void mutt_print_attachment_list(struct AttachCtx *actx, FILE *fp, bool tag,
struct Body *top);
-void mutt_attach_bounce(FILE *fp, struct Header *hdr, struct AttachCtx *actx,
- struct Body *cur);
-void mutt_attach_resend(FILE *fp, struct Header *hdr, struct AttachCtx *actx,
- struct Body *cur);
+void mutt_attach_bounce(FILE *fp, struct AttachCtx *actx, struct Body *cur);
+void mutt_attach_resend(FILE *fp, struct AttachCtx *actx, struct Body *cur);
void mutt_attach_forward(FILE *fp, struct Header *hdr, struct AttachCtx *actx,
struct Body *cur, int flags);
void mutt_attach_reply(FILE *fp, struct Header *hdr, struct AttachCtx *actx,
BuffyNotify = 0;
#ifdef USE_IMAP
- BuffyCount += imap_buffy_check(force, check_stats);
+ BuffyCount += imap_buffy_check(check_stats);
#endif
/* check device ID and serial number instead of comparing paths */
return 0;
}
- int r = mutt_file_lock(ctx->realpath, fileno(ci->lockfp), excl, 1);
+ int r = mutt_file_lock(fileno(ci->lockfp), excl, 1);
if (r == 0)
ci->locked = 1;
if (!ci->locked)
return;
- mutt_file_unlock(ctx->realpath, fileno(ci->lockfp));
+ mutt_file_unlock(fileno(ci->lockfp));
ci->locked = 0;
mutt_file_fclose(&ci->lockfp);
menu->current = ci_first_message();
}
-static int main_change_folder(struct Menu *menu, int op, char *buf, size_t bufsz,
- int *oldcount, int *index_hint, int flags)
+static int main_change_folder(struct Menu *menu, int op, char *buf,
+ size_t bufsz, int *oldcount, int *index_hint)
{
#ifdef USE_NNTP
if (option(OPT_NEWS))
if (!nm_uri_from_query(Context, buf, sizeof(buf)))
mutt_message(_("Failed to create query, aborting."));
else
- main_change_folder(menu, op, buf, sizeof(buf), &oldcount, &index_hint, 0);
+ main_change_folder(menu, op, buf, sizeof(buf), &oldcount, &index_hint);
break;
case OP_MAIN_WINDOWED_VFOLDER_BACKWARD:
if (!nm_uri_from_query(Context, buf, sizeof(buf)))
mutt_message(_("Failed to create query, aborting."));
else
- main_change_folder(menu, op, buf, sizeof(buf), &oldcount, &index_hint, 0);
+ main_change_folder(menu, op, buf, sizeof(buf), &oldcount, &index_hint);
break;
case OP_MAIN_WINDOWED_VFOLDER_FORWARD:
else
{
mutt_debug(2, "nm: + windowed query (%s)\n", buf);
- main_change_folder(menu, op, buf, sizeof(buf), &oldcount, &index_hint, 0);
+ main_change_folder(menu, op, buf, sizeof(buf), &oldcount, &index_hint);
}
break;
}
}
- main_change_folder(menu, op, buf, sizeof(buf), &oldcount, &index_hint, flags);
+ main_change_folder(menu, op, buf, sizeof(buf), &oldcount, &index_hint);
#ifdef USE_NNTP
/* mutt_buffy_check() must be done with mail-reader mode! */
menu->help = mutt_compile_help(
{
mutt_mb_wcstombs(buf, buflen, state->wbuf, state->curpos);
i = strlen(buf);
- if (!mutt_nm_tag_complete(buf, buflen, i, state->tabs))
+ if (!mutt_nm_tag_complete(buf, buflen, state->tabs))
BEEP();
replace_part(state, 0, buf);
return NULL;
}
- if (mutt_file_lock(ctx->lockfile, ctx->fd, 1, 5))
+ if (mutt_file_lock(ctx->fd, 1, 5))
goto fail_close;
ret = db_env_create(&ctx->env, 0);
fail_env:
ctx->env->close(ctx->env, 0);
fail_unlock:
- mutt_file_unlock(ctx->lockfile, ctx->fd);
+ mutt_file_unlock(ctx->fd);
fail_close:
close(ctx->fd);
unlink(ctx->lockfile);
ctx->db->close(ctx->db, 0);
ctx->env->close(ctx->env, 0);
- mutt_file_unlock(ctx->lockfile, ctx->fd);
+ mutt_file_unlock(ctx->fd);
close(ctx->fd);
unlink(ctx->lockfile);
FREE(vctx);
* batch the commands and save on round trips. Returns number of mailboxes with
* new mail.
*/
-int imap_buffy_check(int force, int check_stats)
+int imap_buffy_check(int check_stats)
{
struct ImapData *idata = NULL;
struct ImapData *lastdata = NULL;
int imap_check_mailbox(struct Context *ctx, int force);
int imap_delete_mailbox(struct Context *ctx, struct ImapMbox *mx);
int imap_sync_mailbox(struct Context *ctx, int expunge);
-int imap_buffy_check(int force, int check_stats);
+int imap_buffy_check(int check_stats);
int imap_status(char *path, int queue);
int imap_search(struct Context *ctx, const struct Pattern *pat);
int imap_subscribe(char *path, bool subscribe);
*
* Complete the nearest "+" or "-" -prefixed string previous to pos.
*/
-bool mutt_nm_tag_complete(char *buffer, size_t len, int pos, int numtabs)
+bool mutt_nm_tag_complete(char *buffer, size_t len, int numtabs)
{
if (!buffer)
return false;
{
int r;
- r = mutt_file_lock(ctx->path, fileno(ctx->fp), excl, retry);
+ r = mutt_file_lock(fileno(ctx->fp), excl, retry);
if (r == 0)
ctx->locked = true;
else if (retry && !excl)
{
fflush(ctx->fp);
- mutt_file_unlock(ctx->path, fileno(ctx->fp));
+ mutt_file_unlock(fileno(ctx->fp));
ctx->locked = false;
}
}
if (ctx->append)
{
- mutt_file_unlock(ctx->path, fileno(ctx->fp));
+ mutt_file_unlock(fileno(ctx->fp));
mutt_sig_unblock();
}
/**
* mutt_file_lock - (try to) lock a file
- * @param path Path to file
* @param fd File descriptor to file
* @param excl If set, try to lock exclusively
* @param timeout Retry after this time
*
* Use mutt_file_unlock() to unlock the file.
*/
-int mutt_file_lock(const char *path, int fd, int excl, int timeout)
+int mutt_file_lock(int fd, int excl, int timeout)
{
#if defined(USE_FCNTL) || defined(USE_FLOCK)
int count;
/**
* mutt_file_unlock - Unlock a file previously locked by mutt_file_lock()
- * @param path Path to file
- * @param fd File descriptor to file
+ * @param fd File descriptor to file
* @retval 0 Always
*/
-int mutt_file_unlock(const char *path, int fd)
+int mutt_file_unlock(int fd)
{
#ifdef USE_FCNTL
struct flock unlockit = { F_UNLCK, 0, 0, 0, 0 };
if (fd == -1)
return;
- if (mutt_file_lock(path, fd, 1, 1) == -1)
+ if (mutt_file_lock(fd, 1, 1) == -1)
{
close(fd);
return;
if (fstat(fd, &sb) == 0 && sb.st_size == 0)
unlink(path);
- mutt_file_unlock(path, fd);
+ mutt_file_unlock(fd);
close(fd);
}
int mutt_file_fclose(FILE **f);
FILE * mutt_file_fopen(const char *path, const char *mode);
int mutt_file_fsync_close(FILE **f);
-int mutt_file_lock(const char *path, int fd, int excl, int timeout);
+int mutt_file_lock(int fd, int excl, int timeout);
int mutt_file_mkdir(const char *path, mode_t mode);
int mutt_file_open(const char *path, int flags);
size_t mutt_file_quote_filename(char *d, size_t l, const char *f);
void mutt_file_touch_atime(int f);
void mutt_file_unlink(const char *s);
void mutt_file_unlink_empty(const char *path);
-int mutt_file_unlock(const char *path, int fd);
+int mutt_file_unlock(int fd);
#endif /* _MUTT_FILE_H */
return gpgme_send_menu(msg, 1);
}
-static int verify_sender(struct Header *h, gpgme_protocol_t protocol)
+static int verify_sender(struct Header *h)
{
struct Address *sender = NULL;
unsigned int rc = 1;
int smime_gpgme_verify_sender(struct Header *h)
{
- return verify_sender(h, GPGME_PROTOCOL_CMS);
+ return verify_sender(h);
}
void mutt_gpgme_set_sender(const char *sender)
return;
mutt_debug(1, "Unlocking %s\n", nserv->newsrc_file);
- mutt_file_unlock(nserv->newsrc_file, fileno(nserv->newsrc_fp));
+ mutt_file_unlock(fileno(nserv->newsrc_fp));
mutt_file_fclose(&nserv->newsrc_fp);
}
/* lock it */
mutt_debug(1, "Locking %s\n", nserv->newsrc_file);
- if (mutt_file_lock(nserv->newsrc_file, fileno(nserv->newsrc_fp), 0, 1))
+ if (mutt_file_lock(fileno(nserv->newsrc_fp), 0, 1))
{
mutt_file_fclose(&nserv->newsrc_fp);
return -1;
CHECK_MODE(IsHeader(extra) || IsMsgAttach(extra))
CHECK_ATTACH;
if (IsMsgAttach(extra))
- mutt_attach_bounce(extra->fp, extra->hdr, extra->actx, extra->bdy);
+ mutt_attach_bounce(extra->fp, extra->actx, extra->bdy);
else
ci_bounce_message(extra->hdr);
break;
CHECK_MODE(IsHeader(extra) || IsMsgAttach(extra))
CHECK_ATTACH;
if (IsMsgAttach(extra))
- mutt_attach_resend(extra->fp, extra->hdr, extra->actx, extra->bdy);
+ mutt_attach_resend(extra->fp, extra->actx, extra->bdy);
else
mutt_resend_message(NULL, extra->ctx, extra->hdr);
pager_menu->redraw = REDRAW_FULL;
void mutt_make_attribution(struct Context *ctx, struct Header *cur, FILE *out);
void mutt_make_forward_subject(struct Envelope *env, struct Context *ctx, struct Header *cur);
void mutt_make_help(char *d, size_t dlen, const char *txt, int menu, int op);
-void mutt_make_misc_reply_headers(struct Envelope *env, struct Context *ctx, struct Header *cur, struct Envelope *curenv);
+void mutt_make_misc_reply_headers(struct Envelope *env, struct Envelope *curenv);
void mutt_make_post_indent(struct Context *ctx, struct Header *cur, FILE *out);
void mutt_message_to_7bit(struct Body *a, FILE *fp);
void mutt_mktemp_full(char *s, size_t slen, const char *prefix, const char *suffix, const char *src, int line);
int mutt_var_value_complete(char *buffer, size_t len, int pos);
#ifdef USE_NOTMUCH
bool mutt_nm_query_complete(char *buffer, size_t len, int pos, int numtabs);
-bool mutt_nm_tag_complete(char *buffer, size_t len, int pos, int numtabs);
+bool mutt_nm_tag_complete(char *buffer, size_t len, int numtabs);
#endif
int mutt_complete(char *s, size_t slen);
int mutt_compose_attachment(struct Body *a);
case OP_RESEND:
CHECK_ATTACH;
- mutt_attach_resend(CURATTACH->fp, hdr, actx,
+ mutt_attach_resend(CURATTACH->fp, actx,
menu->tagprefix ? NULL : CURATTACH->content);
menu->redraw = REDRAW_FULL;
break;
case OP_BOUNCE_MESSAGE:
CHECK_ATTACH;
- mutt_attach_bounce(CURATTACH->fp, hdr, actx,
+ mutt_attach_bounce(CURATTACH->fp, actx,
menu->tagprefix ? NULL : CURATTACH->content);
menu->redraw = REDRAW_FULL;
break;
/**
* mutt_attach_bounce - Bounce function, from the attachment menu
*/
-void mutt_attach_bounce(FILE *fp, struct Header *hdr, struct AttachCtx *actx, struct Body *cur)
+void mutt_attach_bounce(FILE *fp, struct AttachCtx *actx, struct Body *cur)
{
char prompt[STRING];
char buf[HUGE_STRING];
/**
* mutt_attach_resend - resend-message, from the attachment menu
*/
-void mutt_attach_resend(FILE *fp, struct Header *hdr, struct AttachCtx *actx, struct Body *cur)
+void mutt_attach_resend(FILE *fp, struct AttachCtx *actx, struct Body *cur)
{
if (!check_all_msg(actx, cur, true))
return;
* (non-message types)
*/
static void attach_forward_bodies(FILE *fp, struct Header *hdr, struct AttachCtx *actx,
- struct Body *cur, short nattach, int flags)
+ struct Body *cur, short nattach)
{
bool mime_fwd_all = false;
bool mime_fwd_any = true;
* relies on a context structure to find messages, while, on the attachment
* menu, messages are referenced through the attachment index.
*/
-static void attach_forward_msgs(FILE *fp, struct Header *hdr,
- struct AttachCtx *actx, struct Body *cur, int flags)
+static void attach_forward_msgs(FILE *fp, struct AttachCtx *actx, struct Body *cur, int flags)
{
struct Header *curhdr = NULL;
struct Header *tmphdr = NULL;
short nattach;
if (check_all_msg(actx, cur, false))
- attach_forward_msgs(fp, hdr, actx, cur, flags);
+ attach_forward_msgs(fp, actx, cur, flags);
else
{
nattach = count_tagged(actx);
- attach_forward_bodies(fp, hdr, actx, cur, nattach, flags);
+ attach_forward_bodies(fp, hdr, actx, cur, nattach);
}
}
mutt_fix_reply_recipients(env);
}
- mutt_make_misc_reply_headers(env, Context, curhdr, curenv);
+ mutt_make_misc_reply_headers(env, curenv);
if (parent)
mutt_add_to_reference_headers(env, curenv);
/**
* attach_include_reply - This is _very_ similar to send.c's include_reply()
*/
-static void attach_include_reply(FILE *fp, FILE *tmpfp, struct Header *cur, int flags)
+static void attach_include_reply(FILE *fp, FILE *tmpfp, struct Header *cur)
{
int cmflags = MUTT_CM_PREFIX | MUTT_CM_DECODE | MUTT_CM_CHARCONV;
int chflags = CH_DECODE;
if (!parent_hdr)
{
if (cur)
- attach_include_reply(fp, tmpfp, cur->hdr, flags);
+ attach_include_reply(fp, tmpfp, cur->hdr);
else
{
for (short i = 0; i < actx->idxlen; i++)
{
if (actx->idx[i]->content->tagged)
- attach_include_reply(actx->idx[i]->fp, tmpfp, actx->idx[i]->content->hdr, flags);
+ attach_include_reply(actx->idx[i]->fp, tmpfp, actx->idx[i]->content->hdr);
}
}
}
mutt_str_replace(&env->subject, buffer);
}
-void mutt_make_misc_reply_headers(struct Envelope *env, struct Context *ctx,
- struct Header *cur, struct Envelope *curenv)
+void mutt_make_misc_reply_headers(struct Envelope *env, struct Envelope *curenv)
{
if (!env || !curenv)
return;
return -1;
}
- mutt_make_misc_reply_headers(env, ctx, cur, curenv);
+ mutt_make_misc_reply_headers(env, curenv);
make_reference_headers(tag ? NULL : curenv, env, ctx);
}
else if (flags & SENDFORWARD)
fputc('\n', fout);
}
-static void encode_8bit(FGETCONV *fc, FILE *fout, int istext)
+static void encode_8bit(FGETCONV *fc, FILE *fout)
{
int ch;
else if (a->encoding == ENCBASE64)
encode_base64(fc, f, write_as_text_part(a));
else if (a->type == TYPETEXT && (!a->noconv))
- encode_8bit(fc, f, write_as_text_part(a));
+ encode_8bit(fc, f);
else
mutt_file_copy_stream(fpin, f);
mutt_sig_allow_interrupt(0);