|
CX Framework
Cross-platform C utility framework
|
Functions | |
| size_t | cstrLen (const char *s) |
| char * | cstrDup (const char *s) |
| size_t | cstrLenw (const unsigned short *s) |
| unsigned short * | cstrDupw (const unsigned short *s) |
| int | cstrCmpi (const char *s1, const char *s2) |
Portable C string helpers for common operations like length, duplication, and comparison. These functions use xalloc for memory allocation and provide optimized implementations.
| int cstrCmpi | ( | const char * | s1, |
| const char * | s2 | ||
| ) |
Case-insensitive string comparison.
Compares two strings ignoring case differences.
| s1 | First null-terminated string |
| s2 | Second null-terminated string |
| char * cstrDup | ( | const char * | s | ) |
Duplicate a null-terminated C string.
Allocates memory using xaAlloc and copies the string. The returned string must be freed with xaFree() or xaDestroy().
| s | Null-terminated string to duplicate, or NULL |
Referenced by xa_strdup().
| unsigned short * cstrDupw | ( | const unsigned short * | s | ) |
Duplicate a null-terminated wide character string.
Allocates memory using xaAlloc and copies the wide string. The returned string must be freed with xaFree() or xaDestroy().
| s | Null-terminated wide string to duplicate, or NULL |
| size_t cstrLen | ( | const char * | s | ) |
Efficiently compute the length of a null-terminated C string.
This uses an optimized word-aligned algorithm for better performance than standard strlen on most architectures.
| s | Null-terminated string |
| size_t cstrLenw | ( | const unsigned short * | s | ) |
Compute the length of a null-terminated wide character string.
| s | Null-terminated wide string (unsigned short) |