axl main logo
 All Data Structures Functions Variables Typedefs Enumerations Enumerator Modules Pages
int axl_stream_inspect ( axlStream stream,
const char *  chunk,
int  inspected_size 
)

Allows to perform an inspection of the given chunk on the given stream.

The chunk will be checked to apper at the begining of the stream. This means that, having the current state of the stream, the chunk is checked to be found at the very begining of the stream.

If the function succeed, an implict call to axl_stream_accept is done. In the case you are only checking but no stream acceptance is required, use instead: axl_stream_peek.

Parameters
streamThe axlStream where the operation will be performed.
chunkThe chunk that is expected to be found at the begin of the stream.
inspected_sizeThe size of the chunk provided to be inspected.
Returns
The function returns the following values according to the result:
  • 0 if the chunk wasn't found inside the stream but no error was found.
  • 1 if the chunk is found inside the given stream.
  • -1 means that no more stream is left to satify the operation.
  • -2 means that the parameters received are wrong either because stream is a NULL reference or because chunk is the same.

References axl_true.

Referenced by axl_dtd_check_entity_ref_and_expand(), and axl_stream_inspect_several().