Standard library header <wchar.h> (C95)
Este encabezado es parte de la biblioteca de cadenas anchas terminadas en nulo .
Contenidos |
Funciones
Conversiones a formatos numéricos |
|
|
(C95)
(C99)
|
convierte una cadena ancha a un valor entero
(función) |
|
(C95)
(C99)
|
convierte una cadena ancha a un valor entero sin signo
(función) |
|
(C99)
(C95)
(C99)
|
convierte una cadena ancha a un valor de punto flotante
(función) |
Manipulación de cadenas |
|
|
(C95)
(C11)
|
copia una cadena ancha a otra
(función) |
|
(C95)
(C11)
|
copia una cierta cantidad de caracteres anchos de una cadena a otra
(función) |
|
(C95)
(C11)
|
agrega una copia de una cadena ancha a otra
(función) |
|
(C95)
(C11)
|
agrega una cierta cantidad de caracteres anchos de una cadena ancha a otra
(función) |
|
(C95)
|
transforma una cadena ancha para que
wcscmp
produzca el mismo resultado que
wcscoll
(función) |
Examen de cadenas |
|
|
(C95)
(C11)
|
devuelve la longitud de una cadena ancha
(función) |
|
(C95)
|
compara dos cadenas anchas
(función) |
|
(C95)
|
compara una cierta cantidad de caracteres de dos cadenas anchas
(función) |
|
(C95)
|
compara dos cadenas anchas de acuerdo a la configuración regional actual
(función) |
|
(C95)
|
encuentra la primera ocurrencia de un carácter ancho en una cadena ancha
(función) |
|
(C95)
|
encuentra la última ocurrencia de un carácter ancho en una cadena ancha
(función) |
|
(C95)
|
devuelve la longitud del segmento inicial máximo que consiste
únicamente de los caracteres anchos encontrados en otra cadena ancha (función) |
|
(C95)
|
devuelve la longitud del segmento inicial máximo que consiste
únicamente de caracteres anchos no encontrados en otra cadena ancha (función) |
|
(C95)
|
encuentra la primera ubicación de cualquier carácter ancho en una cadena ancha, en otra cadena ancha
(función) |
|
(C95)
|
encuentra la primera ocurrencia de una cadena ancha dentro de otra cadena ancha
(función) |
|
(C95)
(C11)
|
encuentra el siguiente token en una cadena ancha
(función) |
Manipulación de arreglos de caracteres anchos |
|
|
(C95)
(C11)
|
copia una cierta cantidad de caracteres anchos entre dos arreglos que no se superponen
(función) |
|
(C95)
(C11)
|
copia una cierta cantidad de caracteres anchos entre dos arreglos, posiblemente superpuestos
(función) |
|
(C95)
|
compara una cierta cantidad de caracteres anchos de dos arreglos
(función) |
|
(C95)
|
encuentra la primera ocurrencia de un carácter ancho en un arreglo de caracteres anchos
(función) |
|
(C95)
|
copia el carácter ancho dado a cada posición en un arreglo de caracteres anchos
(función) |
Tipos
|
wchar_t
|
tipo entero que puede contener cualquier carácter ancho válido
(typedef) |
|
wint_t
(C95)
|
tipo entero que puede contener cualquier carácter ancho válido y al menos un valor más
(typedef) |
Macros
|
WEOF
(C95)
|
un valor no carácter de tipo
wint_t
utilizado para indicar errores
(macro constante) |
|
WCHAR_MIN
(C95)
|
el valor válido más pequeño de
wchar_t
(macro constante) |
|
WCHAR_MAX
(C95)
|
el valor válido más grande de
wchar_t
(macro constante) |
Sinopsis
#define __STDC_VERSION_WCHAR_H__ 202311L typedef /* ver descripción */ wchar_t; typedef /* ver descripción */ size_t; typedef /* ver descripción */ mbstate_t; typedef /* ver descripción */ wint_t; struct tm { /* ver descripción */ }; #define MB_UTF16 /* ver descripción */ #define MB_UTF32 /* ver descripción */ #define MB_UTF8 /* ver descripción */ #define NULL /* ver descripción */ #define WCHAR_MAX /* ver descripción */ #define WCHAR_MIN /* ver descripción */ #define WCHAR_UTF16 /* ver descripción */ #define WCHAR_UTF32 /* ver descripción */ #define WCHAR_UTF8 /* ver descripción */ #define WCHAR_WIDTH /* ver descripción */ #define WEOF /* ver descripción */ int fwprintf(FILE* restrict stream, const wchar_t* restrict format, ...); int fwscanf(FILE* restrict stream, const wchar_t* restrict format, ...); int swprintf(wchar_t* restrict s, size_t n, const wchar_t* restrict format, ...); int swscanf(const wchar_t* restrict s, const wchar_t* restrict format, ...); int vfwprintf(FILE* restrict stream, const wchar_t* restrict format, va_list arg); int vfwscanf(FILE* restrict stream, const wchar_t* restrict format, va_list arg); int vswprintf(wchar_t* restrict s, size_t n, const wchar_t* restrict format, va_list arg); int vswscanf(const wchar_t* restrict s, const wchar_t* restrict format, va_list arg); int vwprintf(const wchar_t* restrict format, va_list arg); int vwscanf(const wchar_t* restrict format, va_list arg); int wprintf(const wchar_t* restrict format, ...); int wscanf(const wchar_t* restrict format, ...); wint_t fgetwc(FILE* stream); wchar_t* fgetws(wchar_t* restrict s, int n, FILE* restrict stream); wint_t fputwc(wchar_t c, FILE* stream); int fputws(const wchar_t* restrict s, FILE* restrict stream); int fwide(FILE* stream, int mode); wint_t getwc(FILE* stream); wint_t getwchar(void); wint_t putwc(wchar_t c, FILE* stream); wint_t putwchar(wchar_t c); wint_t ungetwc(wint_t c, FILE* stream); double wcstod(const wchar_t* restrict nptr, wchar_t** restrict endptr); float wcstof(const wchar_t* restrict nptr, wchar_t** restrict endptr); long double wcstold(const wchar_t* restrict nptr, wchar_t** restrict endptr); long int wcstol(const wchar_t* restrict nptr, wchar_t** restrict endptr, int base); long long int wcstoll(const wchar_t* restrict nptr, wchar_t** restrict endptr, int base); unsigned long int wcstoul(const wchar_t* restrict nptr, wchar_t** restrict endptr, int base); unsigned long long int wcstoull(const wchar_t* restrict nptr, wchar_t** restrict endptr, int base); wchar_t* wcscpy(wchar_t* restrict s1, const wchar_t* restrict s2); wchar_t* wcsncpy(wchar_t* restrict s1, const wchar_t* restrict s2, size_t n); wchar_t* wmemcpy(wchar_t* restrict s1, const wchar_t* restrict s2, size_t n); wchar_t* wmemmove(wchar_t* s1, const wchar_t* s2, size_t n); wchar_t* wcscat(wchar_t* restrict s1, const wchar_t* restrict s2); wchar_t* wcsncat(wchar_t* restrict s1, const wchar_t* restrict s2, size_t n); int wcscmp(const wchar_t* s1, const wchar_t* s2); int wcscoll(const wchar_t* s1, const wchar_t* s2); int wcsncmp(const wchar_t* s1, const wchar_t* s2, size_t n); size_t wcsxfrm(wchar_t* restrict s1, const wchar_t* restrict s2, size_t n); int wmemcmp(const wchar_t* s1, const wchar_t* s2, size_t n); /*QWchar_t*/* wcschr(/*QWchar_t*/* s, wchar_t c); size_t wcscspn(const wchar_t* s1, const wchar_t* s2); /*QWchar_t*/* wcspbrk(/*QWchar_t*/* s1, const wchar_t* s2); /*QWchar_t*/* wcsrchr(/*QWchar_t*/* s, wchar_t c); size_t wcsspn(const wchar_t* s1, const wchar_t* s2); /*QWchar_t*/* wcsstr(/*QWchar_t*/* s1, const wchar_t* s2); wchar_t* wcstok(wchar_t* restrict s1, const wchar_t* restrict s2, wchar_t** restrict ptr); /*QWchar_t*/* wmemchr(/*QWchar_t*/* s, wchar_t c, size_t n); size_t wcslen(const wchar_t* s); size_t wcsnlen(const wchar_t* s, size_t n); wchar_t* wmemset(wchar_t* s, wchar_t c, size_t n); size_t wcsftime(wchar_t* restrict s, size_t maxsize, const wchar_t* restrict format, const struct tm* restrict timeptr); wint_t btowc(int c); int wctob(wint_t c); int mbsinit(const mbstate_t* ps); size_t mbrlen(const char* restrict s, size_t n, mbstate_t* restrict ps); size_t mbrtowc(wchar_t* restrict pwc, const char* restrict s, size_t n, mbstate_t* restrict ps); size_t wcrtomb(char* restrict s, wchar_t wc, mbstate_t* restrict ps); size_t mbsrtowcs(wchar_t* restrict dst, const char** restrict src, size_t len, mbstate_t* restrict ps); size_t wcsrtombs(char* restrict dst, const wchar_t** restrict src, size_t len, mbstate_t* restrict ps);
Solo si la implementación define __STDC_IEC_60559_DFP__ :
_Decimal32 wcstod32(const wchar_t* restrict nptr, wchar_t** restrict endptr); _Decimal64 wcstod64(const wchar_t* restrict nptr, wchar_t** restrict endptr); _Decimal128 wcstod128(const wchar_t* restrict nptr, wchar_t** restrict endptr);
Solo si la implementación define __STDC_IEC_60559_TYPES__ y adicionalmente el código de usuario define __STDC_WANT_IEC_60559_TYPES_EXT__ antes de cualquier inclusión de <wchar.h> :
#ifdef __STDC_WANT_IEC_60559_TYPES_EXT__ /*_FloatN*/ /*wcstofN*/(const wchar_t* restrict nptr, wchar_t** restrict endptr); /*_FloatNx*/ /*wcstofNx*/(const wchar_t* restrict nptr, wchar_t** restrict endptr); /*_DecimalN*/ /*wcstodN*/(const wchar_t* restrict nptr, wchar_t** restrict endptr); /*_DecimalNx*/ /*wcstodNx*/(const wchar_t* restrict nptr, wchar_t** restrict endptr); void /*wcstoencfN*/(unsigned char encptr[restrict static N/8], const wchar_t* restrict nptr, wchar_t** restrict endptr); void /*wcstoencdecdN*/(unsigned char encptr[restrict static N/8], const wchar_t* restrict nptr, wchar_t** restrict endptr); void /*wcstoencbindN*/(unsigned char encptr[restrict static N/8], const wchar_t* restrict nptr, wchar_t** restrict endptr); #endif
Solo si la implementación define __STDC_LIB_EXT1__ y adicionalmente el código de usuario define __STDC_WANT_LIB_EXT1__ antes de cualquier inclusión de <wchar.h> :
#ifdef __STDC_WANT_LIB_EXT1__ typedef /* ver descripción */ errno_t; typedef /* ver descripción */ rsize_t; int fwprintf_s(FILE* restrict stream, const wchar_t* restrict format, ...); int fwscanf_s(FILE* restrict stream, const wchar_t* restrict format, ...); int snwprintf_s(wchar_t* restrict s, rsize_t n, const wchar_t* restrict format, ...); int swprintf_s(wchar_t* restrict s, rsize_t n, const wchar_t* restrict format, ...); int swscanf_s(const wchar_t* restrict s, const wchar_t* restrict format, ...); int vfwprintf_s(FILE* restrict stream, const wchar_t* restrict format, va_list arg); int vfwscanf_s(FILE* restrict stream, const wchar_t* restrict format, va_list arg); int vsnwprintf_s(wchar_t* restrict s, rsize_t n, const wchar_t* restrict format, va_list arg); int vswprintf_s(wchar_t* restrict s, rsize_t n, const wchar_t* restrict format, va_list arg); int vswscanf_s(const wchar_t* restrict s, const wchar_t* restrict format, va_list arg); int vwprintf_s(const wchar_t* restrict format, va_list arg); int vwscanf_s(const wchar_t* restrict format, va_list arg); int wprintf_s(const wchar_t* restrict format, ...); int wscanf_s(const wchar_t* restrict format, ...); errno_t wcscpy_s(wchar_t* restrict s1, rsize_t s1max, const wchar_t* restrict s2); errno_t wcsncpy_s(wchar_t* restrict s1, rsize_t s1max, const wchar_t* restrict s2, rsize_t n); errno_t wmemcpy_s(wchar_t* restrict s1, rsize_t s1max, const wchar_t* restrict s2, rsize_t n); errno_t wmemmove_s(wchar_t* s1, rsize_t s1max, const wchar_t* s2, rsize_t n); errno_t wcscat_s(wchar_t* restrict s1, rsize_t s1max, const wchar_t* restrict s2); errno_t wcsncat_s(wchar_t* restrict s1, rsize_t s1max, const wchar_t* restrict s2, rsize_t n); wchar_t* wcstok_s(wchar_t* restrict s1, rsize_t* restrict s1max, const wchar_t* restrict s2, wchar_t** restrict ptr); size_t wcsnlen_s(const wchar_t* s, size_t maxsize); errno_t wcrtomb_s(size_t* restrict retval, char* restrict s, rsize_t smax, wchar_t wc, mbstate_t* restrict ps); errno_t mbsrtowcs_s(size_t* restrict retval, wchar_t* restrict dst, rsize_t dstmax, const char** restrict src, rsize_t len, mbstate_t* restrict ps); errno_t wcsrtombs_s(size_t* restrict retval, char* restrict dst, rsize_t dstmax, const wchar_t** restrict src, rsize_t len, mbstate_t* restrict ps); #endif