From 955776dfade51c074cac1ee3fb7a5a0ad5150aa9 Mon Sep 17 00:00:00 2001 From: Richard Russon Date: Sat, 7 Jul 2018 23:50:13 +0100 Subject: [PATCH] split protos.h 1 --- alias.h | 6 ++++ browser.c | 1 + browser.h | 3 ++ buffy.h | 7 +++++ color.h | 37 +++++++++++++++++++++++ commands.c | 2 ++ commands.h | 47 +++++++++++++++++++++++++++++ compose.c | 1 + conn/ssl.c | 1 + curs_lib.c | 2 ++ curs_lib.h | 52 ++++++++++++++++++++++++++++++++ curs_main.c | 3 ++ enter.c | 3 ++ handler.c | 3 ++ hdrline.c | 1 + hook.c | 1 + hook.h | 47 +++++++++++++++++++++++++++++ imap/auth_plain.c | 1 + imap/browse.c | 1 + imap/command.c | 1 + imap/message.c | 1 + init.h | 1 + keymap.c | 1 + keymap.h | 5 ++++ main.c | 1 + menu.c | 1 + mutt.h | 19 ++++++++++-- mutt_attach.c | 2 ++ mutt_attach.h | 9 ++++++ mutt_body.c | 1 + mutt_logging.h | 2 ++ muttlib.h | 63 +++++++++++++++++++++++++++++++++++++++ mx.c | 1 + ncrypt/crypt_gpgme.c | 3 ++ ncrypt/pgp.c | 1 + ncrypt/pgpinvoke.c | 1 + ncrypt/pgpkey.c | 2 ++ ncrypt/smime.c | 1 + nntp/newsrc.c | 1 + notmuch/mutt_notmuch.c | 1 + pager.c | 3 ++ pager.h | 2 ++ parse.c | 1 + parse.h | 48 ++++++++++++++++++++++++++++++ pattern.c | 2 ++ pop/pop.c | 1 + pop/pop_lib.c | 1 + postpone.c | 1 + progress.c | 1 + protos.h | 67 ------------------------------------------ query.c | 1 + recvattach.c | 2 ++ recvattach.h | 6 ++++ recvcmd.c | 2 ++ remailer.c | 1 + rfc1524.c | 1 + send.c | 2 ++ send.h | 51 ++++++++++++++++++++++++++++++++ sendlib.c | 1 + sendlib.h | 63 +++++++++++++++++++++++++++++++++++++++ sidebar.c | 1 + sort.c | 2 ++ status.c | 1 + 63 files changed, 529 insertions(+), 69 deletions(-) create mode 100644 color.h create mode 100644 commands.h create mode 100644 curs_lib.h create mode 100644 hook.h create mode 100644 muttlib.h create mode 100644 parse.h create mode 100644 send.h create mode 100644 sendlib.h diff --git a/alias.h b/alias.h index 69e4a1b45..26114d682 100644 --- 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 */ diff --git a/browser.c b/browser.c index ce2e73ef8..76bcd8188 100644 --- 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" diff --git a/browser.h b/browser.h index 34a8e7f5c..8f8c9eb33 100644 --- 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 55d2468c2..5e421881f 100644 --- 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 index 000000000..bfc96a5e7 --- /dev/null +++ b/color.h @@ -0,0 +1,37 @@ +/** + * @file + * Color and attribute parsing + * + * @authors + * Copyright (C) 2018 Richard Russon + * + * @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 . + */ + +#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 */ diff --git a/commands.c b/commands.c index 9a7377f0d..360026b7e 100644 --- a/commands.c +++ b/commands.c @@ -43,8 +43,10 @@ #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 index 000000000..33d3f9dcf --- /dev/null +++ b/commands.h @@ -0,0 +1,47 @@ +/** + * @file + * Manage where the email is piped to external commands + * + * @authors + * Copyright (C) 2018 Richard Russon + * + * @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 . + */ + +#ifndef MUTT_COMMANDS_H +#define MUTT_COMMANDS_H + +#include + +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 */ diff --git a/compose.c b/compose.c index 09836d157..66d53cabf 100644 --- 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" diff --git a/conn/ssl.c b/conn/ssl.c index 38582463e..e1915d799 100644 --- a/conn/ssl.c +++ b/conn/ssl.c @@ -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" diff --git a/curs_lib.c b/curs_lib.c index 5fc5ea4db..614ed9aee 100644 --- a/curs_lib.c +++ b/curs_lib.c @@ -39,10 +39,12 @@ #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 index 000000000..8e674a2dc --- /dev/null +++ b/curs_lib.h @@ -0,0 +1,52 @@ +/** + * @file + * GUI miscellaneous curses (window drawing) routines + * + * @authors + * Copyright (C) 2018 Richard Russon + * + * @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 . + */ + +#ifndef MUTT_CURS_LIB_H +#define MUTT_CURS_LIB_H + +#include +#include +#include + +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 */ diff --git a/curs_main.c b/curs_main.c index f1f60fa47..7773ae85f 100644 --- a/curs_main.c +++ b/curs_main.c @@ -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 eda4a51a0..37ddc2f82 100644 --- a/enter.c +++ b/enter.c @@ -35,6 +35,9 @@ #include #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" diff --git a/handler.c b/handler.c index 0f2a1be4d..9aac9d22a 100644 --- a/handler.c +++ b/handler.c @@ -41,10 +41,13 @@ #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" diff --git a/hdrline.c b/hdrline.c index a6528cca8..d93a8483c 100644 --- 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 442d0dc0a..a6cb0035f 100644 --- 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 index 000000000..163d48ff5 --- /dev/null +++ b/hook.h @@ -0,0 +1,47 @@ +/** + * @file + * Parse and execute user-defined hooks + * + * @authors + * Copyright (C) 2018 Richard Russon + * + * @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 . + */ + +#ifndef MUTT_HOOK_H +#define MUTT_HOOK_H + +#include + +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 */ diff --git a/imap/auth_plain.c b/imap/auth_plain.c index 6813a1c87..3b96158ac 100644 --- a/imap/auth_plain.c +++ b/imap/auth_plain.c @@ -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" diff --git a/imap/browse.c b/imap/browse.c index e071c765b..babc8b30b 100644 --- a/imap/browse.c +++ b/imap/browse.c @@ -42,6 +42,7 @@ #include "context.h" #include "globals.h" #include "imap/imap.h" +#include "mutt_logging.h" #include "options.h" #include "protos.h" diff --git a/imap/command.c b/imap/command.c index f849a64e6..ec0abd329 100644 --- a/imap/command.c +++ b/imap/command.c @@ -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" diff --git a/imap/message.c b/imap/message.c index 245677299..d68856dbd 100644 --- a/imap/message.c +++ b/imap/message.c @@ -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 9d52b2325..105af56f3 100644 --- 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" diff --git a/keymap.c b/keymap.c index 4f62e43d0..e2efdceff 100644 --- 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" diff --git a/keymap.h b/keymap.h index 41ff761c4..bfc99d714 100644 --- 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 7a616b78d..bc588be90 100644 --- 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 5082fcb79..448a611cd 100644 --- 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 48a74aa46..469288b4d 100644 --- a/mutt.h +++ b/mutt.h @@ -30,6 +30,7 @@ #include #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 */ diff --git a/mutt_attach.c b/mutt_attach.c index 40e47ca3c..b58816fed 100644 --- a/mutt_attach.c +++ b/mutt_attach.c @@ -40,12 +40,14 @@ #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" diff --git a/mutt_attach.h b/mutt_attach.h index 24f4ccbdf..77bf23825 100644 --- a/mutt_attach.h +++ b/mutt_attach.h @@ -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 */ diff --git a/mutt_body.c b/mutt_body.c index 0ea066178..fb0f0900c 100644 --- a/mutt_body.c +++ b/mutt_body.c @@ -33,6 +33,7 @@ #include #include "mutt/mutt.h" #include "email/email.h" +#include "mutt_attach.h" #include "protos.h" /** diff --git a/mutt_logging.h b/mutt_logging.h index e8901647a..1daf5a85a 100644 --- a/mutt_logging.h +++ b/mutt_logging.h @@ -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 index 000000000..98fbfd68d --- /dev/null +++ b/muttlib.h @@ -0,0 +1,63 @@ +/** + * @file + * Some miscellaneous functions + * + * @authors + * Copyright (C) 2018 Richard Russon + * + * @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 . + */ + +#ifndef MUTT_MUTTLIB_H +#define MUTT_MUTTLIB_H + +#include +#include +#include +#include + +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 e1cb8ce8a..594c9ad6c 100644 --- 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" diff --git a/ncrypt/crypt_gpgme.c b/ncrypt/crypt_gpgme.c index 9b03803a9..7cdd4c6cd 100644 --- a/ncrypt/crypt_gpgme.c +++ b/ncrypt/crypt_gpgme.c @@ -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 diff --git a/ncrypt/pgp.c b/ncrypt/pgp.c index 4e27bd077..60a119801 100644 --- a/ncrypt/pgp.c +++ b/ncrypt/pgp.c @@ -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" diff --git a/ncrypt/pgpinvoke.c b/ncrypt/pgpinvoke.c index 8fb36d9fd..4e022bb53 100644 --- a/ncrypt/pgpinvoke.c +++ b/ncrypt/pgpinvoke.c @@ -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" diff --git a/ncrypt/pgpkey.c b/ncrypt/pgpkey.c index 046d2df5d..247f7a4a2 100644 --- a/ncrypt/pgpkey.c +++ b/ncrypt/pgpkey.c @@ -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" /** diff --git a/ncrypt/smime.c b/ncrypt/smime.c index d199ed6a6..6ee641d33 100644 --- a/ncrypt/smime.c +++ b/ncrypt/smime.c @@ -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" diff --git a/nntp/newsrc.c b/nntp/newsrc.c index 3f38d3d80..26e082e5e 100644 --- a/nntp/newsrc.c +++ b/nntp/newsrc.c @@ -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" diff --git a/notmuch/mutt_notmuch.c b/notmuch/mutt_notmuch.c index 906c3f1e5..66b29710c 100644 --- a/notmuch/mutt_notmuch.c +++ b/notmuch/mutt_notmuch.c @@ -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 470ed2a7a..0483181b0 100644 --- 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 0cdc0e741..c78d5a7b5 100644 --- 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 e39a20fa0..3e371d326 100644 --- 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 index 000000000..1895bfeb7 --- /dev/null +++ b/parse.h @@ -0,0 +1,48 @@ +/** + * @file + * Miscellaneous email parsing routines + * + * @authors + * Copyright (C) 2018 Richard Russon + * + * @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 . + */ + +#ifndef MUTT_PARSE_H +#define MUTT_PARSE_H + +#include +#include + +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 */ diff --git a/pattern.c b/pattern.c index 154fe34d3..494cc4189 100644 --- a/pattern.c +++ b/pattern.c @@ -36,12 +36,14 @@ #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" diff --git a/pop/pop.c b/pop/pop.c index a1e38efc4..ed7a2e3f3 100644 --- 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" diff --git a/pop/pop_lib.c b/pop/pop_lib.c index 454da66a4..60cda4707 100644 --- a/pop/pop_lib.c +++ b/pop/pop_lib.c @@ -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" diff --git a/postpone.c b/postpone.c index 7e4d748a4..4d492cca0 100644 --- a/postpone.c +++ b/postpone.c @@ -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" diff --git a/progress.c b/progress.c index 34a471050..44c59a519 100644 --- a/progress.c +++ b/progress.c @@ -34,6 +34,7 @@ #include #include "mutt/mutt.h" #include "mutt.h" +#include "mutt_logging.h" #include "progress.h" #include "globals.h" #include "mutt_curses.h" diff --git a/protos.h b/protos.h index 346d318f2..cd4f3ba12 100644 --- a/protos.h +++ b/protos.h @@ -25,18 +25,14 @@ #define _MUTT_PROTOS_H #include -#include -#include #include #include #include #include -#include #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 d4e19c63b..4c0775cf3 100644 --- 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" diff --git a/recvattach.c b/recvattach.c index 67c6f90d2..f4f61c105 100644 --- a/recvattach.c +++ b/recvattach.c @@ -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" diff --git a/recvattach.h b/recvattach.h index 7317d29ec..5093e658e 100644 --- a/recvattach.h +++ b/recvattach.h @@ -24,9 +24,15 @@ #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 */ diff --git a/recvcmd.c b/recvcmd.c index 5a079afc1..e53de5409 100644 --- a/recvcmd.c +++ b/recvcmd.c @@ -33,9 +33,11 @@ #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 diff --git a/remailer.c b/remailer.c index 5f6a17465..a1d94ae75 100644 --- a/remailer.c +++ b/remailer.c @@ -40,6 +40,7 @@ #include "opcodes.h" #include "options.h" #include "protos.h" +#include "recvattach.h" /** * struct Coord - Screen coordinates diff --git a/rfc1524.c b/rfc1524.c index 7bd45de8b..9c526353d 100644 --- 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 76756006f..f18c0f614 100644 --- 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 index 000000000..9c02661a0 --- /dev/null +++ b/send.h @@ -0,0 +1,51 @@ +/** + * @file + * Prepare and send an email + * + * @authors + * Copyright (C) 2018 Richard Russon + * + * @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 . + */ + +#ifndef MUTT_SEND_H +#define MUTT_SEND_H + +#include + +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 */ diff --git a/sendlib.c b/sendlib.c index 78cb889bd..6dfad3bc6 100644 --- 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 index 000000000..fe2243bfb --- /dev/null +++ b/sendlib.h @@ -0,0 +1,63 @@ +/** + * @file + * Miscellaneous functions for sending an email + * + * @authors + * Copyright (C) 2018 Richard Russon + * + * @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 . + */ + +#ifndef MUTT_SENDLIB_H +#define MUTT_SENDLIB_H + +#include +#include + +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 */ diff --git a/sidebar.c b/sidebar.c index 829a2b5ae..eb5f21f4f 100644 --- 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 33467eaf2..011d3b241 100644 --- a/sort.c +++ b/sort.c @@ -27,8 +27,10 @@ #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" diff --git a/status.c b/status.c index 1f48b71a0..eb73f2f63 100644 --- a/status.c +++ b/status.c @@ -29,6 +29,7 @@ #include "config.h" #include #include "mutt/mutt.h" +#include "buffy.h" #include "context.h" #include "format_flags.h" #include "globals.h" -- 2.40.0