Embedded Artistry libc
C Standard Library Support for Bare-metal Systems
wchar.h File Reference
#include <stddef.h>
#include <stdint.h>
#include <wctype.h>
Include dependency graph for wchar.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  mbstate_t
 

Functions

int wcwidth (wchar_t)
 
int wcswidth (const wchar_t *, size_t)
 
wchar_t * wcschr (const wchar_t *, wchar_t)
 
wint_t btowc (int)
 
int wctob (wint_t)
 
wchar_t * wcscpy (wchar_t *__restrict, const wchar_t *__restrict)
 
wchar_t * wcsncpy (wchar_t *__restrict, const wchar_t *__restrict, size_t)
 
wchar_t * wcscat (wchar_t *__restrict, const wchar_t *__restrict)
 
wchar_t * wcsncat (wchar_t *__restrict, const wchar_t *__restrict, size_t)
 
int wcscmp (const wchar_t *, const wchar_t *)
 
int wcsncmp (const wchar_t *, const wchar_t *, size_t)
 
int wcscoll (const wchar_t *, const wchar_t *)
 
size_t wcsxfrm (wchar_t *__restrict, const wchar_t *__restrict, size_t)
 
wchar_t * wcsrchr (const wchar_t *, wchar_t)
 
size_t wcscspn (const wchar_t *, const wchar_t *)
 
size_t wcsspn (const wchar_t *, const wchar_t *)
 
wchar_t * wcspbrk (const wchar_t *, const wchar_t *)
 
wchar_t * wcstok (wchar_t *__restrict, const wchar_t *__restrict, wchar_t **__restrict)
 
size_t wcslen (const wchar_t *)
 
wchar_t * wcsstr (const wchar_t *__restrict, const wchar_t *__restrict)
 
wchar_t * wcswcs (const wchar_t *, const wchar_t *)
 
wchar_t * wmemchr (const wchar_t *, wchar_t, size_t)
 
int wmemcmp (const wchar_t *, const wchar_t *, size_t)
 
wchar_t * wmemcpy (wchar_t *__restrict, const wchar_t *__restrict, size_t)
 
wchar_t * wmemmove (wchar_t *, const wchar_t *, size_t)
 
wchar_t * wmemset (wchar_t *, wchar_t, size_t)
 
int mbsinit (const mbstate_t *)
 
size_t mbrtowc (wchar_t *__restrict, const char *__restrict, size_t, mbstate_t *__restrict)
 
size_t wcrtomb (char *__restrict, wchar_t, mbstate_t *__restrict)
 
size_t mbrlen (const char *__restrict, size_t, mbstate_t *__restrict)
 
size_t mbsrtowcs (wchar_t *__restrict, const char **__restrict, size_t, mbstate_t *__restrict)
 
size_t wcsrtombs (char *__restrict, const wchar_t **__restrict, size_t, mbstate_t *__restrict)
 
float wcstof (const wchar_t *__restrict, wchar_t **__restrict)
 
double wcstod (const wchar_t *__restrict, wchar_t **__restrict)
 
long double wcstold (const wchar_t *__restrict, wchar_t **__restrict)
 
long wcstol (const wchar_t *__restrict, wchar_t **__restrict, int)
 
unsigned long wcstoul (const wchar_t *__restrict, wchar_t **__restrict, int)
 
long long wcstoll (const wchar_t *__restrict, wchar_t **__restrict, int)
 
unsigned long long wcstoull (const wchar_t *__restrict, wchar_t **__restrict, int)
 
size_t mbsnrtowcs (wchar_t *__restrict, const char **__restrict, size_t, size_t, mbstate_t *__restrict)
 
size_t wcsnrtombs (char *__restrict, const wchar_t **__restrict, size_t, size_t, mbstate_t *__restrict)
 
wchar_t * wcsdup (const wchar_t *)
 
size_t wcsnlen (const wchar_t *, size_t)
 
wchar_t * wcpcpy (wchar_t *__restrict, const wchar_t *__restrict)
 
wchar_t * wcpncpy (wchar_t *__restrict, const wchar_t *__restrict, size_t)
 
