/* Headers and macros necessary for reading a directory
 * Taken from server/input.c into separate files when this was needed
 * in server/encounter.c, too
 */

#ifndef M_UNIX
#define M_UNIX
#endif
#define POSIX

#include <sys/types.h>
#ifdef NeXT
#include <sys/dir.h>
#endif

#include <sys/stat.h>
#include <dirent.h>
struct xdirect {
  short d_namlen;
  char  *d_name;
  int   size;
  int   time;
};
#define XDIR DIR

/*struct xdirect *xreaddir(XDIR *, int);*/

#define xopendir(path)          (opendir(path))
#define xclosedir(dir_ptr)      (closedir(dir_ptr))
#define xrewinddir(dir_ptr)     (rewinddir(dir_ptr))

#ifndef S_ISREG
#define S_ISREG(x) (((x) & S_IFMT) == S_IFREG)
#endif

