1 #ifndef _LIBHX_IO_H
2 #define _LIBHX_IO_H 1
3 
4 #include <sys/types.h>
5 
6 #ifdef __cplusplus
7 extern "C" {
8 #endif
9 
10 #ifndef __libhx_internal_hxmc_t_defined
11 #define __libhx_internal_hxmc_t_defined 1
12 typedef char hxmc_t;
13 #endif
14 
15 enum {
16 	HXF_UID  = 1 << 0,
17 	HXF_GID  = 1 << 1,
18 	HXF_KEEP = 1 << 2,
19 	HX_REALPATH_NOFLAGS  = 0,
20 	HX_REALPATH_ABSOLUTE = 1 << 0,
21 	HX_REALPATH_SELF     = 1 << 1,
22 	HX_REALPATH_PARENT   = 1 << 2,
23 	/* HX_REALPATH_SYMLINK  = 1 << 3, removed in v3.13, thus blocked */
24 	HX_REALPATH_DEFAULT  = HX_REALPATH_SELF | HX_REALPATH_PARENT,
25 };
26 
27 struct HXdir;
28 
29 extern struct HXdir *HXdir_open(const char *);
30 extern const char *HXdir_read(struct HXdir *);
31 extern void HXdir_close(struct HXdir *);
32 extern int HX_copy_dir(const char *, const char *, unsigned int, ...);
33 extern int HX_copy_file(const char *, const char *, unsigned int, ...);
34 extern int HX_mkdir(const char *, unsigned int);
35 extern int HX_readlink(hxmc_t **, const char *);
36 extern int HX_realpath(hxmc_t **, const char *, unsigned int);
37 extern int HX_rrmdir(const char *);
38 
39 extern ssize_t HXio_fullread(int, void *, size_t);
40 extern ssize_t HXio_fullwrite(int, const void *, size_t);
41 
42 #ifdef __cplusplus
43 } /* extern "C" */
44 #endif
45 
46 #endif /* _LIBHX_IO_H */
47