Parameters: LandArray * a
Returns: LandArrayIterator
Parameters: LandArray * a, LandArrayIterator * i
Returns: void*
Returns: bool
Returns: int
no parameters
Returns: LandArray*
Create a new empty array.
Parameters: LandArray * self, void * data
Add data to an array.
Parameters: LandArray * self, int n
Allocate n empty (None) entries for the array. Removes any contents of the array if it already has any data added to it.
Parameters: LandArray * self
Remove the last element in the array and return it. Only the last element in an array can be removed. To remove another element, you could replace it with the last (land_array_replace_nth) and remove the last with this function.
Parameters: LandArray * self, int i
Return item at position i and replace it with the last item, shortening the array by one.
If i is the last item this is identical to land_array_pop.
Parameters: LandArray * (* array), void * data
deprecated Use land_array_add in new code, as this function might be removed in a future version.
Given a pointer to a (possibly NULL valued) array pointer, create a new node with the given data, and add to the (possibly modified) array.
Searches the array for the given data. If they are contained, return the first index i so that land_array_get_nth(array, i) == data. If the data cannot be found, -1 is returned.
Parameters: LandArray const * array, int i
Parameters: LandArray const * array
Parameters: LandArray * array, int i, void * data
Replace the array entry at the given index, and return the previous contents.
Replaces the entry at i and returns the previous data. If i is outside the size of the array, resize it.
Parameters: LandArray * array
Destroys an array. This does not destroy any of the data put into it - loop through the array before and destroy the data if there are no other references to them.
Like [land_array_destroy] but also calls land_free on every element.
Parameters: LandArray * self, int(* cmpfnc)(void const * a, void const * b)
Sorts the entries in the array. The given callback function gets passed two direct pointers to two array elements, and expects a return value determining the order: < 0: a is before b = 0: order is arbitrary > 0: a is after b
Expects all array members to be strings and sorts alphabetically.
Parameters: LandArray const * self
Parameters: LandArray * self, int(* cb)(void * item, void * data), void * data
Call the given callback for each array element. If the callback returns anything but 0, the iteration is stopped. The return value is the number of times the callback was called. The data argument simply is passed as-is to the callback.
Clear all elements in the array.
Parameters: LandArray * self, LandArray const * other
Parameters: LandArray * self, LandArray * other
Parameters: LandArray * self, int a, int b
Move item at position a so it is behind b. If b is 0 then a is moved to the beginning. If b is n then a is moved to the end.
Parameters: char const * f, int l
Parameters: LandArray * self, char const * f, int l
Parameters: LandArray * self, void * data, char const * f, int l
Parameters: LandArray const * self, char const * f, int l
Parameters: LandArray * self, LandArray const * other, char const * f, int l
Parameters: LandArray * self, LandArray * other, char const * f, int l