/* Automatically generated by mkexports.lua */
#include <libextl/extl.h>
#include <libextl/private.h>

/* quiet warnings for generated code */
#ifdef __GNUC__
#pragma GCC diagnostic ignored "-Wunused-parameter"
#pragma GCC diagnostic ignored "-Wunused-macros"
#endif

EXTL_DEFCLASS(WTimer);
EXTL_DEFCLASS(WHook);
static bool l2chnd_v_o__WTimer(void (*fn)(), ExtlL2Param *in, ExtlL2Param *out)
{
    if(!EXTL_CHKO1(in, 0, WTimer)) return FALSE;
    fn(in[0].o);
    return TRUE;
}
static bool l2chnd_v_oif__WTimer__(void (*fn)(), ExtlL2Param *in, ExtlL2Param *out)
{
    if(!EXTL_CHKO1(in, 0, WTimer)) return FALSE;
    fn(in[0].o, in[1].i, in[2].f);
    return TRUE;
}
static bool l2chnd_b_of__WHook_(bool (*fn)(), ExtlL2Param *in, ExtlL2Param *out)
{
    if(!EXTL_CHKO1(in, 0, WHook)) return FALSE;
    out[0].b=fn(in[0].o, in[1].f);
    return TRUE;
}
static bool l2chnd_d_s__(double (*fn)(), ExtlL2Param *in, ExtlL2Param *out)
{
    out[0].d=fn(in[0].s);
    return TRUE;
}
static bool l2chnd_s_s__(char* (*fn)(), ExtlL2Param *in, ExtlL2Param *out)
{
    out[0].s=fn(in[0].s);
    return TRUE;
}
static bool l2chnd_o_s__(Obj* (*fn)(), ExtlL2Param *in, ExtlL2Param *out)
{
    out[0].o=fn(in[0].s);
    return TRUE;
}
static bool l2chnd_i_s__(int (*fn)(), ExtlL2Param *in, ExtlL2Param *out)
{
    out[0].i=fn(in[0].s);
    return TRUE;
}
static bool l2chnd_b_f__(bool (*fn)(), ExtlL2Param *in, ExtlL2Param *out)
{
    out[0].b=fn(in[0].f);
    return TRUE;
}
static bool l2chnd_i_sff____(int (*fn)(), ExtlL2Param *in, ExtlL2Param *out)
{
    out[0].i=fn(in[0].s, in[1].f, in[2].f);
    return TRUE;
}
static bool l2chnd_o__(Obj* (*fn)(), ExtlL2Param *in, ExtlL2Param *out)
{
    out[0].o=fn();
    return TRUE;
}
static bool l2chnd_t__(ExtlTab (*fn)(), ExtlL2Param *in, ExtlL2Param *out)
{
    out[0].t=fn();
    return TRUE;
}
static bool l2chnd_v_s__(void (*fn)(), ExtlL2Param *in, ExtlL2Param *out)
{
    fn(in[0].s);
    return TRUE;
}
static bool l2chnd_v_ss___(void (*fn)(), ExtlL2Param *in, ExtlL2Param *out)
{
    fn(in[0].s, in[1].s);
    return TRUE;
}
static bool l2chnd_t_s__(ExtlTab (*fn)(), ExtlL2Param *in, ExtlL2Param *out)
{
    out[0].t=fn(in[0].s);
    return TRUE;
}
static bool l2chnd_b_o__WTimer(bool (*fn)(), ExtlL2Param *in, ExtlL2Param *out)
{
    if(!EXTL_CHKO1(in, 0, WTimer)) return FALSE;
    out[0].b=fn(in[0].o);
    return TRUE;
}

extern void statusd_get_config();
extern void statusd_warn();
extern void create_timer_extl_owned();
extern void statusd_getloadavg();
extern void statusd_exec();
extern void mainloop_get_hook();
extern void statusd_popen_bgread();
extern void statusd_gettext();
extern void statusd_last_modified();
extern void mainloop_defer_extl();
extern void statusd_inform();


