Sha256: 07b0568957c3eaae10a3c7f0168df9a57b4f272de2e931db6df0dcb2cabf0cbf

Contents?: true

Size: 1.07 KB

Versions: 58

Compression:

Stored size: 1.07 KB

Contents

#include <nokogiri.h>

VALUE cNokogiriXmlEntityReference;

/*
 * call-seq:
 *  new(document, content)
 *
 * Create a new EntityReference element on the +document+ with +name+
 */
static VALUE
new (int argc, VALUE *argv, VALUE klass)
{
  xmlDocPtr xml_doc;
  xmlNodePtr node;
  VALUE document;
  VALUE name;
  VALUE rest;
  VALUE rb_node;

  rb_scan_args(argc, argv, "2*", &document, &name, &rest);

  Data_Get_Struct(document, xmlDoc, xml_doc);

  node = xmlNewReference(
           xml_doc,
           (const xmlChar *)StringValueCStr(name)
         );

  noko_xml_document_pin_node(node);

  rb_node = noko_xml_node_wrap(klass, node);
  rb_obj_call_init(rb_node, argc, argv);

  if (rb_block_given_p()) { rb_yield(rb_node); }

  return rb_node;
}

void
noko_init_xml_entity_reference(void)
{
  assert(cNokogiriXmlNode);
  /*
   * EntityReference represents an EntityReference node in an xml document.
   */
  cNokogiriXmlEntityReference = rb_define_class_under(mNokogiriXml, "EntityReference", cNokogiriXmlNode);

  rb_define_singleton_method(cNokogiriXmlEntityReference, "new", new, -1);
}

Version data entries

58 entries across 58 versions & 3 rubygems

Version Path
Nokogiri_precompiled_aarch64_dedshit-1.14.5 ext/nokogiri/xml_entity_reference.c
nokogiri-1.14.5 ext/nokogiri/xml_entity_reference.c
nokogiri-1.14.5-x86_64-linux ext/nokogiri/xml_entity_reference.c
nokogiri-1.14.5-x86_64-darwin ext/nokogiri/xml_entity_reference.c
nokogiri-1.14.5-x86-mingw32 ext/nokogiri/xml_entity_reference.c
nokogiri-1.14.5-x86-linux ext/nokogiri/xml_entity_reference.c
nokogiri-1.14.5-x64-mingw32 ext/nokogiri/xml_entity_reference.c
nokogiri-1.14.5-x64-mingw-ucrt ext/nokogiri/xml_entity_reference.c
nokogiri-1.14.5-java ext/nokogiri/xml_entity_reference.c
nokogiri-1.14.5-arm64-darwin ext/nokogiri/xml_entity_reference.c
nokogiri-1.14.5-arm-linux ext/nokogiri/xml_entity_reference.c
nokogiri-1.14.5-aarch64-linux ext/nokogiri/xml_entity_reference.c
nokogiri-1.14.4 ext/nokogiri/xml_entity_reference.c
nokogiri-1.14.4-x86_64-linux ext/nokogiri/xml_entity_reference.c
nokogiri-1.14.4-x86_64-darwin ext/nokogiri/xml_entity_reference.c
nokogiri-1.14.4-x86-mingw32 ext/nokogiri/xml_entity_reference.c
nokogiri-1.14.4-x86-linux ext/nokogiri/xml_entity_reference.c
nokogiri-1.14.4-x64-mingw32 ext/nokogiri/xml_entity_reference.c
nokogiri-1.14.4-x64-mingw-ucrt ext/nokogiri/xml_entity_reference.c
nokogiri-1.14.4-java ext/nokogiri/xml_entity_reference.c