#include "rbxs.h" #include "rbxs_qname.h" #include "rbxs_dom.h" #include "rbxs_domnode.h" #include "rbxs_domnodeset.h" #include "rbxs_domattribute.h" #include "rbxs_domattributeset.h" #include "rbxs_pull.h" #include "rbxs_pullattribute.h" #include "rbxs_pullattributeset.h" #include "rbxs_utils.h" //*********************************************************************************** // Constructors //*********************************************************************************** VALUE rbxs_main_open(int argc, VALUE *argv, VALUE class) { return(rbxs_dom_open(argc,argv,cSimpleDom)); } VALUE rbxs_main_string(VALUE class, VALUE string) { return(rbxs_dom_string(cSimpleDom,string)); } VALUE rbxs_main_pull(VALUE class, VALUE what) { return(rbxs_pull_new(cSimplePull,what)); } //*********************************************************************************** // Initialize module and class //*********************************************************************************** VALUE mXML; VALUE cSimple; void Init_simple( void ) { mXML = rb_define_module( "XML" ); cSimple = rb_define_class_under( mXML, "Simple", rb_cObject ); // libxml init xmlKeepBlanksDefault(0); xmlLineNumbersDefault(0); defaultEntityLoader = xmlGetExternalEntityLoader(); xmlSetExternalEntityLoader(xmllintExternalEntityLoader); rb_define_const(cSimple, "LIBXML_VERSION", rb_str_new2(LIBXML_DOTTED_VERSION)); rb_define_const(cSimple, "VERSION", rb_str_new2(RBXS_VERSION)); rb_define_singleton_method(cSimple, "open", rbxs_main_open, -1); rb_define_singleton_method(cSimple, "string", rbxs_main_string, 1); rb_define_singleton_method(cSimple, "pull", rbxs_main_pull, 1); init_rbxs_qname(); init_rbxs_dom(); init_rbxs_domnode(); init_rbxs_domnodeset(); init_rbxs_domattribute(); init_rbxs_domattributeset(); init_rbxs_pull(); init_rbxs_pullattributeset(); init_rbxs_pullattribute(); }