Back to index

courier  0.68.2
maildir.h
Go to the documentation of this file.
00001 /*
00002 */
00003 #ifndef       maildir_h
00004 #define       maildir_h
00005 
00006 /*
00007 ** Copyright 1998 - 2002 Double Precision, Inc.  See COPYING for
00008 ** distribution information.
00009 */
00010 
00011 
00012 #if    HAVE_CONFIG_H
00013 #include      "config.h"
00014 #endif
00015 #include      <stdio.h>
00016 #include      <stdlib.h>
00017 #include      "folder.h"
00018 
00019 struct unicode_info;
00020 
00021 MSGINFO *maildir_ngetinfo(const char *);
00022 void maildir_nfreeinfo(MSGINFO *);
00023 
00024 extern void maildir_free(MSGINFO **, unsigned);
00025 extern void matches_free(MATCHEDSTR **, unsigned);
00026 
00027 
00028 extern void maildir_remcache(const char *);
00029 extern void maildir_reload(const char *);
00030 
00031 extern MSGINFO **maildir_read(const char *, unsigned,
00032        size_t *, int *, int *);
00033 extern void maildir_search(const char *dirname,
00034                         size_t pos,
00035                         const char *searchtxt,
00036                         const char *charset,
00037                         unsigned nfiles);
00038 
00039 extern void maildir_loadsearch(unsigned nfiles,
00040                             MSGINFO ***retmsginfo,
00041                             MATCHEDSTR ***retmatches,
00042                             unsigned long *last_message_searched);
00043 
00044 extern void maildir_count(const char *, unsigned *, unsigned *);
00045 
00046 extern char *maildir_basename(const char *);
00047 extern char *maildir_find(const char *, const char *);
00048 extern char *maildir_posfind(const char *, size_t *);
00049 extern int maildir_name2pos(const char *, const char *, size_t *);
00050 
00051 extern char maildirfile_type(const char *);
00052 extern void maildir_markread(const char *, size_t);
00053 extern void maildir_markreplied(const char *, const char *);
00054 extern void maildir_msgdeletefile(const char *, const char *, size_t);
00055 extern void maildir_msgpurge(const char *, size_t);
00056 extern void maildir_msgpurgefile(const char *, const char *);
00057 extern void maildir_purgemimegpg();
00058 extern void maildir_purgesearch();
00059 
00060 extern int maildir_msgmove(const char *, size_t, const char *);
00061 extern int maildir_msgmovefile(const char *, const char *, const char *, size_t);
00062 extern void maildir_autopurge();
00063 extern char *maildir_readheader(FILE *, char **, int);
00064 extern char *maildir_readheader_mimepart(FILE *, char **, int,
00065                                    off_t *, const off_t *);
00066 extern char *maildir_readline(FILE *);
00067 extern char *maildir_readheader_nolc(FILE *, char **);
00068 
00069 extern void maildir_listfolders(const char *inbox_name,
00070                             const char *homedir, char ***);
00071 extern void maildir_readfolders(char ***);
00072 extern void maildir_freefolders(char ***);
00073 extern int maildir_create(const char *);
00074 extern int maildir_delete(const char *, int);
00075 extern int maildir_rename_wrapper(const char *, const char *);
00076 
00077 extern int maildir_createmsg(const char *, const char *, char **);
00078 extern int maildir_recreatemsg(const char *, const char *, char **);
00079 extern void maildir_writemsg(int, const char *, size_t);
00080 extern void maildir_writemsgstr(int, const char *);
00081 extern int maildir_closemsg(int, const char *, const char *, int,
00082        unsigned long);
00083 extern void listrights();
00084 extern void getacl();
00085 
00086 /*
00087 ** Hack: to correctly set Content-Transfer-Encoding: header on sent mail,
00088 ** the message is written out with the header set to 7bit, but the file
00089 ** position of "7bit" is saved. writemsg notes if there were any 8bit
00090 ** characters, and, if necessary, we reseek and change the header in place!
00091 */
00092 
00093 extern off_t  writebufpos;  /* File position updated by writemsg */
00094 extern int    writebuf8bit; /* 8 bit character flag */
00095 
00096 extern int maildir_writemsg_flush(int);
00097 extern void maildir_deletenewmsg(int n, const char *, const char *);
00098 extern unsigned maildir_countof(const char *);
00099 extern void maildir_savefoldermsgs(const char *);
00100 
00101 /*
00102 ** Convert folder names to modified-UTF7.
00103 */
00104 
00105 extern char *folder_toutf7(const char *);
00106 extern char *folder_fromutf7(const char *);
00107 
00108 /*
00109 ** Cache kept in the Maildir directory of the sorted contents of the cur
00110 ** subdirectory.
00111 */
00112 
00113 #define       MAILDIRCURCACHE      "sqwebmail-curcache"
00114 
00115 /*
00116 ** Another cache file, but just of message counts in maildir/cur.
00117 */
00118 
00119 #define       MAILDIRCOUNTCACHE "sqwebmail-curcnt"
00120 
00121 #endif