17 #define LST_CONT(X) X->data.list->container 18 #define LST_SPACE(X) X->data.list->space 100 if (ptr->
space < size) {
292 if (i >= 0 && i<= ptr->
length)
294 else if (i < 0 && -i <= ptr->length)
362 for (i=0; i<len; i++) {
dyn_list * list
pointer to dynamic list
dyn_ushort dyn_strlen(dyn_const_str str)
Returns the length of an string.
dyn_list * list
pointer to dynamic list
trilean dyn_list_remove(dyn_c *list, dyn_ushort i)
Delete the ith element from a list.
trilean dyn_list_insert(dyn_c *list, dyn_c *element, const dyn_ushort i)
Insert a new element at the ith position into a list.
#define DYN_LIST_LEN(dyn)
Return list length.
dyn_c * container
pointer to an array of dynamic elements
trilean dyn_copy(const dyn_c *dyn, dyn_c *copy)
Deep copy dynamic element.
Dynamic data types as part of the SelectScript-VM implementation.
dyn_ushort space
elements available
trilean dyn_list_popi(dyn_c *list, dyn_short i)
Pop i elements from the end of a list.
#define DYN_INIT(dyn)
Mandatory initialization for dynamic elements (NONE)
#define DYN_LIST_GET_REF(dyn, i)
Return the reference to the ith element within a dynamic list.
dyn_c * dyn_list_push_none(dyn_c *list)
Push NONE element to the end of a list.
trilean dyn_list_get(const dyn_c *list, dyn_c *element, const dyn_short i)
Copy the ith element of a list to param element.
void * ptr
pointer to function
dyn_ushort length
elements in use
int16_t dyn_short
16bit signed integer
uint16_t dyn_ushort
16bit unsigned integer
void dyn_string_add(const dyn_c *dyn, dyn_str string)
Add string representation of dynamic element to string.
dyn_ushort length
elements in use
dyn_str str
pointer to character-array
void dyn_move(dyn_c *from, dyn_c *to)
Move dynamic element to new reference, from is of type NONE afterwards.
dyn_c * dyn_list_get_ref(const dyn_c *list, const dyn_short i)
Return a reference to the ith element within list, negative values are allowed.
dyn_ushort dyn_string_len(const dyn_c *dyn)
Calculate length of string representation of dynamic element.
trilean dyn_list_pop(dyn_c *list, dyn_c *element)
Pop the last element from the list and move it to param element.
Basic container for lists.
dyn_c * dyn_list_push(dyn_c *list, const dyn_c *element)
Push new element to the end of a list.
void dyn_strcat(dyn_str destination, dyn_const_str source)
Concatenate strings.
trilean
basic return type for truth values
trilean dyn_list_copy(const dyn_c *list, dyn_c *copy)
Make a deep copy of the entire list.
void dyn_list_string_add(const dyn_c *list, dyn_str str)
Add string representation of a list to str.
void dyn_free(dyn_c *dyn)
free allocated memory
void dyn_list_free(dyn_c *dyn)
Free the allocated memory of the entire list and set it to NONE.
trilean dyn_list_resize(dyn_c *list, dyn_ushort size)
Change the maximal space of a list.
char * dyn_str
Standard dynamic C string.
dyn_ushort dyn_list_string_len(const dyn_c *list)
Return the length of the string representation of a list.
trilean dyn_set_list_len(dyn_c *dyn, dyn_ushort len)
Set dynamic element to list with maximal length.
Basic container for dynamic data types.