]> granicus.if.org Git - neomutt/commitdiff
rename mutt_emaillist_free() to _clear()
authorRichard Russon <rich@flatcap.org>
Mon, 15 Jul 2019 17:36:16 +0000 (18:36 +0100)
committerRichard Russon <rich@flatcap.org>
Tue, 16 Jul 2019 18:01:35 +0000 (19:01 +0100)
The function doesn't free the Emails, just the list, so rename it to
match similar functions.

context.h
email/email.c
email/email.h
index.c
pager.c
recvcmd.c
send.c

index 28d7cbd5e668218a44bd98744bed29ab419d00a1..eb903b1325c578d16e5607cc2afe69955268e7b4 100644 (file)
--- a/context.h
+++ b/context.h
@@ -63,6 +63,6 @@ bool message_is_visible(struct Context *ctx, int index);
 
 int  el_add_email(struct EmailList *el, struct Email *e);
 int  el_add_tagged(struct EmailList *el, struct Context *ctx, struct Email *e, bool use_tagged);
-void mutt_emaillist_free(struct EmailList *el);
+void mutt_emaillist_clear(struct EmailList *el);
 
 #endif /* MUTT_CONTEXT_H */
index dac8bb328457056bdbce2dc1222202ffd4cde0ff..a9c295b48606b6c4691773580df755555d2c159a 100644 (file)
@@ -114,12 +114,12 @@ size_t mutt_email_size(const struct Email *e)
 }
 
 /**
- * mutt_emaillist_free - Drop a private list of Emails
+ * mutt_emaillist_clear - Drop a private list of Emails
  * @param el EmailList to empty
  *
  * The Emails are not freed.
  */
-void mutt_emaillist_free(struct EmailList *el)
+void mutt_emaillist_clear(struct EmailList *el)
 {
   if (!el)
     return;
index 70f6accffd6f1566ca9b50a454f706e75c4ea9ea..a840f1718a599fb127f31560a0404090d6611c77 100644 (file)
@@ -126,6 +126,6 @@ void          mutt_email_free      (struct Email **e);
 struct Email *mutt_email_new       (void);
 size_t        mutt_email_size      (const struct Email *e);
 
-void mutt_emaillist_free(struct EmailList *el);
+void mutt_emaillist_clear(struct EmailList *el);
 
 #endif /* MUTT_EMAIL_EMAIL_H */
diff --git a/index.c b/index.c
index cb560e3fa6eb9eeed57252484027478cf537ad2e..b674b2d439a5379c093b7fafd7bf9e02e549c6c3 100644 (file)
--- a/index.c
+++ b/index.c
@@ -1833,7 +1833,7 @@ int mutt_index_menu(void)
         struct EmailList el = STAILQ_HEAD_INITIALIZER(el);
         el_add_tagged(&el, Context, CUR_EMAIL, tag);
         ci_send_message(SEND_TO_SENDER, NULL, NULL, Context, &el);
-        mutt_emaillist_free(&el);
+        mutt_emaillist_clear(&el);
         menu->redraw = REDRAW_FULL;
         break;
       }
@@ -2343,7 +2343,7 @@ int mutt_index_menu(void)
           struct EmailList el = STAILQ_HEAD_INITIALIZER(el);
           el_add_tagged(&el, Context, CUR_EMAIL, tag);
           mutt_check_traditional_pgp(&el, &menu->redraw);
-          mutt_emaillist_free(&el);
+          mutt_emaillist_clear(&el);
         }
         int hint =
             Context->mailbox->emails[Context->mailbox->v2r[menu->current]]->index;
@@ -2457,7 +2457,7 @@ int mutt_index_menu(void)
           else
             mutt_error(_("No thread linked"));
 
-          mutt_emaillist_free(&el);
+          mutt_emaillist_clear(&el);
         }
 
         if (menu->menu == MENU_PAGER)
@@ -2608,7 +2608,7 @@ int mutt_index_menu(void)
           else
             menu->redraw |= REDRAW_CURRENT;
         }
