]> granicus.if.org Git - neomutt/commitdiff
split protos.h 1
authorRichard Russon <rich@flatcap.org>
Sat, 7 Jul 2018 22:50:13 +0000 (23:50 +0100)
committerRichard Russon <rich@flatcap.org>
Mon, 16 Jul 2018 22:23:11 +0000 (23:23 +0100)
63 files changed:
alias.h
browser.c
browser.h
buffy.h
color.h [new file with mode: 0644]
commands.c
commands.h [new file with mode: 0644]
compose.c
conn/ssl.c
curs_lib.c
curs_lib.h [new file with mode: 0644]
curs_main.c
enter.c
handler.c
hdrline.c
hook.c
hook.h [new file with mode: 0644]
imap/auth_plain.c
imap/browse.c
imap/command.c
imap/message.c
init.h
keymap.c
keymap.h
main.c
menu.c
mutt.h
mutt_attach.c
mutt_attach.h
mutt_body.c
mutt_logging.h
muttlib.h [new file with mode: 0644]
mx.c
ncrypt/crypt_gpgme.c
ncrypt/pgp.c
ncrypt/pgpinvoke.c
ncrypt/pgpkey.c
ncrypt/smime.c
nntp/newsrc.c
notmuch/mutt_notmuch.c
pager.c
pager.h
parse.c
parse.h [new file with mode: 0644]
pattern.c
pop/pop.c
pop/pop_lib.c
postpone.c
progress.c
protos.h
query.c
recvattach.c
recvattach.h
recvcmd.c
remailer.c
rfc1524.c
send.c
send.h [new file with mode: 0644]
sendlib.c
sendlib.h [new file with mode: 0644]
sidebar.c
sort.c
status.c

diff --git a/alias.h b/alias.h
index 69e4a1b45f65bc784f0b5ca4d80a1ab32f43b718..26114d682a627cd3f9fbde6957edfa1d300f4b8b 100644 (file)
--- a/alias.h
+++ b/alias.h
@@ -50,4 +50,10 @@ void            mutt_expand_aliases_env(struct Envelope *env);
 struct Address *mutt_expand_aliases(struct Address *a);
 struct Address *mutt_get_address(struct Envelope *env, char **pfxp);
 
+bool mutt_addr_is_user(struct Address *addr);
+int mutt_alias_complete(char *buf, size_t buflen);
+void mutt_alias_add_reverse(struct Alias *t);
+void mutt_alias_delete_reverse(struct Alias *t);
+struct Address *mutt_alias_reverse_lookup(struct Address *a);
+
 #endif /* _MUTT_ALIAS_H */
index ce2e73ef8ff33b27ac804d630ccfcc461e3d7dac..76bcd81882928815ae7bcbf68a239407fd66f5f7 100644 (file)
--- a/browser.c
+++ b/browser.c
@@ -50,6 +50,7 @@
 #include "mutt_curses.h"
 #include "mutt_menu.h"
 #include "mutt_window.h"
+#include "muttlib.h"
 #include "mx.h"
 #include "opcodes.h"
 #include "options.h"
index 34a8e7f5c159487569838cf6887d8f09126242b0..8f8c9eb3373a004eb123a674664539061642e4ab 100644 (file)
--- a/browser.h
+++ b/browser.h
@@ -78,4 +78,7 @@ struct BrowserState
 #endif
 };
 
+void mutt_select_file(char *f, size_t flen, int flags, char ***files, int *numfiles);
+void mutt_browser_select_dir(char *f);
+
 #endif /* _MUTT_BROWSER_H */
diff --git a/buffy.h b/buffy.h
index 55d2468c255e62f1150d9cb4fa099d5cd1d5a4e1..5e421881f48971925d5b4ae5699b84cf72fbb01e 100644 (file)
--- a/buffy.h
+++ b/buffy.h
@@ -80,6 +80,13 @@ void mutt_buffy_setnotified(const char *path);
 #define MUTT_BUFFY_CHECK_FORCE       (1 << 0)
 #define MUTT_BUFFY_CHECK_FORCE_STATS (1 << 1)
 
+void mutt_buffy(char *s, size_t slen);
+bool mutt_buffy_list(void);
+int mutt_buffy_check(int force);
+bool mutt_buffy_notify(void);
+int mutt_parse_mailboxes(struct Buffer *path, struct Buffer *s, unsigned long data, struct Buffer *err);
+int mutt_parse_unmailboxes(struct Buffer *path, struct Buffer *s, unsigned long data, struct Buffer *err);
+
 /* These variables are backing for config items */
 WHERE short MailCheck;
 WHERE short MailCheckStatsInterval;
diff --git a/color.h b/color.h
new file mode 100644 (file)
index 0000000..bfc96a5
--- /dev/null
+++ b/color.h
@@ -0,0 +1,37 @@
+/**
+ * @file
+ * Color and attribute parsing
+ *
+ * @authors
+ * Copyright (C) 2018 Richard Russon <rich@flatcap.org>
+ *
+ * @copyright
+ * This program is free software: you can redistribute it and/or modify it under
+ * the terms of the GNU General Public License as published by the Free Software
+ * Foundation, either version 2 of the License, or (at your option) any later
+ * version.
+ *
+ * This program is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+ * FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more
+ * details.
+ *
+ * You should have received a copy of the GNU General Public License along with
+ * this program.  If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#ifndef MUTT_COLOR_H
+#define MUTT_COLOR_H
+
+struct Buffer;
+
+int  mutt_alloc_color(int fg, int bg);
+int  mutt_combine_color(int fg_attr, int bg_attr);
+void mutt_free_color(int fg, int bg);
+void mutt_free_colors(void);
+int  mutt_parse_color(struct Buffer *buf, struct Buffer *s, unsigned long data, struct Buffer *err);
+int  mutt_parse_mono(struct Buffer *buf, struct Buffer *s, unsigned long data, struct Buffer *err);
+int  mutt_parse_uncolor(struct Buffer *buf, struct Buffer *s, unsigned long data, struct Buffer *err);
+int  mutt_parse_unmono(struct Buffer *buf, struct Buffer *s, unsigned long data, struct Buffer *err);
+
+#endif /* MUTT_COLOR_H */
index 9a7377f0d2c21471e93d91e680dffae1bbb4a525..360026b7e648243b3a06dbdeebf57c05d88c7ca8 100644 (file)
 #include "keymap.h"
 #include "mailbox.h"
 #include "mutt_curses.h"
+#include "mutt_logging.h"
 #include "mutt_menu.h"
 #include "mutt_window.h"
+#include "recvattach.h"
 #include "mx.h"
 #include "ncrypt/ncrypt.h"
 #include "options.h"
diff --git a/commands.h b/commands.h
new file mode 100644 (file)
index 0000000..33d3f9d
--- /dev/null
@@ -0,0 +1,47 @@
+/**
+ * @file
+ * Manage where the email is piped to external commands
+ *
+ * @authors
+ * Copyright (C) 2018 Richard Russon <rich@flatcap.org>
+ *
+ * @copyright
+ * This program is free software: you can redistribute it and/or modify it under
+ * the terms of the GNU General Public License as published by the Free Software
+ * Foundation, either version 2 of the License, or (at your option) any later
+ * version.
+ *
+ * This program is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+ * FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more
+ * details.
+ *
+ * You should have received a copy of the GNU General Public License along with
+ * this program.  If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#ifndef MUTT_COMMANDS_H
+#define MUTT_COMMANDS_H
+
+#include <stdio.h>
+
+struct Body;
+struct Context;
+struct Envelope;
+struct Header;
+
+void ci_bounce_message(struct Header *h);
+void mutt_check_stats(void);
+int  mutt_check_traditional_pgp(struct Header *h, int *redraw);
+void mutt_display_address(struct Envelope *env);
+int  mutt_display_message(struct Header *cur);
+int  mutt_edit_content_type(struct Header *h, struct Body *b, FILE *fp);
+void mutt_enter_command(void);
+void mutt_pipe_message(struct Header *h);
+void mutt_print_message(struct Header *h);
+int mutt_save_message_ctx(struct Header *h, int delete, int decode, int decrypt, struct Context *ctx);
+int  mutt_save_message(struct Header *h, int delete, int decode, int decrypt);
+void mutt_shell_escape(void);
+void mutt_version(void);
+
+#endif /* MUTT_COMMANDS_H */
index 09836d1579ea321b515f5c20f7499167fc55f519..66d53cabf50323af69d787fe95f2320505799e31 100644 (file)
--- a/compose.c
+++ b/compose.c
@@ -42,6 +42,7 @@
 #include "mutt_attach.h"
 #include "mutt_curses.h"
 #include "mutt_header.h"
