The manual
ginnOS
The reference: libc, the libraries and the kernel
Loading...
Searching...
No Matches
wchar.h File Reference

wide characters. More...

#include <stddef.h>
#include <stdint.h>

Go to the source code of this file.

Data Structures

struct  mbstate_t
 the state of a conversion that stopped in a character (UTF-8 needs none) More...

Macros

#define WEOF   ((wint_t)-1)

Typedefs

typedef unsigned int wint_t

Functions

size_t mbrtowc (wchar_t *wc, const char *s, size_t n, mbstate_t *state)
 the character at s, of at most n bytes, into *wc (if wc is not NULL).
size_t mbrlen (const char *s, size_t n, mbstate_t *state)
 as mbrtowc with s as a whole string: (size_t)-1 or the length
size_t wcrtomb (char *s, wchar_t wc, mbstate_t *state)
 wc as UTF-8 at s (MB_CUR_MAX bytes of room): the bytes, or (size_t)-1
int mbsinit (const mbstate_t *state)
 always 1: no conversion stops in a character
wint_t btowc (int c)
 a character of one byte as a wide character, or WEOF for a byte from 0x80
int wctob (wint_t wc)
 a wide character of one byte as that byte, else EOF
size_t mbstowcs (wchar_t *dst, const char *src, size_t n)
size_t wcstombs (char *dst, const wchar_t *src, size_t n)
size_t wcslen (const wchar_t *s)
int wcscmp (const wchar_t *a, const wchar_t *b)
int wcsncmp (const wchar_t *a, const wchar_t *b, size_t n)
wchar_t * wcscpy (wchar_t *dst, const wchar_t *src)
wchar_t * wcsncpy (wchar_t *dst, const wchar_t *src, size_t n)
wchar_t * wcschr (const wchar_t *s, wchar_t c)
wchar_t * wcsrchr (const wchar_t *s, wchar_t c)
wchar_t * wmemchr (const wchar_t *s, wchar_t c, size_t n)
int wmemcmp (const wchar_t *a, const wchar_t *b, size_t n)
wchar_t * wmemcpy (wchar_t *dst, const wchar_t *src, size_t n)
wchar_t * wmemmove (wchar_t *dst, const wchar_t *src, size_t n)
wchar_t * wmemset (wchar_t *dst, wchar_t c, size_t n)
int wcwidth (wchar_t wc)
 the columns a character takes in a terminal: 0, 1 or 2; -1 if it cannot be shown

Detailed Description

wide characters.

ginnOS has one multibyte encoding, UTF-8: a wchar_t is a Unicode code point.

Macro Definition Documentation

◆ WEOF

#define WEOF   ((wint_t)-1)

Typedef Documentation

◆ wint_t

typedef unsigned int wint_t

Function Documentation

◆ mbrtowc()

size_t mbrtowc ( wchar_t * wc,
const char * s,
size_t n,
mbstate_t * state )

the character at s, of at most n bytes, into *wc (if wc is not NULL).

Returns
the bytes it used, 0 for the null character, (size_t)-1 for bytes that are not UTF-8 (errno EILSEQ), (size_t)-2 when n stops in the character.

◆ mbrlen()

size_t mbrlen ( const char * s,
size_t n,
mbstate_t * state )

as mbrtowc with s as a whole string: (size_t)-1 or the length

◆ wcrtomb()

size_t wcrtomb ( char * s,
wchar_t wc,
mbstate_t * state )

wc as UTF-8 at s (MB_CUR_MAX bytes of room): the bytes, or (size_t)-1

◆ mbsinit()

int mbsinit ( const mbstate_t * state)

always 1: no conversion stops in a character

◆ btowc()

wint_t btowc ( int c)

a character of one byte as a wide character, or WEOF for a byte from 0x80

◆ wctob()

int wctob ( wint_t wc)

a wide character of one byte as that byte, else EOF

◆ mbstowcs()

size_t mbstowcs ( wchar_t * dst,
const char * src,
size_t n )

◆ wcstombs()

size_t wcstombs ( char * dst,
const wchar_t * src,
size_t n )

◆ wcslen()

size_t wcslen ( const wchar_t * s)

◆ wcscmp()

int wcscmp ( const wchar_t * a,
const wchar_t * b )

◆ wcsncmp()

int wcsncmp ( const wchar_t * a,
const wchar_t * b,
size_t n )

◆ wcscpy()

wchar_t * wcscpy ( wchar_t * dst,
const wchar_t * src )

◆ wcsncpy()

wchar_t * wcsncpy ( wchar_t * dst,
const wchar_t * src,
size_t n )

◆ wcschr()

wchar_t * wcschr ( const wchar_t * s,
wchar_t c )

◆ wcsrchr()

wchar_t * wcsrchr ( const wchar_t * s,
wchar_t c )

◆ wmemchr()

wchar_t * wmemchr ( const wchar_t * s,
wchar_t c,
size_t n )

◆ wmemcmp()

int wmemcmp ( const wchar_t * a,
const wchar_t * b,
size_t n )

◆ wmemcpy()

wchar_t * wmemcpy ( wchar_t * dst,
const wchar_t * src,
size_t n )

◆ wmemmove()

wchar_t * wmemmove ( wchar_t * dst,
const wchar_t * src,
size_t n )

◆ wmemset()

wchar_t * wmemset ( wchar_t * dst,
wchar_t c,
size_t n )

◆ wcwidth()

int wcwidth ( wchar_t wc)

the columns a character takes in a terminal: 0, 1 or 2; -1 if it cannot be shown