List Function Hooks
Definition at line 83 of file as_list.h.
#include "as_list.h"
|
int(* | append )(as_list *list, as_val *value) |
|
int(* | append_int64 )(as_list *list, int64_t value) |
|
int(* | append_str )(as_list *list, const char *value) |
|
bool(* | destroy )(as_list *list) |
|
as_list *(* | drop )(const as_list *list, uint32_t n) |
|
bool(* | foreach )(const as_list *list, as_list_foreach_callback callback, void *udata) |
|
as_val *(* | get )(const as_list *list, const uint32_t index) |
|
int64_t(* | get_int64 )(const as_list *list, const uint32_t index) |
|
char *(* | get_str )(const as_list *list, const uint32_t index) |
|
uint32_t(* | hashcode )(const as_list *list) |
|
as_val *(* | head )(const as_list *list) |
|
union as_list_iterator_u *(* | iterator_init )(const as_list *list, union as_list_iterator_u *it) |
|
union as_list_iterator_u *(* | iterator_new )(const as_list *list) |
|
int(* | prepend )(as_list *list, as_val *value) |
|
int(* | prepend_int64 )(as_list *list, int64_t value) |
|
int(* | prepend_str )(as_list *list, const char *value) |
|
int(* | set )(as_list *list, const uint32_t index, as_val *value) |
|
int(* | set_int64 )(as_list *list, const uint32_t index, int64_t value) |
|
int(* | set_str )(as_list *list, const uint32_t index, const char *value) |
|
uint32_t(* | size )(const as_list *list) |
|
as_list *(* | tail )(const as_list *list) |
|
as_list *(* | take )(const as_list *list, uint32_t n) |
|
Append a value to the list.
- Parameters
-
list | The list to append to. |
value | The value to append to the list. |
- Returns
- 0 on success. Otherwise an error occurred.
Definition at line 203 of file as_list.h.
int(* as_list_hooks::append_int64)(as_list *list, int64_t value) |
Append an int64_t value to the list.
- Parameters
-
list | The list to append to. |
value | The value to append to the list. |
- Returns
- 0 on success. Otherwise an error occurred.
Definition at line 213 of file as_list.h.
int(* as_list_hooks::append_str)(as_list *list, const char *value) |
Append a NULL-terminates string value to the list.
- Parameters
-
list | The list to append to. |
value | The value to append to the list. |
- Returns
- 0 on success. Otherwise an error occurred.
Definition at line 223 of file as_list.h.
bool(* as_list_hooks::destroy)(as_list *list) |
Releases the subtype of as_list.
- Parameters
-
map | The map instance to destroy. |
- Returns
- true on success. Otherwise false.
Definition at line 96 of file as_list.h.
Drop the first n element of the list, returning a new list.
- Parameters
-
list | The list. |
n | The number of element to drop. |
- Returns
- A new list containing the remaining elements. Otherwise NULL.
Definition at line 290 of file as_list.h.
Iterate over each element in the list can call the callback function.
- Parameters
-
map | The map to iterate. |
callback | The function to call for each element in the list. |
udata | User-data to be passed to the callback. |
- Returns
- true on success. Otherwise false.
Definition at line 315 of file as_list.h.
as_val*(* as_list_hooks::get)(const as_list *list, const uint32_t index) |
Get the value at a given index of the list.
- Parameters
-
list | The list to get the value from. |
index | The index of the value. |
- Returns
- The value at the given index on success. Otherwie NULL.
Definition at line 132 of file as_list.h.
int64_t(* as_list_hooks::get_int64)(const as_list *list, const uint32_t index) |
Get the int64_t value at a given index of the list.
- Parameters
-
list | The list to get the value from. |
index | The index of the value. |
- Returns
- The value at the given index on success. Otherwie NULL.
Definition at line 142 of file as_list.h.
char*(* as_list_hooks::get_str)(const as_list *list, const uint32_t index) |
Get the NULL-terminated string value at a given index of the list.
- Parameters
-
list | The list to get the value from. |
index | The index of the value. |
- Returns
- The value at the given index on success. Otherwie NULL.
Definition at line 152 of file as_list.h.
uint32_t(* as_list_hooks::hashcode)(const as_list *list) |
The hash value of an as_list.
- Parameters
-
list | The list to get the hashcode value for. |
- Returns
- The hashcode value.
Definition at line 109 of file as_list.h.
Return the first element in the list.
- Parameters
-
list | The list to get the value from. |
- Returns
- The first value in the list. Otherwise NULL.
Definition at line 271 of file as_list.h.
union as_list_iterator_u*(* as_list_hooks::iterator_init)(const as_list *list, union as_list_iterator_u *it) |
Initializes a stack allocated iterator to traverse over the list.
- Parameters
-
- Returns
- true on success. Otherwise false.
Definition at line 333 of file as_list.h.
union as_list_iterator_u*(* as_list_hooks::iterator_new)(const as_list *list) |
Create and initialize a new heap allocated iterator to traverse over the list.
- Parameters
-
- Returns
- true on success. Otherwise false.
Definition at line 324 of file as_list.h.
Prepend the value to the list.
- Parameters
-
list | The list to prepend to. |
value | The value to prepend to the list. |
- Returns
- 0 on success. Otherwise an error occurred.
Definition at line 237 of file as_list.h.
int(* as_list_hooks::prepend_int64)(as_list *list, int64_t value) |
Prepend an int64_t value to the list.
- Parameters
-
list | The list to prepend to. |
value | The value to prepend to the list. |
- Returns
- 0 on success. Otherwise an error occurred.
Definition at line 247 of file as_list.h.
int(* as_list_hooks::prepend_str)(as_list *list, const char *value) |
Prepend a NULL-terminates string value to the list.
- Parameters
-
list | The list to prepend to. |
value | The value to prepend to the list. |
- Returns
- 0 on success. Otherwise an error occurred.
Definition at line 257 of file as_list.h.
int(* as_list_hooks::set)(as_list *list, const uint32_t index, as_val *value) |
Set a value at the given index of the list.
- Parameters
-
list | The list to get the value from. |
index | The index of the value. |
value | The value for the given index. |
- Returns
- The value at the given index on success. Otherwie NULL.
Definition at line 167 of file as_list.h.
int(* as_list_hooks::set_int64)(as_list *list, const uint32_t index, int64_t value) |
Set an int64_t value at the given index of the list.
- Parameters
-
list | The list to get the value from. |
index | The index of the value. |
value | The value for the given index. |
- Returns
- The value at the given index on success. Otherwie NULL.
Definition at line 178 of file as_list.h.
int(* as_list_hooks::set_str)(as_list *list, const uint32_t index, const char *value) |
Set a NULL-terminated string value at the given index of the list.
- Parameters
-
list | The list to get the value from. |
index | The index of the value. |
value | The value for the given index. |
- Returns
- The value at the given index on success. Otherwie NULL.
Definition at line 189 of file as_list.h.
uint32_t(* as_list_hooks::size)(const as_list *list) |
The size of the as_list.
- Parameters
-
map | The map to get the size of. |
- Returns
- The number of entries in the map.
Definition at line 118 of file as_list.h.
Return all but the first element of the list, returning a new list.
- Parameters
-
list | The list to get the list from. |
- Returns
- The tail of the list. Otherwise NULL.
Definition at line 280 of file as_list.h.
Take the first n element of the list, returning a new list.
- Parameters
-
list | The list. |
n | The number of element to take. |
- Returns
- A new list containing the remaining elements. Otherwise NULL.
Definition at line 300 of file as_list.h.
The documentation for this struct was generated from the following file: