toxon
/
lita-tox
Archived
1
0
Fork 0

Basic classes Tox, Tox::Options

This commit is contained in:
Braiden Vasco 2015-09-09 16:36:01 +00:00
parent 34fbcf54ec
commit 21bb7ad966
1 changed files with 26 additions and 0 deletions

View File

@ -1,7 +1,33 @@
#include <ruby.h>
#include <tox/tox.h>
void Init_tox();
static VALUE cTox;
static VALUE cTox_cOptions;
static VALUE cTox_cOptions_alloc(VALUE klass);
static void cTox_cOptions_free(void *ptr);
void Init_tox()
{
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);
}