axl main logo
 All Data Structures Functions Variables Typedefs Enumerations Enumerator Modules Pages
char* axl_stream_concat ( const char *  chunk1,
const char *  chunk2 

Allows to concatenate the two given strings into a single one.

The function will concatenate both string into a newly allocated string that is the result of taking chunk1 followed by chunk2.

If the function receive a NULL value for one of the string received, the result from this function will be the other string. This is done to support a common basic case where the string provided for one of the arguments is the one being used two hold an iterative result. This variable usually is NULL.

Once the string returned is no longer needed, axl_free must be used to deallocate the result.

The function will use the strlen function to calculate current chunk sizes to provide the result.

chunk1The first chunk to be placed on the result.
chunk2The second chunk to be placed on the result.
A newly allocated string, containing both strings, or NULL if fails. The only way for this function to fail is to provide two NULL references as incoming strings.

NOTE: See also axl_concat.

References AXL_LEVEL_DEBUG, axl_new, axl_return_val_if_fail, and axl_strdup().

Referenced by axl_doc_parse_strings(), and axl_node_parse_strings().