From 841a368ddea400022328f35dd8c7a3eb6f543892 Mon Sep 17 00:00:00 2001 From: pdmef Date: Mon, 8 Aug 2005 12:43:11 +0000 Subject: [PATCH] Rocco Rutte: - move more data structures + prototypes to dedicated source files, still much more to come git-svn-id: svn://svn.berlios.de/mutt-ng/trunk@383 e385b8ad-14ed-0310-8656-cc95a2468c6d --- attach.h | 31 ++++++++++++++++++++++++++++++- browser.c | 2 ++ handler.c | 1 + hcache.c | 11 +++++------ hcache.h | 14 ++++++++++++++ imap/message.c | 1 + mh.c | 1 + mutt.h | 9 --------- mutt_menu.h | 5 ++++- muttlib.c | 1 + pager.h | 6 ++++++ pgp.c | 1 + protos.h | 28 +--------------------------- rfc1524.c | 1 + send.c | 1 + 15 files changed, 69 insertions(+), 44 deletions(-) create mode 100644 hcache.h diff --git a/attach.h b/attach.h index b1e6eec..3bc1b82 100644 --- a/attach.h +++ b/attach.h @@ -6,8 +6,19 @@ * It's licensed under the GNU General Public License, * please see the file GPL in the top level source directory. */ +#ifndef _MUTT_ATTACH_H +#define _MUTT_ATTACH_H -/* common protos for compose / attach menus */ +#include "mutt_menu.h" + +typedef struct attachptr { + BODY *content; + int parent_type; + char *tree; + int level; + int num; + unsigned int unowned:1; /* don't unlink on detach */ +} ATTACHPTR; int mutt_tag_attach (MUTTMENU * menu, int n, int m); int mutt_attach_display_loop (MUTTMENU * menu, int op, FILE * fp, @@ -24,3 +35,21 @@ void mutt_attach_bounce (FILE *, HEADER *, ATTACHPTR **, short, BODY *); void mutt_attach_resend (FILE *, HEADER *, ATTACHPTR **, short, BODY *); void mutt_attach_forward (FILE *, HEADER *, ATTACHPTR **, short, BODY *, int); void mutt_attach_reply (FILE *, HEADER *, ATTACHPTR **, short, BODY *, int); + +ATTACHPTR **mutt_gen_attach_list (BODY *, int, ATTACHPTR **, short *, short *, + int, int); + +void mutt_update_tree (ATTACHPTR **, short); + +int mutt_print_attachment (FILE *, BODY *); +int mutt_decode_save_attachment (FILE *, BODY *, char *, int, int); +int mutt_save_attachment (FILE *, BODY *, char *, int, HEADER *); +int mutt_pipe_attachment (FILE *, BODY *, const char *, char *); +int mutt_view_attachment (FILE *, BODY *, int, HEADER *, ATTACHPTR **, short); +int mutt_is_autoview (BODY *, const char *); +void mutt_check_lookup_list (BODY *, char *, int); +int mutt_edit_attachment (BODY *); +int mutt_compose_attachment (BODY * a); +int mutt_get_tmp_attachment (BODY *); + +#endif /* !_MUTT_ATTACH_H */ diff --git a/browser.c b/browser.c index d4a7157..3ed8a11 100644 --- a/browser.c +++ b/browser.c @@ -19,6 +19,8 @@ #include "mapping.h" #include "sort.h" #include "browser.h" +#include "attach.h" + #ifdef USE_IMAP #include "imap.h" #include "imap/mx_imap.h" diff --git a/handler.c b/handler.c index 521bcc3..4ba746c 100644 --- a/handler.c +++ b/handler.c @@ -27,6 +27,7 @@ #include "charset.h" #include "mutt_crypt.h" #include "state.h" +#include "attach.h" #include "lib.h" #include "lib/mem.h" diff --git a/hcache.c b/hcache.c index 93b84de..1a86d4c 100644 --- a/hcache.c +++ b/hcache.c @@ -8,6 +8,11 @@ * It's licensed under the GNU General Public License, * please see the file GPL in the top level source directory. */ +#if HAVE_CONFIG_H +#include "config.h" +#endif /* HAVE_CONFIG_H */ + +#ifdef USE_HCACHE # if HAVE_INTTYPES_H # include @@ -17,12 +22,6 @@ # endif # endif -#if HAVE_CONFIG_H -#include "config.h" -#endif /* HAVE_CONFIG_H */ - -#ifdef USE_HCACHE - #if HAVE_QDBM #include #include diff --git a/hcache.h b/hcache.h new file mode 100644 index 0000000..e042454 --- /dev/null +++ b/hcache.h @@ -0,0 +1,14 @@ +/* + * Copyright notice from original mutt: + * Copyright (C) 2004 Thomas Glanzmann + * Copyright (C) 2004 Tobias Werth + * Copyright (C) 2004 Brian Fundakowski Feldman + * + * This file is part of mutt-ng, see http://www.muttng.org/. + * It's licensed under the GNU General Public License, + * please see the file GPL in the top level source directory. + */ +#ifndef _MUTT_HCACHE_H +#define _MUTT_HCACHE_H + +#endif /* !_MUTT_HCACHE_H */ diff --git a/imap/message.c b/imap/message.c index 416ca73..e4e7361 100644 --- a/imap/message.c +++ b/imap/message.c @@ -22,6 +22,7 @@ #include "imap_private.h" #include "message.h" #include "mx.h" +#include "hcache.h" #ifdef HAVE_PGP #include "pgp.h" diff --git a/mh.c b/mh.c index c062eb9..4b03ef8 100644 --- a/mh.c +++ b/mh.c @@ -24,6 +24,7 @@ #include "copy.h" #include "buffy.h" #include "sort.h" +#include "hcache.h" #include "lib/mem.h" #include "lib/intl.h" diff --git a/mutt.h b/mutt.h index 03fe55b..8131c7d 100644 --- a/mutt.h +++ b/mutt.h @@ -870,15 +870,6 @@ typedef struct { unsigned int counting:1; /* do we just want to cound? */ } CONTEXT; -typedef struct attachptr { - BODY *content; - int parent_type; - char *tree; - int level; - int num; - unsigned int unowned:1; /* don't unlink on detach */ -} ATTACHPTR; - #include "ascii.h" #include "alias.h" #include "buffer.h" diff --git a/mutt_menu.h b/mutt_menu.h index db7250a..1c9e2be 100644 --- a/mutt_menu.h +++ b/mutt_menu.h @@ -6,7 +6,8 @@ * It's licensed under the GNU General Public License, * please see the file GPL in the top level source directory. */ - +#ifndef _MUTT_MENU_H +#define _MUTT_MENU_H /* * This file is named mutt_menu.h so it doesn't collide with ncurses menu.h */ @@ -100,3 +101,5 @@ int mutt_menuLoop (MUTTMENU *); /* used in both the index and pager index to make an entry. */ void index_make_entry (char *, size_t, struct menu_t *, int); int index_color (int); + +#endif /* !_MUTT_MENU_H */ diff --git a/muttlib.c b/muttlib.c index c037f76..bc659a7 100644 --- a/muttlib.c +++ b/muttlib.c @@ -17,6 +17,7 @@ #include "mime.h" #include "mx.h" #include "url.h" +#include "attach.h" #include "reldate.h" diff --git a/pager.h b/pager.h index f24f91e..7520620 100644 --- a/pager.h +++ b/pager.h @@ -6,6 +6,10 @@ * It's licensed under the GNU General Public License, * please see the file GPL in the top level source directory. */ +#ifndef _MUTT_PAGER_H +#define _MUTT_PAGER_H + +#include "attach.h" /* dynamic internal flags */ #define M_SHOWFLAT (1<<0) @@ -35,3 +39,5 @@ typedef struct { int mutt_do_pager (const char *, const char *, int, pager_t *); int mutt_pager (const char *, const char *, int, pager_t *); + +#endif /* !_MUTT_PAGER_H */ diff --git a/pgp.c b/pgp.c index 995ec13..7fdd5e9 100644 --- a/pgp.c +++ b/pgp.c @@ -26,6 +26,7 @@ #include "pgp.h" #include "mime.h" #include "copy.h" +#include "attach.h" #include "lib/mem.h" #include "lib/intl.h" diff --git a/protos.h b/protos.h index 5136460..8638e6a 100644 --- a/protos.h +++ b/protos.h @@ -96,22 +96,6 @@ int mutt_cmp_env (const ENVELOPE * e1, const ENVELOPE * e2); int mutt_cmp_param (const PARAMETER * p1, const PARAMETER * p2); int mutt_cmp_body (const BODY * b1, const BODY * b2); -#if USE_HCACHE -void *mutt_hcache_open (const char *path, const char *folder); -void mutt_hcache_close (void *db); -HEADER *mutt_hcache_restore (const unsigned char *d, HEADER ** oh); -void *mutt_hcache_fetch (void *db, const char *filename, - size_t (*keylen) (const char *fn)); -int mutt_hcache_store (void *db, const char *filename, HEADER * h, - unsigned long uid_validity, - size_t (*keylen) (const char *fn)); -int mutt_hcache_delete (void *db, const char *filename, - size_t (*keylen) (const char *fn)); -#endif /* USE_HCACHE */ - -ATTACHPTR **mutt_gen_attach_list (BODY *, int, ATTACHPTR **, short *, short *, - int, int); - time_t mutt_decrease_mtime (const char *, struct stat *); time_t mutt_local_tz (time_t); time_t mutt_mktime (struct tm *, int); @@ -189,7 +173,6 @@ void mutt_free_parameter (PARAMETER **); void mutt_generate_header (char *, size_t, HEADER *, int); void mutt_help (int); void mutt_draw_tree (CONTEXT *); -void mutt_check_lookup_list (BODY *, char *, int); void mutt_make_attribution (CONTEXT * ctx, HEADER * cur, FILE * out); void mutt_make_forward_subject (ENVELOPE * env, CONTEXT * ctx, HEADER * cur); void mutt_make_help (char *, size_t, char *, int, int); @@ -237,7 +220,6 @@ void mutt_tag_set_flag (int, int); void mutt_unblock_signals (void); void mutt_unblock_signals_system (int); void mutt_update_encoding (BODY * a); -void mutt_update_tree (ATTACHPTR **, short); void mutt_version (void); void mutt_view_attachments (HEADER *); void mutt_write_references (LIST *, FILE *); @@ -262,12 +244,10 @@ int mutt_check_traditional_pgp (HEADER *, int *); int mutt_command_complete (char *, size_t, int, int); int mutt_var_value_complete (char *, size_t, int); int mutt_complete (char *, size_t); -int mutt_compose_attachment (BODY * a); int mutt_copy_body (FILE *, BODY **, BODY *); -int mutt_decode_save_attachment (FILE *, BODY *, char *, int, int); + int mutt_display_message (HEADER * h); int mutt_dump_variables (void); -int mutt_edit_attachment (BODY *); int mutt_edit_message (CONTEXT *, HEADER *); int mutt_fetch_recips (ENVELOPE * out, ENVELOPE * in, int flags); int mutt_chscmp (const char *s, const char *chs); @@ -286,11 +266,9 @@ int _mutt_get_field (char *, char *, size_t, int, int, char ***, int *); int mutt_get_field_unbuffered (char *, char *, size_t, int); int mutt_get_hook_type (const char *); int mutt_get_postponed (CONTEXT *, HEADER *, HEADER **, char *, size_t); -int mutt_get_tmp_attachment (BODY *); int mutt_index_menu (void); int mutt_invoke_mta (ADDRESS *, ADDRESS *, ADDRESS *, ADDRESS *, const char *, int); -int mutt_is_autoview (BODY *, const char *); int mutt_is_mail_list (ADDRESS *); int mutt_is_message_type (int, const char *); int mutt_is_list_cc (int, ADDRESS *, ADDRESS *); @@ -322,11 +300,8 @@ int mutt_parse_score (BUFFER *, BUFFER *, unsigned long, BUFFER *); int mutt_parse_unscore (BUFFER *, BUFFER *, unsigned long, BUFFER *); int mutt_parse_unhook (BUFFER *, BUFFER *, unsigned long, BUFFER *); int mutt_pattern_func (int, char *); -int mutt_pipe_attachment (FILE *, BODY *, const char *, char *); -int mutt_print_attachment (FILE *, BODY *); int mutt_query_complete (char *, size_t); int mutt_query_variables (LIST * queries); -int mutt_save_attachment (FILE *, BODY *, char *, int, HEADER *); int _mutt_save_message (HEADER *, CONTEXT *, int, int, int); int mutt_save_message (HEADER *, int, int, int, int *); int mutt_search_command (int, int); @@ -337,7 +312,6 @@ int mutt_thread_set_flag (HEADER *, int, int, int); int mutt_update_list_file (char *, char *, char *, char *); int mutt_user_is_recipient (HEADER *); void mutt_update_num_postponed (void); -int mutt_view_attachment (FILE *, BODY *, int, HEADER *, ATTACHPTR **, short); int mutt_wait_filter (pid_t); int mutt_which_case (const char *); int mutt_write_fcc (const char *path, HEADER * hdr, const char *msgid, int, diff --git a/rfc1524.c b/rfc1524.c index 7d54477..ad98954 100644 --- a/rfc1524.c +++ b/rfc1524.c @@ -23,6 +23,7 @@ #include "mutt.h" #include "rfc1524.h" +#include "attach.h" #include "lib/mem.h" #include "lib/intl.h" diff --git a/send.c b/send.c index 704b53b..9f741ed 100644 --- a/send.c +++ b/send.c @@ -21,6 +21,7 @@ #include "mutt_crypt.h" #include "mutt_idna.h" #include "url.h" +#include "attach.h" #include "lib/mem.h" #include "lib/intl.h" -- 2.20.1