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.

Parameters:
chunk1 The first chunk to be placed on the result.
chunk2 The second chunk to be placed on the result.
Returns:
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.