sortix-mirror/libmaxsi/c/decl/DIR.h
Jonas 'Sortie' Termansen d2c4b1d6ac Added readdir(3), closedir(3), rewinddir(3), dirfd(3), fdopendir(3),
opendir(3).

Also added non-standard dregister(3), dunregister(3), dclearerr(3),
derror(3), deof(3), dnewdir(3), dcloseall(3).
2012-01-15 00:51:27 +01:00

24 lines
546 B
C

#ifndef _DIR_DECL
#define _DIR_DECL
struct dirent;
#define _DIR_REGISTERED (1<<0)
#define _DIR_ERROR (1<<1)
#define _DIR_EOF (1<<2)
typedef struct _DIR
{
void* user;
int (*read_func)(void* user, struct dirent* dirent, size_t* size);
int (*rewind_func)(void* user);
int (*fd_func)(void* user);
int (*close_func)(void* user);
void (*free_func)(struct _DIR* dir);
/* Application writers shouldn't use anything beyond this point. */
struct _DIR* prev;
struct _DIR* next;
struct dirent* entry;
size_t entrysize;
int flags;
} DIR;
#endif