static ExtlExportedFnSpec statusd_exports[] = {
    {"get_config", statusd_get_config, "S", "t", (ExtlL2CallHandler*)l2chnd_t_s__, FALSE, FALSE, FALSE},
    {"warn", statusd_warn, "S", NULL, (ExtlL2CallHandler*)l2chnd_v_s__, FALSE, FALSE, FALSE},
    {"create_timer", create_timer_extl_owned, NULL, "o", (ExtlL2CallHandler*)l2chnd_o__, FALSE, FALSE, FALSE},
    {"getloadavg", statusd_getloadavg, NULL, "t", (ExtlL2CallHandler*)l2chnd_t__, FALSE, FALSE, FALSE},
    {"exec", statusd_exec, "S", "i", (ExtlL2CallHandler*)l2chnd_i_s__, TRUE, FALSE, FALSE},
    {"get_hook", mainloop_get_hook, "S", "o", (ExtlL2CallHandler*)l2chnd_o_s__, TRUE, FALSE, FALSE},
    {"popen_bgread", statusd_popen_bgread, "Sff", "i", (ExtlL2CallHandler*)l2chnd_i_sff____, TRUE, FALSE, FALSE},
    {"gettext", statusd_gettext, "S", "S", (ExtlL2CallHandler*)l2chnd_s_s__, FALSE, FALSE, FALSE},
    {"last_modified", statusd_last_modified, "S", "d", (ExtlL2CallHandler*)l2chnd_d_s__, FALSE, FALSE, FALSE},
    {"defer", mainloop_defer_extl, "f", "b", (ExtlL2CallHandler*)l2chnd_b_f__, TRUE, FALSE, FALSE},
    {"inform", statusd_inform, "SS", NULL, (ExtlL2CallHandler*)l2chnd_v_ss___, FALSE, FALSE, FALSE},
    {NULL, NULL, NULL, NULL, NULL, FALSE, FALSE, FALSE}
};

extern void timer_set_extl();
extern void timer_reset();
extern void timer_is_set();


static ExtlExportedFnSpec WTimer_exports[] = {
    {"set", timer_set_extl, "oif", NULL, (ExtlL2CallHandler*)l2chnd_v_oif__WTimer__, FALSE, FALSE, FALSE},
    {"reset", timer_reset, "o", NULL, (ExtlL2CallHandler*)l2chnd_v_o__WTimer, FALSE, FALSE, FALSE},
    {"is_set", timer_is_set, "o", "b", (ExtlL2CallHandler*)l2chnd_b_o__WTimer, FALSE, FALSE, FALSE},
    {NULL, NULL, NULL, NULL, NULL, FALSE, FALSE, FALSE}
};

extern void hook_add_extl();
extern void hook_listed();
extern void hook_remove_extl();


static ExtlExportedFnSpec WHook_exports[] = {
    {"add", hook_add_extl, "of", "b", (ExtlL2CallHandler*)l2chnd_b_of__WHook_, FALSE, FALSE, FALSE},
    {"listed", hook_listed, "of", "b", (ExtlL2CallHandler*)l2chnd_b_of__WHook_, TRUE, FALSE, FALSE},
    {"remove", hook_remove_extl, "of", "b", (ExtlL2CallHandler*)l2chnd_b_of__WHook_, FALSE, FALSE, FALSE},
    {NULL, NULL, NULL, NULL, NULL, FALSE, FALSE, FALSE}
};

bool statusd_register_exports()
{
    if(!extl_register_module("statusd", statusd_exports)) return FALSE;
    if(!extl_register_class("WTimer", WTimer_exports, "Obj")) return FALSE;
    if(!extl_register_class("WHook", WHook_exports, "Obj")) return FALSE;
    return TRUE;
}

void statusd_unregister_exports()
{
    extl_unregister_module("statusd", statusd_exports);
    extl_unregister_class("WTimer", WTimer_exports);
    extl_unregister_class("WHook", WHook_exports);
}

