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/ns_noop_convert.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/ns_noop_convert.c')
| -rw-r--r-- | src/modules/ns_noop_convert.c | 22 |
1 files changed, 6 insertions, 16 deletions
diff --git a/src/modules/ns_noop_convert.c b/src/modules/ns_noop_convert.c index 6a2a29b09..bc9a59d02 100644 --- a/src/modules/ns_noop_convert.c +++ b/src/modules/ns_noop_convert.c @@ -88,7 +88,7 @@ class NSNOOPConvert : public Module /*************************************************************************/ -/** +/** * Load data from the db file, and populate the autoop setting * @return 0 for success **/ @@ -126,31 +126,21 @@ int mLoadData(void) /*************************************************************************/ -/** +/** * Load the configuration directives from Services configuration file. * @return 0 for success **/ int mLoadConfig(int argc, char **argv) { - char *tmp = NULL; - - Directive d[] = { - {"NSAutoOPDBName", {{PARAM_STRING, PARAM_RELOAD, &tmp}}}, - }; - - moduleGetConfigDirective(d); + ConfigReader config; + std::string tmp = config.ReadValue("ns_noop_convert", "database", DEFAULT_DB_NAME, 0); if (NSAutoOPDBName) free(NSAutoOPDBName); - if (tmp) { - NSAutoOPDBName = tmp; - } else { - NSAutoOPDBName = sstrdup(DEFAULT_DB_NAME); - alog("ns_noop: NSAutoOPDBName is not defined in Services configuration file, using default %s", NSAutoOPDBName); - } + NSAutoOPDBName = sstrdup(tmp.c_str()); - if (!NSAutoOPDBName) { + if (tmp.empty()) { alog("ns_noop: FATAL: Can't read required configuration directives!"); return MOD_STOP; } else { |
