src/tokeniser/tokeniser.c
hubbub_error emit_current_doctype(hubbub_tokeniser *tokeniser,
		bool force_quirks)
{
	hubbub_token token;

	/* Emit doctype */
	token.type = HUBBUB_TOKEN_DOCTYPE;
	token.data.doctype = tokeniser->context.current_doctype;
	if (force_quirks == true)
		token.data.doctype.force_quirks = true;

	/* Set pointers correctly */
	token.data.doctype.name.ptr = tokeniser->buffer->data;

	if (token.data.doctype.public_missing == false) {
		token.data.doctype.public_id.ptr = tokeniser->buffer->data + 
				token.data.doctype.name.len;
	}

	if (token.data.doctype.system_missing == false) {
		token.data.doctype.system_id.ptr = tokeniser->buffer->data +
				token.data.doctype.name.len +
				token.data.doctype.public_id.len;
	}

	return hubbub_tokeniser_emit_token(tokeniser, &token);
}
/**
 * Emit the current doctype token being stored in the tokeniser context.
 *
 * \param tokeniser	Tokeniser instance
 * \param force_quirks	Force quirks mode on this document
 * \return	true
 */
Emit the current doctype token being stored in the tokeniser context.
\param tokeniser     Tokeniser instance
\param force_quirks  Force quirks mode on this document
\return      true
Emit the current doctype token being stored in the tokeniser context . \ param tokeniser Tokeniser instance \ param force_quirks Force quirks mode on this document \ return true
hubbub_error emit_current_doctype(hubbub_tokeniser *tokeniser,
		bool force_quirks)
{
	hubbub_token token;
	token.type = HUBBUB_TOKEN_DOCTYPE;
	token.data.doctype = tokeniser->context.current_doctype;
	if (force_quirks == true)
		token.data.doctype.force_quirks = true;
	token.data.doctype.name.ptr = tokeniser->buffer->data;
	if (token.data.doctype.public_missing == false) {
		token.data.doctype.public_id.ptr = tokeniser->buffer->data + 
				token.data.doctype.name.len;
	}
	if (token.data.doctype.system_missing == false) {
		token.data.doctype.system_id.ptr = tokeniser->buffer->data +
				token.data.doctype.name.len +
				token.data.doctype.public_id.len;
	}
	return hubbub_tokeniser_emit_token(tokeniser, &token);
}
hubbub_error emit_current_doctype ( hubbub_tokeniser * tokeniser , bool force_quirks ) { hubbub_token token ; token . type = HUBBUB_TOKEN_DOCTYPE ; token . data . doctype = tokeniser -> context . current_doctype ; if ( force_quirks == true ) token . data . doctype . force_quirks = true ; token . data . doctype . name . ptr = tokeniser -> buffer -> data ; if ( token . data . doctype . public_missing == false ) { token . data . doctype . public_id . ptr = tokeniser -> buffer -> data + token . data . doctype . name . len ; } if ( token . data . doctype . system_missing == false ) { token . data . doctype . system_id . ptr = tokeniser -> buffer -> data + token . data . doctype . name . len + token . data . doctype . public_id . len ; } return hubbub_tokeniser_emit_token ( tokeniser , & token ) ; }
Emit the current doctype token being stored in the tokeniser context.
Emit the current doctype token being stored in the tokeniser context .
/* Emit doctype */ /* Set pointers correctly */