Files
news.gitea.happylizard.me/bin/gems/nokogiri-1.18.3-x86_64-linux-gnu/ext/nokogiri/html4_sax_parser.c
T
pizza2d1 4cee170d66
Gitea Actions Demo / Explore-Gitea-Actions (push) Failing after 9s
Add bin and edit workflow
2026-09-16 13:11:16 -06:00

41 lines
924 B
C

#include <nokogiri.h>
VALUE cNokogiriHtml4SaxParser;
static ID id_start_document;
static void
noko_html4_sax_parser_start_document(void *ctx)
{
xmlParserCtxtPtr ctxt = (xmlParserCtxtPtr)ctx;
VALUE self = (VALUE)ctxt->_private;
VALUE doc = rb_iv_get(self, "@document");
xmlSAX2StartDocument(ctx);
rb_funcall(doc, id_start_document, 0);
}
static VALUE
noko_html4_sax_parser_initialize(VALUE self)
{
xmlSAXHandlerPtr handler = noko_xml_sax_parser_unwrap(self);
rb_call_super(0, NULL);
handler->startDocument = noko_html4_sax_parser_start_document;
return self;
}
void
noko_init_html4_sax_parser(void)
{
cNokogiriHtml4SaxParser = rb_define_class_under(mNokogiriHtml4Sax, "Parser", cNokogiriXmlSaxParser);
rb_define_private_method(cNokogiriHtml4SaxParser, "initialize_native",
noko_html4_sax_parser_initialize, 0);
id_start_document = rb_intern("start_document");
}