diff --git a/MANIFEST b/MANIFEST index f6385db..bbeaf90 100644 --- a/MANIFEST +++ b/MANIFEST @@ -11,8 +11,6 @@ ext/c/lexer.h ext/c/lexer.rl ext/c/liboga.c ext/c/liboga.h -ext/c/xml.c -ext/c/xml.h ext/java/LibogaService.java ext/java/org/liboga/xml/Lexer.java ext/java/org/liboga/xml/Lexer.rl @@ -30,4 +28,4 @@ lib/oga/xml/parser.rb lib/oga/xml/pull_parser.rb lib/oga/xml/text.rb lib/oga/xml/xml_declaration.rb -oga.gemspec \ No newline at end of file +oga.gemspec diff --git a/ext/c/lexer.h b/ext/c/lexer.h index 9da1c67..90f5014 100644 --- a/ext/c/lexer.h +++ b/ext/c/lexer.h @@ -3,8 +3,6 @@ #ifndef LIBOGA_XML_LEXER_H #define LIBOGA_XML_LEXER_H -extern VALUE oga_cLexer; - extern void Init_liboga_xml_lexer(); #endif diff --git a/ext/c/lexer.rl b/ext/c/lexer.rl index d71775e..8b0da1f 100644 --- a/ext/c/lexer.rl +++ b/ext/c/lexer.rl @@ -16,8 +16,6 @@ on `ts` and `te`) so the macro ignores this argument. #define callback_simple(name) \ liboga_xml_lexer_callback_simple(self, name); -VALUE oga_cLexer; - %%machine c_lexer; /** @@ -106,7 +104,9 @@ VALUE oga_xml_lexer_advance(VALUE self) void Init_liboga_xml_lexer() { - oga_cLexer = rb_define_class_under(oga_mXML, "Lexer", rb_cObject); + VALUE mOga = rb_const_get(rb_cObject, rb_intern("Oga")); + VALUE mXML = rb_const_get(mOga, rb_intern("XML")); + VALUE cLexer = rb_define_class_under(mXML, "Lexer", rb_cObject); - rb_define_method(oga_cLexer, "advance_native", oga_xml_lexer_advance, 0); + rb_define_method(cLexer, "advance_native", oga_xml_lexer_advance, 0); } diff --git a/ext/c/liboga.c b/ext/c/liboga.c index c49d6a1..2b0480b 100644 --- a/ext/c/liboga.c +++ b/ext/c/liboga.c @@ -1,11 +1,6 @@ #include "liboga.h" -VALUE oga_mOga; - void Init_liboga() { - oga_mOga = rb_define_module("Oga"); - - Init_liboga_xml(); Init_liboga_xml_lexer(); } diff --git a/ext/c/liboga.h b/ext/c/liboga.h index 9d81457..0c19c31 100644 --- a/ext/c/liboga.h +++ b/ext/c/liboga.h @@ -6,9 +6,6 @@ #include #include -extern VALUE oga_mOga; - -#include "xml.h" #include "lexer.h" void Init_liboga(); diff --git a/ext/c/xml.c b/ext/c/xml.c deleted file mode 100644 index 63ef162..0000000 --- a/ext/c/xml.c +++ /dev/null @@ -1,8 +0,0 @@ -#include "xml.h" - -VALUE oga_mXML; - -void Init_liboga_xml() -{ - oga_mXML = rb_define_module_under(oga_mOga, "XML"); -} diff --git a/ext/c/xml.h b/ext/c/xml.h deleted file mode 100644 index 672a579..0000000 --- a/ext/c/xml.h +++ /dev/null @@ -1,10 +0,0 @@ -#ifndef LIBOGA_XML_H -#define LIBOGA_XML_H - -#include "liboga.h" - -extern VALUE oga_mXML; - -void Init_liboga_xml(); - -#endif