2 * CDE - Common Desktop Environment
4 * Copyright (c) 1993-2012, The Open Group. All rights reserved.
6 * These libraries and programs are free software; you can
7 * redistribute them and/or modify them under the terms of the GNU
8 * Lesser General Public License as published by the Free Software
9 * Foundation; either version 2 of the License, or (at your option)
12 * These libraries and programs are distributed in the hope that
13 * they will be useful, but WITHOUT ANY WARRANTY; without even the
14 * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
15 * PURPOSE. See the GNU Lesser General Public License for more
18 * You should have received a copy of the GNU Lesser General Public
19 * License along with these libraries and programs; if not, write
20 * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth
21 * Floor, Boston, MA 02110-1301 USA
23 /* $XConsortium: sptchar.h /main/1 1996/07/29 17:10:09 cde-hp $ */
24 // Copyright (c) 1996 James Clark
25 // See the file COPYING for copying permission.
27 #ifndef sptchar_INCLUDED
28 #define sptchar_INCLUDED 1
36 namespace SP_NAMESPACE {
41 // typedef wchar_t SP_TCHAR;
42 // typedef wchar_t SP_TUCHAR;
43 #define SP_TCHAR wchar_t
44 #define SP_TUCHAR wchar_t
46 #define SP_T(x) L ## x
49 wchar_t *tgetenv(const wchar_t *s)
55 int tcscmp(const wchar_t *s1, const wchar_t *s2)
57 return wcscmp(s1, s2);
61 int tcsncmp(const wchar_t *s1, const wchar_t *s2, size_t n)
63 return wcsncmp(s1, s2, n);
67 unsigned long tcstoul(const wchar_t *s, const wchar_t **sp, int base)
69 return wcstoul((wchar_t *)s, (wchar_t **)sp, base);
73 unsigned long tcstoul(wchar_t *s, wchar_t **sp, int base)
75 return wcstoul(s, sp, base);
79 const wchar_t *tcschr(const wchar_t *s, wint_t c)
85 wchar_t *tcschr(wchar_t *s, wint_t c)
91 size_t tcslen(const wchar_t *s)
97 int fputts(const wchar_t *s, FILE *fp)
103 int totupper(wint_t c)
108 #else /* not SP_WIDE_SYSTEM */
110 // typedef char SP_TCHAR;
111 // typedef unsigned char SP_TUCHAR;
112 #define SP_TCHAR char
113 #define SP_TUCHAR unsigned char
118 char *tgetenv(const char *s)
124 int tcscmp(const char *s1, const char *s2)
126 return strcmp(s1, s2);
130 int tcsncmp(const char *s1, const char *s2, size_t n)
132 return strncmp(s1, s2, n);
136 unsigned long tcstoul(const char *s, const char **sp, int base)
138 return strtoul((char *)s, (char **)sp, base);
142 unsigned long tcstoul(char *s, char **sp, int base)
144 return strtoul(s, sp, base);
148 const char *tcschr(const char *s, int c)
154 char *tcschr(char *s, int c)
160 size_t tcslen(const char *s)
166 int fputts(const char *s, FILE *fp)
177 #endif /* not SP_WIDE_SYSTEM */
183 #endif /* not sptchar_INCLUDED */