MCPcopy Create free account
hub / github.com/davidgiven/fluxengine / adfGetDelEnt

Function adfGetDelEnt

dep/adflib/src/adf_salv.c:73–110  ·  view source on GitHub ↗

* adfGetDelEnt * */

Source from the content-addressed store, hash-verified

71 *
72 */
73struct List* adfGetDelEnt(struct Volume *vol)
74{
75 struct GenBlock *block;
76 int32_t i;
77 struct List *list, *head;
78 BOOL delEnt;
79
80 list = head = NULL;
81 block = NULL;
82 delEnt = TRUE;
83 for(i=vol->firstBlock; i<=vol->lastBlock; i++) {
84 if (adfIsBlockFree(vol, i)) {
85 if (delEnt) {
86 block = (struct GenBlock*)malloc(sizeof(struct GenBlock));
87 if (!block) return NULL;
88/*printf("%p\n",block);*/
89 }
90
91 adfReadGenBlock(vol, i, block);
92
93 delEnt = (block->type==T_HEADER
94 && (block->secType==ST_DIR || block->secType==ST_FILE) );
95
96 if (delEnt) {
97 if (head==NULL)
98 list = head = newCell(NULL, (void*)block);
99 else
100 list = newCell(list, (void*)block);
101 }
102 }
103 }
104
105 if (block!=NULL && list!=NULL && block!=list->content) {
106 free(block);
107/* printf("%p\n",block);*/
108 }
109 return head;
110}
111
112
113/*

Callers

nothing calls this directly

Calls 3

adfIsBlockFreeFunction · 0.85
adfReadGenBlockFunction · 0.85
newCellFunction · 0.85

Tested by

no test coverage detected