event.kc3
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40
diff --git a/lib/kc3/0.1/http/event.kc3 b/lib/kc3/0.1/http/event.kc3
new file mode 100644
index 0000000..e460c6d
--- /dev/null
+++ b/lib/kc3/0.1/http/event.kc3
@@ -0,0 +1,13 @@
+defmodule HTTP.Event do
+
+ def add = cfn S32 "http_event_add" (Ptr, Time)
+
+ def del = cfn S32 "event_del" (Ptr)
+
+ def dispatch = cfn S32 "event_dispatch" ()
+
+ def init = cfn Ptr "event_init" ()
+
+ def set = cfn Void "http_event_set" (Ptr, S32, S16, Cfn, Tag)
+
+end
\ No newline at end of file
diff --git a/lib/kc3/0.1/httpd.kc3 b/lib/kc3/0.1/httpd.kc3
index 2021a66..78f79e3 100644
--- a/lib/kc3/0.1/httpd.kc3
+++ b/lib/kc3/0.1/httpd.kc3
@@ -5,6 +5,7 @@ defmodule HTTPd do
require Socket.Buf
require Str
require HTTP
+ require HTTP.Event
require HTTP.Request
require HTTP.Response
@@ -39,6 +40,7 @@ defmodule HTTPd do
HTTP.mime_type_load("mime.types")
host = getenv("KC3_HTTPD_HOST")
port = getenv("KC3_HTTPD_PORT")
+ event_base = HTTP.Event.init();
server(host, port)
}
(host, port) {