+#include "mutt_logging.h"
 #include "mutt_menu.h"
 #include "mutt_window.h"
 #include "mx.h"
index 38582463e4e99564debba9f6ffebe5cc839c0ded..e1915d7997ca5e513289079b1837478572e61724 100644 (file)
@@ -59,6 +59,7 @@
 #include "globals.h"
 #include "keymap.h"
 #include "mutt_account.h"
+#include "mutt_logging.h"
 #include "mutt_menu.h"
 #include "opcodes.h"
 #include "options.h"
index 5fc5ea4dbdcea3606164416312b291123f140e70..614ed9aeeeef2cecd58c6163ee4eb2a392db85fe 100644 (file)
 #include "mutt/mutt.h"
 #include "email/email.h"
 #include "mutt.h"
+#include "browser.h"
 #include "context.h"
 #include "enter_state.h"
 #include "globals.h"
 #include "mutt_curses.h"
+#include "mutt_logging.h"
 #include "mutt_menu.h"
 #include "mutt_window.h"
 #include "opcodes.h"
diff --git a/curs_lib.h b/curs_lib.h
new file mode 100644 (file)
index 0000000..8e674a2
--- /dev/null
@@ -0,0 +1,52 @@
+/**
+ * @file
+ * GUI miscellaneous curses (window drawing) routines
+ *
+ * @authors
+ * Copyright (C) 2018 Richard Russon <rich@flatcap.org>
+ *
+ * @copyright
+ * This program is free software: you can redistribute it and/or modify it under
+ * the terms of the GNU General Public License as published by the Free Software
+ * Foundation, either version 2 of the License, or (at your option) any later
+ * version.
+ *
+ * This program is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+ * FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more
+ * details.
+ *
+ * You should have received a copy of the GNU General Public License along with
+ * this program.  If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#ifndef MUTT_CURS_LIB_H
+#define MUTT_CURS_LIB_H
+
+#include <stdbool.h>
+#include <stdio.h>
+#include <wchar.h>
+
+struct Context;
+
+bool   message_is_tagged(struct Context *ctx, int index);
+bool   message_is_visible(struct Context *ctx, int index);
+int    mutt_addwch(wchar_t wc);
+int    mutt_any_key_to_continue(const char *s);
+void   mutt_edit_file(const char *editor, const char *data);
+int    mutt_enter_fname_full(const char *prompt, char *buf, size_t blen, int buffy, int multiple, char ***files, int *numfiles, int flags);
+void   mutt_format_s(char *buf, size_t buflen, const char *prec, const char *s);
+void   mutt_format_s_tree(char *buf, size_t buflen, const char *prec, const char *s);
+int    mutt_get_field_full(const char *field, char *buf, size_t buflen, int complete, int multiple, char ***files, int *numfiles);
+int    mutt_get_field_unbuffered(char *msg, char *buf, size_t buflen, int flags);
+int    mutt_multi_choice(char *prompt, char *letters);
+void   mutt_paddstr(int n, const char *s);
+void   mutt_perror_debug(const char *s);
+void   mutt_query_exit(void);
+void   mutt_show_error(void);
+void   mutt_simple_format(char *buf, size_t buflen, int min_width, int max_width, int justify, char pad_char, const char *s, size_t n, int arboreal);
+int    mutt_strwidth(const char *s);
+size_t mutt_wstr_trunc(const char *src, size_t maxlen, size_t maxwid, size_t *width);
+int    mutt_yesorno(const char *msg, int def);
+
+#endif /* MUTT_CURS_LIB_H */
index f1f60fa47e468bb01ac65d1a1fb190ef70a9765d..7773ae85f25619effb6403a2c5390c8a2d121642 100644 (file)
@@ -33,6 +33,7 @@
 #include "conn/conn.h"
 #include "mutt.h"
 #include "alias.h"
+#include "browser.h"
 #include "buffy.h"
 #include "context.h"
 #include "format_flags.h"
@@ -41,6 +42,7 @@
 #include "mailbox.h"
 #include "mutt_curses.h"
 #include "mutt_header.h"
+#include "mutt_logging.h"
 #include "mutt_menu.h"
 #include "mutt_thread.h"
 #include "mutt_window.h"
@@ -52,6 +54,7 @@
 #include "pattern.h"
 #include "progress.h"
 #include "protos.h"
+#include "recvattach.h"
 #include "sort.h"
 #include "terminal.h"
 #ifdef USE_SIDEBAR
diff --git a/enter.c b/enter.c
index eda4a51a04f4cf4f0f2a9e3e0cbe55c54cd8bfb1..37ddc2f82961463dc5dc3e2061c21f450c279daf 100644 (file)
--- a/enter.c
+++ b/enter.c
@@ -35,6 +35,9 @@
 #include <wctype.h>
 #include "mutt/mutt.h"
 #include "mutt.h"
+#include "alias.h"
+#include "browser.h"
+#include "buffy.h"
 #include "enter_state.h"
 #include "globals.h"
 #include "history.h"
index 0f2a1be4d460e5783f58c1ac54e13e3fb0398757..9aac9d22a9d54457defab7f9fd0b03d99d598e3a 100644 (file)
--- a/handler.c
+++ b/handler.c
 #include "filter.h"
 #include "globals.h"
 #include "keymap.h"
+#include "mutt_attach.h"
+#include "mutt_logging.h"
 #include "ncrypt/ncrypt.h"
 #include "opcodes.h"
 #include "options.h"
 #include "protos.h"
+#include "recvattach.h"
 #include "rfc1524.h"
 #include "rfc3676.h"
 #include "state.h"
index a6528cca8284f103c0b73f6beb66552994b023cd..d93a8483ca09696f3753a67d071402efae723c4e 100644 (file)
--- a/hdrline.c
+++ b/hdrline.c
@@ -32,6 +32,7 @@
 #include "mutt/mutt.h"
 #include "email/email.h"
 #include "mutt.h"
+#include "alias.h"
 #include "context.h"
 #include "format_flags.h"
 #include "globals.h"
diff --git a/hook.c b/hook.c
index 442d0dc0a5dd5ff51623860aaddfca24120a00bf..a6cb0035ffdaa86d246635eff9fe1eb55b1acd84 100644 (file)
--- a/hook.c
+++ b/hook.c
@@ -36,6 +36,7 @@
 #include "mutt/mutt.h"
 #include "email/email.h"
 #include "mutt.h"
+#include "alias.h"
 #include "globals.h"
 #include "mailbox.h"
 #include "ncrypt/ncrypt.h"
