All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Data Fields
as_list_hooks Struct Reference

Detailed Description

List Function Hooks

Definition at line 88 of file as_list.h.

#include "as_list.h"

+ Collaboration diagram for as_list_hooks:

Data Fields

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)
 

Field Documentation

int(* as_list_hooks::append)(as_list *list, as_val *value)

Append a value to the list.

Parameters
listThe list to append to.
valueThe value to append to the list.
Returns
0 on success. Otherwise an error occurred.

Definition at line 208 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
listThe list to append to.
valueThe value to append to the list.
Returns
0 on success. Otherwise an error occurred.

Definition at line 218 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
listThe list to append to.
valueThe value to append to the list.
Returns
0 on success. Otherwise an error occurred.

Definition at line 228 of file as_list.h.

bool(* as_list_hooks::destroy)(as_list *list)

Releases the subtype of as_list.

Parameters
mapThe map instance to destroy.
Returns
true on success. Otherwise false.

Definition at line 101 of file as_list.h.

as_list*(* as_list_hooks::drop)(const as_list *list, uint32_t n)

Drop the first n element of the list, returning a new list.

Parameters
listThe list.
nThe number of element to drop.
Returns
A new list containing the remaining elements. Otherwise NULL.

Definition at line 295 of file as_list.h.

bool(* as_list_hooks::foreach)(const as_list *list, as_list_foreach_callback callback, void *udata)

Iterate over each element in the list can call the callback function.

Parameters
mapThe map to iterate.
callbackThe function to call for each element in the list.
udataUser-data to be passed to the callback.
Returns
true on success. Otherwise false.

Definition at line 320 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
listThe list to get the value from.
indexThe index of the value.
Returns
The value at the given index on success. Otherwie NULL.

Definition at line 137 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
listThe list to get the value from.
indexThe index of the value.
Returns
The value at the given index on success. Otherwie NULL.

Definition at line 147 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
listThe list to get the value from.
indexThe index of the value.
Returns
The value at the given index on success. Otherwie NULL.

Definition at line 157 of file as_list.h.

uint32_t(* as_list_hooks::hashcode)(const as_list *list)

The hash value of an as_list.

Parameters
listThe list to get the hashcode value for.
Returns
The hashcode value.

Definition at line 114 of file as_list.h.

as_val*(* as_list_hooks::head)(const as_list *list)

Return the first element in the list.

Parameters
listThe list to get the value from.
Returns
The first value in the list. Otherwise NULL.

Definition at line 276 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
listThe list to iterate.
Returns
true on success. Otherwise false.

Definition at line 338 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
listThe list to iterate.
Returns
true on success. Otherwise false.

Definition at line 329 of file as_list.h.

int(* as_list_hooks::prepend)(as_list *list, as_val *value)

Prepend the value to the list.

Parameters
listThe list to prepend to.
valueThe value to prepend to the list.
Returns
0 on success. Otherwise an error occurred.

Definition at line 242 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
listThe list to prepend to.
valueThe value to prepend to the list.
Returns
0 on success. Otherwise an error occurred.

Definition at line 252 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
listThe list to prepend to.
valueThe value to prepend to the list.
Returns
0 on success. Otherwise an error occurred.

Definition at line 262 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
listThe list to get the value from.
indexThe index of the value.
valueThe value for the given index.
Returns
The value at the given index on success. Otherwie NULL.

Definition at line 172 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
listThe list to get the value from.
indexThe index of the value.
valueThe value for the given index.
Returns
The value at the given index on success. Otherwie NULL.

Definition at line 183 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
listThe list to get the value from.
indexThe index of the value.
valueThe value for the given index.
Returns
The value at the given index on success. Otherwie NULL.

Definition at line 194 of file as_list.h.

uint32_t(* as_list_hooks::size)(const as_list *list)

The size of the as_list.

Parameters
mapThe map to get the size of.
Returns
The number of entries in the map.

Definition at line 123 of file as_list.h.

as_list*(* as_list_hooks::tail)(const as_list *list)

Return all but the first element of the list, returning a new list.

Parameters
listThe list to get the list from.
Returns
The tail of the list. Otherwise NULL.

Definition at line 285 of file as_list.h.

as_list*(* as_list_hooks::take)(const as_list *list, uint32_t n)

Take the first n element of the list, returning a new list.

Parameters
listThe list.
nThe number of element to take.
Returns
A new list containing the remaining elements. Otherwise NULL.

Definition at line 305 of file as_list.h.


The documentation for this struct was generated from the following file: