handler.c hash.c hcache.c hdrline.c headers.c help.c history.c hook.c \
init.c \
keymap.c \
- lib.c \
+ lib.c list.c \
main.c mbox.c mbyte.c md5c.c menu.c mh.c muttlib.c mutt_idna.c mx.c \
pager.c parse.c pattern.c postpone.c \
query.c \
alias.h \
buffer.h browser.h \
enter.h \
+ list.h \
mbyte.h remailer.h url.h state.h \
pgppacket.c mutt_idna.h mutt_libesmtp.c \
crypt-mod-pgp-classic.c crypt-mod-smime-classic.c \
EXTRA_DIST = COPYRIGHT GPL OPS OPS.PGP OPS.CRYPT OPS.SMIME TODO \
configure acconfig.h \
- account.h alias.h attach.h \
+ account.h alias.h attach.h recvattach.h handler.h thread.h \
buffer.h buffy.h \
charset.h compress.h copy.h crypthash.h \
dotlock.h functions.h gen_defs \
- enter.h \
+ enter.h recvattach.h handler.h thread.h \
+ list.h \
globals.h hash.h history.h init.h keymap.h mutt_crypt.h \
mapping.h md5.h mime.h mutt.h mutt_curses.h mutt_menu.h \
mutt_sasl.h mutt_socket.h mutt_ssl.h mutt_tunnel.h \
#endif
#include "mutt.h"
+#include "enter.h"
+#include "ascii.h"
#include "account.h"
#include "url.h"
#include "lib/debug.h"
#include "mutt.h"
+#include "enter.h"
+#include "ascii.h"
#include "mutt_curses.h"
#include "mutt_idna.h"
#include "mutt_menu.h"
#endif
#include "mutt.h"
+#include "ascii.h"
+#include "handler.h"
+#include "recvattach.h"
#include "mutt_menu.h"
#include "mutt_curses.h"
#include "keymap.h"
#ifndef _MUTT_ATTACH_H
#define _MUTT_ATTACH_H
-#include "mutt_menu.h"
-
typedef struct attachptr {
BODY *content;
int parent_type;
unsigned int unowned:1; /* don't unlink on detach */
} ATTACHPTR;
-int mutt_tag_attach (MUTTMENU * menu, int n, int m);
-int mutt_attach_display_loop (MUTTMENU * menu, int op, FILE * fp,
- HEADER * hdr, BODY * cur, ATTACHPTR *** idxp,
- short *idxlen, short *idxmax, int recv);
-
-
-void mutt_save_attachment_list (FILE * fp, int tag, BODY * top, HEADER * hdr,
- MUTTMENU * menu);
-void mutt_pipe_attachment_list (FILE * fp, int tag, BODY * top, int filter);
-void mutt_print_attachment_list (FILE * fp, int tag, BODY * top);
-
void mutt_attach_bounce (FILE *, HEADER *, ATTACHPTR **, short, BODY *);
void mutt_attach_resend (FILE *, HEADER *, ATTACHPTR **, short, BODY *);
void mutt_attach_forward (FILE *, HEADER *, ATTACHPTR **, short, BODY *, int);
void mutt_attach_reply (FILE *, HEADER *, ATTACHPTR **, short, BODY *, int);
-ATTACHPTR **mutt_gen_attach_list (BODY *, int, ATTACHPTR **, short *, short *,
- int, int);
-
-void mutt_update_tree (ATTACHPTR **, short);
-
int mutt_print_attachment (FILE *, BODY *);
int mutt_decode_save_attachment (FILE *, BODY *, char *, int, int);
int mutt_save_attachment (FILE *, BODY *, char *, int, HEADER *);
#endif
#include "mutt.h"
+#include "enter.h"
#include "mx.h"
#include "mutt_curses.h"
#include "mutt_menu.h"
#include <stdlib.h>
#include <string.h>
+#include <ctype.h>
#include "buffer.h"
#include "lib/mem.h"
#include "lib/str.h"
+#include "lib/debug.h"
/*
* Creates and initializes a BUFFER*. If passed an existing BUFFER*,
buf->dptr += len;
*(buf->dptr) = '\0';
}
+
+int mutt_extract_token (BUFFER * dest, BUFFER * tok, int flags)
+{
+ char ch;
+ char qc = 0; /* quote char */
+ char *pc;
+
+ /* reset the destination pointer to the beginning of the buffer */
+ dest->dptr = dest->data;
+
+ SKIPWS (tok->dptr);
+ while ((ch = *tok->dptr)) {
+ if (!qc) {
+ if ((ISSPACE (ch) && !(flags & M_TOKEN_SPACE)) ||
+ (ch == '#' && !(flags & M_TOKEN_COMMENT)) ||
+ (ch == '=' && (flags & M_TOKEN_EQUAL)) ||
+ (ch == ';' && !(flags & M_TOKEN_SEMICOLON)) ||
+ ((flags & M_TOKEN_PATTERN) && strchr ("~!|", ch)))
+ break;
+ }
+
+ tok->dptr++;
+
+ if (ch == qc)
+ qc = 0; /* end of quote */
+ else if (!qc && (ch == '\'' || ch == '"') && !(flags & M_TOKEN_QUOTE))
+ qc = ch;
+ else if (ch == '\\' && qc != '\'') {
+ if (!*tok->dptr)
+ return -1; /* premature end of token */
+ switch (ch = *tok->dptr++) {
+ case 'c':
+ case 'C':
+ if (!*tok->dptr)
+ return -1; /* premature end of token */
+ mutt_buffer_addch (dest, (toupper ((unsigned char) *tok->dptr)
+ - '@') & 0x7f);
+ tok->dptr++;
+ break;
+ case 'r':
+ mutt_buffer_addch (dest, '\r');
+ break;
+ case 'n':
+ mutt_buffer_addch (dest, '\n');
+ break;
+ case 't':
+ mutt_buffer_addch (dest, '\t');
+ break;
+ case 'f':
+ mutt_buffer_addch (dest, '\f');
+ break;
+ case 'e':
+ mutt_buffer_addch (dest, '\033');
+ break;
+ default:
+ if (isdigit ((unsigned char) ch) &&
+ isdigit ((unsigned char) *tok->dptr) &&
+ isdigit ((unsigned char) *(tok->dptr + 1))) {
+
+ mutt_buffer_addch (dest,
+ (ch << 6) + (*tok->dptr << 3) + *(tok->dptr +
+ 1) - 3504);
+ tok->dptr += 2;
+ }
+ else
+ mutt_buffer_addch (dest, ch);
+ }
+ }
+ else if (ch == '^' && (flags & M_TOKEN_CONDENSE)) {
+ if (!*tok->dptr)
+ return -1; /* premature end of token */
+ ch = *tok->dptr++;
+ if (ch == '^')
+ mutt_buffer_addch (dest, ch);
+ else if (ch == '[')
+ mutt_buffer_addch (dest, '\033');
+ else if (isalpha ((unsigned char) ch))
+ mutt_buffer_addch (dest, toupper ((unsigned char) ch) - '@');
+ else {
+ mutt_buffer_addch (dest, '^');
+ mutt_buffer_addch (dest, ch);
+ }
+ }
+ else if (ch == '`' && (!qc || qc == '"')) {
+ FILE *fp;
+ pid_t pid;
+ char *cmd, *ptr;
+ size_t expnlen;
+ BUFFER expn;
+ int line = 0;
+
+ pc = tok->dptr;
+ do {
+ if ((pc = strpbrk (pc, "\\`"))) {
+ /* skip any quoted chars */
+ if (*pc == '\\')
+ pc += 2;
+ }
+ } while (pc && *pc != '`');
+ if (!pc) {
+ debug_print (1, ("mismatched backtics\n"));
+ return (-1);
+ }
+ cmd = str_substrdup (tok->dptr, pc);
+ if ((pid = mutt_create_filter (cmd, NULL, &fp, NULL)) < 0) {
+ debug_print (1, ("unable to fork command: %s\n", cmd));
+ mem_free (&cmd);
+ return (-1);
+ }
+ mem_free (&cmd);
+
+ tok->dptr = pc + 1;
+
+ /* read line */
+ memset (&expn, 0, sizeof (expn));
+ expn.data = mutt_read_line (NULL, &expn.dsize, fp, &line);
+ fclose (fp);
+ mutt_wait_filter (pid);
+
+ /* if we got output, make a new string consiting of the shell ouptput
+ plus whatever else was left on the original line */
+ /* BUT: If this is inside a quoted string, directly add output to
+ * the token */
+ if (expn.data && qc) {
+ mutt_buffer_addstr (dest, expn.data);
+ mem_free (&expn.data);
+ }
+ else if (expn.data) {
+ expnlen = str_len (expn.data);
+ tok->dsize = expnlen + str_len (tok->dptr) + 1;
+ ptr = mem_malloc (tok->dsize);
+ memcpy (ptr, expn.data, expnlen);
+ strcpy (ptr + expnlen, tok->dptr); /* __STRCPY_CHECKED__ */
+ if (tok->destroy)
+ mem_free (&tok->data);
+ tok->data = ptr;
+ tok->dptr = ptr;
+ tok->destroy = 1; /* mark that the caller should destroy this data */
+ ptr = NULL;
+ mem_free (&expn.data);
+ }
+ }
+ else if (ch == '$' && (!qc || qc == '"')
+ && (*tok->dptr == '{' || isalpha ((unsigned char) *tok->dptr))) {
+ char *env = NULL, *var = NULL;
+
+ if (*tok->dptr == '{') {
+ tok->dptr++;
+ if ((pc = strchr (tok->dptr, '}'))) {
+ var = str_substrdup (tok->dptr, pc);
+ tok->dptr = pc + 1;
+ }
+ }
+ else {
+ for (pc = tok->dptr; isalnum ((unsigned char) *pc) || *pc == '_';
+ pc++);
+ var = str_substrdup (tok->dptr, pc);
+ tok->dptr = pc;
+ }
+ if (var && (env = getenv (var)))
+ mutt_buffer_addstr (dest, env);
+ mem_free (&var);
+ }
+ else
+ mutt_buffer_addch (dest, ch);
+ }
+ mutt_buffer_addch (dest, 0); /* terminate the string */
+ SKIPWS (tok->dptr);
+ return 0;
+}
+
#include "mutt.h"
#include "buffy.h"
+#include "buffer.h"
#include "mx.h"
#include "mh.h"
#include "sidebar.h"
#include "mutt.h"
#include "charset.h"
+#include "ascii.h"
#include "lib/mem.h"
#include "lib/intl.h"
#endif
#include "mutt.h"
+#include "buffer.h"
+#include "ascii.h"
#include "mutt_curses.h"
#include "mapping.h"
#endif
#include "mutt.h"
+#include "enter.h"
+#include "recvattach.h"
+#include "ascii.h"
#include "mutt_curses.h"
#include "mutt_menu.h"
#include "mime.h"
#endif
#include "mutt.h"
+#include "enter.h"
#include "mutt_curses.h"
#include "mutt_idna.h"
#include "mutt_menu.h"
#include "rfc1524.h"
#include "mime.h"
#include "attach.h"
+#include "recvattach.h"
#include "mapping.h"
#include "sort.h"
#include "charset.h"
#endif
#include "mutt.h"
+#include "ascii.h"
+#include "handler.h"
#include "mx.h"
#include "copy.h"
#include "rfc2047.h"
#endif
#include "mutt.h"
+#include "ascii.h"
+#include "handler.h"
#include "mutt_curses.h"
#include "mime.h"
#include "copy.h"
#endif
#include "mutt.h"
+#include "enter.h"
#include "mutt_menu.h"
#include "mutt_curses.h"
#include "pager.h"
#include "mutt_menu.h"
#include "mapping.h"
#include "sort.h"
+#include "recvattach.h"
#include "buffy.h"
#include "mx.h"
#include "sidebar.h"
+#include "thread.h"
#include "xterm.h"
#ifdef USE_POP
#endif
#include "mutt.h"
+#include "ascii.h"
+#include "enter.h"
#include "mutt_curses.h"
#include "mutt_idna.h"
#endif
#include "mutt.h"
+#include "enter.h"
#include "mutt_menu.h"
#include "mutt_curses.h"
#include "keymap.h"
#ifndef _GLOBALS_H
#define _GLOBALS_H
+#include "alias.h"
+
#include "lib/str.h"
#include "lib/list.h"
#include "lib/rx.h"
#include <sys/stat.h>
#include "mutt.h"
+#include "ascii.h"
+#include "recvattach.h"
+#include "handler.h"
#include "mutt_curses.h"
#include "rfc1524.h"
#include "keymap.h"
--- /dev/null
+/*
+ * Copyright notice from original mutt:
+ * Copyright (C) 1996-2000 Michael R. Elkins <me@mutt.org>
+ *
+ * This file is part of mutt-ng, see http://www.muttng.org/.
+ * It's licensed under the GNU General Public License,
+ * please see the file GPL in the top level source directory.
+ */
+#ifndef _MUTT_HANDLER_H
+#define _MUTT_HANDLER_H
+
+#include "state.h"
+
+void mutt_body_handler (BODY *, STATE *);
+void mutt_decode_attachment (BODY *, STATE *);
+void mutt_decode_base64 (STATE * s, long len, int istext, iconv_t cd);
+
+#endif /* !_MUTT_HANDLER_H */
#include "mutt.h"
#include "mutt_curses.h"
#include "sort.h"
+#include "thread.h"
#include "charset.h"
#include "mutt_crypt.h"
#include "mutt_idna.h"
#endif
#include "mutt.h"
+#include "ascii.h"
#include "mutt_crypt.h"
#include "mutt_idna.h"
#endif
#include "mutt.h"
+#include "buffer.h"
#include "mx.h"
#include "mutt_crypt.h"
#include "lib/debug.h"
#include "mutt.h"
+#include "ascii.h"
#include "imap_private.h"
#include "auth.h"
#endif
#include "mutt.h"
+#include "ascii.h"
#include "mutt_sasl.h"
#include "imap_private.h"
#include "auth.h"
#include "lib/debug.h"
#include "mutt.h"
+#include "ascii.h"
+#include "enter.h"
#include "imap_private.h"
/* -- forward declarations -- */
# include "config.h"
#endif
-#include "mutt.h"
-#include "imap_private.h"
-#include "message.h"
-#include "mx.h"
-
#include "lib/mem.h"
#include "lib/intl.h"
#include "lib/debug.h"
+#include "mutt.h"
+#include "message.h"
+#include "mx.h"
+#include "ascii.h"
+#include "imap_private.h"
+
#include <ctype.h>
#include <stdlib.h>
#endif
#include "mutt.h"
+#include "ascii.h"
+#include "buffer.h"
#include "mutt_curses.h"
#include "mx.h"
#include "globals.h"
#include <ctype.h>
#include "mutt.h"
+#include "ascii.h"
+#include "buffer.h"
#include "mutt_curses.h"
#include "imap_private.h"
#include "message.h"
#include "mutt.h"
#include "mx.h" /* for M_IMAP */
+#include "ascii.h"
#include "url.h"
#include "imap_private.h"
#include "mutt_ssl.h"
#endif
#include "mutt.h"
+#include "buffer.h"
+#include "ascii.h"
#include "mapping.h"
#include "mutt_curses.h"
#include "history.h"
return (-1);
}
-int mutt_extract_token (BUFFER * dest, BUFFER * tok, int flags)
-{
- char ch;
- char qc = 0; /* quote char */
- char *pc;
-
- /* reset the destination pointer to the beginning of the buffer */
- dest->dptr = dest->data;
-
- SKIPWS (tok->dptr);
- while ((ch = *tok->dptr)) {
- if (!qc) {
- if ((ISSPACE (ch) && !(flags & M_TOKEN_SPACE)) ||
- (ch == '#' && !(flags & M_TOKEN_COMMENT)) ||
- (ch == '=' && (flags & M_TOKEN_EQUAL)) ||
- (ch == ';' && !(flags & M_TOKEN_SEMICOLON)) ||
- ((flags & M_TOKEN_PATTERN) && strchr ("~!|", ch)))
- break;
- }
-
- tok->dptr++;
-
- if (ch == qc)
- qc = 0; /* end of quote */
- else if (!qc && (ch == '\'' || ch == '"') && !(flags & M_TOKEN_QUOTE))
- qc = ch;
- else if (ch == '\\' && qc != '\'') {
- if (!*tok->dptr)
- return -1; /* premature end of token */
- switch (ch = *tok->dptr++) {
- case 'c':
- case 'C':
- if (!*tok->dptr)
- return -1; /* premature end of token */
- mutt_buffer_addch (dest, (toupper ((unsigned char) *tok->dptr)
- - '@') & 0x7f);
- tok->dptr++;
- break;
- case 'r':
- mutt_buffer_addch (dest, '\r');
- break;
- case 'n':
- mutt_buffer_addch (dest, '\n');
- break;
- case 't':
- mutt_buffer_addch (dest, '\t');
- break;
- case 'f':
- mutt_buffer_addch (dest, '\f');
- break;
- case 'e':
- mutt_buffer_addch (dest, '\033');
- break;
- default:
- if (isdigit ((unsigned char) ch) &&
- isdigit ((unsigned char) *tok->dptr) &&
- isdigit ((unsigned char) *(tok->dptr + 1))) {
-
- mutt_buffer_addch (dest,
- (ch << 6) + (*tok->dptr << 3) + *(tok->dptr +
- 1) - 3504);
- tok->dptr += 2;
- }
- else
- mutt_buffer_addch (dest, ch);
- }
- }
- else if (ch == '^' && (flags & M_TOKEN_CONDENSE)) {
- if (!*tok->dptr)
- return -1; /* premature end of token */
- ch = *tok->dptr++;
- if (ch == '^')
- mutt_buffer_addch (dest, ch);
- else if (ch == '[')
- mutt_buffer_addch (dest, '\033');
- else if (isalpha ((unsigned char) ch))
- mutt_buffer_addch (dest, toupper ((unsigned char) ch) - '@');
- else {
- mutt_buffer_addch (dest, '^');
- mutt_buffer_addch (dest, ch);
- }
- }
- else if (ch == '`' && (!qc || qc == '"')) {
- FILE *fp;
- pid_t pid;
- char *cmd, *ptr;
- size_t expnlen;
- BUFFER expn;
- int line = 0;
-
- pc = tok->dptr;
- do {
- if ((pc = strpbrk (pc, "\\`"))) {
- /* skip any quoted chars */
- if (*pc == '\\')
- pc += 2;
- }
- } while (pc && *pc != '`');
- if (!pc) {
- debug_print (1, ("mismatched backtics\n"));
- return (-1);
- }
- cmd = str_substrdup (tok->dptr, pc);
- if ((pid = mutt_create_filter (cmd, NULL, &fp, NULL)) < 0) {
- debug_print (1, ("unable to fork command: %s\n", cmd));
- mem_free (&cmd);
- return (-1);
- }
- mem_free (&cmd);
-
- tok->dptr = pc + 1;
-
- /* read line */
- memset (&expn, 0, sizeof (expn));
- expn.data = mutt_read_line (NULL, &expn.dsize, fp, &line);
- fclose (fp);
- mutt_wait_filter (pid);
-
- /* if we got output, make a new string consiting of the shell ouptput
- plus whatever else was left on the original line */
- /* BUT: If this is inside a quoted string, directly add output to
- * the token */
- if (expn.data && qc) {
- mutt_buffer_addstr (dest, expn.data);
- mem_free (&expn.data);
- }
- else if (expn.data) {
- expnlen = str_len (expn.data);
- tok->dsize = expnlen + str_len (tok->dptr) + 1;
- ptr = mem_malloc (tok->dsize);
- memcpy (ptr, expn.data, expnlen);
- strcpy (ptr + expnlen, tok->dptr); /* __STRCPY_CHECKED__ */
- if (tok->destroy)
- mem_free (&tok->data);
- tok->data = ptr;
- tok->dptr = ptr;
- tok->destroy = 1; /* mark that the caller should destroy this data */
- ptr = NULL;
- mem_free (&expn.data);
- }
- }
- else if (ch == '$' && (!qc || qc == '"')
- && (*tok->dptr == '{' || isalpha ((unsigned char) *tok->dptr))) {
- char *env = NULL, *var = NULL;
-
- if (*tok->dptr == '{') {
- tok->dptr++;
- if ((pc = strchr (tok->dptr, '}'))) {
- var = str_substrdup (tok->dptr, pc);
- tok->dptr = pc + 1;
- }
- }
- else {
- for (pc = tok->dptr; isalnum ((unsigned char) *pc) || *pc == '_';
- pc++);
- var = str_substrdup (tok->dptr, pc);
- tok->dptr = pc;
- }
- if (var && (env = getenv (var)))
- mutt_buffer_addstr (dest, env);
- mem_free (&var);
- }
- else
- mutt_buffer_addch (dest, ch);
- }
- mutt_buffer_addch (dest, 0); /* terminate the string */
- SKIPWS (tok->dptr);
- return 0;
-}
-
static void add_to_list (LIST ** list, const char *str)
{
LIST *t, *last = NULL;
#endif
#include "mutt.h"
+#include "buffer.h"
+#include "ascii.h"
#include "mutt_menu.h"
#include "mutt_curses.h"
#include "keymap.h"
#include "buffy.h"
#include "mbox.h"
#include "sort.h"
+#include "thread.h"
#include "copy.h"
#ifdef USE_COMPRESSED
#endif
#include "mutt.h"
+#include "enter.h"
#include "mutt_curses.h"
#include "mutt_menu.h"
#include "mbyte.h"
#include "copy.h"
#include "buffy.h"
#include "sort.h"
+#include "thread.h"
#include "hcache.h"
#include "lib/mem.h"
unsigned int counting:1; /* do we just want to cound? */
} CONTEXT;
-#include "ascii.h"
-#include "alias.h"
-#include "buffer.h"
-#include "state.h"
-#include "enter.h"
#include "protos.h"
#include "lib.h"
#include "globals.h"
#define MUTT_CRYPT_H
#include "mutt.h" /* Need this to declare BODY, ADDRESS. STATE etc. */
+#include "state.h"
+
/* FIXME: They should be pointer to anonymous structures for better
information hiding. */
#endif
#include "mutt.h"
+#include "ascii.h"
#include "charset.h"
#include "mutt_idna.h"
#endif
#include "mutt.h"
+#include "ascii.h"
+#include "buffer.h"
+#include "enter.h"
#include "mutt_curses.h"
#include "mime.h"
#include "mx.h"
#endif
#include "mutt.h"
+#include "ascii.h"
#include "mx.h"
#include "mbox.h"
#include "mh.h"
#include "rfc2047.h"
#include "sort.h"
+#include "thread.h"
#include "copy.h"
#include "keymap.h"
#include "url.h"
#endif
#include "mutt.h"
+#include "enter.h"
#include "mutt_curses.h"
#include "keymap.h"
#include "mutt_menu.h"
#include "sort.h"
#include "pager.h"
#include "attach.h"
+#include "recvattach.h"
#include "mbyte.h"
#include "sidebar.h"
#include "buffy.h"
#endif
#include "mutt.h"
+#include "buffer.h"
+#include "enter.h"
+#include "ascii.h"
+#include "recvattach.h"
#include "mx.h"
#include "mime.h"
#include "rfc2047.h"
#endif
#include "mutt.h"
+#include "buffer.h"
+#include "handler.h"
+#include "enter.h"
+#include "ascii.h"
#include "mx.h"
#include "mapping.h"
#include "keymap.h"
#endif
#include "mutt.h"
+#include "enter.h"
+#include "ascii.h"
+#include "handler.h"
#include "mutt_curses.h"
#include "pgp.h"
#include "mime.h"
#endif
#include "mutt.h"
+#include "enter.h"
+#include "ascii.h"
+#include "recvattach.h"
#include "mutt_curses.h"
#include "mutt_menu.h"
#include "mime.h"
#endif
#include "mutt.h"
+#include "handler.h"
#include "pgp.h"
#include "pgppacket.h"
#include "mime.h"
#endif
#include "mutt.h"
+#include "ascii.h"
#include "mx.h"
#include "md5.h"
#include "pop.h"
#endif
#include "mutt.h"
+#include "ascii.h"
#include "mx.h"
#include "url.h"
#include "pop.h"
#endif
#include "mutt.h"
+#include "ascii.h"
+#include "enter.h"
+#include "handler.h"
#include "mutt_menu.h"
#include "rfc1524.h"
#include "mime.h"
#include "mapping.h"
#include "sort.h"
+#include "thread.h"
#include "mx.h"
#ifdef USE_IMAP
#include "imap.h"
#define mutt_system(x) _mutt_system(x,0)
int _mutt_system (const char *, int);
-#define mutt_next_thread(x) _mutt_aside_thread(x,1,0)
-#define mutt_previous_thread(x) _mutt_aside_thread(x,0,0)
-#define mutt_next_subthread(x) _mutt_aside_thread(x,1,1)
-#define mutt_previous_subthread(x) _mutt_aside_thread(x,0,1)
-int _mutt_aside_thread (HEADER *, short, short);
-
-#define mutt_collapse_thread(x,y) _mutt_traverse_thread (x,y,M_THREAD_COLLAPSE)
-#define mutt_uncollapse_thread(x,y) _mutt_traverse_thread (x,y,M_THREAD_UNCOLLAPSE)
-#define mutt_get_hidden(x,y)_mutt_traverse_thread (x,y,M_THREAD_GET_HIDDEN)
-#define mutt_thread_contains_unread(x,y) _mutt_traverse_thread (x,y,M_THREAD_UNREAD)
-#define mutt_thread_next_unread(x,y) _mutt_traverse_thread(x,y,M_THREAD_NEXT_UNREAD)
-int _mutt_traverse_thread (CONTEXT * ctx, HEADER * hdr, int flag);
-
-
#define mutt_new_parameter() mem_calloc (1, sizeof (PARAMETER))
#define mutt_new_header() mem_calloc (1, sizeof (HEADER))
#define mutt_new_envelope() mem_calloc (1, sizeof (ENVELOPE))
CONTENT *mutt_get_content_info (const char *fname, BODY * b);
-HASH *mutt_make_id_hash (CONTEXT *);
-HASH *mutt_make_subj_hash (CONTEXT *);
-
LIST *mutt_make_references (ENVELOPE * e);
LIST *mutt_parse_references (char *, int);
time_t mutt_parse_date (const char *, HEADER *);
int is_from (const char *, char *, size_t, time_t *);
-const char *mutt_attach_fmt (char *dest,
- size_t destlen,
- char op,
- const char *src,
- const char *prefix,
- const char *ifstring,
- const char *elsestring,
- unsigned long data, format_flag flags);
-
-
char *mutt_charset_hook (const char *);
char *mutt_iconv_hook (const char *);
char *mutt_expand_path (char *, size_t);
LIST *** pp, LIST *** qq);
void mutt_adv_mktemp (char *, size_t);
void mutt_allow_interrupt (int);
-void mutt_attach_init (BODY *);
void mutt_block_signals (void);
void mutt_block_signals_system (void);
-void mutt_body_handler (BODY *, STATE *);
int mutt_bounce_message (FILE * fp, HEADER *, ADDRESS *);
-void mutt_break_thread (HEADER *);
void mutt_canonical_charset (char *, size_t, const char *);
void mutt_check_rescore (CONTEXT *);
void mutt_clear_error (void);
-void mutt_decode_attachment (BODY *, STATE *);
-void mutt_decode_base64 (STATE * s, long len, int istext, iconv_t cd);
void mutt_default_save (char *, size_t, HEADER *);
void mutt_display_address (ENVELOPE *);
void mutt_display_sanitize (char *);
void mutt_unblock_signals_system (int);
void mutt_update_encoding (BODY * a);
void mutt_version (void);
-void mutt_view_attachments (HEADER *);
void mutt_write_references (LIST *, FILE *);
void mutt_write_address_list (ADDRESS * adr, FILE * fp, int linelen,
int display);
-void mutt_set_virtual (CONTEXT *);
int mutt_addwch (wchar_t);
int mutt_alloc_color (int fg, int bg);
#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 *, HEADER *);
int mutt_prepare_template (FILE *, CONTEXT *, HEADER *, HEADER *, short);
int mutt_resend_message (FILE *, CONTEXT *, HEADER *);
int mutt_invoke_mta (ADDRESS *, ADDRESS *, ADDRESS *, ADDRESS *, const char *,
int);
int mutt_is_mail_list (ADDRESS *);
-int mutt_is_message_type (int, const char *);
int mutt_is_list_cc (int, ADDRESS *, ADDRESS *);
int mutt_is_list_recipient (int, ADDRESS *, ADDRESS *);
int mutt_is_subscribed_list (ADDRESS *);
int mutt_is_text_part (BODY *);
int mutt_is_valid_mailbox (const char *);
-int mutt_link_threads (HEADER *, HEADER *, CONTEXT *);
int mutt_lookup_mime_type (BODY *, const char *);
int mutt_match_spam_list (const char *, SPAM_LIST *, char *, int);
-int mutt_messages_in_thread (CONTEXT *, HEADER *, int);
int mutt_multi_choice (char *prompt, char *letters);
int mutt_needs_mailcap (BODY *);
int mutt_num_postponed (int);
#endif
#include "mutt.h"
+#include "ascii.h"
+#include "enter.h"
+#include "handler.h"
+#include "recvattach.h"
#include "mutt_curses.h"
#include "mutt_menu.h"
#include "rfc1524.h"
{NULL}
};
-int mutt_extract_path (char *filename, char *path)
+static int mutt_extract_path (char *filename, char *path)
{
char *tmp = mem_malloc (sizeof (char) * _POSIX_PATH_MAX);
char *help_ptr;
return (src);
}
-void attach_entry (char *b, size_t blen, MUTTMENU * menu, int num)
+static void attach_entry (char *b, size_t blen, MUTTMENU * menu, int num)
{
mutt_FormatString (b, blen, NONULL (AttachFormat), mutt_attach_fmt,
(unsigned long) (((ATTACHPTR **) menu->data)[num]),
print_attachment_list (fp, tag, top, &state);
}
-void
+static void
mutt_update_attach_index (BODY * cur, ATTACHPTR *** idxp,
short *idxlen, short *idxmax, MUTTMENU * menu)
{
--- /dev/null
+/*
+ * Copyright notice from original mutt:
+ * Copyright (C) 1996-2000 Michael R. Elkins <me@mutt.org>
+ *
+ * This file is part of mutt-ng, see http://www.muttng.org/.
+ * It's licensed under the GNU General Public License,
+ * please see the file GPL in the top level source directory.
+ */
+#ifndef _MUTT_RECVATTACH_H
+#define _MUTT_RECVATTACH_H
+
+#include "mutt_menu.h"
+
+#include "attach.h"
+
+void mutt_update_tree (ATTACHPTR **, short);
+
+ATTACHPTR **mutt_gen_attach_list (BODY *, int, ATTACHPTR **, short *, short *,
+ int, int);
+
+const char *mutt_attach_fmt (char *dest,
+ size_t destlen,
+ char op,
+ const char *src,
+ const char *prefix,
+ const char *ifstring,
+ const char *elsestring,
+ unsigned long data, format_flag flags);
+
+int mutt_tag_attach (MUTTMENU * menu, int n, int m);
+
+int mutt_is_message_type (int, const char *);
+
+void mutt_save_attachment_list (FILE * fp, int tag, BODY * top, HEADER * hdr,
+ MUTTMENU * menu);
+
+void mutt_pipe_attachment_list (FILE * fp, int tag, BODY * top, int filter);
+void mutt_print_attachment_list (FILE * fp, int tag, BODY * top);
+
+int mutt_attach_display_loop (MUTTMENU * menu, int op, FILE * fp,
+ HEADER * hdr, BODY * cur, ATTACHPTR *** idxp,
+ short *idxlen, short *idxmax, int recv);
+
+void mutt_attach_init (BODY *);
+
+void mutt_view_attachments (HEADER *);
+
+#endif /* !_MUTT_RECVATTACH_H */
#endif
#include "mutt.h"
+#include "enter.h"
+#include "state.h"
+#include "handler.h"
+#include "recvattach.h"
#include "mutt_curses.h"
#include "mutt_menu.h"
#include "rfc1524.h"
#endif
#include "mutt.h"
+#include "ascii.h"
#include "rfc1524.h"
#include "attach.h"
#endif
#include "mutt.h"
+#include "ascii.h"
#include "mime.h"
#include "charset.h"
#include "rfc2047.h"
#endif
#include "mutt.h"
+#include "ascii.h"
#include "mime.h"
#include "charset.h"
#include "lib/str.h"
#include <stdlib.h>
#include "mutt.h"
+#include "ascii.h"
#include "mutt_idna.h"
#include "lib/mem.h"
#include "mutt.h"
#include "sort.h"
+#include "buffer.h"
#include "lib/mem.h"
#include "lib/intl.h"
#endif
#include "mutt.h"
+#include "enter.h"
+#include "ascii.h"
#include "mutt_curses.h"
#include "rfc2047.h"
#include "keymap.h"
#endif
#include "mutt.h"
+#include "ascii.h"
+#include "handler.h"
+#include "recvattach.h"
#include "mutt_curses.h"
#include "rfc2047.h"
#include "rfc2231.h"
#endif
#include "mutt.h"
+#include "enter.h"
+#include "handler.h"
#include "mutt_curses.h"
#include "mutt_menu.h"
#include "smime.h"
#endif
#include "mutt.h"
-#include "lib/str.h"
#include "sort.h"
+#include "thread.h"
#include "mutt_idna.h"
+#include "lib/str.h"
#include "lib/intl.h"
#include <stdlib.h>
typedef int sort_t (const void *, const void *);
sort_t *mutt_get_sort_func (int);
-void mutt_clear_threads (CONTEXT *);
void mutt_sort_headers (CONTEXT *, int);
-void mutt_sort_threads (CONTEXT *, int);
int mutt_select_sort (int);
-THREAD *mutt_sort_subthreads (THREAD *, int);
WHERE short BrowserSort INITVAL (SORT_SUBJECT);
WHERE short Sort INITVAL (SORT_DATE);
#include "mutt.h"
#include "sort.h"
+#include "thread.h"
#include "lib/mem.h"
#include "lib/intl.h"
hash_destroy (&ctx->thread_hash, free);
}
-int compare_threads (const void *a, const void *b)
+static int compare_threads (const void *a, const void *b)
{
static sort_t *sort_func = NULL;
--- /dev/null
+/*
+ * Copyright notice from original mutt:
+ * Copyright (C) 1996-2000 Michael R. Elkins <me@mutt.org>
+ *
+ * This file is part of mutt-ng, see http://www.muttng.org/.
+ * It's licensed under the GNU General Public License,
+ * please see the file GPL in the top level source directory.
+ */
+#ifndef _MUTT_THREAD_H
+#define _MUTT_THREAD_H
+
+#define mutt_next_thread(x) _mutt_aside_thread(x,1,0)
+#define mutt_previous_thread(x) _mutt_aside_thread(x,0,0)
+#define mutt_next_subthread(x) _mutt_aside_thread(x,1,1)
+#define mutt_previous_subthread(x) _mutt_aside_thread(x,0,1)
+int _mutt_aside_thread (HEADER *, short, short);
+
+#define mutt_collapse_thread(x,y) _mutt_traverse_thread (x,y,M_THREAD_COLLAPSE)
+#define mutt_uncollapse_thread(x,y) _mutt_traverse_thread (x,y,M_THREAD_UNCOLLAPSE)
+#define mutt_get_hidden(x,y)_mutt_traverse_thread (x,y,M_THREAD_GET_HIDDEN)
+#define mutt_thread_contains_unread(x,y) _mutt_traverse_thread (x,y,M_THREAD_UNREAD)
+#define mutt_thread_next_unread(x,y) _mutt_traverse_thread(x,y,M_THREAD_NEXT_UNREAD)
+int _mutt_traverse_thread (CONTEXT * ctx, HEADER * hdr, int flag);
+
+void mutt_clear_threads (CONTEXT *);
+
+void mutt_sort_threads (CONTEXT *, int);
+THREAD *mutt_sort_subthreads (THREAD *, int);
+
+int mutt_parent_message (CONTEXT *, HEADER *);
+void mutt_set_virtual (CONTEXT *);
+
+int mutt_messages_in_thread (CONTEXT *, HEADER *, int);
+
+HASH *mutt_make_id_hash (CONTEXT *);
+HASH *mutt_make_subj_hash (CONTEXT *);
+
+int mutt_link_threads (HEADER *, HEADER *, CONTEXT *);
+void mutt_break_thread (HEADER *);
+
+#endif /* !_MUTT_THREAD_H */
#endif
#include "mutt.h"
+#include "ascii.h"
#include "mapping.h"
#include "url.h"