Lines Matching defs:dp
84 hasCHKName(struct pcdir *dp)
86 return (dp->pcd_filename[CHKNAME_F] == 'F' &&
87 dp->pcd_filename[CHKNAME_I] == 'I' &&
88 dp->pcd_filename[CHKNAME_L] == 'L' &&
89 dp->pcd_filename[CHKNAME_E] == 'E' &&
90 isdigit(dp->pcd_filename[CHKNAME_THOUSANDS]) &&
91 isdigit(dp->pcd_filename[CHKNAME_HUNDREDS]) &&
92 isdigit(dp->pcd_filename[CHKNAME_TENS]) &&
93 isdigit(dp->pcd_filename[CHKNAME_ONES]) &&
94 dp->pcd_ext[CHKNAME_C] == 'C' &&
95 dp->pcd_ext[CHKNAME_H] == 'H' &&
96 dp->pcd_ext[CHKNAME_K] == 'K');
109 addToCHKList(struct pcdir *dp)
113 chknum = 1000 * (dp->pcd_filename[CHKNAME_THOUSANDS] - '0');
114 chknum += 100 * (dp->pcd_filename[CHKNAME_HUNDREDS] - '0');
115 chknum += 10 * (dp->pcd_filename[CHKNAME_TENS] - '0');
116 chknum += (dp->pcd_filename[CHKNAME_ONES] - '0');
127 appendToPath(struct pcdir *dp, char *thePath, int *theLen)
151 if ((dp->pcd_filename[i] == ' ') ||
152 !(pc_validchar(dp->pcd_filename[i])))
154 *(thePath + (*theLen)++) = dp->pcd_filename[i++];
159 if ((dp->pcd_ext[i] == ' ') || ((*theLen) >= MAXPATHLEN) ||
160 (!(pc_validchar(dp->pcd_ext[i]))))
168 if ((dp->pcd_ext[i] == ' ') || !(pc_validchar(dp->pcd_ext[i])))
170 *(thePath + (*theLen)++) = dp->pcd_ext[i++];
175 printName(FILE *outDest, struct pcdir *dp)
179 if ((dp->pcd_filename[i] == ' ') ||
180 !(pc_validchar(dp->pcd_filename[i])))
182 (void) fprintf(outDest, "%c", dp->pcd_filename[i]);
186 if (!(pc_validchar(dp->pcd_ext[i])))
188 (void) fprintf(outDest, "%c", dp->pcd_ext[i]);
200 sanityCheckSize(int fd, struct pcdir *dp, int32_t actualClusterCount,
210 sizeFromDir = extractSize(dp);
240 splitChain(fd, dp, startCluster, orphanEntry, &ignorei);
245 noteUsage(int fd, int32_t startAt, struct pcdir *dp, struct pcdir *lp,
257 if ((markInUse(fd, chain, dp, lp, longEntryStartCluster,
284 if (sanityCheckSize(fd, dp, count, isDir, startAt,
300 storeInfoAboutEntry(int fd, struct pcdir *dp, struct pcdir *ldp, int depth,
306 int hidden = (dp->pcd_attr & PCA_HIDDEN || dp->pcd_attr & PCA_SYSTEM);
307 int dir = (dp->pcd_attr & PCA_DIR);
316 appendToPath(dp, fullPath, fullLen);
343 printName(stderr, dp);
348 extractSize(dp), extractStartCluster(dp));
351 start = extractStartCluster(dp);
352 haveBad = noteUsage(fd, start, dp, ldp, longEntryStartCluster,
362 truncChainWithBadCluster(fd, dp, start);
371 storeInfoAboutLabel(struct pcdir *dp)
380 printName(stderr, dp);
386 searchChecks(struct pcdir *dp, int operation, char matchRequired,
407 if (operation == PCFS_FIND_ATTR && dp->pcd_attr == matchRequired) {
408 *found = dp;
410 dp->pcd_filename[0] == matchRequired) {
411 *found = dp;
412 } else if (operation == PCFS_FIND_CHKS && hasCHKName(dp)) {
413 addToCHKList(dp);
418 catalogEntry(int fd, struct pcdir *dp, struct pcdir *longdp,
421 if (dp->pcd_attr & PCA_LABEL) {
422 storeInfoAboutLabel(dp);
424 storeInfoAboutEntry(fd, dp, longdp, depth, currentCluster,
496 struct pcdir *dp;
501 dp = dirData->dirp;
507 while ((uchar_t *)dp < dirData->bytes + dirDataLen &&
508 dp->pcd_filename[0] != PCD_UNUSED) {
512 searchChecks(dp, operation, matchRequired, found);
524 if ((dp->pcd_attr & PCDL_LFN_BITS) == PCDL_LFN_BITS) {
528 longdp = dp;
530 dp++;
532 } else if ((dp->pcd_filename[0] == PCD_ERASED) ||
533 (dp->pcd_filename[0] == '.')) {
540 dp++;
545 catalogEntry(fd, dp, longdp, longStart, depth,
549 if (dp->pcd_attr & PCA_DIR && descend == PCFS_VISIT_SUBDIRS) {
550 traverseDir(fd, extractStartCluster(dp), depth + 1,
556 dp++;
561 if ((uchar_t *)dp < dirData->bytes + dirDataLen) {
569 *dirEnd = dp;
744 extractSize(struct pcdir *dp)
748 read_32_bits((uchar_t *)&(dp->pcd_size), &returnMe);
753 extractStartCluster(struct pcdir *dp)
758 read_16_bits((uchar_t *)&(dp->un.pcd_scluster_hi), &hi);
759 read_16_bits((uchar_t *)&(dp->pcd_scluster_lo), &lo);
762 read_16_bits((uchar_t *)&(dp->pcd_scluster_lo), &lo);
877 updateDirEnt_CreatTime(struct pcdir *dp)
879 getNow(&dp->pcd_crtime, &dp->pcd_crtime_msec);
880 markClusterModified(findImpactedCluster(dp));
884 updateDirEnt_ModTimes(struct pcdir *dp)
888 getNow(&dp->pcd_mtime, NULL);
889 dp->pcd_ladate = dp->pcd_mtime.pct_date;
890 dp->pcd_attr |= PCA_ARCH;
891 markClusterModified(findImpactedCluster(dp));
1038 updateDirEnt_Size(struct pcdir *dp, uint32_t newSize)
1040 uchar_t *p = (uchar_t *)&(dp->pcd_size);
1042 markClusterModified(findImpactedCluster(dp));
1046 updateDirEnt_Start(struct pcdir *dp, int32_t newStart)
1048 uchar_t *p = (uchar_t *)&(dp->pcd_scluster_lo);
1051 p = (uchar_t *)&(dp->un.pcd_scluster_hi);
1054 markClusterModified(findImpactedCluster(dp));
1058 updateDirEnt_Name(struct pcdir *dp, char *newName)
1064 dp->pcd_filename[i] = *newName++;
1066 dp->pcd_filename[i] = ' ';
1068 markClusterModified(findImpactedCluster(dp));