4d6c899474
* DISCLAIMER: Ditto. * CRT_noglob.c: Reword copyright and disclaimer. Move Contributors section CONTRIBUTORS file. Remove RCS tags. * CRTFmode.c: Ditto. * CRTglob.c: Ditto. * CRTinit.c: Ditto. * crt1.c: Ditto. * crtdll.dev: Ditto. * dllcrt1.c: Ditto. * dllmain.c: Ditto. * gccmain.c: Ditto. * init.c: Ditto. * isascii.c: Ditto. * iscsym.c: Ditto. * iscsymf.c: Ditto. * jamfile: Ditto. * main.c: Ditto. * msvcrt.def.in: Ditto. * strcasecmp.c: Ditto. * toascii.c: Ditto. * wcscmpi.c: Ditto. * include/assert.h: Ditto. * include/conio.h: Ditto. * include/ctype.h: Ditto. * include/direct.h: Ditto. * include/dirent.h: Ditto. * include/dos.h: Ditto. * include/errno.h: Ditto. * include/excpt.h: Ditto. * include/fcntl.h: Ditto. * include/float.h: Ditto. * include/io.h: Ditto. * include/locale.h: Ditto. * include/malloc.h: Ditto. * include/math.h: Ditto. * include/process.h: Ditto. * include/setjmp.h: Ditto. * include/share.h: Ditto. * include/signal.h: Ditto. * include/stdio.h: Ditto. * include/stdlib.h: Ditto. * include/string.h: Ditto. * include/tchar.h: Ditto. * include/time.h: Ditto. * include/wchar.h: Ditto. * include/sys/locking.h: Ditto. * include/sys/param.h: Ditto. * include/sys/stat.h: Ditto. * include/sys/timeb.h: Ditto. * include/sys/types.h: Ditto. * include/sys/utime.h: Ditto. * mingwex/dirent.c: Ditto.
125 lines
2.9 KiB
C
125 lines
2.9 KiB
C
/*
|
|
* DIRENT.H (formerly DIRLIB.H)
|
|
* This file has no copyright assigned and is placed in the Public Domain.
|
|
* This file is a part of the mingw-runtime package.
|
|
* No warranty is given; refer to the file DISCLAIMER within the package.
|
|
*
|
|
*/
|
|
#ifndef _DIRENT_H_
|
|
#define _DIRENT_H_
|
|
|
|
/* All the headers include this file. */
|
|
#include <_mingw.h>
|
|
|
|
#include <io.h>
|
|
|
|
#ifndef RC_INVOKED
|
|
|
|
#ifdef __cplusplus
|
|
extern "C" {
|
|
#endif
|
|
|
|
struct dirent
|
|
{
|
|
long d_ino; /* Always zero. */
|
|
unsigned short d_reclen; /* Always zero. */
|
|
unsigned short d_namlen; /* Length of name in d_name. */
|
|
char d_name[FILENAME_MAX]; /* File name. */
|
|
};
|
|
|
|
/*
|
|
* This is an internal data structure. Good programmers will not use it
|
|
* except as an argument to one of the functions below.
|
|
* dd_stat field is now int (was short in older versions).
|
|
*/
|
|
typedef struct
|
|
{
|
|
/* disk transfer area for this dir */
|
|
struct _finddata_t dd_dta;
|
|
|
|
/* dirent struct to return from dir (NOTE: this makes this thread
|
|
* safe as long as only one thread uses a particular DIR struct at
|
|
* a time) */
|
|
struct dirent dd_dir;
|
|
|
|
/* _findnext handle */
|
|
long dd_handle;
|
|
|
|
/*
|
|
* Status of search:
|
|
* 0 = not started yet (next entry to read is first entry)
|
|
* -1 = off the end
|
|
* positive = 0 based index of next entry
|
|
*/
|
|
int dd_stat;
|
|
|
|
/* given path for dir with search pattern (struct is extended) */
|
|
char dd_name[1];
|
|
} DIR;
|
|
|
|
DIR* __cdecl opendir (const char*);
|
|
struct dirent* __cdecl readdir (DIR*);
|
|
int __cdecl closedir (DIR*);
|
|
void __cdecl rewinddir (DIR*);
|
|
long __cdecl telldir (DIR*);
|
|
void __cdecl seekdir (DIR*, long);
|
|
|
|
|
|
/* wide char versions */
|
|
|
|
struct _wdirent
|
|
{
|
|
long d_ino; /* Always zero. */
|
|
unsigned short d_reclen; /* Always zero. */
|
|
unsigned short d_namlen; /* Length of name in d_name. */
|
|
wchar_t d_name[FILENAME_MAX]; /* File name. */
|
|
/* NOTE: The name in the dirent structure points to the name in the * wfinddata_t structure in the _WDIR. */
|
|
};
|
|
|
|
/*
|
|
* This is an internal data structure. Good programmers will not use it
|
|
* except as an argument to one of the functions below.
|
|
*/
|
|
typedef struct
|
|
{
|
|
/* disk transfer area for this dir */
|
|
struct _wfinddata_t dd_dta;
|
|
|
|
/* dirent struct to return from dir (NOTE: this makes this thread
|
|
* safe as long as only one thread uses a particular DIR struct at
|
|
* a time) */
|
|
struct _wdirent dd_dir;
|
|
|
|
/* _findnext handle */
|
|
long dd_handle;
|
|
|
|
/*
|
|
* Status of search:
|
|
* 0 = not started yet (next entry to read is first entry)
|
|
* -1 = off the end
|
|
* positive = 0 based index of next entry
|
|
*/
|
|
int dd_stat;
|
|
|
|
/* given path for dir with search pattern (struct is extended) */
|
|
wchar_t dd_name[1];
|
|
} _WDIR;
|
|
|
|
|
|
|
|
_WDIR* __cdecl _wopendir (const wchar_t*);
|
|
struct _wdirent* __cdecl _wreaddir (_WDIR*);
|
|
int __cdecl _wclosedir (_WDIR*);
|
|
void __cdecl _wrewinddir (_WDIR*);
|
|
long __cdecl _wtelldir (_WDIR*);
|
|
void __cdecl _wseekdir (_WDIR*, long);
|
|
|
|
|
|
#ifdef __cplusplus
|
|
}
|
|
#endif
|
|
|
|
#endif /* Not RC_INVOKED */
|
|
|
|
#endif /* Not _DIRENT_H_ */
|