comparison src/getidblock.c @ 150:06aa84023b48

rename some structure fields to reflect our better understanding of the pst format
author Carl Byington <carl@five-ten-sg.com>
date Thu, 05 Mar 2009 08:23:32 -0800
parents f9773b6368e0
children ab384fed78c5
comparison
equal deleted inserted replaced
149:f9773b6368e0 150:06aa84023b48
43 43
44 if (process) { 44 if (process) {
45 DEBUG_MAIN(("Parsing block id %#"PRIx64"\n", id)); 45 DEBUG_MAIN(("Parsing block id %#"PRIx64"\n", id));
46 ptr = pstfile.d_head; 46 ptr = pstfile.d_head;
47 while (ptr) { 47 while (ptr) {
48 if (ptr->list_index && ptr->list_index->id == id) 48 if (ptr->assoc_tree && ptr->assoc_tree->id == id)
49 break; 49 break;
50 if (ptr->desc && ptr->desc->id == id) 50 if (ptr->desc && ptr->desc->id == id)
51 break; 51 break;
52 ptr = pst_getNextDptr(ptr); 52 ptr = pst_getNextDptr(ptr);
53 } 53 }
54 if (!ptr) { 54 if (!ptr) {
55 ptr = (pst_desc_ll *) xmalloc(sizeof(pst_desc_ll)); 55 ptr = (pst_desc_ll *) xmalloc(sizeof(pst_desc_ll));
56 memset(ptr, 0, sizeof(pst_desc_ll));
56 ptr->desc = pst_getID(&pstfile, id); 57 ptr->desc = pst_getID(&pstfile, id);
57 ptr->list_index = NULL;
58 } 58 }
59 pst_item *item = pst_parse_item(&pstfile, ptr, NULL); 59 pst_item *item = pst_parse_item(&pstfile, ptr, NULL);
60 if (item) pst_freeItem(item); 60 if (item) pst_freeItem(item);
61 } 61 }
62 } 62 }
64 64
65 void dump_desc(pst_desc_ll *ptr); 65 void dump_desc(pst_desc_ll *ptr);
66 void dump_desc(pst_desc_ll *ptr) 66 void dump_desc(pst_desc_ll *ptr)
67 { 67 {
68 while (ptr) { 68 while (ptr) {
69 DEBUG_MAIN(("\n\n\nLooking at block desc id %#"PRIx64"\n", ptr->id)); 69 DEBUG_MAIN(("\n\n\nLooking at block desc id %#"PRIx64"\n", ptr->d_id));
70 if (ptr->desc && ptr->desc->id) dumper(ptr->desc->id); 70 if (ptr->desc && ptr->desc->id) dumper(ptr->desc->id);
71 if (ptr->list_index && ptr->list_index->id) dumper(ptr->list_index->id); 71 if (ptr->assoc_tree && ptr->assoc_tree->id) dumper(ptr->assoc_tree->id);
72 if (ptr->child) dump_desc(ptr->child); 72 if (ptr->child) dump_desc(ptr->child);
73 ptr = ptr->next; 73 ptr = ptr->next;
74 } 74 }
75 } 75 }
76 76