xref: /haiku/headers/private/fs_shell/fssh_dirent.h (revision 893988af824e65e49e55f517b157db8386e8002b)
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 
11 typedef 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 
20 typedef struct {
21 	int					fd;
22 	struct fssh_dirent	ent;
23 } fssh_DIR;
24 
25 #ifdef __cplusplus
26 extern "C" {
27 #endif
28 
29 fssh_DIR			*fssh_opendir(const char *dirname);
30 struct fssh_dirent	*fssh_readdir(fssh_DIR *dir);
31 int					fssh_readdir_r(fssh_DIR *dir, struct fssh_dirent *entry,
32 						struct fssh_dirent **_result);
33 int					fssh_closedir(fssh_DIR *dir);
34 void				fssh_rewinddir(fssh_DIR *dir);
35 void 				fssh_seekdir(fssh_DIR *dir, long int loc);
36 long int			fssh_telldir(fssh_DIR *);
37 
38 #ifdef __cplusplus
39 }
40 #endif
41 
42 #endif	/* _FSSH_DIRENT_H */
43