home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The C Users' Group Library 1994 August
/
wc-cdrom-cusersgrouplibrary-1994-08.iso
/
listings
/
v_01_04
/
1n04016a
< prev
next >
Wrap
Text File
|
1990-07-18
|
2KB
|
61 lines
/*
** Figure 1 - DIRENT.H
*/
#ifndef DIRENT_H
#define DIRENT_H
#include <stdio.h> /* For FILENAME_MAX */
#include <dos.h>
#if defined(__ZTC__)
#define DSTRUCT FIND /* ZTC/C++ */
#define ATTRIBUTE attribute
#define NAME name
#pragma pack(1)
#include <direct.h>
#elif defined(__TURBOC__)
#define DSTRUCT ffblk /* TC/C++ */
#define ATTRIBUTE ff_attrib
#define NAME ff_name
#include <dir.h>
#else
#define DSTRUCT find_t /* Assume MSC/QC */
#define ATTRIBUTE attrib
#define NAME name
#pragma pack(1)
#include <direct.h>
#endif
#define FA_ANY 0xff
#undef FA_DIREC
#define FA_DIREC 0x10
struct DSTRUCT *rfind_1st(char *, unsigned, struct DSTRUCT *);
struct DSTRUCT *rfind_nxt(struct DSTRUCT *);
typedef struct
{
int dd_fd;
unsigned dd_loc,
dd_size;
struct DSTRUCT dd_buf;
char dd_dirname[FILENAME_MAX];
} DOS_DIR;
DOS_DIR *opendir(char *);
int closedir(DOS_DIR *),
rewinddir(DOS_DIR *);
struct DSTRUCT *readdir(DOS_DIR *),
*seekdir(DOS_DIR *, int, int);
#define telldir(dd) dd->loc
int patmat(const char *, const char *);
int dirmask(struct DSTRUCT *,char *,char *,unsigned,unsigned);
extern int DFerr;
extern DOS_DIR _DIRS[];
#endif /* DIRENT_H */