1 // Copyright (c) 1996 James Clark
2 // See the file COPYING for copying permission.
4 #ifndef sptchar_INCLUDED
5 #define sptchar_INCLUDED 1
13 namespace SP_NAMESPACE {
18 typedef wchar_t SP_TCHAR;
19 typedef wchar_t SP_TUCHAR;
21 #define SP_T(x) L ## x
24 wchar_t *tgetenv(const wchar_t *s)
30 int tcscmp(const wchar_t *s1, const wchar_t *s2)
32 return wcscmp(s1, s2);
36 int tcsncmp(const wchar_t *s1, const wchar_t *s2, size_t n)
38 return wcsncmp(s1, s2, n);
42 unsigned long tcstoul(const wchar_t *s, const wchar_t **sp, int base)
44 return wcstoul((wchar_t *)s, (wchar_t **)sp, base);
48 unsigned long tcstoul(wchar_t *s, wchar_t **sp, int base)
50 return wcstoul(s, sp, base);
54 const wchar_t *tcschr(const wchar_t *s, wint_t c)
60 wchar_t *tcschr(wchar_t *s, wint_t c)
66 size_t tcslen(const wchar_t *s)
72 int fputts(const wchar_t *s, FILE *fp)
78 int totupper(wint_t c)
84 bool istalnum(wint_t c)
89 #else /* not SP_WIDE_SYSTEM */
91 typedef char SP_TCHAR;
92 typedef unsigned char SP_TUCHAR;
97 char *tgetenv(const char *s)
103 int tcscmp(const char *s1, const char *s2)
105 return strcmp(s1, s2);
109 int tcsncmp(const char *s1, const char *s2, size_t n)
111 return strncmp(s1, s2, n);
115 unsigned long tcstoul(const char *s, const char **sp, int base)
117 return strtoul((char *)s, (char **)sp, base);
121 unsigned long tcstoul(char *s, char **sp, int base)
123 return strtoul(s, sp, base);
127 const char *tcschr(const char *s, int c)
133 char *tcschr(char *s, int c)
139 size_t tcslen(const char *s)
145 int fputts(const char *s, FILE *fp)
162 #endif /* not SP_WIDE_SYSTEM */
168 #endif /* not sptchar_INCLUDED */