Beispiel #1
0
static void show_strval(int mode, const char *name, const char *value)
{
    if (mode & SHOW_EVAL)
	value = mail_conf_eval(value);

    if (mode & SHOW_NAME) {
	vstream_printf("%s = %s\n", name, value);
    } else {
	vstream_printf("%s\n", value);
    }
}
Beispiel #2
0
char   *get_mail_conf_str_fn(const char *name, stupid_indent_str defval,
			             int min, int max)
{
    const char *strval;

    if ((strval = mail_conf_lookup_eval(name)) == 0) {
	strval = mail_conf_eval(defval());
	mail_conf_update(name, strval);
    }
    check_mail_conf_str(name, strval, min, max);
    return (mystrdup(strval));
}
Beispiel #3
0
static int get_def_time_unit(const char *name, const char *defval)
{
    const char *cp;

    for (cp = mail_conf_eval(defval); /* void */ ; cp++) {
	if (*cp == 0)
	    msg_panic("parameter %s: missing time unit in default value: %s",
		      name, defval);
	if (ISALPHA(*cp)) {
	    if (cp[1] != 0)
		msg_panic("parameter %s: bad time unit in default value: %s",
			  name, defval);
	    return (*cp);
	}
    }
}
Beispiel #4
0
char   *get_mail_conf_str2(const char *name1, const char *name2,
			           const char *defval,
			           int min, int max)
{
    const char *strval;
    char   *name;

    name = concatenate(name1, name2, (char *) 0);
    if ((strval = mail_conf_lookup_eval(name)) == 0) {
	strval = mail_conf_eval(defval);
	mail_conf_update(name, strval);
    }
    check_mail_conf_str(name, strval, min, max);
    myfree(name);
    return (mystrdup(strval));
}