-        mutt_emaillist_free(&el);
+        mutt_emaillist_clear(&el);
         break;
       }
 
@@ -2920,7 +2920,7 @@ int mutt_index_menu(void)
           else
             menu->redraw |= REDRAW_CURRENT;
         }
-        mutt_emaillist_free(&el);
+        mutt_emaillist_clear(&el);
         break;
       }
 
@@ -2980,7 +2980,7 @@ int mutt_index_menu(void)
         struct EmailList el = STAILQ_HEAD_INITIALIZER(el);
         el_add_tagged(&el, Context, CUR_EMAIL, tag);
         ci_bounce_message(Context->mailbox, &el);
-        mutt_emaillist_free(&el);
+        mutt_emaillist_clear(&el);
         break;
       }
 
@@ -3011,7 +3011,7 @@ int mutt_index_menu(void)
         mutt_emails_set_flag(Context->mailbox, &el, MUTT_PURGE, (op == OP_PURGE_MESSAGE));
         if (C_DeleteUntag)
           mutt_emails_set_flag(Context->mailbox, &el, MUTT_TAG, 0);
-        mutt_emaillist_free(&el);
+        mutt_emaillist_clear(&el);
 
         if (tag)
         {
@@ -3130,12 +3130,12 @@ int mutt_index_menu(void)
           struct EmailList el = STAILQ_HEAD_INITIALIZER(el);
           el_add_tagged(&el, Context, CUR_EMAIL, tag);
           mutt_check_traditional_pgp(&el, &menu->redraw);
-          mutt_emaillist_free(&el);
+          mutt_emaillist_clear(&el);
         }
         struct EmailList el = STAILQ_HEAD_INITIALIZER(el);
         el_add_tagged(&el, Context, CUR_EMAIL, tag);
         mutt_ev_message(Context->mailbox, &el, edit ? EVM_EDIT : EVM_VIEW);
-        mutt_emaillist_free(&el);
+        mutt_emaillist_clear(&el);
         menu->redraw = REDRAW_FULL;
 
         break;
@@ -3152,7 +3152,7 @@ int mutt_index_menu(void)
           mutt_check_traditional_pgp(&el, &menu->redraw);
         }
         ci_send_message(SEND_FORWARD, NULL, NULL, Context, &el);
-        mutt_emaillist_free(&el);
+        mutt_emaillist_clear(&el);
         menu->redraw = REDRAW_FULL;
         break;
       }
@@ -3178,7 +3178,7 @@ int mutt_index_menu(void)
           mutt_check_traditional_pgp(&el, &menu->redraw);
         }
         ci_send_message(replyflags, NULL, NULL, Context, &el);
-        mutt_emaillist_free(&el);
+        mutt_emaillist_clear(&el);
         menu->redraw = REDRAW_FULL;
         break;
       }
@@ -3191,7 +3191,7 @@ int mutt_index_menu(void)
         struct EmailList el = STAILQ_HEAD_INITIALIZER(el);
         el_add_tagged(&el, Context, CUR_EMAIL, tag);
         int num_changed = mutt_label_message(Context->mailbox, &el);
-        mutt_emaillist_free(&el);
+        mutt_emaillist_clear(&el);
 
         if (num_changed > 0)
         {
@@ -3223,7 +3223,7 @@ int mutt_index_menu(void)
           mutt_check_traditional_pgp(&el, &menu->redraw);
         }
         ci_send_message(SEND_REPLY | SEND_LIST_REPLY, NULL, NULL, Context, &el);
-        mutt_emaillist_free(&el);
+        mutt_emaillist_clear(&el);
         menu->redraw = REDRAW_FULL;
         break;
       }
@@ -3253,7 +3253,7 @@ int mutt_index_menu(void)
         struct EmailList el = STAILQ_HEAD_INITIALIZER(el);
         el_add_tagged(&el, Context, CUR_EMAIL, tag);
         crypt_extract_keys_from_messages(&el);
