21 VERBOSE_ENTRY(
"mcl_size_t count = <%u>, string_array_t **array = <%p>", count, array)
35 new_array->
count = count;
48 for (index = 0; index < count; index++)
60 DEBUG_ENTRY(
"string_array_t *array = <%p>, mcl_size_t increment_value = <%u>", array, increment_value)
72 DEBUG_ENTRY(
"string_array_t *array = <%p>, string_t *string = <%p>, mcl_bool_t destroy = <%u>", array,
string, destroy)
81 MCL_DEBUG(
"Array is full. It will be resized by increment value");
94 for (index = array->
count; index < new_count; index++)
100 array->
count = new_count;
116 DEBUG_ENTRY(
"string_array_t *array = <%p>, mcl_size_t index = <%u>", array, index)
124 ASSERT_MESSAGE(index < array->index,
"Received index is out of bounds!");
129 return string_to_return;
151 temp_buffer = final_buffer;
153 for (index = 0; index < array->
index; index++)
160 MCL_DEBUG(
"String at index <%d> has been added to the final buffer = <%s>", index, final_buffer);
176 DEBUG_ENTRY(
"string_array_t **array = <%p>", array)
186 for (index = 0; index < local_array->
count; index++)
192 MCL_DEBUG(
"Current string item in string array has been destroyed.");
196 MCL_DEBUG(
"Current string item has been added to array as not destroyable. Not calling destroy.");
200 MCL_DEBUG(
"String items in the array has been released. Now freeing the array.");
void string_util_strncat(char *destination, const char *source, mcl_size_t count)
Standard library strncat wrapper.
void string_destroy(string_t **string)
Destroys the allocated resources of the string.
E_MCL_ERROR_CODE string_array_add(string_array_t *array, string_t *string, mcl_bool_t destroy)
Adds an string_t string object into the array.
Memory module header file.
#define VERBOSE_LEAVE(...)
mcl_size_t total_length
Total length of string array.
mcl_size_t count
Item count.
mcl_size_t index
Item index.
char * buffer
Buffer of string handle.
void string_array_destroy(string_array_t **array)
Destroys the string array handle.
#define ASSERT_MESSAGE(condition,...)
#define MCL_FALSE
MCL bool type.
string_t * string_array_get(string_array_t *array, mcl_size_t index)
To get the string_t string object at a specified index.
#define MCL_ERROR_RETURN_POINTER(return_value,...)
#define MCL_MALLOC(bytes)
Log utility module header file.
E_MCL_ERROR_CODE
MCL Error code definitions. Every function returning an error code uses this enum values...
#define MCL_RESIZE(p, bytes)
#define VERBOSE_ENTRY(...)
string_t * string_array_to_string(string_array_t *array)
To concatenate the strings in the array.
General invalid parameter fail.
string_array_item_t * items
Item of string array.
#define ASSERT_CODE_MESSAGE(condition, return_code,...)
mcl_bool_t destroy
To decide whether to call string_destroy() for specific item in the array when destroying the string ...
Definitions module header file.
E_MCL_ERROR_CODE string_initialize_dynamic(const char *value, mcl_size_t value_length, string_t **string)
Initializes a dynamic string_t object with the given value and length.
mcl_size_t length
Length of buffer.
E_MCL_ERROR_CODE string_array_set_increment(string_array_t *array, mcl_size_t increment_value)
Sets the increment value of the array.
E_MCL_ERROR_CODE string_array_initialize(mcl_size_t count, string_array_t **array)
String array initialize method.
string_t * string
String object.
#define DEFAULT_INCREMENT_VALUE
Default increment value of the array.
String array module header file.
mcl_size_t increment_value
Increment value.
#define MCL_ERROR_RETURN(return_value,...)