1/*
2** Distributed under the terms of the Haiku License.
3*/
4#ifndef _FSSH_DIRENT_H
5#define _FSSH_DIRENT_H
6
7
8#include "fssh_defs.h"
9
10
11typedef struct fssh_dirent {
12	fssh_dev_t			d_dev;		/* device */
13	fssh_dev_t			d_pdev;		/* parent device (only for queries) */
14	fssh_ino_t			d_ino;		/* inode number */
15	fssh_ino_t			d_pino;		/* parent inode (only for queries) */
16	unsigned short		d_reclen;	/* length of this record, not the name */
17	char				d_name[1];	/* name of the entry (null byte terminated) */
18} fssh_dirent_t;
19
20typedef struct {
21	int					fd;
22	struct fssh_dirent	ent;
23} fssh_DIR;
24
25#ifdef __cplusplus
26extern "C" {
27#endif
28
29fssh_DIR			*fssh_opendir(const char *dirname);
30struct fssh_dirent	*fssh_readdir(fssh_DIR *dir);
31int					fssh_readdir_r(fssh_DIR *dir, struct fssh_dirent *entry,
32						struct fssh_dirent **_result);
33int					fssh_closedir(fssh_DIR *dir);
34void				fssh_rewinddir(fssh_DIR *dir);
35void 				fssh_seekdir(fssh_DIR *dir, long int loc);
36long int			fssh_telldir(fssh_DIR *);
37
38#ifdef __cplusplus
39}
40#endif
41
42#endif	/* _FSSH_DIRENT_H */
43