| 44 | extern struct Env adfEnv; |
| 45 | |
| 46 | struct 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 |
no test coverage detected