diff --git a/hook.h b/hook.h
new file mode 100644 (file)
index 0000000..163d48f
--- /dev/null
+++ b/hook.h
@@ -0,0 +1,47 @@
+/**
+ * @file
+ * Parse and execute user-defined hooks
+ *
+ * @authors
+ * Copyright (C) 2018 Richard Russon <rich@flatcap.org>
+ *
+ * @copyright
+ * This program is free software: you can redistribute it and/or modify it under
+ * the terms of the GNU General Public License as published by the Free Software
+ * Foundation, either version 2 of the License, or (at your option) any later
+ * version.
+ *
+ * This program is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+ * FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more
+ * details.
+ *
+ * You should have received a copy of the GNU General Public License along with
+ * this program.  If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#ifndef MUTT_HOOK_H
+#define MUTT_HOOK_H
+
+#include <stdio.h>
+
+struct Address;
+struct Buffer;
+struct Context;
+struct Header;
+struct ListHead;
+
+void  mutt_account_hook(const char *url);
+void  mutt_crypt_hook(struct ListHead *list, struct Address *addr);
+void  mutt_default_save(char *path, size_t pathlen, struct Header *hdr);
+void  mutt_delete_hooks(int type);
+char *mutt_find_hook(int type, const char *pat);
+void  mutt_folder_hook(const char *path);
+void  mutt_message_hook(struct Context *ctx, struct Header *hdr, int type);
+int   mutt_parse_hook(struct Buffer *buf, struct Buffer *s, unsigned long data, struct Buffer *err);
+int   mutt_parse_unhook(struct Buffer *buf, struct Buffer *s, unsigned long data, struct Buffer *err);
+void  mutt_select_fcc(char *path, size_t pathlen, struct Header *hdr);
+void  mutt_startup_shutdown_hook(int type);
+void  mutt_timeout_hook(void);
+
+#endif /* MUTT_HOOK_H */
index 6813a1c879edc5ae3d75328701b09c896f1d70fd..3b96158aca7d3f0a512e919812773010601b1320 100644 (file)
@@ -33,6 +33,7 @@
 #include "conn/conn.h"
 #include "auth.h"
 #include "mutt_account.h"
+#include "mutt_logging.h"
 #include "mutt_socket.h"
 #include "options.h"
 #include "protos.h"
index e071c765bc93e9fc460b3cba5f06e12cdfdec1c4..babc8b30b534102dd6a5b6a60d0ff94be15c755b 100644 (file)
@@ -42,6 +42,7 @@
 #include "context.h"
 #include "globals.h"
 #include "imap/imap.h"
+#include "mutt_logging.h"
 #include "options.h"
 #include "protos.h"
 
index f849a64e6fc24e271d19294612e6cdff60a76e9c..ec0abd329045f85f808b464b27dae36091d5bf37 100644 (file)
@@ -48,6 +48,7 @@
 #include "mailbox.h"
 #include "message.h"
 #include "mutt_account.h"
+#include "mutt_logging.h"
 #include "mutt_menu.h"
 #include "mutt_socket.h"
 #include "mx.h"
index 245677299dcca704d97b3c1404fd99af3bb798d9..d68856dbd64f54e2420784a59ce948a4a037c40b 100644 (file)
@@ -47,6 +47,7 @@
 #include "mailbox.h"
 #include "mutt_account.h"
 #include "mutt_curses.h"
+#include "mutt_logging.h"
 #include "mutt_socket.h"
 #include "mx.h"
 #include "options.h"
diff --git a/init.h b/init.h
index 9d52b2325c7b0d35be1db446334681fc54229b19..105af56f3986f2549b0955c3e541de3d680ec466 100644 (file)
--- a/init.h
+++ b/init.h
@@ -36,6 +36,7 @@
 #include "globals.h"
 #include "group.h"
 #include "history.h"
+#include "keymap.h"
 #include "mutt_commands.h"
 #include "mutt_logging.h"
 #include "mutt_options.h"
index 4f62e43d0fa3812aecc0f9459809fbcd5d597e9f..e2efdceff442f327f284d9c34400054b5db946ab 100644 (file)
--- a/keymap.c
+++ b/keymap.c
@@ -34,6 +34,7 @@
 #include "functions.h"
 #include "globals.h"
 #include "mutt_curses.h"
+#include "mutt_logging.h"
 #include "mutt_window.h"
 #include "ncrypt/ncrypt.h"
 #include "opcodes.h"
index 41ff761c4aaf7970959f1b0aa5927b2a6123a608..bfc99d714289c6e982923c71440b9142506ef7a9 100644 (file)
--- a/keymap.h
+++ b/keymap.h
@@ -131,4 +131,9 @@ extern const struct Binding OpMix[];
 
 void mutt_free_keys(void);
 
+int mutt_parse_bind(struct Buffer *buf, struct Buffer *s, unsigned long data, struct Buffer *err);
+int mutt_parse_exec(struct Buffer *buf, struct Buffer *s, unsigned long data, struct Buffer *err);
+int mutt_parse_macro(struct Buffer *buf, struct Buffer *s, unsigned long data, struct Buffer *err);
+int mutt_parse_push(struct Buffer *buf, struct Buffer *s, unsigned long data, struct Buffer *err);
+
 #endif /* _MUTT_KEYMAP_H */
diff --git a/main.c b/main.c
index 7a616b78d36188196e83d27b58edde1540c6c52c..bc588be90d6bfa32bcb6a5a9b68005f43388e4e8 100644 (file)
--- a/main.c
+++ b/main.c
@@ -46,6 +46,7 @@
 #include "conn/conn.h"
 #include "mutt.h"
 #include "alias.h"
+#include "browser.h"
 #include "buffy.h"
 #include "globals.h"
 #include "keymap.h"
diff --git a/menu.c b/menu.c
index 5082fcb79512bbddf2e2693bb6754baa9e14c5c1..448a611cd64dc6170f3cc7509c0946539730642d 100644 (file)
--- a/menu.c
+++ b/menu.c
@@ -34,6 +34,7 @@
 #include "globals.h"
 #include "keymap.h"
 #include "mutt_curses.h"
+#include "mutt_logging.h"
 #include "mutt_menu.h"
 #include "mutt_window.h"
 #include "opcodes.h"
diff --git a/mutt.h b/mutt.h
index 48a74aa469dba44d9f32c2341f36845fabdf2dd6..469288b4d0d945f6f6efad35f13be28851b5ed97 100644 (file)
--- a/mutt.h
+++ b/mutt.h
@@ -30,6 +30,7 @@
 #include <stdbool.h>
 #include "where.h"
 
+struct Buffer;
 struct ListHead;
 struct Mapping;
 
@@ -290,10 +291,24 @@ struct AttachMatch
 
 int safe_asprintf(char **, const char *, ...);
 
-int mutt_inbox_cmp(const char *a, const char *b);
-
 char *mutt_compile_help(char *buf, size_t buflen, int menu, const struct Mapping *items);
 
+int mutt_extract_token(struct Buffer *dest, struct Buffer *tok, int flags);
+void mutt_free_opts(void);
+int query_quadoption(int opt, const char *prompt);
+int mutt_label_complete(char *buf, size_t buflen, int numtabs);
+int mutt_command_complete(char *buf, size_t buflen, int pos, int numtabs);
+int mutt_var_value_complete(char *buf, size_t buflen, int pos);
+void myvar_set(const char *var, const char *val);
+bool mutt_nm_query_complete(char *buf, size_t buflen, int pos, int numtabs);
+bool mutt_nm_tag_complete(char *buf, size_t buflen, int numtabs);
+int mutt_dump_variables(bool hide_sensitive);
+int mutt_get_hook_type(const char *name);
+int mutt_parse_rc_line(/* const */ char *line, struct Buffer *token, struct Buffer *err);
+int mutt_query_variables(struct ListHead *queries);
+bool set_default_value(const char *name, intptr_t value);
+void reset_value(const char *name);
+
 /* All the variables below are backing for config items */
 
 /* Quad-options */
index 40e47ca3c45cb256d9d64376f39a24386413013e..b58816fed02d50c6faeb7ed39ed253bd42ec7864 100644 (file)
 #include "globals.h"
 #include "handler.h"
 #include "mailbox.h"
+#include "mutt_attach.h"
 #include "mutt_curses.h"
 #include "mx.h"
 #include "ncrypt/ncrypt.h"
 #include "options.h"
 #include "pager.h"
 #include "protos.h"
