00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011 #ifndef _KLONE_HOOK_H_
00012 #define _KLONE_HOOK_H_
00013 #include <klone/request.h>
00014 #include <klone/response.h>
00015 #include <klone/session.h>
00016
00017 struct hook_s;
00018 typedef struct hook_s hook_t;
00019
00020 #ifdef __cplusplus
00021 extern "C" {
00022 #endif
00023
00024
00025 typedef int (*hook_server_init_t)(void);
00026 typedef int (*hook_server_term_t)(void);
00027
00028 int hook_server_init( hook_server_init_t );
00029 int hook_server_term( hook_server_term_t );
00030
00031
00032 typedef int (*hook_child_init_t)(void);
00033 typedef int (*hook_child_term_t)(void);
00034
00035 int hook_child_init( hook_child_init_t );
00036 int hook_child_term( hook_child_term_t );
00037
00038
00039 typedef int (*hook_request_t)(request_t *, response_t *);
00040 int hook_request( hook_request_t );
00041
00042
00043 int hook_create( hook_t **phook);
00044 int hook_free( hook_t *hook);
00045
00046 #ifdef ENABLE_HOOKS
00047
00048 void hooks_setup(void);
00049 #endif
00050
00051 #ifdef __cplusplus
00052 }
00053 #endif
00054
00055 #endif