tildefriends/src/httpd.js.c

33 lines
1.1 KiB
C
Raw Normal View History

#include "httpd.js.h"
#include "log.h"
static JSValue _httpd_all(JSContext* context, JSValueConst this_val, int argc, JSValueConst* argv)
{
tf_printf("HTTPD_ALL UNIMPLEMENTED\n");
return JS_UNDEFINED;
}
static JSValue _httpd_register_socket_handler(JSContext* context, JSValueConst this_val, int argc, JSValueConst* argv)
{
tf_printf("HTTPD_REGISTER_SOCKET_HANDLER UNIMPLEMENTED\n");
return JS_UNDEFINED;
}
static JSValue _httpd_start(JSContext* context, JSValueConst this_val, int argc, JSValueConst* argv)
{
tf_printf("HTTPD_START UNIMPLEMENTED\n");
return JS_UNDEFINED;
}
void tf_httpd_register(JSContext* context)
{
JSValue global = JS_GetGlobalObject(context);
JSValue httpd = JS_NewObject(context);
JS_SetPropertyStr(context, httpd, "all", JS_NewCFunction(context, _httpd_all, "all", 2));
JS_SetPropertyStr(context, httpd, "registerSocketHandler", JS_NewCFunction(context, _httpd_register_socket_handler, "register_socket_handler", 2));
JS_SetPropertyStr(context, httpd, "start", JS_NewCFunction(context, _httpd_start, "start", 0));
JS_SetPropertyStr(context, global, "httpdc", httpd);
JS_FreeValue(context, global);
}