~ubuntu-branches/ubuntu/breezy/php5/breezy-security

« back to all changes in this revision

Viewing changes to TSRM/readdir.h

  • Committer: Bazaar Package Importer
  • Author(s): Adam Conrad
  • Date: 2005-10-09 03:14:32 UTC
  • Revision ID: james.westby@ubuntu.com-20051009031432-kspik3lobxstafv9
Tags: upstream-5.0.5
ImportĀ upstreamĀ versionĀ 5.0.5

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#ifndef READDIR_H
 
2
#define READDIR_H
 
3
 
 
4
 
 
5
/*
 
6
 * Structures and types used to implement opendir/readdir/closedir
 
7
 * on Windows 95/NT.
 
8
 */
 
9
 
 
10
#include <io.h>
 
11
#include <stdio.h>
 
12
#include <stdlib.h>
 
13
#include <sys/types.h>
 
14
 
 
15
 
 
16
/* struct dirent - same as Unix */
 
17
 
 
18
struct dirent {
 
19
        long d_ino;                                     /* inode (always 1 in WIN32) */
 
20
        off_t d_off;                            /* offset to this dirent */
 
21
        unsigned short d_reclen;        /* length of d_name */
 
22
        char d_name[_MAX_FNAME + 1];    /* filename (null terminated) */
 
23
};
 
24
 
 
25
 
 
26
/* typedef DIR - not the same as Unix */
 
27
typedef struct {
 
28
        long handle;                            /* _findfirst/_findnext handle */
 
29
        short offset;                           /* offset into directory */
 
30
        short finished;                         /* 1 if there are not more files */
 
31
        struct _finddata_t fileinfo;    /* from _findfirst/_findnext */
 
32
        char *dir;                                      /* the dir we are reading */
 
33
        struct dirent dent;                     /* the dirent to return */
 
34
} DIR;
 
35
 
 
36
/* Function prototypes */
 
37
DIR *opendir(const char *);
 
38
struct dirent *readdir(DIR *);
 
39
int readdir_r(DIR *, struct dirent *, struct dirent **);
 
40
int closedir(DIR *);
 
41
void rewinddir(DIR *);
 
42
 
 
43
 
 
44
#endif /* READDIR_H */