Map Function Hooks
Definition at line 85 of file as_map.h.
#include "as_map.h"
◆ clear
int(* as_map_hooks::clear) (as_map *map) |
Clear all entries of the map.
- Parameters
-
- Returns
- 0 on success. Otherwise an error occurred.
Definition at line 154 of file as_map.h.
◆ destroy
bool(* as_map_hooks::destroy) (as_map *map) |
Releases the subtype of as_map.
- Parameters
-
map | The map instance to destroy. |
- Returns
- true on success. Otherwise false.
Definition at line 98 of file as_map.h.
◆ foreach
Iterate over each entry in the map can call the callback function.
- Parameters
-
map | The map to iterate. |
callback | The function to call for each entry in the map. |
udata | User-data to be passed to the callback. |
- Returns
- true on success. Otherwise false.
Definition at line 189 of file as_map.h.
◆ get
Set a value at the given key of the map.
- Parameters
-
map | The map to containing the (key,value) pair. |
key | The key of the value. |
- Returns
- The value on success. Otherwise NULL.
Definition at line 145 of file as_map.h.
◆ hashcode
uint32_t(* as_map_hooks::hashcode) (const as_map *map) |
The hash value of an as_map.
- Parameters
-
map | The map to get the hashcode value for. |
- Returns
- The hashcode value.
Definition at line 111 of file as_map.h.
◆ iterator_init
union as_map_iterator_u *(* as_map_hooks::iterator_init) (const as_map *map, union as_map_iterator_u *it) |
Initialize a stack allocated iterator to traverse over the entries map.
- Parameters
-
- Returns
- true on success. Otherwise false.
Definition at line 189 of file as_map.h.
◆ iterator_new
union as_map_iterator_u *(* as_map_hooks::iterator_new) (const as_map *map) |
Create and initialize a new heap allocated iterator to traverse over the entries map.
- Parameters
-
- Returns
- true on success. Otherwise false.
Definition at line 189 of file as_map.h.
◆ remove
int(* as_map_hooks::remove) (as_map *map, const as_val *key) |
Remove the entry specified by the key.
- Parameters
-
map | The map to remove the entry from. |
key | The key of the entry to be removed. |
- Returns
- 0 on success. Otherwise an error occurred.
Definition at line 164 of file as_map.h.
◆ set
Set a value of the given key in a map.
- Parameters
-
map | The map to store the (key,value) pair. |
key | The key for the given value. |
val | The value for the given key. |
- Returns
- 0 on success. Otherwise an error occurred.
Definition at line 135 of file as_map.h.
◆ set_flags
void(* as_map_hooks::set_flags) (as_map *map, uint32_t flags) |
Set map attributes.
- Parameters
-
map | The map to remove the entry from. |
flags | Flags to set. |
- Returns
- 0 on success. Otherwise an error occurred.
Definition at line 174 of file as_map.h.
◆ size
uint32_t(* as_map_hooks::size) (const as_map *map) |
The size of the as_map.
- Parameters
-
map | The map to get the size of. |
- Returns
- The number of entries in the map.
Definition at line 120 of file as_map.h.
The documentation for this struct was generated from the following file: