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 85 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_double )(as_list *list, double 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)
 
double(* get_double )(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_double )(as_list *list, uint32_t index, double 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_double )(as_list *list, double 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_double )(as_list *list, uint32_t index, double 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 274 of file as_list.h.

int(* as_list_hooks::append_double)(as_list *list, double value)

Append a double 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 294 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 284 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 304 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 380 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 98 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 419 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 444 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 134 of file as_list.h.

double(* as_list_hooks::get_double)(const as_list *list, uint32_t index)

Get the double 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 154 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 144 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 164 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 111 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 400 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 227 of file as_list.h.

int(* as_list_hooks::insert_double)(as_list *list, uint32_t index, double value)

Insert a double 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 249 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 238 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 260 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 462 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 453 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 318 of file as_list.h.

int(* as_list_hooks::prepend_double)(as_list *list, double value)

Prepend a double 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 338 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 328 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 348 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 365 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 179 of file as_list.h.

int(* as_list_hooks::set_double)(as_list *list, uint32_t index, double value)

Set a double 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 201 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 190 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 212 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 120 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 409 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 429 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 391 of file as_list.h.


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