+#include "recvattach.h"
 #include "rfc1524.h"
 #include "state.h"
 
index 24f4ccbdfae95d4fdbfc3900a1fedc13d06702d8..77bf23825777fc51385a5e7c181eba30880e4d88 100644 (file)
@@ -46,4 +46,13 @@ void mutt_print_attachment_list(struct AttachCtx *actx, FILE *fp, bool tag,
 
 int mutt_view_attachment(FILE *fp, struct Body *a, int flag, struct Header *hdr, struct AttachCtx *actx);
 
+void mutt_check_lookup_list(struct Body *b, char *type, size_t len);
+int mutt_compose_attachment(struct Body *a);
+int mutt_decode_save_attachment(FILE *fp, struct Body *m, char *path, int displaying, int flags);
+int mutt_edit_attachment(struct Body *a);
+int mutt_get_tmp_attachment(struct Body *a);
+int mutt_pipe_attachment(FILE *fp, struct Body *b, const char *path, char *outfile);
+int mutt_print_attachment(FILE *fp, struct Body *a);
+int mutt_save_attachment(FILE *fp, struct Body *m, char *path, int flags, struct Header *hdr);
+
 #endif /* _MUTT_ATTACH2_H */
index 0ea066178b4f767c4f2b8c7bcd29466146af490d..fb0f0900c970aee4fcadfc401f68a783a58bf4cc 100644 (file)
@@ -33,6 +33,7 @@
 #include <string.h>
 #include "mutt/mutt.h"
 #include "email/email.h"
+#include "mutt_attach.h"
 #include "protos.h"
 
 /**
index e8901647a4e535742f64549bbd4815ec0553933f..1daf5a85a0d7fe50017736299c504a6889ee9868 100644 (file)
@@ -37,4 +37,6 @@ void mutt_log_stop(void);
 int mutt_log_set_level(int level, bool verbose);
 int mutt_log_set_file(const char *file, bool verbose);
 
+void mutt_clear_error(void);
+
 #endif /* _LOGGING2_H */
diff --git a/muttlib.h b/muttlib.h
new file mode 100644 (file)
index 0000000..98fbfd6
--- /dev/null
+++ b/muttlib.h
@@ -0,0 +1,63 @@
+/**
+ * @file
+ * Some miscellaneous functions
+ *
+ * @authors
+ * Copyright (C) 2018 Richard Russon <rich@flatcap.org>
+ *
+ * @copyright
+ * This program is free software: you can redistribute it and/or modify it under
+ * the terms of the GNU General Public License as published by the Free Software
+ * Foundation, either version 2 of the License, or (at your option) any later
+ * version.
+ *
+ * This program is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+ * FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more
+ * details.
+ *
+ * You should have received a copy of the GNU General Public License along with
+ * this program.  If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#ifndef MUTT_MUTTLIB_H
+#define MUTT_MUTTLIB_H
+
+#include <signal.h>
+#include <stdbool.h>
+#include <stdint.h>
+#include <stdio.h>
+
+struct Address;
+struct Body;
+
+struct passwd;
+struct stat;
+
+void        mutt_adv_mktemp(char *s, size_t l);
+int         mutt_check_overwrite(const char *attname, const char *path, char *fname, size_t flen, int *append, char **directory);
+void        mutt_encode_path(char *dest, size_t dlen, const char *src);
+void        mutt_expand_file_fmt(char *dest, size_t destlen, const char *fmt, const char *src);
+void        mutt_expand_fmt(char *dest, size_t destlen, const char *fmt, const char *src);
+char *      mutt_expand_path(char *s, size_t slen);
+char *      mutt_expand_path_regex(char *s, size_t slen, bool regex);
+char *      mutt_gecos_name(char *dest, size_t destlen, struct passwd *pw);
+void        mutt_get_parent_path(char *output, char *path, size_t olen);
+int         mutt_inbox_cmp(const char *a, const char *b);
+bool        mutt_is_text_part(struct Body *b);
+const char *mutt_make_version(void);
+void        mutt_mktemp_full(char *s, size_t slen, const char *prefix, const char *suffix, const char *src, int line);
+bool        mutt_needs_mailcap(struct Body *m);
+FILE *      mutt_open_read(const char *path, pid_t *thepid);
+void        mutt_pretty_mailbox(char *s, size_t buflen);
+uint32_t    mutt_rand32(void);
+uint64_t    mutt_rand64(void);
+void        mutt_rand_base32(void *out, size_t len);
+int         mutt_randbuf(void *out, size_t len);
+size_t      mutt_realpath(char *buf);
+void        mutt_safe_path(char *s, size_t l, struct Address *a);
+int         mutt_save_confirm(const char *s, struct stat *st);
+void        mutt_save_path(char *d, size_t dsize, struct Address *a);
+void        mutt_sleep(short s);
+
+#endif /* MUTT_MUTTLIB_H */
diff --git a/mx.c b/mx.c
index e1cb8ce8a04456a1c26510d977ed12f8cf431b62..594c9ad6cd14756759f9ded85c48ec56a8f9c17d 100644 (file)
--- a/mx.c
+++ b/mx.c
@@ -50,6 +50,7 @@
 #include "maildir/maildir.h"
 #include "mbox/mbox.h"
 #include "mutt_header.h"
+#include "mutt_logging.h"
 #include "mutt_thread.h"
 #include "ncrypt/ncrypt.h"
 #include "opcodes.h"
index 9b03803a982751c40bf04e597e3d0d8b03a28642..7cdd4c6cd990e08b72d50d3bba70ce4468528e7c 100644 (file)
@@ -57,7 +57,9 @@
 #include "globals.h"
 #include "handler.h"
 #include "keymap.h"
+#include "mutt_attach.h"
 #include "mutt_curses.h"
+#include "mutt_logging.h"
 #include "mutt_menu.h"
 #include "mutt_window.h"
 #include "ncrypt.h"
@@ -65,6 +67,7 @@
 #include "options.h"
 #include "pager.h"
 #include "protos.h"
+#include "recvattach.h"
 #include "sort.h"
 #include "state.h"
 #ifdef ENABLE_NLS
index 4e27bd077011c64aa5f8375f8010c9ae92b923b5..60a1198017d8763fa21b749defb22991073bd9d8 100644 (file)
@@ -50,6 +50,7 @@
 #include "filter.h"
 #include "globals.h"
 #include "handler.h"
+#include "mutt_attach.h"
 #include "mutt_curses.h"
 #include "ncrypt.h"
 #include "options.h"
index 8fb36d9fdb181a5eadd852627a628356ba25cac2..4e022bb533853b4c3c4b4674ecd07205d2ec9fd4 100644 (file)
@@ -41,6 +41,7 @@
 #include "format_flags.h"
 #include "globals.h"
 #include "mutt_curses.h"
+#include "mutt_logging.h"
 #include "mutt_window.h"
 #include "ncrypt.h"
 #include "pgp.h"
index 046d2df5de25b21a28626d02416c1fe5920b65db..247f7a4a2c33e21f41c6a726f580e082bdbe6e72 100644 (file)
@@ -48,6 +48,7 @@
 #include "globals.h"
 #include "gnupgparse.h"
 #include "keymap.h"
+#include "mutt_logging.h"
 #include "mutt_menu.h"
 #include "mutt_window.h"
 #include "ncrypt.h"
@@ -58,6 +59,7 @@
 #include "pgpinvoke.h"
 #include "pgplib.h"
 #include "protos.h"
+#include "recvattach.h"
 #include "sort.h"
 
 /**
index d199ed6a6e97c80b8071cec67ec700216e4e3faa..6ee641d33091e7bca3c86de25ae493febbd3f78a 100644 (file)
@@ -49,6 +49,7 @@
 #include "handler.h"
 #include "keymap.h"
 #include "mutt_curses.h"
+#include "mutt_logging.h"
 #include "mutt_menu.h"
 #include "mutt_window.h"
 #include "ncrypt.h"
index 3f38d3d80b0ed2a15949bb682d50cf0a39b0417b..26e082e5eb6249b3bef7d28a9090cb08d3a997bb 100644 (file)
@@ -47,6 +47,7 @@
 #include "format_flags.h"
 #include "globals.h"
 #include "mutt_account.h"
+#include "mutt_logging.h"
 #include "mutt_socket.h"
 #include "mutt_window.h"
 #include "mx.h"
index 906c3f1e51de058281e3ddafcfa7b987f5a7596e..66b29710ca72954700cec4615bf58522c120401c 100644 (file)
@@ -55,6 +55,7 @@
 #include "globals.h"
 #include "mailbox.h"
 #include "maildir/maildir.h"
+#include "mutt_logging.h"
 #include "mutt_thread.h"
 #include "mx.h"
 #include "progress.h"
diff --git a/pager.c b/pager.c
index 470ed2a7accf5e794e3ac6641ccc4d0b0e4bad13..0483181b03601833c8eee2a542a47027073f9be6 100644 (file)
--- a/pager.c
+++ b/pager.c
@@ -36,6 +36,7 @@
 #include "mutt.h"
 #include "pager.h"
 #include "alias.h"
+#include "buffy.h"
 #include "context.h"
 #include "format_flags.h"
 #include "globals.h"
@@ -44,6 +45,7 @@
 #include "mutt_attach.h"
 #include "mutt_curses.h"
 #include "mutt_header.h"
+#include "mutt_logging.h"
 #include "mutt_menu.h"
 #include "mutt_window.h"
 #include "mx.h"
@@ -51,6 +53,7 @@
 #include "opcodes.h"
 #include "options.h"
 #include "protos.h"
+#include "recvattach.h"
 #include "recvcmd.h"
 #include "sort.h"
 #include "terminal.h"
diff --git a/pager.h b/pager.h
index 0cdc0e74198f9ac8d83d0591b6892266a704dbd6..c78d5a7b559d29cca12c54cadc411f90a38778f5 100644 (file)
--- a/pager.h
+++ b/pager.h
@@ -63,4 +63,6 @@ int mutt_do_pager(const char *banner, const char *tempfile, int do_color, struct
 int mutt_pager(const char *banner, const char *fname, int flags, struct Pager *extra);
 void update_index(struct Menu *menu, struct Context *ctx, int check, int oldcount, int index_hint);
 
+void mutt_clear_pager_position(void);
+
 #endif /* _MUTT_PAGER_H */
diff --git a/parse.c b/parse.c
index e39a20fa07e23cf1aa9e4f02107d5250d1dfca45..3e371d326256c849c24f7a8789f47bf6b00f2138 100644 (file)
--- a/parse.c
+++ b/parse.c
@@ -36,6 +36,7 @@
 #include "ncrypt/ncrypt.h"
 #include "options.h"
 #include "protos.h"
+#include "recvattach.h"
 #include "rfc2047.h"
 #include "rfc2231.h"
 #include "url.h"
diff --git a/parse.h b/parse.h
new file mode 100644 (file)
index 0000000..1895bfe
--- /dev/null
+++ b/parse.h
@@ -0,0 +1,48 @@
+/**
+ * @file
+ * Miscellaneous email parsing routines
+ *
+ * @authors
+ * Copyright (C) 2018 Richard Russon <rich@flatcap.org>
+ *
+ * @copyright
+ * This program is free software: you can redistribute it and/or modify it under
+ * the terms of the GNU General Public License as published by the Free Software
+ * Foundation, either version 2 of the License, or (at your option) any later
+ * version.
+ *
+ * This program is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+ * FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more
+ * details.
+ *
+ * You should have received a copy of the GNU General Public License along with
+ * this program.  If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#ifndef MUTT_PARSE_H
+#define MUTT_PARSE_H
+
+#include <stdbool.h>
+#include <stdio.h>
+
+struct Body;
+struct Context;
+struct Envelope;
+struct Header;
+
+int              mutt_check_encoding(const char *c);
+int              mutt_check_mime_type(const char *s);
+int              mutt_count_body_parts(struct Context *ctx, struct Header *hdr);
+char *           mutt_extract_message_id(const char *s, const char **saveptr);
+void             mutt_parse_content_type(char *s, struct Body *ct);
+void             mutt_parse_mime_message(struct Context *ctx, struct Header *cur);
+struct Body *    mutt_parse_multipart(FILE *fp, const char *boundary, LOFF_T end_off, bool digest);
+void             mutt_parse_part(FILE *fp, struct Body *b);
+struct Body *    mutt_read_mime_header(FILE *fp, bool digest);
+int              mutt_rfc822_parse_line(struct Envelope *e, struct Header *hdr, char *line, char *p, short user_hdrs, short weed, short do_2047);
+struct Body *    mutt_rfc822_parse_message(FILE *fp, struct Body *parent);
+struct Envelope *mutt_rfc822_read_header(FILE *f, struct Header *hdr, short user_hdrs, short weed);
+char *           mutt_rfc822_read_line(FILE *f, char *line, size_t *linelen);
+
+#endif /* MUTT_PARSE_H */
index 154fe34d33bf25c3082d9fd8812757bb3d75794d..494cc4189a52f35e5e677cbff3d9fb1cfbd65109 100644 (file)
--- a/pattern.c
+++ b/pattern.c
 #include "conn/conn.h"
 #include "mutt.h"
 #include "pattern.h"
+#include "alias.h"
 #include "context.h"
 #include "copy.h"
 #include "globals.h"
 #include "group.h"
 #include "handler.h"
 #include "mailbox.h"
+#include "mutt_logging.h"
 #include "mutt_menu.h"
 #include "mx.h"
 #include "ncrypt/ncrypt.h"
index a1e38efc4bc73a173db59b547e9aa6abe44543da..ed7a2e3f3f9bc210ad7f52b6f74062c0df60c54c 100644 (file)
--- a/pop/pop.c
+++ b/pop/pop.c
@@ -47,6 +47,7 @@
 #include "mailbox.h"
 #include "mutt_account.h"
 #include "mutt_header.h"
+#include "mutt_logging.h"
 #include "mutt_socket.h"
 #include "mx.h"
 #include "ncrypt/ncrypt.h"
index 454da66a4144a9ee05de8f50f183d8775b681f49..60cda4707588ae8fe6984f84401767692d905dd5 100644 (file)
@@ -37,6 +37,7 @@
 #include "globals.h"
 #include "mutt_account.h"
 #include "mutt_curses.h"
+#include "mutt_logging.h"
 #include "mutt_socket.h"
 #include "options.h"
 #include "pop.h"
index 7e4d748a433f5938a231d69897241c1005ba450f..4d492cca052c96a5541c52f62e21120c86d028cc 100644 (file)
@@ -45,6 +45,7 @@
 #include "handler.h"
 #include "keymap.h"
 #include "mailbox.h"
+#include "mutt_logging.h"
 #include "mutt_menu.h"
 #include "mutt_thread.h"
 #include "ncrypt/ncrypt.h"
index 34a4710507396c5151def67e28d2eb4fd44a9869..44c59a51972a843cec6c5e3a9514e54590e1f11f 100644 (file)
@@ -34,6 +34,7 @@
 #include <sys/time.h>
 #include "mutt/mutt.h"
 #include "mutt.h"
+#include "mutt_logging.h"
 #include "progress.h"
 #include "globals.h"
 #include "mutt_curses.h"
index 346d318f2bb0dadb5118427e94d20b657ddeb396..cd4f3ba1248873ca872077a15d4d4f9a46a5b189 100644 (file)
--- a/protos.h
+++ b/protos.h
 #define _MUTT_PROTOS_H
 
 #include <stddef.h>
-#include <ctype.h>
-#include <iconv.h>
 #include <stdbool.h>
 #include <stdint.h>
 #include <stdio.h>
 #include <time.h>
-#include <wctype.h>
 #include "mutt.h"
 #include "format_flags.h"
 
 struct Address;
-struct Alias;
 struct AliasList;
 struct Body;
 struct Buffer;
@@ -73,26 +69,16 @@ enum XdgType
   XDG_CONFIG_DIRS,
 };
 
