QQ登录

只需一步,快速开始

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 1269|回复: 0

关于opendir函数的返回类型DIR

[复制链接]
发表于 2003-5-18 16:29:32 | 显示全部楼层 |阅读模式
函数原型为:
DIR *opendir(const char *pathname);
返回值数据类型为DIR,可是在包含文件中找到:
typedef struct __dirstream DIR;
但找不到struct __dirstream的具体定义。
请问struct __dirstream在那里定义?是如何定义的?
谢谢!


别人说在dirent.h里有如下定义:
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;                /* File name. */
        /* NOTE: The name in the dirent structure points to the name in the
         *       finddata_t structure in the DIR. */
};

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;
我的怎么没有,难道不是在/usr/include/dirent.h或/usr/include/bits/dirent.h中吗?
您需要登录后才可以回帖 登录 | 注册

本版积分规则

GMT+8, 2024-11-15 20:29 , Processed in 0.047483 second(s), 16 queries .

© 2021 Powered by Discuz! X3.5.

快速回复 返回顶部 返回列表