00001
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031 #ifndef FILE_FUNCTIONS_H_
00032 #define FILE_FUNCTIONS_H_
00033 #include <string.h>
00034 #include <stdbool.h>
00035 #include <limits.h>
00036 #include <glib.h>
00037 #include "str_functions.h"
00038
00045 #ifdef WIN32
00046 #define DIRECTORY_SEPARATOR '\\'
00047 #else
00048 #define DIRECTORY_SEPARATOR '/'
00049 #endif
00050
00057 typedef enum{
00058 TASK_RUNNING,
00059 TASK_CANCELED,
00060 TASK_FAILED,
00061 TASK_COMPLETED
00062 } TaskStatus;
00063
00064
00071 #ifdef WIN32
00072 #define PATH_SEPARATOR ';'
00073 #else
00074 #define PATH_SEPARATOR ':'
00075 #endif
00076
00077
00088 gchar*
00089 truepath(const gchar *path, gchar *resolved_path);
00090
00097 gboolean
00098 isReadable(const gchar *filename);
00099
00100
00109 gboolean
00110 isWritable(const gchar *filename);
00111
00123 #define FILE_MODE_EXIST 1<<4
00124 #define FILE_MODE_DIRECTORY 1<<3
00125 #define FILE_MODE_READ 1<<2
00126 #define FILE_MODE_WRITE 1<<1
00127 #define FILE_MODE_EXECUTE 1
00128
00147 gboolean filename_meets_accessMode(const gchar *filename, guint access_mode_mask);
00148
00159 gchar*
00160 filename_search_paths(const gchar *filename,const gchar* search_paths);
00161
00181 gchar*
00182 filename_search_paths_mode(const gchar *filename,const gchar* search_paths,guint access_mode_mask);
00183
00219 typedef TaskStatus (* ChooseFilenameFunc) (gchar *filename_buf, guint filename_len, StringList *extensions, guint access_mode_mask, const gchar * prompt, gpointer option);
00220
00248 gchar *filename_choose
00249 (const gchar *filename_default, guint filename_len, StringList *extensions,
00250 guint access_mode_mask, const gchar * prompt, gpointer option, ChooseFilenameFunc callback);
00251
00252
00253
00254 #endif
00255