Returns the next chunk available on the stream. This function allows to get next available chunk, validating it with provided valid_chars variable, until the chunk provided are found. Currently, valid_chars is not used, so, the chunk returned is not validated against the value provided. As an example if it is required to get the encoding content, you could do the next call:
// reference to the allocated result char * result; // chunk matched variable int chunk_matched; // get the next chunk until a " or ' is found result = axl_stream_get_until (stream, NULL, &chunk_matched, TRUE, 2, "\"", "'"); Value returned from this function mustn't be deallocated. However, because the value returned is dinamically allocated by the function, you can avoid doing a double allocation operation by nullifying the internal reference to the result returned, making the caller the only owner of the reference returned. To do this use: axl_stream_nullify with LAST_CHUNK.
|