1 #ifndef maildircreate_h 2 #define maildircreate_h 3 4 /* 5 ** Copyright 1998 - 2003 Double Precision, Inc. 6 ** See COPYING for distribution information. 7 */ 8 9 #if HAVE_CONFIG_H 10 #include "config.h" 11 #endif 12 13 #include <stdio.h> 14 15 #ifdef __cplusplus 16 extern "C" { 17 #endif 18 19 20 /* Create messages in maildirs */ 21 22 struct maildir_tmpcreate_info { 23 const char *maildir; 24 unsigned long msgsize; /* If known, 0 otherwise (must use requota later)*/ 25 const char *uniq; /* You need when creating multiple msgs */ 26 const char *hostname; /* If known, NULL otherwise */ 27 int openmode; /* Default open mode */ 28 int doordie; /* Loop until we get it right. */ 29 char *tmpname; /* On exit, filename in tmp */ 30 char *newname; /* On exit, filename in new */ 31 char *curname; /* On exit, filename in cur */ 32 }; 33 34 #define maildir_tmpcreate_init(i) \ 35 do \ 36 { \ 37 memset( (i), 0, sizeof(*(i))); \ 38 (i)->openmode=0644; \ 39 } while(0) 40 41 int maildir_tmpcreate_fd(struct maildir_tmpcreate_info *); 42 FILE *maildir_tmpcreate_fp(struct maildir_tmpcreate_info *); 43 void maildir_tmpcreate_free(struct maildir_tmpcreate_info *); 44 45 /* Move created message from tmp to new */ 46 int maildir_movetmpnew(const char *tmpname, const char *newname); 47 48 #ifdef __cplusplus 49 } 50 #endif 51 52 #endif 53