-        mutt_emaillist_free(&el);
+        mutt_emaillist_clear(&el);
         menu->redraw = REDRAW_FULL;
         break;
       }
@@ -3269,7 +3269,7 @@ int mutt_index_menu(void)
           struct EmailList el = STAILQ_HEAD_INITIALIZER(el);
           el_add_tagged(&el, Context, CUR_EMAIL, tag);
           mutt_check_traditional_pgp(&el, &menu->redraw);
-          mutt_emaillist_free(&el);
+          mutt_emaillist_clear(&el);
         }
 
         if (menu->menu == MENU_PAGER)
@@ -3287,7 +3287,7 @@ int mutt_index_menu(void)
         struct EmailList el = STAILQ_HEAD_INITIALIZER(el);
         el_add_tagged(&el, Context, CUR_EMAIL, tag);
         mutt_pipe_message(Context->mailbox, &el);
-        mutt_emaillist_free(&el);
+        mutt_emaillist_clear(&el);
 
 #ifdef USE_IMAP
         /* in an IMAP folder index with imap_peek=no, piping could change
@@ -3307,7 +3307,7 @@ int mutt_index_menu(void)
         struct EmailList el = STAILQ_HEAD_INITIALIZER(el);
         el_add_tagged(&el, Context, CUR_EMAIL, tag);
         mutt_print_message(Context->mailbox, &el);
-        mutt_emaillist_free(&el);
+        mutt_emaillist_clear(&el);
 
 #ifdef USE_IMAP
         /* in an IMAP folder index with imap_peek=no, printing could change
@@ -3447,7 +3447,7 @@ int mutt_index_menu(void)
             el_add_tagged(&el, Context, CUR_EMAIL, tag);
             ci_send_message(((op == OP_FOLLOWUP) ? SEND_REPLY : SEND_FORWARD) | SEND_NEWS,
                             NULL, NULL, Context, &el);
-            mutt_emaillist_free(&el);
+            mutt_emaillist_clear(&el);
           }
           menu->redraw = REDRAW_FULL;
           break;
@@ -3465,7 +3465,7 @@ int mutt_index_menu(void)
           mutt_check_traditional_pgp(&el, &menu->redraw);
         }
         ci_send_message(SEND_REPLY, NULL, NULL, Context, &el);
-        mutt_emaillist_free(&el);
+        mutt_emaillist_clear(&el);
         menu->redraw = REDRAW_FULL;
         break;
       }
@@ -3512,7 +3512,7 @@ int mutt_index_menu(void)
 
         mutt_emails_set_flag(Context->mailbox, &el, MUTT_DELETE, 0);
         mutt_emails_set_flag(Context->mailbox, &el, MUTT_PURGE, 0);
-        mutt_emaillist_free(&el);
+        mutt_emaillist_clear(&el);
 
         if (tag)
         {
diff --git a/pager.c b/pager.c
index 145de78d5dcbef40f07a81b6c3b381e9cefd8a9f..29adb1d66f07b779dfa7f10c0189726ab9bb0b1d 100644 (file)
--- a/pager.c
+++ b/pager.c
@@ -2954,7 +2954,7 @@ int mutt_pager(const char *banner, const char *fname, PagerFlags flags, struct P
           struct EmailList el = STAILQ_HEAD_INITIALIZER(el);
           el_add_email(&el, extra->email);
           ci_bounce_message(m, &el);
-          mutt_emaillist_free(&el);
+          mutt_emaillist_clear(&el);
         }
         break;
       }
@@ -2979,7 +2979,7 @@ int mutt_pager(const char *banner, const char *fname, PagerFlags flags, struct P
           struct EmailList el = STAILQ_HEAD_INITIALIZER(el);
           el_add_email(&el, extra->email);
           ci_send_message(SEND_TO_SENDER, NULL, NULL, extra->ctx, &el);
-          mutt_emaillist_free(&el);
+          mutt_emaillist_clear(&el);
         }
         pager_menu->redraw = REDRAW_FULL;
         break;
@@ -3038,7 +3038,7 @@ int mutt_pager(const char *banner, const char *fname, PagerFlags flags, struct P
           ch = -1;
           rc = OP_MAIN_NEXT_UNDELETED;
         }
-        mutt_emaillist_free(&el);
+        mutt_emaillist_clear(&el);
         break;
       }
 
@@ -3144,7 +3144,7 @@ int mutt_pager(const char *banner, const char *fname, PagerFlags flags, struct P
           struct EmailList el = STAILQ_HEAD_INITIALIZER(el);
           el_add_tagged(&el, extra->ctx, extra->email, false);
           mutt_pipe_message(extra->ctx->mailbox, &el);
-          mutt_emaillist_free(&el);
+          mutt_emaillist_clear(&el);
         }
         break;
 
@@ -3157,7 +3157,7 @@ int mutt_pager(const char *banner, const char *fname, PagerFlags flags, struct P
           struct EmailList el = STAILQ_HEAD_INITIALIZER(el);
           el_add_tagged(&el, extra->ctx, extra->email, false);
           mutt_print_message(extra->ctx->mailbox, &el);
-          mutt_emaillist_free(&el);
+          mutt_emaillist_clear(&el);
         }
         break;
 
@@ -3196,7 +3196,7 @@ int mutt_pager(const char *banner, const char *fname, PagerFlags flags, struct P
           struct EmailList el = STAILQ_HEAD_INITIALIZER(el);
           el_add_email(&el, extra->email);
           ci_send_message(SEND_NEWS | SEND_FORWARD, NULL, NULL, extra->ctx, &el);
-          mutt_emaillist_free(&el);
+          mutt_emaillist_clear(&el);
         }
         pager_menu->redraw = REDRAW_FULL;
         break;
@@ -3229,7 +3229,7 @@ int mutt_pager(const char *banner, const char *fname, PagerFlags flags, struct P
             struct EmailList el = STAILQ_HEAD_INITIALIZER(el);
             el_add_email(&el, extra->email);
             ci_send_message(SEND_NEWS | SEND_REPLY, NULL, NULL, extra->ctx, &el);
-            mutt_emaillist_free(&el);
+            mutt_emaillist_clear(&el);
           }
           pager_menu->redraw = REDRAW_FULL;
           break;
@@ -3259,7 +3259,7 @@ int mutt_pager(const char *banner, const char *fname, PagerFlags flags, struct P
           struct EmailList el = STAILQ_HEAD_INITIALIZER(el);
           el_add_email(&el, extra->email);
           ci_send_message(replyflags, NULL, NULL, extra->ctx, &el);
-          mutt_emaillist_free(&el);
+          mutt_emaillist_clear(&el);
         }
         pager_menu->redraw = REDRAW_FULL;
         break;
@@ -3272,7 +3272,7 @@ int mutt_pager(const char *banner, const char *fname, PagerFlags flags, struct P
         struct EmailList el = STAILQ_HEAD_INITIALIZER(el);
         el_add_email(&el, extra->email);
         ci_send_message(SEND_POSTPONED, NULL, NULL, extra->ctx, &el);
-        mutt_emaillist_free(&el);
+        mutt_emaillist_clear(&el);
         pager_menu->redraw = REDRAW_FULL;
         break;
       }
@@ -3287,7 +3287,7 @@ int mutt_pager(const char *banner, const char *fname, PagerFlags flags, struct P
           struct EmailList el = STAILQ_HEAD_INITIALIZER(el);
           el_add_email(&el, extra->email);
           ci_send_message(SEND_FORWARD, NULL, NULL, extra->ctx, &el);
-          mutt_emaillist_free(&el);
+          mutt_emaillist_clear(&el);
         }
         pager_menu->redraw = REDRAW_FULL;
         break;
@@ -3334,7 +3334,7 @@ int mutt_pager(const char *banner, const char *fname, PagerFlags flags, struct P
           else
             pager_menu->redraw |= REDRAW_STATUS | REDRAW_INDEX;
         }
-        mutt_emaillist_free(&el);
+        mutt_emaillist_clear(&el);
         break;
       }
 
@@ -3468,7 +3468,7 @@ int mutt_pager(const char *banner, const char *fname, PagerFlags flags, struct P
         struct EmailList el = STAILQ_HEAD_INITIALIZER(el);
         el_add_email(&el, extra->email);
         ci_send_message(SEND_KEY, NULL, NULL, extra->ctx, &el);
-        mutt_emaillist_free(&el);
+        mutt_emaillist_clear(&el);
         pager_menu->redraw = REDRAW_FULL;
         break;
       }
@@ -3480,7 +3480,7 @@ int mutt_pager(const char *banner, const char *fname, PagerFlags flags, struct P
         struct EmailList el = STAILQ_HEAD_INITIALIZER(el);
         el_add_email(&el, extra->email);
         rc = mutt_label_message(Context->mailbox, &el);
-        mutt_emaillist_free(&el);
+        mutt_emaillist_clear(&el);
 
         if (rc > 0)
         {
@@ -3510,7 +3510,7 @@ int mutt_pager(const char *banner, const char *fname, PagerFlags flags, struct P
         struct EmailList el = STAILQ_HEAD_INITIALIZER(el);
         el_add_email(&el, extra->email);
         crypt_extract_keys_from_messages(&el);
-        mutt_emaillist_free(&el);
+        mutt_emaillist_clear(&el);
         pager_menu->redraw = REDRAW_FULL;
         break;
       }
index 2599adccf02cae6de0e87fc1c5451b873d095a82..6a45be303be0f8e0546cbcdf1bd5ee710bbbf230 100644 (file)
--- a/recvcmd.c
+++ b/recvcmd.c
@@ -597,7 +597,7 @@ static void attach_forward_bodies(FILE *fp, struct Email *e, struct AttachCtx *a
   struct EmailList el = STAILQ_HEAD_INITIALIZER(el);
   el_add_email(&el, e_parent);
   ci_send_message(SEND_NO_FLAGS, e_tmp, tmpbody, NULL, &el);
-  mutt_emaillist_free(&el);
+  mutt_emaillist_clear(&el);
   return;
 
 bail:
@@ -733,7 +733,7 @@ static void attach_forward_msgs(FILE *fp, struct AttachCtx *actx,
   struct EmailList el = STAILQ_HEAD_INITIALIZER(el);
   el_add_email(&el, e_cur);
   ci_send_message(flags, e_tmp, (tmpbody[0] != '\0') ? tmpbody : NULL, NULL, &el);
-  mutt_emaillist_free(&el);
+  mutt_emaillist_clear(&el);
 }
 
 /**
@@ -1044,7 +1044,7 @@ void mutt_attach_reply(FILE *fp, struct Email *e, struct AttachCtx *actx,
   {
     mutt_set_flag(Context->mailbox, e, MUTT_REPLIED, true);
   }
-  mutt_emaillist_free(&el);
+  mutt_emaillist_clear(&el);
 }
 
 /**
diff --git a/send.c b/send.c
index a148f8d52e805715cb7cc32096c30c2434eee719..9f48a85307751f78157026ca2c8f34d28f293b62 100644 (file)
--- a/send.c
+++ b/send.c
@@ -1493,7 +1493,7 @@ int mutt_resend_message(FILE *fp, struct Context *ctx, struct Email *e_cur)
   struct EmailList el = STAILQ_HEAD_INITIALIZER(el);
   el_add_email(&el, e_cur);
   int rc = ci_send_message(SEND_RESEND, e_new, NULL, ctx, &el);
-  mutt_emaillist_free(&el);
+  mutt_emaillist_clear(&el);
 
   return rc;
 }