libc: Add strxfrm()
This commit is contained in:
parent
2e9348181d
commit
2eeef9581f
@ -74,6 +74,9 @@ extern "C"
|
|||||||
/* Compares a and b based on the current locale. */
|
/* Compares a and b based on the current locale. */
|
||||||
int strcoll(const char* a, const char* b);
|
int strcoll(const char* a, const char* b);
|
||||||
|
|
||||||
|
/* Transforms src based on the current locale and stores n bytes of it in dest. */
|
||||||
|
size_t strxfrm(char* dest, const char* src, size_t n);
|
||||||
|
|
||||||
/* Searches for the needle string in the haystack string. */
|
/* Searches for the needle string in the haystack string. */
|
||||||
char* strstr(const char* haystack, const char* needle);
|
char* strstr(const char* haystack, const char* needle);
|
||||||
|
|
||||||
|
@ -136,6 +136,12 @@ extern "C"
|
|||||||
return strcmp(a, b);
|
return strcmp(a, b);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
size_t strxfrm(char* dest, const char* src, size_t n)
|
||||||
|
{
|
||||||
|
strncpy(dest, src, n);
|
||||||
|
return n;
|
||||||
|
}
|
||||||
|
|
||||||
size_t strcspn(const char* str, const char* reject)
|
size_t strcspn(const char* str, const char* reject)
|
||||||
{
|
{
|
||||||
const char* s = str;
|
const char* s = str;
|
||||||
|
Loading…
Reference in New Issue
Block a user