#include <stddef.h>
#include <parserutils/errors.h>
#include <parserutils/functypes.h>
Go to the source code of this file.
◆ parserutils_vector
◆ parserutils_vector_append()
Append an item to the vector
- Parameters
-
| vector | The vector to append to |
| item | The item to append |
- Returns
- PARSERUTILS_OK on success, appropriate error otherwise
◆ parserutils_vector_clear()
Clear a vector
- Parameters
-
| vector | The vector to clear |
- Returns
- PARSERUTILS_OK on success, appropriate error otherwise.
◆ parserutils_vector_create()
Create a vector
- Parameters
-
| item_size | Length, in bytes, of an item in the vector |
| chunk_size | Number of vector slots in a chunk |
| vector | Pointer to location to receive vector instance |
- Returns
- PARSERUTILS_OK on success, PARSERUTILS_BADPARM on bad parameters, PARSERUTILS_NOMEM on memory exhaustion
◆ parserutils_vector_destroy()
Destroy a vector instance
- Parameters
-
| vector | The vector to destroy |
- Returns
- PARSERUTILS_OK on success, appropriate error otherwise.
◆ parserutils_vector_get_length()
Acquire the length (in items) of the vector.
- Parameters
-
| vector | The vector to interrogate. |
| length | Pointer to location to receive length information. |
- Returns
- PARSERUTILS_OK on success, appropriate error otherwise
◆ parserutils_vector_iterate()
Iterate over a vector
- Parameters
-
| vector | The vector to iterate over |
| ctx | Pointer to an integer for the iterator to use as context. |
- Returns
- Pointer to current item, or NULL if no more
- Note
- The value pointed to by ctx must be zero to begin the iteration.
◆ parserutils_vector_peek()
Peek at an item in a vector
- Parameters
-
| vector | The vector to iterate over |
| ctx | Integer for the iterator to use as context. |
- Returns
- Pointer to item, or NULL if no more
◆ parserutils_vector_remove_last()
Remove the last item from a vector
- Parameters
-
| vector | The vector to remove from |
- Returns
- PARSERUTILS_OK on success, appropriate error otherwise