41 dyn->data.
dict = dict;
118 for (; space<size; ++
space)
119 ptr->
key[space] = NULL;
150 for (i=0; i<
length; ++
i, ++s_key) {
250 free(dict->data.
dict);
const char * dyn_const_str
Standard dynamic C const string.
dyn_list * list
pointer to dynamic list
trilean dyn_dict_remove(dyn_c *dict, dyn_const_str key)
Remove key-value pair from dictionary.
dictionary of type dyn_dict
dyn_ushort dyn_strlen(dyn_const_str str)
Returns the length of an string.
void dyn_strcpy(dyn_str destination, dyn_const_str source)
Copy string.
dyn_c * dyn_dict_insert(dyn_c *dict, dyn_const_str key, dyn_c *value)
Insert a new key-value pair into the dictionary.
dyn_c value
dynamic element of type dyn_list
trilean dyn_dict_change(dyn_c *dict, const dyn_ushort i, const dyn_c *value)
Replace the ith element in a dictionary with a new value.
dyn_c * dyn_dict_get(const dyn_c *dict, dyn_const_str key)
Get the reference to value stored at key.
void dyn_dict_string_add(const dyn_c *dict, dyn_str string)
Add the dict-string representation to string.
dyn_str dyn_dict_get_i_key(const dyn_c *dict, const dyn_ushort i)
Get the reference to ith key in dict.
void dyn_dict_empty(dyn_c *dict)
todo
dyn_ushort dyn_dict_has_key(const dyn_c *dict, dyn_const_str key)
Check if dict has key and return its position - 1 (returns 0 if not found)
dyn_dict * dict
pointer to dynamic dictionary
trilean dyn_copy(const dyn_c *dyn, dyn_c *copy)
Deep copy dynamic element.
Dynamic data types as part of the SelectScript-VM implementation.
#define DYN_INIT(dyn)
Mandatory initialization for dynamic elements (NONE)
#define DYN_LIST_GET_REF(dyn, i)
Return the reference to the ith element within a dynamic list.
dyn_ushort space
elements available
dyn_c * dyn_dict_get_i_ref(const dyn_c *dict, const dyn_ushort i)
Get the reference to ith value in dict.
void * ptr
pointer to function
dyn_ushort dyn_dict_string_len(const dyn_c *dict)
Calculate the required string length.
#define DYN_DICT_GET_I_REF(dyn, i)
Return a reference to the ith element stored within a dictionary.
#define DYN_DICT_GET_I_KEY(dyn, i)
Return a reference to the ith key stored within a dictionary.
dyn_ushort length
elements in use
char dyn_char
Basic 8bit signed integer.
Basic container for dictionaries.
uint16_t dyn_ushort
16bit unsigned integer
void dyn_string_add(const dyn_c *dyn, dyn_str string)
Add string representation of dynamic element to string.
dyn_ushort length
elements in use
void dyn_move(dyn_c *from, dyn_c *to)
Move dynamic element to new reference, from is of type NONE afterwards.
dyn_c * dyn_list_get_ref(const dyn_c *list, const dyn_short i)
Return a reference to the ith element within list, negative values are allowed.
dyn_ushort dyn_string_len(const dyn_c *dyn)
Calculate length of string representation of dynamic element.
dyn_dict * dict
pointer to dynamic dictionary
dyn_c value
dynamic element of type dyn_list
dyn_str * key
array to C strings used as identifiers
trilean dyn_dict_copy(const dyn_c *dict, dyn_c *copy)
Copy the entire dict.
void dyn_strcat(dyn_str destination, dyn_const_str source)
Concatenate strings.
dyn_str * key
array to C strings used as identifiers
trilean
basic return type for truth values
trilean dyn_dict_resize(dyn_c *dict, dyn_ushort size)
Set the available space for elements.
#define DYN_DICT_SPACE(dyn)
Return the maximal usable number of elements of a dictionary.
dyn_char dyn_strcmp(dyn_const_str a, dyn_const_str b)
Compares the string a to the string b.
dyn_ushort dyn_length(const dyn_c *dyn)
Reterns the length of an element.
void dyn_dict_free(dyn_c *dict)
Free all allocated memory.
#define DYN_DICT_LENGTH(dyn)
Return the number of elements stored within a dictionary.
trilean dyn_set_dict(dyn_c *dyn, dyn_ushort length)
Set dyn to a dictionary with a max. length of elements.
void dyn_free(dyn_c *dyn)
free allocated memory
trilean dyn_list_resize(dyn_c *list, const dyn_ushort size)
Change the maximal space of a list.
char * dyn_str
Standard dynamic C string.
trilean dyn_set_list_len(dyn_c *dyn, dyn_ushort len)
Set dynamic element to list with maximal length.
Basic container for dynamic data types.