#include <lib-lib/ascii.h>
#include <lib-lib/macros.h>
#include <lib-lib/buffer.h>
+#include <lib-lib/mapping.h>
#include "mutt.h"
-#include "mapping.h"
#include "mutt_curses.h"
#include "history.h"
#include "keymap.h"
path[0] = '\0';
m_strcpy(path, sizeof(path), val);
mutt_expand_path (path, sizeof(path));
- str_replace ((char **) dst->data, path);
+ m_strreplace((char **) dst->data, path);
return (1);
}
if (!check_special (dst->option, (unsigned long) val, errbuf, errlen))
return (0);
- str_replace ((char**) dst->data, val);
+ m_strreplace((char**) dst->data, val);
return (1);
}
dst->data = (unsigned long) m_strdup(val);
else {
char* s = (char*) dst->data;
- str_replace (&s, val);
+ m_strreplace(&s, val);
}
if (m_strlen(dst->init) == 0)
dst->init = m_strdup((char*) dst->data);
p_delete(&p->rx);
}
- str_replace (&p->pattern, val);
+ m_strreplace(&p->pattern, val);
p->rx = rx;
p->not = not;
struct option_t* option) {
char s[HUGE_STRING];
s[0] = '\0';
- rfc822_write_address (s, sizeof(s), *((ADDRESS**) option->data), 0);
+ rfc822_write_address (s, sizeof(s), *((address_t**) option->data), 0);
snprintf (dst, dstlen, "%s=\"%s\"", option->option, NONULL (s));
}
char* errbuf, size_t errlen) {
if (!dst)
return (0);
- rfc822_free_address ((ADDRESS**) dst->data);
+ address_delete ((address_t**) dst->data);
if (val && *val)
- *((ADDRESS**) dst->data) = rfc822_parse_adrlist (NULL, val);
+ *((address_t**) dst->data) = rfc822_parse_adrlist (NULL, val);
return (1);
}
}
else {
/* override the previous value */
- rfc822_free_address (&tmp->addr);
+ address_delete (&tmp->addr);
if (CurrentMenu == MENU_ALIAS)
set_option (OPTFORCEREDRAWINDEX);
}
}
#ifdef DEBUG
if (DebugLevel >= 2) {
- ADDRESS *a;
+ address_t *a;
/* A group is terminated with an empty address, so check a->mailbox */
for (a = tmp->addr; a && a->mailbox; a = a->next) {
r = -1;
break;
} else if (DTYPE (option->type) == DT_ADDR)
- rfc822_free_address ((ADDRESS **) option->data);
+ address_delete ((address_t **) option->data);
else if (DTYPE (option->type) == DT_USER)
/* to unset $user_ means remove */
hash_delete (ConfigOptions, option->option,
}
else if (DTYPE (option->type) == DT_ADDR) {
rfc822_write_address (tmp, sizeof(tmp),
- *((ADDRESS **) option->data), 0);
+ *((address_t **) option->data), 0);
}
else if (DTYPE (option->type) == DT_QUAD)
m_strcpy(tmp, sizeof(tmp), vals[quadoption(option->data)]);
return 0;
}
-const char *mutt_getnamebyvalue (int val, const struct mapping_t *map)
-{
- int i;
-
- for (i = 0; map[i].name; i++)
- if (map[i].value == val)
- return (map[i].name);
- return NULL;
-}
-
-int mutt_getvaluebyname (const char *name, const struct mapping_t *map)
-{
- int i;
-
- for (i = 0; map[i].name; i++)
- if (ascii_strcasecmp (map[i].name, name) == 0)
- return (map[i].value);
- return (-1);
-}
-
static int mutt_execute_commands (LIST * p)
{
BUFFER err, token;