-int mutt_extract_token(struct Buffer *dest, struct Buffer *tok, int flags);
-
 void mutt_make_string_info(char *buf, size_t buflen, int cols, const char *s,
                            struct HdrFormatInfo *hfi, enum FormatFlag flags);
 
-void mutt_free_opts(void);
-
 int mutt_system(const char *cmd);
 
 void mutt_parse_content_type(char *s, struct Body *ct);
 void mutt_generate_boundary(struct ParameterList *parm);
 
-#ifdef USE_NOTMUCH
-int mutt_parse_virtual_mailboxes(struct Buffer *path, struct Buffer *s, unsigned long data, struct Buffer *err);
-#endif
-
 FILE *mutt_open_read(const char *path, pid_t *thepid);
 
-int query_quadoption(int opt, const char *prompt);
-
 char *mutt_extract_message_id(const char *s, const char **saveptr);
 
 struct Address *mutt_default_from(void);
@@ -114,11 +100,6 @@ struct Envelope *mutt_rfc822_read_header(FILE *f, struct Header *hdr, short user
 
 int is_from(const char *s, char *path, size_t pathlen, time_t *tp);
 
-const char *attach_format_str(char *buf, size_t buflen, size_t col, int cols,
-                            char op, const char *src, const char *prec,
-                            const char *if_str, const char *else_str,
-                            unsigned long data, enum FormatFlag flags);
-
 char *mutt_expand_path(char *s, size_t slen);
 char *mutt_expand_path_regex(char *s, size_t slen, bool regex);
 char *mutt_find_hook(int type, const char *pat);
@@ -138,19 +119,14 @@ void mutt_add_to_reference_headers(struct Envelope *env, struct Envelope *curenv
 void mutt_adv_mktemp(char *s, size_t l);
 void mutt_alias_menu(char *buf, size_t buflen, struct AliasList *aliases);
 int mutt_bounce_message(FILE *fp, struct Header *h, struct Address *to);
-void mutt_buffy(char *s, size_t slen);
-bool mutt_buffy_list(void);
 void mutt_check_stats(void);
 int mutt_count_body_parts(struct Context *ctx, struct Header *hdr);
 void mutt_check_rescore(struct Context *ctx);
-void mutt_clear_error(void);
-void mutt_clear_pager_position(void);
 void mutt_default_save(char *path, size_t pathlen, struct Header *hdr);
 void mutt_display_address(struct Envelope *env);
 void mutt_draw_statusline(int cols, const char *buf, size_t buflen);
 int mutt_edit_content_type (struct Header *h, struct Body *b, FILE *fp);
 void mutt_edit_file(const char *editor, const char *data);
-int mutt_label_complete(char *buf, size_t buflen, int numtabs);
 void mutt_encode_descriptions(struct Body *b, short recurse);
 void mutt_encode_path(char *dest, size_t dlen, const char *src);
 void mutt_enter_command(void);
@@ -167,7 +143,6 @@ void mutt_forward_trailer(struct Context *ctx, struct Header *cur, FILE *fp);
 void mutt_free_color(int fg, int bg);
 void mutt_free_colors(void);
 void mutt_help(int menu);
-void mutt_check_lookup_list(struct Body *b, char *type, size_t len);
 void mutt_make_attribution(struct Context *ctx, struct Header *cur, FILE *out);
 void mutt_make_forward_subject(struct Envelope *env, struct Context *ctx, struct Header *cur);
 void mutt_make_help(char *d, size_t dlen, const char *txt, int menu, int op);
@@ -192,7 +167,6 @@ 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(struct Context *ctx, struct Header *hdr, bool upd_ctx);
 void mutt_select_fcc(char *path, size_t pathlen, struct Header *hdr);
-void mutt_select_file(char *f, size_t flen, int flags, char ***files, int *numfiles);
 void mutt_message_hook(struct Context *ctx, struct Header *hdr, int type);
 void mutt_set_flag_update(struct Context *ctx, struct Header *h, int flag, bool bf, bool upd_ctx);
 #define mutt_set_flag(a, b, c, d) mutt_set_flag_update(a, b, c, d, true)
@@ -204,18 +178,11 @@ void mutt_stamp_attachment(struct Body *a);
 void mutt_tag_set_flag(int flag, int bf);
 void mutt_update_encoding(struct Body *a);
 void mutt_version(void);
-void mutt_view_attachments(struct Header *hdr);
 void mutt_write_address_list(struct Address *addr, FILE *fp, int linelen, bool display);
-bool mutt_addr_is_user(struct Address *addr);
 int mutt_addwch(wchar_t wc);
-int mutt_alias_complete(char *buf, size_t buflen);
-void mutt_alias_add_reverse(struct Alias *t);
-void mutt_alias_delete_reverse(struct Alias *t);
 int mutt_alloc_color(int fg, int bg);
 int mutt_combine_color(int fg_attr, int bg_attr);
 int mutt_any_key_to_continue(const char *s);
-int mutt_buffy_check(int force);
-bool mutt_buffy_notify(void);
 int mutt_builtin_editor(const char *path, struct Header *msg, struct Header *cur);
 int mutt_change_flag(struct Header *h, int bf);
 int mutt_check_encoding(const char *c);
@@ -224,19 +191,8 @@ int mutt_check_mime_type(const char *s);
 int mutt_check_overwrite(const char *attname, const char *path, char *fname,
                          size_t flen, int *append, char **directory);
 int mutt_check_traditional_pgp(struct Header *h, int *redraw);
-int mutt_command_complete(char *buf, size_t buflen, int pos, int numtabs);
-int mutt_var_value_complete(char *buf, size_t buflen, int pos);
-void myvar_set(const char *var, const char *val);
-#ifdef USE_NOTMUCH
-bool mutt_nm_query_complete(char *buf, size_t buflen, int pos, int numtabs);
-bool mutt_nm_tag_complete(char *buf, size_t buflen, int numtabs);
-#endif
 int mutt_complete(char *buf, size_t buflen);
-int mutt_compose_attachment(struct Body *a);
-int mutt_decode_save_attachment(FILE *fp, struct Body *m, char *path, int displaying, int flags);
 int mutt_display_message(struct Header *cur);
-int mutt_dump_variables(bool hide_sensitive);
-int mutt_edit_attachment(struct Body *a);
 int mutt_edit_message(struct Context *ctx, struct Header *hdr);
 int mutt_view_message(struct Context *ctx, struct Header *hdr);
 int mutt_fetch_recips(struct Envelope *out, struct Envelope *in, int flags);
@@ -253,47 +209,33 @@ int mutt_enter_string_full(char *buf, size_t buflen, int col, int flags, int mul
 #define mutt_get_field(A, B, C, D) mutt_get_field_full(A, B, C, D, 0, NULL, NULL)
 int mutt_get_field_full(const char *field, char *buf, size_t buflen, int complete,
                     int multiple, char ***files, int *numfiles);
-int mutt_get_hook_type(const char *name);
 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(struct Context *ctx, struct Header *hdr, struct Header **cur, char *fcc, size_t fcclen);
 int mutt_parse_crypt_hdr(const char *p, int set_empty_signas, int crypt_app);
-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,
                          const char *msg, int eightbit);
 bool mutt_is_mail_list(struct Address *addr);
-bool mutt_is_message_type(int type, const char *subtype);
 bool mutt_is_subscribed_list(struct Address *addr);
 bool mutt_is_text_part(struct Body *b);
 int mutt_lookup_mime_type(struct Body *att, const char *path);
 int mutt_multi_choice(char *prompt, char *letters);
 bool mutt_needs_mailcap(struct Body *m);
 int mutt_num_postponed(int force);
-int mutt_parse_bind(struct Buffer *buf, struct Buffer *s, unsigned long data, struct Buffer *err);
-int mutt_parse_exec(struct Buffer *buf, struct Buffer *s, unsigned long data, struct Buffer *err);
 int mutt_parse_color(struct Buffer *buf, struct Buffer *s, unsigned long data, struct Buffer *err);
 int mutt_parse_uncolor(struct Buffer *buf, struct Buffer *s, unsigned long data, struct Buffer *err);
 int mutt_parse_hook(struct Buffer *buf, struct Buffer *s, unsigned long data, struct Buffer *err);
-int mutt_parse_macro(struct Buffer *buf, struct Buffer *s, unsigned long data, struct Buffer *err);
-int mutt_parse_mailboxes(struct Buffer *path, struct Buffer *s, unsigned long data, struct Buffer *err);
-int mutt_parse_unmailboxes(struct Buffer *path, struct Buffer *s, unsigned long data, struct Buffer *err);
 int mutt_parse_mono(struct Buffer *buf, struct Buffer *s, unsigned long data, struct Buffer *err);
 int mutt_parse_unmono(struct Buffer *buf, struct Buffer *s, unsigned long data, struct Buffer *err);
-int mutt_parse_push(struct Buffer *buf, struct Buffer *s, unsigned long data, struct Buffer *err);
-int mutt_parse_rc_line(/* const */ char *line, struct Buffer *token, struct Buffer *err);
 int mutt_rfc822_parse_line(struct Envelope *e, struct Header *hdr, char *line, char *p,
                            short user_hdrs, short weed, short do_2047);
 int mutt_parse_score(struct Buffer *buf, struct Buffer *s, unsigned long data, struct Buffer *err);
 int mutt_parse_unscore(struct Buffer *buf, struct Buffer *s, unsigned long data, struct Buffer *err);
 int mutt_parse_unhook(struct Buffer *buf, struct Buffer *s, unsigned long data, struct Buffer *err);
 void mutt_delete_hooks(int type);
-int mutt_pipe_attachment(FILE *fp, struct Body *b, const char *path, char *outfile);
-int mutt_print_attachment(FILE *fp, struct Body *a);
 int mutt_query_complete(char *buf, size_t buflen);
-int mutt_query_variables(struct ListHead *queries);
-int mutt_save_attachment(FILE *fp, struct Body *m, char *path, int flags, struct Header *hdr);
 int mutt_save_message_ctx(struct Header *h, int delete, int decode, int decrypt, struct Context *ctx);
 int mutt_save_message(struct Header *h, int delete, int decode, int decrypt);
 #ifdef USE_SMTP
@@ -321,7 +263,6 @@ void mutt_set_header_color(struct Context *ctx, struct Header *curhdr);
 void mutt_sleep(short s);
 int mutt_save_confirm(const char *s, struct stat *st);
 
-void mutt_browser_select_dir(char *f);
 void mutt_get_parent_path(char *output, char *path, size_t olen);
 size_t mutt_realpath(char *buf);
 
@@ -331,16 +272,11 @@ uint32_t mutt_rand32(void);
 uint64_t mutt_rand64(void);
 int mutt_randbuf(void *out, size_t len);
 
-struct Address *mutt_alias_reverse_lookup(struct Address *a);
-
 int getdnsdomainname(char *d, size_t len);
 
-/* unsorted */
 void ci_bounce_message(struct Header *h);
 int ci_send_message(int flags, struct Header *msg, char *tempfile, struct Context *ctx, struct Header *cur);
 
-/* prototypes for compatibility functions */
-
 #ifndef HAVE_WCSCASECMP
 int wcscasecmp(const wchar_t *a, const wchar_t *b);
 #endif
@@ -348,7 +284,4 @@ int wcscasecmp(const wchar_t *a, const wchar_t *b);
 bool message_is_tagged(struct Context *ctx, int index);
 bool message_is_visible(struct Context *ctx, int index);
 
-bool set_default_value(const char *name, intptr_t value);
-void reset_value(const char *name);
-
 #endif /* _MUTT_PROTOS_H */
diff --git a/query.c b/query.c
index d4e19c63ba217d2638e62f7aa3b33b1197768df6..4c0775cf3402a7acbbc2e190f0c6aa87453709b6 100644 (file)
--- a/query.c
+++ b/query.c
@@ -34,6 +34,7 @@
 #include "format_flags.h"
 #include "globals.h"
 #include "keymap.h"
+#include "mutt_logging.h"
 #include "mutt_menu.h"
 #include "mutt_window.h"
 #include "opcodes.h"
index 67c6f90d2451058f039cd62e3fab99938f5c1491..f4f61c105e886c36a9f0b03fa975fb14962f6f92 100644 (file)
@@ -31,6 +31,7 @@
 #include "mutt/mutt.h"
 #include "email/email.h"
 #include "mutt.h"
+#include "recvattach.h"
 #include "context.h"
 #include "filter.h"
 #include "format_flags.h"
@@ -40,6 +41,7 @@
 #include "mailbox.h"
 #include "mutt_attach.h"
 #include "mutt_curses.h"
+#include "mutt_logging.h"
 #include "mutt_menu.h"
 #include "mutt_window.h"
 #include "mx.h"
index 7317d29ece85b28c29a5a2b47ca1aa545627e7a0..5093e658e6ee3c95c00d4ad13d546162f5b6dbe2 100644 (file)
 #ifndef _MUTT_RECVATTACH_H
 #define _MUTT_RECVATTACH_H
 
+#include "format_flags.h"
+
 struct AttachCtx;
 
 void mutt_attach_init(struct AttachCtx *actx);
 void mutt_update_tree(struct AttachCtx *actx);
 
+const char *attach_format_str(char *buf, size_t buflen, size_t col, int cols, char op, const char *src, const char *prec, const char *if_str, const char *else_str, unsigned long data, enum FormatFlag flags);
+void mutt_view_attachments(struct Header *hdr);
+bool mutt_is_message_type(int type, const char *subtype);
+
 #endif /* _MUTT_RECVATTACH_H */
index 5a079afc18d21cf3459a70aa98f234fcafa6d206..e53de54092e487f42480d4829f92f5e3be22cf1a 100644 (file)
--- a/recvcmd.c
+++ b/recvcmd.c
 #include "globals.h"
 #include "handler.h"
 #include "mutt_body.h"
+#include "mutt_logging.h"
 #include "mutt_window.h"
 #include "options.h"
 #include "protos.h"
+#include "recvattach.h"
 #include "state.h"
 #ifdef ENABLE_NLS
 #include <libintl.h>
index 5f6a174655b88cc2b572632e0e29fe3339d86c90..a1d94ae758e9b317f30223df4bfa311812dba7ca 100644 (file)
@@ -40,6 +40,7 @@
 #include "opcodes.h"
 #include "options.h"
 #include "protos.h"
+#include "recvattach.h"
 
 /**
  * struct Coord - Screen coordinates
index 7bd45de8b286e4bea4be95c91fe2fe7d73d938ae..9c526353dc33f352b45ea4b022049b895f3b73f7 100644 (file)
--- a/rfc1524.c
+++ b/rfc1524.c
@@ -42,6 +42,7 @@
 #include "mutt.h"
 #include "rfc1524.h"
 #include "globals.h"
+#include "mutt_attach.h"
 #include "options.h"
 #include "protos.h"
 
diff --git a/send.c b/send.c
index 76756006f363088d538b4885265ef9a1be14f47c..f18c0f614a1a8330626e5c3e3df3c56ee1efa406 100644 (file)
--- a/send.c
+++ b/send.c
@@ -40,7 +40,9 @@
 #include "filter.h"
 #include "globals.h"
 #include "mailbox.h"
+#include "mutt_attach.h"
 #include "mutt_header.h"
+#include "mutt_logging.h"
 #include "ncrypt/ncrypt.h"
 #include "options.h"
 #include "pattern.h"
diff --git a/send.h b/send.h
new file mode 100644 (file)
index 0000000..9c02661
--- /dev/null
+++ b/send.h
@@ -0,0 +1,51 @@
+/**
+ * @file
+ * Prepare and send an email
+ *
+ * @authors
+ * Copyright (C) 2018 Richard Russon <rich@flatcap.org>
+ *
+ * @copyright
+ * This program is free software: you can redistribute it and/or modify it under
+ * the terms of the GNU General Public License as published by the Free Software
+ * Foundation, either version 2 of the License, or (at your option) any later
+ * version.
+ *
+ * This program is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+ * FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more
+ * details.
+ *
+ * You should have received a copy of the GNU General Public License along with
+ * this program.  If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#ifndef MUTT_SEND_H
+#define MUTT_SEND_H
+
+#include <stdio.h>
+
+struct Address;
+struct Body;
+struct Context;
+struct Envelope;
+struct Header;
+
+int             ci_send_message(int flags, struct Header *msg, char *tempfile, struct Context *ctx, struct Header *cur);
+void            mutt_add_to_reference_headers(struct Envelope *env, struct Envelope *curenv);
+int             mutt_compose_to_sender(struct Header *hdr);
+struct Address *mutt_default_from(void);
+void            mutt_encode_descriptions(struct Body *b, short recurse);
+int             mutt_fetch_recips(struct Envelope *out, struct Envelope *in, int flags);
+void            mutt_fix_reply_recipients(struct Envelope *env);
+void            mutt_forward_intro(struct Context *ctx, struct Header *cur, FILE *fp);
+void            mutt_forward_trailer(struct Context *ctx, struct Header *cur, FILE *fp);
+void            mutt_make_attribution(struct Context *ctx, struct Header *cur, FILE *out);
+void            mutt_make_forward_subject(struct Envelope *env, struct Context *ctx, struct Header *cur);
+void            mutt_make_misc_reply_headers(struct Envelope *env, struct Envelope *curenv);
+void            mutt_make_post_indent(struct Context *ctx, struct Header *cur, FILE *out);
+struct Address *mutt_remove_xrefs(struct Address *a, struct Address *b);
+int             mutt_resend_message(FILE *fp, struct Context *ctx, struct Header *cur);
+void            mutt_set_followup_to(struct Envelope *e);
+
+#endif /* MUTT_SEND_H */
index 78cb889bdbb1d7933a6c8e7e45ab0703bc03d0ab..6dfad3bc6785b47532d24a8065d3db07d3316331 100644 (file)
--- a/sendlib.c
+++ b/sendlib.c
@@ -53,6 +53,7 @@
 #include "options.h"
 #include "pager.h"
 #include "protos.h"
+#include "recvattach.h"
 #include "rfc2047.h"
 #include "rfc2231.h"
 #include "state.h"
diff --git a/sendlib.h b/sendlib.h
new file mode 100644 (file)
index 0000000..fe2243b
--- /dev/null
+++ b/sendlib.h
@@ -0,0 +1,63 @@
+/**
+ * @file
+ * Miscellaneous functions for sending an email
+ *
+ * @authors
+ * Copyright (C) 2018 Richard Russon <rich@flatcap.org>
+ *
+ * @copyright
+ * This program is free software: you can redistribute it and/or modify it under
+ * the terms of the GNU General Public License as published by the Free Software
+ * Foundation, either version 2 of the License, or (at your option) any later
+ * version.
+ *
+ * This program is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+ * FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more
+ * details.
+ *
+ * You should have received a copy of the GNU General Public License along with
+ * this program.  If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#ifndef MUTT_SENDLIB_H
+#define MUTT_SENDLIB_H
+
+#include <stdbool.h>
+#include <stdio.h>
+
+struct Address;
+struct Body;
+struct Context;
+struct Envelope;
+struct Header;
+struct ListHead;
+struct ParameterList;
+
+char *          mutt_body_get_charset(struct Body *b, char *buf, size_t buflen);
+int             mutt_bounce_message(FILE *fp, struct Header *h, struct Address *to);
+const char *    mutt_fqdn(bool may_hide_host);
+void            mutt_generate_boundary(struct ParameterList *parm);
+struct Content *mutt_get_content_info(const char *fname, struct Body *b);
+int             mutt_invoke_sendmail(struct Address *from, struct Address *to, struct Address *cc, struct Address *bcc, const char *msg, int eightbit);
+int             mutt_lookup_mime_type(struct Body *att, const char *path);
+struct Body *   mutt_make_file_attach(const char *path);
+struct Body *   mutt_make_message_attach(struct Context *ctx, struct Header *hdr, bool attach_msg);
+struct Body *   mutt_make_multipart(struct Body *b);
+void            mutt_message_to_7bit(struct Body *a, FILE *fp);
+void            mutt_prepare_envelope(struct Envelope *env, bool final);
+struct Address *mutt_remove_duplicates(struct Address *addr);
+struct Body *   mutt_remove_multipart(struct Body *b);
+int             mutt_rfc822_write_header(FILE *fp, struct Envelope *env, struct Body *attach, int mode, bool privacy);
+void            mutt_stamp_attachment(struct Body *a);
+void            mutt_unprepare_envelope(struct Envelope *env);
+void            mutt_update_encoding(struct Body *a);
+void            mutt_write_address_list(struct Address *addr, FILE *fp, int linelen, bool display);
+int             mutt_write_fcc(const char *path, struct Header *hdr, const char *msgid, int post, char *fcc, char **finalpath);
+int             mutt_write_mime_body(struct Body *a, FILE *f);
+int             mutt_write_mime_header(struct Body *a, FILE *f);
+int             mutt_write_multiple_fcc(const char *path, struct Header *hdr, const char *msgid, int post, char *fcc, char **finalpath);
+int             mutt_write_one_header(FILE *fp, const char *tag, const char *value, const char *pfx, int wraplen, int flags);
+void            mutt_write_references(const struct ListHead *r, FILE *f, size_t trim);
+
+#endif /* MUTT_SENDLIB_H */
index 829a2b5ae31452a343cea92cc05ac0e21b3794a8..eb5f21f4f702013eec29d0d9069637e5c0828e20 100644 (file)
--- a/sidebar.c
+++ b/sidebar.c
@@ -44,6 +44,7 @@
 #include "mutt_curses.h"
 #include "mutt_menu.h"
 #include "mutt_window.h"
+#include "muttlib.h"
 #include "mx.h"
 #include "opcodes.h"
 #include "options.h"
diff --git a/sort.c b/sort.c
index 33467eaf27b0cdf09cc3de60c75ebb24cbfb084b..011d3b241603edbd257ceaeb747174563fc01e85 100644 (file)
--- a/sort.c
+++ b/sort.c
 #include "mutt/mutt.h"
 #include "email/email.h"
 #include "sort.h"
+#include "alias.h"
 #include "context.h"
 #include "globals.h"
+#include "mutt_logging.h"
 #include "mutt_thread.h"
 #include "options.h"
 #include "protos.h"
index 1f48b71a0fd86a6e1897f519245d7c6a11968e3e..eb73f2f63fd0c5c36eae0e794d7ce102bba1aff6 100644 (file)
--- a/status.c
+++ b/status.c
@@ -29,6 +29,7 @@
 #include "config.h"
 #include <stdio.h>
 #include "mutt/mutt.h"
+#include "buffy.h"
 #include "context.h"
 #include "format_flags.h"
 #include "globals.h"