Hubbub $Id$
Classes | Typedefs | Enumerations | Functions
tokeniser.h File Reference
#include <stdbool.h>
#include <inttypes.h>
#include <hubbub/errors.h>
#include <hubbub/functypes.h>
#include <hubbub/types.h>
#include <parserutils/input/inputstream.h>

Go to the source code of this file.

Classes

union  hubbub_tokeniser_optparams
 Hubbub tokeniser option parameters. More...
 

Typedefs

typedef struct hubbub_tokeniser hubbub_tokeniser
 
typedef enum hubbub_tokeniser_opttype hubbub_tokeniser_opttype
 Hubbub tokeniser option types. More...
 
typedef union hubbub_tokeniser_optparams hubbub_tokeniser_optparams
 Hubbub tokeniser option parameters. More...
 

Enumerations

enum  hubbub_tokeniser_opttype {
  HUBBUB_TOKENISER_TOKEN_HANDLER , HUBBUB_TOKENISER_ERROR_HANDLER , HUBBUB_TOKENISER_CONTENT_MODEL , HUBBUB_TOKENISER_PROCESS_CDATA ,
  HUBBUB_TOKENISER_PAUSE
}
 Hubbub tokeniser option types. More...
 

Functions

hubbub_error hubbub_tokeniser_create (parserutils_inputstream *input, hubbub_tokeniser **tokeniser)
 Create a hubbub tokeniser. More...
 
hubbub_error hubbub_tokeniser_destroy (hubbub_tokeniser *tokeniser)
 Destroy a hubbub tokeniser. More...
 
hubbub_error hubbub_tokeniser_setopt (hubbub_tokeniser *tokeniser, hubbub_tokeniser_opttype type, hubbub_tokeniser_optparams *params)
 Configure a hubbub tokeniser. More...
 
hubbub_error hubbub_tokeniser_insert_chunk (hubbub_tokeniser *tokeniser, const uint8_t *data, size_t len)
 Insert a chunk of data into the input stream. More...
 
hubbub_error hubbub_tokeniser_run (hubbub_tokeniser *tokeniser)
 Process remaining data in the input stream. More...
 

Typedef Documentation

◆ hubbub_tokeniser

◆ hubbub_tokeniser_optparams

Hubbub tokeniser option parameters.

◆ hubbub_tokeniser_opttype

Hubbub tokeniser option types.

Enumeration Type Documentation

◆ hubbub_tokeniser_opttype

Hubbub tokeniser option types.

Enumerator
HUBBUB_TOKENISER_TOKEN_HANDLER 
HUBBUB_TOKENISER_ERROR_HANDLER 
HUBBUB_TOKENISER_CONTENT_MODEL 
HUBBUB_TOKENISER_PROCESS_CDATA 
HUBBUB_TOKENISER_PAUSE 

Function Documentation

◆ hubbub_tokeniser_create()

hubbub_error hubbub_tokeniser_create ( parserutils_inputstream *  input,
hubbub_tokeniser **  tokeniser 
)

Create a hubbub tokeniser.

Parameters
inputInput stream instance
tokeniserPointer to location to receive tokeniser instance
Returns
HUBBUB_OK on success, HUBBUB_BADPARM on bad parameters, HUBBUB_NOMEM on memory exhaustion

◆ hubbub_tokeniser_destroy()

hubbub_error hubbub_tokeniser_destroy ( hubbub_tokeniser tokeniser)

Destroy a hubbub tokeniser.

Parameters
tokeniserThe tokeniser instance to destroy
Returns
HUBBUB_OK on success, appropriate error otherwise

◆ hubbub_tokeniser_insert_chunk()

hubbub_error hubbub_tokeniser_insert_chunk ( hubbub_tokeniser tokeniser,
const uint8_t *  data,
size_t  len 
)

Insert a chunk of data into the input stream.

Inserts the given data into the input stream ready for parsing but does not cause any additional processing of the input.

Parameters
tokeniserTokeniser instance
dataData to insert (UTF-8 encoded)
lenLength, in bytes, of data
Returns
HUBBUB_OK on success, appropriate error otherwise

◆ hubbub_tokeniser_run()

hubbub_error hubbub_tokeniser_run ( hubbub_tokeniser tokeniser)

Process remaining data in the input stream.

Parameters
tokeniserThe tokeniser instance to invoke
Returns
HUBBUB_OK on success, appropriate error otherwise

◆ hubbub_tokeniser_setopt()

hubbub_error hubbub_tokeniser_setopt ( hubbub_tokeniser tokeniser,
hubbub_tokeniser_opttype  type,
hubbub_tokeniser_optparams params 
)

Configure a hubbub tokeniser.

Parameters
tokeniserThe tokeniser instance to configure
typeThe option type to set
paramsOption-specific parameters
Returns
HUBBUB_OK on success, appropriate error otherwise