Lines Matching refs:dirent

445 	struct dosDirEntry dirent, *d;
604 memset(&dirent, 0, sizeof dirent);
610 dirent.flags = p[11];
616 dirent.name[j] = p[j];
617 dirent.name[8] = '\0';
618 for (k = 7; k >= 0 && dirent.name[k] == ' '; k--)
619 dirent.name[k] = '\0';
620 if (dirent.name[k] != '\0')
622 if (dirent.name[0] == SLOT_E5)
623 dirent.name[0] = 0xe5;
625 if (dirent.flags & ATTR_VOLUME) {
638 dirent.name[k++] = '.';
640 dirent.name[k++] = p[j+8];
641 dirent.name[k] = '\0';
642 for (k--; k >= 0 && dirent.name[k] == ' '; k--)
643 dirent.name[k] = '\0';
652 dirent.head = p[26] | (p[27] << 8);
654 dirent.head |= (p[20] << 16) | (p[21] << 24);
655 dirent.size = p[28] | (p[29] << 8) | (p[30] << 16) | (p[31] << 24);
657 strlcpy(dirent.lname, longName,
658 sizeof(dirent.lname));
663 dirent.parent = dir;
664 dirent.next = dir->child;
670 fullpath(&dirent), 0);
683 if (dirent.size == 0 && !(dirent.flags & ATTR_DIRECTORY)) {
684 if (dirent.head != 0) {
686 fullpath(&dirent));
691 clearchain(boot, fat, dirent.head);
692 dirent.head = 0;
697 } else if (dirent.head == 0
698 && !strcmp(dirent.name, "..")
704 } else if (dirent.head < CLUST_FIRST
705 || dirent.head >= boot->NumClusters
706 || fat[dirent.head].next == CLUST_FREE
707 || (fat[dirent.head].next >= CLUST_RSRVD
708 && fat[dirent.head].next < CLUST_EOFS)
709 || fat[dirent.head].head != dirent.head) {
710 if (dirent.head == 0)
712 fullpath(&dirent));
713 else if (dirent.head < CLUST_FIRST
714 || dirent.head >= boot->NumClusters)
716 fullpath(&dirent),
717 dirent.head);
718 else if (fat[dirent.head].next == CLUST_FREE)
720 fullpath(&dirent));
721 else if (fat[dirent.head].next >= CLUST_RSRVD)
723 fullpath(&dirent),
724 rsrvdcltype(fat[dirent.head].next));
727 fullpath(&dirent));
728 if (dirent.flags & ATTR_DIRECTORY) {
741 dirent.size = 0;
748 if (dirent.head >= CLUST_FIRST && dirent.head < boot->NumClusters)
749 fat[dirent.head].flags |= FAT_USED;
751 if (dirent.flags & ATTR_DIRECTORY) {
757 if (dirent.size) {
759 fullpath(&dirent));
762 dirent.size = 0;
770 if (strcmp(dirent.name, ".") == 0) {
771 if (dirent.head != dir->head) {
775 dirent.head = dir->head;
776 p[26] = (u_char)dirent.head;
777 p[27] = (u_char)(dirent.head >> 8);
779 p[20] = (u_char)(dirent.head >> 16);
780 p[21] = (u_char)(dirent.head >> 24);
788 if (strcmp(dirent.name, "..") == 0) {
791 if (dirent.head) {
795 dirent.head = 0;
803 } else if (dirent.head != dir->parent->head) {
807 dirent.head = dir->parent->head;
808 p[26] = (u_char)dirent.head;
809 p[27] = (u_char)(dirent.head >> 8);
811 p[20] = (u_char)(dirent.head >> 16);
812 p[21] = (u_char)(dirent.head >> 24);
827 memcpy(d, &dirent, sizeof(struct dosDirEntry));
840 mod |= k = checksize(boot, fat, p, &dirent);