Lines Matching refs:attrp
94 struct cat_desc *descp, struct cat_attr *attrp, struct cat_fork *forkp, cnid_t *desc_cnid);
97 struct cat_desc *outdescp, struct cat_attr *attrp, struct cat_fork *forkp);
113 static void buildrecord(struct cat_attr *attrp, cnid_t cnid, int std_hfs, u_int32_t encoding, CatalogRecord *crp, u_int32_t *recordSize);
120 static void getbsdattr(struct hfsmount *hfsmp, const struct HFSPlusCatalogFile *crp, struct cat_attr * attrp);
176 struct cat_attr *attrp,
186 getbsdattr(hfsmp, &cnoderec, attrp);
188 getbsdattr(hfsmp, (struct HFSPlusCatalogFile *)recp, attrp);
202 (attrp->ca_atime >= hfsmp->hfc_timebase)) {
218 (attrp->ca_atime >= hfsmp->hfc_timebase)) {
303 struct cat_desc *outdescp, struct cat_attr *attrp,
318 result = cat_lookupbykey(hfsmp, keyp, 0, descp->cd_hint, wantrsrc, outdescp, attrp, forkp, desc_cnid);
327 result = cat_lookupmangled(hfsmp, descp, wantrsrc, outdescp, attrp, forkp);
337 // result = cat_lookupbykey(hfsmp, keyp, descp->cd_hint, attrp, forkp);
488 struct cat_desc *outdescp, struct cat_attr *attrp, struct cat_fork *forkp)
532 result = cat_lookupbykey(hfsmp, keyp, allow_system_files, 0, 0, outdescp, attrp, forkp, NULL);
560 struct cat_desc *outdescp, struct cat_attr *attrp, struct cat_fork *forkp)
580 result = cat_idlookup(hfsmp, fileID, 0, outdescp, attrp, forkp);
604 struct cat_desc *descp, struct cat_attr *attrp, struct cat_fork *forkp, cnid_t *desc_cnid)
650 && (attrp || forkp)
671 if (attrp != NULL) {
676 getbsdattr(hfsmp, &cnoderec, attrp);
678 getbsdattr(hfsmp, (struct HFSPlusCatalogFile *)recp, attrp);
680 attrp->ca_linkref = ilink;
732 if (attrp != NULL) {
733 attrp->ca_mode &= S_IFMT | S_IRUSR | S_IRGRP | S_IROTH;
744 if (attrp != NULL) {
745 attrp->ca_blocks = validblks + recp->hfsPlusFile.resourceFork.totalBlocks;
793 cat_create(struct hfsmount *hfsmp, struct cat_desc *descp, struct cat_attr *attrp,
806 modeformat = attrp->ca_mode & S_IFMT;
848 S_ISDIR(attrp->ca_mode));
896 buildrecord(attrp, nextCNID, std_hfs, encoding, &bto->data, &datalen);
909 if (!std_hfs || S_ISDIR(attrp->ca_mode)) {
936 encoding, S_ISDIR(attrp->ca_mode), out_descp);
941 attrp->ca_fileid = nextCNID;
1267 cat_delete(struct hfsmount *hfsmp, struct cat_desc *descp, struct cat_attr *attrp)
1299 result = getkey(hfsmp, attrp->ca_fileid, (CatalogKey *)&iterator->key);
1300 cnid = attrp->ca_fileid;
1317 result = cat_lookupmangled(hfsmp, descp, 0, &temp_desc, attrp, NULL);
1357 * using the data from attrp and forkp.
1361 cat_update(struct hfsmount *hfsmp, struct cat_desc *descp, struct cat_attr *attrp,
1374 state.s_attr = attrp;
1390 if ((descp->cd_cnid != attrp->ca_fileid) ||
1392 (attrp->ca_recflags & kHFSHasLinkChainMask)) {
1393 result = getkey(hfsmp, attrp->ca_fileid, (CatalogKey *)&iterator->key);
1425 struct cat_attr *attrp;
1432 attrp = state->s_attr;
1445 dir->valence = attrp->ca_entries;
1446 dir->createDate = UTCToLocal(to_hfs_time(attrp->ca_itime));
1447 dir->modifyDate = UTCToLocal(to_hfs_time(attrp->ca_mtime));
1448 dir->backupDate = UTCToLocal(to_hfs_time(attrp->ca_btime));
1449 bcopy(&attrp->ca_finderinfo[0], &dir->userInfo, 16);
1450 bcopy(&attrp->ca_finderinfo[16], &dir->finderInfo, 16);
1459 (file->fileID != attrp->ca_fileid))
1461 file->createDate = UTCToLocal(to_hfs_time(attrp->ca_itime));
1462 file->modifyDate = UTCToLocal(to_hfs_time(attrp->ca_mtime));
1463 file->backupDate = UTCToLocal(to_hfs_time(attrp->ca_btime));
1464 bcopy(&attrp->ca_finderinfo[0], &file->userInfo, 16);
1465 bcopy(&attrp->ca_finderinfo[16], &file->finderInfo, 16);
1490 if (attrp->ca_flags & (SF_IMMUTABLE | UF_IMMUTABLE))
1501 if (dir->folderID != attrp->ca_fileid) {
1502 printf("catrec_update: id %d != %d\n", dir->folderID, attrp->ca_fileid);
1505 dir->flags = attrp->ca_recflags;
1506 dir->valence = attrp->ca_entries;
1507 dir->createDate = to_hfs_time(attrp->ca_itime);
1508 dir->contentModDate = to_hfs_time(attrp->ca_mtime);
1509 dir->backupDate = to_hfs_time(attrp->ca_btime);
1510 dir->accessDate = to_hfs_time(attrp->ca_atime);
1511 attrp->ca_atimeondisk = attrp->ca_atime;
1512 dir->attributeModDate = to_hfs_time(attrp->ca_ctime);
1517 dir->folderCount = attrp->ca_dircount;
1518 bcopy(&attrp->ca_finderinfo[0], &dir->userInfo, 32);
1541 (attrp->ca_flags != 0) ||
1542 (attrp->ca_uid != hfsmp->hfs_uid) ||
1543 (attrp->ca_gid != hfsmp->hfs_gid) ||
1544 ((attrp->ca_mode & ALLPERMS) !=
1548 dir->bsdInfo.ownerID = attrp->ca_uid;
1549 dir->bsdInfo.groupID = attrp->ca_gid;
1551 dir->bsdInfo.ownerFlags = attrp->ca_flags & 0x000000FF;
1552 dir->bsdInfo.adminFlags = attrp->ca_flags >> 16;
1553 dir->bsdInfo.fileMode = attrp->ca_mode;
1555 if (attrp->ca_linkcount > 1 || dir->hl_linkCount > 1) {
1556 dir->hl_linkCount = attrp->ca_linkcount;
1566 if (file->fileID != attrp->ca_fileid)
1568 file->flags = attrp->ca_recflags;
1569 file->createDate = to_hfs_time(attrp->ca_itime);
1570 file->contentModDate = to_hfs_time(attrp->ca_mtime);
1571 file->backupDate = to_hfs_time(attrp->ca_btime);
1572 file->accessDate = to_hfs_time(attrp->ca_atime);
1573 attrp->ca_atimeondisk = attrp->ca_atime;
1574 file->attributeModDate = to_hfs_time(attrp->ca_ctime);
1580 file->hl_firstLinkID = attrp->ca_firstlink;
1584 bcopy(&attrp->ca_finderinfo[0], &file->userInfo, 32);
1607 (attrp->ca_flags != 0) ||
1608 (attrp->ca_uid != hfsmp->hfs_uid) ||
1609 (attrp->ca_gid != hfsmp->hfs_gid) ||
1610 ((attrp->ca_mode & ALLPERMS) !=
1614 file->bsdInfo.ownerID = attrp->ca_uid;
1615 file->bsdInfo.groupID = attrp->ca_gid;
1617 file->bsdInfo.ownerFlags = attrp->ca_flags & 0x000000FF;
1618 file->bsdInfo.adminFlags = attrp->ca_flags >> 16;
1619 file->bsdInfo.fileMode = attrp->ca_mode;
1649 if (attrp->ca_flags & (SF_IMMUTABLE | UF_IMMUTABLE))
1655 if (S_ISBLK(attrp->ca_mode) || S_ISCHR(attrp->ca_mode)) {
1656 file->bsdInfo.special.rawDevice = attrp->ca_rdev;
1657 } else if (descp->cd_cnid != attrp->ca_fileid || attrp->ca_linkcount == 2) {
1658 file->hl_linkCount = attrp->ca_linkcount;
1963 cat_createlink(struct hfsmount *hfsmp, struct cat_desc *descp, struct cat_attr *attrp,
2048 buildrecord(attrp, nextCNID, 0, encoding, &bto->data, &datalen);
2052 bto->data.hfsPlusFile.hl_linkReference = attrp->ca_linkref;
2056 if ((result = cat_makealias(hfsmp, attrp->ca_linkref, &bto->data.hfsPlusFile))) {
3575 * cat_desc here). Both key and attrp must point to real structures.
3582 cat_getkeyplusattr(struct hfsmount *hfsmp, cnid_t cnid, CatalogKey * key, struct cat_attr *attrp)
3589 result = cat_lookupbykey(hfsmp, key, 0, 0, 0, NULL, attrp, NULL, NULL);
3598 (attrp->ca_recflags & kHFSHasLinkChainMask)) {
3623 buildrecord(struct cat_attr *attrp, cnid_t cnid, int std_hfs, u_int32_t encoding,
3626 int type = attrp->ca_mode & S_IFMT;
3627 u_int32_t createtime = to_hfs_time(attrp->ca_itime);
3637 bcopy(attrp->ca_finderinfo, &crp->hfsFolder.userInfo, 32);
3645 bcopy(attrp->ca_finderinfo, &crp->hfsFile.userInfo, 16);
3646 bcopy(&attrp->ca_finderinfo[16], &crp->hfsFile.finderInfo, 16);
3654 crp->hfsPlusFolder.flags = attrp->ca_recflags;
3664 bcopy(attrp->ca_finderinfo, &crp->hfsPlusFolder.userInfo, 32);
3670 crp->hfsPlusFile.flags = attrp->ca_recflags;
3680 bcopy(attrp->ca_finderinfo, &crp->hfsPlusFile.userInfo, 32);
3684 bsdp->special.rawDevice = attrp->ca_rdev;
3691 bsdp->ownerID = attrp->ca_uid;
3692 bsdp->groupID = attrp->ca_gid;
3693 bsdp->fileMode = attrp->ca_mode;
3694 bsdp->adminFlags = attrp->ca_flags >> 16;
3695 bsdp->ownerFlags = attrp->ca_flags & 0x000000FF;
3759 getbsdattr(struct hfsmount *hfsmp, const struct HFSPlusCatalogFile *crp, struct cat_attr * attrp)
3764 attrp->ca_recflags = crp->flags;
3765 attrp->ca_atime = to_bsd_time(crp->accessDate);
3766 attrp->ca_atimeondisk = attrp->ca_atime;
3767 attrp->ca_mtime = to_bsd_time(crp->contentModDate);
3768 attrp->ca_ctime = to_bsd_time(crp->attributeModDate);
3769 attrp->ca_itime = to_bsd_time(crp->createDate);
3770 attrp->ca_btime = to_bsd_time(crp->backupDate);
3773 attrp->ca_flags = 0;
3774 attrp->ca_uid = hfsmp->hfs_uid;
3775 attrp->ca_gid = hfsmp->hfs_gid;
3777 attrp->ca_mode = S_IFDIR | (hfsmp->hfs_dir_mask & ACCESSPERMS);
3779 attrp->ca_mode = S_IFREG | (hfsmp->hfs_file_mask & ACCESSPERMS);
3781 attrp->ca_linkcount = 1;
3782 attrp->ca_rdev = 0;
3784 attrp->ca_linkcount = 1; /* may be overridden below */
3785 attrp->ca_rdev = 0;
3786 attrp->ca_uid = bsd->ownerID;
3787 attrp->ca_gid = bsd->groupID;
3788 attrp->ca_flags = bsd->ownerFlags | (bsd->adminFlags << 16);
3789 attrp->ca_mode = (mode_t)bsd->fileMode;
3790 switch (attrp->ca_mode & S_IFMT) {
3793 attrp->ca_rdev = bsd->special.rawDevice;
3800 attrp->ca_linkcount = bsd->special.linkCount;
3818 * attrp->ca_uid = hfsmp->hfs_uid;
3819 * attrp->ca_gid = hfsmp->hfs_gid;
3825 if (!S_ISDIR(attrp->ca_mode)) {
3826 attrp->ca_mode &= ~S_IFMT;
3827 attrp->ca_mode |= S_IFDIR;
3829 attrp->ca_entries = ((const HFSPlusCatalogFolder *)crp)->valence;
3830 attrp->ca_dircount = ((hfsmp->hfs_flags & HFS_FOLDERCOUNT) && (attrp->ca_recflags & kHFSHasFolderCountMask)) ?
3835 attrp->ca_flags |= UF_HIDDEN;
3841 if ((attrp->ca_flags & (SF_IMMUTABLE | UF_IMMUTABLE)) == 0)
3842 attrp->ca_flags |= UF_IMMUTABLE;
3845 attrp->ca_flags &= ~(SF_IMMUTABLE | UF_IMMUTABLE);
3849 attrp->ca_flags |= UF_HIDDEN;
3851 attrp->ca_blocks = crp->dataFork.totalBlocks + crp->resourceFork.totalBlocks;
3855 attrp->ca_recflags |= kHFSThreadExistsMask;
3858 attrp->ca_firstlink = (attrp->ca_recflags & kHFSHasLinkChainMask) ? crp->hl_firstLinkID : 0;
3861 attrp->ca_fileid = crp->fileID;
3863 bcopy(&crp->userInfo, attrp->ca_finderinfo, 32);