diff options
| author | cyberbotx <cyberbotx@5417fbe8-f217-4b02-8779-1006273d7864> | 2008-11-19 00:48:29 +0000 |
|---|---|---|
| committer | cyberbotx <cyberbotx@5417fbe8-f217-4b02-8779-1006273d7864> | 2008-11-19 00:48:29 +0000 |
| commit | 0f069f0e8becfd1770a6ce396ead7aa67e3bde06 (patch) | |
| tree | ede474534d89b32bcdcc24d58e5cca6c427d6176 /src/modules/os_info.c | |
| parent | 1a2fdff0c653562ebde967850875e5445bc0c5ae (diff) | |
Converted modules to use ConfigReader to access new config parser.
Added all module directives to new config.
Removed references to old config parser (not sure if I got them all, though).
git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/trunk@1756 5417fbe8-f217-4b02-8779-1006273d7864
Diffstat (limited to 'src/modules/os_info.c')
| -rw-r--r-- | src/modules/os_info.c | 25 |
1 files changed, 7 insertions, 18 deletions
diff --git a/src/modules/os_info.c b/src/modules/os_info.c index 4adc4e0a2..731573f37 100644 --- a/src/modules/os_info.c +++ b/src/modules/os_info.c @@ -323,7 +323,7 @@ class OSInfo : public Module ~OSInfo() { char *av[1]; - + for (int i = 0; i < 1024; i++) { /* Remove the nick Cores */ @@ -336,7 +336,7 @@ class OSInfo : public Module nc->Shrink("os_modinfo"); } } - } + } av[0] = sstrdup(EVENT_START); mSaveData(1, av); free(av[0]); @@ -401,7 +401,7 @@ int myAddNickInfo(User * u) free(c); na->nc->Shrink("os_info"); } - + moduleNoticeLang(s_NickServ, u, OINFO_DEL_SUCCESS, nick); /* NickCore not found! */ } else { @@ -666,7 +666,7 @@ int mSaveData(int argc, char **argv) /* If we have any info on this channel */ char *c; if (ci->GetExt("os_info", c)) - { + { fprintf(out, "C %s %s\n", ci->name, c); } } @@ -698,24 +698,13 @@ int mBackupData(int argc, char **argv) **/ int mLoadConfig(void) { - char *tmp = NULL; - - Directive directivas[] = { - {"OSInfoDBName", {{PARAM_STRING, PARAM_RELOAD, &tmp}}}, - }; - - Directive *d = &directivas[0]; - moduleGetConfigDirective(d); + ConfigReader config; + std::string tmp = config.ReadValue("os_info", "database", DEFAULT_DB_NAME, 0); if (OSInfoDBName) free(OSInfoDBName); - if (tmp) { - OSInfoDBName = tmp; - } else { - OSInfoDBName = sstrdup(DEFAULT_DB_NAME); - alog("os_info: OSInfoDBName is not defined in Services configuration file, using default %s", OSInfoDBName); - } + OSInfoDBName = sstrdup(tmp.c_str()); alog("os_info: Directive OSInfoDBName loaded (%s)...", OSInfoDBName); |
