00001 /****************************************************************** 00002 ANet_Daemon/Core/ModuleLoader.c 00003 Module loading functions. 00004 00005 Part of the run-time wrapper of the ANet project. 00006 00007 Distributed under GPL: http://www.gnu.org/copyleft/gpl.html 00008 ******************************************************************/ 00009 00010 #include "Modules.h" 00011 #include "IMC.h" //inter-module communication 00012 #include "StubModule.h" 00013 00026 // define some list of ANetModuleInfo here 00027 // also define some hash of (moduleName,instanceName) -> ANetMemoryTag here 00028 00029 void Test() 00030 { 00031 LoadModules(); 00032 CreateInstance("StubModule", "Stub1"); 00033 CreateInstance("StubModule", "Stub2"); 00034 CallModuleFunction("StubModule", "Stub1", kStubMain, 10); 00035 } 00036 00037 void LoadModules() 00038 { 00039 LoadInternalModule(StubModuleLoad); 00040 } 00041 00042 void CreateInstance(char *moduleName, char *instanceName) 00043 { 00044 //store info in hash 00045 //call the module's ANetModuleCreateInstanceFuncPtr 00046 //store the instance's globals (g) in hash 00047 } 00048 00049 void LoadInternalModule(ANetModuleLoadFuncPtr func) 00050 { 00051 //call func 00052 //store info in list 00053 } 00054 00055 UInt32 ANetAddModuleName(ANetModuleInfo *modInfo, char *moduleName) 00056 { 00057 // TO use the madule structure. 00058 } 00059 00060 00061 UInt32 ANetAddFunctionMap(ANetModuleInfo *modInfo, ANetFunctionMap *funcMap) 00062 { 00063 // I am not sure as yet. 00064 } 00065