27 #ifndef _HAVE_FL_UTF8_HDR_
28 #define _HAVE_FL_UTF8_HDR_
30 #include "Fl_Export.H"
38 # include <sys/types.h>
39 # include <sys/stat.h>
42 # define xchar wchar_t
43 # if !defined(FL_DLL) && !defined(__CYGWIN__)
45 # define strdup _strdup
47 # define putenv _putenv
49 # define stricmp _stricmp
51 # define strnicmp _strnicmp
57 #elif defined(__APPLE__)
59 # include <sys/stat.h>
60 # define xchar wchar_t
62 # include <sys/types.h>
63 # include <sys/stat.h>
65 # include <X11/Xlocale.h>
66 # include <X11/Xlib.h>
68 # define xchar unsigned short
99 FL_EXPORT
unsigned fl_utf8decode(
const char* p,
const char* end,
int* len);
105 FL_EXPORT
const char*
fl_utf8fwd(
const char* p,
const char* start,
const char* end);
108 FL_EXPORT
const char*
fl_utf8back(
const char* p,
const char* start,
const char* end);
111 FL_EXPORT
unsigned fl_ucs_to_Utf16(
const unsigned ucs,
unsigned short *dst,
const unsigned dstlen);
114 FL_EXPORT
unsigned fl_utf8toUtf16(
const char* src,
unsigned srclen,
unsigned short* dst,
unsigned dstlen);
117 FL_EXPORT
unsigned fl_utf8towc(
const char *src,
unsigned srclen,
wchar_t *dst,
unsigned dstlen);
120 FL_EXPORT
unsigned fl_utf8fromwc(
char *dst,
unsigned dstlen,
const wchar_t *src,
unsigned srclen);
123 FL_EXPORT
unsigned fl_utf8toa (
const char *src,
unsigned srclen,
char *dst,
unsigned dstlen);
128 FL_EXPORT
unsigned fl_utf8froma (
char *dst,
unsigned dstlen,
const char *src,
unsigned srclen);
138 FL_EXPORT
int fl_utf8test(
const char *src,
unsigned len);
153 FL_EXPORT
unsigned fl_utf8to_mb(
const char *src,
unsigned srclen,
char *dst,
unsigned dstlen);
158 FL_EXPORT
unsigned fl_utf8from_mb(
char *dst,
unsigned dstlen,
const char *src,
unsigned srclen);
165 FL_EXPORT
char *fl_utf8_to_locale(
const char *s,
int len,
unsigned int codepage);
168 FL_EXPORT
char *fl_locale_to_utf8(
const char *s,
int len,
unsigned int codepage);
189 FL_EXPORT
int fl_utf_tolower(
const unsigned char *str,
int len,
char *buf);
192 FL_EXPORT
int fl_utf_toupper(
const unsigned char *str,
int len,
char *buf);
195 FL_EXPORT
int fl_chmod(
const char* f,
int mode);
198 FL_EXPORT
int fl_access(
const char* f,
int mode);
201 FL_EXPORT
int fl_stat(
const char *path,
struct stat *buffer );
204 FL_EXPORT
char* fl_getcwd(
char *buf,
int maxlen);
207 FL_EXPORT FILE *
fl_fopen(
const char *f,
const char *mode);
210 FL_EXPORT
int fl_system(
const char* f);
213 FL_EXPORT
int fl_execvp(
const char *file,
char *
const *argv);
216 FL_EXPORT
int fl_open(
const char* f,
int o, ...);
219 FL_EXPORT
int fl_unlink(
const char *f);
222 FL_EXPORT
int fl_rmdir(
const char *f);
225 FL_EXPORT
char* fl_getenv(
const char *name);
228 FL_EXPORT
int fl_mkdir(
const char* f,
int mode);
231 FL_EXPORT
int fl_rename(
const char* f,
const char *t);
235 FL_EXPORT
void fl_make_path_for_file(
const char *path );
238 FL_EXPORT
char fl_make_path(
const char *path );
FL_EXPORT int fl_utf8test(const char *src, unsigned len)
Definition: fl_utf.c:919
FL_EXPORT int fl_wcwidth(const char *src)
extended wrapper around fl_wcwidth_(unsigned int ucs) function.
Definition: fl_utf.c:974
FL_EXPORT int fl_utf8len(char c)
return the byte length of the UTF-8 sequence with first byte c, or -1 if c is not valid...
Definition: fl_utf8.cxx:114
FL_EXPORT unsigned fl_utf8to_mb(const char *src, unsigned srclen, char *dst, unsigned dstlen)
Definition: fl_utf.c:778
FL_EXPORT unsigned fl_utf8toUtf16(const char *src, unsigned srclen, unsigned short *dst, unsigned dstlen)
Definition: fl_utf.c:426
FL_EXPORT FILE * fl_fopen(const char *f, const char *mode)
Cross-platform function to open files with a UTF-8 encoded name.
Definition: fl_utf8.cxx:562
FL_EXPORT unsigned int fl_nonspacing(unsigned int ucs)
returns true if the character is non-spacing.
Definition: fl_utf8.cxx:361
FL_EXPORT unsigned fl_utf8fromwc(char *dst, unsigned dstlen, const wchar_t *src, unsigned srclen)
Definition: fl_utf.c:611
FL_EXPORT int fl_utf_tolower(const unsigned char *str, int len, char *buf)
converts the str string to the lower case equivalent into buf.
Definition: fl_utf8.cxx:246
FL_EXPORT int fl_utf8locale()
Definition: fl_utf.c:745
FL_EXPORT int fl_wcwidth_(unsigned int ucs)
wrapper to adapt Markus Kuhn's implementation of wcwidth() for FLTK
Definition: fl_utf.c:957
FL_EXPORT unsigned fl_utf8towc(const char *src, unsigned srclen, wchar_t *dst, unsigned dstlen)
Converts a UTF-8 string into a wide character string.
Definition: fl_utf.c:494
FL_EXPORT int fl_utf_nb_char(const unsigned char *buf, int len)
returns the number of Unicode chars in the UTF-8 string
Definition: fl_utf8.cxx:169
FL_EXPORT int fl_open(const char *f, int o,...)
Cross-platform function to open files with a UTF-8 encoded name.
Definition: fl_utf8.cxx:530
FL_EXPORT unsigned fl_utf8toa(const char *src, unsigned srclen, char *dst, unsigned dstlen)
Definition: fl_utf.c:550
FL_EXPORT int fl_utf_strncasecmp(const char *s1, const char *s2, int n)
UTF-8 aware strncasecmp - converts to lower case Unicode and tests.
Definition: fl_utf8.cxx:194
FL_EXPORT int fl_utf8bytes(unsigned ucs)
Return the number of bytes needed to encode the given UCS4 character in UTF8.
Definition: fl_utf.c:273
FL_EXPORT int fl_utf8len1(char c)
Return the byte length of the UTF-8 sequence with first byte c, or 1 if c is not valid.
Definition: fl_utf8.cxx:143
FL_EXPORT int fl_toupper(unsigned int ucs)
return the Unicode upper case value of ucs
Definition: fl_utf8.cxx:237
FL_EXPORT unsigned fl_utf8froma(char *dst, unsigned dstlen, const char *src, unsigned srclen)
Definition: fl_utf.c:699
FL_EXPORT const char * fl_utf8back(const char *p, const char *start, const char *end)
Definition: fl_utf.c:254
FL_EXPORT const char * fl_utf8fwd(const char *p, const char *start, const char *end)
Definition: fl_utf.c:223
FL_EXPORT unsigned fl_utf8decode(const char *p, const char *end, int *len)
Definition: fl_utf.c:131
FL_EXPORT int fl_utf_strcasecmp(const char *s1, const char *s2)
UTF-8 aware strcasecmp - converts to Unicode and tests.
Definition: fl_utf8.cxx:221
FL_EXPORT char * fl_utf2mbcs(const char *src)
converts UTF8 to a local multi-byte character string.
Definition: fl_utf8.cxx:438
This file contains simple "C"-style type definitions.
FL_EXPORT int fl_utf8encode(unsigned ucs, char *buf)
Definition: fl_utf.c:303
FL_EXPORT int fl_tolower(unsigned int ucs)
return the Unicode lower case value of ucs
Definition: fl_utf8.cxx:229
FL_EXPORT unsigned fl_ucs_to_Utf16(const unsigned ucs, unsigned short *dst, const unsigned dstlen)
Definition: fl_utf.c:357
FL_EXPORT unsigned fl_utf8from_mb(char *dst, unsigned dstlen, const char *src, unsigned srclen)
Definition: fl_utf.c:852
FL_EXPORT int fl_utf_toupper(const unsigned char *str, int len, char *buf)
converts the str string to the upper case equivalent into buf.
Definition: fl_utf8.cxx:277