add ipcModuleMethods::init
git-svn-id: svn://10.0.0.236/trunk@133269 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
@@ -148,6 +148,10 @@ struct ipcCommandModule
|
||||
// ipcModule interface impl
|
||||
//
|
||||
|
||||
static void Init()
|
||||
{
|
||||
}
|
||||
|
||||
static void Shutdown()
|
||||
{
|
||||
}
|
||||
@@ -187,6 +191,7 @@ ipcModuleMethods *IPC_GetCommandModuleMethods()
|
||||
static ipcModuleMethods methods =
|
||||
{
|
||||
IPC_MODULE_METHODS_VERSION,
|
||||
ipcCommandModule::Init,
|
||||
ipcCommandModule::Shutdown,
|
||||
ipcCommandModule::HandleMsg
|
||||
};
|
||||
|
||||
@@ -72,6 +72,11 @@ struct ipcModuleMethods
|
||||
//
|
||||
PRUint32 version;
|
||||
|
||||
//
|
||||
// called after this module is registered.
|
||||
//
|
||||
void (* init) (void);
|
||||
|
||||
//
|
||||
// called when this module will no longer be accessed.
|
||||
//
|
||||
|
||||
@@ -117,8 +117,11 @@ InitModuleFromLib(const char *modulesDir, const char *fileName)
|
||||
if (func) {
|
||||
ipcModuleEntry *entries = NULL;
|
||||
int count = func(&gDaemonMethods, &entries);
|
||||
for (int i=0; i<count; ++i)
|
||||
for (int i=0; i<count; ++i) {
|
||||
AddModule(entries[i].target, entries[i].methods, PR_LoadLibrary(buf));
|
||||
if (entries[i].methods->init)
|
||||
entries[i].methods->init();
|
||||
}
|
||||
}
|
||||
PR_UnloadLibrary(lib);
|
||||
}
|
||||
|
||||
@@ -12,6 +12,11 @@ static const nsID TestModuleID =
|
||||
|
||||
struct TestModule
|
||||
{
|
||||
static void Init()
|
||||
{
|
||||
printf("*** TestModule::Init\n");
|
||||
}
|
||||
|
||||
static void Shutdown()
|
||||
{
|
||||
printf("*** TestModule::Shutdown\n");
|
||||
@@ -30,6 +35,7 @@ struct TestModule
|
||||
static ipcModuleMethods gTestMethods =
|
||||
{
|
||||
IPC_MODULE_METHODS_VERSION,
|
||||
TestModule::Init,
|
||||
TestModule::Shutdown,
|
||||
TestModule::HandleMsg
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user