21 #ifndef SELKIELoggerBase_StrArray
22 #define SELKIELoggerBase_StrArray
73 string *
str_new(
const size_t len,
const char *ca);
76 bool str_copy(
string *dst,
const string *src);
82 bool str_update(
string *str,
const size_t len,
const char *src);
void sa_destroy(strarray *sa)
Destroy array and contents.
bool sa_copy(strarray *dst, const strarray *src)
Copy an array of strings from src to dst.
bool str_copy(string *dst, const string *src)
Update an existing string by copying the contents from another.
bool sa_init(strarray *dst, const int entries)
Initialise an already allocated array.
bool sa_move(strarray *dst, strarray *src)
Move strings from one array to another.
bool str_update(string *str, const size_t len, const char *src)
Update an existing string from a character array of given length.
bool sa_set_entry(strarray *array, const int index, string *str)
Copy a string to a given position in the array.
string * str_duplicate(const string *src)
Allocate a new string containing the contents of another.
string * str_new(const size_t len, const char *ca)
Create new string from character array.
void str_destroy(string *str)
Destroy a string and free its contents.
strarray * sa_new(int entries)
Allocate storage for a new array.
void sa_clear_entry(strarray *array, const int index)
Clear an array entry.
bool sa_create_entry(strarray *array, const int index, const size_t len, const char *src)
Create an string in a given position from a character array and length.
int entries
Maximum number of strings in array, set when calling sa_new()
string * strings
Simple array of string structures.
char * data
Character array, should be null terminated.
size_t length
This should include a terminating null byte where possible.