update for HEAD-2002110701
[reactos.git] / include / crtdll / dirent.h
1 /*
2  * DIRENT.H (formerly DIRLIB.H)
3  *
4  * by M. J. Weinstein   Released to public domain 1-Jan-89
5  *
6  * Because I have heard that this feature (opendir, readdir, closedir)
7  * it so useful for programmers coming from UNIX or attempting to port
8  * UNIX code, and because it is reasonably light weight, I have included
9  * it in the Mingw32 package.
10  *   - Colin Peters <colin@bird.fu.is.saga-u.ac.jp>
11  *
12  *  This code is distributed in the hope that is will be useful but
13  *  WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY
14  *  DISCLAMED. This includeds but is not limited to warranties of
15  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
16  *
17  * $Revision$
18  * $Author$
19  * $Date$
20  *
21  */
22
23 #ifndef _STRICT_ANSI
24
25 #ifndef _DIRENT_H_
26 #define _DIRENT_H_
27
28 #include <crtdll/dir.h>
29
30 #ifdef __cplusplus
31 extern "C" {
32 #endif
33
34 struct dirent
35 {
36         long            d_ino;
37         unsigned short  d_reclen;
38         unsigned short  d_namlen;
39         char            d_name[FILENAME_MAX+1];
40 };
41
42 typedef struct
43 {
44         struct _finddata_t      dd_dta;         /* disk transfer area for this dir */
45         struct dirent           dd_dir;         /* dirent struct to return from dir */
46         long                    dd_handle;      /* _findnext handle */
47         short                   dd_stat;        /* status return from last lookup */
48         char                    dd_name[1];     /* full name of file (struct is extended */
49 } DIR;
50
51 DIR*            opendir (const char* szPath);
52 struct dirent*  readdir (DIR* dir);
53 int             closedir (DIR* dir);
54
55 #ifdef  __cplusplus
56 }
57 #endif
58
59 #endif _DIRENT_H_
60
61 #endif /* Not _STRICT_ANSI */