fltk  1.3.5-source
About: FLTK (Fast Light Tool Kit) is a cross-platform C++ GUI toolkit for UNIX/Linux (X11), Microsoft Windows, and MacOS X.
  Fossies Dox: fltk-1.3.5-source.tar.bz2  ("inofficial" and yet experimental doxygen-generated source code documentation)  

fl_utf8.cxx
Go to the documentation of this file.
1 //
2 // "$Id$"
3 //
4 // Unicode to UTF-8 conversion functions.
5 //
6 // Author: Jean-Marc Lienher ( http://oksid.ch )
7 // Copyright 2000-2010 by O'ksi'D.
8 //
9 // This library is free software. Distribution and use rights are outlined in
10 // the file "COPYING" which should have been included with this file. If this
11 // file is missing or damaged, see the license at:
12 //
13 // http://www.fltk.org/COPYING.php
14 //
15 // Please report all bugs and problems on the following page:
16 //
17 // http://www.fltk.org/str.php
18 //
19 
20 #include <config.h>
21 #include <FL/filename.H>
22 #include <stdarg.h>
23 
24 #if defined(WIN32) || defined(__CYGWIN__)
25 # include <ctype.h>
26 # include <io.h>
27 # include <windows.h>
28 # include <winbase.h>
29 # include <process.h>
30 # ifdef __CYGWIN__
31 # include <wchar.h>
32 # include <sys/types.h>
33 # include <sys/stat.h>
34 # include <fcntl.h>
35 # include <unistd.h>
36 # else
37 # include <direct.h>
38 # endif
39 extern "C" {
40  int XUtf8Tolower(int ucs);
41  unsigned short XUtf8IsNonSpacing(unsigned int ucs);
42 };
43 #elif defined(__APPLE__)
44 # include <stdio.h>
45 # include <time.h>
46 //# include <unix.h>
47 # include <fcntl.h>
48 # include <unistd.h>
49 # include <wchar.h>
50 # include <stdlib.h>
51 # include <sys/types.h>
52 # include <sys/stat.h>
53 
54 extern "C" {
55  int XUtf8Tolower(int ucs);
56  unsigned short XUtf8IsNonSpacing(unsigned int ucs);
57 }
58 
59 #else // X-windows platform
60 
61 # include "Xutf8.h"
62 # include <sys/types.h>
63 # include <sys/stat.h>
64 # include <fcntl.h>
65 # include <unistd.h>
66 #endif // WIN32
67 
68 #include <FL/fl_utf8.h>
69 #include <string.h>
70 #include <stdlib.h>
71 
72 #undef fl_open
73 
78 // *** NOTE : All functions are LIMITED to 24 bits Unicode values !!! ***
79 // *** But only 16 bits are really used under Linux and win32 ***
80 
81 
82 #define NBC 0xFFFF + 1
83 
84 static int Toupper(int ucs) {
85  long i;
86  static unsigned short *table = NULL;
87 
88  if (!table) {
89  table = (unsigned short*) malloc(
90  sizeof(unsigned short) * (NBC));
91  for (i = 0; i < NBC; i++) {
92  table[i] = (unsigned short) i;
93  }
94  for (i = 0; i < NBC; i++) {
95  int l;
96  l = XUtf8Tolower(i);
97  if (l != i) table[l] = (unsigned short) i;
98  }
99  }
100  if (ucs >= NBC || ucs < 0) return ucs;
101  return table[ucs];
102 }
103 
111 int fl_utf8len(char c)
112 {
113  if (!(c & 0x80)) return 1;
114  if (c & 0x40) {
115  if (c & 0x20) {
116  if (c & 0x10) {
117  if (c & 0x08) {
118  if (c & 0x04) {
119  return 6;
120  }
121  return 5;
122  }
123  return 4;
124  }
125  return 3;
126  }
127  return 2;
128  }
129  return -1;
130 } // fl_utf8len
131 
132 
141 int fl_utf8len1(char c)
142 {
143  if (!(c & 0x80)) return 1;
144  if (c & 0x40) {
145  if (c & 0x20) {
146  if (c & 0x10) {
147  if (c & 0x08) {
148  if (c & 0x04) {
149  return 6;
150  }
151  return 5;
152  }
153  return 4;
154  }
155  return 3;
156  }
157  return 2;
158  }
159  return 1;
160 } // fl_utf8len1
161 
162 
166 int
168  const unsigned char *buf,
169  int len)
170 {
171  int i = 0;
172  int nbc = 0;
173  while (i < len) {
174  int cl = fl_utf8len((buf+i)[0]);
175  if (cl < 1) cl = 1;
176  nbc++;
177  i += cl;
178  }
179  return nbc;
180 }
181 
182 
193 int fl_utf_strncasecmp(const char *s1, const char *s2, int n)
194 {
195  int i;
196  for (i = 0; i < n; i++) {
197  int l1, l2;
198  unsigned int u1, u2;
199 
200  if (*s1==0 && *s2==0) return 0; // all compared equal, return 0
201 
202  u1 = fl_utf8decode(s1, 0, &l1);
203  u2 = fl_utf8decode(s2, 0, &l2);
204  int res = XUtf8Tolower(u1) - XUtf8Tolower(u2);
205  if (res) return res;
206  s1 += l1;
207  s2 += l2;
208  }
209  return 0;
210 }
211 
212 
221 int fl_utf_strcasecmp(const char *s1, const char *s2)
222 {
223  return fl_utf_strncasecmp(s1, s2, 0x7fffffff);
224 }
225 
229 int fl_tolower(unsigned int ucs)
230 {
231  return XUtf8Tolower(ucs);
232 }
233 
237 int fl_toupper(unsigned int ucs)
238 {
239  return Toupper(ucs);
240 }
241 
246 int fl_utf_tolower(const unsigned char *str, int len, char *buf)
247 {
248  int i;
249  int l = 0;
250  char *end = (char *)&str[len];
251  for (i = 0; i < len;) {
252  int l1, l2;
253  unsigned int u1;
254 
255  u1 = fl_utf8decode((const char*)(str + i), end, &l1);
256  l2 = fl_utf8encode((unsigned int) XUtf8Tolower(u1), buf + l);
257  if (l1 < 1) {
258  i += 1;
259  } else {
260  i += l1;
261  }
262  if (l2 < 1) {
263  l += 1;
264  } else {
265  l += l2;
266  }
267  }
268  return l;
269 }
270 
275 int fl_utf_toupper(const unsigned char *str, int len, char *buf)
276 {
277  int i;
278  int l = 0;
279  char *end = (char *)&str[len];
280  for (i = 0; i < len;) {
281  int l1, l2;
282  unsigned int u1;
283 
284  u1 = fl_utf8decode((const char*)(str + i), end, &l1);
285  l2 = fl_utf8encode((unsigned int) Toupper(u1), buf + l);
286  if (l1 < 1) {
287  i += 1;
288  } else {
289  i += l1;
290  }
291  if (l2 < 1) {
292  l += 1;
293  } else {
294  l += l2;
295  }
296  }
297  return l;
298 }
299 
300 
313 unsigned int fl_nonspacing(unsigned int ucs)
314 {
315  return (unsigned int) XUtf8IsNonSpacing(ucs);
316 }
317 
318 #ifdef WIN32
319 unsigned int fl_codepage = 0;
320 #endif
321 
322 #if defined (WIN32) && !defined(__CYGWIN__)
323 
324 // For Win32 platforms, we frequently need to translate between
325 // Windows 16-bit wide characters (usually UTF-16) and our
326 // native UTF-8 strings. To this end, we maintain a number of
327 // character buffers to support the conversions.
328 // NOTE: Our re-use of these buffers means this code is not
329 // going to be thread-safe.
330 static xchar *mbwbuf = NULL;
331 static xchar *wbuf = NULL;
332 static xchar *wbuf1 = NULL;
333 static char *buf = NULL;
334 static int buf_len = 0;
335 static unsigned short *wbufa = NULL;
336 
337 // FIXME: This should *maybe* return 'const char *' instead of 'char *'
338 char *fl_utf8_to_locale(const char *s, int len, UINT codepage)
339 {
340  if (!s) return (char *)"";
341  int l = 0;
342  unsigned wn = fl_utf8toUtf16(s, len, NULL, 0); // Query length
343  wn = wn * 2 + 1;
344  if (wn >= (unsigned)buf_len) {
345  buf_len = wn;
346  buf = (char*) realloc(buf, buf_len);
347  wbufa = (unsigned short*) realloc(wbufa, buf_len * sizeof(short));
348  }
349  if (codepage < 1) codepage = fl_codepage;
350  l = fl_utf8toUtf16(s, len, wbufa, wn); // Convert string
351  wbufa[l] = 0;
352  buf[l] = 0;
353  l = WideCharToMultiByte(codepage, 0, (WCHAR*)wbufa, l, buf, buf_len, NULL, NULL);
354  if (l < 0) l = 0;
355  buf[l] = 0;
356  return buf;
357 }
358 
359 // FIXME: This should maybe return 'const char *' instead of 'char *'
360 char *fl_locale_to_utf8(const char *s, int len, UINT codepage)
361 {
362  if (!s) return (char *)"";
363  int l = 0;
364  if (buf_len < len * 5 + 1) {
365  buf_len = len * 5 + 1;
366  buf = (char*) realloc(buf, buf_len);
367  wbufa = (unsigned short*) realloc(wbufa, buf_len * sizeof(short));
368  }
369  if (codepage < 1) codepage = fl_codepage;
370  buf[l] = 0;
371 
372  l = MultiByteToWideChar(codepage, 0, s, len, (WCHAR*)wbufa, buf_len);
373  if (l < 0) l = 0;
374  wbufa[l] = 0;
375  l = fl_utf8fromwc(buf, buf_len, (xchar*)wbufa, l);
376  buf[l] = 0;
377  return buf;
378 }
379 #endif
380 
384 char * fl_utf2mbcs(const char *s)
385 {
386  if (!s) return NULL;
387 
388 #if defined(WIN32) && !defined(__CYGWIN__)
389 
390  size_t l = strlen(s);
391  static char *buf = NULL;
392 
393  unsigned wn = fl_utf8toUtf16(s, (unsigned) l, NULL, 0) + 7; // Query length
394  mbwbuf = (xchar*)realloc(mbwbuf, sizeof(xchar)*wn);
395  l = fl_utf8toUtf16(s, (unsigned) l, (unsigned short *)mbwbuf, wn); // Convert string
396  mbwbuf[l] = 0;
397 
398  buf = (char*)realloc(buf, (unsigned) (l * 6 + 1));
399  l = (unsigned) wcstombs(buf, mbwbuf, (unsigned) l * 6);
400  buf[l] = 0;
401  return buf;
402 #else
403  return (char*) s;
404 #endif
405 }
406 
421 char *fl_getenv(const char* v) {
422 
423 #if defined (WIN32) && !defined(__CYGWIN__)
424 
425  size_t l = strlen(v);
426  unsigned wn = fl_utf8toUtf16(v, (unsigned) l, NULL, 0) + 1; // Query length
427  wbuf = (xchar*)realloc(wbuf, sizeof(xchar)*wn);
428  wn = fl_utf8toUtf16(v, (unsigned) l, (unsigned short *)wbuf, wn); // Convert string
429  wbuf[wn] = 0;
430  xchar *ret = _wgetenv(wbuf);
431  static char *buf = NULL;
432  if (ret) {
433  l = (unsigned) wcslen(ret);
434  wn = fl_utf8fromwc(NULL, 0, ret, (unsigned) l) + 1; // query length
435  buf = (char*) realloc(buf, wn);
436  wn = fl_utf8fromwc(buf, wn, ret, (unsigned) l); // convert string
437  buf[wn] = 0;
438  return buf;
439  } else {
440  return NULL;
441  }
442 
443 #else
444 
445  return getenv(v);
446 
447 #endif
448 
449 } // fl_getenv()
450 
451 
461 int fl_open(const char* f, int oflags, ...)
462 {
463  int pmode;
464  va_list ap;
465  va_start(ap, oflags);
466  pmode = va_arg (ap, int);
467  va_end(ap);
468 
469 #if defined (WIN32) && !defined(__CYGWIN__)
470 
471  unsigned l = (unsigned) strlen(f);
472  unsigned wn = fl_utf8toUtf16(f, l, NULL, 0) + 1; // Query length
473  wbuf = (xchar*)realloc(wbuf, sizeof(xchar)*wn);
474  wn = fl_utf8toUtf16(f, l, (unsigned short *)wbuf, wn); // Convert string
475  wbuf[wn] = 0;
476  if (pmode == -1) return _wopen(wbuf, oflags);
477  else return _wopen(wbuf, oflags, pmode);
478 
479 #else
480 
481  if (pmode == -1) return open(f, oflags);
482  else return open(f, oflags, pmode);
483 
484 #endif
485 
486 } // fl_open()
487 
488 
498 FILE *fl_fopen(const char* f, const char *mode) {
499 
500 #if defined (WIN32) && !defined(__CYGWIN__)
501 
502  size_t l = strlen(f);
503  unsigned wn = fl_utf8toUtf16(f, (unsigned) l, NULL, 0) + 1; // Query length
504  wbuf = (xchar*)realloc(wbuf, sizeof(xchar)*wn);
505  wn = fl_utf8toUtf16(f, (unsigned) l, (unsigned short *)wbuf, wn); // Convert string
506  wbuf[wn] = 0;
507  l = strlen(mode);
508  wn = fl_utf8toUtf16(mode, (unsigned) l, NULL, 0) + 1; // Query length
509  wbuf1 = (xchar*)realloc(wbuf1, sizeof(xchar)*wn);
510  wn = fl_utf8toUtf16(mode, (unsigned) l, (unsigned short *)wbuf1, wn); // Convert string
511  wbuf1[wn] = 0;
512  return _wfopen(wbuf, wbuf1);
513 
514 #else
515 
516  return fopen(f, mode);
517 
518 #endif
519 
520 } // fl_fopen()
521 
522 
534 int fl_system(const char* cmd)
535 {
536 #if defined(WIN32) && !defined(__CYGWIN__)
537 
538 # ifdef __MINGW32__
539  return system(fl_utf2mbcs(cmd));
540 # else
541  size_t l = strlen(cmd);
542  unsigned wn = fl_utf8toUtf16(cmd, (unsigned) l, NULL, 0) + 1; // Query length
543  wbuf = (xchar*)realloc(wbuf, sizeof(xchar)*wn);
544  wn = fl_utf8toUtf16(cmd, (unsigned) l, (unsigned short *)wbuf, wn); // Convert string
545  wbuf[wn] = 0;
546  return _wsystem(wbuf);
547 # endif
548 
549 #else
550  return system(cmd);
551 #endif
552 }
553 
554 int fl_execvp(const char *file, char *const *argv)
555 {
556 #if defined(WIN32) && !defined(__CYGWIN__) // Windows
557 
558 # ifdef __MINGW32__
559  return _execvp(fl_utf2mbcs(file), argv);
560 # else
561  size_t l = strlen(file);
562  int i, n;
563  xchar **ar;
564  unsigned wn = fl_utf8toUtf16(file, (unsigned) l, NULL, 0) + 1; // Query length
565  wbuf = (xchar*)realloc(wbuf, sizeof(xchar)*wn);
566  wn = fl_utf8toUtf16(file, (unsigned) l, (unsigned short *)wbuf, wn); // Convert string
567  wbuf[wn] = 0;
568 
569  i = 0; n = 0;
570  while (argv[i]) {i++; n++;}
571  ar = (xchar**) malloc(sizeof(xchar*) * (n + 1));
572  i = 0;
573  while (i <= n) {
574  unsigned wn;
575  l = strlen(argv[i]);
576  wn = fl_utf8toUtf16(argv[i], (unsigned) l, NULL, 0) + 1; // Query length
577  ar[i] = (xchar *)malloc(sizeof(xchar)*wn);
578  wn = fl_utf8toUtf16(argv[i], (unsigned) l, (unsigned short *)ar[i], wn); // Convert string
579  ar[i][wn] = 0;
580  i++;
581  }
582  ar[n] = NULL;
583  _wexecvp(wbuf, ar); // STR #3040
584  i = 0;
585  while (i <= n) {
586  free(ar[i]);
587  i++;
588  }
589  free(ar);
590  return -1; // STR #3040
591 # endif
592 
593 #else // other platforms
594  return execvp(file, argv);
595 #endif
596 
597 }
598 
609 int fl_chmod(const char* f, int mode) {
610 
611 #if defined(WIN32) && !defined(__CYGWIN__) // Windows
612 
613  size_t l = strlen(f);
614  unsigned wn = fl_utf8toUtf16(f, (unsigned) l, NULL, 0) + 1; // Query length
615  wbuf = (xchar*)realloc(wbuf, sizeof(xchar)*wn);
616  wn = fl_utf8toUtf16(f, (unsigned) l, (unsigned short *)wbuf, wn); // Convert string
617  wbuf[wn] = 0;
618  return _wchmod(wbuf, mode);
619 
620 #else // other platforms
621 
622  return chmod(f, mode);
623 
624 #endif
625 
626 } // fl_chmod()
627 
628 
639 int fl_access(const char* f, int mode) {
640 
641 #if defined (WIN32) && !defined(__CYGWIN__) // Windows
642 
643  size_t l = strlen(f);
644  unsigned wn = fl_utf8toUtf16(f, (unsigned) l, NULL, 0) + 1; // Query length
645  wbuf = (xchar*)realloc(wbuf, sizeof(xchar)*wn);
646  wn = fl_utf8toUtf16(f, (unsigned) l, (unsigned short *)wbuf, wn); // Convert string
647  wbuf[wn] = 0;
648  return _waccess(wbuf, mode);
649 
650 #else // other platforms
651 
652  return access(f, mode);
653 
654 #endif
655 
656 } // fl_access()
657 
658 
669 int fl_stat(const char* f, struct stat *b) {
670 
671 #if defined(WIN32) && !defined(__CYGWIN__) // Windows
672 
673  size_t l = strlen(f);
674  unsigned wn = fl_utf8toUtf16(f, (unsigned) l, NULL, 0) + 1; // Query length
675  wbuf = (xchar*)realloc(wbuf, sizeof(xchar)*wn);
676  wn = fl_utf8toUtf16(f, (unsigned) l, (unsigned short *)wbuf, wn); // Convert string
677  wbuf[wn] = 0;
678  return _wstat(wbuf, (struct _stat*)b);
679 
680 #else // other platforms
681 
682  return stat(f, b);
683 
684 #endif
685 
686 } // fl_stat()
687 
688 
699 char *fl_getcwd(char* b, int l) {
700 
701  if (b == NULL) {
702  b = (char*) malloc(l+1);
703  }
704 
705 #if defined(WIN32) && !defined(__CYGWIN__) // Windows
706 
707  static xchar *wbuf = NULL;
708  wbuf = (xchar*)realloc(wbuf, sizeof(xchar) * (l+1));
709  xchar *ret = _wgetcwd(wbuf, l);
710  if (ret) {
711  unsigned dstlen = l;
712  l = (int) wcslen(wbuf);
713  dstlen = fl_utf8fromwc(b, dstlen, wbuf, (unsigned) l);
714  b[dstlen] = 0;
715  return b;
716  } else {
717  return NULL;
718  }
719 
720 #else // other platforms
721 
722  return getcwd(b, l);
723 
724 #endif
725 
726 } // fl_getcwd()
727 
728 
738 int fl_unlink(const char* f) {
739 
740 #if defined(WIN32) && !defined(__CYGWIN__) // Windows
741 
742  size_t l = strlen(f);
743  unsigned wn = fl_utf8toUtf16(f, (unsigned) l, NULL, 0) + 1; // Query length
744  wbuf = (xchar*)realloc(wbuf, sizeof(xchar)*wn);
745  wn = fl_utf8toUtf16(f, (unsigned) l, (unsigned short *)wbuf, wn); // Convert string
746  wbuf[wn] = 0;
747  return _wunlink(wbuf);
748 
749 #else // other platforms
750 
751  return unlink(f);
752 
753 #endif
754 
755 } // fl_unlink()
756 
757 
768 int fl_mkdir(const char* f, int mode) {
769 
770 #if defined(WIN32) && !defined(__CYGWIN__) // Windows
771 
772  size_t l = strlen(f);
773  unsigned wn = fl_utf8toUtf16(f, (unsigned) l, NULL, 0) + 1; // Query length
774  wbuf = (xchar*)realloc(wbuf, sizeof(xchar)*wn);
775  wn = fl_utf8toUtf16(f, (unsigned) l, (unsigned short *)wbuf, wn); // Convert string
776  wbuf[wn] = 0;
777  return _wmkdir(wbuf);
778 
779 #else // other platforms
780 
781  return mkdir(f, mode);
782 
783 #endif
784 
785 } // fl_mkdir()
786 
787 
797 int fl_rmdir(const char* f) {
798 
799 #if defined (WIN32) && !defined(__CYGWIN__) // Windows
800 
801  size_t l = strlen(f);
802  unsigned wn = fl_utf8toUtf16(f, (unsigned) l, NULL, 0) + 1; // Query length
803  wbuf = (xchar*)realloc(wbuf, sizeof(xchar)*wn);
804  wn = fl_utf8toUtf16(f, (unsigned) l, (unsigned short *)wbuf, wn); // Convert string
805  wbuf[wn] = 0;
806  return _wrmdir(wbuf);
807 
808 #else
809 
810  return rmdir(f);
811 
812 #endif
813 
814 } // fl_rmdir()
815 
816 
827 int fl_rename(const char* f, const char *n) {
828 
829 #if defined (WIN32) && !defined(__CYGWIN__) // Windows
830 
831  size_t l = strlen(f);
832  unsigned wn = fl_utf8toUtf16(f, (unsigned) l, NULL, 0) + 1; // Query length
833  wbuf = (xchar*)realloc(wbuf, sizeof(xchar)*wn);
834  wn = fl_utf8toUtf16(f, (unsigned) l, (unsigned short *)wbuf, wn); // Convert string
835  wbuf[wn] = 0;
836  l = strlen(n);
837  wn = fl_utf8toUtf16(n, (unsigned) l, NULL, 0) + 1; // Query length
838  wbuf1 = (xchar*)realloc(wbuf1, sizeof(xchar)*wn);
839  wn = fl_utf8toUtf16(n, (unsigned) l, (unsigned short *)wbuf1, wn); // Convert string
840  wbuf1[wn] = 0;
841  return _wrename(wbuf, wbuf1);
842 
843 #else
844 
845  return rename(f, n);
846 
847 #endif
848 
849 } // fl_rename()
850 
851 
857 char fl_make_path( const char *path ) {
858  if (fl_access(path, 0)) {
859  const char *s = strrchr( path, '/' );
860  if ( !s ) return 0;
861  size_t len = (size_t) (s-path);
862  char *p = (char*)malloc( len+1 );
863  memcpy( p, path, len );
864  p[len] = 0;
865  fl_make_path( p );
866  free( p );
867  fl_mkdir(path, 0700);
868  }
869  return 1;
870 }
871 
878 void fl_make_path_for_file( const char *path ) {
879 
880  const char *s = strrchr( path, '/' );
881  if ( !s ) return;
882  size_t len = (s-path);
883  char *p = (char*)malloc( len+1 );
884  memcpy( p, path, len );
885  p[len] = 0;
886  fl_make_path( p );
887  free( p );
888 
889 } // fl_make_path_for_file()
890 
893 //
894 // End of "$Id$".
895 //
xchar
#define xchar
Definition: fl_utf8.h:68
buf
static char * buf
Definition: fl_encoding_mac_roman.cxx:76
fl_getcwd
char * fl_getcwd(char *buf, int maxlen)
Definition: fl_utf8.cxx:699
fl_system
int fl_system(const char *f)
Definition: fl_utf8.cxx:534
fl_utf8toUtf16
unsigned fl_utf8toUtf16(const char *src, unsigned srclen, unsigned short *dst, unsigned dstlen)
Definition: fl_utf.c:432
fl_utf8len
int fl_utf8len(char c)
Definition: fl_utf8.cxx:111
fl_utf_tolower
int fl_utf_tolower(const unsigned char *str, int len, char *buf)
Definition: fl_utf8.cxx:246
filename.H
free
void free()
NULL
#define NULL
Definition: forms.H:34
fl_utf8fromwc
unsigned fl_utf8fromwc(char *dst, unsigned dstlen, const wchar_t *src, unsigned srclen)
Definition: fl_utf.c:617
fl_utf_toupper
int fl_utf_toupper(const unsigned char *str, int len, char *buf)
Definition: fl_utf8.cxx:275
fl_fopen
FILE * fl_fopen(const char *f, const char *mode)
Definition: fl_utf8.cxx:498
b
long b
Definition: jpegint.h:397
fl_open
int fl_open(const char *f, int o,...)
Definition: fl_utf8.cxx:461
fl_utf8decode
unsigned fl_utf8decode(const char *p, const char *end, int *len)
Definition: fl_utf.c:137
XUtf8IsNonSpacing
unsigned short XUtf8IsNonSpacing(unsigned int ucs)
Definition: is_spacing.c:28
p
static menustate * p
Definition: Fl_Menu.cxx:606
fl_utf8.h
header for Unicode and UTF-8 character handling
fl_utf8len1
int fl_utf8len1(char c)
Definition: fl_utf8.cxx:141
XUtf8Tolower
int XUtf8Tolower(int ucs)
Definition: case.c:30
NBC
#define NBC
Definition: fl_utf8.cxx:82
fl_chmod
int fl_chmod(const char *f, int mode)
Definition: fl_utf8.cxx:609
fl_stat
int fl_stat(const char *path, struct stat *buffer)
Definition: fl_utf8.cxx:669
table
static symbol table[]
Definition: factory.cxx:1109
fl_rename
int fl_rename(const char *f, const char *t)
Definition: fl_utf8.cxx:827
fl_getenv
char * fl_getenv(const char *name)
Definition: fl_utf8.cxx:421
fl_make_path_for_file
void fl_make_path_for_file(const char *path)
Definition: fl_utf8.cxx:878
Toupper
static int Toupper(int ucs)
Definition: fl_utf8.cxx:84
fl_utf_strncasecmp
int fl_utf_strncasecmp(const char *s1, const char *s2, int n)
Definition: fl_utf8.cxx:193
fl_utf_strcasecmp
int fl_utf_strcasecmp(const char *s1, const char *s2)
Definition: fl_utf8.cxx:221
fl_utf_nb_char
int fl_utf_nb_char(const unsigned char *buf, int len)
Definition: fl_utf8.cxx:167
fl_mkdir
int fl_mkdir(const char *f, int mode)
Definition: fl_utf8.cxx:768
fl_access
int fl_access(const char *f, int mode)
Definition: fl_utf8.cxx:639
fl_utf8encode
int fl_utf8encode(unsigned ucs, char *buf)
Definition: fl_utf.c:309
fl_codepage
unsigned int fl_codepage
f
Fl_Box_Draw_F * f
Definition: fl_boxtype.cxx:285
malloc
voidp malloc()
fl_toupper
int fl_toupper(unsigned int ucs)
Definition: fl_utf8.cxx:237
fl_nonspacing
unsigned int fl_nonspacing(unsigned int ucs)
Definition: fl_utf8.cxx:313
fl_rmdir
int fl_rmdir(const char *f)
Definition: fl_utf8.cxx:797
fl_utf2mbcs
char * fl_utf2mbcs(const char *src)
Definition: fl_utf8.cxx:384
fl_make_path
char fl_make_path(const char *path)
Definition: fl_utf8.cxx:857
fl_tolower
int fl_tolower(unsigned int ucs)
Definition: fl_utf8.cxx:229
fl_unlink
int fl_unlink(const char *f)
Definition: fl_utf8.cxx:738
fl_execvp
int fl_execvp(const char *file, char *const *argv)
Definition: fl_utf8.cxx:554
Xutf8.h