|
Wapcaplet
|
Go to the source code of this file.
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)) |
Definition at line 34 of file libwapcaplet.c.
| #define LWC_ALLOC | ( | s | ) | malloc(s) |
Definition at line 45 of file libwapcaplet.c.
| #define LWC_FREE | ( | p | ) | free(p) |
Definition at line 46 of file libwapcaplet.c.
| #define NR_BUCKETS_DEFAULT (4091) |
Definition at line 36 of file libwapcaplet.c.
| #define STR_OF | ( | str | ) | ((char *)(str + 1)) |
Definition at line 33 of file libwapcaplet.c.
| #define UNUSED | ( | x | ) | ((x) = (x)) |
Definition at line 16 of file libwapcaplet.c.
| typedef struct lwc_context_s lwc_context |
| typedef lwc_hash(* lwc_hasher) (const char *, size_t) |
Definition at line 48 of file libwapcaplet.c.
| typedef void *(* lwc_memcpy) (void *restrict, const void *restrict, size_t) |
Definition at line 50 of file libwapcaplet.c.
| typedef int(* lwc_strncmp) (const char *, const char *, size_t) |
Definition at line 49 of file libwapcaplet.c.
| 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. |
Definition at line 255 of file libwapcaplet.c.
| 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. |
Definition at line 143 of file libwapcaplet.c.
| 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. |
Definition at line 152 of file libwapcaplet.c.
| 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. |
Definition at line 270 of file libwapcaplet.c.
| 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. |
Definition at line 187 of file libwapcaplet.c.
| 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. |
Definition at line 168 of file libwapcaplet.c.