Added classification macros for file types from struct dirent.

git-svn-id: svn://svn.cc65.org/cc65/trunk@5736 b7a2c559-68d2-44c3-8de9-860c34a00d81
This commit is contained in:
uz
2012-06-24 14:23:33 +00:00
parent 5bc67cdaee
commit 7aefd9b4e7
4 changed files with 142 additions and 28 deletions

View File

@@ -85,12 +85,20 @@ struct dirent {
char d_name[16+1];
unsigned int d_off;
unsigned int d_blocks;
unsigned char d_type; /* See CBM_T_xxx defines in cbm.h */
unsigned char d_type; /* See _CBM_T_xxx defines */
/* bsd extensions */
unsigned char d_namlen;
};
/* File type specification macros. We need definitions of CBM file types. */
#include <cbm_filetype.h>
#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_ISLNK(t) ((t) == _CBM_T_LNK)
#elif defined(__LYNX__)
struct dirent {