toxon
/
lita-tox
Archived
1
0
Fork 0
This repository has been archived on 2023-03-27. You can view files and clone it, but cannot push or open issues or pull requests.
lita-tox/ext/tox/tox.c

34 lines
657 B
C
Raw Normal View History

2015-07-25 13:16:16 +00:00
#include <ruby.h>
2015-09-09 16:36:01 +00:00
#include <tox/tox.h>
2015-07-25 13:16:16 +00:00
void Init_tox();
2015-09-09 16:36:01 +00:00
static VALUE cTox;
static VALUE cTox_cOptions;
static VALUE cTox_cOptions_alloc(VALUE klass);
static void cTox_cOptions_free(void *ptr);
2015-07-25 13:16:16 +00:00
void Init_tox()
{
2015-09-09 16:36:01 +00:00
cTox = rb_define_class("Tox", rb_cObject);
cTox_cOptions = rb_define_class_under(cTox, "Options", rb_cObject);
rb_define_alloc_func(cTox_cOptions, cTox_cOptions_alloc);
}
VALUE cTox_cOptions_alloc(const VALUE klass)
{
struct Tox_Options *tox_options;
tox_options = ALLOC(struct Tox_Options);
return Data_Wrap_Struct(klass, NULL, cTox_cOptions_free, tox_options);
}
void cTox_cOptions_free(void *const ptr)
{
free(ptr);
2015-07-25 13:16:16 +00:00
}