cleaned up source code a little more
This commit is contained in:
@ -154,6 +154,7 @@ qse_fio_t* qse_fio_init (
|
||||
else
|
||||
{
|
||||
int desired_access = 0;
|
||||
|
||||
#ifdef QSE_CHAR_IS_MCHAR
|
||||
const qse_mchar_t* path_mb = path;
|
||||
#else
|
||||
@ -440,3 +441,32 @@ int qse_fio_chmod (qse_fio_t* fio, int mode)
|
||||
return QSE_FCHMOD (fio->handle, mode);
|
||||
#endif
|
||||
}
|
||||
|
||||
int qse_fio_sync (qse_fio_t* fio)
|
||||
{
|
||||
#ifdef _WIN32
|
||||
return (FlushFileBuffers (fio->handle) == FALSE)? -1: 0;
|
||||
#else
|
||||
return QSE_FSYNC (fio->handle);
|
||||
#endif
|
||||
}
|
||||
|
||||
int qse_fio_lock (qse_fio_t* fio, qse_fio_lck_t* lck, int flags)
|
||||
{
|
||||
/* TODO: qse_fio_lock
|
||||
* struct flock fl;
|
||||
* fl.l_type = F_RDLCK, F_WRLCK;
|
||||
* QSE_FCNTL (fio->handle, F_SETLK, &fl);
|
||||
*/
|
||||
return -1;
|
||||
}
|
||||
|
||||
int qse_fio_unlock (qse_fio_t* fio, qse_fio_lck_t* lck, int flags)
|
||||
{
|
||||
/* TODO: qse_fio_unlock
|
||||
* struct flock fl;
|
||||
* fl.l_type = F_UNLCK;
|
||||
* QSE_FCNTL (fio->handle, F_SETLK, &fl);
|
||||
*/
|
||||
return -1;
|
||||
}
|
||||
|
@ -84,6 +84,18 @@
|
||||
#define QSE_FCHMOD(handle,mode) fchmod(handle,mode)
|
||||
#endif
|
||||
|
||||
#if defined(SYS_fsync)
|
||||
#define QSE_FSYNC(handle) syscall(SYS_fsync,handle)
|
||||
#else
|
||||
#define QSE_FSYNC(handle) fsync(handle)
|
||||
#endif
|
||||
|
||||
#if defined(SYS_fcntl)
|
||||
#define QSE_FCNTL(handle,cmd,arg) syscall(SYS_fcntl,handle,cmd,arg)
|
||||
#else
|
||||
#define QSE_FCNTL(handle,cmd,arg) fcntl(handle,cmd,arg)
|
||||
#endif
|
||||
|
||||
#ifdef SYS_dup2
|
||||
#define QSE_DUP2(ofd,nfd) syscall(SYS_dup2,ofd,nfd)
|
||||
#else
|
||||
|
Reference in New Issue
Block a user