make includes fix from trunk
[minix.git] / include / hgfs.h
blob1d5a0dd890027120a7affa1da7e9bf2ed0f246fe
1 /* Part of libhgfs - (c) 2009, D.C. van Moolenbroek */
3 #ifndef _HGFS_H
4 #define _HGFS_H
6 #include <sys/types.h>
7 #include <minix/u64.h>
9 typedef void *hgfs_file_t; /* handle to open file */
10 typedef void *hgfs_dir_t; /* handle to directory search */
12 struct hgfs_attr {
13 u32_t a_mask; /* which fields to retrieve/set */
14 mode_t a_mode; /* file type and permissions */
15 u64_t a_size; /* file size */
16 time_t a_crtime; /* file creation time */
17 time_t a_atime; /* file access time */
18 time_t a_mtime; /* file modification time */
19 time_t a_ctime; /* file change time */
22 #define HGFS_ATTR_SIZE 0x01 /* get/set file size */
23 #define HGFS_ATTR_CRTIME 0x02 /* get/set file creation time */
24 #define HGFS_ATTR_ATIME 0x04 /* get/set file access time */
25 #define HGFS_ATTR_MTIME 0x08 /* get/set file modification time */
26 #define HGFS_ATTR_CTIME 0x10 /* get/set file change time */
27 #define HGFS_ATTR_MODE 0x20 /* get/set file mode */
28 #define HGFS_ATTR_ALL \
29 (HGFS_ATTR_SIZE | HGFS_ATTR_CRTIME | HGFS_ATTR_ATIME | \
30 HGFS_ATTR_MTIME | HGFS_ATTR_CTIME | HGFS_ATTR_MODE)
32 _PROTOTYPE( int hgfs_init, (void) );
33 _PROTOTYPE( void hgfs_cleanup, (void) );
35 _PROTOTYPE( int hgfs_enabled, (void) );
37 _PROTOTYPE( int hgfs_open, (char *path, int flags, int mode,
38 hgfs_file_t *handle) );
39 _PROTOTYPE( int hgfs_read, (hgfs_file_t handle, char *buf, size_t size,
40 u64_t offset) );
41 _PROTOTYPE( int hgfs_write, (hgfs_file_t handle, const char *buf,
42 size_t len, u64_t offset, int append) );
43 _PROTOTYPE( int hgfs_close, (hgfs_file_t handle) );
45 _PROTOTYPE( size_t hgfs_readbuf, (char **ptr) );
46 _PROTOTYPE( size_t hgfs_writebuf, (char **ptr) );
48 _PROTOTYPE( int hgfs_opendir, (char *path, hgfs_dir_t *handle) );
49 _PROTOTYPE( int hgfs_readdir, (hgfs_dir_t handle, unsigned int index,
50 char *buf, size_t size, struct hgfs_attr *attr) );
51 _PROTOTYPE( int hgfs_closedir, (hgfs_dir_t handle) );
53 _PROTOTYPE( int hgfs_getattr, (char *path, struct hgfs_attr *attr) );
54 _PROTOTYPE( int hgfs_setattr, (char *path, struct hgfs_attr *attr) );
56 _PROTOTYPE( int hgfs_mkdir, (char *path, int mode) );
57 _PROTOTYPE( int hgfs_unlink, (char *path) );
58 _PROTOTYPE( int hgfs_rmdir, (char *path) );
59 _PROTOTYPE( int hgfs_rename, (char *opath, char *npath) );
61 _PROTOTYPE( int hgfs_queryvol, (char *path, u64_t *free, u64_t *total) );
63 #endif /* _HGFS_H */