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

Last change on this file since 367 was 367, checked in by Nishi, on Oct 17, 2024 at 1:22:49 PM

some fix

  • Property svn:keywords set to Id
File size: 2.0 KB
RevLine 
[17]1/* $Id: tw_module.h 367 2024-10-17 04:22:49Z nishi $ */
2
3#ifndef __TW_MODULE_H__
4#define __TW_MODULE_H__
5
[140]6#ifdef __cplusplus
7extern "C" {
8#endif
9
[17]10#include "tw_config.h"
[18]11#include "tw_http.h"
[17]12
[367]13#ifdef __NETWARE__
14#include <nwconio.h>
15#define END_MODULE int main(){DestroyScreen(GetCurrentScreen());while(1);return 0;}
16#else
17#define END_MODULE
18#endif
19
[313]20#if defined(__OS2__)
21#define INCL_DOSMODULEMGR
22#define INCL_DOSERRORS
23#include <os2.h>
[314]24#define MODULE_DECL __export APIENTRY
[315]25#elif defined(__WATCOMC__)
26#define MODULE_DECL __export
[313]27#else
28#define MODULE_DECL
29#endif
30
[17]31struct tw_tool {
32 void (*log)(const char* name, const char* log, ...);
[18]33 void (*add_version)(const char* string);
[156]34 void (*add_define)(const char* string);
35 void (*delete_define)(const char* string);
[17]36};
37
[18]38enum TW_MODULE_RETURN {
[20]39 _TW_MODULE_PASS = 0, /* Pass to the next module. */
40 _TW_MODULE_STOP, /* Do not pass to the next module. */
[141]41 _TW_MODULE_STOP2, /* Do not pass to the next module, and do not handle response. */
[39]42 _TW_MODULE_ERROR, /* Error, and do not pass to the next module. */
43
44 _TW_CONFIG_PARSED, /* Got parsed */
45 _TW_CONFIG_NOTME, /* Did not parse */
46 _TW_CONFIG_ERROR /* Error */
[18]47};
48
[20]49#define TW_MODULE_PASS _TW_MODULE_PASS
50#define TW_MODULE_STOP _TW_MODULE_STOP
[141]51#define TW_MODULE_STOP2 _TW_MODULE_STOP2
[20]52#define TW_MODULE_ERROR(x) (_TW_MODULE_ERROR | ((x) << 8))
53
[39]54#define TW_CONFIG_PARSED _TW_CONFIG_PARSED
55#define TW_CONFIG_NOTME _TW_CONFIG_NOTME
56#define TW_CONFIG_ERROR _TW_CONFIG_ERROR
57
[315]58typedef int(MODULE_DECL* tw_mod_init_t)(struct tw_config* config, struct tw_tool* tools);
59typedef int(MODULE_DECL* tw_mod_request_t)(struct tw_tool* tools, struct tw_http_request* req, struct tw_http_response* res);
60typedef int(MODULE_DECL* tw_mod_config_t)(struct tw_tool* tools, char** argv, int argc);
[17]61
[140]62#ifdef SOURCE
[17]63void* tw_module_load(const char* path);
64void* tw_module_symbol(void* mod, const char* sym);
65void tw_init_tools(struct tw_tool* tools);
66int tw_module_init(void* mod);
[156]67
68void tw_add_version(const char* string);
69void tw_add_define(const char* string);
70void tw_delete_define(const char* string);
[140]71#endif
[17]72
[140]73#ifdef __cplusplus
74}
[17]75#endif
[140]76
77#endif
Note: See TracBrowser for help on using the repository browser.