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

Function adfSetEntryComment

dep/adflib/src/adf_dir.c:282–310  ·  view source on GitHub ↗

* adfSetEntryComment * */

Source from the content-addressed store, hash-verified

280 *
281 */
282RETCODE adfSetEntryComment(struct Volume* vol, SECTNUM parSect, char* name,
283 char* newCmt)
284{
285 struct bEntryBlock parent, entry;
286 SECTNUM nSect;
287
288 if (adfReadEntryBlock( vol, parSect, &parent )!=RC_OK)
289 return RC_ERROR;
290 nSect = adfNameToEntryBlk(vol, parent.hashTable, name, &entry, NULL);
291 if (nSect==-1) {
292 (*adfEnv.wFct)("adfSetEntryComment : entry not found");
293 return RC_ERROR;
294 }
295
296 entry.commLen = min(MAXCMMTLEN, strlen(newCmt));
297 memcpy(entry.comment, newCmt, entry.commLen);
298
299 if (entry.secType==ST_DIR)
300 adfWriteDirBlock(vol, nSect, (struct bDirBlock*)&entry);
301 else if (entry.secType==ST_FILE)
302 adfWriteFileHdrBlock(vol, nSect, (struct bFileHeaderBlock*)&entry);
303 else
304 (*adfEnv.wFct)("adfSetEntryComment : entry secType incorrect");
305
306 if (isDIRCACHE(vol->dosType))
307 adfUpdateCache(vol, &parent, (struct bEntryBlock*)&entry, TRUE);
308
309 return RC_OK;
310}
311
312
313/*

Callers

nothing calls this directly

Calls 5

adfReadEntryBlockFunction · 0.85
adfNameToEntryBlkFunction · 0.85
adfWriteDirBlockFunction · 0.85
adfWriteFileHdrBlockFunction · 0.85
adfUpdateCacheFunction · 0.85

Tested by

no test coverage detected