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 87 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)
 
int(* concat )(as_list *list, const as_list *list2)
 
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, uint32_t index)
 
int64_t(* get_int64 )(const as_list *list, uint32_t index)
 
char *(* get_str )(const as_list *list, uint32_t index)
 
uint32_t(* hashcode )(const as_list *list)
 
as_val *(* head )(const as_list *list)
 
int(* insert )(as_list *list, uint32_t index, as_val *value)
 
int(* insert_int64 )(as_list *list, uint32_t index, int64_t value)
 
int(* insert_str )(as_list *list, uint32_t index, const char *value)
 
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(* remove )(as_list *list, uint32_t index)
 
int(* set )(as_list *list, uint32_t index, as_val *value)
 
int(* set_int64 )(as_list *list, uint32_t index, int64_t value)
 
int(* set_str )(as_list *list, 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)
 
int(* trim )(as_list *list, uint32_t index)
 

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 244 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 254 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 264 of file as_list.h.

int(* as_list_hooks::concat)(as_list *list, const as_list *list2)

Append all elements of list2, in order, to list. No new list object is created.

Parameters
listThe list to append to.
list2The list from which to append.
Returns
0 on success. Otherwise an error occurred.

Definition at line 330 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 100 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 369 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 394 of file as_list.h.

as_val*(* as_list_hooks::get)(const as_list *list, 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 136 of file as_list.h.

int64_t(* as_list_hooks::get_int64)(const as_list *list, 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 146 of file as_list.h.

char*(* as_list_hooks::get_str)(const as_list *list, 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 156 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 113 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 350 of file as_list.h.

int(* as_list_hooks::insert)(as_list *list, uint32_t index, as_val *value)

Insert a value at the given index of the list.

Parameters
listThe list to insert the value into.
indexThe index of the value.
valueThe value for the given index.
Returns
AS_ARRAYLIST_OK on success. Otherwise an error occurred.

Definition at line 208 of file as_list.h.

int(* as_list_hooks::insert_int64)(as_list *list, uint32_t index, int64_t value)

Insert an int64_t value at the given index of the list.

Parameters
listThe list to insert the value into.
indexThe index of the value.
valueThe value for the given index.
Returns
AS_ARRAYLIST_OK on success. Otherwise an error occurred.

Definition at line 219 of file as_list.h.

int(* as_list_hooks::insert_str)(as_list *list, uint32_t index, const char *value)

Insert a NULL-terminated string value at the given index of the list.

Parameters
listThe list to insert the value into.
indexThe index of the value.
valueThe value for the given index.
Returns
AS_ARRAYLIST_OK on success. Otherwise an error occurred.

Definition at line 230 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 412 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 403 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 278 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 288 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 298 of file as_list.h.

int(* as_list_hooks::remove)(as_list *list, uint32_t index)

Remove element at specified index.

Any elements beyond specified index will be shifted so their indexes decrease by 1. The element at specified index will be destroyed.

Parameters
listThe list.
indexThe index of the element to remove.
Returns
0 on success. Otherwise an error occurred.

Definition at line 315 of file as_list.h.

int(* as_list_hooks::set)(as_list *list, 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 171 of file as_list.h.

int(* as_list_hooks::set_int64)(as_list *list, 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 182 of file as_list.h.

int(* as_list_hooks::set_str)(as_list *list, 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 193 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 122 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 359 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 379 of file as_list.h.

int(* as_list_hooks::trim)(as_list *list, uint32_t index)

Delete (and destroy) all elements at and beyond specified index. Capacity is not reduced.

Parameters
listThe list to trim.
indexThe index from which to trim.
Returns
0 on success. Otherwise an error occurred.

Definition at line 341 of file as_list.h.


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