Changeset 313 in Main for trunk/Server
- Timestamp:
- Oct 14, 2024, 8:22:06 AM (5 weeks ago)
- Location:
- trunk/Server
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Server/module.c
r312 r313 30 30 #ifdef __OS2__ 31 31 #define INCL_DOSMODULEMGR 32 #define INCL_DOSERRORS 32 33 #include <os2.h> 33 34 #else … … 43 44 void* lib; 44 45 char tmp[512]; 45 unsigned long l; 46 #ifdef __OS2__ 47 HMODULE mod; 48 #endif 46 49 chdir(config.server_root); 47 50 #if defined(__MINGW32__) || defined(_MSC_VER) || defined(__BORLANDC__) || defined(__WATCOMC__) 48 51 #ifdef __OS2__ 49 lib = NULL; 50 l = (unsigned long)lib; 51 DosLoadModule(tmp, 512, path, &l); 52 if(DosLoadModule(tmp, 512, path, &mod) != NO_ERROR){ 53 return NULL; 54 } 55 lib = (void*)mod; 52 56 #else 53 57 lib = LoadLibraryA(path); … … 68 72 #ifdef __OS2__ 69 73 void* ret; 70 DosQueryProcAddr((unsigned long)mod, 0, sym, (PFN*)&ret); 74 APIRET rc; 75 if((rc = DosQueryProcAddr((HMODULE)mod, 0, sym, (PFN*)&ret)) != NO_ERROR){ 76 cm_log("Module", "OS/2 error %d", (int)rc); 77 return NULL; 78 } 71 79 return ret; 72 80 #else … … 81 89 tw_mod_init_t mod_init = (tw_mod_init_t)tw_module_symbol(mod, "mod_init"); 82 90 if(mod_init == NULL) { 83 cm_log("Module", "Could not init a module");91 cm_log("Module", "Could not find a init call"); 84 92 return 1; 85 93 } else { -
trunk/Server/tw_module.h
r156 r313 10 10 #include "tw_config.h" 11 11 #include "tw_http.h" 12 13 #if defined(__OS2__) 14 #define INCL_DOSMODULEMGR 15 #define INCL_DOSERRORS 16 #include <os2.h> 17 #define MODULE_DECL APIENTRY 18 #else 19 #define MODULE_DECL 20 #endif 12 21 13 22 struct tw_tool { … … 38 47 #define TW_CONFIG_ERROR _TW_CONFIG_ERROR 39 48 40 typedef int ( *tw_mod_init_t)(struct tw_config* config, struct tw_tool* tools);41 typedef int ( *tw_mod_request_t)(struct tw_tool* tools, struct tw_http_request* req, struct tw_http_response* res);42 typedef int ( *tw_mod_config_t)(struct tw_tool* tools, char** argv, int argc);49 typedef int (MODULE_DECL *tw_mod_init_t)(struct tw_config* config, struct tw_tool* tools); 50 typedef int (MODULE_DECL *tw_mod_request_t)(struct tw_tool* tools, struct tw_http_request* req, struct tw_http_response* res); 51 typedef int (MODULE_DECL *tw_mod_config_t)(struct tw_tool* tools, char** argv, int argc); 43 52 44 53 #ifdef SOURCE
Note:
See TracChangeset
for help on using the changeset viewer.