36 #ifndef _HAVE_FL_UTF8_HDR_
37 #define _HAVE_FL_UTF8_HDR_
39 #include "Fl_Export.H"
47 # include <sys/types.h>
48 # include <sys/stat.h>
51 # define xchar wchar_t
52 # if !defined(FL_DLL) && !defined(__CYGWIN__)
54 # define strdup _strdup
56 # define putenv _putenv
58 # define stricmp _stricmp
60 # define strnicmp _strnicmp
66 #elif defined(__APPLE__)
68 # include <sys/stat.h>
69 # define xchar wchar_t
71 # include <sys/types.h>
72 # include <sys/stat.h>
74 # include <X11/Xlocale.h>
75 # include <X11/Xlib.h>
77 # define xchar unsigned short
108 FL_EXPORT
unsigned fl_utf8decode(
const char* p,
const char* end,
int* len);
114 FL_EXPORT
const char*
fl_utf8fwd(
const char* p,
const char* start,
const char* end);
117 FL_EXPORT
const char*
fl_utf8back(
const char* p,
const char* start,
const char* end);
120 FL_EXPORT
unsigned fl_ucs_to_Utf16(
const unsigned ucs,
unsigned short *dst,
const unsigned dstlen);
123 FL_EXPORT
unsigned fl_utf8toUtf16(
const char* src,
unsigned srclen,
unsigned short* dst,
unsigned dstlen);
126 FL_EXPORT
unsigned fl_utf8towc(
const char *src,
unsigned srclen,
wchar_t *dst,
unsigned dstlen);
129 FL_EXPORT
unsigned fl_utf8fromwc(
char *dst,
unsigned dstlen,
const wchar_t *src,
unsigned srclen);
132 FL_EXPORT
unsigned fl_utf8toa (
const char *src,
unsigned srclen,
char *dst,
unsigned dstlen);
137 FL_EXPORT
unsigned fl_utf8froma (
char *dst,
unsigned dstlen,
const char *src,
unsigned srclen);
147 FL_EXPORT
int fl_utf8test(
const char *src,
unsigned len);
162 FL_EXPORT
unsigned fl_utf8to_mb(
const char *src,
unsigned srclen,
char *dst,
unsigned dstlen);
167 FL_EXPORT
unsigned fl_utf8from_mb(
char *dst,
unsigned dstlen,
const char *src,
unsigned srclen);
174 FL_EXPORT
char *fl_utf8_to_locale(
const char *s,
int len,
unsigned int codepage);
177 FL_EXPORT
char *fl_locale_to_utf8(
const char *s,
int len,
unsigned int codepage);
198 FL_EXPORT
int fl_utf_tolower(
const unsigned char *str,
int len,
char *buf);
201 FL_EXPORT
int fl_utf_toupper(
const unsigned char *str,
int len,
char *buf);
204 FL_EXPORT
int fl_chmod(
const char* f,
int mode);
207 FL_EXPORT
int fl_access(
const char* f,
int mode);
210 FL_EXPORT
int fl_stat(
const char *path,
struct stat *buffer );
213 FL_EXPORT
char* fl_getcwd(
char *buf,
int maxlen);
216 FL_EXPORT FILE *fl_fopen(
const char *f,
const char *mode);
219 FL_EXPORT
int fl_system(
const char* f);
222 FL_EXPORT
int fl_execvp(
const char *file,
char *
const *argv);
225 FL_EXPORT
int fl_open(
const char* f,
int o, ...);
228 FL_EXPORT
int fl_unlink(
const char *f);
231 FL_EXPORT
int fl_rmdir(
const char *f);
234 FL_EXPORT
char* fl_getenv(
const char *name);
237 FL_EXPORT
int fl_mkdir(
const char* f,
int mode);
240 FL_EXPORT
int fl_rename(
const char* f,
const char *t);
244 FL_EXPORT
void fl_make_path_for_file(
const char *path );
247 FL_EXPORT
char fl_make_path(
const char *path );
FL_EXPORT int fl_utf8test(const char *src, unsigned len)
Definition: fl_utf.c:928
FL_EXPORT int fl_wcwidth(const char *src)
extended wrapper around fl_wcwidth_(unsigned int ucs) function.
Definition: fl_utf.c:983
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:120
FL_EXPORT unsigned fl_utf8to_mb(const char *src, unsigned srclen, char *dst, unsigned dstlen)
Definition: fl_utf.c:787
FL_EXPORT unsigned fl_utf8toUtf16(const char *src, unsigned srclen, unsigned short *dst, unsigned dstlen)
Definition: fl_utf.c:435
FL_EXPORT unsigned int fl_nonspacing(unsigned int ucs)
returns true if the character is non-spacing.
Definition: fl_utf8.cxx:400
FL_EXPORT unsigned fl_utf8fromwc(char *dst, unsigned dstlen, const wchar_t *src, unsigned srclen)
Definition: fl_utf.c:620
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:285
FL_EXPORT int fl_utf8locale()
Definition: fl_utf.c:754
FL_EXPORT int fl_wcwidth_(unsigned int ucs)
wrapper to adapt Markus Kuhn's implementation of wcwidth() for FLTK
Definition: fl_utf.c:966
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:503
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:175
FL_EXPORT unsigned fl_utf8toa(const char *src, unsigned srclen, char *dst, unsigned dstlen)
Definition: fl_utf.c:559
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:202
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:282
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:149
FL_EXPORT int fl_toupper(unsigned int ucs)
return the Unicode upper case value of ucs
Definition: fl_utf8.cxx:276
FL_EXPORT unsigned fl_utf8froma(char *dst, unsigned dstlen, const char *src, unsigned srclen)
Definition: fl_utf.c:708
FL_EXPORT const char * fl_utf8back(const char *p, const char *start, const char *end)
Definition: fl_utf.c:263
FL_EXPORT const char * fl_utf8fwd(const char *p, const char *start, const char *end)
Definition: fl_utf.c:232
FL_EXPORT unsigned fl_utf8decode(const char *p, const char *end, int *len)
Definition: fl_utf.c:140
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:252
FL_EXPORT char * fl_utf2mbcs(const char *src)
converts UTF8 to a local multi-byte character string.
Definition: fl_utf8.cxx:477
This file contains simple "C"-style type definitions.
FL_EXPORT int fl_utf8encode(unsigned ucs, char *buf)
Definition: fl_utf.c:312
FL_EXPORT int fl_tolower(unsigned int ucs)
return the Unicode lower case value of ucs
Definition: fl_utf8.cxx:268
FL_EXPORT unsigned fl_ucs_to_Utf16(const unsigned ucs, unsigned short *dst, const unsigned dstlen)
Definition: fl_utf.c:366
FL_EXPORT unsigned fl_utf8from_mb(char *dst, unsigned dstlen, const char *src, unsigned srclen)
Definition: fl_utf.c:861
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:316