add plugin op for uh_chunk_printf
[project/uhttpd.git] / plugin.c
index ecf6660..9081163 100644 (file)
--- a/plugin.c
+++ b/plugin.c
@@ -21,6 +21,8 @@
 #include "uhttpd.h"
 #include "plugin.h"
 
+static LIST_HEAD(plugins);
+
 static const struct uhttpd_ops ops = {
        .dispatch_add = uh_dispatch_add,
        .path_match = uh_path_match,
@@ -30,6 +32,7 @@ static const struct uhttpd_ops ops = {
        .client_error = uh_client_error,
        .request_done = uh_request_done,
        .chunk_write = uh_chunk_write,
+       .chunk_printf = uh_chunk_printf,
        .urlencode = uh_urlencode,
        .urldecode = uh_urldecode,
 };
@@ -53,5 +56,14 @@ int uh_plugin_init(const char *name)
                return -ENOENT;
        }
 
+       list_add(&p->list, &plugins);
        return p->init(&ops, &conf);
 }
+
+void uh_plugin_post_init(void)
+{
+       struct uhttpd_plugin *p;
+
+       list_for_each_entry(p, &plugins, list)
+               p->post_init();
+}