Ulfius
HTTP Framework for REST Applications in C
|
Functions | |
int | u_map_init (struct _u_map *u_map) |
int | u_map_clean (struct _u_map *u_map) |
int | u_map_clean_full (struct _u_map *u_map) |
int | u_map_clean_enum (char **array) |
const char ** | u_map_enum_keys (const struct _u_map *u_map) |
const char ** | u_map_enum_values (const struct _u_map *u_map) |
int | u_map_has_key (const struct _u_map *u_map, const char *key) |
int | u_map_has_value (const struct _u_map *u_map, const char *value) |
int | u_map_has_value_binary (const struct _u_map *u_map, const char *value, size_t length) |
int | u_map_has_key_case (const struct _u_map *u_map, const char *key) |
int | u_map_has_value_case (const struct _u_map *u_map, const char *value) |
int | u_map_put (struct _u_map *u_map, const char *key, const char *value) |
int | u_map_put_binary (struct _u_map *u_map, const char *key, const char *value, uint64_t offset, size_t length) |
ssize_t | u_map_get_length (const struct _u_map *u_map, const char *key) |
ssize_t | u_map_get_case_length (const struct _u_map *u_map, const char *key) |
const char * | u_map_get (const struct _u_map *u_map, const char *key) |
const char * | u_map_get_case (const struct _u_map *u_map, const char *key) |
int | u_map_remove_from_key (struct _u_map *u_map, const char *key) |
int | u_map_remove_from_key_case (struct _u_map *u_map, const char *key) |
int | u_map_remove_from_value (struct _u_map *u_map, const char *value) |
int | u_map_remove_from_value_case (struct _u_map *u_map, const char *value) |
int | u_map_remove_from_value_binary (struct _u_map *u_map, const char *key, size_t length) |
int | u_map_remove_at (struct _u_map *u_map, const int index) |
struct _u_map * | u_map_copy (const struct _u_map *source) |
int | u_map_copy_into (struct _u_map *dest, const struct _u_map *source) |
int | u_map_count (const struct _u_map *source) |
int | u_map_empty (struct _u_map *u_map) |
struct _u_map management functions
int u_map_init | ( | struct _u_map * | u_map | ) |
initialize a struct _u_map this function MUST be called after a declaration or allocation
u_map | the _u_map to initialize |
Ulfius Framework
REST framework library
u_umap.c: Simple map structure functions definitions not memory friendly, all pointer returned must be freed after use
Copyright 2015-2022 Nicolas Mora mail@ babe loues t.or g
This program is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; version 2.1 of the License.
This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU GENERAL PUBLIC LICENSE for more details.
You should have received a copy of the GNU General Public License along with this library. If not, see http://www.gnu.org/licenses/.
int u_map_clean | ( | struct _u_map * | u_map | ) |
int u_map_clean_full | ( | struct _u_map * | u_map | ) |
int u_map_clean_enum | ( | char ** | array | ) |
free an enum return by functions u_map_enum_keys or u_map_enum_values
array | the string array to cleanup |
const char** u_map_enum_keys | ( | const struct _u_map * | u_map | ) |
const char** u_map_enum_values | ( | const struct _u_map * | u_map | ) |
int u_map_has_key | ( | const struct _u_map * | u_map, |
const char * | key | ||
) |
int u_map_has_value | ( | const struct _u_map * | u_map, |
const char * | value | ||
) |
int u_map_has_value_binary | ( | const struct _u_map * | u_map, |
const char * | value, | ||
size_t | length | ||
) |
Detects if the value exists in the _u_map, value may be any byte array search is case sensitive
u_map | the _u_map to analyze |
value | the value to look for |
length | the length of the value to look for |
int u_map_has_key_case | ( | const struct _u_map * | u_map, |
const char * | key | ||
) |
int u_map_has_value_case | ( | const struct _u_map * | u_map, |
const char * | value | ||
) |
int u_map_put | ( | struct _u_map * | u_map, |
const char * | key, | ||
const char * | value | ||
) |
add the specified key/value pair into the specified u_map if the u_map already contains a pair with the same key, replace the value
u_map | the _u_map to update |
key | the key string |
value | the value string |
int u_map_put_binary | ( | struct _u_map * | u_map, |
const char * | key, | ||
const char * | value, | ||
uint64_t | offset, | ||
size_t | length | ||
) |
add the specified key/binary value pair into the specified u_map if the u_map already contains a pair with the same key, replace the value at the specified offset with the specified length
u_map | the _u_map to update |
key | the key string |
value | the value binary |
offset | the start offset to set value in u_map value |
length | the length of value to set |
ssize_t u_map_get_length | ( | const struct _u_map * | u_map, |
const char * | key | ||
) |
get the value length corresponding to the specified key in the u_map search is case sensitive
u_map | the _u_map to analyze |
key | the key look for |
ssize_t u_map_get_case_length | ( | const struct _u_map * | u_map, |
const char * | key | ||
) |
get the value length corresponding to the specified key in the u_map search is case insensitive
u_map | the _u_map to analyze |
key | the key look for |
const char* u_map_get | ( | const struct _u_map * | u_map, |
const char * | key | ||
) |
get the value corresponding to the specified key in the u_map search is case sensitive
u_map | the _u_map to analyze |
key | the key to look for |
const char* u_map_get_case | ( | const struct _u_map * | u_map, |
const char * | key | ||
) |
get the value corresponding to the specified key in the u_map search is case insensitive
u_map | the _u_map to analyze |
key | the key to look for |
int u_map_remove_from_key | ( | struct _u_map * | u_map, |
const char * | key | ||
) |
remove an pair key/value that has the specified key search is case sensitive
u_map | the _u_map to analyze |
key | the key to look for |
int u_map_remove_from_key_case | ( | struct _u_map * | u_map, |
const char * | key | ||
) |
remove all pairs key/value that has the specified key (case insensitive search) search is case insensitive
u_map | the _u_map to analyze |
key | the key to look for |
int u_map_remove_from_value | ( | struct _u_map * | u_map, |
const char * | value | ||
) |
remove all pairs key/value that has the specified value search is case sensitive
u_map | the _u_map to analyze |
value | the value to look for |
int u_map_remove_from_value_case | ( | struct _u_map * | u_map, |
const char * | value | ||
) |
remove all pairs key/value that has the specified value search is case insensitive
u_map | the _u_map to analyze |
value | the value to look for |
int u_map_remove_from_value_binary | ( | struct _u_map * | u_map, |
const char * | key, | ||
size_t | length | ||
) |
remove all pairs key/value that has the specified value up until the specified length
u_map | the _u_map to analyze |
key | the key to look for |
length | the length of key |
int u_map_remove_at | ( | struct _u_map * | u_map, |
const int | index | ||
) |
remove the pair key/value at the specified index
u_map | the _u_map to analyze |
index | the position of the tuple to remove |
int u_map_count | ( | const struct _u_map * | source | ) |