create a lib-hash.a with sha1 and md5.
[apps/madmutt.git] / pattern.c
index f4c0548..bb818f0 100644 (file)
--- a/pattern.c
+++ b/pattern.c
 #endif
 
 #include <lib-lib/mem.h>
+#include <lib-lib/ascii.h>
 #include <lib-lib/str.h>
 #include <lib-lib/macros.h>
+#include <lib-lib/buffer.h>
 
 #include "mutt.h"
-#include "buffer.h"
 #include "handler.h"
 #include "enter.h"
-#include "ascii.h"
 #include "mx.h"
 #include "mapping.h"
 #include "keymap.h"
@@ -163,7 +163,7 @@ msg_search (CONTEXT *ctx, pattern_t* pat, int msgno)
   if ((msg = mx_open_message (ctx, msgno)) != NULL) {
     if (option (OPTTHOROUGHSRC)) {
       /* decode the header / body */
-      memset (&s, 0, sizeof (s));
+      p_clear(&s, 1);
       s.fpin = msg->fp;
       s.flags = M_CHARCONV;
       mutt_mktemp (tempfile);
@@ -246,7 +246,7 @@ int eat_regexp (pattern_t * pat, BUFFER * s, BUFFER * err)
   BUFFER buf;
   int r;
 
-  memset (&buf, 0, sizeof (buf));
+  p_clear(&buf, 1);
 
   if (mutt_extract_token (&buf, s, M_TOKEN_PATTERN | M_TOKEN_COMMENT) != 0 ||
       !buf.data) {
@@ -536,21 +536,21 @@ static int eat_date (pattern_t * pat, BUFFER * s, BUFFER * err)
   BUFFER buffer;
   struct tm min, max;
 
-  memset (&buffer, 0, sizeof (buffer));
+  p_clear(&buffer, 1);
   if (mutt_extract_token (&buffer, s, M_TOKEN_COMMENT | M_TOKEN_PATTERN) != 0
       || !buffer.data) {
     strfcpy (err->data, _("error in expression"), err->dsize);
     return (-1);
   }
 
-  memset (&min, 0, sizeof (min));
+  p_clear(&min, 1);
   /* the `0' time is Jan 1, 1970 UTC, so in order to prevent a negative time
      when doing timezone conversion, we use Jan 2, 1970 UTC as the base
      here */
   min.tm_mday = 2;
   min.tm_year = 70;
 
-  memset (&max, 0, sizeof (max));
+  p_clear(&max, 1);
 
   /* Arbitrary year in the future.  Don't set this too high
      or mutt_mktime() returns something larger than will
@@ -712,7 +712,7 @@ pattern_t *mutt_pattern_comp ( /* const */ char *s, int flags, BUFFER * err)
   char *buf;
   BUFFER ps;
 
-  memset (&ps, 0, sizeof (ps));
+  p_clear(&ps, 1);
   ps.dptr = s;
   ps.dsize = m_strlen(s);
 
@@ -1170,7 +1170,7 @@ void mutt_check_simple (char *s, size_t len, const char *simple)
 
   if (!strchr (s, '~') && !strchr (s, '=')) {       /* yup, so spoof a real request */
     /* convert old tokens into the new format */
-    if (ascii_strcasecmp ("all", s) == 0 || !str_cmp ("^", s) || !str_cmp (".", s))     /* ~A is more efficient */
+    if (ascii_strcasecmp ("all", s) == 0 || !m_strcmp("^", s) || !m_strcmp(".", s))     /* ~A is more efficient */
       strfcpy (s, "~A", len);
     else if (ascii_strcasecmp ("del", s) == 0)
       strfcpy (s, "~D", len);
@@ -1326,7 +1326,7 @@ int mutt_search_command (int cur, int op)
     strfcpy (temp, buf, sizeof (temp));
     mutt_check_simple (temp, sizeof (temp), NONULL (SimpleSearch));
 
-    if (!SearchPattern || str_cmp (temp, LastSearchExpn)) {
+    if (!SearchPattern || m_strcmp(temp, LastSearchExpn)) {
       set_option (OPTSEARCHINVALID);
       strfcpy (LastSearch, buf, sizeof (LastSearch));
       mutt_message _("Compiling search pattern...");