#ifndef SYS_DIRENT_H
#define SYS_DIRENT_H

/*
**        $VER: sys/dirent.h 1.2 (30.12.00)
**             Includes Release 45.00
**                 StormC Version
**
**    Copyright © 1996/2001 by CyberdyneSystems
**
**            written by Matthias Henze
**               All Rights Reserved
*/

#ifndef STORMAMIGA_H
  #include <stormamiga.h>
#endif

#define MAXNAMLEN 255

#ifdef STORMAMIGA_SASC
  struct  dirent
  {
    ulong  d_ino;                 /* inode number of entry */
    ushort d_reclen;              /* length of this record */
    ushort d_namlen;              /* length of string in d_name */
    off_t  d_off;                 /* offset of disk directory entry */
    char   d_name[MAXNAMLEN + 1]; /* name must be no longer than this */
  };
#else
  struct dirent
  {
    uint   d_fileno;              /* file number of entry */
    ushort d_reclen;              /* length of this record */
    uchar  d_type;                /* file type, see below */
    uchar  d_namlen;              /* length of string in d_name */
    char   d_name[MAXNAMLEN + 1]; /* name must be no longer than this */
  };
#endif

/* File types */
#define DT_UNKNOWN       0
#define DT_FIFO          1
#define DT_CHR           2
#define DT_DIR           4
#define DT_BLK           6
#define DT_REG           8
#define DT_LNK          10
#define DT_SOCK         12
#define DT_WHT          14

/* Convert between stat structure types and directory types. */
#define IFTODT(mode)    (((mode) & 0170000) >> 12)
#define DTTOIF(dirtype) ((dirtype) << 12)

#endif  /* SYS_DIRENT_H */
