Rocco Rutte:
authorpdmef <pdmef@e385b8ad-14ed-0310-8656-cc95a2468c6d>
Mon, 8 Aug 2005 12:43:11 +0000 (12:43 +0000)
committerpdmef <pdmef@e385b8ad-14ed-0310-8656-cc95a2468c6d>
Mon, 8 Aug 2005 12:43:11 +0000 (12:43 +0000)
- 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

15 files changed:
attach.h
browser.c
handler.c
hcache.c
hcache.h [new file with mode: 0644]
imap/message.c
mh.c
mutt.h
mutt_menu.h
muttlib.c
pager.h
pgp.c
protos.h
rfc1524.c
send.c

index b1e6eec..3bc1b82 100644 (file)
--- 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 */
index d4a7157..3ed8a11 100644 (file)
--- 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"
index 521bcc3..4ba746c 100644 (file)
--- 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"
index 93b84de..1a86d4c 100644 (file)
--- 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 <inttypes.h>
 #  endif
 # endif
 
-#if HAVE_CONFIG_H
-#include "config.h"
-#endif /* HAVE_CONFIG_H */
-
-#ifdef USE_HCACHE
-
 #if HAVE_QDBM
 #include <depot.h>
 #include <cabin.h>
diff --git a/hcache.h b/hcache.h
new file mode 100644 (file)
index 0000000..e042454
--- /dev/null
+++ b/hcache.h
@@ -0,0 +1,14 @@
+/*
+ * Copyright notice from original mutt:
+ * Copyright (C) 2004 Thomas Glanzmann <sithglan@stud.uni-erlangen.de>
+ * Copyright (C) 2004 Tobias Werth <sitowert@stud.uni-erlangen.de>
+ * Copyright (C) 2004 Brian Fundakowski Feldman <green@FreeBSD.org>
+ *
+ * This file is part of mutt-ng, see http://www.muttng.org/.
+ * It's licensed under the GNU General Public License,
+ * please see the file GPL in the top level source directory.
+ */
+#ifndef _MUTT_HCACHE_H
+#define _MUTT_HCACHE_H
+
+#endif /* !_MUTT_HCACHE_H */
index 416ca73..e4e7361 100644 (file)
@@ -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 (file)
--- 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 (file)
--- 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"
index db7250a..1c9e2be 100644 (file)
@@ -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 */
index c037f76..bc659a7 100644 (file)
--- 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 (file)
--- 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 (file)
--- 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"
index 5136460..8638e6a 100644 (file)
--- 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,
index 7d54477..ad98954 100644 (file)
--- 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 (file)
--- 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"