source: Main/trunk/Server/tw_module.h@ 19

Last change on this file since 19 was 18, checked in by Nishi, on Sep 14, 2024 at 9:42:40 AM

can return response now

  • Property svn:keywords set to Id
File size: 801 bytes
RevLine 
[17]1/* $Id: tw_module.h 18 2024-09-14 00:42:40Z nishi $ */
2
3#ifndef __TW_MODULE_H__
4#define __TW_MODULE_H__
5
6#include "tw_config.h"
[18]7#include "tw_http.h"
[17]8
9struct tw_tool {
10 void (*log)(const char* name, const char* log, ...);
[18]11 void (*add_version)(const char* string);
[17]12};
13
[18]14enum TW_MODULE_RETURN {
15 TW_MODULE_PASS = 0, /* Pass to the next module. */
16 TW_MODULE_STOP, /* Do not pass to the next module. */
17 TW_MODULE_ERROR /* Error, and do not pass to the next module. */
18};
19
[17]20typedef int (*tw_mod_init_t)(struct tw_config* config, struct tw_tool* tools);
[18]21typedef int (*tw_mod_request_t)(struct tw_tool* tools, struct tw_http_request* req, struct tw_http_response* res);
[17]22
23void* tw_module_load(const char* path);
24void* tw_module_symbol(void* mod, const char* sym);
25void tw_init_tools(struct tw_tool* tools);
26int tw_module_init(void* mod);
27
28#endif
Note: See TracBrowser for help on using the repository browser.