X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;f=include%2Fdirent.h;h=124c7f2241bc6c30d0010b5295823ccc1c9ddadc;hb=2cd4b5109a59c3743b38369359c389cc1b9edab4;hp=63a96ea82971def7ed4afa2c3c711a9e2f77b065;hpb=7aefd9b4e7b67908b7b3c38b6003c7f1a8d3ee2d;p=cc65 diff --git a/include/dirent.h b/include/dirent.h index 63a96ea82..124c7f224 100644 --- a/include/dirent.h +++ b/include/dirent.h @@ -36,14 +36,14 @@ /*****************************************************************************/ -/* Data */ +/* Data */ /*****************************************************************************/ typedef struct DIR DIR; -#if defined(__APPLE2__) || defined(__APPLE2ENH__) +#if defined(__APPLE2__) struct dirent { char d_name[16]; @@ -73,12 +73,23 @@ struct dirent { } d_mtime; }; +#define _DE_ISREG(t) ((t) != 0x0F) +#define _DE_ISDIR(t) ((t) == 0x0F) +#define _DE_ISLBL(t) (0) +#define _DE_ISLNK(t) (0) + #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) ((t) != 0xC4) +#define _DE_ISDIR(t) ((t) == 0xC4) +#define _DE_ISLBL(t) (0) +#define _DE_ISLNK(t) (0) + #elif defined(__CBM__) struct dirent { @@ -96,34 +107,44 @@ struct dirent { #define _DE_ISREG(t) (((t) & _CBM_T_REG) != 0) #define _DE_ISDIR(t) ((t) == _CBM_T_DIR) -#define _DE_ISLBL(t) ((t) == _CBM_T_HDR) +#define _DE_ISLBL(t) ((t) == _CBM_T_HEADER) #define _DE_ISLNK(t) ((t) == _CBM_T_LNK) #elif defined(__LYNX__) struct dirent { - unsigned char d_blocks; - unsigned int d_offset; - char d_type; - void *d_address; - unsigned int d_size; + unsigned char d_blocks; + unsigned int d_offset; + char d_type; + void *d_address; + unsigned int d_size; }; extern struct dirent FileEntry; #pragma zpsym ("FileEntry"); +#define _DE_ISREG(t) (1) +#define _DE_ISDIR(t) (0) +#define _DE_ISLBL(t) (0) +#define _DE_ISLNK(t) (0) + #else struct dirent { char d_name[1]; }; +#define _DE_ISREG(t) (1) +#define _DE_ISDIR(t) (0) +#define _DE_ISLBL(t) (0) +#define _DE_ISLNK(t) (0) + #endif /*****************************************************************************/ -/* Code */ +/* Code */ /*****************************************************************************/