libsaria: Remove old callback framework

I moved ocarina over to the new system, so the old one can go away now
since it isn't thread safe and nothing uses it anymore.

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
This commit is contained in:
Bryan Schumaker 2012-01-21 22:11:29 -05:00
parent 6b6b2814c3
commit 3d511a1f19
2 changed files with 0 additions and 15 deletions

View File

@ -12,7 +12,6 @@ enum callback_t {
REFILTER,
};
void register_callback(callback_t, void (*)());
void set_cb_handler(void (*)(callback_t));
void trigger_callback(callback_t);

View File

@ -1,28 +1,14 @@
#include <libsaria/libsaria.h>
#include <libsaria/callback.h>
#include <map>
using namespace std;
static map<callback_t, void (*)()> callbacks;
static void (*handler_func)(callback_t);
void trigger_callback(callback_t type)
{
map<callback_t, void (*)()>::iterator it;
it=callbacks.find(type);
if (it != callbacks.end())
it->second();
if (handler_func)
handler_func(type);
}
void register_callback(callback_t type, void (* func)())
{
callbacks[type] = func;
}
void set_cb_handler(void (*func)(callback_t))
{
handler_func = func;