remove yet anoter round of str_* functions, replaced with their inlineable
[apps/madmutt.git] / init.c
diff --git a/init.c b/init.c
index 6ca24b3..ef3f3d0 100644 (file)
--- a/init.c
+++ b/init.c
@@ -279,7 +279,7 @@ static void sys_to_string (char* dst, size_t dstlen,
      * if name starts with $folder, just strip it to keep hierarchy
      * $folder=imap://host, path=imap://host/inbox/b -> inbox/b
      */
-    if (Maildirlength > 0 && str_ncmp (CurrentFolder, Maildir,
+    if (Maildirlength > 0 && m_strncmp(CurrentFolder, Maildir,
                                       Maildirlength) == 0 &&
        m_strlen(CurrentFolder) > Maildirlength) {
      val = CurrentFolder + Maildirlength;
@@ -1108,9 +1108,9 @@ static int parse_attach_list (BUFFER *buf, BUFFER *s, LIST **ldata,
     a = p_new(ATTACH_MATCH, 1);
 
     /* some cheap hacks that I expect to remove */
-    if (!str_casecmp(buf->data, "any"))
+    if (!m_strcasecmp(buf->data, "any"))
       a->major = m_strdup("*/.*");
-    else if (!str_casecmp(buf->data, "none"))
+    else if (!m_strcasecmp(buf->data, "none"))
       a->major = m_strdup("cheap_hack/this_should_never_match");
     else
       a->major = m_strdup(buf->data);
@@ -1164,9 +1164,9 @@ static int parse_unattach_list (BUFFER *buf, BUFFER *s, LIST **ldata, BUFFER *er
   do {
     mutt_extract_token (buf, s, 0);
 
-    if (!str_casecmp(buf->data, "any"))
+    if (!m_strcasecmp(buf->data, "any"))
       tmp = m_strdup("*/.*");
-    else if (!str_casecmp(buf->data, "none"))
+    else if (!m_strcasecmp(buf->data, "none"))
       tmp = m_strdup("cheap_hack/this_should_never_match");
     else
       tmp = m_strdup(buf->data);
@@ -1186,7 +1186,7 @@ static int parse_unattach_list (BUFFER *buf, BUFFER *s, LIST **ldata, BUFFER *er
       a = (ATTACH_MATCH *)lp->data;
       debug_print(5, ("parse_unattach_list: check %s/%s [%d] : %s/%s [%d]\n",
                       a->major, a->minor, a->major_int, tmp, minor, major));
-      if (a->major_int == major && !str_casecmp(minor, a->minor)) {
+      if (a->major_int == major && !m_strcasecmp(minor, a->minor)) {
         debug_print(5, ("parse_unattach_list: removed %s/%s [%d]\n",
                         a->major, a->minor, a->major_int));
         regfree(&a->minor_rx);
@@ -1258,13 +1258,13 @@ static int parse_attachments (BUFFER *buf, BUFFER *s, unsigned long data, BUFFER
     op = '+';
     category--;
   }
-  if (!str_ncasecmp(category, "attachment", strlen(category))) {
+  if (!m_strncasecmp(category, "attachment", strlen(category))) {
     if (op == '+')
       listp = &AttachAllow;
     else
       listp = &AttachExclude;
   }
-  else if (!str_ncasecmp(category, "inline", strlen(category))) {
+  else if (!m_strncasecmp(category, "inline", strlen(category))) {
     if (op == '+')
       listp = &InlineAllow;
     else
@@ -1293,13 +1293,13 @@ static int parse_unattachments (BUFFER *buf, BUFFER *s, unsigned long data, BUFF
     op = '+';
     p--;
   }
-  if (!str_ncasecmp(p, "attachment", strlen(p))) {
+  if (!m_strncasecmp(p, "attachment", strlen(p))) {
     if (op == '+')
       listp = &AttachAllow;
     else
       listp = &AttachExclude;
   }
-  else if (!str_ncasecmp(p, "inline", strlen(p))) {
+  else if (!m_strncasecmp(p, "inline", strlen(p))) {
     if (op == '+')
       listp = &InlineAllow;
     else
@@ -1384,7 +1384,7 @@ static int parse_unalias (BUFFER * buf, BUFFER * s, unsigned long data,
     }
     else
       for (tmp = Aliases; tmp; tmp = tmp->next) {
-        if (str_casecmp (buf->data, tmp->name) == 0) {
+        if (m_strcasecmp(buf->data, tmp->name) == 0) {
           if (CurrentMenu == MENU_ALIAS) {
             tmp->del = 1;
             set_option (OPTFORCEREDRAWINDEX);
@@ -1424,7 +1424,7 @@ static int parse_alias (BUFFER * buf, BUFFER * s, unsigned long data,
 
   /* check to see if an alias with this name already exists */
   for (; tmp; tmp = tmp->next) {
-    if (!str_casecmp (tmp->name, buf->data))
+    if (!m_strcasecmp(tmp->name, buf->data))
       break;
     last = tmp;
   }
@@ -1561,12 +1561,12 @@ parse_sort (struct option_t* dst, const char *s, const struct mapping_t *map,
             char* errbuf, size_t errlen) {
   int i, flags = 0;
 
-  if (str_ncmp ("reverse-", s, 8) == 0) {
+  if (m_strncmp("reverse-", s, 8) == 0) {
     s += 8;
     flags = SORT_REVERSE;
   }
 
-  if (str_ncmp ("last-", s, 5) == 0) {
+  if (m_strncmp("last-", s, 5) == 0) {
     s += 5;
     flags |= SORT_LAST;
   }
@@ -1708,8 +1708,8 @@ static void mutt_restore_default (const char* name, void* p,
 static int check_dsn_return (const char* option, unsigned long p,
                              char* errbuf, size_t errlen) {
   char* val = (char*) p;
-  if (val && *val && str_ncmp (val, "hdrs", 4) != 0 &&
-      str_ncmp (val, "full", 4) != 0) {
+  if (val && *val && m_strncmp(val, "hdrs", 4) != 0 &&
+      m_strncmp(val, "full", 4) != 0) {
     if (errbuf)
       snprintf (errbuf, errlen, _("'%s' is invalid for $%s"), val, "dsn_return");
     return (0);
@@ -1731,10 +1731,10 @@ static int check_dsn_notify (const char* option, unsigned long p,
     return (1);
 
   for (i = 0; i < list->length; i++)
-    if (str_ncmp (list->data[i], "never", 5) != 0 &&
-        str_ncmp (list->data[i], "failure", 7) != 0 &&
-        str_ncmp (list->data[i], "delay", 5) != 0 &&
-        str_ncmp (list->data[i], "success", 7) != 0) {
+    if (m_strncmp(list->data[i], "never", 5) != 0 &&
+        m_strncmp(list->data[i], "failure", 7) != 0 &&
+        m_strncmp(list->data[i], "delay", 5) != 0 &&
+        m_strncmp(list->data[i], "success", 7) != 0) {
       if (errbuf)
         snprintf (errbuf, errlen, _("'%s' is invalid for $%s"),
                   (char*) list->data[i], "dsn_notify");
@@ -1839,11 +1839,11 @@ static int parse_set (BUFFER * tmp, BUFFER * s, unsigned long data,
       query = 1;
       s->dptr++;
     }
-    else if (str_ncmp ("no", s->dptr, 2) == 0) {
+    else if (m_strncmp("no", s->dptr, 2) == 0) {
       s->dptr += 2;
       unset = !unset;
     }
-    else if (str_ncmp ("inv", s->dptr, 3) == 0) {
+    else if (m_strncmp("inv", s->dptr, 3) == 0) {
       s->dptr += 3;
       inv = !inv;
     }
@@ -2284,17 +2284,17 @@ int mutt_command_complete (char *buffer, size_t len, int pos, int numtabs)
     /* return the completed command */
     m_strcpy(buffer, len - spaces, Completed);
   }
-  else if (!str_ncmp (buffer, "set", 3)
-           || !str_ncmp (buffer, "unset", 5)
-           || !str_ncmp (buffer, "reset", 5)
-           || !str_ncmp (buffer, "toggle", 6)) {    /* complete variables */
+  else if (!m_strncmp(buffer, "set", 3)
+           || !m_strncmp(buffer, "unset", 5)
+           || !m_strncmp(buffer, "reset", 5)
+           || !m_strncmp(buffer, "toggle", 6)) {    /* complete variables */
     const char *prefixes[] = { "no", "inv", "?", "&", NULL };
 
     pt++;
     /* loop through all the possible prefixes (no, inv, ...) */
-    if (!str_ncmp (buffer, "set", 3)) {
+    if (!m_strncmp(buffer, "set", 3)) {
       for (num = 0; prefixes[num]; num++) {
-        if (!str_ncmp (pt, prefixes[num], m_strlen(prefixes[num]))) {
+        if (!m_strncmp(pt, prefixes[num], m_strlen(prefixes[num]))) {
           pt += m_strlen(prefixes[num]);
           break;
         }
@@ -2332,7 +2332,7 @@ int mutt_command_complete (char *buffer, size_t len, int pos, int numtabs)
 
     m_strcpy(pt, buffer + len - pt - spaces, Completed);
   }
-  else if (!str_ncmp (buffer, "exec", 4)) {
+  else if (!m_strncmp(buffer, "exec", 4)) {
     struct binding_t *menu = km_get_table (CurrentMenu);
 
     if (!menu && CurrentMenu != MENU_PAGER)
@@ -2401,7 +2401,7 @@ int mutt_var_value_complete (char *buffer, size_t len, int pos)
   if (*pt == '=')               /* abort if no var before the '=' */
     return 0;
 
-  if (str_ncmp (buffer, "set", 3) == 0) {
+  if (m_strncmp(buffer, "set", 3) == 0) {
     strfcpy (var, pt, sizeof(var));
     /* ignore the trailing '=' when comparing */
     var[m_strlen(var) - 1] = 0;