toxon
/
lita-tox
Archived
1
0
Fork 0

Implement Tox#kill

This commit is contained in:
Braiden Vasco 2015-09-12 17:53:41 +00:00
parent c19fd24c5e
commit a6cefab6f3
2 changed files with 14 additions and 0 deletions

View File

@ -12,5 +12,6 @@ have_library LIBTOXCORE, 'tox_get_savedata_size' and
have_library LIBTOXCORE, 'tox_get_savedata' and
have_library LIBTOXCORE, 'tox_self_get_address' and
have_library LIBTOXCORE, 'tox_bootstrap' and
have_library LIBTOXCORE, 'tox_kill' and
create_makefile "#{NAME}/#{NAME}" or exit(1)

View File

@ -30,6 +30,7 @@ static VALUE cTox_initialize(VALUE self, VALUE options);
static VALUE cTox_savedata(VALUE self);
static VALUE cTox_id(VALUE self);
static VALUE cTox_bootstrap(VALUE self, VALUE options);
static VALUE cTox_kill(VALUE self);
typedef struct Tox_Options cTox_cOptions_;
@ -47,6 +48,7 @@ void Init_tox()
rb_define_method(cTox, "savedata", cTox_savedata, 0);
rb_define_method(cTox, "id", cTox_id, 0);
rb_define_method(cTox, "bootstrap", cTox_bootstrap, 1);
rb_define_method(cTox, "kill", cTox_kill, 0);
cTox_cOptions = rb_define_class_under(cTox, "Options", rb_cObject);
rb_define_alloc_func(cTox_cOptions, cTox_cOptions_alloc);
@ -182,6 +184,17 @@ VALUE cTox_bootstrap(const VALUE self, const VALUE options)
return Qfalse;
}
VALUE cTox_kill(const VALUE self)
{
cTox_ *tox;
Data_Get_Struct(self, cTox_, tox);
tox_kill(tox->tox);
return self;
}
/******************************************************************************
* Tox::Options
******************************************************************************/