36#ifndef _HAVE_FL_UTF8_HDR_
37#define _HAVE_FL_UTF8_HDR_
47# include <sys/types.h>
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__)
71# include <sys/types.h>
74# include <X11/Xlocale.h>
77# define xchar unsigned short
108FL_EXPORT
unsigned fl_utf8decode(
const char* p,
const char* end,
int* len);
114FL_EXPORT
const char*
fl_utf8fwd(
const char* p,
const char* start,
const char* end);
117FL_EXPORT
const char*
fl_utf8back(
const char* p,
const char* start,
const char* end);
120FL_EXPORT
unsigned fl_ucs_to_Utf16(
const unsigned ucs,
unsigned short *dst,
const unsigned dstlen);
123FL_EXPORT
unsigned fl_utf8toUtf16(
const char* src,
unsigned srclen,
unsigned short* dst,
unsigned dstlen);
126FL_EXPORT
unsigned fl_utf8towc(
const char *src,
unsigned srclen,
wchar_t *dst,
unsigned dstlen);
129FL_EXPORT
unsigned fl_utf8fromwc(
char *dst,
unsigned dstlen,
const wchar_t *src,
unsigned srclen);
132FL_EXPORT
unsigned fl_utf8toa (
const char *src,
unsigned srclen,
char *dst,
unsigned dstlen);
137FL_EXPORT
unsigned fl_utf8froma (
char *dst,
unsigned dstlen,
const char *src,
unsigned srclen);
147FL_EXPORT
int fl_utf8test(
const char *src,
unsigned len);
162FL_EXPORT
unsigned fl_utf8to_mb(
const char *src,
unsigned srclen,
char *dst,
unsigned dstlen);
167FL_EXPORT
unsigned fl_utf8from_mb(
char *dst,
unsigned dstlen,
const char *src,
unsigned srclen);
174FL_EXPORT
char *fl_utf8_to_locale(
const char *s,
int len,
unsigned int codepage);
177FL_EXPORT
char *fl_locale_to_utf8(
const char *s,
int len,
unsigned int codepage);
198FL_EXPORT
int fl_utf_tolower(
const unsigned char *str,
int len,
char *buf);
201FL_EXPORT
int fl_utf_toupper(
const unsigned char *str,
int len,
char *buf);
204FL_EXPORT
int fl_chmod(
const char* f,
int mode);
207FL_EXPORT
int fl_access(
const char* f,
int mode);
210FL_EXPORT
int fl_stat(
const char *path,
struct stat *buffer );
213FL_EXPORT
char* fl_getcwd(
char *buf,
int maxlen);
216FL_EXPORT FILE *fl_fopen(
const char *f,
const char *mode);
219FL_EXPORT
int fl_system(
const char* f);
222FL_EXPORT
int fl_execvp(
const char *file,
char *
const *argv);
225FL_EXPORT
int fl_open(
const char* f,
int o, ...);
228FL_EXPORT
int fl_unlink(
const char *f);
231FL_EXPORT
int fl_rmdir(
const char *f);
234FL_EXPORT
char* fl_getenv(
const char *name);
237FL_EXPORT
int fl_mkdir(
const char* f,
int mode);
240FL_EXPORT
int fl_rename(
const char* f,
const char *t);
244FL_EXPORT
void fl_make_path_for_file(
const char *path );
247FL_EXPORT
char fl_make_path(
const char *path );
This file contains simple "C"-style type definitions.
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_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 int fl_wcwidth(const char *src)
extended wrapper around fl_wcwidth_(unsigned int ucs) function.
Definition: fl_utf.c:983
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
FL_EXPORT unsigned fl_utf8fromwc(char *dst, unsigned dstlen, const wchar_t *src, unsigned srclen)
Definition: fl_utf.c:620
FL_EXPORT unsigned fl_utf8toUtf16(const char *src, unsigned srclen, unsigned short *dst, unsigned dstlen)
Definition: fl_utf.c:435
FL_EXPORT unsigned fl_utf8to_mb(const char *src, unsigned srclen, char *dst, unsigned dstlen)
Definition: fl_utf.c:787
FL_EXPORT int fl_tolower(unsigned int ucs)
return the Unicode lower case value of ucs
Definition: fl_utf8.cxx:268
FL_EXPORT unsigned int fl_nonspacing(unsigned int ucs)
returns true if the character is non-spacing.
Definition: fl_utf8.cxx:400
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 const char * fl_utf8fwd(const char *p, const char *start, const char *end)
Definition: fl_utf.c:232
FL_EXPORT char * fl_utf2mbcs(const char *src)
converts UTF8 to a local multi-byte character string.
Definition: fl_utf8.cxx:477
FL_EXPORT int fl_utf8test(const char *src, unsigned len)
Definition: fl_utf.c:928
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_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_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 const char * fl_utf8back(const char *p, const char *start, const char *end)
Definition: fl_utf.c:263
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 unsigned fl_utf8decode(const char *p, const char *end, int *len)
Definition: fl_utf.c:140
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_utf8encode(unsigned ucs, char *buf)
Definition: fl_utf.c:312
FL_EXPORT unsigned fl_utf8froma(char *dst, unsigned dstlen, const char *src, unsigned srclen)
Definition: fl_utf.c:708
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_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