iPXE
wchar.c File Reference

Wide-character strings. More...

#include <wchar.h>

Go to the source code of this file.

Functions

 FILE_LICENCE (GPL2_OR_LATER_OR_UBDL)
 FILE_SECBOOT (PERMITTED)
size_t wcsnlen (const wchar_t *string, size_t max)
 Calculate length of wide-character string.
size_t wcslen (const wchar_t *string)
 Calculate length of wide-character string.

Detailed Description

Wide-character strings.

Definition in file wchar.c.

Function Documentation

◆ FILE_LICENCE()

FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL )

◆ FILE_SECBOOT()

FILE_SECBOOT ( PERMITTED )

◆ wcsnlen()

size_t wcsnlen ( const wchar_t * string,
size_t max )

Calculate length of wide-character string.

Parameters
stringString
maxMaximum length (in wide characters)
Return values
lenLength (in wide characters, excluding terminating NUL)

Definition at line 43 of file wchar.c.

43 {
44 size_t len = 0;
45
46 while ( max-- && *(string++) )
47 len++;
48 return len;
49}
#define max(x, y)
Definition ath.h:41
ring len
Length.
Definition dwmac.h:226

References len, and max.

Referenced by efi_load_path(), string_test_exec(), and wcslen().

◆ wcslen()

size_t wcslen ( const wchar_t * string)

Calculate length of wide-character string.

Parameters
stringString
Return values
lenLength (in wide characters, excluding terminating NUL)

Definition at line 57 of file wchar.c.

57 {
58
59 return wcsnlen ( string, ( ( ~( ( size_t ) 0 ) ) /
60 sizeof ( string[0] ) ) );
61}
size_t wcsnlen(const wchar_t *string, size_t max)
Calculate length of wide-character string.
Definition wchar.c:43

References wcsnlen().

Referenced by efi_file_open(), efi_image_exec(), efi_snp_hii_append(), efivars_find(), and string_test_exec().