Go to the documentation of this file.
30 #define FB_EXT_CHAR ((char)255)
33 #define FB_STR_TMPDESCRIPTORS 256
36 #define FB_MAXDIMENSIONS 8
39 #define FB_ARRAY_TMPDESCRIPTORS (FB_STR_TMPDESCRIPTORS / 4)
42 #define FB_TAB_WIDTH 14
45 #define FB_NATIVE_TAB 1
50 #define FB_SCRN_DEFAULT_WIDTH 80
51 #define FB_SCRN_DEFAULT_HEIGHT 25
54 #define FB_COLOR_FG_DEFAULT 0x1
55 #define FB_COLOR_BG_DEFAULT 0x2
58 #define FB_RESERVED_FILES 2
61 #define FB_MAX_FILES (FB_RESERVED_FILES + 255)
64 #define FB_FILE_BUFSIZE 8192
67 #define FB_LOCALBUFF_MAXLEN 32768
76 #define FB_CHAR_TO_INT(ch) ((int) ((unsigned) (unsigned char) (ch)))
82 #define FB_MAKE_EXT_KEY(ch) \
83 ((int) ((((unsigned) (unsigned char) (ch)) << 8) + \
84 (unsigned) (unsigned char) (FB_EXT_CHAR)))
86 #define MIN(a,b) ((a) < (b) ? (a) : (b))
87 #define MAX(a,b) ((a) > (b) ? (a) : (b))
88 #define MID(a,b,c) MIN(MAX((a), (b)), (c))
90 #define SWAP(a,b) ((a) ^= (b), (b) ^= (a), (a) ^= (b))
94 #elif defined HOST_UNIX
96 #elif defined HOST_WIN32
98 #elif defined HOST_XBOX
102 #if defined ENABLE_MT && !defined HOST_DOS && !defined HOST_XBOX
103 FBCALL void fb_Lock(
void );
104 FBCALL void fb_Unlock(
void );
105 FBCALL void fb_StrLock(
void );
106 FBCALL void fb_StrUnlock(
void );
107 #define FB_LOCK() fb_Lock()
108 #define FB_UNLOCK() fb_Unlock()
109 #define FB_STRLOCK() fb_StrLock()
110 #define FB_STRUNLOCK() fb_StrUnlock()
115 #define FB_STRUNLOCK()
120 static __inline__
int FB_MEMCMP(
const void *p1,
const void *p2,
size_t len )
138 :
"c" (len),
"S" (p1),
"D" (p2)
143 static __inline__
void *
FB_MEMCPY(
void *dest,
const void *src,
size_t n )
161 :
"c" (n),
"S" (src),
"D" (dest)
168 static __inline__
void *
FB_MEMCPYX(
void *dest,
const void *src,
size_t n )
184 :
"c" (n),
"S" (src),
"D" (dest)
189 static __inline__
const void *
FB_MEMCHR(
const void *s,
int c,
size_t n )
204 " xorl %%edi, %%edi \n"
209 :
"c" (n),
"a" (c),
"D" (s)
216 static __inline__
size_t FB_MEMLEN(
const void *s,
int c,
size_t n )
233 :
"c" (n),
"a" (c),
"D" ((
const char*) s + n - 1)
238 #define RORW(num, bits) __asm__ __volatile__("rorw %1, %0" : "=m"(num) : "c"(bits) : "memory")
239 #define RORW1(num) __asm__ __volatile__("rorw $1, %0" : "=m"(bit) : : "memory");
243 #define FB_MEMCMP(p1, p2, len) memcmp( p1, p2, len )
244 #define FB_MEMCPY( dest, src, n ) memcpy(dest, src, n)
245 #define FB_MEMCHR( s, c, n ) memchr( s, c, n )
249 static __inline__
void *
FB_MEMCPYX(
void *dest,
const void *src,
size_t n )
251 memcpy(dest, src, n);
252 return ((
char *)dest)+n;
255 static __inline__
size_t FB_MEMLEN(
const void *s,
int c,
size_t n )
257 const char *pachData = (
const char*) s;
259 if( pachData[n]!=(
char)c )
265 #define RORW(num, bits) num = ( (num) >> (bits) ) | (num << (16 - bits) )
266 #define RORW1(num) RORW(num, 1)
271 #define DBG_ASSERT(e) assert(e)
273 #define DBG_ASSERT(e) ((void)0)
276 #define fb_hSign( x ) (((x) < 0) ? -1 : 1)
318 #define SC_ESCAPE 0x01
329 #define SC_MINUS 0x0C
330 #define SC_EQUALS 0x0D
331 #define SC_BACKSPACE 0x0E
343 #define SC_LEFTBRACKET 0x1A
344 #define SC_RIGHTBRACKET 0x1B
345 #define SC_ENTER 0x1C
346 #define SC_CONTROL 0x1D
356 #define SC_SEMICOLON 0x27
357 #define SC_QUOTE 0x28
358 #define SC_TILDE 0x29
359 #define SC_LSHIFT 0x2A
360 #define SC_BACKSLASH 0x2B
368 #define SC_COMMA 0x33
369 #define SC_PERIOD 0x34
370 #define SC_SLASH 0x35
371 #define SC_RSHIFT 0x36
372 #define SC_MULTIPLY 0x37
374 #define SC_SPACE 0x39
375 #define SC_CAPSLOCK 0x3A
386 #define SC_NUMLOCK 0x45
387 #define SC_SCROLLLOCK 0x46
390 #define SC_PAGEUP 0x49
392 #define SC_CLEAR 0x4C
393 #define SC_RIGHT 0x4D
397 #define SC_PAGEDOWN 0x51
398 #define SC_INSERT 0x52
399 #define SC_DELETE 0x53
405 #define SC_ALTGR 0x64
407 #define KEY_BACKSPACE 8
409 #define KEY_F1 FB_MAKE_EXT_KEY( ';' )
410 #define KEY_F2 FB_MAKE_EXT_KEY( '<' )
411 #define KEY_F3 FB_MAKE_EXT_KEY( '=' )
412 #define KEY_F4 FB_MAKE_EXT_KEY( '>' )
413 #define KEY_F5 FB_MAKE_EXT_KEY( '?' )
414 #define KEY_F6 FB_MAKE_EXT_KEY( '@' )
415 #define KEY_F7 FB_MAKE_EXT_KEY( 'A' )
416 #define KEY_F8 FB_MAKE_EXT_KEY( 'B' )
417 #define KEY_F9 FB_MAKE_EXT_KEY( 'C' )
418 #define KEY_F10 FB_MAKE_EXT_KEY( 'D' )
419 #define KEY_HOME FB_MAKE_EXT_KEY( 'G' )
420 #define KEY_UP FB_MAKE_EXT_KEY( 'H' )
421 #define KEY_PAGE_UP FB_MAKE_EXT_KEY( 'I' )
422 #define KEY_LEFT FB_MAKE_EXT_KEY( 'K' )
423 #define KEY_CLEAR FB_MAKE_EXT_KEY( 'L' )
424 #define KEY_RIGHT FB_MAKE_EXT_KEY( 'M' )
425 #define KEY_END FB_MAKE_EXT_KEY( 'O' )
426 #define KEY_DOWN FB_MAKE_EXT_KEY( 'P' )
427 #define KEY_PAGE_DOWN FB_MAKE_EXT_KEY( 'Q' )
428 #define KEY_INS FB_MAKE_EXT_KEY( 'R' )
429 #define KEY_DEL FB_MAKE_EXT_KEY( 'S' )
430 #define KEY_QUIT FB_MAKE_EXT_KEY( 'k' )