From: Richard Russon Date: Mon, 15 Jul 2019 17:36:16 +0000 (+0100) Subject: rename mutt_emaillist_free() to _clear() X-Git-Tag: 2019-10-25~131^2~10 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=0ff8838d855fb0e27d544e2f3036cc4ee28641b0;p=neomutt rename mutt_emaillist_free() to _clear() The function doesn't free the Emails, just the list, so rename it to match similar functions. --- diff --git a/context.h b/context.h index 28d7cbd5e..eb903b132 100644 --- 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 */ diff --git a/email/email.c b/email/email.c index dac8bb328..a9c295b48 100644 --- a/email/email.c +++ b/email/email.c @@ -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; diff --git a/email/email.h b/email/email.h index 70f6accff..a840f1718 100644 --- a/email/email.h +++ b/email/email.h @@ -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 cb560e3fa..b674b2d43 100644 --- 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 145de78d5..29adb1d66 100644 --- 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; } diff --git a/recvcmd.c b/recvcmd.c index 2599adccf..6a45be303 100644 --- 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 a148f8d52..9f48a8530 100644 --- 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; }