scc

simple c99 compiler
git clone git://git.simple-cc.org/scc
Log | Files | Refs | Submodules | README | LICENSE

wchar.h (4263B)


      1 #ifndef _WCHAR_H
      2 #define _WCHAR_H
      3 
      4 #define _NEED_NULL
      5 #define _NEED_SIZET
      6 #define _NEED_WCHART
      7 #define _NEED_WEOF
      8 #define _NEED_WCHARLIM
      9 #define _NEED_WINT
     10 #define _NEED_VA_LIST
     11 #include <sys/cdefs.h>
     12 #include <arch/cdefs.h>
     13 
     14 /*
     15  * We only support utf8 as multibyte encoding and
     16  * it does not have state.
     17  */
     18 typedef int mbstate_t;
     19 
     20 struct tm;
     21 struct _FILE;
     22 
     23 extern int vswscanf(const wchar_t *restrict, const wchar_t *restrict, __va_list);
     24 extern int vwprintf(const wchar_t *restrict, __va_list);
     25 extern int vwscanf(const wchar_t *restrict format, __va_list);
     26 
     27 extern int fwprintf(struct _FILE *restrict, const wchar_t *restrict, ...);
     28 extern int fwscanf(struct _FILE *restrict, const wchar_t *restrict, ...);
     29 
     30 extern int vfwprintf(struct _FILE *restrict, const wchar_t *restrict, __va_list);
     31 extern int vfwscanf(struct _FILE *restrict, const wchar_t *restrict, __va_list);
     32 extern int vswprintf(wchar_t *restrict, size_t, const wchar_t *restrict, __va_list);
     33 
     34 extern wint_t fgetwc(struct _FILE *);
     35 extern wint_t fputwc(wchar_t c, struct _FILE *);
     36 extern wint_t getwc(struct _FILE *);
     37 extern wint_t putwc(wchar_t, struct _FILE *);
     38 extern int fwide(struct _FILE *, int);
     39 extern wint_t ungetwc(wint_t, struct _FILE *);
     40 extern wchar_t *fgetws(wchar_t *restrict, int, struct _FILE *restrict);
     41 extern int fputws(const wchar_t *restrict, struct _FILE *restrict);
     42 
     43 extern int swprintf(wchar_t *restrict, size_t, const wchar_t *restrict, ...);
     44 extern int swscanf(const wchar_t *restrict, const wchar_t *restrict, ...);
     45 extern int wprintf(const wchar_t *restrict, ...);
     46 extern int wscanf(const wchar_t *restrict, ...);
     47 
     48 extern wint_t getwchar(void);
     49 extern wint_t putwchar(wchar_t);
     50 
     51 extern double wcstod(const wchar_t *restrict, wchar_t **restrict);
     52 extern float wcstof(const wchar_t *restrict, wchar_t **restrict);
     53 extern long double wcstold(const wchar_t *restrict, wchar_t **restrict);
     54 
     55 extern long int wcstol(const wchar_t *restrict, wchar_t **restrict, int);
     56 extern long long int wcstoll(const wchar_t *restrict, wchar_t **restrict, int);
     57 extern unsigned long int wcstoul(const wchar_t *restrict, wchar_t **restrict, int);
     58 extern unsigned long long int wcstoull(const wchar_t *restrict, wchar_t **restrict, int);
     59 
     60 extern wchar_t *wcscpy(wchar_t *restrict, const wchar_t *restrict);
     61 extern wchar_t *wcsncpy(wchar_t *restrict, const wchar_t *restrict, size_t);
     62 
     63 extern wchar_t *wmemcpy(wchar_t *restrict, const wchar_t *restrict, size_t);
     64 extern wchar_t *wmemmove(wchar_t *, const wchar_t *, size_t);
     65 extern wchar_t *wcscat(wchar_t *restrict, const wchar_t *restrict);
     66 extern wchar_t *wcsncat(wchar_t *restrict, const wchar_t *restrict, size_t);
     67 extern int wcscmp(const wchar_t *, const wchar_t *);
     68 extern int wcscoll(const wchar_t *, const wchar_t *);
     69 extern int wcsncmp(const wchar_t *, const wchar_t *, size_t);
     70 extern size_t wcsxfrm(wchar_t *restrict, const wchar_t *restrict, size_t);
     71 extern int wmemcmp(const wchar_t *, const wchar_t *, size_t);
     72 extern wchar_t *wcschr(const wchar_t *, wchar_t);
     73 extern size_t wcscspn(const wchar_t *, const wchar_t *);
     74 extern wchar_t *wcspbrk(const wchar_t *, const wchar_t *);
     75 extern wchar_t *wcsrchr(const wchar_t *, wchar_t);
     76 extern size_t wcsspn(const wchar_t *, const wchar_t *);
     77 extern wchar_t *wcsstr(const wchar_t *, const wchar_t *);
     78 extern wchar_t *wcstok(wchar_t *restrict, const wchar_t *restrict, wchar_t **restrict);
     79 extern wchar_t *wmemchr(const wchar_t *, wchar_t, size_t);
     80 extern size_t wcslen(const wchar_t *);
     81 extern wchar_t *wmemset(wchar_t *, wchar_t, size_t);
     82 extern size_t wcsftime(wchar_t *restrict, size_t, const wchar_t *restrict, const struct tm *restrict);
     83 extern wint_t btowc(int);
     84 extern int wctob(wint_t);
     85 extern int mbsinit(const mbstate_t *);
     86 extern size_t mbrlen(const char *restrict, size_t, mbstate_t *restrict);
     87 extern size_t mbrtowc(wchar_t *restrict, const char *restrict, size_t, mbstate_t *restrict);
     88 extern size_t wcrtomb(char *restrict, wchar_t, mbstate_t *restrict);
     89 extern size_t mbsrtowcs(wchar_t *restrict, const char **restrict, size_t, mbstate_t *restrict);
     90 extern size_t wcsrtombs(char *restrict, const wchar_t **restrict, size_t, mbstate_t *restrict);
     91 extern int wcwidth(wchar_t);
     92 
     93 #define mbrlen(s, n, ps) mbrtowc(NULL, s, n, ps)
     94 #define putwc(wc, fp) fputwc(wc, fp)
     95 
     96 #endif