Outputs data to a stream input/output file according to the format.
#include <stdio.h>
#include <wchar.h>
long fwprintf(FILE *restrict fp, const wchar_t *restrict control [, arg] );
control Pointer to wide string indicating format
arg, List of data to be output according to format
Normal: Number of wide strings converted and output
The fwprintf function is the wide-character version of the fprintf function.
Outputs a variable parameter list to the specified stream input/output file according to a format.
#include <stdarg.h>
#include <stdio.h>
#include <wchar.h>
long vfwprintf(FILE *restrict fp, const char *restrict control, va_list arg)
control Pointer to wide string indicating format
Normal: Number of characters converted and output
The vfwprintf function is the wide-character version of the vfprintf function.
Converts data according to a format and outputs it to the specified area.
#include <stdio.h>
#include <wchar.h>
long swprintf(wchar_t *restrict s, size_t n, const wchar_t *restrict control [, arg]...);
s Pointer to storage area to which data is to be output
n Number of wide characters to be output
control Pointer to wide string indicating format
arg, Data to be output according to format
Normal: Number of characters converted
Abnormal: When a representation format error occurs or writing n or morewide characters is requested: Negative value
The swprintf function is the wide-character version of the sprintf function.
Outputs a variable parameter list to the specified storage area according to a format.
#include <stdarg.h>
#include <wchar.h>
long vswprintf(wchar_t *restrict s, size_t n, const wchar_t *restrict control, va_list arg)
s Pointer to storage area to which data is to be output
n Number of wide characters to be output
control Pointer to wide string indicating format
Normal: Number of characters converted
The vswprintf function is the wide-character version of the vsprintf function.
Converts data according to a format and outputs it to the standard output file (stdout).
#include <stdio.h>
#include <wchar.h>
long wprintf(const wchar_t *restrict control [, arg]...);
control Pointer to string indicating format
arg, Data to be output according to format
Normal: Number of wide characters converted and output
The wprintf function is the wide-character version of printf function.
Outputs a variable parameter list to the standard output file (stdout) according to a format.
#include <stdarg.h>
#include <wchar.h>
long vwprintf(const wchar_t *restrict control, va_list arg);
control Pointer to wide string indicating format
Normal: Number of characters converted and output
The vwprintf function is the wide-character version of the vprintf function.
Inputs data from a stream input/output file and converts it according to a format.
#include <stdio.h>
#include <wchar.h>
long fwscanf(FILE *restrict fp, const wchar_t *restrict control [, ptr]...);
control Pointer to wide string indicating format
ptr Pointer to storage area that stores input data
Normal: Number of data items successfully input and converted
Abnormal: Input data ends before input data conversion is performed: EOF
The fwscanf function is the wide-character version of the fscanf function.
Inputs data from a stream input/output file and converts it according to a format.
#include <stdarg.h>
#include <stdio.h>
#include <wchar.h>
long vfwscanf(FILE *restrict fp, const wchar_t *restrict control, va_list arg)
control Pointer to wide string indicating format
Normal: Number of data items successfully input and converted
Abnormal: Input data ends before input data conversion is performed: EOF
The vfwscanf is the wide-character version of the vfscanf function.
Inputs data from the specified storage area and converts it according to a format.
#include <stdio.h>
#include <wchar.h>
long swscanf(const wchar_t *restrict s, const wchar_t *restrict control [, ptr]...);
s Storage area containing data to be input
control Pointer to wide string indicating format
ptr, Pointer to storage area that stores input and converted data
Normal: Number of data items successfully input and converted
The swscanf is the wide-character version of the sscanf function.
Inputs data from the specified storage area and converts it according to a format.
#include <stdarg.h>
#include <wchar.h>
long vswscanf(const wchar_t *restrict s, const wchar_t *restrict control, va_list arg);
s Storage area containing data to be input
control Pointer to wide string indicating format
Normal: Number of data items successfully input and converted
Inputs data from the standard input file (stdin) and converts it according to a format.
#include <wchar.h>
long wscanf(const wchar_t *control [, ptr] );
control Pointer to wide string indicating format
ptr, Pointer to storage area that stores input and converted data
Normal: Number of data items successfully input and converted
The wscanf function is the wide-character version of the scanf function.
Inputs data from the specified storage area and converts it according to a format.
#include <stdarg.h>
#include <wchar.h>
long vwscanf(const wchar_t *restrict control, va_list arg)
control Pointer to wide string indicating format
Normal: Number of data items successfully input and converted
Abnormal: Input data ends before input data conversion is performed: EOF
The vwscanf function is provided to support wide-character format with the vscanf function.
Inputs one wide character from a stream input/output file.
#include <stdio.h>
#include <wchar.h>
wint_t fgetwc(FILE *fp);
Otherwise: Input wide character
When a read error occurs, the error indicator for that file is set.
The fgetwc function is provided to support wide-character input to the fgetc function.
Inputs a wide string from a stream input/output file.
#include <stdio.h>
#include <wchar.h>
wchar_t *fgetws(wchar_t *restrict s, long n, FILE *fp);
s Pointer to storage area to which wide string is input
n Number of bytes of storage area to which wide string is input
The fgetws function is provided to support wide-character input to the fgets function.
Outputs one wide character to a stream input/output file.
#include <stdio.h>
#include <wchar.h>
wint_t fputwc(wchar_t c, FILE *fp);
When a write error occurs, the error indicator for that file is set.
The fputwc function is the wide-character version of the fputc function.
Outputs a wide string to a stream input/output file.
#include <stdio.h>
#include <wchar.h>
long fputws(const wchar_t *restrict s, FILE *restrict fp);
s Pointer to wide string to be output
The fputws function is the wide-character version of the fputs function.
Specifies the input unit of a file.
#include <stdio.h>
#include <wchar.h>
long fwide(FILE *fp, long mode);
mode Value indicating the input unit
A wide character is specified as the unit: Value greater than 0
A byte is specified as the unit: Value smaller than 0
No input/output unit is specified: 0
The fwide function does not change the stream input/output unit that has already been determined.
Inputs one wide character from a stream input/output file.
#include <stdio.h>
#include <wchar.h>
long getwc(FILE *fp);
Otherwise: Input wide character
When a read error occurs, the error indicator for that file is set.
The getwc function is equivalent to fgetwc, but getwc may evaluate fp two or more times because it is implemented as a macro. Accordingly, specify an expression without side effects for fp.
Inputs one wide character from the standard input file (stdin).
#include <wchar.h>
long getwchar(void);
Otherwise: Input wide character
When a read error occurs, the error indicator for that file is set.
The getwchar function is the wide-character version of the getchar function.
Outputs one wide character to a stream input/output file.
#include <stdio.h>
#include <wchar.h>
wint_t putwc(wchar_t c, FILE *fp);
When a write error occurs, the error indicator for that file is set.
The putwc function is equivalent to fputwc, but putwc may evaluate fp two or more times because it is implemented as a macro. Accordingly, specify an expression without side effects for fp.
Outputs one wide character to the standard output file (stdout).
#include <wchar.h>
wint_t putwchar(wchar_t c);
When a write error occurs, the error indicator for that file is set.
The putwchar function is the wide-character version of the putchar function.
Returns one wide character to a stream input/output file.
#include <stdio.h>
#include <wchar.h>
wint_t ungetwc(wint_t c, FILE *fp);
c Wide character to be returned
Normal: Returned wide character
The ungetwc function is the wide-character version of the ungetc function.
Converts the initial part of a wide string to a specified-type floating-point number.
#include <wchar.h>
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);
nptr Pointer to a number-representing string to be converted
endptr Pointer to the storage area containing a pointer to the first character that does not represent a floating-point number
Normal: If the string pointed by nptr begins with a character that does not represent a floating-point number: 0
If the string pointed by nptr begins with a character thatrepresents a floating-point number: Converted data as a specified-type floating-point number
Abnormal: If the converted data overflows: HUGE_VAL, HUGE_VALF, or HUGE_VALL with the same sign as that of the string before conversion
If the converted data underflows: 0
If the converted result overflows or underflows, errno is set.
The wcstod function group is the wide-character version of the strtod function group.
Converts the initial part of a wide string to a specified-type integer.
#include <wchar.h>
long int wcstol(const wchar_t * restrict nptr, wchar_t ** restrict endptr, long base);
long long int wcstoll(const wchar_t * restrict nptr, wchar_t ** restrict endptr, long base);
unsigned long int wcstoul(const wchar_t * restrict nptr, wchar_t ** restrict endptr, long base);
unsigned long long int wcstoull(const wchar_t * restrict nptr, wchar_t ** restrict endptr, long base;
nptr Pointer to a number-representing string to be converted
endptr Pointer to the storage area containing a pointer to the first character that does not represent an integer
base Radix of conversion (0 or 2 to 36)
Normal: If the string pointed by nptr begins with a character that does not represent an integer: 0
If the string pointed by nptr begins with a character that represents an integer: Converted data as a specified-type integer
Abnormal: If the converted data overflows: LONG_MIN, LONG_MAX, LLONG_MIN, LLONG_MAX, ULONG_MAX, or ULLONG_MAX depending on the sign of the string before conversion
If the converted result overflows, errno is set.
The wcstol function group is the wide-character version of the strtol function group.
Copies the contents of a source wide string including the null character to a destination storage area.
#include <wchar.h>
wchar_t *wcscpy(wchar_t * restrict s1, const wchar_t * restrict s2);
s1 Pointer to destination storage area
The wcscpy function group is the wide-character version of the strcpy function group.
Copies a source wide string of a specified length to a destination storage area.
#include <wchar.h>
wchar_t *wcsncpy(wchar_t * restrict s1, const wchar_t * restrict s2, size_t n);
s1 Pointer to destination storage area
n Number of characters to be copied
The wcsncpy function is the wide-character version of the strncpy function.
Copies the contents of a source storage area of a specified length to a destination storage area.
#include <wchar.h>
wchar_t *wmemcpy(wchar_t *restrict s1, const wchar_t *restrict s2, size_t n);
s1 Pointer to destination storage area
s2 Pointer to source storage area
n Number of characters to be copied
The wmemcpy function is the wide-character version of the memcpy function.
Copies the specified size of the contents of a source area to a destination storage area. If part of the source storage area and the destination storage area overlap, data is copied to the destination storage area before the overlapped source storage area is overwritten. Therefore, correct copy is enabled.
#include <wchar.h>
wchar_t *wmemmove(wchar_t *s1, const wchar_t *s2, size_t n);
s1 Pointer to destination storage area
s2 Pointer to source storage area
n Number of characters to be copied
The wmemmove function is the wide-character version of the memmove function.
Concatenates a string after another string.
#include <wchar.h>
wchar_t *wcscat(wchar_t *s1, const wchar_t *s2);
s1 Pointer to the string after which another string is appended
s2 Pointer to the string to be appended after the other string
The wcscat function is the wide-character version of the strcat function.
Concatenates a string of a specified length after another string.
#include <wchar.h>
wchar_t *wcsncat(wchar_t * restrict s1, const wchar_t * restrict s2, size_t n);
s1 Pointer to the string after which another string is appended
s2 Pointer to the string to be appended after the other string
n Number of characters to concatenate
The wcsncat function is the wide-character version of the strncat function.
Compares the contents of two strings specified.
#include <wchar.h>
long wcscmp(const wchar_t *s1, const wchar_t *s2);
s1 Pointer to the reference string to be compared
s2 Pointer to the string to compare to the reference
If string pointed by s1 > string pointed by s2: Positive value
If string pointed by s1 == string pointed by s2: 0
If string pointed by s1 < string pointed by s2: Negative value
The wcscmp function is the wide-character version of the strcmp function.
Compares two strings specified up to a specified length.
#include <wchar.h>
long wcsncmp(const wchar_t *s1, const wchar_t *s2, size_t n);
s1 Pointer to the reference string to be compared
s2 Pointer to the string to compare to the reference
n Maximum number of characters to compare
If string pointed by s1 > string pointed by s2: Positive value
If string pointed by s1 == string pointed by s2: 0
If string pointed by s1 < string pointed by s2: Negative value
The wcsncmp function is the wide-character version of the strncmp function.
Compares the contents of two storage areas specified.
#include <wchar.h>
long wmemcmp(const wchar_t * s1, const wchar_t * s2, size_t n);
s1 Pointer to the reference storage area to be compared
s2 Pointer to the storage area to compare to the reference
n Number of characters to compare
If storage area pointed by s1 > storage area pointed by s2: Positive value
If storage area pointed by s1 == storage area pointed by s2: 0
If storage area pointed by s1 < storage area pointed by s2: Negative value
The wmemcmp function is the wide-character version of the memcmp function.
Searches a specified string for the first occurrence of a specified character.
#include <wchar.h>
wchar_t *wcschr(const wchar_t *s, wchar_t c);
s Pointer to the string to be searched
If the character is found: Pointer to the found character
If the character is not found: NULL
The wcschr function is the wide-character version of the strchr function.
Checks a specified string from the beginning and counts the number of consecutive characters at the beginning that are not included in another string specified.
#include <wchar.h>
size_t wcscspn(const wchar_t *s1, const wchar_t *s2);
s1 Pointer to the string to be checked
s2 Pointer to the string used to check s1
Number of characters at the beginning of the s1 string that are not included in the s2 string
The wcscspn function is the wide-character version of the strcspn function.
Searches a specified string for the first occurrence of the character that is included in another string specified.
#include <wchar.h>
wchar_t *wcspbrk(const wchar_t *s1, const wchar_t *s2);
s1 Pointer to the string to be searched
s2 Pointer to the string that indicates the characters to search s1 for
If the character is found: Pointer to the found character
If the character is not found: NULL
The wcspbrk function is the wide-character version of the strpbrk function.
Searches a specified string for the last occurrence of a specified character.
#include <wchar.h>
wchar_t *wcsrchr(const wchar_t *s, wchar_t c);
s Pointer to the string to be searched
If the character is found: Pointer to the found character
If the character is not found: NULL
Checks a specified string from the beginning and counts the number of consecutive characters at the beginning that are included in another string specified.
#include <wchar.h>
size_t wcsspn(const wchar_t *s1, const wchar_t *s2);
s1 Pointer to the string to be checked
s2 Pointer to the string used to check s1
Number of characters at the beginning of the s1 string that are included in the s2 string
The wcsspn function is the wide-character version of the strspn function.
Searches a specified string for the first occurrence of another string specified.
#include <wchar.h>
wchar_t *wcsstr(const wchar_t *s1, const wchar_t *s2);
s1 Pointer to the string to be searched
s2 Pointer to the string to search for
If the string is found: Pointer to the found string
If the string is not found: NULL
Divides a specified string into some tokens.
#include <wchar.h>
wchar_t* wcstok(wchar_t * restrict s1, const wchar_t * restrict s2, wchar_t ** restrict ptr);
s1 Pointer to the string to be divided into some tokens
s2 Pointer to the string representing string-dividing characters
ptr Pointer to the string where search is to be started at the next function call
If division into tokens is successful: Pointer to the first token divided
If division into tokens is unsuccessful: NULL
The wcstok function is the wide-character version of the strtok function.
To search the same string for the second or later time, set s1 to NULL and ptr to the value returned by the previous function call to the same string.
Searches a specified storage area for the first occurrence of a specified character.
#include <wchar.h>
wchar_t *wmemchr(const wchar_t *s, wchar_t c, size_t n);
s Pointer to the storage area to be searched
n Number of characters to search
If the character is found: Pointer to the found character
If the character is not found: NULL
The wmemchr function is the wide-character version of the memchr function.
Calculates the length of a wide string except the terminating null wide character.
#include <wchar.h>
size_t wcslen(const wchar_t *s);
s Pointer to the wide string to check the length of
Number of characters in the wide string
The wcslen function is the wide-character version of the strlen function.
Sets a specified character a specified number of times at the beginning of a specified storage area.
#include <wchar.h>
wchar_t *wmemset(wchar_t *s, wchar_t c, size_t n);
s Pointer to storage area to set characters in
n Number of characters to be set
The wmemset function is the wide-character version of the memset function.
Checks if a specified mbstate_t object indicates the initial conversion state.
#include <wchar.h>
long mbsinit(const mbstate_t *ps);
ps Pointer to mbstate_t object
Initial conversion state: Nonzero
Calculates the number of bytes in a specified multibyte character.
#include <wchar.h>
size_t mbrlen(const char * restrict s, size_t n, mbstate_t *restrict ps);
n Maximum number of bytes to be checked for multibyte character
ps Pointer to mbstate_t object
0: A null wide character is detected in n or fewer bytes.
From 1 to n inclusive: A multibyte character is detected in n or fewer bytes.
(size_t)(2): No complete multibyte character is detected in n bytes.