Changeset View
Changeset View
Standalone View
Standalone View
sys/boot/efi/libefi/wchar.c
Show All 30 Lines | |||||
/* | /* | ||||
* CHAR16 related functions moved from loader. | * CHAR16 related functions moved from loader. | ||||
* Perhaps we should move those to libstand afterall, but they are | * Perhaps we should move those to libstand afterall, but they are | ||||
* needed only by UEFI. | * needed only by UEFI. | ||||
*/ | */ | ||||
int | int | ||||
wcscmp(CHAR16 *a, CHAR16 *b) | wcscmp(const CHAR16 *a, const CHAR16 *b) | ||||
{ | { | ||||
while (*a && *b && *a == *b) { | while (*a && *b && *a == *b) { | ||||
a++; | a++; | ||||
b++; | b++; | ||||
} | } | ||||
return *a - *b; | return *a - *b; | ||||
} | |||||
size_t | |||||
wcslen(const CHAR16 *s) | |||||
{ | |||||
size_t len; | |||||
for(len = 0; s[len] != '\0'; len++); | |||||
return len; | |||||
} | } | ||||
/* | /* | ||||
* cpy8to16 copies a traditional C string into a CHAR16 string and | * cpy8to16 copies a traditional C string into a CHAR16 string and | ||||
* 0 terminates it. len is the size of *dst in bytes. | * 0 terminates it. len is the size of *dst in bytes. | ||||
*/ | */ | ||||
void | void | ||||
cpy8to16(const char *src, CHAR16 *dst, size_t len) | cpy8to16(const char *src, CHAR16 *dst, size_t len) | ||||
Show All 19 Lines |