src/tokeniser/tokeniser.c
hubbub_error hubbub_tokeniser_setopt(hubbub_tokeniser *tokeniser,
		hubbub_tokeniser_opttype type,
		hubbub_tokeniser_optparams *params)
{
	hubbub_error err = HUBBUB_OK;

	if (tokeniser == NULL || params == NULL)
		return HUBBUB_BADPARM;

	switch (type) {
	case HUBBUB_TOKENISER_TOKEN_HANDLER:
		tokeniser->token_handler = params->token_handler.handler;
		tokeniser->token_pw = params->token_handler.pw;
		break;
	case HUBBUB_TOKENISER_ERROR_HANDLER:
		tokeniser->error_handler = params->error_handler.handler;
		tokeniser->error_pw = params->error_handler.pw;
		break;
	case HUBBUB_TOKENISER_CONTENT_MODEL:
		tokeniser->content_model = params->content_model.model;
		break;
	case HUBBUB_TOKENISER_PROCESS_CDATA:
		tokeniser->process_cdata_section = params->process_cdata;
		break;
	case HUBBUB_TOKENISER_PAUSE:
		if (params->pause_parse == true) {
			tokeniser->paused = true;
		} else {
			if (tokeniser->paused == true) {
				tokeniser->paused = false;
				err = hubbub_tokeniser_run(tokeniser);
			}
		}
	}

	return err;
}
/**
 * Configure a hubbub tokeniser
 *
 * \param tokeniser  The tokeniser instance to configure
 * \param type       The option type to set
 * \param params     Option-specific parameters
 * \return HUBBUB_OK on success, appropriate error otherwise
 */
Configure a hubbub tokeniser
\param tokeniser  The tokeniser instance to configure
\param type       The option type to set
\param params     Option-specific parameters
\return HUBBUB_OK on success, appropriate error otherwise
Configure a hubbub tokeniser \ param tokeniser The tokeniser instance to configure \ param type The option type to set \ param params Option - specific parameters \ return HUBBUB_OK on success appropriate error otherwise
hubbub_error hubbub_tokeniser_setopt(hubbub_tokeniser *tokeniser,
		hubbub_tokeniser_opttype type,
		hubbub_tokeniser_optparams *params)
{
	hubbub_error err = HUBBUB_OK;
	if (tokeniser == NULL || params == NULL)
		return HUBBUB_BADPARM;
	switch (type) {
	case HUBBUB_TOKENISER_TOKEN_HANDLER:
		tokeniser->token_handler = params->token_handler.handler;
		tokeniser->token_pw = params->token_handler.pw;
		break;
	case HUBBUB_TOKENISER_ERROR_HANDLER:
		tokeniser->error_handler = params->error_handler.handler;
		tokeniser->error_pw = params->error_handler.pw;
		break;
	case HUBBUB_TOKENISER_CONTENT_MODEL:
		tokeniser->content_model = params->content_model.model;
		break;
	case HUBBUB_TOKENISER_PROCESS_CDATA:
		tokeniser->process_cdata_section = params->process_cdata;
		break;
	case HUBBUB_TOKENISER_PAUSE:
		if (params->pause_parse == true) {
			tokeniser->paused = true;
		} else {
			if (tokeniser->paused == true) {
				tokeniser->paused = false;
				err = hubbub_tokeniser_run(tokeniser);
			}
		}
	}
	return err;
}
hubbub_error hubbub_tokeniser_setopt ( hubbub_tokeniser * tokeniser , hubbub_tokeniser_opttype type , hubbub_tokeniser_optparams * params ) { hubbub_error err = HUBBUB_OK ; if ( tokeniser == NULL || params == NULL ) return HUBBUB_BADPARM ; switch ( type ) { case HUBBUB_TOKENISER_TOKEN_HANDLER : tokeniser -> token_handler = params -> token_handler . handler ; tokeniser -> token_pw = params -> token_handler . pw ; break ; case HUBBUB_TOKENISER_ERROR_HANDLER : tokeniser -> error_handler = params -> error_handler . handler ; tokeniser -> error_pw = params -> error_handler . pw ; break ; case HUBBUB_TOKENISER_CONTENT_MODEL : tokeniser -> content_model = params -> content_model . model ; break ; case HUBBUB_TOKENISER_PROCESS_CDATA : tokeniser -> process_cdata_section = params -> process_cdata ; break ; case HUBBUB_TOKENISER_PAUSE : if ( params -> pause_parse == true ) { tokeniser -> paused = true ; } else { if ( tokeniser -> paused == true ) { tokeniser -> paused = false ; err = hubbub_tokeniser_run ( tokeniser ) ; } } } return err ; }
Configure a hubbub tokeniser
 \param tokeniser  The tokeniser instance to configure
 \param type       The option type to set
 \param params     Option-specific parameters
 \return HUBBUB_OK on success, appropriate error otherwise
Configure a hubbub tokeniser \ param tokeniser The tokeniser instance to configure \ param type The option type to set \ param params Option - specific parameters \ return HUBBUB_OK on success appropriate error otherwise