comparison src/lspst.c @ 46:b2a7f2e0926a

more fixes for 64 bit format
author carl
date Sat, 12 Jan 2008 15:20:53 -0800
parents f6db1f060a95
children f66078abed38
comparison
equal deleted inserted replaced
45:b961bcdadd0e 46:b2a7f2e0926a
67 ff.skip_count++; 67 ff.skip_count++;
68 } 68 }
69 else { 69 else {
70 DEBUG_MAIN(("main: Desc Email ID %x [d_ptr->id = %x]\n", d_ptr->desc->id, d_ptr->id)); 70 DEBUG_MAIN(("main: Desc Email ID %x [d_ptr->id = %x]\n", d_ptr->desc->id, d_ptr->id));
71 71
72 item = _pst_parse_item(&pstfile, d_ptr); 72 item = pst_parse_item(&pstfile, d_ptr);
73 DEBUG_MAIN(("main: About to process item @ %p.\n", item)); 73 DEBUG_MAIN(("main: About to process item @ %p.\n", item));
74 if (item) { 74 if (item) {
75 if (item->message_store) { 75 if (item->message_store) {
76 // there should only be one message_store, and we have already done it 76 // there should only be one message_store, and we have already done it
77 DIE(("main: A second message_store has been found. Sorry, this must be an error.\n")); 77 DIE(("main: A second message_store has been found. Sorry, this must be an error.\n"));
132 } else { 132 } else {
133 ff.skip_count++; 133 ff.skip_count++;
134 DEBUG_MAIN(("main: Unknown item type. %i. Ascii1=\"%s\"\n", 134 DEBUG_MAIN(("main: Unknown item type. %i. Ascii1=\"%s\"\n",
135 item->type, item->ascii_type)); 135 item->type, item->ascii_type));
136 } 136 }
137 _pst_freeItem(item); 137 pst_freeItem(item);
138 } else { 138 } else {
139 ff.skip_count++; 139 ff.skip_count++;
140 DEBUG_MAIN(("main: A NULL item was seen\n")); 140 DEBUG_MAIN(("main: A NULL item was seen\n"));
141 } 141 }
142 d_ptr = d_ptr->next; 142 d_ptr = d_ptr->next;
149 int main(int argc, char** argv) { 149 int main(int argc, char** argv) {
150 pst_item *item = NULL; 150 pst_item *item = NULL;
151 pst_desc_ll *d_ptr; 151 pst_desc_ll *d_ptr;
152 char *temp = NULL; //temporary char pointer 152 char *temp = NULL; //temporary char pointer
153 char *d_log = NULL; 153 char *d_log = NULL;
154 struct file_ll *f = NULL, *head = NULL;
155 154
156 if (argc <= 1) DIE(("Missing PST filename.\n")); 155 if (argc <= 1) DIE(("Missing PST filename.\n"));
157 156
158 DEBUG_INIT(d_log); 157 DEBUG_INIT(d_log);
159 DEBUG_REGISTER_CLOSE(); 158 DEBUG_REGISTER_CLOSE();
166 if (pst_load_index(&pstfile)) DIE(("Index Error\n")); 165 if (pst_load_index(&pstfile)) DIE(("Index Error\n"));
167 166
168 pst_load_extended_attributes(&pstfile); 167 pst_load_extended_attributes(&pstfile);
169 168
170 d_ptr = pstfile.d_head; // first record is main record 169 d_ptr = pstfile.d_head; // first record is main record
171 item = _pst_parse_item(&pstfile, d_ptr); 170 item = pst_parse_item(&pstfile, d_ptr);
172 if (!item || !item->message_store) { 171 if (!item || !item->message_store) {
173 DEBUG_RET(); 172 DEBUG_RET();
174 DIE(("main: Could not get root record\n")); 173 DIE(("main: Could not get root record\n"));
175 } 174 }
176 175
191 d_ptr = pst_getTopOfFolders(&pstfile, item); 190 d_ptr = pst_getTopOfFolders(&pstfile, item);
192 if (!d_ptr) DIE(("Top of folders record not found. Cannot continue\n")); 191 if (!d_ptr) DIE(("Top of folders record not found. Cannot continue\n"));
193 DEBUG_MAIN(("d_ptr(TOF) = %p.\n", d_ptr)); 192 DEBUG_MAIN(("d_ptr(TOF) = %p.\n", d_ptr));
194 193
195 process(item, d_ptr->child); // do the childred of TOPF 194 process(item, d_ptr->child); // do the childred of TOPF
196 _pst_freeItem(item); 195 pst_freeItem(item);
197 pst_close(&pstfile); 196 pst_close(&pstfile);
198 197
199 DEBUG_RET(); 198 DEBUG_RET();
200 return 0; 199 return 0;
201 } 200 }