Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members

fxdefs.h
1 /********************************************************************************
2 * *
3 * FOX Definitions, Types, and Macros *
4 * *
5 *********************************************************************************
6 * Copyright (C) 1997,2018 by Jeroen van der Zijp. All Rights Reserved. *
7 *********************************************************************************
8 * This library is free software; you can redistribute it and/or modify *
9 * it under the terms of the GNU Lesser General Public License as published by *
10 * the Free Software Foundation; either version 3 of the License, or *
11 * (at your option) any later version. *
12 * *
13 * This library is distributed in the hope that it will be useful, *
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
16 * GNU Lesser General Public License for more details. *
17 * *
18 * You should have received a copy of the GNU Lesser General Public License *
19 * along with this program. If not, see <http://www.gnu.org/licenses/> *
20 ********************************************************************************/
21 #ifndef FXDEFS_H
22 #define FXDEFS_H
23 
24 
25 
26 /******************************** Definitions ********************************/
27 
28 // Placement new
29 #include <new>
30 
31 
32 // Path separator
33 #ifdef WIN32
34 #define PATHSEP '\\'
35 #define PATHSEPSTRING "\\"
36 #define PATHLISTSEP ';'
37 #define PATHLISTSEPSTRING ";"
38 #define ISPATHSEP(c) ((c)=='\\' || (c)=='/')
39 #else
40 #define PATHSEP '/'
41 #define PATHSEPSTRING "/"
42 #define PATHLISTSEP ':'
43 #define PATHLISTSEPSTRING ":"
44 #define ISPATHSEP(c) ((c)=='/')
45 #endif
46 
47 
48 // End Of Line
49 #ifdef WIN32
50 #define ENDLINE "\r\n"
51 #else
52 #define ENDLINE "\n"
53 #endif
54 
55 
56 // For Windows
57 #ifdef _DEBUG
58 #ifndef DEBUG
59 #define DEBUG
60 #endif
61 #endif
62 #ifdef _NDEBUG
63 #ifndef NDEBUG
64 #define NDEBUG
65 #endif
66 #endif
67 
68 
69 // Shared library support
70 #ifdef WIN32
71 #define FXLOCAL
72 #define FXEXPORT __declspec(dllexport)
73 #define FXIMPORT __declspec(dllimport)
74 #else
75 #if defined(__GNUC__) && (__GNUC__ >= 4)
76 #define FXLOCAL __attribute__((visibility("hidden")))
77 #define FXEXPORT __attribute__((visibility("default")))
78 #define FXIMPORT __attribute__((visibility("default")))
79 #else
80 #define FXLOCAL
81 #define FXEXPORT
82 #define FXIMPORT
83 #endif
84 #endif
85 
86 
87 // Define FXAPI for DLL builds
88 #ifdef FOXDLL
89 #ifdef FOXDLL_EXPORTS
90 #define FXAPI FXEXPORT
91 #define FXTEMPLATE_EXTERN
92 #else
93 #define FXAPI FXIMPORT
94 #define FXTEMPLATE_EXTERN extern
95 #endif
96 #else
97 #define FXAPI
98 #define FXTEMPLATE_EXTERN
99 #endif
100 
101 
102 // Data alignment attribute
103 #if defined(__GNUC__)
104 #define __align(x) __attribute__((aligned(x)))
105 #elif defined(_MSC_VER)
106 #define __align(x) __declspec(align(x))
107 #else
108 #define __align(x)
109 #endif
110 
111 // Get alignment of pointer p to b=2^n bytes, returning 0..b-1
112 #define __alignment(p,b) (((FXival)(p))&((b)-1))
113 
114 // Check if pointer p is aligned to b=2^n bytes
115 #define __isaligned(p,b) (__alignment(p,b)==0)
116 
117 // Align pointer to b=2^n bytes
118 #define __alignto(p,b) ((void*)((((FXival)(p))+((FXival)((b)-1)))&~((FXival)((b)-1))))
119 
120 
121 // Thread-local storage attribute
122 #if defined(__GNUC__)
123 #define __threadlocal __thread
124 #elif defined(_MSC_VER)
125 #define __threadlocal __declspec(thread)
126 #else
127 #define __threadlocal
128 #endif
129 
130 
131 // Non-returning function
132 #if defined(__GNUC__)
133 #define __noreturn __attribute__((__noreturn__))
134 #elif (_MSC_VER >= 1400)
135 #define __noreturn __declspec(noreturn)
136 #else
137 #define __noreturn
138 #endif
139 
140 // Branch prediction optimization
141 #if (__GNUC__ >= 3)
142 #define __likely(cond) __builtin_expect(!!(cond),1)
143 #define __unlikely(cond) __builtin_expect(!!(cond),0)
144 #else
145 #define __likely(cond) (!!(cond))
146 #define __unlikely(cond) (!!(cond))
147 #endif
148 
149 
150 // Prefetch address
151 #if (__GNUC__ >= 4) && (defined(__i386__) || defined(__x86_64__))
152 #define __prefetch(addr) __builtin_prefetch((addr),0)
153 #define __prefetchw(addr) __builtin_prefetch((addr),1)
154 #else
155 #define __prefetch(addr)
156 #define __prefetchw(addr)
157 #endif
158 
159 
160 // Standard call calling sequence
161 #ifdef WIN32
162 #ifndef CALLBACK
163 #define CALLBACK __stdcall
164 #endif
165 #endif
166 
167 
168 // C Language calling sequence
169 #ifdef WIN32
170 #ifndef CDECL
171 #define CDECL __cdecl
172 #endif
173 #else
174 #ifndef CDECL
175 #define CDECL
176 #endif
177 #endif
178 
179 
180 // Checking printf and scanf format strings
181 #if defined(_CC_GNU_) || defined(__GNUG__) || defined(__GNUC__)
182 #define FX_PRINTF(fmt,arg) __attribute__((format(printf,fmt,arg)))
183 #define FX_SCANF(fmt,arg) __attribute__((format(scanf,fmt,arg)))
184 #define FX_FORMAT(arg) __attribute__((format_arg(arg)))
185 #else
186 #define FX_PRINTF(fmt,arg)
187 #define FX_SCANF(fmt,arg)
188 #define FX_FORMAT(arg)
189 #endif
190 
191 
192 // Suffixes for 64-bit long constants
193 #if defined(WIN32) && !defined(__GNUC__)
194 #define FXLONG(c) c ## i64
195 #define FXULONG(c) c ## ui64
196 #else
197 #define FXLONG(c) c ## LL
198 #define FXULONG(c) c ## ULL
199 #endif
200 
201 
202 // Raw event type
203 #ifdef WIN32
204 struct tagMSG;
205 #else
206 union _XEvent;
207 #endif
208 
209 
210 namespace FX {
211 
212 
214 enum { maybe=2 };
215 
216 
218 enum FXExponent {
219  EXP_NEVER=0,
220  EXP_ALWAYS=1,
221  EXP_AUTO=2
222  };
223 
224 
226 enum {
227  SEARCH_BACKWARD = 1,
228  SEARCH_FORWARD = 2,
229  SEARCH_NOWRAP = 0,
230  SEARCH_WRAP = 4,
231  SEARCH_EXACT = 0,
232  SEARCH_IGNORECASE = 8,
233  SEARCH_REGEX = 16,
234  SEARCH_PREFIX = 32,
235  SEARCH_SUFFIX = 64
236  };
237 
238 
239 /********************************* Typedefs **********************************/
240 
241 // Forward declarations
242 class FXObject;
243 class FXStream;
244 class FXString;
245 
246 
247 // Streamable types; these are fixed size!
248 typedef char FXchar;
249 typedef signed char FXschar;
250 typedef unsigned char FXuchar;
251 typedef bool FXbool;
252 typedef unsigned short FXushort;
253 typedef short FXshort;
254 typedef unsigned int FXuint;
255 typedef int FXint;
256 typedef float FXfloat;
257 typedef double FXdouble;
258 #if defined(WIN32)
259 typedef unsigned int FXwchar;
260 #if defined(_MSC_VER) && !defined(_NATIVE_WCHAR_T_DEFINED)
261 typedef unsigned short FXnchar;
262 #elif defined(__WATCOMC__) && !defined(_WCHAR_T_DEFINED)
263 typedef long char FXnchar;
264 #else
265 typedef wchar_t FXnchar;
266 #endif
267 #else
268 typedef wchar_t FXwchar;
269 typedef unsigned short FXnchar;
270 #endif
271 #if defined(__LP64__) || defined(_LP64) || (_MIPS_SZLONG == 64) || (__WORDSIZE == 64)
272 typedef unsigned long FXulong;
273 typedef long FXlong;
274 #elif defined(_MSC_VER) || (defined(__BCPLUSPLUS__) && __BORLANDC__ > 0x500) || defined(__WATCOM_INT64__)
275 typedef unsigned __int64 FXulong;
276 typedef __int64 FXlong;
277 #elif defined(__GNUG__) || defined(__GNUC__) || defined(__SUNPRO_CC) || defined(__MWERKS__) || defined(__SC__) || defined(_LONGLONG)
278 typedef unsigned long long FXulong;
279 typedef long long FXlong;
280 #else
281 #error "FXlong and FXulong not defined for this architecture!"
282 #endif
283 
284 
285 // Integral types large enough to hold value of a pointer
286 #if defined(_WIN64)
287 #if defined (_MSC_VER)
288 typedef __int64 FXival;
289 typedef unsigned __int64 FXuval;
290 #else
291 typedef long long FXival;
292 typedef unsigned long long FXuval;
293 #endif
294 #else
295 typedef long FXival;
296 typedef unsigned long FXuval;
297 #endif
298 
299 
300 // Generic void pointer
301 typedef void* FXptr;
302 
303 
304 // Handle to something in server
305 #ifdef WIN32
306 typedef void* FXID;
307 #else
308 typedef unsigned long FXID;
309 #endif
310 
311 // Time since January 1, 1970 (UTC)
312 typedef FXlong FXTime;
313 
314 // Pixel type (could be color index)
315 typedef unsigned long FXPixel;
316 
317 // RGBA pixel value
318 typedef FXuint FXColor;
319 
320 // Hot key
321 typedef FXuint FXHotKey;
322 
323 // Input source handle type
324 #ifdef WIN32
325 typedef void* FXInputHandle;
326 #else
327 typedef FXint FXInputHandle;
328 #endif
329 
330 // Thread ID type
331 #if defined(WIN32)
332 typedef void* FXThreadID;
333 #else
334 typedef unsigned long FXThreadID;
335 #endif
336 
337 // Thread-local storage key
338 typedef FXuval FXThreadStorageKey;
339 
340 // Raw event type
341 #ifdef WIN32
342 typedef tagMSG FXRawEvent;
343 #else
344 typedef _XEvent FXRawEvent;
345 #endif
346 
347 
349 #ifdef WIN32
350 typedef FXushort FXDragType;
351 #else
352 typedef FXID FXDragType;
353 #endif
354 
355 
357 const FXTime forever=FXLONG(9223372036854775807);
358 
359 
360 /********************************** Macros ***********************************/
361 
363 #define FXBIT(val,b) (((val)>>(b))&1)
364 
366 #define FXABS(val) (((val)>=0)?(val):-(val))
367 
369 #define FXSGN(val) (((val)<0)?-1:1)
370 
372 #define FXSGNZ(val) ((val)<0?-1:(val)>0?1:0)
373 
375 #define FXSGNX(x,b) (((FXint)((x)<<(32-(b))))>>(32-(b)))
376 
378 #define FXMAX(a,b) (((a)>(b))?(a):(b))
379 
381 #define FXMIN(a,b) (((a)>(b))?(b):(a))
382 
384 #define FXMIN3(x,y,z) ((x)<(y)?FXMIN(x,z):FXMIN(y,z))
385 
387 #define FXMAX3(x,y,z) ((x)>(y)?FXMAX(x,z):FXMAX(y,z))
388 
390 #define FXMIN4(x,y,z,w) (FXMIN(FXMIN(x,y),FXMIN(z,w)))
391 
393 #define FXMAX4(x,y,z,w) (FXMAX(FXMAX(x,y),FXMAX(z,w)))
394 
396 #define FXMINMAX(lo,hi,a,b) ((a)<(b)?((lo)=(a),(hi)=(b)):((lo)=(b),(hi)=(a)))
397 
399 #define FXCLAMP(lo,x,hi) ((x)<(lo)?(lo):((x)>(hi)?(hi):(x)))
400 
402 #define FXSWAP(a,b,t) ((t)=(a),(a)=(b),(b)=(t))
403 
405 #define FXLERP(a,b,f) ((a)+((b)-(a))*(f))
406 
408 #define STRUCTOFFSET(str,member) (((char *)(&(((str *)0)->member)))-((char *)0))
409 
411 #define ARRAYNUMBER(array) (sizeof(array)/sizeof(array[0]))
412 
414 #define CONTAINER(ptr,str,mem) ((str*)(((char*)(ptr))-STRUCTOFFSET(str,mem)))
415 
417 #define MKUINT(l,h) ((((FX::FXuint)(l))&0xffff) | (((FX::FXuint)(h))<<16))
418 
420 #define FXSEL(type,id) ((((FX::FXuint)(id))&0xffff) | (((FX::FXuint)(type))<<16))
421 
423 #define FXSELTYPE(s) ((FX::FXushort)(((s)>>16)&0xffff))
424 
426 #define FXSELID(s) ((FX::FXushort)((s)&0xffff))
427 
429 #define FXISUTF8(c) (((c)&0xC0)!=0x80)
430 
432 #define FXISLEADUTF8(c) (((c)&0xC0)==0xC0)
433 #define FXISFOLLOWUTF8(c) (((c)&0xC0)==0x80)
434 
436 #define FXISSEQUTF8(c) (((c)&0x80)==0x80)
437 
439 #define FXUTF8LEN(c) (((0xE5000000>>((((FXuchar)(c))>>4)<<1))&3)+1)
440 
442 #define FXISUTF16(c) (((c)&0xFC00)!=0xDC00)
443 
445 #define FXISLEADUTF16(c) (((c)&0xFC00)==0xD800)
446 #define FXISFOLLOWUTF16(c) (((c)&0xFC00)==0xDC00)
447 
449 #define FXISSEQUTF16(c) (((c)&0xF800)==0xD800)
450 
452 #define FXUTF16LEN(c) (FXISLEADUTF16(c)+1)
453 
455 #define FXISUTF32(c) ((c)<0x110000)
456 
458 #define FXAVGCOLOR(ca,cb) (((ca)&(cb))+((((ca)^(cb))&0xFEFEFEFE)>>1))
459 
460 
461 // Definitions for big-endian machines
462 #if FOX_BIGENDIAN == 1
463 
465 #define FXRGBA(r,g,b,a) (((FX::FXuint)(FX::FXuchar)(a)) | ((FX::FXuint)(FX::FXuchar)(r)<<8) | ((FX::FXuint)(FX::FXuchar)(g)<<16) | ((FX::FXuint)(FX::FXuchar)(b)<<24))
466 
468 #define FXRGB(r,g,b) (((FX::FXuint)(FX::FXuchar)(r)<<8) | ((FX::FXuint)(FX::FXuchar)(g)<<16) | ((FX::FXuint)(FX::FXuchar)(b)<<24) | 0x000000ff)
469 
471 #define FXREDVAL(rgba) ((FX::FXuchar)(((rgba)>>8)&0xff))
472 
474 #define FXGREENVAL(rgba) ((FX::FXuchar)(((rgba)>>16)&0xff))
475 
477 #define FXBLUEVAL(rgba) ((FX::FXuchar)(((rgba)>>24)&0xff))
478 
480 #define FXALPHAVAL(rgba) ((FX::FXuchar)((rgba)&0xff))
481 
483 #define FXRGBACOMPVAL(rgba,comp) ((FX::FXuchar)(((rgba)>>((comp)<<3))&0xff))
484 
486 #define FXCOLORREF2RGB(ref) (FX::FXuint)((((ref)<<8)&0xff000000) | (((ref)<<8)&0xff0000) | (((ref)<<8)&0xff00) | 0x000000ff)
487 
489 #define FXRGB2COLORREF(rgb) (FX::FXuint)((((rgb)>>8)&0xff0000) | (((rgb)>>8)&0xff00) | (((rgb)>>8)&0xff))
490 
491 #endif
492 
493 
494 // Definitions for little-endian machines
495 #if FOX_BIGENDIAN == 0
496 
498 #define FXRGBA(r,g,b,a) (((FX::FXuint)(FX::FXuchar)(a)<<24) | ((FX::FXuint)(FX::FXuchar)(r)<<16) | ((FX::FXuint)(FX::FXuchar)(g)<<8) | ((FX::FXuint)(FX::FXuchar)(b)))
499 
501 #define FXRGB(r,g,b) (((FX::FXuint)(FX::FXuchar)(r)<<16) | ((FX::FXuint)(FX::FXuchar)(g)<<8) | ((FX::FXuint)(FX::FXuchar)(b)) | 0xff000000)
502 
504 #define FXREDVAL(rgba) ((FX::FXuchar)(((rgba)>>16)&0xff))
505 
507 #define FXGREENVAL(rgba) ((FX::FXuchar)(((rgba)>>8)&0xff))
508 
510 #define FXBLUEVAL(rgba) ((FX::FXuchar)((rgba)&0xff))
511 
513 #define FXALPHAVAL(rgba) ((FX::FXuchar)(((rgba)>>24)&0xff))
514 
516 #define FXRGBACOMPVAL(rgba,comp) ((FX::FXuchar)(((rgba)>>((3-(comp))<<3))&0xff))
517 
519 #define FXCOLORREF2RGB(ref) (FX::FXuint)((((ref)>>16)&0xff) | ((ref)&0xff00) | (((ref)<<16)&0xff0000) | 0xff000000)
520 
522 #define FXRGB2COLORREF(rgb) (FX::FXuint)((((rgb)<<16)&0xff0000) | ((rgb)&0xff00) | (((rgb)>>16)&0xff))
523 
524 #endif
525 
526 
534 #ifndef NDEBUG
535 #define FXASSERT(exp) (__likely(exp)?((void)0):(void)FX::fxassert(#exp,__FILE__,__LINE__))
536 #else
537 #define FXASSERT(exp) ((void)0)
538 #endif
539 
540 
548 #ifndef NDEBUG
549 #define FXVERIFY(exp) (__likely(exp)?((void)0):(void)FX::fxverify(#exp,__FILE__,__LINE__))
550 #else
551 #define FXVERIFY(exp) ((void)(exp))
552 #endif
553 
554 
567 #ifndef NDEBUG
568 #define FXTRACE(arguments) FX::fxtrace arguments
569 #else
570 #define FXTRACE(arguments) ((void)0)
571 #endif
572 
579 #define FXMALLOC(ptr,type,no) (FX::fxmalloc((void **)(ptr),sizeof(type)*(no)))
580 
587 #define FXCALLOC(ptr,type,no) (FX::fxcalloc((void **)(ptr),sizeof(type)*(no)))
588 
598 #define FXRESIZE(ptr,type,no) (FX::fxresize((void **)(ptr),sizeof(type)*(no)))
599 
607 #define FXMEMDUP(ptr,src,type,no) (FX::fxmemdup((void **)(ptr),(const void*)(src),sizeof(type)*(no)))
608 
615 #define FXFREE(ptr) (FX::fxfree((void **)(ptr)))
616 
617 /********************************** Globals **********************************/
618 
620 extern FXAPI FXbool fxmalloc(void** ptr,FXuval size);
621 
623 extern FXAPI FXbool fxcalloc(void** ptr,FXuval size);
624 
626 extern FXAPI FXbool fxresize(void** ptr,FXuval size);
627 
629 extern FXAPI FXbool fxmemdup(void** ptr,const void* src,FXuval size);
630 
632 extern FXAPI void fxfree(void** ptr);
633 
635 extern FXAPI __noreturn void fxerror(const FXchar* format,...) FX_PRINTF(1,2) ;
636 
638 extern FXAPI void fxwarning(const FXchar* format,...) FX_PRINTF(1,2) ;
639 
641 extern FXAPI void fxmessage(const FXchar* format,...) FX_PRINTF(1,2) ;
642 
644 extern FXAPI void fxassert(const FXchar* expression,const FXchar* filename,unsigned int lineno);
645 
647 extern FXAPI void fxverify(const FXchar* expression,const FXchar* filename,unsigned int lineno);
648 
650 extern FXAPI void fxtrace(FXint level,const FXchar* format,...) FX_PRINTF(2,3) ;
651 
653 extern FXAPI FXbool fxtoDOS(FXchar*& string,FXint& len);
654 
656 extern FXAPI FXbool fxfromDOS(FXchar*& string,FXint& len);
657 
659 extern FXAPI FXchar *fxstrdup(const FXchar* str);
660 
662 extern FXAPI FXuint fxstrhash(const FXchar* str);
663 
665 extern FXAPI FXival fxstrlcpy(FXchar* dst,const FXchar* src,FXival len);
666 
668 extern FXAPI FXival fxstrlcat(FXchar* dst,const FXchar* src,FXival len);
669 
671 extern FXAPI void fxrgb_to_hsv(FXfloat& h,FXfloat& s,FXfloat& v,FXfloat r,FXfloat g,FXfloat b);
672 
674 extern FXAPI void fxhsv_to_rgb(FXfloat& r,FXfloat& g,FXfloat& b,FXfloat h,FXfloat s,FXfloat v);
675 
677 extern FXAPI void fxrgb_to_hsl(FXfloat& h,FXfloat& s,FXfloat& l,FXfloat r,FXfloat g,FXfloat b);
678 
680 extern FXAPI void fxhsl_to_rgb(FXfloat& r,FXfloat& g,FXfloat& b,FXfloat h,FXfloat s,FXfloat l);
681 
683 extern FXint fxencode64(FXchar* dst,const FXchar* src,FXint len);
684 
686 extern FXint fxdecode64(FXchar* dst,const FXchar* src,FXint len);
687 
689 extern FXAPI FXwchar fxkeysym2ucs(FXwchar sym);
690 
692 extern FXAPI FXwchar fxucs2keysym(FXwchar ucs);
693 
695 extern FXAPI FXint fxparsegeometry(const FXchar *string,FXint& x,FXint& y,FXint& w,FXint& h);
696 
698 extern FXAPI FXbool fxisconsole(const FXchar *path);
699 
701 extern FXAPI FXTime fxgetticks();
702 
704 extern FXAPI const FXuchar fxversion[3];
705 
707 extern FXAPI FXint fxTraceLevel;
708 
709 
711 extern FXAPI FXwchar wc(const FXchar *ptr);
712 
714 extern FXAPI FXwchar wc(const FXnchar *ptr);
715 
716 
718 extern FXAPI const FXchar* wcinc(const FXchar* ptr);
719 
721 extern FXAPI FXchar* wcinc(FXchar* ptr);
722 
724 extern FXAPI const FXnchar* wcinc(const FXnchar* ptr);
725 
727 extern FXAPI FXnchar* wcinc(FXnchar* ptr);
728 
730 extern FXAPI const FXchar* wcdec(const FXchar* ptr);
731 
733 extern FXAPI FXchar* wcdec(FXchar* ptr);
734 
736 extern FXAPI const FXnchar* wcdec(const FXnchar* ptr);
737 
739 extern FXAPI FXnchar* wcdec(FXnchar* ptr);
740 
742 extern FXAPI const FXchar* wcstart(const FXchar* ptr);
743 
745 extern FXAPI FXchar* wcstart(FXchar* ptr);
746 
748 extern FXAPI const FXnchar* wcstart(const FXnchar *ptr);
749 
751 extern FXAPI FXnchar* wcstart(FXnchar *ptr);
752 
754 extern FXAPI FXint wclen(const FXchar *ptr);
755 
757 extern FXAPI FXint wclen(const FXnchar *ptr);
758 
760 extern FXAPI FXint wcvalid(const FXchar* ptr);
761 
763 extern FXAPI FXint wcvalid(const FXnchar* ptr);
764 
765 
767 extern FXAPI FXint wc2utf(FXwchar w);
768 
770 extern FXAPI FXint wc2nc(FXwchar w);
771 
773 extern FXAPI FXint wcs2utf(const FXwchar* ptr,FXint len);
774 extern FXAPI FXint wcs2utf(const FXwchar* ptr);
775 
777 extern FXAPI FXint ncs2utf(const FXnchar* ptr,FXint len);
778 extern FXAPI FXint ncs2utf(const FXnchar* ptr);
779 
781 extern FXAPI FXint utf2wcs(const FXchar *ptr,FXint len);
782 extern FXAPI FXint utf2wcs(const FXchar *ptr);
783 
785 extern FXAPI FXint utf2ncs(const FXchar *ptr,FXint len);
786 extern FXAPI FXint utf2ncs(const FXchar *ptr);
787 
788 
790 extern FXAPI FXint wc2utf(FXchar *dst,FXwchar w);
791 
793 extern FXAPI FXint wc2nc(FXnchar *dst,FXwchar w);
794 
796 extern FXAPI FXint wcs2utf(FXchar *dst,const FXwchar* src,FXint dlen,FXint slen);
797 extern FXAPI FXint wcs2utf(FXchar *dst,const FXwchar* src,FXint dlen);
798 
800 extern FXAPI FXint ncs2utf(FXchar *dst,const FXnchar* src,FXint dlen,FXint slen);
801 extern FXAPI FXint ncs2utf(FXchar *dst,const FXnchar* src,FXint dlen);
802 
804 extern FXAPI FXint utf2wcs(FXwchar *dst,const FXchar* src,FXint dlen,FXint slen);
805 extern FXAPI FXint utf2wcs(FXwchar *dst,const FXchar* src,FXint dlen);
806 
808 extern FXAPI FXint utf2ncs(FXnchar *dst,const FXchar* src,FXint dlen,FXint slen);
809 extern FXAPI FXint utf2ncs(FXnchar *dst,const FXchar* src,FXint dlen);
810 
812 extern FXAPI void memswap(void* dst,void* src,FXuval n);
813 
814 }
815 
816 #endif
Definition: FX4Splitter.h:28

Copyright © 1997-2018 Jeroen van der Zijp