int wcscasecmp (const wchar_t *, const wchar_t *)
 
int wcsncasecmp (const wchar_t *, const wchar_t *, size_t)
 
size_t wcsftime (wchar_t *__restrict, size_t, const wchar_t *__restrict, const struct tm *__restrict)
 

Class Documentation

◆ mbstate_t

struct mbstate_t

Definition at line 14 of file wchar.h.

Collaboration diagram for mbstate_t:
Collaboration graph
Class Members
unsigned __opaque1
unsigned __opaque2

Function Documentation

◆ btowc()

wint_t btowc ( int  )

◆ mbrlen()

size_t mbrlen ( const char *  __restrict,
size_t  ,
mbstate_t __restrict 
)

◆ mbrtowc()

size_t mbrtowc ( wchar_t *  __restrict,
const char *  __restrict,
size_t  ,
mbstate_t __restrict 
)

◆ mbsinit()

int mbsinit ( const mbstate_t )

◆ mbsnrtowcs()

size_t mbsnrtowcs ( wchar_t *  __restrict,
const char **  __restrict,
size_t  ,
size_t  ,
mbstate_t __restrict 
)

◆ mbsrtowcs()

size_t mbsrtowcs ( wchar_t *  __restrict,
const char **  __restrict,
size_t  ,
mbstate_t __restrict 
)

◆ wcpcpy()

wchar_t* wcpcpy ( wchar_t *  __restrict,
const wchar_t *  __restrict 
)

◆ wcpncpy()

wchar_t* wcpncpy ( wchar_t *  __restrict,
const wchar_t *  __restrict,
size_t   
)

◆ wcrtomb()

size_t wcrtomb ( char *  __restrict,
wchar_t  ,
mbstate_t __restrict 
)

◆ wcscasecmp()

int wcscasecmp ( const wchar_t *  ,
const wchar_t *   
)

◆ wcscat()

wchar_t* wcscat ( wchar_t *  __restrict,
const wchar_t *  __restrict 
)

◆ wcschr()

wchar_t* wcschr ( const wchar_t *  ,
wchar_t   
)

Referenced by iswspace().

◆ wcscmp()

int wcscmp ( const wchar_t *  ,
const wchar_t *   
)

◆ wcscoll()

int wcscoll ( const wchar_t *  ,
const wchar_t *   
)

◆ wcscpy()

wchar_t* wcscpy ( wchar_t *  __restrict,
const wchar_t *  __restrict 
)

◆ wcscspn()

size_t wcscspn ( const wchar_t *  ,
const wchar_t *   
)

◆ wcsdup()

wchar_t* wcsdup ( const wchar_t *  )

◆ wcsftime()

size_t wcsftime ( wchar_t *  __restrict,
size_t  ,
const wchar_t *  __restrict,
const struct tm __restrict 
)

◆ wcslen()

size_t wcslen ( const wchar_t *  )

◆ wcsncasecmp()

int wcsncasecmp ( const wchar_t *  ,
const wchar_t *  ,
size_t   
)

◆ wcsncat()

wchar_t* wcsncat ( wchar_t *  __restrict,
const wchar_t *  __restrict,
size_t   
)

◆ wcsncmp()

int wcsncmp ( const wchar_t *  ,
const wchar_t *  ,
size_t   
)

◆ wcsncpy()

wchar_t* wcsncpy ( wchar_t *  __restrict,
const wchar_t *  __restrict,
size_t   
)

◆ wcsnlen()

size_t wcsnlen ( const wchar_t *  ,
size_t   
)

◆ wcsnrtombs()

size_t wcsnrtombs ( char *  __restrict,
const wchar_t **  __restrict,
size_t  ,
size_t  ,
mbstate_t __restrict 
)

◆ wcspbrk()

wchar_t* wcspbrk ( const wchar_t *  ,
const wchar_t *   
)

◆ wcsrchr()

wchar_t* wcsrchr ( const wchar_t *  ,
wchar_t   
)

◆ wcsrtombs()

size_t wcsrtombs ( char *  __restrict,
const wchar_t **  __restrict,
size_t  ,
mbstate_t __restrict 
)

◆ wcsspn()

