
#include <libsaria/libsaria.h>
#include <libsaria/callback.h>

#include <map>
using namespace std;

static map<callback_t, void (*)()> callbacks;

void trigger_callback(callback_t type)
{
	map<callback_t, void (*)()>::iterator it;
	it=callbacks.find(type);
	if (it != callbacks.end())
		it->second();
}

void register_callback(callback_t type, void (* func)())
{
	callbacks[type] = func;
}
