11 #ifndef __FILE_UTIL_H__ 12 #define __FILE_UTIL_H__ 14 #include "ws_symbol_export.h" 35 #ifdef HAVE_SYS_STAT_H 46 #define S_ISREG(mode) (((mode) & S_IFMT) == S_IFREG) 49 #define S_IFIFO _S_IFIFO 52 #define S_ISFIFO(mode) (((mode) & S_IFMT) == S_IFIFO) 55 #define S_ISDIR(mode) (((mode) & S_IFMT) == S_IFDIR) 65 #define ws_statb64 struct _stat64 82 WS_DLL_PUBLIC
int ws_stdio_open (
const gchar *filename,
int flags,
int mode);
83 WS_DLL_PUBLIC
int ws_stdio_rename (
const gchar *oldfilename,
const gchar *newfilename);
84 WS_DLL_PUBLIC
int ws_stdio_mkdir (
const gchar *filename,
int mode);
85 WS_DLL_PUBLIC
int ws_stdio_stat64 (
const gchar *filename, ws_statb64 *buf);
86 WS_DLL_PUBLIC
int ws_stdio_unlink (
const gchar *filename);
87 WS_DLL_PUBLIC
int ws_stdio_remove (
const gchar *filename);
89 WS_DLL_PUBLIC FILE * ws_stdio_fopen (
const gchar *filename,
const gchar *mode);
90 WS_DLL_PUBLIC FILE * ws_stdio_freopen (
const gchar *filename,
const gchar *mode, FILE *
stream);
92 #define ws_open ws_stdio_open 93 #define ws_rename ws_stdio_rename 94 #define ws_mkdir ws_stdio_mkdir 95 #define ws_stat64 ws_stdio_stat64 96 #define ws_unlink ws_stdio_unlink 97 #define ws_remove ws_stdio_remove 98 #define ws_fopen ws_stdio_fopen 99 #define ws_freopen ws_stdio_freopen 105 #define ws_read _read 106 #define ws_write _write 107 #define ws_close _close 109 #define ws_fstat64 _fstati64 110 #define ws_lseek64 _lseeki64 111 #define ws_fdopen _fdopen 112 #define ws_fileno _fileno 113 #define ws_isatty _isatty 114 #define ws_getc_unlocked _fgetc_nolock 120 #define ws_getpid _getpid 121 #define ws_umask _umask 131 gboolean ws_init_dll_search_path();
141 void *ws_load_library(
const gchar *library_name);
151 GModule *ws_module_open(gchar *module_name, GModuleFlags flags);
157 WS_DLL_PUBLIC
void create_app_running_mutex();
161 WS_DLL_PUBLIC
void close_app_running_mutex();
168 #define ws_statb64 struct stat 172 #define ws_rename rename 173 #define ws_mkdir(dir,mode) mkdir(dir,mode) 174 #define ws_stat64 stat 175 #define ws_unlink unlink 176 #define ws_remove remove 177 #define ws_fopen fopen 178 #define ws_freopen freopen 181 #define ws_write write 186 #define ws_close ::close 188 #define ws_close close 191 #define ws_fstat64 fstat 192 #define ws_lseek64 lseek 193 #define ws_fdopen fdopen 194 #define ws_fileno fileno 195 #define ws_isatty isatty 196 #define ws_getc_unlocked getc_unlocked 200 #define ws_getpid getpid 201 #define ws_umask umask 207 #define WS_DIRENT const char 208 #define ws_dir_open g_dir_open 209 #define ws_dir_read_name g_dir_read_name 210 #define ws_dir_get_name(dirent) dirent 211 #define ws_dir_rewind g_dir_rewind 212 #define ws_dir_close g_dir_close