diff options
Diffstat (limited to 'apps/osc.c')
-rw-r--r-- | apps/osc.c | 23 |
1 files changed, 14 insertions, 9 deletions
@@ -24,6 +24,7 @@ #include <stdio.h> #include <stdlib.h> +#include <assert.h> #include "osc.h" @@ -51,27 +52,31 @@ static int generic_handler(const char *path, const char *types, lo_arg ** argv, int osc_init(osc_t* o, const char* port) { - if(!o) - return -1; + assert(o != NULL); - o->st_ = lo_server_thread_new(port, print_error); // TODO: what happends when this fails? + // TODO: what happends when this fails? + o->st_ = lo_server_thread_new(port, print_error); lo_server_thread_add_method(o->st_, NULL, NULL, generic_handler, NULL); return 0; } -void osc_start(osc_t* o) +int osc_start(osc_t* o) { - if(!o) - return; + assert(o != NULL); + // TODO: what happends when this fails? lo_server_thread_start(o->st_); + + return 0; } -void osc_stop(osc_t* o) +int osc_stop(osc_t* o) { - if(!o) - return; + assert(o != NULL); + // TODO: what happends when this fails? lo_server_thread_free(o->st_); + + return 0; } |