Please wait. This can take some minutes ...
Many resources are needed to download a project. Please understand that we have to compensate our server costs. Thank you in advance.
Project price only 1 $
You can buy this project and download/modify it how often you want.
gems.nokogiri-1.6.7.2-java.ext.nokogiri.xml_entity_decl.c Maven / Gradle / Ivy
static VALUE original_content(VALUE self )
{
xmlEntityPtr node;
Data_Get_Struct(self , xmlEntity, node);
if (!node->orig) return Qnil;
return NOKOGIRI_STR_NEW2(node->orig);
}
static VALUE get_content(VALUE self )
{
xmlEntityPtr node;
Data_Get_Struct(self , xmlEntity, node);
if (!node->content) return Qnil;
return NOKOGIRI_STR_NEW(node->content, node->length);
}
static VALUE entity_type(VALUE self )
{
xmlEntityPtr node;
Data_Get_Struct(self , xmlEntity, node);
return INT2NUM((int)node->etype);
}
static VALUE external_id(VALUE self )
{
xmlEntityPtr node;
Data_Get_Struct(self , xmlEntity, node);
if (!node->ExternalID) return Qnil;
return NOKOGIRI_STR_NEW2(node->ExternalID);
}
static VALUE system_id(VALUE self )
{
xmlEntityPtr node;
Data_Get_Struct(self , xmlEntity, node);
if (!node->SystemID) return Qnil;
return NOKOGIRI_STR_NEW2(node->SystemID);
}
VALUE cNokogiriXmlEntityDecl;
void init_xml_entity_decl()
{
VALUE nokogiri = rb_define_module("Nokogiri" );
VALUE xml = rb_define_module_under(nokogiri, "XML" );
VALUE node = rb_define_class_under(xml, "Node" , rb_cObject);
VALUE klass = rb_define_class_under(xml, "EntityDecl" , node);
cNokogiriXmlEntityDecl = klass;
rb_define_method(klass, "original_content" , original_content, 0 );
rb_define_method(klass, "content" , get_content, 0 );
rb_define_method(klass, "entity_type" , entity_type, 0 );
rb_define_method(klass, "external_id" , external_id, 0 );
rb_define_method(klass, "system_id" , system_id, 0 );
rb_const_set(cNokogiriXmlEntityDecl, rb_intern("INTERNAL_GENERAL" ),
INT2NUM(XML_INTERNAL_GENERAL_ENTITY));
rb_const_set(cNokogiriXmlEntityDecl, rb_intern("EXTERNAL_GENERAL_PARSED" ),
INT2NUM(XML_EXTERNAL_GENERAL_PARSED_ENTITY));
rb_const_set(cNokogiriXmlEntityDecl, rb_intern("EXTERNAL_GENERAL_UNPARSED" ),
INT2NUM(XML_EXTERNAL_GENERAL_UNPARSED_ENTITY));
rb_const_set(cNokogiriXmlEntityDecl, rb_intern("INTERNAL_PARAMETER" ),
INT2NUM(XML_INTERNAL_PARAMETER_ENTITY));
rb_const_set(cNokogiriXmlEntityDecl, rb_intern("EXTERNAL_PARAMETER" ),
INT2NUM(XML_EXTERNAL_PARAMETER_ENTITY));
rb_const_set(cNokogiriXmlEntityDecl, rb_intern("INTERNAL_PREDEFINED" ),
INT2NUM(XML_INTERNAL_PREDEFINED_ENTITY));
}