48 if (map != NULL && key != NULL && value != NULL)
59 new_list = realloc(map->
entries, new_size);
81 if (map != NULL && key != NULL && value != NULL)
83 size_t numStrings = 0;
84 for (
size_t index = 0; value[index] != NULL; index++)
89 if (stringList != NULL)
109 if (map != NULL && key != NULL)
113 if (strcmp(map->
entries[index].
key, key) == 0)
115 foundIndex = (int)index;
bool ConstStringList_AddStrings(ConstStringList *stringList, const char **strings, size_t numStrings)
Add an array of strings to the given string list.
void ConstStringList_Clear(ConstStringList *stringList)
Clear the specified string list. The strings in the list are left alone, but the list itself is delet...
Declaration of the MapOfStrings typedef for declaring a map of strings keyed by another string.
void MapOfStrings_Initialize(MapOfStrings *map)
Initialize the given MapOfStrings structure so it is ready for use.
void MapOfStrings_Clear(MapOfStrings *map)
Clear the given MapOfStrings object, releasing all memory associated with it. Leaves the object in an...
int MapOfStrings_Find(MapOfStrings *map, const char *key)
Find the specified key in the given MapOfStrings object, returning an index into the object.
bool MapOfStrings_AddStringList(MapOfStrings *map, const char *key, ConstStringList *value)
Add a key/value association to the given MapOfStrings object. The MapOfStrings object takes ownership...
bool MapOfStrings_AddArray(MapOfStrings *map, const char *key, const char **value)
Add a key/value association to the given MapOfStrings object, where the value is provided as a NULL-t...
Represents a list of pointers to zero-terminated strings that are to remain constant and never delete...
Represents an entry in the MapOfStrings structure, associating a string "key" with a StringList "valu...
ConstStringList * value
The "value" that is a ConstStringList object.
const char * key
A string that is associated with the value field.
Represents a list of structures that map strings to ConstStringList objects.
MapOfStringsEntry * entries
List of MapOfStringsEntry for each mapping.
size_t entries_count
Number of items in the entries list.