]> git.sur5r.net Git - cc65/commitdiff
Added functional Atari directory classification macros for file types from struct...
authorol.sc <ol.sc@b7a2c559-68d2-44c3-8de9-860c34a00d81>
Tue, 3 Jul 2012 20:10:52 +0000 (20:10 +0000)
committerol.sc <ol.sc@b7a2c559-68d2-44c3-8de9-860c34a00d81>
Tue, 3 Jul 2012 20:10:52 +0000 (20:10 +0000)
git-svn-id: svn://svn.cc65.org/cc65/trunk@5759 b7a2c559-68d2-44c3-8de9-860c34a00d81

include/dirent.h
libsrc/atari/posixdirent.s

index 857aad4db1e7b6291f7aa0792a5fed713ad2f264..010db6a117cefbe858d8ff75aecccf2a27997c79 100644 (file)
@@ -81,11 +81,12 @@ struct dirent {
 #elif defined(__ATARI__)
 
 struct dirent {
-    char d_name[13];  /* 8.3 + trailing 0 */
+    char          d_name[13];  /* 8.3 + trailing 0 */
+    unsigned char d_type;
 };
 
-#define _DE_ISREG(t)  (1)
-#define _DE_ISDIR(t)  (0)
+#define _DE_ISREG(t)  ((t) != 0xC4)
+#define _DE_ISDIR(t)  ((t) == 0xC4)
 #define _DE_ISLBL(t)  (0)
 #define _DE_ISLNK(t)  (0)
 
index f33a7f04f2912c3533fa98770e44f3f2cb7067fb..cb84fca71f4d9755bd280647a0c5a82c19adf266 100644 (file)
@@ -93,7 +93,7 @@ cioerr:               sty     __oserror
                dey
                dey
                sta     (ptr1),y
-               cpy     #9
+               cpy     #8
                bcs     @break
                cmp     #' '
                bne     @next
@@ -113,6 +113,8 @@ cioerr:             sty     __oserror
                bne     @done
 
 @hasext:       jsr     copychar
+               ldy     #13             ; d_type
+               sta     (ptr1),y
                ldy     #11
                jsr     copychar
                ldy     #12