Lines Matching refs:dirent

528 	struct dosDirEntry dirent, *d;
691 memset(&dirent, 0, sizeof dirent);
697 dirent.flags = p[11];
703 dirent.name[j] = p[j];
704 dirent.name[8] = '\0';
705 for (k = 7; k >= 0 && dirent.name[k] == ' '; k--)
706 dirent.name[k] = '\0';
707 if (dirent.name[k] != '\0')
709 if (dirent.name[0] == SLOT_E5)
710 dirent.name[0] = 0xe5;
712 if (dirent.flags & ATTR_VOLUME) {
725 dirent.name[k++] = '.';
727 dirent.name[k++] = p[j+8];
728 dirent.name[k] = '\0';
729 for (k--; k >= 0 && dirent.name[k] == ' '; k--)
730 dirent.name[k] = '\0';
739 dirent.head = p[26] | (p[27] << 8);
741 dirent.head |= (p[20] << 16) | (p[21] << 24);
742 dirent.size = p[28] | (p[29] << 8) | (p[30] << 16) | (p[31] << 24);
744 strcpy(dirent.lname, longName);
749 dirent.parent = dir;
750 dirent.next = dir->child;
756 fullpath(&dirent), 0);
769 if (dirent.size == 0 && !(dirent.flags & ATTR_DIRECTORY)) {
770 if (dirent.head != 0) {
772 fullpath(&dirent));
777 clearchain(boot, fat, dirent.head);
778 dirent.head = 0;
783 } else if (dirent.head == 0
784 && !strcmp(dirent.name, "..")
790 } else if (dirent.head < CLUST_FIRST
791 || dirent.head >= boot->NumClusters
792 || fat[dirent.head].next == CLUST_FREE
793 || (fat[dirent.head].next >= CLUST_RSRVD
794 && fat[dirent.head].next < CLUST_EOFS)
795 || fat[dirent.head].head != dirent.head) {
796 if (dirent.head == 0)
798 fullpath(&dirent));
799 else if (dirent.head < CLUST_FIRST
800 || dirent.head >= boot->NumClusters)
802 fullpath(&dirent),
803 dirent.head);
804 else if (fat[dirent.head].next == CLUST_FREE)
806 fullpath(&dirent));
807 else if (fat[dirent.head].next >= CLUST_RSRVD)
809 fullpath(&dirent),
810 rsrvdcltype(fat[dirent.head].next));
813 fullpath(&dirent));
814 if (dirent.flags & ATTR_DIRECTORY) {
827 dirent.size = 0;
834 if (dirent.head >= CLUST_FIRST && dirent.head < boot->NumClusters)
835 fat[dirent.head].flags |= FAT_USED;
837 if (dirent.flags & ATTR_DIRECTORY) {
843 if (dirent.size) {
845 fullpath(&dirent));
848 dirent.size = 0;
856 if (strcmp(dirent.name, ".") == 0) {
857 if (dirent.head != dir->head) {
861 dirent.head = dir->head;
862 p[26] = (u_char)dirent.head;
863 p[27] = (u_char)(dirent.head >> 8);
865 p[20] = (u_char)(dirent.head >> 16);
866 p[21] = (u_char)(dirent.head >> 24);
873 } else if (strcmp(dirent.name, "..") == 0) {
876 if (dirent.head) {
880 dirent.head = 0;
888 } else if (dirent.head != dir->parent->head) {
892 dirent.head = dir->parent->head;
893 p[26] = (u_char)dirent.head;
894 p[27] = (u_char)(dirent.head >> 8);
896 p[20] = (u_char)(dirent.head >> 16);
897 p[21] = (u_char)(dirent.head >> 24);
906 if (dirent.head == dir->head) {
908 dirent.name, fullpath(dir));
921 if (check_dot_dot(f,boot,fat,&dirent)) {
937 memcpy(d, &dirent, sizeof(struct dosDirEntry));
953 mod |= k = checksize(boot, fat, p, &dirent);