comparison src/readpst.c @ 33:12cac756bc05 stable-0-5-5

enable -d option, but if not specified, don't generate a debug file
author carl
date Tue, 10 Jul 2007 20:23:55 -0700
parents b88ceb81dba2
children 07177825c91b
comparison
equal deleted inserted replaced
32:c03974357771 33:12cac756bc05
200 break; 200 break;
201 } 201 }
202 } 202 }
203 203
204 #ifdef DEBUG_ALL 204 #ifdef DEBUG_ALL
205 // initialize log file 205 // force a log file
206 if (!d_log) 206 if (!d_log) d_log = "readpst.log";
207 d_log = "readpst.log"; 207 #endif // defined DEBUG_ALL
208 DEBUG_INIT(d_log); 208 DEBUG_INIT(d_log);
209 DEBUG_REGISTER_CLOSE(); 209 DEBUG_REGISTER_CLOSE();
210 #endif // defined DEBUG_ALL
211
212 DEBUG_ENT("main"); 210 DEBUG_ENT("main");
213 211
214 if (argc > optind) { 212 if (argc > optind) {
215 fname = argv[optind]; 213 fname = argv[optind];
216 } else { 214 } else {
273 if (item){ 271 if (item){
274 _pst_freeItem(item); 272 _pst_freeItem(item);
275 item = NULL; 273 item = NULL;
276 } 274 }
277 275
278 /* if ((item = _pst_parse_item(&pstfile, d_ptr)) == NULL || item->folder == NULL) {
279 DEBUG_MAIN(("main: Could not get \"Top Of Personal Folder\" record\n"));
280 return -2;
281 }*/
282 d_ptr = d_ptr->child; // do the children of TOPF 276 d_ptr = d_ptr->child; // do the children of TOPF
283 277
284 if (output_mode != OUTPUT_QUIET) printf("Processing items...\n"); 278 if (output_mode != OUTPUT_QUIET) printf("Processing items...\n");
285 279
286 DEBUG_MAIN(("main: About to do email stuff\n")); 280 DEBUG_MAIN(("main: About to do email stuff\n"));
326 if (d_ptr->child) { 320 if (d_ptr->child) {
327 d_ptr = d_ptr->child; 321 d_ptr = d_ptr->child;
328 skip_child = 1; 322 skip_child = 1;
329 } else { 323 } else {
330 DEBUG_MAIN(("main: Folder has NO children. Creating directory, and closing again\n")); 324 DEBUG_MAIN(("main: Folder has NO children. Creating directory, and closing again\n"));
331 if (output_mode != OUTPUT_QUIET) 325 if (output_mode != OUTPUT_QUIET) printf("\tNo items to process in folder \"%s\", should have been %i\n", f->dname, f->stored_count);
332 printf("\tNo items to process in folder \"%s\", should have been %i\n", f->dname, f->stored_count);
333 head = f->next; 326 head = f->next;
334 if (f->output) 327 if (f->output)
335 fclose(f->output); 328 fclose(f->output);
336 if (mode == MODE_KMAIL) 329 if (mode == MODE_KMAIL)
337 close_kmail_dir(); 330 close_kmail_dir();