X-Git-Url: http://git.madism.org/?p=apps%2Fmadmutt.git;a=blobdiff_plain;f=init.c;h=f52b1836679f64371e4b6031885c9829684e2577;hp=4b4daa31f4350fb14566fc8f850ab11251bfd921;hb=85832555b8d510499b13bc454e458382d36e195d;hpb=238b70e39b78f585c586bd51aef41988b3cc73d1 diff --git a/init.c b/init.c index 4b4daa3..f52b183 100644 --- a/init.c +++ b/init.c @@ -20,9 +20,9 @@ #include #include #include +#include #include "mutt.h" -#include "mapping.h" #include "mutt_curses.h" #include "history.h" #include "keymap.h" @@ -517,7 +517,7 @@ static void addr_to_string (char* dst, size_t dstlen, 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)); } @@ -525,9 +525,9 @@ static int addr_from_string (struct option_t* dst, const char* val, 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); } @@ -1440,7 +1440,7 @@ static int parse_alias (BUFFER * buf, BUFFER * s, unsigned long data, } else { /* override the previous value */ - rfc822_free_address (&tmp->addr); + address_delete (&tmp->addr); if (CurrentMenu == MENU_ALIAS) set_option (OPTFORCEREDRAWINDEX); } @@ -1460,7 +1460,7 @@ static int parse_alias (BUFFER * buf, BUFFER * s, unsigned long data, } #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) { @@ -1878,7 +1878,7 @@ static int parse_set (BUFFER * tmp, BUFFER * s, unsigned long data, snprintf (err->data, err->dsize, _("%s: unknown variable"), tmp->data); return (-1); } - SKIPWS (s->dptr); + s->dptr = vskipspaces(s->dptr); if (reset) { if (query || unset || inv) { @@ -1972,7 +1972,7 @@ static int parse_set (BUFFER * tmp, BUFFER * s, unsigned long data, 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, @@ -2176,7 +2176,7 @@ int mutt_parse_rc_line ( /* const */ char *line, BUFFER * token, BUFFER * err) debug_print (1, ("expand '%s'\n", line)); - SKIPWS (expn.dptr); + expn.dptr = vskipspaces(expn.dptr); while (*expn.dptr) { if (*expn.dptr == '#') break; /* rest of line is a comment */ @@ -2244,7 +2244,7 @@ int mutt_command_complete (char *buffer, size_t len, int pos, int numtabs) int num; int spaces; /* keep track of the number of leading spaces on the line */ - SKIPWS (buffer); + buffer = vskipspaces(buffer); spaces = buffer - pt; pt = buffer + pos - spaces; @@ -2391,7 +2391,7 @@ int mutt_var_value_complete (char *buffer, size_t len, int pos) if (buffer[0] == 0) return 0; - SKIPWS (buffer); + buffer = vskipspaces(buffer); spaces = buffer - pt; pt = buffer + pos - spaces; @@ -2424,7 +2424,7 @@ int mutt_var_value_complete (char *buffer, size_t len, int pos) } 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)]); @@ -2527,26 +2527,6 @@ int mutt_query_variables (LIST * queries) 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; @@ -2665,8 +2645,7 @@ void mutt_init (int skip_sys_rc, LIST * commands) if ((f = safe_fopen (SYSCONFDIR "/nntpserver", "r"))) { buffer[0] = '\0'; fgets (buffer, sizeof(buffer), f); - p = buffer; - SKIPWS (p); + p = vskipspaces(buffer); q = (char*)p; while (*q && !isspace(*q)) q++;