Changeset 182 in Main for trunk/Server/module.c
- Timestamp:
- Sep 27, 2024, 9:55:12 PM (7 weeks ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Server/module.c
r159 r182 14 14 #include <stdlib.h> 15 15 16 extern struct tw_config config; 17 18 #ifdef _PSP 19 void* tw_module_load(const char* path) { return NULL; } 20 21 void* tw_module_symbol(void* mod, const char* sym) { return NULL; } 22 23 int tw_module_init(void* mod) { return 1; } 24 25 #else 26 16 27 #ifdef __MINGW32__ 17 28 #include <windows.h> … … 19 30 #include <dlfcn.h> 20 31 #endif 21 22 extern struct tw_config config;23 32 24 33 void* tw_module_load(const char* path) { … … 46 55 #endif 47 56 } 57 58 int tw_module_init(void* mod) { 59 tw_mod_init_t mod_init = (tw_mod_init_t)tw_module_symbol(mod, "mod_init"); 60 if(mod_init == NULL) { 61 cm_log("Module", "Could not init a module"); 62 return 1; 63 } else { 64 struct tw_tool tools; 65 tw_init_tools(&tools); 66 return mod_init(&config, &tools); 67 } 68 } 69 #endif 48 70 49 71 void tw_add_version(const char* string) { … … 88 110 tools->add_define = tw_add_define; 89 111 } 90 91 int tw_module_init(void* mod) {92 tw_mod_init_t mod_init = (tw_mod_init_t)tw_module_symbol(mod, "mod_init");93 if(mod_init == NULL) {94 cm_log("Module", "Could not init a module");95 return 1;96 } else {97 struct tw_tool tools;98 tw_init_tools(&tools);99 return mod_init(&config, &tools);100 }101 }
Note:
See TracChangeset
for help on using the changeset viewer.