Sha256: 972cb7bc9e38dc588972c993a4097400552f92fa140c43903dfebe712eb027b1

Contents?: true

Size: 1.07 KB

Versions: 261

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);

  xml_doc = noko_xml_document_unwrap(document);

  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

261 entries across 261 versions & 7 rubygems

Version Path
minato_ruby_api_client-0.2.2 vendor/bundle/ruby/3.2.0/gems/nokogiri-1.16.6-x86_64-linux/ext/nokogiri/xml_entity_reference.c
nokogiri-1.18.1-x86_64-linux-musl ext/nokogiri/xml_entity_reference.c
nokogiri-1.18.1-x86_64-linux-gnu ext/nokogiri/xml_entity_reference.c
nokogiri-1.18.1-x86_64-darwin ext/nokogiri/xml_entity_reference.c
nokogiri-1.18.1-x64-mingw-ucrt ext/nokogiri/xml_entity_reference.c
nokogiri-1.18.1-java ext/nokogiri/xml_entity_reference.c
nokogiri-1.18.1 ext/nokogiri/xml_entity_reference.c
nokogiri-1.18.1-arm-linux-musl ext/nokogiri/xml_entity_reference.c
nokogiri-1.18.1-arm-linux-gnu ext/nokogiri/xml_entity_reference.c
nokogiri-1.18.1-arm64-darwin ext/nokogiri/xml_entity_reference.c
nokogiri-1.18.1-aarch64-linux-musl ext/nokogiri/xml_entity_reference.c
nokogiri-1.18.1-aarch64-linux-gnu ext/nokogiri/xml_entity_reference.c
nokogiri-1.18.0-x86_64-linux-musl ext/nokogiri/xml_entity_reference.c
nokogiri-1.18.0-x86_64-linux-gnu ext/nokogiri/xml_entity_reference.c
nokogiri-1.18.0-x86_64-darwin ext/nokogiri/xml_entity_reference.c
nokogiri-1.18.0-x64-mingw-ucrt ext/nokogiri/xml_entity_reference.c
nokogiri-1.18.0-java ext/nokogiri/xml_entity_reference.c
nokogiri-1.18.0 ext/nokogiri/xml_entity_reference.c
nokogiri-1.18.0-arm-linux-musl ext/nokogiri/xml_entity_reference.c
nokogiri-1.18.0-arm-linux-gnu ext/nokogiri/xml_entity_reference.c