|
XenevaOS
|

Classes | |
| struct | lwc_context_s |
Macros | |
| #define | UNUSED(x) ((x) = (x)) |
| #define | STR_OF(str) ((char *)(str + 1)) |
| #define | CSTR_OF(str) ((const char *)(str + 1)) |
| #define | NR_BUCKETS_DEFAULT (4091) |
| #define | LWC_ALLOC(s) malloc(s) |
| #define | LWC_FREE(p) free(p) |
Typedefs | |
| typedef struct lwc_context_s | lwc_context |
| typedef lwc_hash(* | lwc_hasher) (const char *, size_t) |
| typedef int(* | lwc_strncmp) (const char *, const char *, size_t) |
| typedef void *(* | lwc_memcpy) (void *restrict, const void *restrict, size_t) |
Functions | |
| lwc_error | lwc_intern_string (const char *s, size_t slen, lwc_string **ret) |
| lwc_error | lwc_intern_substring (lwc_string *str, size_t ssoffset, size_t sslen, lwc_string **ret) |
| lwc_error | lwc_string_tolower (lwc_string *str, lwc_string **ret) |
| void | lwc_string_destroy (lwc_string *str) |
| lwc_error | lwc__intern_caseless_string (lwc_string *str) |
| void | lwc_iterate_strings (lwc_iteration_callback_fn cb, void *pw) |
| #define CSTR_OF | ( | str | ) | ((const char *)(str + 1)) |
| #define LWC_ALLOC | ( | s | ) | malloc(s) |
| #define LWC_FREE | ( | p | ) | free(p) |
| #define NR_BUCKETS_DEFAULT (4091) |
| #define STR_OF | ( | str | ) | ((char *)(str + 1)) |
| #define UNUSED | ( | x | ) | ((x) = (x)) |
| typedef struct lwc_context_s lwc_context |
| typedef void *(* lwc_memcpy) (void *restrict, const void *restrict, size_t) |
| typedef int(* lwc_strncmp) (const char *, const char *, size_t) |
| lwc_error lwc__intern_caseless_string | ( | lwc_string * | str | ) |
Intern a caseless copy of the passed string.
| str | The string to intern the caseless copy of. |
| lwc_error lwc_intern_string | ( | const char * | s, |
| size_t | slen, | ||
| lwc_string ** | ret | ||
| ) |
Intern a string.
Take a copy of the string data referred to by s and slen and intern it. The resulting lwc_string can be used for simple and caseless comparisons by lwc_string_isequal and lwc_string_caseless_isequal respectively.
| s | Pointer to the start of the string to intern. |
| slen | Length of the string in characters. (Not including any terminators) |
| ret | Pointer to lwc_string pointer to fill out. |
| lwc_error lwc_intern_substring | ( | lwc_string * | str, |
| size_t | ssoffset, | ||
| size_t | sslen, | ||
| lwc_string ** | ret | ||
| ) |
Intern a substring.
Intern a subsequence of the provided lwc_string.
| str | String to acquire substring from. |
| ssoffset | Substring offset into str. |
| sslen | Substring length. |
| ret | Pointer to pointer to lwc_string to fill out. |
| void lwc_iterate_strings | ( | lwc_iteration_callback_fn | cb, |
| void * | pw | ||
| ) |
Iterate the context and return every string in it.
If there are no strings found in the context, then this has the side effect of removing the global context which will reduce the chances of false-positives on leak checkers.
| cb | The callback to give the string to. |
| pw | The private word for the callback. |
| void lwc_string_destroy | ( | lwc_string * | str | ) |
Destroy an unreffed lwc_string.
This destroys an lwc_string whose reference count indicates that it should be.
| str | The string to unref. |
| lwc_error lwc_string_tolower | ( | lwc_string * | str, |
| lwc_string ** | ret | ||
| ) |
Optain a lowercased lwc_string from given lwc_string.
| str | String to create lowercase string from. |
| ret | Pointer to lwc_string pointer to fill out. |