|
#define | oc_alloc_string(ocstring, size) _oc_alloc_string((ocstring), (size)) |
| allocate oc_string More...
|
|
#define | oc_bool_array(ocboolarray) (oc_cast(ocboolarray, bool)) |
|
#define | oc_bool_array_size(ocboolarray) ((ocboolarray).size) |
|
#define | oc_byte_string_array_add_item(ocstringarray, str, str_len) (_oc_byte_string_array_add_item(&(ocstringarray), str, str_len)) |
|
#define | oc_byte_string_array_get_allocated_size(ocstringarray) ((ocstringarray).size / STRING_ARRAY_ITEM_MAX_LEN) |
|
#define | oc_byte_string_array_get_item(ocstringarray, index) (oc_string(ocstringarray) + (index) * STRING_ARRAY_ITEM_MAX_LEN + 1) |
|
#define | oc_byte_string_array_get_item_size(ocstringarray, index) (*(oc_string(ocstringarray) + (index) * STRING_ARRAY_ITEM_MAX_LEN)) |
|
#define | oc_byte_string_array_set_item(ocstringarray, str, str_len, index) (_oc_copy_byte_string_to_array(&(ocstringarray), str, str_len, index)) |
|
#define | oc_cast(block, type) ((type *)(OC_MMEM_PTR(&(block)))) |
|
#define | oc_double_array(ocdoublearray) (oc_cast(ocdoublearray, double)) |
|
#define | oc_double_array_size(ocdoublearray) ((ocdoublearray).size) |
|
#define | oc_free_bool_array(ocarray) (_oc_free_array(ocarray, BYTE_POOL)) |
| free array of booleans More...
|
|
#define | oc_free_byte_string_array(ocstringarray) (_oc_free_string(ocstringarray)) |
|
#define | oc_free_double_array(ocarray) (_oc_free_array(ocarray, DOUBLE_POOL)) |
| free array of doubles More...
|
|
#define | oc_free_int_array(ocarray) (_oc_free_array(ocarray, INT_POOL)) |
| free array of integers More...
|
|
#define | oc_free_string(ocstring) _oc_free_string(ocstring) |
| free ocstring More...
|
|
#define | oc_free_string_array(ocstringarray) (_oc_free_string(ocstringarray)) |
| free oc string array More...
|
|
#define | oc_int_array(ocintarray) (oc_cast(ocintarray, int64_t)) |
|
#define | oc_int_array_size(ocintarray) ((ocintarray).size) |
|
#define | oc_new_bool_array(ocarray, size) (_oc_new_array(ocarray, size, BYTE_POOL)) |
| new boolean array More...
|
|
#define | oc_new_byte_string_array(ocstringarray, size) (_oc_alloc_string_array(ocstringarray, size)) |
|
#define | oc_new_double_array(ocarray, size) (_oc_new_array(ocarray, size, DOUBLE_POOL)) |
| new double array More...
|
|
#define | oc_new_int_array(ocarray, size) (_oc_new_array(ocarray, size, INT_POOL)) |
| new integer array More...
|
|
#define | oc_new_string(ocstring, str, str_len) _oc_new_string(ocstring, str, str_len) |
| create new string from string (not null terminated) More...
|
|
#define | oc_new_string_array(ocstringarray, size) (_oc_alloc_string_array(ocstringarray, size)) |
| new oc string array More...
|
|
#define | oc_string(ocstring) ((char *)(ocstring).ptr) |
| cast oc_string to string More...
|
|
#define | oc_string_array_add_item(ocstringarray, str) (_oc_string_array_add_item(&(ocstringarray), str)) |
|
#define | oc_string_array_get_allocated_size(ocstringarray) ((ocstringarray).size / STRING_ARRAY_ITEM_MAX_LEN) |
|
#define | oc_string_array_get_item(ocstringarray, index) (oc_string(ocstringarray) + (ptrdiff_t)((index) * STRING_ARRAY_ITEM_MAX_LEN)) |
|
#define | oc_string_array_get_item_size(ocstringarray, index) (strlen((const char *)oc_string_array_get_item(ocstringarray, index))) |
|
#define | oc_string_array_set_item(ocstringarray, str, index) (_oc_copy_string_to_array(&(ocstringarray), str, index)) |
|
#define | oc_string_len(ocstring) ((ocstring).size != 0 ? (ocstring).size - 1 : 0) |
| Get the length of the C-string stored by ocstring. More...
|
|
#define | STRING_ARRAY_ITEM_MAX_LEN (128) |
|
|
void | _oc_alloc_string (oc_string_t *ocstring, size_t size) |
| allocate oc_string More...
|
|
void | _oc_alloc_string_array (oc_string_array_t *ocstringarray, size_t size) |
| allocate string array More...
|
|
bool | _oc_byte_string_array_add_item (oc_string_array_t *ocstringarray, const char str[], size_t str_len) |
|
bool | _oc_copy_byte_string_to_array (oc_string_array_t *ocstringarray, const char str[], size_t str_len, size_t index) |
|
bool | _oc_copy_string_to_array (oc_string_array_t *ocstringarray, const char str[], size_t index) |
|
void | _oc_free_array (oc_array_t *ocarray, oc_mmem_pool_t type) |
| free array More...
|
|
void | _oc_free_string (oc_string_t *ocstring) |
| free oc string More...
|
|
void | _oc_new_array (oc_array_t *ocarray, size_t size, oc_mmem_pool_t type) |
| new array More...
|
|
void | _oc_new_string (oc_string_t *ocstring, const char *str, size_t str_len) |
| new oc_string from string More...
|
|
bool | _oc_string_array_add_item (oc_string_array_t *ocstringarray, const char str[]) |
|
void | oc_concat_strings (oc_string_t *concat, const char *str1, const char *str2) |
| Allocate a new oc_string and concat two non-empty C-strings into it. More...
|
|
int | oc_conv_byte_array_to_hex_string (const uint8_t *array, size_t array_len, char *hex_str, size_t *hex_str_len) |
| Conversions between hex encoded strings and byte arrays. More...
|
|
int | oc_conv_hex_string_to_byte_array (const char *hex_str, size_t hex_str_len, uint8_t *array, size_t *array_len) |
| convert hex string to byte array More...
|
|
void | oc_copy_string (oc_string_t *dst, const oc_string_t *src) |
| copy ocstring More...
|
|
void | oc_join_string_array (oc_string_array_t *ocstringarray, oc_string_t *ocstring) |
| Join a string array into a single string using ' ' as a delimiter. More...
|
|
void | oc_set_string (oc_string_t *dst, const char *str, size_t str_len) |
| reset ocstring contents More...
|
|
size_t | oc_string_len_unsafe (oc_string_t str) |
| Get the length of the non-NULL C-string. More...
|
|