Lines Matching defs:dirent
468 struct dosDirEntry dirent, *d;
610 memset(&dirent, 0, sizeof dirent);
616 dirent.flags = p[11];
622 dirent.name[j] = p[j];
623 dirent.name[8] = '\0';
624 for (k = 7; k >= 0 && dirent.name[k] == ' '; k--)
625 dirent.name[k] = '\0';
626 if (k < 0 || dirent.name[k] != '\0')
628 if (dirent.name[0] == SLOT_E5)
629 dirent.name[0] = 0xe5;
631 if (dirent.flags & ATTR_VOLUME) {
644 dirent.name[k++] = '.';
646 dirent.name[k++] = p[j+8];
647 dirent.name[k] = '\0';
648 for (k--; k >= 0 && dirent.name[k] == ' '; k--)
649 dirent.name[k] = '\0';
658 dirent.head = p[26] | (p[27] << 8);
660 dirent.head |= (p[20] << 16) | (p[21] << 24);
661 dirent.size = p[28] | (p[29] << 8) | (p[30] << 16) | (p[31] << 24);
663 strlcpy(dirent.lname, longName,
664 sizeof(dirent.lname));
669 dirent.parent = dir;
670 dirent.next = dir->child;
676 fullpath(&dirent), 0);
689 if (dirent.size == 0 && !(dirent.flags & ATTR_DIRECTORY)) {
690 if (dirent.head != 0) {
692 fullpath(&dirent));
697 clearchain(boot, fat, dirent.head);
698 dirent.head = 0;
703 } else if (dirent.head == 0
704 && !strcmp(dirent.name, "..")
710 } else if (dirent.head < CLUST_FIRST
711 || dirent.head >= boot->NumClusters
712 || fat[dirent.head].next == CLUST_FREE
713 || (fat[dirent.head].next >= CLUST_RSRVD
714 && fat[dirent.head].next < CLUST_EOFS)
715 || fat[dirent.head].head != dirent.head) {
716 if (dirent.head == 0)
718 fullpath(&dirent));
719 else if (dirent.head < CLUST_FIRST
720 || dirent.head >= boot->NumClusters)
722 fullpath(&dirent),
723 dirent.head);
724 else if (fat[dirent.head].next == CLUST_FREE)
726 fullpath(&dirent));
727 else if (fat[dirent.head].next >= CLUST_RSRVD)
729 fullpath(&dirent),
730 rsrvdcltype(fat[dirent.head].next));
733 fullpath(&dirent));
734 if (dirent.flags & ATTR_DIRECTORY) {
747 dirent.size = 0;
754 if (dirent.head >= CLUST_FIRST && dirent.head < boot->NumClusters)
755 fat[dirent.head].flags |= FAT_USED;
757 if (dirent.flags & ATTR_DIRECTORY) {
763 if (dirent.size) {
765 fullpath(&dirent));
768 dirent.size = 0;
776 if (strcmp(dirent.name, ".") == 0) {
777 if (dirent.head != dir->head) {
781 dirent.head = dir->head;
782 p[26] = (u_char)dirent.head;
783 p[27] = (u_char)(dirent.head >> 8);
785 p[20] = (u_char)(dirent.head >> 16);
786 p[21] = (u_char)(dirent.head >> 24);
794 if (strcmp(dirent.name, "..") == 0) {
797 if (dirent.head) {
801 dirent.head = 0;
809 } else if (dirent.head != dir->parent->head) {
813 dirent.head = dir->parent->head;
814 p[26] = (u_char)dirent.head;
815 p[27] = (u_char)(dirent.head >> 8);
817 p[20] = (u_char)(dirent.head >> 16);
818 p[21] = (u_char)(dirent.head >> 24);
833 memcpy(d, &dirent, sizeof(struct dosDirEntry));
846 mod |= k = checksize(boot, fat, p, &dirent);