rcutils
master
C API providing common utilities and data structures.
|
Go to the documentation of this file.
17 #ifndef RCUTILS__TYPES__STRING_ARRAY_H_
18 #define RCUTILS__TYPES__STRING_ARRAY_H_
213 sizeof(string_array->
data[0]),
221 #endif // RCUTILS__TYPES__STRING_ARRAY_H_
rcutils_allocator_t allocator
The allocator used to allocate and free memory for the string array.
Definition: string_array.h:44
The structure holding the metadata for a string array.
Definition: string_array.h:35
int rcutils_string_array_sort_compare(const void *lhs, const void *rhs)
Lexicographic comparer for pointers to string pointers.
#define RCUTILS_PUBLIC_TYPE
Definition: visibility_control.h:29
#define RCUTILS_RET_INVALID_ARGUMENT
Invalid argument return code.
Definition: rcutils_ret.h:38
#define RCUTILS_CHECK_FOR_NULL_WITH_MSG(value, msg, error_statement)
Check a value for null, with an error message and error statement.
Definition: error_handling.h:218
int rcutils_ret_t
The type that holds a return value for an rcutils operation.
Definition: rcutils_ret.h:26
rcutils_ret_t rcutils_string_array_sort(rcutils_string_array_t *string_array)
Sort a string array according to lexicographical order.
Definition: string_array.h:205
rcutils_ret_t rcutils_string_array_cmp(const rcutils_string_array_t *lhs, const rcutils_string_array_t *rhs, int *res)
Compare two string arrays.
#define RCUTILS_WARN_UNUSED
A macro to make the compiler warn when the return value of a function is not used.
Definition: macros.h:27
rcutils_ret_t rcutils_string_array_fini(rcutils_string_array_t *string_array)
Finalize a string array, reclaiming all resources.
Encapsulation of an allocator.
Definition: allocator.h:47
rcutils_string_array_t rcutils_get_zero_initialized_string_array(void)
Return an empty string array struct.
rcutils_ret_t rcutils_string_array_resize(rcutils_string_array_t *string_array, size_t new_size)
Resize a string array, reclaiming removed resources.
#define RCUTILS_PUBLIC
Definition: visibility_control.h:23
rcutils_ret_t rcutils_string_array_init(rcutils_string_array_t *string_array, size_t size, const rcutils_allocator_t *allocator)
Initialize a string array with a given size.
struct rcutils_string_array_t rcutils_string_array_t
The structure holding the metadata for a string array.
size_t size
The number of strings that can be stored in the string array.
Definition: string_array.h:38
rcutils_ret_t rcutils_qsort(void *ptr, size_t count, size_t size, int(*comp)(const void *, const void *))
Interface to qsort with rcutils-style argument validation.
char ** data
The allocated memory for the string array.
Definition: string_array.h:41