iPXE
Functions
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)
 
size_t wcsnlen (const wchar_t *string, size_t max)
 Calculate length of wide-character string. More...
 
size_t wcslen (const wchar_t *string)
 Calculate length of wide-character string. More...
 

Detailed Description

Wide-character strings.

Definition in file wchar.c.

Function Documentation

◆ FILE_LICENCE()

FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL  )

◆ 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 42 of file wchar.c.

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

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 56 of file wchar.c.

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

References wcsnlen().

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