comparison src/readpst.c @ 34:07177825c91b

fix signed/unsigned to allow very small pst files with only leaf nodes
author carl
date Thu, 12 Jul 2007 14:59:13 -0700
parents 12cac756bc05
children 6fe121a971c9
comparison
equal deleted inserted replaced
33:12cac756bc05 34:07177825c91b
61 int32_t skip_count; 61 int32_t skip_count;
62 int32_t type; 62 int32_t type;
63 struct file_ll *next; 63 struct file_ll *next;
64 }; 64 };
65 65
66 void write_email_body(FILE *f, char *body); 66 void write_email_body(FILE *f, char *body);
67 char *removeCR (char *c); 67 char* removeCR (char *c);
68 int32_t usage(); 68 int32_t usage();
69 int32_t version(); 69 int32_t version();
70 char *mk_kmail_dir(char*); 70 char* mk_kmail_dir(char*);
71 int32_t close_kmail_dir(); 71 int32_t close_kmail_dir();
72 char *mk_recurse_dir(char*); 72 char* mk_recurse_dir(char*);
73 int32_t close_recurse_dir(); 73 int32_t close_recurse_dir();
74 char *mk_seperate_dir(char *dir, int overwrite); 74 char* mk_seperate_dir(char *dir, int overwrite);
75 int32_t close_seperate_dir(); 75 int32_t close_seperate_dir();
76 int32_t mk_seperate_file(struct file_ll *f); 76 int32_t mk_seperate_file(struct file_ll *f);
77 char *my_stristr(char *haystack, char *needle); 77 char* my_stristr(char *haystack, char *needle);
78 char *check_filename(char *fname); 78 char* check_filename(char *fname);
79 char *rfc2426_escape(char *str); 79 char* rfc2426_escape(char *str);
80 int32_t chr_count(char *str, char x); 80 int32_t chr_count(char *str, char x);
81 char *rfc2425_datetime_format(FILETIME *ft); 81 char* rfc2425_datetime_format(FILETIME *ft);
82 char *rfc2445_datetime_format(FILETIME *ft); 82 char* rfc2445_datetime_format(FILETIME *ft);
83 char *skip_header_prologue(char *headers); 83 char* skip_header_prologue(char *headers);
84 void write_separate_attachment(char f_name[], pst_item_attach* current_attach, int attach_num, pst_file* pst); 84 void write_separate_attachment(char f_name[], pst_item_attach* current_attach, int attach_num, pst_file* pst);
85 void write_inline_attachment(FILE* f_output, pst_item_attach* current_attach, char boundary[], pst_file* pst); 85 void write_inline_attachment(FILE* f_output, pst_item_attach* current_attach, char boundary[], pst_file* pst);
86 void write_normal_email(FILE* f_output, char f_name[], pst_item* item, int mode, int mode_MH, pst_file* pst, int save_rtf); 86 void write_normal_email(FILE* f_output, char f_name[], pst_item* item, int mode, int mode_MH, pst_file* pst, int save_rtf);
87 void write_vcard(FILE* f_output, pst_item_contact* contact, char comment[]); 87 void write_vcard(FILE* f_output, pst_item_contact* contact, char comment[]);
88 void write_appointment(FILE* f_output, pst_item_appointment* appointment, 88 void write_appointment(FILE* f_output, pst_item_appointment* appointment,
89 pst_item_email* email, FILETIME* create_date, FILETIME* modify_date); 89 pst_item_email* email, FILETIME* create_date, FILETIME* modify_date);
90 void create_enter_dir(struct file_ll* f, char file_as[], int mode, int overwrite); 90 void create_enter_dir(struct file_ll* f, char file_as[], int mode, int overwrite);
91 char *prog_name; 91
92 char *output_dir = "."; 92 char* prog_name;
93 char *kmail_chdir = NULL; 93 char* output_dir = ".";
94 char* kmail_chdir = NULL;
94 // Normal mode just creates mbox format files in the current directory. Each file is named 95 // Normal mode just creates mbox format files in the current directory. Each file is named
95 // the same as the folder's name that it represents 96 // the same as the folder's name that it represents
96 #define MODE_NORMAL 0 97 #define MODE_NORMAL 0
97 // KMail mode creates a directory structure suitable for being used directly 98 // KMail mode creates a directory structure suitable for being used directly
98 // by the KMail application 99 // by the KMail application
112 #define OUTPUT_QUIET 1 113 #define OUTPUT_QUIET 1
113 114
114 // default mime-type for attachments that have a null mime-type 115 // default mime-type for attachments that have a null mime-type
115 #define MIME_TYPE_DEFAULT "application/octet-stream" 116 #define MIME_TYPE_DEFAULT "application/octet-stream"
116 117
117
118 // output mode for contacts 118 // output mode for contacts
119 #define CMODE_VCARD 0 119 #define CMODE_VCARD 0
120 #define CMODE_LIST 1 120 #define CMODE_LIST 1
121 121
122 // output settings for RTF bodies 122 // output settings for RTF bodies
123 // filename for the attachment 123 // filename for the attachment
124 #define RTF_ATTACH_NAME "rtf-body.rtf" 124 #define RTF_ATTACH_NAME "rtf-body.rtf"
125 // mime type for the attachment 125 // mime type for the attachment
126 #define RTF_ATTACH_TYPE "application/rtf" 126 #define RTF_ATTACH_TYPE "application/rtf"
127
128
127 int main(int argc, char** argv) { 129 int main(int argc, char** argv) {
128 pst_item *item = NULL; 130 pst_item *item = NULL;
129 pst_file pstfile; 131 pst_file pstfile;
130 pst_desc_ll *d_ptr; 132 pst_desc_ll *d_ptr;
131 char * fname = NULL; 133 char * fname = NULL;