diff options
Diffstat (limited to 'plugin.h')
-rw-r--r-- | plugin.h | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/plugin.h b/plugin.h new file mode 100644 index 0000000..d3e8b36 --- /dev/null +++ b/plugin.h @@ -0,0 +1,18 @@ +#pragma once + +#include "http.h" + + +typedef enum Handler_ret_t{ + HR_HANDLED, + HR_NEXT, + HR_ERROR, +} Handler_ret_t; + +typedef Handler_ret_t (*Handler)(int sock,Headers *headers); + +typedef void (*register_callback_t)(const char *name,Handler handler); + +// Override this in the plugin; it will be called from the main application. +// It should call the callback with the plugin's handler. +void plugin_register_yourself(register_callback_t callback); |