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

Function adfFindEntry

dep/adflib/src/adf_dir.c:46–68  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

44extern struct Env adfEnv;
45
46struct Entry* adfFindEntry(struct Volume *vol, char* name)
47{
48 SECTNUM nSect;
49 struct bEntryBlock entryBlk;
50 struct bEntryBlock parent;
51 struct Entry* entry;
52
53 adfReadEntryBlock(vol, vol->curDirPtr, &parent);
54
55 nSect = adfNameToEntryBlk(vol, parent.hashTable, name, &entryBlk, NULL);
56 if (nSect==-1) {
57 (*adfEnv.wFct)("adfRenameEntry : existing entry not found");
58 return NULL;
59 }
60
61 entry = malloc(sizeof(*entry));
62 if (adfEntBlock2Entry(&entryBlk, entry) != RC_OK) {
63 free(entry);
64 return NULL;
65 }
66
67 return entry;
68}
69
70/*
71 * adfRenameEntry

Callers 1

getDirentMethod · 0.85

Calls 3

adfReadEntryBlockFunction · 0.85
adfNameToEntryBlkFunction · 0.85
adfEntBlock2EntryFunction · 0.85

Tested by

no test coverage detected