Lines Matching full:dirent
526 struct dosDirEntry dirent, *d;
689 memset(&dirent, 0, sizeof dirent);
695 dirent.flags = p[11];
701 dirent.name[j] = p[j];
702 dirent.name[8] = '\0';
703 for (k = 7; k >= 0 && dirent.name[k] == ' '; k--)
704 dirent.name[k] = '\0';
705 if (dirent.name[k] != '\0')
707 if (dirent.name[0] == SLOT_E5)
708 dirent.name[0] = 0xe5;
710 if (dirent.flags & ATTR_VOLUME) {
723 dirent.name[k++] = '.';
725 dirent.name[k++] = p[j+8];
726 dirent.name[k] = '\0';
727 for (k--; k >= 0 && dirent.name[k] == ' '; k--)
728 dirent.name[k] = '\0';
737 dirent.head = p[26] | (p[27] << 8);
739 dirent.head |= (p[20] << 16) | (p[21] << 24);
740 dirent.size = p[28] | (p[29] << 8) | (p[30] << 16) | (p[31] << 24);
742 strcpy(dirent.lname, longName);
747 dirent.parent = dir;
748 dirent.next = dir->child;
754 fullpath(&dirent), 0);
767 if (dirent.size == 0 && !(dirent.flags & ATTR_DIRECTORY)) {
768 if (dirent.head != 0) {
770 fullpath(&dirent));
775 clearchain(boot, fat, dirent.head);
776 dirent.head = 0;
781 } else if (dirent.head == 0
782 && !strcmp(dirent.name, "..")
788 } else if (dirent.head < CLUST_FIRST
789 || dirent.head >= boot->NumClusters
790 || fat[dirent.head].next == CLUST_FREE
791 || (fat[dirent.head].next >= CLUST_RSRVD
792 && fat[dirent.head].next < CLUST_EOFS)
793 || fat[dirent.head].head != dirent.head) {
794 if (dirent.head == 0)
796 fullpath(&dirent));
797 else if (dirent.head < CLUST_FIRST
798 || dirent.head >= boot->NumClusters)
800 fullpath(&dirent),
801 dirent.head);
802 else if (fat[dirent.head].next == CLUST_FREE)
804 fullpath(&dirent));
805 else if (fat[dirent.head].next >= CLUST_RSRVD)
807 fullpath(&dirent),
808 rsrvdcltype(fat[dirent.head].next));
811 fullpath(&dirent));
812 if (dirent.flags & ATTR_DIRECTORY) {
825 dirent.size = 0;
832 if (dirent.head >= CLUST_FIRST && dirent.head < boot->NumClusters)
833 fat[dirent.head].flags |= FAT_USED;
835 if (dirent.flags & ATTR_DIRECTORY) {
841 if (dirent.size) {
843 fullpath(&dirent));
846 dirent.size = 0;
854 if (strcmp(dirent.name, ".") == 0) {
855 if (dirent.head != dir->head) {
859 dirent.head = dir->head;
860 p[26] = (u_char)dirent.head;
861 p[27] = (u_char)(dirent.head >> 8);
863 p[20] = (u_char)(dirent.head >> 16);
864 p[21] = (u_char)(dirent.head >> 24);
871 } else if (strcmp(dirent.name, "..") == 0) {
874 if (dirent.head) {
878 dirent.head = 0;
886 } else if (dirent.head != dir->parent->head) {
890 dirent.head = dir->parent->head;
891 p[26] = (u_char)dirent.head;
892 p[27] = (u_char)(dirent.head >> 8);
894 p[20] = (u_char)(dirent.head >> 16);
895 p[21] = (u_char)(dirent.head >> 24);
904 if (dirent.head == dir->head) {
906 dirent.name, fullpath(dir));
919 if (check_dot_dot(f,boot,fat,&dirent)) {
935 memcpy(d, &dirent, sizeof(struct dosDirEntry));
951 mod |= k = checksize(boot, fat, p, &dirent);