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.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.c')
-rw-r--r-- | src/modules.c | 93 |
1 files changed, 0 insertions, 93 deletions
diff --git a/src/modules.c b/src/modules.c index 34025a9af..492745497 100644 --- a/src/modules.c +++ b/src/modules.c @@ -1225,99 +1225,6 @@ void updateProtectDetails(const char *level_info_protect_word, } /** - * Deal with modules who want to lookup config directives! - * @param h The Directive to lookup in the config file - * @return 1 on success, 0 on error - **/ -int moduleGetConfigDirective(Directive * d) -{ - FILE *config; - char *dir = NULL; - char buf[1024]; - char *directive; - int linenum = 0; - int ac = 0; - char *av[MAXPARAMS]; - char *str = NULL; - char *s = NULL; - char *t = NULL; - int retval = 1; - - config = fopen(SERVICES_CONF, "r"); - if (!config) { - alog("Can't open %s", SERVICES_CONF); - return 0; - } - while (fgets(buf, sizeof(buf), config)) { - linenum++; - if (*buf == '#' || *buf == '\r' || *buf == '\n') { - continue; - } - dir = myStrGetOnlyToken(buf, '\t', 0); - if (dir) { - str = myStrGetTokenRemainder(buf, '\t', 1); - } else { - dir = myStrGetOnlyToken(buf, ' ', 0); - if (dir || (dir = myStrGetOnlyToken(buf, '\n', 0))) { - str = myStrGetTokenRemainder(buf, ' ', 1); - } else { - continue; - } - } - if (dir) { - directive = normalizeBuffer(dir); - } else { - continue; - } - - if (stricmp(directive, d->name) == 0) { - if (str) { - s = str; - while (isspace(*s)) - s++; - while (*s) { - if (ac >= MAXPARAMS) { - alog("module error: too many config. params"); - break; - } - t = s; - if (*s == '"') { - t++; - s++; - while (*s && *s != '"') { - if (*s == '\\' && s[1] != 0) - s++; - s++; - } - if (!*s) - alog("module error: Warning: unterminated double-quoted string"); - else - *s++ = 0; - } else { - s += strcspn(s, " \t\r\n"); - if (*s) - *s++ = 0; - } - av[ac++] = t; - while (isspace(*s)) - s++; - } - } - retval = parse_directive(d, directive, ac, av, linenum, 0, s); - } - if (directive) { - free(directive); - } - } - if (dir) - free(dir); - if (str) - free(str); - fclose(config); - return retval; -} - -/** * Send a notice to the user in the correct language, or english. * @param source Who sends the notice * @param u The user to send the message to |