VSF Documented
wchar.h
Go to the documentation of this file.
1#ifndef __SIMPLE_LIBC_WCHAR_H__
2#define __SIMPLE_LIBC_WCHAR_H__
3
5
6#if VSF_LINUX_CFG_RELATIVE_PATH == ENABLED
7# include "./stdio.h"
8# include "./time.h"
9#else
10# include <stdio.h>
11# include <time.h>
12#endif
13
14#ifdef __cplusplus
15extern "C" {
16#endif
17
18#ifndef WEOF
19# define WEOF ((wint_t)-1)
20#endif
21
22#ifdef __WIN__
23# ifdef __cplusplus
24# define _CONST_RETURN const
25# else
26# define _CONST_RETURN
27# endif
28#else
29# define _CONST_RETURN
30
31# if !__IS_COMPILER_IAR__
32// mbstate_t is defined in uchar.h in IAR
33typedef struct {
34 unsigned long wc;
35 unsigned short byte, state;
36} mbstate_t;
37# endif
38#endif
39
40#define getwc_unlocked getwc
41#define getwchar_unlocked getwchar
42#define fgetwc_unlocked fgetwc
43#define fputwc_unlocked fputwc
44#define putwc_unlocked putwc
45#define putwchar_unlocked putwchar
46#define fgetws_unlocked fgetws
47#define fputws_unlocked fputws
48
49int mbsinit(const mbstate_t *ps);
50size_t mbrlen(const char *str, size_t n, mbstate_t *ps);
51size_t mbrtowc(wchar_t *pwc, const char *str, size_t n, mbstate_t *ps);
52size_t mbsrtowcs(wchar_t *dst, const char **src, size_t n, mbstate_t *ps);
53size_t wcrtomb(char *str, wchar_t wc, mbstate_t *ps);
54size_t wcsrtombs(char *mbstr, const wchar_t **wcstr, size_t n, mbstate_t *ps);
55int wctob(wint_t wchar);
56
58
60wint_t putwchar(wchar_t c);
61wint_t putwc(wchar_t c, FILE *f);
62wint_t fputwc(wchar_t c, FILE *f);
66wchar_t * fgetws(wchar_t *str, int n, FILE *f);
67int fputws(const wchar_t *str, FILE *f);
68int fwide(FILE *f, int mode);
69
70int wprintf(const wchar_t *format, ...);
71int wscanf(const wchar_t *format, ...);
72int vwprintf(const wchar_t *format, va_list ap);
73int vwscanf(const wchar_t *format, va_list ap);
74int fwscanf(FILE *f, const wchar_t *format, ...);
75int fwprintf(FILE *f, const wchar_t *format, ...);
76int vfwprintf(FILE *f, const wchar_t *format, va_list ap);
77int vfwscanf(FILE *f, const wchar_t *format, va_list ap);
78
79int swscanf(const wchar_t *str, const wchar_t *format, ...);
80int vswscanf(const wchar_t *str, const wchar_t *format, va_list ap);
81int swprintf(wchar_t *str, size_t n, const wchar_t *format, ...);
82int vswprintf(wchar_t *str, size_t n, const wchar_t *format, va_list ap);
83
84size_t wcslen(const wchar_t *str);
85wchar_t * wcscat(wchar_t *dest, const wchar_t *src);
86wchar_t * wcsncat(wchar_t *dest, const wchar_t *src, size_t n);
87_CONST_RETURN wchar_t * wcschr(const wchar_t *str, wchar_t c);
88_CONST_RETURN wchar_t * wcsrchr(const wchar_t *str, wchar_t c);
89int wcscmp(const wchar_t *str1, const wchar_t *str2);
90int wcsncmp(const wchar_t *str1, const wchar_t *str2, size_t n);
91int wcscoll(const wchar_t *str1, const wchar_t *str2);
92wchar_t * wcscpy(wchar_t *dest, const wchar_t *src);
93wchar_t * wcsncpy(wchar_t *dest, const wchar_t *src, size_t n);
94_CONST_RETURN wchar_t * wcsstr(const wchar_t *str1, const wchar_t *str2);
95wchar_t * wcstok(wchar_t *str, const wchar_t *delim);
96
97wchar_t * wmemset(wchar_t *dest, wchar_t c, size_t n);
98wchar_t * wmemchr(const wchar_t *str, wchar_t c, size_t n);
99int wmemcmp(const wchar_t *str1, const wchar_t *str2, size_t n);
100wchar_t * wmemcpy(wchar_t *dest, const wchar_t *src, size_t n);
101wchar_t * wmemmove(wchar_t *dest, const wchar_t *src, size_t n);
102
103long wcstol(const wchar_t *str, wchar_t **ptr, int base);
104float wcstof(const wchar_t *str, wchar_t **ptr);
105double wcstod(const wchar_t *str, wchar_t **ptr);
106long double wcstold(const wchar_t *str, wchar_t **ptr);
107long long wcstoll(const wchar_t *str, wchar_t **ptr, int base);
108unsigned long long wcstoull(const wchar_t *str, wchar_t **ptr, int base);
109unsigned long wcstoul(const wchar_t *str, wchar_t **ptr, int base);
110
111wchar_t * wcspbrk(wchar_t *str, const wchar_t *charset);
112size_t wcsspn(const wchar_t *str, const wchar_t *charset);
113size_t wcscspn(const wchar_t *str, const wchar_t *charset);
114size_t wcsxfrm(wchar_t *dest, const wchar_t *src, size_t n);
115
116size_t wcsftime(wchar_t *dest, size_t n, const wchar_t *format, const struct tm *timeptr);
117
118#ifdef __cplusplus
119}
120#endif
121
122#endif
unsigned short wint_t
Definition stddef.h:35
int FILE
Definition stdio.h:141
Definition wchar.h:33
unsigned long wc
Definition wchar.h:34
unsigned short byte
Definition wchar.h:35
Definition time.h:52
uint8_t state
Definition vsf_msg_tree.h:247
SDL_PixelFormat format
Definition vsf_sdl2_pixelformat.c:32
_CONST_RETURN wchar_t * wcsstr(const wchar_t *str1, const wchar_t *str2)
size_t wcsftime(wchar_t *dest, size_t n, const wchar_t *format, const struct tm *timeptr)
long long wcstoll(const wchar_t *str, wchar_t **ptr, int base)
int swprintf(wchar_t *str, size_t n, const wchar_t *format,...)
Definition simple_swprintf.c:731
wint_t fgetwc(FILE *f)
unsigned long wcstoul(const wchar_t *str, wchar_t **ptr, int base)
wint_t getwc(FILE *f)
size_t wcrtomb(char *str, wchar_t wc, mbstate_t *ps)
wint_t ungetwc(wint_t c, FILE *f)
int vfwscanf(FILE *f, const wchar_t *format, va_list ap)
int wscanf(const wchar_t *format,...)
wint_t btowc(int c)
size_t wcscspn(const wchar_t *str, const wchar_t *charset)
wchar_t * wmemmove(wchar_t *dest, const wchar_t *src, size_t n)
int wctob(wint_t wchar)
wchar_t * wcscat(wchar_t *dest, const wchar_t *src)
size_t mbrlen(const char *str, size_t n, mbstate_t *ps)
long double wcstold(const wchar_t *str, wchar_t **ptr)
size_t wcsrtombs(char *mbstr, const wchar_t **wcstr, size_t n, mbstate_t *ps)
long wcstol(const wchar_t *str, wchar_t **ptr, int base)
int fputws(const wchar_t *str, FILE *f)
int wcscoll(const wchar_t *str1, const wchar_t *str2)
int wmemcmp(const wchar_t *str1, const wchar_t *str2, size_t n)
int wcscmp(const wchar_t *str1, const wchar_t *str2)
size_t wcsxfrm(wchar_t *dest, const wchar_t *src, size_t n)
size_t mbrtowc(wchar_t *pwc, const char *str, size_t n, mbstate_t *ps)
wchar_t * wcscpy(wchar_t *dest, const wchar_t *src)
size_t mbsrtowcs(wchar_t *dst, const char **src, size_t n, mbstate_t *ps)
wchar_t * wcspbrk(wchar_t *str, const wchar_t *charset)
#define _CONST_RETURN
Definition wchar.h:29
int fwide(FILE *f, int mode)
wchar_t * wcstok(wchar_t *str, const wchar_t *delim)
int wcsncmp(const wchar_t *str1, const wchar_t *str2, size_t n)
wchar_t * wcsncat(wchar_t *dest, const wchar_t *src, size_t n)
wchar_t * fgetws(wchar_t *str, int n, FILE *f)
wchar_t * wmemchr(const wchar_t *str, wchar_t c, size_t n)
wchar_t * wmemcpy(wchar_t *dest, const wchar_t *src, size_t n)
int fwprintf(FILE *f, const wchar_t *format,...)
float wcstof(const wchar_t *str, wchar_t **ptr)
wchar_t * wcsncpy(wchar_t *dest, const wchar_t *src, size_t n)
int vswprintf(wchar_t *str, size_t n, const wchar_t *format, va_list ap)
Definition simple_swprintf.c:155
int vwprintf(const wchar_t *format, va_list ap)
int vfwprintf(FILE *f, const wchar_t *format, va_list ap)
int vwscanf(const wchar_t *format, va_list ap)
int fwscanf(FILE *f, const wchar_t *format,...)
int mbsinit(const mbstate_t *ps)
unsigned long long wcstoull(const wchar_t *str, wchar_t **ptr, int base)
wint_t putwc(wchar_t c, FILE *f)
wchar_t * wmemset(wchar_t *dest, wchar_t c, size_t n)
_CONST_RETURN wchar_t * wcschr(const wchar_t *str, wchar_t c)
int vswscanf(const wchar_t *str, const wchar_t *format, va_list ap)
double wcstod(const wchar_t *str, wchar_t **ptr)
wint_t getwchar()
size_t wcslen(const wchar_t *str)
wint_t fputwc(wchar_t c, FILE *f)
_CONST_RETURN wchar_t * wcsrchr(const wchar_t *str, wchar_t c)
size_t wcsspn(const wchar_t *str, const wchar_t *charset)
int wprintf(const wchar_t *format,...)
wint_t putwchar(wchar_t c)
int swscanf(const wchar_t *str, const wchar_t *format,...)