size_t wcsspn ( const wchar_t *  ,
const wchar_t *   
)

◆ wcsstr()

wchar_t* wcsstr ( const wchar_t *  __restrict,
const wchar_t *  __restrict 
)

◆ wcstod()

double wcstod ( const wchar_t *  __restrict,
wchar_t **  __restrict 
)

◆ wcstof()

float wcstof ( const wchar_t *  __restrict,
wchar_t **  __restrict 
)

◆ wcstok()

wchar_t* wcstok ( wchar_t *  __restrict,
const wchar_t *  __restrict,
wchar_t **  __restrict 
)

◆ wcstol()

long wcstol ( const wchar_t *  __restrict,
wchar_t **  __restrict,
int   
)

◆ wcstold()

long double wcstold ( const wchar_t *  __restrict,
wchar_t **  __restrict 
)

◆ wcstoll()

long long wcstoll ( const wchar_t *  __restrict,
wchar_t **  __restrict,
int   
)

◆ wcstoul()

unsigned long wcstoul ( const wchar_t *  __restrict,
wchar_t **  __restrict,
int   
)

◆ wcstoull()

unsigned long long wcstoull ( const wchar_t *  __restrict,
wchar_t **  __restrict,
int   
)

◆ wcswcs()

wchar_t* wcswcs ( const wchar_t *  ,
const wchar_t *   
)

◆ wcswidth()

int wcswidth ( const wchar_t *  ,
size_t   
)

Definition at line 3 of file wcswidth.c.

4 {
5  int l = 0, k = 0;
6  for(; n-- && *wcs && (k = wcwidth(*wcs)) >= 0; l += k, wcs++)
7  {
8  {
9  ;
10  }
11  }
12  return (k < 0) ? k : l;
13 }
int wcwidth(wchar_t)
Definition: wcwidth.c:11

References wcwidth().

◆ wcsxfrm()

size_t wcsxfrm ( wchar_t *  __restrict,
const wchar_t *  __restrict,
size_t   
)

◆ wctob()

int wctob ( wint_t  )

◆ wcwidth()

int wcwidth ( wchar_t  )

Definition at line 11 of file wcwidth.c.

12 {
13  if(wc < (wchar_t)0xffU)
14  {
15  return (wc + 1 & 0x7f) >= 0x21 ? 1 : wc ? -1 : 0;
16  }
17 
18  if((wc & (wchar_t)0xfffeffffU) < 0xfffe)
19  {
20  if((table[table[wc >> 8] * 32 + ((wc & 255) >> 3)] >> (wc & 7)) & 1)
21  {
22  return 0;
23  }
24 
25  if((wtable[wtable[wc >> 8] * 32 + ((wc & 255) >> 3)] >> (wc & 7)) & 1)
26  {
27  return 2;
28  }
29 
30  return 1;
31  }
32 
33  if((wc & 0xfffe) == 0xfffe)
34  {
35  return -1;
36  }
37 
38  if(wc - (wchar_t)0x20000U < 0x20000)
39  {
40  return 2;
41  }
42 
43  if(wc == 0xe0001 || wc - (wchar_t)0xe0020U < 0x5f || wc - 0xe0100 < 0xef)
44  {
45  return 0;
46  }
47 
48  return 1;
49 }
static const unsigned char wtable[]
Definition: wcwidth.c:7
static const unsigned char table[]
Definition: wcwidth.c:3

References table, and wtable.

Referenced by wcswidth().

Here is the caller graph for this function:

◆ wmemchr()

wchar_t* wmemchr ( const wchar_t *  ,
wchar_t  ,
size_t   
)

◆ wmemcmp()

int wmemcmp ( const wchar_t *  ,
const wchar_t *  ,
size_t   
)

◆ wmemcpy()

wchar_t* wmemcpy ( wchar_t *  __restrict,
const wchar_t *  __restrict,
size_t   
)

◆ wmemmove()

wchar_t* wmemmove ( wchar_t *  ,
const wchar_t *  ,
size_t   
)

◆ wmemset()

wchar_t* wmemset ( wchar_t *  ,
wchar_t  ,
size_t   
)