* adfSetEntryComment * */
| 280 | * |
| 281 | */ |
| 282 | RETCODE 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 | /* |
nothing calls this directly
no test coverage detected