|
Libical API Documentation 4.0 UNRELEASED Go to the stable 3.0 documentation
|
Implements the data structure for handling string arrays. More...
Go to the source code of this file.
Functions | |
| void | icalstrarray_add (icalstrarray *array, const char *elem) |
| Appends a string to the array, omitting duplicates. | |
| void | icalstrarray_append (icalstrarray *array, const char *elem) |
| Appends a string to the array. | |
| icalstrarray * | icalstrarray_clone (icalstrarray *array) |
| Clones the array and all its elements. | |
| const char * | icalstrarray_element_at (icalstrarray *array, size_t position) |
| Accesses a string stored in the array. | |
| size_t | icalstrarray_find (icalstrarray *array, const char *needle) |
| Finds a string in the array. | |
| void | icalstrarray_free (icalstrarray *array) |
| Frees this array's memory and all its elements. | |
| void | icalstrarray_remove (icalstrarray *array, const char *del) |
| Removes all occurrences of a string. | |
| void | icalstrarray_remove_element_at (icalstrarray *array, size_t position) |
| Removes the string at an array position. | |
| size_t | icalstrarray_size (const icalstrarray *array) |
| Indicates the count of strings stored in the array. | |
| void | icalstrarray_sort (icalstrarray *array) |
| Sorts the strings in the array in ascending order. | |
Implements the data structure for handling string arrays.
Definition in file icalstrarray.c.
| void icalstrarray_add | ( | icalstrarray * | array, |
| const char * | elem ) |
Appends a string to the array, omitting duplicates.
| array | The array object to which the string append to |
| elem | The string to append |
Appends string elem to array unless a byte-equal string already is present in the array.
Definition at line 71 of file icalstrarray.c.
| void icalstrarray_append | ( | icalstrarray * | array, |
| const char * | elem ) |
Appends a string to the array.
| array | The array object to which the string append to |
| elem | The string to append |
Appends string elem to array, not checking for duplicates. Use icalstrarray_add() to only add strings that are not present already in the array.
Definition at line 59 of file icalstrarray.c.
| icalstrarray * icalstrarray_clone | ( | icalstrarray * | array | ) |
Clones the array and all its elements.
| array | The array object to clone. |
Creates an independent copy of the array and all its string elements.
Definition at line 145 of file icalstrarray.c.
| const char * icalstrarray_element_at | ( | icalstrarray * | array, |
| size_t | position ) |
Accesses a string stored in the array.
| array | The array object in which the string is stored |
| position | The slot position of the string in the array |
Accesses a string by returning a pointer to it, given an array and a valid slot position.
Definition at line 32 of file icalstrarray.c.
| size_t icalstrarray_find | ( | icalstrarray * | array, |
| const char * | needle ) |
Finds a string in the array.
| array | The array object in which to search for the string |
| needle | The string to search for |
Looks for string needle in the array, comparing strings for byte-equality. The position of the first occurrence is returned if the string is found. If the string is not found, then the count of elements in the array is returned.
Definition at line 40 of file icalstrarray.c.
| void icalstrarray_free | ( | icalstrarray * | array | ) |
Frees this array's memory and all its elements.
| array | The array object to free |
Frees the array.
Definition at line 116 of file icalstrarray.c.
| void icalstrarray_remove | ( | icalstrarray * | array, |
| const char * | del ) |
Removes all occurrences of a string.
| array | The array object from which to remove the string |
| del | The string to remove from the array |
Removes all occurrences of the string del from array.
Definition at line 96 of file icalstrarray.c.
| void icalstrarray_remove_element_at | ( | icalstrarray * | array, |
| size_t | position ) |
Removes the string at an array position.
| array | The array object from which to remove the string |
| position | The array position of the string to remove |
Removes the string at position in the array.
Definition at line 82 of file icalstrarray.c.
| size_t icalstrarray_size | ( | const icalstrarray * | array | ) |
Indicates the count of strings stored in the array.
| array | The array object in which the string is stored |
Returns the count of strings stored in the array.
Definition at line 24 of file icalstrarray.c.
| void icalstrarray_sort | ( | icalstrarray * | array | ) |
Sorts the strings in the array in ascending order.
| array | The array object to sort. |
Sorts the array such that all string elements occur in ascending order, comparing the strings as bytes.
Definition at line 137 of file icalstrarray.c.