1 /* 2 Unix SMB/Netbios implementation. 3 Version 1.9. 4 Character set handling 5 */ 6 7 #ifndef CHARSET_C 8 9 extern char *dos_char_map; 10 extern char *upper_char_map; 11 extern char *lower_char_map; 12 13 #ifdef toupper 14 #undef toupper 15 #endif 16 17 #ifdef tolower 18 #undef tolower 19 #endif 20 21 #ifdef isupper 22 #undef isupper 23 #endif 24 25 #ifdef islower 26 #undef islower 27 #endif 28 29 #ifdef isdoschar 30 #undef isdoschar 31 #endif 32 33 #ifdef isspace 34 #undef isspace 35 #endif 36 37 #define toupper(c) (upper_char_map[(c&0xff)] & 0xff) 38 #define tolower(c) (lower_char_map[(c&0xff)] & 0xff) 39 #define isupper(c) ((c&0xff) != tolower(c&0xff)) 40 #define islower(c) ((c&0xff) != toupper(c&0xff)) 41 #define isdoschar(c) (dos_char_map[(c&0xff)] != 0) 42 #define isspace(c) ((c)==' ' || (c) == '\t') 43 44 /* this is used to determine if a character is safe to use in 45 something that may be put on a command line */ 46 #define issafe(c) (isalnum((c&0xff)) || strchr("-._",c)) 47 #endif /* !CHARSET_C */ 48 49 /* Dynamic codepage files defines. */ 50 51 /* Version id for dynamically loadable codepage files. */ 52 #define CODEPAGE_FILE_VERSION_ID 0x1 53 /* Version 1 codepage file header size. */ 54 #define CODEPAGE_HEADER_SIZE 8 55 /* Offsets for codepage file header entries. */ 56 #define CODEPAGE_VERSION_OFFSET 0 57 #define CODEPAGE_CLIENT_CODEPAGE_OFFSET 2 58 #define CODEPAGE_LENGTH_OFFSET 4 59