dirent.mh

来自「开放源码的编译器open watcom 1.6.0版的源代码」· MH 代码 · 共 55 行

MH
55
字号
/*
 *  dirent.h    Portable directory entry definitions
 *
:include crwat.sp
 */
#ifndef _DIRENT_H_INCLUDED

#ifndef __TYPES_H_INCLUDED
 #include <sys/types.h>
#endif

#define _DIRBUF  8  /*  Max number of dir entries buffered  */

:include pshpackl.sp
struct dirent {
    ino_t           d_ino;
    off_t           d_off;
    unsigned short  d_reclen;
#if 0 /* this field is missing for linux kernel 2.2 */
    unsigned char   d_type;
#endif
    char            d_name[256];		/* We must not include limits.h! */
};

#define d_fileno	d_ino	/* Backwards compatibility.  */

#undef  _DIRENT_HAVE_D_NAMLEN
#define _DIRENT_HAVE_D_RECLEN
#define _DIRENT_HAVE_D_OFF
#define _DIRENT_HAVE_D_TYPE

/* This is the data type of directory stream objects.
 * The actual structure is opaque to users.
 */
typedef struct __dirstream DIR;

:include poppack.sp
/*
 *  POSIX 1003.1 Prototypes.
 */
#ifdef __cplusplus
extern "C" {
#endif
_WCRTLINK extern DIR              *opendir( const char *__dirname );
_WCRTLINK extern struct dirent    *readdir( DIR *__dirp );
_WCRTLINK extern void             rewinddir( DIR *__dirp );
_WCRTLINK extern int              closedir( DIR *__dirp );
#ifdef __cplusplus
};
#endif

#define _DIRENT_H_INCLUDED
#endif

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?