rationalize list handling in mutt a bit.
[apps/madmutt.git] / imap / message.c
index ba49cd1..9e7b39b 100644 (file)
@@ -47,7 +47,7 @@
 static void flush_buffer (char *buf, size_t * len, CONNECTION * conn);
 static int msg_fetch_header (CONTEXT * ctx, IMAP_HEADER * h, char *buf,
                              FILE * fp);
-static int msg_has_flag (LIST * flag_list, const char *flag);
+static int msg_has_flag (string_list_t * flag_list, const char *flag);
 static int msg_parse_fetch (IMAP_HEADER * h, char *s);
 static char *msg_parse_flags (IMAP_HEADER * h, char *s);
 
@@ -74,7 +74,7 @@ int imap_read_headers (IMAP_DATA * idata, int msgbegin, int msgend)
   int rc, mfhrc, oldmsgcount;
   int fetchlast = 0;
   const char *want_headers =
-    "DATE FROM SUBJECT TO CC MESSAGE-ID REFERENCES CONTENT-TYPE CONTENT-DESCRIPTION IN-REPLY-TO REPLY-TO LINES LIST-POST X-LABEL";
+    "DATE FROM SUBJECT TO CC MESSAGE-ID REFERENCES CONTENT-TYPE CONTENT-DESCRIPTION IN-REPLY-TO REPLY-TO LINES string_list_t-POST X-LABEL";
 
 #ifdef USE_HCACHE
   void *hc = NULL;
@@ -758,10 +758,10 @@ fail:
 
 /* imap_add_keywords: concatenate custom IMAP tags to list, if they
  *   appear in the folder flags list. Why wouldn't they? */
-void imap_add_keywords (char *s, HEADER * h, LIST * mailbox_flags,
+void imap_add_keywords (char *s, HEADER * h, string_list_t * mailbox_flags,
                         size_t slen)
 {
-  LIST *keywords;
+  string_list_t *keywords;
 
   if (!mailbox_flags || !HEADER_DATA (h) || !HEADER_DATA (h)->keywords)
     return;
@@ -781,7 +781,7 @@ void imap_add_keywords (char *s, HEADER * h, LIST * mailbox_flags,
 void imap_free_header_data (void **data)
 {
   /* this should be safe even if the list wasn't used */
-  mutt_free_list (&(((IMAP_HEADER_DATA *) * data)->keywords));
+  string_list_wipe(&(((IMAP_HEADER_DATA *) * data)->keywords));
 
   p_delete(data);
 }
@@ -823,7 +823,7 @@ char *imap_set_flags (IMAP_DATA * idata, HEADER * h, char *s)
   ctx->changed &= ~readonly;
   ctx->readonly = readonly;
 
-  mutt_free_list (&(HEADER_DATA (h)->keywords));
+  string_list_wipe(&(HEADER_DATA (h)->keywords));
   HEADER_DATA (h)->keywords = newh.data->keywords;
   p_delete(&newh.data);
 
@@ -943,7 +943,7 @@ static int msg_fetch_header_fetch (CONTEXT * ctx, IMAP_HEADER * h, char *buf,
 
 /* msg_has_flag: do a caseless comparison of the flag against a flag list,
  *   return 1 if found or flag list has '\*', 0 otherwise */
-static int msg_has_flag (LIST * flag_list, const char *flag)
+static int msg_has_flag (string_list_t * flag_list, const char *flag)
 {
   if (!flag_list)
     return 0;
@@ -1067,7 +1067,7 @@ static char *msg_parse_flags (IMAP_HEADER * h, char *s)
       char *flag_word = s;
 
       if (!h->data->keywords)
-        h->data->keywords = mutt_new_list ();
+        h->data->keywords = string_item_new();
 
       while (*s && !ISSPACE (*s) && *s != ')')
         s++;