Sha256: 4d8a16627c86fc8dbca2853ad6fd3df382fe7ec4268fbd6c55ecdcfb82dcd7b9

Contents?: true

Size: 813 Bytes

Versions: 265

Compression:

Stored size: 813 Bytes

Contents

#include <html_entity_lookup.h>

/*
 * call-seq:
 *  get(key)
 *
 * Get the HTML::EntityDescription for +key+
 */
static VALUE get(VALUE self, VALUE key)
{
  const htmlEntityDesc * desc =
    htmlEntityLookup((const xmlChar *)StringValueCStr(key));
  VALUE klass, args[3];

  if(NULL == desc) return Qnil;
  klass = rb_const_get(mNokogiriHtml, rb_intern("EntityDescription"));

  args[0] = INT2NUM((long)desc->value);
  args[1] = NOKOGIRI_STR_NEW2(desc->name);
  args[2] = NOKOGIRI_STR_NEW2(desc->desc);

  return rb_class_new_instance(3, args, klass);
}

void init_html_entity_lookup()
{
  VALUE nokogiri = rb_define_module("Nokogiri");
  VALUE html = rb_define_module_under(nokogiri, "HTML");
  VALUE klass = rb_define_class_under(html, "EntityLookup", rb_cObject);

  rb_define_method(klass, "get", get, 1);
}

Version data entries

265 entries across 236 versions & 20 rubygems

Version Path
files.com-1.0.55 docs/vendor/bundle/ruby/2.5.0/gems/nokogiri-1.10.1/ext/nokogiri/html_entity_lookup.c
nokogiri-1.11.0.rc2 ext/nokogiri/html_entity_lookup.c
nokogiri-1.11.0.rc2-x86_64-linux ext/nokogiri/html_entity_lookup.c
nokogiri-1.11.0.rc2-x86-mingw32 ext/nokogiri/html_entity_lookup.c
nokogiri-1.11.0.rc2-x86-linux ext/nokogiri/html_entity_lookup.c
nokogiri-1.11.0.rc2-x64-mingw32 ext/nokogiri/html_entity_lookup.c
nokogiri-1.11.0.rc2-java ext/nokogiri/html_entity_lookup.c
argon-1.3.1 vendor/bundle/ruby/2.7.0/gems/nokogiri-1.10.9/ext/nokogiri/html_entity_lookup.c
symbolic_enum-1.1.5 vendor/bundle/ruby/2.7.0/gems/nokogiri-1.10.9/ext/nokogiri/html_entity_lookup.c
nokogiri-1.10.9 ext/nokogiri/html_entity_lookup.c
nokogiri-1.10.9-x86-mingw32 ext/nokogiri/html_entity_lookup.c
nokogiri-1.10.9-x64-mingw32 ext/nokogiri/html_entity_lookup.c
nokogiri-1.10.9-java ext/nokogiri/html_entity_lookup.c
tdiary-5.1.1 vendor/bundle/ruby/2.6.0/gems/nokogiri-1.10.5/ext/nokogiri/html_entity_lookup.c
tdiary-5.1.1 vendor/bundle/ruby/2.7.0/gems/nokogiri-1.10.8/ext/nokogiri/html_entity_lookup.c
nokogiri-1.10.8 ext/nokogiri/html_entity_lookup.c
nokogiri-1.10.8-x86-mingw32 ext/nokogiri/html_entity_lookup.c
nokogiri-1.10.8-x64-mingw32 ext/nokogiri/html_entity_lookup.c
nokogiri-1.10.8-java ext/nokogiri/html_entity_lookup.c
nokogiri-1.11.0.rc1-x86_64-linux ext/nokogiri/html_entity_lookup.c