char buf[HUGE_STRING];
HEADER *hn = NULL;
- CONTEXT ctx;
+ struct Context ctx;
MESSAGE *msg = NULL;
int chflags = 0;
int r = -1;
{
int rc = 0;
int new_or_changed;
- CONTEXT ctx;
+ struct Context ctx;
if (option(OPTCHECKMBOXSIZE))
new_or_changed = sb->st_size > mailbox->size;
}
}
-int _mutt_save_message(HEADER *h, CONTEXT *ctx, int delete, int decode, int decrypt)
+int _mutt_save_message(HEADER *h, struct Context *ctx, int delete, int decode, int decrypt)
{
int cmflags, chflags;
int rc;
int i, need_buffy_cleanup;
int need_passphrase = 0, app = 0;
char prompt[SHORT_STRING], buf[_POSIX_PATH_MAX];
- CONTEXT ctx;
+ struct Context ctx;
struct stat st;
snprintf(prompt, sizeof(prompt),
int op = 0;
int loop = 1;
int fccSet = 0; /* has the user edited the Fcc: field ? */
- CONTEXT *ctx = NULL, *this = NULL;
+ struct Context *ctx = NULL, *this = NULL;
/* Sort, SortAux could be changed in mutt_index_menu() */
int oldSort, oldSortAux;
struct stat st;
/**
* struct COMPRESS_INFO - Private data for compress
*
- * This object gets attached to the mailbox's CONTEXT.
+ * This object gets attached to the mailbox's Context.
*/
typedef struct
{
* 1: Success (locked or readonly)
* 0: Error (can't lock the file)
*/
-static int lock_realpath(CONTEXT *ctx, int excl)
+static int lock_realpath(struct Context *ctx, int excl)
{
if (!ctx)
return 0;
*
* Unlock a mailbox previously locked by lock_mailbox().
*/
-static void unlock_realpath(CONTEXT *ctx)
+static void unlock_realpath(struct Context *ctx)
{
if (!ctx)
return;
* 0: Success
* -1: Error
*/
-static int setup_paths(CONTEXT *ctx)
+static int setup_paths(struct Context *ctx)
{
if (!ctx)
return -1;
*
* Save the compressed file size in the compress_info struct.
*/
-static void store_size(const CONTEXT *ctx)
+static void store_size(const struct Context *ctx)
{
if (!ctx)
return;
* COMPRESS_INFO: Hook info for the mailbox's path
* NULL: On error
*/
-static COMPRESS_INFO *set_compress_info(CONTEXT *ctx)
+static COMPRESS_INFO *set_compress_info(struct Context *ctx)
{
if (!ctx || !ctx->path)
return NULL;
* free_compress_info - Frees the compress info members and structure.
* @ctx: Mailbox to free compress_info for.
*/
-static void free_compress_info(CONTEXT *ctx)
+static void free_compress_info(struct Context *ctx)
{
COMPRESS_INFO *ci = NULL;
* @fmt: Field formatting string, UNUSED
* @ifstring: If condition is met, display this string, UNUSED
* @elsestring: Otherwise, display this string, UNUSED
- * @data: Pointer to the mailbox CONTEXT
+ * @data: Pointer to the mailbox Context
* @flags: Format flags, UNUSED
*
* cb_format_str is a callback function for mutt_FormatString. It understands
if (!dest || (data == 0))
return src;
- CONTEXT *ctx = (CONTEXT *) data;
+ struct Context *ctx = (struct Context *) data;
switch (op)
{
* Result:
* gzip -dc '~/mail/abc.gz' > '/tmp/xyz'
*/
-static void expand_command_str(const CONTEXT *ctx, const char *cmd, char *buf, int buflen)
+static void expand_command_str(const struct Context *ctx, const char *cmd, char *buf, int buflen)
{
if (!ctx || !cmd || !buf)
return;
* 1: Success
* 0: Failure
*/
-static int execute_command(CONTEXT *ctx, const char *command, const char *progress)
+static int execute_command(struct Context *ctx, const char *command, const char *progress)
{
int rc = 1;
char sys_cmd[HUGE_STRING];
* Then determine the type of the mailbox so we can delegate the handling of
* messages.
*/
-static int comp_open_mailbox(CONTEXT *ctx)
+static int comp_open_mailbox(struct Context *ctx)
{
if (!ctx || (ctx->magic != MUTT_COMPRESSED))
return -1;
* 0: Success
* -1: Failure
*/
-static int comp_open_append_mailbox(CONTEXT *ctx, int flags)
+static int comp_open_append_mailbox(struct Context *ctx, int flags)
{
if (!ctx)
return -1;
* 0: Success
* -1: Failure
*/
-static int comp_close_mailbox(CONTEXT *ctx)
+static int comp_close_mailbox(struct Context *ctx)
{
if (!ctx)
return -1;
* MUTT_REOPENED: The mailbox was closed and reopened
* -1: Mailbox bad
*/
-static int comp_check_mailbox(CONTEXT *ctx, int *index_hint)
+static int comp_check_mailbox(struct Context *ctx, int *index_hint)
{
if (!ctx)
return -1;
/**
* comp_open_message - Delegated to mbox handler
*/
-static int comp_open_message(CONTEXT *ctx, MESSAGE *msg, int msgno)
+static int comp_open_message(struct Context *ctx, MESSAGE *msg, int msgno)
{
if (!ctx)
return -1;
/**
* comp_close_message - Delegated to mbox handler
*/
-static int comp_close_message(CONTEXT *ctx, MESSAGE *msg)
+static int comp_close_message(struct Context *ctx, MESSAGE *msg)
{
if (!ctx)
return -1;
/**
* comp_commit_message - Delegated to mbox handler
*/
-static int comp_commit_message(CONTEXT *ctx, MESSAGE *msg)
+static int comp_commit_message(struct Context *ctx, MESSAGE *msg)
{
if (!ctx)
return -1;
/**
* comp_open_new_message - Delegated to mbox handler
*/
-static int comp_open_new_message(MESSAGE *msg, CONTEXT *ctx, HEADER *hdr)
+static int comp_open_new_message(MESSAGE *msg, struct Context *ctx, HEADER *hdr)
{
if (!ctx)
return -1;
* true: Yes, we can append to the file
* false: No, appending isn't possible
*/
-bool mutt_comp_can_append(CONTEXT *ctx)
+bool mutt_comp_can_append(struct Context *ctx)
{
if (!ctx)
return false;
* 0: Success
* -1: Failure
*/
-static int comp_sync_mailbox(CONTEXT *ctx, int *index_hint)
+static int comp_sync_mailbox(struct Context *ctx, int *index_hint)
{
if (!ctx)
return -1;
#ifndef _MUTT_COMPRESS_H
#define _MUTT_COMPRESS_H 1
-bool mutt_comp_can_append(CONTEXT *ctx);
+bool mutt_comp_can_append(struct Context *ctx);
bool mutt_comp_can_read(const char *path);
int mutt_comp_valid_command(const char *cmd);
/* should be made to return -1 on fatal errors, and 1 on non-fatal errors
* like partial decode, where it is worth displaying as much as possible */
-int mutt_copy_message(FILE *fpout, CONTEXT *src, HEADER *hdr, int flags, int chflags)
+int mutt_copy_message(FILE *fpout, struct Context *src, HEADER *hdr, int flags, int chflags)
{
MESSAGE *msg = NULL;
int r;
* flags mutt_copy_message() flags
* chflags mutt_copy_header() flags
*/
-static int _mutt_append_message(CONTEXT *dest, FILE *fpin, CONTEXT *src,
+static int _mutt_append_message(struct Context *dest, FILE *fpin, struct Context *src,
HEADER *hdr, struct Body *body, int flags, int chflags)
{
char buf[STRING];
return r;
}
-int mutt_append_message(CONTEXT *dest, CONTEXT *src, HEADER *hdr, int cmflags, int chflags)
+int mutt_append_message(struct Context *dest, struct Context *src, HEADER *hdr, int cmflags, int chflags)
{
MESSAGE *msg = NULL;
int r;
int _mutt_copy_message(FILE *fpout, FILE *fpin, HEADER *hdr, struct Body *body,
int flags, int chflags);
-int mutt_copy_message(FILE *fpout, CONTEXT *src, HEADER *hdr, int flags, int chflags);
+int mutt_copy_message(FILE *fpout, struct Context *src, HEADER *hdr, int flags, int chflags);
-int mutt_append_message(CONTEXT *dest, CONTEXT *src, HEADER *hdr, int cmflags, int chflags);
+int mutt_append_message(struct Context *dest, struct Context *src, HEADER *hdr, int cmflags, int chflags);
#endif /* _MUTT_COPY_H */
}
/* This should be in mx.c, but it only gets used here. */
-static int mx_toggle_write(CONTEXT *ctx)
+static int mx_toggle_write(struct Context *ctx)
{
if (!ctx)
return -1;
menu->redraw |= REDRAW_INDEX | REDRAW_STATUS;
}
-void update_index(MUTTMENU *menu, CONTEXT *ctx, int check, int oldcount, int index_hint)
+void update_index(MUTTMENU *menu, struct Context *ctx, int check, int oldcount, int index_hint)
{
/* store pointers to the newly added messages */
HEADER **save_new = NULL;
return close;
}
-void mutt_set_header_color(CONTEXT *ctx, HEADER *curhdr)
+void mutt_set_header_color(struct Context *ctx, HEADER *curhdr)
{
COLOR_LINE *color = NULL;
pattern_cache_t cache;
* 0 message edited successfully
* -1 error
*/
-static int edit_one_message(CONTEXT *ctx, HEADER *cur)
+static int edit_one_message(struct Context *ctx, HEADER *cur)
{
char tmp[_POSIX_PATH_MAX];
char buff[STRING];
int of, cf;
- CONTEXT tmpctx;
+ struct Context tmpctx;
MESSAGE *msg = NULL;
FILE *fp = NULL;
return rc;
}
-int mutt_edit_message(CONTEXT *ctx, HEADER *hdr)
+int mutt_edit_message(struct Context *ctx, HEADER *hdr)
{
int i, j;
#include "mx.h"
#include "sort.h"
-void _mutt_set_flag(CONTEXT *ctx, HEADER *h, int flag, int bf, int upd_ctx)
+void _mutt_set_flag(struct Context *ctx, HEADER *h, int flag, int bf, int upd_ctx)
{
if (!ctx || !h)
return;
WHERE void (*mutt_error)(const char *, ...);
WHERE void (*mutt_message)(const char *, ...);
-WHERE CONTEXT *Context;
+WHERE struct Context *Context;
WHERE char Errorbuf[STRING];
WHERE char AttachmentMarker[STRING];
{
struct hdr_format_info *hfi = (struct hdr_format_info *) data;
HEADER *hdr = NULL, *htmp = NULL;
- CONTEXT *ctx = NULL;
+ struct Context *ctx = NULL;
char fmt[SHORT_STRING], buf2[LONG_STRING], *p = NULL;
char *wch = NULL;
int do_locales, i;
#undef THREAD_OLD
}
-void _mutt_make_string(char *dest, size_t destlen, const char *s, CONTEXT *ctx,
+void _mutt_make_string(char *dest, size_t destlen, const char *s, struct Context *ctx,
HEADER *hdr, format_flag flags)
{
struct hdr_format_info hfi;
}
}
-static void label_ref_dec(CONTEXT *ctx, char *label)
+static void label_ref_dec(struct Context *ctx, char *label)
{
struct hash_elem *elem = NULL;
uintptr_t count;
elem->data = (void *) count;
}
-static void label_ref_inc(CONTEXT *ctx, char *label)
+static void label_ref_inc(struct Context *ctx, char *label)
{
struct hash_elem *elem = NULL;
uintptr_t count;
/*
* add an X-Label: field.
*/
-static int label_message(CONTEXT *ctx, HEADER *hdr, char *new)
+static int label_message(struct Context *ctx, HEADER *hdr, char *new)
{
if (hdr == NULL)
return 0;
return changed;
}
-void mutt_make_label_hash(CONTEXT *ctx)
+void mutt_make_label_hash(struct Context *ctx)
{
/* 131 is just a rough prime estimate of how many distinct
* labels someone might have in a mailbox.
ctx->label_hash = hash_create(131, MUTT_HASH_STRDUP_KEYS);
}
-void mutt_label_hash_add(CONTEXT *ctx, HEADER *hdr)
+void mutt_label_hash_add(struct Context *ctx, HEADER *hdr)
{
if (!ctx || !ctx->label_hash)
return;
label_ref_inc(ctx, hdr->env->x_label);
}
-void mutt_label_hash_remove(CONTEXT *ctx, HEADER *hdr)
+void mutt_label_hash_remove(struct Context *ctx, HEADER *hdr)
{
if (!ctx || !ctx->label_hash)
return;
return NULL;
}
-void mutt_message_hook(CONTEXT *ctx, HEADER *hdr, int type)
+void mutt_message_hook(struct Context *ctx, HEADER *hdr, int type)
{
struct Buffer err, token;
HOOK *hook = NULL;
current_hook_type = 0;
}
-static int addr_hook(char *path, size_t pathlen, int type, CONTEXT *ctx, HEADER *hdr)
+static int addr_hook(char *path, size_t pathlen, int type, struct Context *ctx, HEADER *hdr)
{
HOOK *hook = NULL;
pattern_cache_t cache;
return 0;
}
-int imap_delete_mailbox(CONTEXT *ctx, IMAP_MBOX *mx)
+int imap_delete_mailbox(struct Context *ctx, IMAP_MBOX *mx)
{
char buf[LONG_STRING], mbox[LONG_STRING];
IMAP_DATA *idata = NULL;
return s;
}
-static int imap_open_mailbox(CONTEXT *ctx)
+static int imap_open_mailbox(struct Context *ctx)
{
IMAP_DATA *idata = NULL;
IMAP_STATUS *status = NULL;
return -1;
}
-static int imap_open_mailbox_append(CONTEXT *ctx, int flags)
+static int imap_open_mailbox_append(struct Context *ctx, int flags)
{
IMAP_DATA *idata = NULL;
char buf[LONG_STRING];
imap_free_idata(idata);
}
-static int imap_open_new_message(MESSAGE *msg, CONTEXT *dest, HEADER *hdr)
+static int imap_open_new_message(MESSAGE *msg, struct Context *dest, HEADER *hdr)
{
char tmp[_POSIX_PATH_MAX];
* ctx: the current context
* expunge: 0 or 1 - do expunge?
*/
-int imap_sync_mailbox(CONTEXT *ctx, int expunge)
+int imap_sync_mailbox(struct Context *ctx, int expunge)
{
IMAP_DATA *idata = NULL;
- CONTEXT *appendctx = NULL;
+ struct Context *appendctx = NULL;
HEADER *h = NULL;
HEADER **hdrs = NULL;
int oldsort;
return rc;
}
-/* imap_close_mailbox: clean up IMAP data in CONTEXT */
-int imap_close_mailbox(CONTEXT *ctx)
+/* imap_close_mailbox: clean up IMAP data in Context */
+int imap_close_mailbox(struct Context *ctx)
{
IMAP_DATA *idata = NULL;
int i;
* 0 no change
* -1 error
*/
-int imap_check_mailbox(CONTEXT *ctx, int force)
+int imap_check_mailbox(struct Context *ctx, int force)
{
return imap_check(ctx->data, force);
}
return result;
}
-static int imap_check_mailbox_reopen(CONTEXT *ctx, int *index_hint)
+static int imap_check_mailbox_reopen(struct Context *ctx, int *index_hint)
{
int rc;
(void) index_hint;
return 0;
}
-int imap_search(CONTEXT *ctx, const pattern_t *pat)
+int imap_search(struct Context *ctx, const pattern_t *pat)
{
struct Buffer buf;
IMAP_DATA *idata = ctx->data;
* -1: error
* 0: success
* 1: non-fatal error - try fetch/append */
-int imap_fast_trash(CONTEXT *ctx, char *dest)
+int imap_fast_trash(struct Context *ctx, char *dest)
{
IMAP_DATA *idata = NULL;
char mbox[LONG_STRING];
/* imap.c */
int imap_access(const char *, int);
-int imap_check_mailbox(CONTEXT *ctx, int force);
-int imap_delete_mailbox(CONTEXT *ctx, IMAP_MBOX *mx);
-int imap_sync_mailbox(CONTEXT *ctx, int expunge);
-int imap_close_mailbox(CONTEXT *ctx);
+int imap_check_mailbox(struct Context *ctx, int force);
+int imap_delete_mailbox(struct Context *ctx, IMAP_MBOX *mx);
+int imap_sync_mailbox(struct Context *ctx, int expunge);
+int imap_close_mailbox(struct Context *ctx);
int imap_buffy_check(int force, int check_stats);
int imap_status(char *path, int queue);
-int imap_search(CONTEXT *ctx, const pattern_t *pat);
+int imap_search(struct Context *ctx, const pattern_t *pat);
int imap_subscribe(char *path, int subscribe);
int imap_complete(char *dest, size_t dlen, char *path);
-int imap_fast_trash(CONTEXT *ctx, char *dest);
+int imap_fast_trash(struct Context *ctx, char *dest);
-void imap_allow_reopen(CONTEXT *ctx);
-void imap_disallow_reopen(CONTEXT *ctx);
+void imap_allow_reopen(struct Context *ctx);
+void imap_disallow_reopen(struct Context *ctx);
extern struct mx_ops mx_imap_ops;
int imap_mailbox_rename(const char *mailbox);
/* message.c */
-int imap_append_message(CONTEXT *ctx, MESSAGE *msg);
-int imap_copy_messages(CONTEXT *ctx, HEADER *h, char *dest, int delete);
+int imap_append_message(struct Context *ctx, MESSAGE *msg);
+int imap_copy_messages(struct Context *ctx, HEADER *h, char *dest, int delete);
/* socket.c */
void imap_logout_all(void);
/* The following data is all specific to the currently SELECTED mbox */
char delim;
- CONTEXT *ctx;
+ struct Context *ctx;
char *mailbox;
unsigned short check_status;
unsigned char reopen;
int imap_cache_del(IMAP_DATA *idata, HEADER *h);
int imap_cache_clean(IMAP_DATA *idata);
-int imap_fetch_message(CONTEXT *ctx, MESSAGE *msg, int msgno);
-int imap_close_message(CONTEXT *ctx, MESSAGE *msg);
-int imap_commit_message(CONTEXT *ctx, MESSAGE *msg);
+int imap_fetch_message(struct Context *ctx, MESSAGE *msg, int msgno);
+int imap_close_message(struct Context *ctx, MESSAGE *msg);
+int imap_commit_message(struct Context *ctx, MESSAGE *msg);
/* util.c */
#ifdef USE_HCACHE
static void imap_update_context(IMAP_DATA *idata, int oldmsgcount)
{
- CONTEXT *ctx = NULL;
+ struct Context *ctx = NULL;
HEADER *h = NULL;
int msgno;
* 0 on success
* -1 if the string is not a fetch response
* -2 if the string is a corrupt fetch response */
-static int msg_fetch_header(CONTEXT *ctx, IMAP_HEADER *h, char *buf, FILE *fp)
+static int msg_fetch_header(struct Context *ctx, IMAP_HEADER *h, char *buf, FILE *fp)
{
IMAP_DATA *idata = NULL;
long bytes;
*/
int imap_read_headers(IMAP_DATA *idata, int msgbegin, int msgend)
{
- CONTEXT *ctx = NULL;
+ struct Context *ctx = NULL;
char *hdrreq = NULL;
FILE *fp = NULL;
char tempfile[_POSIX_PATH_MAX];
return retval;
}
-int imap_fetch_message(CONTEXT *ctx, MESSAGE *msg, int msgno)
+int imap_fetch_message(struct Context *ctx, MESSAGE *msg, int msgno)
{
IMAP_DATA *idata = NULL;
HEADER *h = NULL;
return -1;
}
-int imap_close_message(CONTEXT *ctx, MESSAGE *msg)
+int imap_close_message(struct Context *ctx, MESSAGE *msg)
{
return safe_fclose(&msg->fp);
}
-int imap_commit_message(CONTEXT *ctx, MESSAGE *msg)
+int imap_commit_message(struct Context *ctx, MESSAGE *msg)
{
int r = safe_fclose(&msg->fp);
return imap_append_message(ctx, msg);
}
-int imap_append_message(CONTEXT *ctx, MESSAGE *msg)
+int imap_append_message(struct Context *ctx, MESSAGE *msg)
{
IMAP_DATA *idata = NULL;
FILE *fp = NULL;
* -1: error
* 0: success
* 1: non-fatal error - try fetch/append */
-int imap_copy_messages(CONTEXT *ctx, HEADER *h, char *dest, int delete)
+int imap_copy_messages(struct Context *ctx, HEADER *h, char *dest, int delete)
{
IMAP_DATA *idata = NULL;
struct Buffer cmd, sync_cmd;
* the server. Expects a flags line of the form "FLAGS (flag flag ...)" */
char *imap_set_flags(IMAP_DATA *idata, HEADER *h, char *s)
{
- CONTEXT *ctx = idata->ctx;
+ struct Context *ctx = idata->ctx;
IMAP_HEADER newh;
IMAP_HEADER_DATA *hd = NULL;
bool readonly;
}
/* Allow/disallow re-opening a folder upon expunge. */
-void imap_allow_reopen(CONTEXT *ctx)
+void imap_allow_reopen(struct Context *ctx)
{
IMAP_DATA *idata = NULL;
if (!ctx || !ctx->data || ctx->magic != MUTT_IMAP)
idata->reopen |= IMAP_REOPEN_ALLOW;
}
-void imap_disallow_reopen(CONTEXT *ctx)
+void imap_disallow_reopen(struct Context *ctx)
{
IMAP_DATA *idata = NULL;
if (!ctx || !ctx->data || ctx->magic != MUTT_IMAP)
time_t received; /* the time at which this message was received */
} MESSAGE;
-CONTEXT *mx_open_mailbox(const char *path, int flags, CONTEXT *pctx);
+struct Context *mx_open_mailbox(const char *path, int flags, struct Context *pctx);
-MESSAGE *mx_open_message(CONTEXT *ctx, int msgno);
-MESSAGE *mx_open_new_message(CONTEXT *dest, HEADER *hdr, int flags);
+MESSAGE *mx_open_message(struct Context *ctx, int msgno);
+MESSAGE *mx_open_new_message(struct Context *dest, HEADER *hdr, int flags);
-void mx_fastclose_mailbox(CONTEXT *ctx);
+void mx_fastclose_mailbox(struct Context *ctx);
-int mx_close_mailbox(CONTEXT *ctx, int *index_hint);
-int mx_sync_mailbox(CONTEXT *ctx, int *index_hint);
-int mx_commit_message(MESSAGE *msg, CONTEXT *ctx);
-int mx_close_message(CONTEXT *ctx, MESSAGE **msg);
+int mx_close_mailbox(struct Context *ctx, int *index_hint);
+int mx_sync_mailbox(struct Context *ctx, int *index_hint);
+int mx_commit_message(MESSAGE *msg, struct Context *ctx);
+int mx_close_message(struct Context *ctx, MESSAGE **msg);
int mx_get_magic(const char *path);
int mx_set_magic(const char *s);
-int mx_check_mailbox(CONTEXT *ctx, int *index_hint);
+int mx_check_mailbox(struct Context *ctx, int *index_hint);
#ifdef USE_IMAP
bool mx_is_imap(const char *p);
#endif
* excl - exclusive lock?
* retry - should retry if unable to lock?
*/
-static int mbox_lock_mailbox(CONTEXT *ctx, int excl, int retry)
+static int mbox_lock_mailbox(struct Context *ctx, int excl, int retry)
{
int r;
return r;
}
-static void mbox_unlock_mailbox(CONTEXT *ctx)
+static void mbox_unlock_mailbox(struct Context *ctx)
{
if (ctx->locked)
{
}
}
-static int mmdf_parse_mailbox(CONTEXT *ctx)
+static int mmdf_parse_mailbox(struct Context *ctx)
{
char buf[HUGE_STRING];
char return_path[LONG_STRING];
* NOTE: it is assumed that the mailbox being read has been locked before
* this routine gets called. Strange things could happen if it's not!
*/
-static int mbox_parse_mailbox(CONTEXT *ctx)
+static int mbox_parse_mailbox(struct Context *ctx)
{
struct stat sb;
char buf[HUGE_STRING], return_path[STRING];
#undef PREV
/* open a mbox or mmdf style mailbox */
-static int mbox_open_mailbox(CONTEXT *ctx)
+static int mbox_open_mailbox(struct Context *ctx)
{
int rc;
return rc;
}
-static int mbox_open_mailbox_append(CONTEXT *ctx, int flags)
+static int mbox_open_mailbox_append(struct Context *ctx, int flags)
{
ctx->fp = safe_fopen(ctx->path, flags & MUTT_NEWFOLDER ? "w" : "a");
if (!ctx->fp)
return 0;
}
-static int mbox_close_mailbox(CONTEXT *ctx)
+static int mbox_close_mailbox(struct Context *ctx)
{
if (!ctx->fp)
{
return 0;
}
-static int mbox_open_message(CONTEXT *ctx, MESSAGE *msg, int msgno)
+static int mbox_open_message(struct Context *ctx, MESSAGE *msg, int msgno)
{
msg->fp = ctx->fp;
return 0;
}
-static int mbox_close_message(CONTEXT *ctx, MESSAGE *msg)
+static int mbox_close_message(struct Context *ctx, MESSAGE *msg)
{
msg->fp = NULL;
return 0;
}
-static int mbox_commit_message(CONTEXT *ctx, MESSAGE *msg)
+static int mbox_commit_message(struct Context *ctx, MESSAGE *msg)
{
if (fputc('\n', msg->fp) == EOF)
return -1;
return 0;
}
-static int mmdf_commit_message(CONTEXT *ctx, MESSAGE *msg)
+static int mmdf_commit_message(struct Context *ctx, MESSAGE *msg)
{
if (fputs(MMDF_SEP, msg->fp) == EOF)
return -1;
return 0;
}
-static int mbox_open_new_message(MESSAGE *msg, CONTEXT *dest, HEADER *hdr)
+static int mbox_open_new_message(MESSAGE *msg, struct Context *dest, HEADER *hdr)
{
msg->fp = dest->fp;
return 0;
}
}
-static int reopen_mailbox(CONTEXT *ctx, int *index_hint)
+static int reopen_mailbox(struct Context *ctx, int *index_hint)
{
int (*cmp_headers)(const HEADER *, const HEADER *) = NULL;
HEADER **old_hdrs;
* 0 no change
* -1 error
*/
-static int mbox_check_mailbox(CONTEXT *ctx, int *index_hint)
+static int mbox_check_mailbox(struct Context *ctx, int *index_hint)
{
struct stat st;
char buffer[LONG_STRING];
* Returns 1 if the mailbox has at least 1 new messages (not old)
* otherwise returns 0.
*/
-static bool mbox_has_new(CONTEXT *ctx)
+static bool mbox_has_new(struct Context *ctx)
{
int i;
/* if mailbox has at least 1 new message, sets mtime > atime of mailbox
* so buffy check reports new mail */
-void mbox_reset_atime(CONTEXT *ctx, struct stat *st)
+void mbox_reset_atime(struct Context *ctx, struct stat *st)
{
struct utimbuf utimebuf;
struct stat _st;
* 0 success
* -1 failure
*/
-static int mbox_sync_mailbox(CONTEXT *ctx, int *index_hint)
+static int mbox_sync_mailbox(struct Context *ctx, int *index_hint)
{
char tempfile[_POSIX_PATH_MAX];
char buf[32];
#define MH_SEQ_REPLIED (1 << 1)
#define MH_SEQ_FLAGGED (1 << 2)
-static inline struct mh_data *mh_data(CONTEXT *ctx)
+static inline struct mh_data *mh_data(struct Context *ctx)
{
return (struct mh_data *) ctx->data;
}
return rc;
}
-static inline mode_t mh_umask(CONTEXT *ctx)
+static inline mode_t mh_umask(struct Context *ctx)
{
struct stat st;
struct mh_data *data = mh_data(ctx);
return rc;
}
-static int mh_mkstemp(CONTEXT *dest, FILE **fp, char **tgt)
+static int mh_mkstemp(struct Context *dest, FILE **fp, char **tgt)
{
int fd;
char path[_POSIX_PATH_MAX];
}
/* XXX - we don't currently remove deleted messages from sequences we don't know. Should we? */
-static void mh_update_sequences(CONTEXT *ctx)
+static void mh_update_sequences(struct Context *ctx)
{
FILE *ofp = NULL, *nfp = NULL;
FREE(&tmpfname);
}
-static void mh_sequences_add_one(CONTEXT *ctx, int n, short unseen, short flagged, short replied)
+static void mh_sequences_add_one(struct Context *ctx, int n, short unseen, short flagged, short replied)
{
short unseen_done = 0;
short flagged_done = 0;
*q = '\0';
}
-static void maildir_update_mtime(CONTEXT *ctx)
+static void maildir_update_mtime(struct Context *ctx)
{
char buf[_POSIX_PATH_MAX];
struct stat st;
return NULL;
}
-static int maildir_parse_dir(CONTEXT *ctx, struct maildir ***last,
+static int maildir_parse_dir(struct Context *ctx, struct maildir ***last,
const char *subdir, int *count, progress_t *progress)
{
DIR *dirp = NULL;
return 0;
}
-static bool maildir_add_to_context(CONTEXT *ctx, struct maildir *md)
+static bool maildir_add_to_context(struct Context *ctx, struct maildir *md)
{
int oldmsgcount = ctx->msgcount;
return false;
}
-static int maildir_move_to_context(CONTEXT *ctx, struct maildir **md)
+static int maildir_move_to_context(struct Context *ctx, struct maildir **md)
{
int r;
r = maildir_add_to_context(ctx, *md);
/* Sorts mailbox into its natural order.
* Currently only defined for MH where files are numbered.
*/
-static void mh_sort_natural(CONTEXT *ctx, struct maildir **md)
+static void mh_sort_natural(struct Context *ctx, struct maildir **md)
{
if (!ctx || !md || !*md || ctx->magic != MUTT_MH || Sort != SORT_ORDER)
return;
/*
* This function does the second parsing pass
*/
-static void maildir_delayed_parsing(CONTEXT *ctx, struct maildir **md, progress_t *progress)
+static void maildir_delayed_parsing(struct Context *ctx, struct maildir **md, progress_t *progress)
{
struct maildir *p, *last = NULL;
char fn[_POSIX_PATH_MAX];
mh_sort_natural(ctx, md);
}
-static int mh_close_mailbox(CONTEXT *ctx)
+static int mh_close_mailbox(struct Context *ctx)
{
FREE(&ctx->data);
* subdir [IN] NULL for MH mailboxes, otherwise the subdir of the
* maildir mailbox to read from
*/
-static int mh_read_dir(CONTEXT *ctx, const char *subdir)
+static int mh_read_dir(struct Context *ctx, const char *subdir)
{
struct maildir *md = NULL;
struct mh_sequences mhs;
}
/* read a maildir style mailbox */
-static int maildir_read_dir(CONTEXT *ctx)
+static int maildir_read_dir(struct Context *ctx)
{
/* maildir looks sort of like MH, except that there are two subdirectories
* of the main folder path from which to read messages
return 0;
}
-static int maildir_open_mailbox(CONTEXT *ctx)
+static int maildir_open_mailbox(struct Context *ctx)
{
return maildir_read_dir(ctx);
}
-static int maildir_open_mailbox_append(CONTEXT *ctx, int flags)
+static int maildir_open_mailbox_append(struct Context *ctx, int flags)
{
char tmp[_POSIX_PATH_MAX];
return 0;
}
-static int mh_open_mailbox(CONTEXT *ctx)
+static int mh_open_mailbox(struct Context *ctx)
{
return mh_read_dir(ctx, NULL);
}
-static int mh_open_mailbox_append(CONTEXT *ctx, int flags)
+static int mh_open_mailbox_append(struct Context *ctx, int flags)
{
char tmp[_POSIX_PATH_MAX];
int i;
* Open a new (temporary) message in an MH folder.
*/
-static int mh_open_new_message(MESSAGE *msg, CONTEXT *dest, HEADER *hdr)
+static int mh_open_new_message(MESSAGE *msg, struct Context *dest, HEADER *hdr)
{
return mh_mkstemp(dest, &msg->fp, &msg->path);
}
}
}
-static int maildir_mh_open_message(CONTEXT *ctx, MESSAGE *msg, int msgno, int is_maildir)
+static int maildir_mh_open_message(struct Context *ctx, MESSAGE *msg, int msgno, int is_maildir)
{
HEADER *cur = ctx->hdrs[msgno];
char path[_POSIX_PATH_MAX];
return 0;
}
-static int maildir_open_message(CONTEXT *ctx, MESSAGE *msg, int msgno)
+static int maildir_open_message(struct Context *ctx, MESSAGE *msg, int msgno)
{
return maildir_mh_open_message(ctx, msg, msgno, 1);
}
-static int mh_open_message(CONTEXT *ctx, MESSAGE *msg, int msgno)
+static int mh_open_message(struct Context *ctx, MESSAGE *msg, int msgno)
{
return maildir_mh_open_message(ctx, msg, msgno, 0);
}
-static int mh_close_message(CONTEXT *ctx, MESSAGE *msg)
+static int mh_close_message(struct Context *ctx, MESSAGE *msg)
{
return safe_fclose(&msg->fp);
}
* with a {cur,new} prefix.
*
*/
-static int maildir_open_new_message(MESSAGE *msg, CONTEXT *dest, HEADER *hdr)
+static int maildir_open_new_message(MESSAGE *msg, struct Context *dest, HEADER *hdr)
{
int fd;
char path[_POSIX_PATH_MAX];
* See also maildir_open_new_message().
*
*/
-static int _maildir_commit_message(CONTEXT *ctx, MESSAGE *msg, HEADER *hdr)
+static int _maildir_commit_message(struct Context *ctx, MESSAGE *msg, HEADER *hdr)
{
char subdir[4];
char suffix[16];
}
}
-static int maildir_commit_message(CONTEXT *ctx, MESSAGE *msg)
+static int maildir_commit_message(struct Context *ctx, MESSAGE *msg)
{
return _maildir_commit_message(ctx, msg, NULL);
}
*/
-static int _mh_commit_message(CONTEXT *ctx, MESSAGE *msg, HEADER *hdr, short updseq)
+static int _mh_commit_message(struct Context *ctx, MESSAGE *msg, HEADER *hdr, short updseq)
{
DIR *dirp = NULL;
struct dirent *de = NULL;
return 0;
}
-static int mh_commit_message(CONTEXT *ctx, MESSAGE *msg)
+static int mh_commit_message(struct Context *ctx, MESSAGE *msg)
{
return _mh_commit_message(ctx, msg, NULL, 1);
}
* This code is also used for attachment deletion in maildir
* folders.
*/
-static int mh_rewrite_message(CONTEXT *ctx, int msgno)
+static int mh_rewrite_message(struct Context *ctx, int msgno)
{
HEADER *h = ctx->hdrs[msgno];
MESSAGE *dest = NULL;
return rc;
}
-static int mh_sync_message(CONTEXT *ctx, int msgno)
+static int mh_sync_message(struct Context *ctx, int msgno)
{
HEADER *h = ctx->hdrs[msgno];
return 0;
}
-static int maildir_sync_message(CONTEXT *ctx, int msgno)
+static int maildir_sync_message(struct Context *ctx, int msgno)
{
HEADER *h = ctx->hdrs[msgno];
}
#ifdef USE_HCACHE
-int mh_sync_mailbox_message(CONTEXT *ctx, int msgno, header_cache_t *hc)
+int mh_sync_mailbox_message(struct Context *ctx, int msgno, header_cache_t *hc)
#else
-int mh_sync_mailbox_message(CONTEXT *ctx, int msgno)
+int mh_sync_mailbox_message(struct Context *ctx, int msgno)
#endif
{
#ifdef USE_HCACHE
return dest;
}
-static void maildir_update_tables(CONTEXT *ctx, int *index_hint)
+static void maildir_update_tables(struct Context *ctx, int *index_hint)
{
short old_sort;
int old_count;
* either subdirectory differently, as mail could be copied directly into
* the cur directory from another agent.
*/
-static int maildir_check_mailbox(CONTEXT *ctx, int *index_hint)
+static int maildir_check_mailbox(struct Context *ctx, int *index_hint)
{
struct stat st_new; /* status of the "new" subdirectory */
struct stat st_cur; /* status of the "cur" subdirectory */
* happens.
*
*/
-static int mh_check_mailbox(CONTEXT *ctx, int *index_hint)
+static int mh_check_mailbox(struct Context *ctx, int *index_hint)
{
char buf[_POSIX_PATH_MAX];
struct stat st, st_cur;
return 0;
}
-static int mh_sync_mailbox(CONTEXT *ctx, int *index_hint)
+static int mh_sync_mailbox(struct Context *ctx, int *index_hint)
{
int i, j;
#ifdef USE_HCACHE
return -1;
}
-bool maildir_update_flags(CONTEXT *ctx, HEADER *o, HEADER *n)
+bool maildir_update_flags(struct Context *ctx, HEADER *o, HEADER *n)
{
/* save the global state here so we can reset it at the
* end of list block if required.
RIGHTSMAX
};
-struct _context;
+struct Context;
struct _message;
/*
*/
struct mx_ops
{
- int (*open)(struct _context *ctx);
- int (*open_append)(struct _context *ctx, int flags);
- int (*close)(struct _context *ctx);
- int (*check)(struct _context *ctx, int *index_hint);
- int (*sync)(struct _context *ctx, int *index_hint);
- int (*open_msg)(struct _context *ctx, struct _message *msg, int msgno);
- int (*close_msg)(struct _context *ctx, struct _message *msg);
- int (*commit_msg)(struct _context *ctx, struct _message *msg);
- int (*open_new_msg)(struct _message *msg, struct _context *ctx, HEADER *hdr);
+ int (*open)(struct Context *ctx);
+ int (*open_append)(struct Context *ctx, int flags);
+ int (*close)(struct Context *ctx);
+ int (*check)(struct Context *ctx, int *index_hint);
+ int (*sync)(struct Context *ctx, int *index_hint);
+ int (*open_msg)(struct Context *ctx, struct _message *msg, int msgno);
+ int (*close_msg)(struct Context *ctx, struct _message *msg);
+ int (*commit_msg)(struct Context *ctx, struct _message *msg);
+ int (*open_new_msg)(struct _message *msg, struct Context *ctx, HEADER *hdr);
};
#include "mutt_menu.h"
-typedef struct _context
+struct Context
{
char *path;
char *realpath; /* used for buffy comparison and the sidebar */
/* driver hooks */
void *data; /* driver specific data */
struct mx_ops *mx_ops;
-} CONTEXT;
+};
typedef struct
{
*
* ## Notes
*
- * - notmuch uses private CONTEXT->data and private HEADER->data
+ * - notmuch uses private Context->data and private HEADER->data
*
* - all exported functions are usable within notmuch context only
*
*
* This stores the global NotMuch data, such as the database connection.
*
- * @sa CONTEXT#data, NotmuchDBLimit, NM_QUERY_TYPE_MESGS
+ * @sa Context#data, NotmuchDBLimit, NM_QUERY_TYPE_MESGS
*/
struct nm_ctxdata
{
return data;
}
-static int init_context(CONTEXT *ctx)
+static int init_context(struct Context *ctx)
{
if (!ctx || (ctx->magic != MUTT_NOTMUCH))
return -1;
return buf;
}
-static struct nm_ctxdata *get_ctxdata(CONTEXT *ctx)
+static struct nm_ctxdata *get_ctxdata(struct Context *ctx)
{
if (ctx && (ctx->magic == MUTT_NOTMUCH))
return ctx->data;
return name;
}
-static void progress_reset(CONTEXT *ctx)
+static void progress_reset(struct Context *ctx)
{
struct nm_ctxdata *data = NULL;
data->progress_ready = false;
}
-static void progress_update(CONTEXT *ctx, notmuch_query_t *q)
+static void progress_update(struct Context *ctx, notmuch_query_t *q)
{
struct nm_ctxdata *data = get_ctxdata(ctx);
ctx->msgcount + data->ignmsgcount - data->oldmsgcount, -1);
}
-static HEADER *get_mutt_header(CONTEXT *ctx, notmuch_message_t *msg)
+static HEADER *get_mutt_header(struct Context *ctx, notmuch_message_t *msg)
{
char *mid = NULL;
const char *id = NULL;
return h;
}
-static void append_message(CONTEXT *ctx, notmuch_query_t *q, notmuch_message_t *msg, int dedup)
+static void append_message(struct Context *ctx, notmuch_query_t *q, notmuch_message_t *msg, int dedup)
{
char *newpath = NULL;
const char *path = NULL;
FREE(&newpath);
}
-static void append_replies(CONTEXT *ctx, notmuch_query_t *q, notmuch_message_t *top, int dedup)
+static void append_replies(struct Context *ctx, notmuch_query_t *q, notmuch_message_t *top, int dedup)
{
notmuch_messages_t *msgs = NULL;
}
}
-static void append_thread(CONTEXT *ctx, notmuch_query_t *q, notmuch_thread_t *thread, int dedup)
+static void append_thread(struct Context *ctx, notmuch_query_t *q, notmuch_thread_t *thread, int dedup)
{
notmuch_messages_t *msgs = NULL;
}
}
-static bool read_mesgs_query(CONTEXT *ctx, notmuch_query_t *q, int dedup)
+static bool read_mesgs_query(struct Context *ctx, notmuch_query_t *q, int dedup)
{
struct nm_ctxdata *data = get_ctxdata(ctx);
int limit;
return true;
}
-static bool read_threads_query(CONTEXT *ctx, notmuch_query_t *q, int dedup, int limit)
+static bool read_threads_query(struct Context *ctx, notmuch_query_t *q, int dedup, int limit)
{
struct nm_ctxdata *data = get_ctxdata(ctx);
notmuch_threads_t *threads = NULL;
return 0;
}
-static int update_header_flags(CONTEXT *ctx, HEADER *hdr, const char *tags)
+static int update_header_flags(struct Context *ctx, HEADER *hdr, const char *tags)
{
char *tag = NULL, *end = NULL, *p = NULL;
char *buf = safe_strdup(tags);
return NULL;
}
-void nm_longrun_init(CONTEXT *ctx, int writable)
+void nm_longrun_init(struct Context *ctx, int writable)
{
struct nm_ctxdata *data = get_ctxdata(ctx);
}
}
-void nm_longrun_done(CONTEXT *ctx)
+void nm_longrun_done(struct Context *ctx)
{
struct nm_ctxdata *data = get_ctxdata(ctx);
mutt_debug(2, "nm: long run deinitialized\n");
}
-void nm_debug_check(CONTEXT *ctx)
+void nm_debug_check(struct Context *ctx)
{
struct nm_ctxdata *data = get_ctxdata(ctx);
if (!data)
}
}
-int nm_read_entire_thread(CONTEXT *ctx, HEADER *h)
+int nm_read_entire_thread(struct Context *ctx, HEADER *h)
{
struct nm_ctxdata *data = get_ctxdata(ctx);
const char *id = NULL;
return rc;
}
-char *nm_uri_from_query(CONTEXT *ctx, char *buf, size_t bufsz)
+char *nm_uri_from_query(struct Context *ctx, char *buf, size_t bufsz)
{
mutt_debug(2, "nm_uri_from_query (%s)\n", buf);
struct nm_ctxdata *data = get_ctxdata(ctx);
mutt_debug(2, "nm_normalize_uri (%s)\n", orig_uri);
char buf[LONG_STRING];
- CONTEXT tmp_ctx;
+ struct Context tmp_ctx;
struct nm_ctxdata tmp_ctxdata;
tmp_ctx.magic = MUTT_NOTMUCH;
mutt_debug(2, "nm_query_window_backward (%d)\n", NotmuchQueryWindowCurrentPosition);
}
-int nm_modify_message_tags(CONTEXT *ctx, HEADER *hdr, char *buf)
+int nm_modify_message_tags(struct Context *ctx, HEADER *hdr, char *buf)
{
struct nm_ctxdata *data = get_ctxdata(ctx);
notmuch_database_t *db = NULL;
return rc;
}
-int nm_update_filename(CONTEXT *ctx, const char *old, const char *new, HEADER *h)
+int nm_update_filename(struct Context *ctx, const char *old, const char *new, HEADER *h)
{
char buf[PATH_MAX];
int rc;
return rc;
}
-char *nm_get_description(CONTEXT *ctx)
+char *nm_get_description(struct Context *ctx)
{
struct Buffy *p = NULL;
return -1;
}
-int nm_record_message(CONTEXT *ctx, char *path, HEADER *h)
+int nm_record_message(struct Context *ctx, char *path, HEADER *h)
{
notmuch_database_t *db = NULL;
notmuch_status_t st;
return rc;
}
-int nm_get_all_tags(CONTEXT *ctx, char **tag_list, int *tag_count)
+int nm_get_all_tags(struct Context *ctx, char **tag_list, int *tag_count)
{
struct nm_ctxdata *data = get_ctxdata(ctx);
notmuch_database_t *db = NULL;
}
-static int nm_open_mailbox(CONTEXT *ctx)
+static int nm_open_mailbox(struct Context *ctx)
{
notmuch_query_t *q = NULL;
struct nm_ctxdata *data = NULL;
return rc;
}
-static int nm_close_mailbox(CONTEXT *ctx)
+static int nm_close_mailbox(struct Context *ctx)
{
int i;
return 0;
}
-static int nm_check_mailbox(CONTEXT *ctx, int *index_hint)
+static int nm_check_mailbox(struct Context *ctx, int *index_hint)
{
struct nm_ctxdata *data = get_ctxdata(ctx);
time_t mtime = 0;
new_flags ? MUTT_FLAGS : 0;
}
-static int nm_sync_mailbox(CONTEXT *ctx, int *index_hint)
+static int nm_sync_mailbox(struct Context *ctx, int *index_hint)
{
struct nm_ctxdata *data = get_ctxdata(ctx);
int i, rc = 0;
return rc;
}
-static int nm_open_message(CONTEXT *ctx, MESSAGE *msg, int msgno)
+static int nm_open_message(struct Context *ctx, MESSAGE *msg, int msgno)
{
if (!ctx || !msg)
return 1;
return !msg->fp;
}
-static int nm_close_message(CONTEXT *ctx, MESSAGE *msg)
+static int nm_close_message(struct Context *ctx, MESSAGE *msg)
{
if (!msg)
return 1;
return 0;
}
-static int nm_commit_message(CONTEXT *ctx, MESSAGE *msg)
+static int nm_commit_message(struct Context *ctx, MESSAGE *msg)
{
mutt_error(_("Can't write to virtual folder."));
return -1;
#include <stdbool.h>
-int nm_read_entire_thread(CONTEXT *ctx, HEADER *h);
+int nm_read_entire_thread(struct Context *ctx, HEADER *h);
char *nm_header_get_folder(HEADER *h);
-int nm_update_filename(CONTEXT *ctx, const char *old, const char *new, HEADER *h);
+int nm_update_filename(struct Context *ctx, const char *old, const char *new, HEADER *h);
bool nm_normalize_uri(char *new_uri, const char *orig_uri, size_t new_uri_sz);
-char *nm_uri_from_query(CONTEXT *ctx, char *buf, size_t bufsz);
-int nm_modify_message_tags(CONTEXT *ctx, HEADER *hdr, char *buf);
+char *nm_uri_from_query(struct Context *ctx, char *buf, size_t bufsz);
+int nm_modify_message_tags(struct Context *ctx, HEADER *hdr, char *buf);
void nm_query_window_backward(void);
void nm_query_window_forward(void);
-void nm_longrun_init(CONTEXT *ctx, int writable);
-void nm_longrun_done(CONTEXT *ctx);
+void nm_longrun_init(struct Context *ctx, int writable);
+void nm_longrun_done(struct Context *ctx);
-char *nm_get_description(CONTEXT *ctx);
+char *nm_get_description(struct Context *ctx);
int nm_description_to_path(const char *desc, char *buf, size_t bufsz);
-int nm_record_message(CONTEXT *ctx, char *path, HEADER *h);
+int nm_record_message(struct Context *ctx, char *path, HEADER *h);
-void nm_debug_check(CONTEXT *ctx);
-int nm_get_all_tags(CONTEXT *ctx, char **tag_list, int *tag_count);
+void nm_debug_check(struct Context *ctx);
+int nm_get_all_tags(struct Context *ctx, char **tag_list, int *tag_count);
/*
- * functions usable outside notmuch CONTEXT
+ * functions usable outside notmuch Context
*/
int nm_nonctx_get_count(char *path, int *all, int *new);
return access(path, flags);
}
-static int mx_open_mailbox_append(CONTEXT *ctx, int flags)
+static int mx_open_mailbox_append(struct Context *ctx, int flags)
{
struct stat sb;
* MUTT_PEEK revert atime where applicable
* ctx if non-null, context struct to use
*/
-CONTEXT *mx_open_mailbox(const char *path, int flags, CONTEXT *pctx)
+struct Context *mx_open_mailbox(const char *path, int flags, struct Context *pctx)
{
- CONTEXT *ctx = pctx;
+ struct Context *ctx = pctx;
int rc;
if (!path || !path[0])
return NULL;
if (!ctx)
- ctx = safe_malloc(sizeof(CONTEXT));
- memset(ctx, 0, sizeof(CONTEXT));
+ ctx = safe_malloc(sizeof(struct Context));
+ memset(ctx, 0, sizeof(struct Context));
ctx->path = safe_strdup(path);
if (!(ctx->realpath = realpath(ctx->path, NULL)))
ctx->realpath = safe_strdup(ctx->path);
}
/* free up memory associated with the mailbox context */
-void mx_fastclose_mailbox(CONTEXT *ctx)
+void mx_fastclose_mailbox(struct Context *ctx)
{
int i;
struct utimbuf ut;
if (ctx->limit_pattern)
mutt_pattern_free(&ctx->limit_pattern);
safe_fclose(&ctx->fp);
- memset(ctx, 0, sizeof(CONTEXT));
+ memset(ctx, 0, sizeof(struct Context));
}
/* save changes to disk */
-static int sync_mailbox(CONTEXT *ctx, int *index_hint)
+static int sync_mailbox(struct Context *ctx, int *index_hint)
{
if (!ctx->mx_ops || !ctx->mx_ops->sync)
return -1;
}
/* move deleted mails to the trash folder */
-static int trash_append(CONTEXT *ctx)
+static int trash_append(struct Context *ctx)
{
- CONTEXT ctx_trash;
+ struct Context ctx_trash;
int i;
struct stat st, stc;
int opt_confappend, rc;
}
/* save changes and close mailbox */
-int mx_close_mailbox(CONTEXT *ctx, int *index_hint)
+int mx_close_mailbox(struct Context *ctx, int *index_hint)
{
int i, move_messages = 0, purge = 1, read_msgs = 0;
int check;
int isSpool = 0;
- CONTEXT f;
+ struct Context f;
char mbox[_POSIX_PATH_MAX];
char buf[SHORT_STRING];
#endif
/* update a Context structure's internal tables. */
-void mx_update_tables(CONTEXT *ctx, int committing)
+void mx_update_tables(struct Context *ctx, int committing)
{
int i, j;
* 0 success
* -1 error
*/
-int mx_sync_mailbox(CONTEXT *ctx, int *index_hint)
+int mx_sync_mailbox(struct Context *ctx, int *index_hint)
{
int rc, i;
int purge = 1;
* hdr message being copied (required for maildir support, because
* the filename depends on the message flags)
*/
-MESSAGE *mx_open_new_message(CONTEXT *dest, HEADER *hdr, int flags)
+MESSAGE *mx_open_new_message(struct Context *dest, HEADER *hdr, int flags)
{
struct Address *p = NULL;
MESSAGE *msg = NULL;
}
/* check for new mail */
-int mx_check_mailbox(CONTEXT *ctx, int *index_hint)
+int mx_check_mailbox(struct Context *ctx, int *index_hint)
{
if (!ctx || !ctx->mx_ops)
{
}
/* return a stream pointer for a message */
-MESSAGE *mx_open_message(CONTEXT *ctx, int msgno)
+MESSAGE *mx_open_message(struct Context *ctx, int msgno)
{
MESSAGE *msg = NULL;
}
/* commit a message to a folder */
-int mx_commit_message(MESSAGE *msg, CONTEXT *ctx)
+int mx_commit_message(MESSAGE *msg, struct Context *ctx)
{
if (!ctx->mx_ops || !ctx->mx_ops->commit_msg)
return -1;
}
/* close a pointer to a message */
-int mx_close_message(CONTEXT *ctx, MESSAGE **msg)
+int mx_close_message(struct Context *ctx, MESSAGE **msg)
{
if (!ctx || !msg)
return 0;
return r;
}
-void mx_alloc_memory(CONTEXT *ctx)
+void mx_alloc_memory(struct Context *ctx)
{
int i;
size_t s = MAX(sizeof(HEADER *), sizeof(int));
/* this routine is called to update the counts in the context structure for
* the last message header parsed.
*/
-void mx_update_context(CONTEXT *ctx, int new_messages)
+void mx_update_context(struct Context *ctx, int new_messages)
{
HEADER *h = NULL;
int msgno;
#define MAXLOCKATTEMPT 5
int mbox_check_empty(const char *path);
-void mbox_reset_atime(CONTEXT *ctx, struct stat *st);
+void mbox_reset_atime(struct Context *ctx, struct stat *st);
int mh_check_empty(const char *path);
HEADER *maildir_parse_message(int magic, const char *fname, int is_old, HEADER *h);
HEADER *maildir_parse_stream(int magic, FILE *f, const char *fname, int is_old, HEADER *_h);
void maildir_parse_flags(HEADER *h, const char *path);
-bool maildir_update_flags(CONTEXT *ctx, HEADER *o, HEADER *n);
+bool maildir_update_flags(struct Context *ctx, HEADER *o, HEADER *n);
void maildir_flags(char *dest, size_t destlen, HEADER *hdr);
#ifdef USE_HCACHE
#include "hcache/hcache.h"
-int mh_sync_mailbox_message(CONTEXT *ctx, int msgno, header_cache_t *hc);
+int mh_sync_mailbox_message(struct Context *ctx, int msgno, header_cache_t *hc);
#else
-int mh_sync_mailbox_message(CONTEXT *ctx, int msgno);
+int mh_sync_mailbox_message(struct Context *ctx, int msgno);
#endif
#ifdef USE_NOTMUCH
int mbox_strict_cmp_headers(const HEADER *h1, const HEADER *h2);
-void mx_alloc_memory(CONTEXT *ctx);
-void mx_update_context(CONTEXT *ctx, int new_messages);
-void mx_update_tables(CONTEXT *ctx, int committing);
+void mx_alloc_memory(struct Context *ctx);
+void mx_update_context(struct Context *ctx, int new_messages);
+void mx_update_tables(struct Context *ctx, int committing);
int mx_lock_file(const char *path, int fd, int excl, int dot, int timeout);
}
/* Generate array of .newsrc entries */
-void nntp_newsrc_gen_entries(CONTEXT *ctx)
+void nntp_newsrc_gen_entries(struct Context *ctx)
{
NNTP_DATA *nntp_data = ctx->data;
anum_t last = 0, first = 1;
* Read = a read message number is in the .newsrc
* New = not read and not cached
* Old = not read but cached */
-void nntp_article_status(CONTEXT *ctx, HEADER *hdr, char *group, anum_t anum)
+void nntp_article_status(struct Context *ctx, HEADER *hdr, char *group, anum_t anum)
{
NNTP_DATA *nntp_data = ctx->data;
unsigned int i;
}
/* Update read flag and set article number if empty */
-static void nntp_parse_xref(CONTEXT *ctx, HEADER *hdr)
+static void nntp_parse_xref(struct Context *ctx, HEADER *hdr)
{
NNTP_DATA *nntp_data = ctx->data;
char *buf = NULL, *p = NULL;
typedef struct
{
- CONTEXT *ctx;
+ struct Context *ctx;
anum_t first;
anum_t last;
int restore;
static int parse_overview_line(char *line, void *data)
{
FETCH_CTX *fc = data;
- CONTEXT *ctx = fc->ctx;
+ struct Context *ctx = fc->ctx;
NNTP_DATA *nntp_data = ctx->data;
HEADER *hdr = NULL;
FILE *fp = NULL;
}
/* Fetch headers */
-static int nntp_fetch_headers(CONTEXT *ctx, void *hc, anum_t first, anum_t last, int restore)
+static int nntp_fetch_headers(struct Context *ctx, void *hc, anum_t first, anum_t last, int restore)
{
NNTP_DATA *nntp_data = ctx->data;
FETCH_CTX fc;
}
/* Open newsgroup */
-static int nntp_open_mailbox(CONTEXT *ctx)
+static int nntp_open_mailbox(struct Context *ctx)
{
NNTP_SERVER *nserv = NULL;
NNTP_DATA *nntp_data = NULL;
}
/* Fetch message */
-static int nntp_fetch_message(CONTEXT *ctx, MESSAGE *msg, int msgno)
+static int nntp_fetch_message(struct Context *ctx, MESSAGE *msg, int msgno)
{
NNTP_DATA *nntp_data = ctx->data;
NNTP_ACACHE *acache = NULL;
}
/* Close message */
-static int nntp_close_message(CONTEXT *ctx, MESSAGE *msg)
+static int nntp_close_message(struct Context *ctx, MESSAGE *msg)
{
return safe_fclose(&msg->fp);
}
* MUTT_NEW_MAIL - new articles found
* 0 - no change
* -1 - lost connection */
-static int nntp_check_mailbox(CONTEXT *ctx, int *index_hint)
+static int nntp_check_mailbox(struct Context *ctx, int *index_hint)
{
NNTP_DATA *nntp_data = ctx->data;
NNTP_SERVER *nserv = nntp_data->nserv;
}
/* Save changes to .newsrc and cache */
-static int nntp_sync_mailbox(CONTEXT *ctx, int *index_hint)
+static int nntp_sync_mailbox(struct Context *ctx, int *index_hint)
{
NNTP_DATA *nntp_data = ctx->data;
int rc, i;
}
/* Free up memory associated with the newsgroup context */
-static int nntp_fastclose_mailbox(CONTEXT *ctx)
+static int nntp_fastclose_mailbox(struct Context *ctx)
{
NNTP_DATA *nntp_data = ctx->data, *nntp_tmp = NULL;
* 0 - success
* 1 - no such article
* -1 - error */
-int nntp_check_msgid(CONTEXT *ctx, const char *msgid)
+int nntp_check_msgid(struct Context *ctx, const char *msgid)
{
NNTP_DATA *nntp_data = ctx->data;
HEADER *hdr = NULL;
typedef struct
{
- CONTEXT *ctx;
+ struct Context *ctx;
unsigned int num;
unsigned int max;
anum_t *child;
}
/* Fetch children of article with the Message-ID */
-int nntp_check_children(CONTEXT *ctx, const char *msgid)
+int nntp_check_children(struct Context *ctx, const char *msgid)
{
NNTP_DATA *nntp_data = ctx->data;
CHILD_CTX cc;
int nntp_active_save_cache(NNTP_SERVER *nserv);
int nntp_check_new_groups(NNTP_SERVER *nserv);
int nntp_open_connection(NNTP_SERVER *nserv);
-void nntp_newsrc_gen_entries(CONTEXT *ctx);
+void nntp_newsrc_gen_entries(struct Context *ctx);
void nntp_bcache_update(NNTP_DATA *nntp_data);
-void nntp_article_status(CONTEXT *ctx, HEADER *hdr, char *group, anum_t anum);
+void nntp_article_status(struct Context *ctx, HEADER *hdr, char *group, anum_t anum);
void nntp_group_unread_stat(NNTP_DATA *nntp_data);
void nntp_data_free(void *data);
void nntp_acache_free(NNTP_DATA *nntp_data);
int nntp_active_fetch(NNTP_SERVER *nserv);
int nntp_newsrc_update(NNTP_SERVER *nserv);
int nntp_post(const char *msg);
-int nntp_check_msgid(CONTEXT *ctx, const char *msgid);
-int nntp_check_children(CONTEXT *ctx, const char *msgid);
+int nntp_check_msgid(struct Context *ctx, const char *msgid);
+int nntp_check_children(struct Context *ctx, const char *msgid);
int nntp_newsrc_parse(NNTP_SERVER *nserv);
void nntp_newsrc_close(NNTP_SERVER *nserv);
void nntp_buffy(char *buf, size_t len);
typedef struct
{
- CONTEXT *ctx; /* current mailbox */
+ struct Context *ctx; /* current mailbox */
HEADER *hdr; /* current message */
struct Body *bdy; /* current attachment */
FILE *fp; /* source stream */
int mutt_do_pager(const char *banner, const char *tempfile, int do_color, pager_t *info);
int mutt_pager(const char *banner, const char *fname, int flags, pager_t *extra);
-void update_index(MUTTMENU *menu, CONTEXT *ctx, int check, int oldcount, int index_hint);
+void update_index(MUTTMENU *menu, struct Context *ctx, int check, int oldcount, int index_hint);
#endif /* _MUTT_PAGER_H */
return NULL;
}
-void mutt_parse_mime_message(CONTEXT *ctx, HEADER *cur)
+void mutt_parse_mime_message(struct Context *ctx, HEADER *cur)
{
MESSAGE *msg = NULL;
return count < 0 ? 0 : count;
}
-int mutt_count_body_parts(CONTEXT *ctx, HEADER *hdr)
+int mutt_count_body_parts(struct Context *ctx, HEADER *hdr)
{
short keep_parts = 0;
return regexec(pat->p.rx, buf, 0, NULL, 0);
}
-static int msg_search(CONTEXT *ctx, pattern_t *pat, int msgno)
+static int msg_search(struct Context *ctx, pattern_t *pat, int msgno)
{
MESSAGE *msg = NULL;
STATE s;
return curlist;
}
-static bool perform_and(pattern_t *pat, pattern_exec_flag flags, CONTEXT *ctx,
+static bool perform_and(pattern_t *pat, pattern_exec_flag flags, struct Context *ctx,
HEADER *hdr, pattern_cache_t *cache)
{
for (; pat; pat = pat->next)
}
static int perform_or(struct pattern_t *pat, pattern_exec_flag flags,
- CONTEXT *ctx, HEADER *hdr, pattern_cache_t *cache)
+ struct Context *ctx, HEADER *hdr, pattern_cache_t *cache)
{
for (; pat; pat = pat->next)
if (mutt_pattern_exec(pat, flags, ctx, hdr, cache) > 0)
}
static int match_threadcomplete(struct pattern_t *pat, pattern_exec_flag flags,
- CONTEXT *ctx, THREAD *t, int left, int up,
+ struct Context *ctx, THREAD *t, int left, int up,
int right, int down)
{
int a;
* cache: For repeated matches against the same HEADER, passing in non-NULL will
* store some of the cacheable pattern matches in this structure. */
int mutt_pattern_exec(struct pattern_t *pat, pattern_exec_flag flags,
- CONTEXT *ctx, HEADER *h, pattern_cache_t *cache)
+ struct Context *ctx, HEADER *h, pattern_cache_t *cache)
{
int result;
int *cache_entry = NULL;
static int fetch_uidl(char *line, void *data)
{
int i, index;
- CONTEXT *ctx = (CONTEXT *) data;
+ struct Context *ctx = (struct Context *) data;
POP_DATA *pop_data = (POP_DATA *) ctx->data;
char *endp = NULL;
static int msg_cache_check(const char *id, struct BodyCache *bcache, void *data)
{
- CONTEXT *ctx = NULL;
+ struct Context *ctx = NULL;
POP_DATA *pop_data = NULL;
int i;
- if (!(ctx = (CONTEXT *) data))
+ if (!(ctx = (struct Context *) data))
return -1;
if (!(pop_data = (POP_DATA *) ctx->data))
return -1;
* -2 - invalid command or execution error,
* -3 - error writing to tempfile
*/
-static int pop_fetch_headers(CONTEXT *ctx)
+static int pop_fetch_headers(struct Context *ctx)
{
int i, ret, old_count, new_count, deleted;
unsigned short hcached = 0, bcached;
}
/* open POP mailbox - fetch only headers */
-static int pop_open_mailbox(CONTEXT *ctx)
+static int pop_open_mailbox(struct Context *ctx)
{
int ret;
char buf[LONG_STRING];
}
/* close POP mailbox */
-static int pop_close_mailbox(CONTEXT *ctx)
+static int pop_close_mailbox(struct Context *ctx)
{
POP_DATA *pop_data = (POP_DATA *) ctx->data;
}
/* fetch message from POP server */
-static int pop_fetch_message(CONTEXT *ctx, MESSAGE *msg, int msgno)
+static int pop_fetch_message(struct Context *ctx, MESSAGE *msg, int msgno)
{
int ret;
void *uidl = NULL;
return 0;
}
-static int pop_close_message(CONTEXT *ctx, MESSAGE *msg)
+static int pop_close_message(struct Context *ctx, MESSAGE *msg)
{
return safe_fclose(&msg->fp);
}
/* update POP mailbox - delete messages from server */
-static int pop_sync_mailbox(CONTEXT *ctx, int *index_hint)
+static int pop_sync_mailbox(struct Context *ctx, int *index_hint)
{
int i, j, ret = 0;
char buf[LONG_STRING];
}
/* Check for new messages and fetch headers */
-static int pop_check_mailbox(CONTEXT *ctx, int *index_hint)
+static int pop_check_mailbox(struct Context *ctx, int *index_hint)
{
int ret;
POP_DATA *pop_data = (POP_DATA *) ctx->data;
char *url = NULL, *p = NULL;
int i, delanswer, last = 0, msgs, bytes, rset = 0, ret;
struct Connection *conn = NULL;
- CONTEXT ctx;
+ struct Context ctx;
MESSAGE *msg = NULL;
struct Account acct;
POP_DATA *pop_data = NULL;
int pop_query_d(POP_DATA *pop_data, char *buf, size_t buflen, char *msg);
int pop_fetch_data(POP_DATA *pop_data, char *query, progress_t *progressbar,
int (*funct)(char *, void *), void *data);
-int pop_reconnect(CONTEXT *ctx);
-void pop_logout(CONTEXT *ctx);
+int pop_reconnect(struct Context *ctx);
+void pop_logout(struct Context *ctx);
/* pop.c */
void pop_fetch_mail(void);
}
/* logout from POP server */
-void pop_logout(CONTEXT *ctx)
+void pop_logout(struct Context *ctx)
{
int ret = 0;
char buf[LONG_STRING];
{
int i;
unsigned int index;
- CONTEXT *ctx = (CONTEXT *) data;
+ struct Context *ctx = (struct Context *) data;
char *endp = NULL;
errno = 0;
}
/* reconnect and verify indexes if connection was lost */
-int pop_reconnect(CONTEXT *ctx)
+int pop_reconnect(struct Context *ctx)
{
int ret;
POP_DATA *pop_data = (POP_DATA *) ctx->data;
static short PostCount = 0;
-static CONTEXT *PostContext = NULL;
+static struct Context *PostContext = NULL;
static short UpdateNumPostponed = 0;
/* Return the number of postponed messages.
int mutt_num_postponed(int force)
{
struct stat st;
- CONTEXT ctx;
+ struct Context ctx;
static time_t LastModify = 0;
static char *OldPostponed = NULL;
static void post_entry(char *s, size_t slen, MUTTMENU *menu, int entry)
{
- CONTEXT *ctx = (CONTEXT *) menu->data;
+ struct Context *ctx = (struct Context *) menu->data;
_mutt_make_string(s, slen, NONULL(HdrFmt), ctx, ctx->hdrs[entry], MUTT_FORMAT_ARROWCURSOR);
}
* 0 normal exit
* SENDREPLY recalled message is a reply
*/
-int mutt_get_postponed(CONTEXT *ctx, HEADER *hdr, HEADER **cur, char *fcc, size_t fcclen)
+int mutt_get_postponed(struct Context *ctx, HEADER *hdr, HEADER **cur, char *fcc, size_t fcclen)
{
HEADER *h = NULL;
int code = SENDPOSTPONED;
* Resent messages enable header weeding, and also
* discard any existing Message-ID and Mail-Followup-To.
*/
-int mutt_prepare_template(FILE *fp, CONTEXT *ctx, HEADER *newhdr, HEADER *hdr, short resend)
+int mutt_prepare_template(FILE *fp, struct Context *ctx, HEADER *newhdr, HEADER *hdr, short resend)
{
MESSAGE *msg = NULL;
char file[_POSIX_PATH_MAX];
#define MoreArgs(p) (*p->dptr && *p->dptr != ';' && *p->dptr != '#')
#define mutt_make_string(A, B, C, D, E) _mutt_make_string(A, B, C, D, E, 0)
-void _mutt_make_string(char *dest, size_t destlen, const char *s, CONTEXT *ctx,
+void _mutt_make_string(char *dest, size_t destlen, const char *s, struct Context *ctx,
HEADER *hdr, format_flag flags);
struct hdr_format_info
{
- CONTEXT *ctx;
+ struct Context *ctx;
HEADER *hdr;
const char *pager_progress;
};
#define mutt_get_hidden(x, y) _mutt_traverse_thread(x, y, MUTT_THREAD_GET_HIDDEN)
#define mutt_thread_contains_unread(x, y) _mutt_traverse_thread(x, y, MUTT_THREAD_UNREAD)
#define mutt_thread_next_unread(x, y) _mutt_traverse_thread(x, y, MUTT_THREAD_NEXT_UNREAD)
-int _mutt_traverse_thread(CONTEXT *ctx, HEADER *cur, int flag);
+int _mutt_traverse_thread(struct Context *ctx, HEADER *cur, int flag);
typedef const char *format_t(char *, size_t, size_t, int, char, const char *,
const char *, const char *, const char *,
struct Address *mutt_parse_adrlist(struct Address *p, const char *s);
struct Body *mutt_make_file_attach(const char *path);
-struct Body *mutt_make_message_attach(CONTEXT *ctx, HEADER *hdr, int attach_msg);
+struct Body *mutt_make_message_attach(struct Context *ctx, HEADER *hdr, int attach_msg);
struct Body *mutt_remove_multipart(struct Body *b);
struct Body *mutt_make_multipart(struct Body *b);
struct Body *mutt_new_body(void);
struct Content *mutt_get_content_info(const char *fname, struct Body *b);
-HASH *mutt_make_id_hash(CONTEXT *ctx);
+HASH *mutt_make_id_hash(struct Context *ctx);
char *mutt_read_rfc822_line(FILE *f, char *line, size_t *linelen);
ENVELOPE *mutt_read_rfc822_header(FILE *f, HEADER *hdr, short user_hdrs, short weed);
void mutt_buffy(char *s, size_t slen);
int mutt_buffy_list(void);
void mutt_canonical_charset(char *dest, size_t dlen, const char *name);
-int mutt_count_body_parts(CONTEXT *ctx, HEADER *hdr);
-void mutt_check_rescore(CONTEXT *ctx);
+int mutt_count_body_parts(struct Context *ctx, HEADER *hdr);
+void mutt_check_rescore(struct Context *ctx);
void mutt_clear_error(void);
void mutt_clear_pager_position(void);
void mutt_create_alias(ENVELOPE *cur, struct Address *iadr);
void mutt_envlist_set(const char *name, const char *value, bool overwrite);
int mutt_filter_unprintable(char **s);
int mutt_label_message(HEADER *hdr);
-void mutt_make_label_hash(CONTEXT *ctx);
-void mutt_label_hash_add(CONTEXT *ctx, HEADER *hdr);
-void mutt_label_hash_remove(CONTEXT *ctx, HEADER *hdr);
+void mutt_make_label_hash(struct Context *ctx);
+void mutt_label_hash_add(struct Context *ctx, HEADER *hdr);
+void mutt_label_hash_remove(struct Context *ctx, HEADER *hdr);
int mutt_label_complete(char *buffer, size_t len, int numtabs);
void mutt_curses_error(const char *fmt, ...);
void mutt_curses_message(const char *fmt, ...);
void mutt_free_parameter(PARAMETER **p);
void mutt_free_regexp(REGEXP **pp);
void mutt_help(int menu);
-void mutt_draw_tree(CONTEXT *ctx);
+void mutt_draw_tree(struct Context *ctx);
void mutt_check_lookup_list(struct Body *b, char *type, int len);
-void mutt_make_attribution(CONTEXT *ctx, HEADER *cur, FILE *out);
-void mutt_make_forward_subject(ENVELOPE *env, CONTEXT *ctx, HEADER *cur);
+void mutt_make_attribution(struct Context *ctx, HEADER *cur, FILE *out);
+void mutt_make_forward_subject(ENVELOPE *env, struct Context *ctx, HEADER *cur);
void mutt_make_help(char *d, size_t dlen, const char *txt, int menu, int op);
-void mutt_make_misc_reply_headers(ENVELOPE *env, CONTEXT *ctx, HEADER *cur, ENVELOPE *curenv);
-void mutt_make_post_indent(CONTEXT *ctx, HEADER *cur, FILE *out);
+void mutt_make_misc_reply_headers(ENVELOPE *env, struct Context *ctx, HEADER *cur, ENVELOPE *curenv);
+void mutt_make_post_indent(struct Context *ctx, HEADER *cur, FILE *out);
void mutt_merge_envelopes(ENVELOPE *base, ENVELOPE **extra);
void mutt_message_to_7bit(struct Body *a, FILE *fp);
#define mutt_mktemp(a, b) mutt_mktemp_pfx_sfx(a, b, "mutt", NULL)
const char *src, int line);
void mutt_normalize_time(struct tm *tm);
void mutt_paddstr(int n, const char *s);
-void mutt_parse_mime_message(CONTEXT *ctx, HEADER *cur);
+void mutt_parse_mime_message(struct Context *ctx, HEADER *cur);
void mutt_parse_part(FILE *fp, struct Body *b);
void mutt_perror(const char *s);
void mutt_prepare_envelope(ENVELOPE *env, int final);
void mutt_query_menu(char *buf, size_t buflen);
void mutt_safe_path(char *s, size_t l, struct Address *a);
void mutt_save_path(char *d, size_t dsize, struct Address *a);
-void mutt_score_message(CONTEXT *ctx, HEADER *hdr, int upd_ctx);
+void mutt_score_message(struct Context *ctx, HEADER *hdr, int upd_ctx);
void mutt_select_fcc(char *path, size_t pathlen, HEADER *hdr);
#define mutt_select_file(A, B, C) _mutt_select_file(A, B, C, NULL, NULL)
void _mutt_select_file(char *f, size_t flen, int flags, char ***files, int *numfiles);
-void mutt_message_hook(CONTEXT *ctx, HEADER *hdr, int type);
-void _mutt_set_flag(CONTEXT *ctx, HEADER *h, int flag, int bf, int upd_ctx);
+void mutt_message_hook(struct Context *ctx, HEADER *hdr, int type);
+void _mutt_set_flag(struct Context *ctx, HEADER *h, int flag, int bf, int upd_ctx);
#define mutt_set_flag(a, b, c, d) _mutt_set_flag(a, b, c, d, 1)
void mutt_set_followup_to(ENVELOPE *e);
void mutt_shell_escape(void);
void mutt_version(void);
void mutt_view_attachments(HEADER *hdr);
void mutt_write_address_list(struct Address *adr, FILE *fp, int linelen, int display);
-void mutt_set_virtual(CONTEXT *ctx);
+void mutt_set_virtual(struct Context *ctx);
int mutt_add_to_rx_list(RX_LIST **list, const char *s, int flags, struct Buffer *err);
bool mutt_addr_is_user(struct Address *addr);
int mutt_addwch(wchar_t wc);
int mutt_display_message(HEADER *cur);
int mutt_dump_variables(int hide_sensitive);
int mutt_edit_attachment(struct Body *a);
-int mutt_edit_message(CONTEXT *ctx, HEADER *hdr);
+int mutt_edit_message(struct Context *ctx, HEADER *hdr);
int mutt_fetch_recips(ENVELOPE *out, ENVELOPE *in, int flags);
int mutt_chscmp(const char *s, const char *chs);
#define mutt_is_utf8(a) mutt_chscmp(a, "utf-8")
#define mutt_is_us_ascii(a) mutt_chscmp(a, "us-ascii")
-int mutt_parent_message(CONTEXT *ctx, HEADER *hdr, int find_root);
-int mutt_prepare_template(FILE *fp, CONTEXT *ctx, HEADER *newhdr, HEADER *hdr, short resend);
-int mutt_resend_message(FILE *fp, CONTEXT *ctx, HEADER *cur);
+int mutt_parent_message(struct Context *ctx, HEADER *hdr, int find_root);
+int mutt_prepare_template(FILE *fp, struct Context *ctx, HEADER *newhdr, HEADER *hdr, short resend);
+int mutt_resend_message(FILE *fp, struct Context *ctx, HEADER *cur);
int mutt_compose_to_sender(HEADER *hdr);
#define mutt_enter_fname(A, B, C, D) _mutt_enter_fname(A, B, C, D, 0, NULL, NULL, 0)
#define mutt_enter_vfolder(A, B, C, D) _mutt_enter_fname(A, B, C, D, 0, NULL, NULL, MUTT_SEL_VFOLDER)
int mutt_get_field_unbuffered(char *msg, char *buf, size_t buflen, int flags);
#define mutt_get_password(A, B, C) mutt_get_field_unbuffered(A, B, C, MUTT_PASS)
-int mutt_get_postponed(CONTEXT *ctx, HEADER *hdr, HEADER **cur, char *fcc, size_t fcclen);
+int mutt_get_postponed(struct Context *ctx, HEADER *hdr, HEADER **cur, char *fcc, size_t fcclen);
int mutt_get_tmp_attachment(struct Body *a);
int mutt_index_menu(void);
int mutt_invoke_sendmail(struct Address *from, struct Address *to, struct Address *cc, struct Address *bcc,
int mutt_is_list_recipient(int alladdr, struct Address *a1, struct Address *a2);
bool mutt_is_subscribed_list(struct Address *addr);
bool mutt_is_text_part(struct Body *b);
-int mutt_link_threads(HEADER *cur, HEADER *last, CONTEXT *ctx);
+int mutt_link_threads(HEADER *cur, HEADER *last, struct Context *ctx);
int mutt_lookup_mime_type(struct Body *att, const char *path);
bool mutt_match_rx_list(const char *s, RX_LIST *l);
bool mutt_match_spam_list(const char *s, REPLACE_LIST *l, char *text, int textsize);
-int mutt_messages_in_thread(CONTEXT *ctx, HEADER *hdr, int flag);
+int mutt_messages_in_thread(struct Context *ctx, HEADER *hdr, int flag);
int mutt_multi_choice(char *prompt, char *letters);
bool mutt_needs_mailcap(struct Body *m);
int mutt_num_postponed(int force);
int mutt_query_complete(char *buf, size_t buflen);
int mutt_query_variables(LIST *queries);
int mutt_save_attachment(FILE *fp, struct Body *m, char *path, int flags, HEADER *hdr);
-int _mutt_save_message(HEADER *h, CONTEXT *ctx, int delete, int decode, int decrypt);
+int _mutt_save_message(HEADER *h, struct Context *ctx, int delete, int decode, int decrypt);
int mutt_save_message(HEADER *h, int delete, int decode, int decrypt);
int mutt_search_command(int cur, int op);
#ifdef USE_SMTP
int mutt_write_rfc822_header(FILE *fp, ENVELOPE *env, struct Body *attach, int mode, int privacy);
void mutt_write_references(LIST *r, FILE *f, int trim);
int mutt_yesorno(const char *msg, int def);
-void mutt_set_header_color(CONTEXT *ctx, HEADER *curhdr);
+void mutt_set_header_color(struct Context *ctx, HEADER *curhdr);
void mutt_sleep(short s);
int mutt_save_confirm(const char *s, struct stat *st);
}
int mutt_pattern_exec(struct pattern_t *pat, pattern_exec_flag flags,
- CONTEXT *ctx, HEADER *h, pattern_cache_t *cache);
+ struct Context *ctx, HEADER *h, pattern_cache_t *cache);
pattern_t *mutt_pattern_comp(/* const */ char *s, int flags, struct Buffer *err);
void mutt_check_simple(char *s, size_t len, const char *simple);
void mutt_pattern_free(pattern_t **pat);
/* unsorted */
void ci_bounce_message(HEADER *h);
-int ci_send_message(int flags, HEADER *msg, char *tempfile, CONTEXT *ctx, HEADER *cur);
+int ci_send_message(int flags, HEADER *msg, char *tempfile, struct Context *ctx, HEADER *cur);
/* prototypes for compatibility functions */
static SCORE *Score = NULL;
-void mutt_check_rescore(CONTEXT *ctx)
+void mutt_check_rescore(struct Context *ctx)
{
int i;
return 0;
}
-void mutt_score_message(CONTEXT *ctx, HEADER *hdr, int upd_ctx)
+void mutt_score_message(struct Context *ctx, HEADER *hdr, int upd_ctx)
{
SCORE *tmp = NULL;
pattern_cache_t cache;
}
-static int include_forward(CONTEXT *ctx, HEADER *cur, FILE *out)
+static int include_forward(struct Context *ctx, HEADER *cur, FILE *out)
{
int chflags = CH_DECODE, cmflags = 0;
return 0;
}
-void mutt_make_attribution(CONTEXT *ctx, HEADER *cur, FILE *out)
+void mutt_make_attribution(struct Context *ctx, HEADER *cur, FILE *out)
{
char buffer[LONG_STRING];
if (Attribution)
}
}
-void mutt_make_post_indent(CONTEXT *ctx, HEADER *cur, FILE *out)
+void mutt_make_post_indent(struct Context *ctx, HEADER *cur, FILE *out)
{
char buffer[STRING];
if (PostIndentString)
}
}
-static int include_reply(CONTEXT *ctx, HEADER *cur, FILE *out)
+static int include_reply(struct Context *ctx, HEADER *cur, FILE *out)
{
int cmflags = MUTT_CM_PREFIX | MUTT_CM_DECODE | MUTT_CM_CHARCONV | MUTT_CM_REPLYING;
int chflags = CH_DECODE;
}
}
-void mutt_make_forward_subject(ENVELOPE *env, CONTEXT *ctx, HEADER *cur)
+void mutt_make_forward_subject(ENVELOPE *env, struct Context *ctx, HEADER *cur)
{
if (!env)
return;
mutt_str_replace(&env->subject, buffer);
}
-void mutt_make_misc_reply_headers(ENVELOPE *env, CONTEXT *ctx, HEADER *cur, ENVELOPE *curenv)
+void mutt_make_misc_reply_headers(ENVELOPE *env, struct Context *ctx, HEADER *cur, ENVELOPE *curenv)
{
if (!env || !curenv)
return;
#endif
}
-static void make_reference_headers(ENVELOPE *curenv, ENVELOPE *env, CONTEXT *ctx)
+static void make_reference_headers(ENVELOPE *curenv, ENVELOPE *env, struct Context *ctx)
{
if (!env || !ctx)
return;
mutt_free_list(&env->references);
}
-static int envelope_defaults(ENVELOPE *env, CONTEXT *ctx, HEADER *cur, int flags)
+static int envelope_defaults(ENVELOPE *env, struct Context *ctx, HEADER *cur, int flags)
{
ENVELOPE *curenv = NULL;
int i = 0, tag = 0;
static int generate_body(FILE *tempfp, /* stream for outgoing message */
HEADER *msg, /* header for outgoing message */
int flags, /* compose mode */
- CONTEXT *ctx, /* current mailbox */
+ struct Context *ctx, /* current mailbox */
HEADER *cur) /* current message */
{
int i;
return ci_send_message(0, msg, NULL, NULL, NULL);
}
-int mutt_resend_message(FILE *fp, CONTEXT *ctx, HEADER *cur)
+int mutt_resend_message(FILE *fp, struct Context *ctx, HEADER *cur)
{
HEADER *msg = mutt_new_header();
int ci_send_message(int flags, /* send mode */
HEADER *msg, /* template to use for new message */
char *tempfile, /* file specified by -i or -H */
- CONTEXT *ctx, /* current mailbox */
+ struct Context *ctx, /* current mailbox */
HEADER *cur) /* current message */
{
char buffer[LONG_STRING];
a->content = info;
}
-struct Body *mutt_make_message_attach(CONTEXT *ctx, HEADER *hdr, int attach_msg)
+struct Body *mutt_make_message_attach(struct Context *ctx, HEADER *hdr, int attach_msg)
{
char buffer[LONG_STRING];
struct Body *body = NULL;
int mutt_write_fcc(const char *path, HEADER *hdr, const char *msgid, int post,
char *fcc, char **finalpath)
{
- CONTEXT f;
+ struct Context f;
MESSAGE *msg = NULL;
char tempfile[_POSIX_PATH_MAX];
FILE *tempfp = NULL;
}
/**
- * mutt_sb_set_buffystats - Update the Buffy's message counts from the CONTEXT
- * @ctx: A mailbox CONTEXT
+ * mutt_sb_set_buffystats - Update the Buffy's message counts from the Context
+ * @ctx: A mailbox Context
*
- * Given a mailbox CONTEXT, find a matching mailbox Buffy and copy the message
+ * Given a mailbox Context, find a matching mailbox Buffy and copy the message
* counts into it.
*/
-void mutt_sb_set_buffystats(const CONTEXT *ctx)
+void mutt_sb_set_buffystats(const struct Context *ctx)
{
/* Even if the sidebar's hidden,
* we should take note of the new data. */
void mutt_sb_draw(void);
const char *mutt_sb_get_highlight(void);
void mutt_sb_notify_mailbox(struct Buffy *b, int created);
-void mutt_sb_set_buffystats(const CONTEXT *ctx);
+void mutt_sb_set_buffystats(const struct Context *ctx);
void mutt_sb_set_open_buffy(void);
void mutt_sb_toggle_virtual(void);
/* not reached */
}
-void mutt_sort_headers(CONTEXT *ctx, int init)
+void mutt_sort_headers(struct Context *ctx, int init)
{
int i;
HEADER *h = NULL;
typedef int sort_t(const void *, const void *);
sort_t *mutt_get_sort_func(int method);
-void mutt_clear_threads(CONTEXT *ctx);
-void mutt_sort_headers(CONTEXT *ctx, int init);
-void mutt_sort_threads(CONTEXT *ctx, int init);
+void mutt_clear_threads(struct Context *ctx);
+void mutt_sort_headers(struct Context *ctx, int init);
+void mutt_sort_threads(struct Context *ctx, int init);
int mutt_select_sort(int reverse);
THREAD *mutt_sort_subthreads(THREAD *thread, int init);
}
/* Determines whether to display a message's subject. */
-static int need_display_subject(CONTEXT *ctx, HEADER *hdr)
+static int need_display_subject(struct Context *ctx, HEADER *hdr)
{
THREAD *tmp = NULL, *tree = hdr->thread;
return 1;
}
-static void linearize_tree(CONTEXT *ctx)
+static void linearize_tree(struct Context *ctx)
{
THREAD *tree = ctx->tree;
HEADER **array = ctx->hdrs + (Sort & SORT_REVERSE ? ctx->msgcount - 1 : 0);
* skip parts of the tree in mutt_draw_tree() if we've decided here that we
* don't care about them any more.
*/
-static void calculate_visibility(CONTEXT *ctx, int *max_depth)
+static void calculate_visibility(struct Context *ctx, int *max_depth)
{
THREAD *tmp = NULL, *tree = ctx->tree;
int hide_top_missing = option(OPTHIDETOPMISSING) && !option(OPTHIDEMISSING);
* graphics chars on terminals which don't support them (see the man page
* for curs_addch).
*/
-void mutt_draw_tree(CONTEXT *ctx)
+void mutt_draw_tree(struct Context *ctx)
{
char *pfx = NULL, *mypfx = NULL, *arrow = NULL, *myarrow = NULL, *new_tree = NULL;
char corner = (Sort & SORT_REVERSE) ? MUTT_TREE_ULCORNER : MUTT_TREE_LLCORNER;
* if there are multiple matches, the one which was sent the latest, but
* before the current message, is used.
*/
-static THREAD *find_subject(CONTEXT *ctx, THREAD *cur)
+static THREAD *find_subject(struct Context *ctx, THREAD *cur)
{
struct hash_elem *ptr = NULL;
THREAD *tmp = NULL, *last = NULL;
*new = cur;
}
-static HASH *make_subj_hash(CONTEXT *ctx)
+static HASH *make_subj_hash(struct Context *ctx)
{
int i;
HEADER *hdr = NULL;
}
/* thread by subject things that didn't get threaded by message-id */
-static void pseudo_threads(CONTEXT *ctx)
+static void pseudo_threads(struct Context *ctx)
{
THREAD *tree = ctx->tree, *top = tree;
THREAD *tmp = NULL, *cur = NULL, *parent = NULL, *curchild = NULL, *nextchild = NULL;
}
-void mutt_clear_threads(CONTEXT *ctx)
+void mutt_clear_threads(struct Context *ctx)
{
int i;
}
}
-static void check_subjects(CONTEXT *ctx, int init)
+static void check_subjects(struct Context *ctx, int init)
{
HEADER *cur = NULL;
THREAD *tmp = NULL;
}
}
-void mutt_sort_threads(CONTEXT *ctx, int init)
+void mutt_sort_threads(struct Context *ctx, int init)
{
HEADER *cur = NULL;
int i, oldsort, using_refs = 0;
return tmp->virtual;
}
-int mutt_parent_message(CONTEXT *ctx, HEADER *hdr, int find_root)
+int mutt_parent_message(struct Context *ctx, HEADER *hdr, int find_root)
{
THREAD *thread = NULL;
HEADER *parent = NULL;
return parent->virtual;
}
-void mutt_set_virtual(CONTEXT *ctx)
+void mutt_set_virtual(struct Context *ctx)
{
int i;
HEADER *cur = NULL;
}
}
-int _mutt_traverse_thread(CONTEXT *ctx, HEADER *cur, int flag)
+int _mutt_traverse_thread(struct Context *ctx, HEADER *cur, int flag)
{
THREAD *thread = NULL, *top = NULL;
HEADER *roothdr = NULL;
/* if flag is 0, we want to know how many messages
* are in the thread. if flag is 1, we want to know
* our position in the thread. */
-int mutt_messages_in_thread(CONTEXT *ctx, HEADER *hdr, int flag)
+int mutt_messages_in_thread(struct Context *ctx, HEADER *hdr, int flag)
{
THREAD *threads[2];
int i, rc;
}
-HASH *mutt_make_id_hash(CONTEXT *ctx)
+HASH *mutt_make_id_hash(struct Context *ctx)
{
int i;
HEADER *hdr = NULL;
clean_references(hdr->thread, hdr->thread->child);
}
-static bool link_threads(HEADER *parent, HEADER *child, CONTEXT *ctx)
+static bool link_threads(HEADER *parent, HEADER *child, struct Context *ctx)
{
if (child == parent)
return false;
return true;
}
-int mutt_link_threads(HEADER *cur, HEADER *last, CONTEXT *ctx)
+int mutt_link_threads(HEADER *cur, HEADER *last, struct Context *ctx)
{
int i;
bool changed = false;