comparison src/getidblock.c @ 252:4573b536177f

fix for broken internet headers from Outlook
author Carl Byington <carl@five-ten-sg.com>
date Sat, 24 Jul 2010 12:07:56 -0700
parents 2f38c4ce606f
children 201464dd356e
comparison
equal deleted inserted replaced
251:00aaa548289b 252:4573b536177f
29 29
30 if ((readSize = pst_ff_getIDblock_dec(&pstfile, i_id, &buf)) <= 0 || buf == 0) { 30 if ((readSize = pst_ff_getIDblock_dec(&pstfile, i_id, &buf)) <= 0 || buf == 0) {
31 DIE(("Error loading block\n")); 31 DIE(("Error loading block\n"));
32 } 32 }
33 33
34 DEBUG_INFO(("Printing block id %#"PRIx64", size %#"PRIx64"\n", i_id, (uint64_t)readSize)); 34 DEBUG_INFO(("Printing block i_id %#"PRIx64", size %#"PRIx64"\n", i_id, (uint64_t)readSize));
35 if (binary) { 35 if (binary) {
36 if (fwrite(buf, 1, readSize, stdout) != 0) { 36 if (fwrite(buf, 1, readSize, stdout) != 0) {
37 DIE(("Error occured during writing of buf to stdout\n")); 37 DIE(("Error occured during writing of buf to stdout\n"));
38 } 38 }
39 } else { 39 } else {
61 if (item) pst_freeItem(item); 61 if (item) pst_freeItem(item);
62 } 62 }
63 } 63 }
64 64
65 65
66 void dump_desc(pst_desc_tree *ptr); 66 void dump_desc(pst_desc_tree *ptr, pst_desc_tree *parent);
67 void dump_desc(pst_desc_tree *ptr) 67 void dump_desc(pst_desc_tree *ptr, pst_desc_tree *parent)
68 { 68 {
69 while (ptr) { 69 while (ptr) {
70 DEBUG_INFO(("\n\n\nLooking at block desc id %#"PRIx64"\n", ptr->d_id)); 70 uint64_t parent_d_id = (parent) ? parent->d_id : 0;
71 printf("Descriptor block d_id %#"PRIx64" parent d_id %#"PRIx64" children %i desc.i_id=%#"PRIx64", assoc tree.i_id=%#"PRIx64"\n",
72 ptr->d_id, parent_d_id, ptr->no_child,
73 (ptr->desc ? ptr->desc->i_id : (uint64_t)0),
74 (ptr->assoc_tree ? ptr->assoc_tree->i_id : (uint64_t)0));
71 if (ptr->desc && ptr->desc->i_id) dumper(ptr->desc->i_id); 75 if (ptr->desc && ptr->desc->i_id) dumper(ptr->desc->i_id);
72 if (ptr->assoc_tree && ptr->assoc_tree->i_id) dumper(ptr->assoc_tree->i_id); 76 if (ptr->assoc_tree && ptr->assoc_tree->i_id) dumper(ptr->assoc_tree->i_id);
73 if (ptr->child) dump_desc(ptr->child); 77 if (ptr->child) dump_desc(ptr->child, ptr);
74 ptr = ptr->next; 78 ptr = ptr->next;
75 } 79 }
76 } 80 }
77 81
78 82
129 pst_index_ll *ptr = pstfile.i_head; 133 pst_index_ll *ptr = pstfile.i_head;
130 while (ptr) { 134 while (ptr) {
131 dumper(ptr->i_id); 135 dumper(ptr->i_id);
132 ptr = ptr->next; 136 ptr = ptr->next;
133 } 137 }
134 dump_desc(pstfile.d_head); 138 dump_desc(pstfile.d_head, NULL);
135 } 139 }
136 140
137 if (pst_close(&pstfile) != 0) { 141 if (pst_close(&pstfile) != 0) {
138 DIE(("pst_close failed\n")); 142 DIE(("pst_close failed\n"));
139 } 143 }