aboutsummaryrefslogtreecommitdiff
path: root/AT91SAM7S256/SAM7S256/Include/wchar.h
blob: 2fa96aaa18a06f7cd6154bfd5cabfa9d8da8cabd (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
/* wchar.h standard header */
#ifndef _WCHAR
#define _WCHAR

#ifndef _SYSTEM_BUILD
  #pragma system_include
#endif

#ifndef _YVALS
  #include <yvals.h>
#endif
#include <ysizet.h>
_C_STD_BEGIN

                /* MACROS */
#ifndef NULL
  #define NULL  _NULL
#endif /* NULL */

#define WCHAR_MIN       _WCMIN
#define WCHAR_MAX       _WCMAX
#define WEOF    ((wint_t)(-1))

#if _WCMAX < __UNSIGNED_SHORT_MAX__
  #error "<wchart.h> wchar_t is too small."
#endif

                /* TYPE DEFINITIONS */
typedef _Mbstatet mbstate_t;

struct tm;
struct _Filet;

#ifndef _WCHART
  #define _WCHART
  typedef _Wchart wchar_t;
#endif /* _WCHART */

#ifndef _WINTT
  #define _WINTT
  typedef _Wintt wint_t;
#endif /* _WINT */

_C_LIB_DECL
                /* stdio DECLARATIONS */
#if _DLIB_FILE_DESCRIPTOR
  __INTRINSIC wint_t fgetwc(struct _Filet *);
  __INTRINSIC wchar_t * fgetws(wchar_t *, int, struct _Filet *);
  __INTRINSIC wint_t fputwc(wchar_t, struct _Filet *);
  __INTRINSIC int fputws(const wchar_t *, struct _Filet *);
  __INTRINSIC int fwide(struct _Filet *, int);
  __INTRINSIC int fwprintf(struct _Filet *,
                         const wchar_t *, ...);
  __INTRINSIC int fwscanf(struct _Filet *,
                        const wchar_t *, ...);
  __INTRINSIC wint_t getwc(struct _Filet *);
  __INTRINSIC wint_t putwc(wchar_t, struct _Filet *);
  __INTRINSIC wint_t ungetwc(wint_t, struct _Filet *);
  __INTRINSIC int vfwprintf(struct _Filet *,
                          const wchar_t *, __Va_list);
  #if _DLIB_ADD_C99_SYMBOLS
    __INTRINSIC int vfwscanf(struct _Filet *,
                             const wchar_t *, __Va_list);
  #endif /* _DLIB_ADD_C99_SYMBOLS */

#endif /* _DLIB_FILE_DESCRIPTOR */

__INTRINSIC wint_t getwchar(void);
__INTRINSIC wint_t __ungetwchar(wint_t);
__INTRINSIC wint_t putwchar(wchar_t);
__INTRINSIC int swprintf(wchar_t *, size_t,
                         const wchar_t *, ...);
__INTRINSIC int swscanf(const wchar_t *,
                        const wchar_t *, ...);
__INTRINSIC int vswprintf(wchar_t *, size_t,
                          const wchar_t *, __Va_list);
__INTRINSIC int vwprintf(const wchar_t *, __Va_list);
#if _DLIB_ADD_C99_SYMBOLS
  __INTRINSIC int vswscanf(const wchar_t *, const wchar_t *, __Va_list);
  __INTRINSIC int vwscanf(const wchar_t *, __Va_list);
#endif /* _DLIB_ADD_C99_SYMBOLS */
__INTRINSIC int wprintf(const wchar_t *, ...);
__INTRINSIC int wscanf(const wchar_t *, ...);

                /* stdlib DECLARATIONS */
__INTRINSIC size_t mbrlen(const char *, size_t, mbstate_t *);
__INTRINSIC size_t mbrtowc(wchar_t *, const char *, size_t,
                           mbstate_t *);
__INTRINSIC size_t mbsrtowcs(wchar_t *, const char **, size_t,
                             mbstate_t *);
__INTRINSIC int mbsinit(const mbstate_t *);
__INTRINSIC size_t wcrtomb(char *, wchar_t, mbstate_t *);
__INTRINSIC size_t wcsrtombs(char *, const wchar_t **, size_t,
                             mbstate_t *);
__INTRINSIC long wcstol(const wchar_t *, wchar_t **, int);
__INTRINSIC unsigned long wcstoul(const wchar_t *, wchar_t **, int);

                /* string DECLARATIONS */
__INTRINSIC wchar_t * wcscat(wchar_t *, const wchar_t *);
__INTRINSIC int wcscmp(const wchar_t *, const wchar_t *);
__INTRINSIC int wcscoll(const wchar_t *, const wchar_t *);
__INTRINSIC wchar_t * wcscpy(wchar_t *, const wchar_t *);
__INTRINSIC size_t wcscspn(const wchar_t *, const wchar_t *);
__INTRINSIC size_t wcslen(const wchar_t *);
__INTRINSIC wchar_t * wcsncat(wchar_t *,
                              const wchar_t *, size_t);
__INTRINSIC int wcsncmp(const wchar_t *, const wchar_t *, size_t);
__INTRINSIC wchar_t * wcsncpy(wchar_t *,
                              const wchar_t *, size_t);
__INTRINSIC size_t wcsspn(const wchar_t *, const wchar_t *);
__INTRINSIC wchar_t * wcstok(wchar_t *, const wchar_t *,
                             wchar_t **);
__INTRINSIC size_t wcsxfrm(wchar_t *,
                           const wchar_t *, size_t);
__INTRINSIC int wmemcmp(const wchar_t *, const wchar_t *, size_t);
__INTRINSIC wchar_t * wmemcpy(wchar_t *,
                              const wchar_t *, size_t);
__INTRINSIC wchar_t * wmemmove(wchar_t *, const wchar_t *, size_t);
__INTRINSIC wchar_t * wmemset(wchar_t *, wchar_t, size_t);

                /* time DECLARATIONS */
__INTRINSIC size_t wcsftime(wchar_t *, size_t,
                            const wchar_t *, const struct tm *);


__INTRINSIC wint_t btowc(int);
#if _DLIB_ADD_C99_SYMBOLS
  __INTRINSIC float wcstof(const wchar_t *, wchar_t **);
  __INTRINSIC long double wcstold(const wchar_t *, wchar_t **);
#endif /* _DLIB_ADD_C99_SYMBOLS */
__INTRINSIC double wcstod(const wchar_t *, wchar_t **);
__INTRINSIC int wctob(wint_t);

__INTRINSIC wint_t _Btowc(int);
__INTRINSIC int _Wctob(wint_t);
__INTRINSIC double _WStod(const wchar_t *, wchar_t **, long);
__INTRINSIC float _WStof(const wchar_t *, wchar_t **, long);
__INTRINSIC long double _WStold(const wchar_t *, wchar_t **, long);
__INTRINSIC unsigned long _WStoul(const wchar_t *, wchar_t **, int);

__INTRINSIC wchar_t * _Wmemchr(const wchar_t *, wchar_t, size_t);
__INTRINSIC wchar_t * _Wcschr(const wchar_t *, wchar_t);
__INTRINSIC wchar_t * _Wcspbrk(const wchar_t *, const wchar_t *);
__INTRINSIC wchar_t * _Wcsrchr(const wchar_t *, wchar_t);
__INTRINSIC wchar_t * _Wcsstr(const wchar_t *, const wchar_t *);
_END_C_LIB_DECL

/* IAR, can't use the Dinkum stratagem for wmemchr,... */

#ifdef __cplusplus
  __INTRINSIC const wchar_t * wmemchr(const wchar_t *, wchar_t, size_t);
  __INTRINSIC const wchar_t * wcschr(const wchar_t *, wchar_t);
  __INTRINSIC const wchar_t * wcspbrk(const wchar_t *, const wchar_t *);
  __INTRINSIC const wchar_t * wcsrchr(const wchar_t *, wchar_t);
  __INTRINSIC const wchar_t * wcsstr(const wchar_t *, const wchar_t *);
  __INTRINSIC wchar_t * wmemchr(wchar_t *, wchar_t, size_t);
  __INTRINSIC wchar_t * wcschr(wchar_t *, wchar_t);
  __INTRINSIC wchar_t * wcspbrk(wchar_t *, const wchar_t *);
  __INTRINSIC wchar_t * wcsrchr(wchar_t *, wchar_t);
  __INTRINSIC wchar_t * wcsstr(wchar_t *, const wchar_t *);
#else /* !__cplusplus */
  __INTRINSIC wchar_t * wmemchr(const wchar_t *, wchar_t, size_t);
  __INTRINSIC wchar_t * wcschr(const wchar_t *, wchar_t);
  __INTRINSIC wchar_t * wcspbrk(const wchar_t *, const wchar_t *);
  __INTRINSIC wchar_t * wcsrchr(const wchar_t *, wchar_t);
  __INTRINSIC wchar_t * wcsstr(const wchar_t *, const wchar_t *);
#endif /* __cplusplus */

#ifndef _NO_DEFINITIONS_IN_HEADER_FILES
  #ifdef __cplusplus
                /* INLINES AND OVERLOADS, FOR C++ */

    inline const wchar_t * wmemchr(const wchar_t *_S, wchar_t _C, size_t _N)
    {
      return (_Wmemchr(_S, _C, _N));
    }

    inline const wchar_t * wcschr(const wchar_t *_S, wchar_t _C)
    {
      return (_Wcschr(_S, _C));
    }

    inline const wchar_t * wcspbrk(const wchar_t *_S, const wchar_t *_P)
    {
      return (_Wcspbrk(_S, _P));
    }

    inline const wchar_t * wcsrchr(const wchar_t *_S, wchar_t _C)
    {
      return (_Wcsrchr(_S, _C));
    }

    inline const wchar_t * wcsstr(const wchar_t *_S, const wchar_t *_P)
    {
      return (_Wcsstr(_S, _P));
    }

    inline wchar_t * wmemchr(wchar_t *_S, wchar_t _C, size_t _N)
    {
      return (_Wmemchr(_S, _C, _N));
    }

    inline wchar_t * wcschr(wchar_t *_S, wchar_t _C)
    {
      return (_Wcschr(_S, _C));
    }

    inline wchar_t * wcspbrk(wchar_t *_S, const wchar_t *_P)
    {
      return (_Wcspbrk(_S, _P));
    }

    inline wchar_t * wcsrchr(wchar_t *_S, wchar_t _C)
    {
      return (_Wcsrchr(_S, _C));
    }

    inline wchar_t * wcsstr(wchar_t *_S, const wchar_t *_P)
    {
      return (_Wcsstr(_S, _P));
    }

  #else /* __cplusplus */
    #pragma inline
    wchar_t * wmemchr(const wchar_t *_S, wchar_t _C, size_t _N)
    {
      return (_Wmemchr(_S, _C, _N));
    }

    #pragma inline
    wchar_t * wcschr(const wchar_t *_S, wchar_t _C)
    {
      return (_Wcschr(_S, _C));
    }

    #pragma inline
    wchar_t * wcspbrk(const wchar_t *_S, const wchar_t *_P)
    {
      return (_Wcspbrk(_S, _P));
    }

    #pragma inline
    wchar_t * wcsrchr(const wchar_t *_S, wchar_t _C)
    {
      return (_Wcsrchr(_S, _C));
    }

    #pragma inline
    wchar_t * wcsstr(const wchar_t *_S, const wchar_t *_P)
    {
      return (_Wcsstr(_S, _P));
    }
  #endif /* __cplusplus */

  #pragma inline
  wint_t btowc(int _C)
  {       /* convert single byte to wide character */
    return (_Btowc(_C));
  }

  #if _DLIB_ADD_C99_SYMBOLS
    #pragma inline
    float wcstof(const wchar_t *_S,
                 wchar_t **_Endptr)
    {       /* convert wide string to double */
      return (_WStof(_S, _Endptr, 0));
    }

    #pragma inline
    long double wcstold(const wchar_t *_S,
                        wchar_t **_Endptr)
    {       /* convert wide string to double */
      return (_WStold(_S, _Endptr, 0));
    }
  #endif /* _DLIB_ADD_C99_SYMBOLS */

  #pragma inline
  double wcstod(const wchar_t *_S,
                wchar_t **_Endptr)
  {       /* convert wide string to double */
    return (_WStod(_S, _Endptr, 0));
  }


  #pragma inline
  unsigned long wcstoul(const wchar_t *_S,
                        wchar_t **_Endptr, int _Base)
  {       /* convert wide string to unsigned long */
    return (_WStoul(_S, _Endptr, _Base));
  }

  #pragma inline
  int wctob(wint_t _Wc)
  {       /* convert wide character to single byte */
    return (_Wctob(_Wc));
  }

#endif /* _NO_DEFINITIONS_IN_HEADER_FILES */

#pragma inline
static wchar_t _WLC(wchar_t _C)
{  /* Convert wide character to lower case. */
  return (_C | (L'a' - L'A'));
}

_C_STD_END
#endif /* _WCHAR */

#if defined(_STD_USING) && defined(__cplusplus)
  using _CSTD mbstate_t; using _CSTD tm; using _CSTD wint_t;

  using _CSTD btowc; using _CSTD fgetwc; using _CSTD fgetws; using _CSTD fputwc;
  using _CSTD fputws; using _CSTD fwide; using _CSTD fwprintf;
  using _CSTD fwscanf; using _CSTD getwc; using _CSTD getwchar;
  using _CSTD mbrlen; using _CSTD mbrtowc; using _CSTD mbsrtowcs;
  using _CSTD mbsinit; using _CSTD putwc; using _CSTD putwchar;
  using _CSTD swprintf; using _CSTD swscanf; using _CSTD ungetwc;
  using _CSTD vfwprintf; using _CSTD vswprintf; using _CSTD vwprintf;
  using _CSTD wcrtomb; using _CSTD wprintf; using _CSTD wscanf;
  using _CSTD wcsrtombs; using _CSTD wcstol; using _CSTD wcscat;
  using _CSTD wcschr; using _CSTD wcscmp; using _CSTD wcscoll;
  using _CSTD wcscpy; using _CSTD wcscspn; using _CSTD wcslen;
  using _CSTD wcsncat; using _CSTD wcsncmp; using _CSTD wcsncpy;
  using _CSTD wcspbrk; using _CSTD wcsrchr; using _CSTD wcsspn;
  using _CSTD wcstod;
  using _CSTD wcstoul; using _CSTD wcsstr;
  using _CSTD wcstok; using _CSTD wcsxfrm; using _CSTD wctob;
  using _CSTD wmemchr; using _CSTD wmemcmp; using _CSTD wmemcpy;
  using _CSTD wmemmove; using _CSTD wmemset; using _CSTD wcsftime;
  #if _DLIB_ADD_C99_SYMBOLS
    using _CSTD vfwscanf; using _CSTD vswscanf; using _CSTD vwscanf;
    using _CSTD wcstof; using _CSTD wcstold;
  #endif /* _DLIB_ADD_C99_SYMBOLS */
#endif /* defined(_STD_USING) && defined(__cplusplus) */

/*
 * Copyright (c) 1992-2002 by P.J. Plauger.  ALL RIGHTS RESERVED.
 * Consult your license regarding permissions and restrictions.
V3.12:0576 */