00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00028 #ifndef _HAVE_FL_UTF8_HDR_
00029 #define _HAVE_FL_UTF8_HDR_
00030
00031 #include "Fl_Export.H"
00032 #include "fl_types.h"
00033
00034 #include <stdio.h>
00035 #include <string.h>
00036 #include <stdlib.h>
00037
00038 #ifdef WIN32
00039 # include <sys/types.h>
00040 # include <sys/stat.h>
00041 # include <locale.h>
00042 # include <ctype.h>
00043 # define xchar wchar_t
00044 # if !defined(FL_DLL) && !defined(__CYGWIN__)
00045 # undef strdup
00046 # define strdup _strdup
00047 # undef putenv
00048 # define putenv _putenv
00049 # undef stricmp
00050 # define stricmp _stricmp
00051 # undef strnicmp
00052 # define strnicmp _strnicmp
00053 # undef chdir
00054 # define chdir _chdir
00055 # endif
00056 #elif defined(__APPLE__)
00057 # include <wchar.h>
00058 # include <sys/stat.h>
00059 # define xchar wchar_t
00060 #else
00061 # include <sys/types.h>
00062 # include <sys/stat.h>
00063 # if defined(FL_LIBRARY)
00064 # include <X11/Xlocale.h>
00065 # include <X11/Xlib.h>
00066 # endif
00067 # include <locale.h>
00068 # define xchar unsigned short
00069 #endif
00070
00071 #ifdef __cplusplus
00072 extern "C" {
00073 #endif
00074
00079
00080
00081
00087 FL_EXPORT int fl_utf8bytes(unsigned ucs);
00088
00089
00090 FL_EXPORT int fl_utf8len(char c);
00091
00092
00093 FL_EXPORT int fl_utf8len1(char c);
00094
00095
00096 FL_EXPORT int fl_utf_nb_char(const unsigned char *buf, int len);
00097
00098
00099 FL_EXPORT unsigned fl_utf8decode(const char* p, const char* end, int* len);
00100
00101
00102 FL_EXPORT int fl_utf8encode(unsigned ucs, char* buf);
00103
00104
00105 FL_EXPORT const char* fl_utf8fwd(const char* p, const char* start, const char* end);
00106
00107
00108 FL_EXPORT const char* fl_utf8back(const char* p, const char* start, const char* end);
00109
00110
00111 FL_EXPORT unsigned fl_ucs_to_Utf16(const unsigned ucs, unsigned short *dst, const unsigned dstlen);
00112
00113
00114 FL_EXPORT unsigned fl_utf8toUtf16(const char* src, unsigned srclen, unsigned short* dst, unsigned dstlen);
00115
00116
00117 FL_EXPORT unsigned fl_utf8towc(const char *src, unsigned srclen, wchar_t *dst, unsigned dstlen);
00118
00119
00120 FL_EXPORT unsigned fl_utf8fromwc(char *dst, unsigned dstlen, const wchar_t *src, unsigned srclen);
00121
00122
00123 FL_EXPORT unsigned fl_utf8toa (const char *src, unsigned srclen, char *dst, unsigned dstlen);
00124
00125
00126 FL_EXPORT unsigned fl_utf8froma (char *dst, unsigned dstlen, const char *src, unsigned srclen);
00127
00128
00129 FL_EXPORT int fl_utf8locale(void);
00130
00131
00132
00133
00134 FL_EXPORT int fl_utf8test(const char *src, unsigned len);
00135
00136
00137
00138 FL_EXPORT int fl_wcwidth_(unsigned int ucs);
00139
00140
00141
00142
00143 FL_EXPORT int fl_wcwidth(const char *src);
00144
00145
00146 FL_EXPORT unsigned int fl_nonspacing(unsigned int ucs);
00147
00148
00149 FL_EXPORT unsigned fl_utf8to_mb(const char *src, unsigned srclen, char *dst, unsigned dstlen);
00150
00151 FL_EXPORT char* fl_utf2mbcs(const char *src);
00152
00153
00154 FL_EXPORT unsigned fl_utf8from_mb(char *dst, unsigned dstlen, const char *src, unsigned srclen);
00155
00156
00157 #ifdef WIN32
00158
00159 FL_EXPORT char *fl_utf8_to_locale(const char *s, int len, unsigned int codepage);
00160
00161
00162 FL_EXPORT char *fl_locale_to_utf8(const char *s, int len, unsigned int codepage);
00163 #endif
00164
00165
00166
00167
00168
00169
00170
00171 FL_EXPORT int fl_utf_strncasecmp(const char *s1, const char *s2, int n);
00172
00173
00174 FL_EXPORT int fl_utf_strcasecmp(const char *s1, const char *s2);
00175
00176
00177 FL_EXPORT int fl_tolower(unsigned int ucs);
00178
00179
00180 FL_EXPORT int fl_toupper(unsigned int ucs);
00181
00182
00183 FL_EXPORT int fl_utf_tolower(const unsigned char *str, int len, char *buf);
00184
00185
00186 FL_EXPORT int fl_utf_toupper(const unsigned char *str, int len, char *buf);
00187
00188
00189 FL_EXPORT int fl_chmod(const char* f, int mode);
00190
00191
00192 FL_EXPORT int fl_access(const char* f, int mode);
00193
00194
00195 FL_EXPORT int fl_stat( const char *path, struct stat *buffer );
00196
00197
00198 FL_EXPORT char* fl_getcwd( char *buf, int maxlen);
00199
00200
00201 FL_EXPORT FILE *fl_fopen(const char *f, const char *mode);
00202
00203
00204 FL_EXPORT int fl_system(const char* f);
00205
00206
00207 FL_EXPORT int fl_execvp(const char *file, char *const *argv);
00208
00209
00210 FL_EXPORT int fl_open(const char* f, int o, ...);
00211
00212
00213 FL_EXPORT int fl_unlink(const char *f);
00214
00215
00216 FL_EXPORT int fl_rmdir(const char *f);
00217
00218
00219 FL_EXPORT char* fl_getenv(const char *name);
00220
00221
00222 FL_EXPORT int fl_mkdir(const char* f, int mode);
00223
00224
00225 FL_EXPORT int fl_rename(const char* f, const char *t);
00226
00227
00228
00229 FL_EXPORT void fl_make_path_for_file( const char *path );
00230
00231
00232 FL_EXPORT char fl_make_path( const char *path );
00233
00234
00237
00238
00239 #ifdef __cplusplus
00240 }
00241 #endif
00242
00243
00244 #endif
00245
00246
00247
00248