diff options
author | tomsmeding <tom.smeding@gmail.com> | 2016-12-25 22:55:21 +0100 |
---|---|---|
committer | tomsmeding <tom.smeding@gmail.com> | 2016-12-25 22:56:13 +0100 |
commit | ed2b3a38ec05c566c645dc2aabfd513edff8d63b (patch) | |
tree | 388cf0c5d6a425f5d7f86783e0c67e930f94c6a4 /plugin.h | |
parent | 70431dcb67e33bd466d03fb41e5a90ba301127a4 (diff) |
Plugins
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); |