Expand PMF_FN_* macros.
[netbsd-mini2440.git] / dist / nvi / common / multibyte.h
blob201dc7105df67b5bd7663c8b0f853e861fbcd23c
1 /* $NetBSD: multibyte.h,v 1.4 2009/08/11 21:28:02 aymeric Exp $ */
3 #ifndef MULTIBYTE_H
4 #define MULTIBYTE_H
6 #ifdef USE_WIDECHAR
7 #include <wchar.h>
8 #include <wctype.h>
10 typedef wchar_t RCHAR_T;
11 typedef wchar_t CHAR_T;
12 #if defined(__NetBSD__)
13 #define MAX_CHAR_T 0xffffffff
14 #else
15 #define MAX_CHAR_T WCHAR_MAX
16 #endif
17 typedef u_int UCHAR_T;
19 #define STRLEN wcslen
20 #define STRTOL wcstol
21 #define STRTOUL wcstoul
22 #define SPRINTF swprintf
23 #define STRCMP wcscmp
24 #define STRPBRK wcspbrk
25 #define TOUPPER towupper
26 #define TOLOWER towlower
27 #define ISUPPER iswupper
28 #define ISLOWER iswlower
29 #define STRSET wmemset
30 #define STRCHR wcschr
32 #define L(ch) L ## ch
34 #else
35 typedef char RCHAR_T;
36 typedef u_char CHAR_T;
37 #define MAX_CHAR_T 0xff
38 typedef u_char UCHAR_T;
40 #define STRLEN strlen
41 #define STRTOL strtol
42 #define STRTOUL strtoul
43 #define SPRINTF snprintf
44 #define STRCMP strcmp
45 #define STRPBRK strpbrk
46 #define TOUPPER toupper
47 #define TOLOWER tolower
48 #define ISUPPER isupper
49 #define ISLOWER islower
50 #define STRSET memset
51 #define STRCHR strchr
53 #define L(ch) ch
55 #endif
57 #define MEMCMP(to, from, n) \
58 memcmp(to, from, (n) * sizeof(*(to)))
59 #define MEMMOVE(p, t, len) memmove(p, t, (len) * sizeof(*(p)))
60 #define MEMCPY(p, t, len) memcpy(p, t, (len) * sizeof(*(p)))
61 #define SIZE(w) (sizeof(w)/sizeof(*w))
63 #endif