00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031 #ifdef fl_dirent_h_cyclic_include
00032 # include "/usr/include/dirent.h"
00033 #endif
00034
00035 #ifndef FL_FILENAME_H
00036 # define FL_FILENAME_H
00037
00038 # include "Fl_Export.H"
00039
00044 # define FL_PATH_MAX 2048
00060 FL_EXPORT const char *fl_filename_name(const char * filename);
00061 FL_EXPORT const char *fl_filename_ext(const char *buf);
00062 FL_EXPORT char *fl_filename_setext(char *to, int tolen, const char *ext);
00063 FL_EXPORT int fl_filename_expand(char *to, int tolen, const char *from);
00064 FL_EXPORT int fl_filename_absolute(char *to, int tolen, const char *from);
00065 FL_EXPORT int fl_filename_relative(char *to, int tolen, const char *from);
00066 FL_EXPORT int fl_filename_match(const char *name, const char *pattern);
00067 FL_EXPORT int fl_filename_isdir(const char *name);
00068
00069 # if defined(__cplusplus) && !defined(FL_DOXYGEN)
00070
00071
00072
00073
00074 inline char *fl_filename_setext(char *to, const char *ext) { return fl_filename_setext(to, FL_PATH_MAX, ext); }
00075 inline int fl_filename_expand(char *to, const char *from) { return fl_filename_expand(to, FL_PATH_MAX, from); }
00076 inline int fl_filename_absolute(char *to, const char *from) { return fl_filename_absolute(to, FL_PATH_MAX, from); }
00077 FL_EXPORT int fl_filename_relative(char *to, int tolen, const char *from, const char *cwd);
00078 inline int fl_filename_relative(char *to, const char *from) { return fl_filename_relative(to, FL_PATH_MAX, from); }
00079 # endif
00080
00081
00082 # if defined(WIN32) && !defined(__CYGWIN__) && !defined(__WATCOMC__)
00083
00084 struct dirent {char d_name[1];};
00085
00086 # elif defined(__WATCOMC__)
00087 # include <sys/types.h>
00088 # include <direct.h>
00089
00090 # else
00091
00092
00093
00094
00095
00096
00097
00098
00099
00100
00101
00102
00103
00104
00105 # include <sys/types.h>
00106 # define fl_dirent_h_cyclic_include
00107 # include <dirent.h>
00108 # undef fl_dirent_h_cyclic_include
00109 # endif
00110
00111 # if defined (__cplusplus)
00112 extern "C" {
00113 # endif
00114
00115 # if !defined(FL_DOXYGEN)
00116 FL_EXPORT int fl_alphasort(struct dirent **, struct dirent **);
00117 FL_EXPORT int fl_casealphasort(struct dirent **, struct dirent **);
00118 FL_EXPORT int fl_casenumericsort(struct dirent **, struct dirent **);
00119 FL_EXPORT int fl_numericsort(struct dirent **, struct dirent **);
00120 # endif
00121
00122 typedef int (Fl_File_Sort_F)(struct dirent **, struct dirent **);
00124 # if defined(__cplusplus)
00125 }
00126
00127
00128
00129
00130
00131 FL_EXPORT int fl_filename_list(const char *d, struct dirent ***l,
00132 Fl_File_Sort_F *s = fl_numericsort);
00133 FL_EXPORT void fl_filename_free_list(struct dirent ***l, int n);
00134
00135
00136
00137
00138
00139
00140 FL_EXPORT int fl_open_uri(const char *uri, char *msg = (char *)0,
00141 int msglen = 0);
00142
00143 # ifndef FL_DOXYGEN
00144
00145
00146
00147
00148
00149
00150
00151 int _fl_filename_isdir_quick(const char *name);
00152 # endif
00153
00154 # endif
00155
00156
00157
00158
00159
00160 # ifdef FLTK_1_0_COMPAT
00161 # define filename_absolute fl_filename_absolute
00162 # define filename_expand fl_filename_expand
00163 # define filename_ext fl_filename_ext
00164 # define filename_isdir fl_filename_isdir
00165 # define filename_list fl_filename_list
00166 # define filename_match fl_filename_match
00167 # define filename_name fl_filename_name
00168 # define filename_relative fl_filename_relative
00169 # define filename_setext fl_filename_setext
00170 # define numericsort fl_numericsort
00171 # endif
00172
00173
00174 #endif
00175
00178
00179
00180