ucode: adjust to latest ucode api
[project/uhttpd.git] / uhttpd.h
index f77718e3201d055ea167ca1d0bae3a76f32e092f..c755df6a70bf0be74f2cfffb85a2fadf306024df 100644 (file)
--- a/uhttpd.h
+++ b/uhttpd.h
@@ -33,6 +33,9 @@
 #include <libubus.h>
 #include <json-c/json.h>
 #endif
+#ifdef HAVE_UCODE
+#include <ucode/vm.h>
+#endif
 #ifdef HAVE_TLS
 #include <libubox/ustream-ssl.h>
 #endif
@@ -59,6 +62,15 @@ struct lua_prefix {
        void *ctx;
 };
 
+#ifdef HAVE_UCODE
+struct ucode_prefix {
+       struct list_head list;
+       const char *handler;
+       const char *prefix;
+       uc_vm_t ctx;
+};
+#endif
+
 struct config {
        const char *docroot;
        const char *realm;
@@ -69,6 +81,7 @@ struct config {
        const char *cgi_path;
        const char *ubus_prefix;
        const char *ubus_socket;
+       const char *dirlist_charset;
        int no_symlinks;
        int no_dirlists;
        int network_timeout;
@@ -82,8 +95,12 @@ struct config {
        int ubus_noauth;
        int ubus_cors;
        int cgi_prefix_len;
+       int events_retry;
        struct list_head cgi_alias;
        struct list_head lua_prefix;
+#ifdef HAVE_UCODE
+       struct list_head ucode_prefix;
+#endif
 };
 
 struct auth_realm {
@@ -209,6 +226,7 @@ struct dispatch_ubus {
        struct json_tokener *jstok;
        struct json_object *jsobj;
        struct json_object *jsobj_cur;
+       char *url_path;
        int post_len;
 
        uint32_t obj;
@@ -218,6 +236,9 @@ struct dispatch_ubus {
        bool req_pending;
        bool array;
        int array_idx;
+       bool legacy; /* Got legacy request => use legacy reply */
+
+       struct ubus_subscriber sub;
 };
 #endif