Sha256: ba6549777538a9d166941e897214473f167545f6c7ff61c4ae928021e8c18e73

Contents?: true

Size: 870 Bytes

Versions: 4

Compression:

Stored size: 870 Bytes

Contents

#include "ruby.h"
#include "swfmill_ext_to_xml.h"
#include "swfmill_ext_to_swf.h"
#include <libxml/xmlmemory.h>

VALUE rb_mSwfmill;
VALUE rb_eSwfmill_Error;
VALUE rb_eSwfmill_EOFError;

extern "C" {

static void
init_xml_memory()
{
    xmlMemSetup((xmlFreeFunc)ruby_xfree,
                (xmlMallocFunc)ruby_xmalloc,
                (xmlReallocFunc)ruby_xrealloc,
                strdup);
}

void Init_swfmill_ext(void)
{
    init_xml_memory();

    rb_mSwfmill = rb_define_module("Swfmill");
    rb_eSwfmill_Error = rb_define_class_under(rb_mSwfmill, "Error", rb_eStandardError);
    rb_eSwfmill_EOFError = rb_define_class_under(rb_mSwfmill, "EOFError", rb_eStandardError);

    rb_define_singleton_method(rb_mSwfmill, "to_xml", (VALUE (*)(...))swfmill_ext_to_xml, 2);
    rb_define_singleton_method(rb_mSwfmill, "to_swf", (VALUE (*)(...))swfmill_ext_to_swf, 2);
}

}

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
swfmill-0.0.6 ext/swfmill_ext.cc
swfmill-0.0.5 ext/swfmill_ext.cc
swfmill-0.0.4 ext/swfmill_ext.cc
swfmill-0.0.3 ext/swfmill_ext.cc