rationalize list handling in mutt a bit.
[apps/madmutt.git] / lib-crypt / crypt-gpgme.c
index 8d8fb96..5be0147 100644 (file)
@@ -3018,12 +3018,12 @@ leave:
  */
 
 
-/* Convert LIST into a pattern string suitable to be passed to GPGME.
+/* Convert string_list_t into a pattern string suitable to be passed to GPGME.
    We need to convert spaces in an item into a '+' and '%' into
    "%25". */
-static char *list_to_pattern (LIST * list)
+static char *list_to_pattern (string_list_t * list)
 {
-  LIST *l;
+  string_list_t *l;
   char *pattern, *p;
   const char *s;
   size_t n;
@@ -3068,7 +3068,7 @@ static char *list_to_pattern (LIST * list)
 
 /* Return a list of keys which are candidates for the selection.
    Select by looking at the HINTS list. */
-static crypt_key_t *get_candidates (LIST * hints, unsigned int app,
+static crypt_key_t *get_candidates (string_list_t * hints, unsigned int app,
                                     int secret)
 {
   crypt_key_t *db, *k, **kend;
@@ -3098,7 +3098,7 @@ static crypt_key_t *get_candidates (LIST * hints, unsigned int app,
        depending on the protocol.  For gpg we don' t need percent
        escaped pappert but simple strings passed in an array to the
        keylist_ext_start function. */
-    LIST *l;
+    string_list_t *l;
     size_t n;
     char **patarr;
 
@@ -3212,7 +3212,7 @@ static crypt_key_t *get_candidates (LIST * hints, unsigned int app,
 
 /* Add the string STR to the list HINTS.  This list is later used to
    match addresses. */
-static LIST *crypt_add_string_to_hints (LIST * hints, const char *str)
+static string_list_t *crypt_add_string_to_hints (string_list_t * hints, const char *str)
 {
   char *scratch;
   char *t;
@@ -3429,7 +3429,7 @@ static crypt_key_t *crypt_getkeybyaddr (address_t * a, short abilities,
                                         unsigned int app, int *forced_valid)
 {
   address_t *r, *p;
-  LIST *hints = NULL;
+  string_list_t *hints = NULL;
 
   int weak = 0;
   int invalid = 0;
@@ -3454,7 +3454,7 @@ static crypt_key_t *crypt_getkeybyaddr (address_t * a, short abilities,
   mutt_message (_("Looking for keys matching \"%s\"..."), a->mailbox);
   keys = get_candidates (hints, app, (abilities & KEYFLAG_CANSIGN));
 
-  mutt_free_list (&hints);
+  string_list_wipe(&hints);
 
   if (!keys)
     return NULL;
@@ -3498,7 +3498,7 @@ static crypt_key_t *crypt_getkeybyaddr (address_t * a, short abilities,
                    || !(validity & CRYPT_KV_ADDR)))
         this_key_has_weak = 1;
     }
-    address_delete (&r);
+    address_list_wipe(&r);
 
     if (match) {
       crypt_key_t *tmp;
@@ -3546,7 +3546,7 @@ static crypt_key_t *crypt_getkeybyaddr (address_t * a, short abilities,
 static crypt_key_t *crypt_getkeybystr (char *p, short abilities,
                                        unsigned int app, int *forced_valid)
 {
-  LIST *hints = NULL;
+  string_list_t *hints = NULL;
   crypt_key_t *keys;
   crypt_key_t *matches = NULL;
   crypt_key_t **matches_endp = &matches;
@@ -3559,7 +3559,7 @@ static crypt_key_t *crypt_getkeybystr (char *p, short abilities,
 
   hints = crypt_add_string_to_hints (hints, p);
   keys = get_candidates (hints, app, (abilities & KEYFLAG_CANSIGN));
-  mutt_free_list (&hints);
+  string_list_wipe(&hints);
 
   if (!keys)
     return NULL;
@@ -3731,8 +3731,8 @@ static char *find_keys (address_t * to, address_t * cc, address_t * bcc,
       }
       else if (r == -1) {
         p_delete(&keylist);
-        address_delete (&tmp);
-        address_delete (&addr);
+        address_list_wipe(&tmp);
+        address_list_wipe(&addr);
         return NULL;
       }
     }
@@ -3750,8 +3750,8 @@ static char *find_keys (address_t * to, address_t * cc, address_t * bcc,
 #endif
                                     &forced_valid)) == NULL) {
         p_delete(&keylist);
-        address_delete (&tmp);
-        address_delete (&addr);
+        address_list_wipe(&tmp);
+        address_list_wipe(&addr);
         return NULL;
       }
     }
@@ -3776,9 +3776,9 @@ static char *find_keys (address_t * to, address_t * cc, address_t * bcc,
     keylist_used = m_strlen(keylist);
 
     crypt_free_key (&key);
-    address_delete (&addr);
+    address_list_wipe(&addr);
   }
-  address_delete (&tmp);
+  address_list_wipe(&tmp);
   return (keylist);
 }