summaryrefslogtreecommitdiff
path: root/src/modules.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/modules.c')
-rw-r--r--src/modules.c93
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