root/trunk/libarchive-d/libarchive/entry.d

Revision 246, 5.9 kB (checked in by Anders, 4 years ago)

Add sqlite3 and libarchive bindings written by me. They are both hand-made, so typos may have went in but I think these should be of OK quality.

Line 
1 //
2 // libarchive modules for D
3 // Written by Anders Bergh <anders1@gmail.com>
4 // Released into the public domain
5 //
6
7 module libarchive.entry;
8
9 import libarchive.types;
10
11 extern (C):
12
13 struct archive_entry;
14
15 const int AE_IFMT = 0170000;
16 const int AE_IFREG = 0100000;
17 const int AE_IFLNK = 0120000;
18 const int AE_IFSOCK = 0140000;
19 const int AE_IFCHR = 0020000;
20 const int AE_IFBLK = 0060000;
21 const int AE_IFDIR = 0040000;
22 const int AE_IFIFO = 0010000;
23
24 archive_entry* archive_entry_clear(archive_entry*);
25 archive_entry* archive_entry_clone(archive_entry*);
26 void archive_entry_free(archive_entry*);
27 archive_entry* archive_entry_new();
28
29 time_t archive_entry_atime(archive_entry*);
30 int archive_entry_atime_nsec(archive_entry*);
31 time_t archive_entry_ctime(archive_entry*);
32 int archive_entry_ctime_nsec(archive_entry*);
33 dev_t archive_entry_dev(archive_entry*);
34 dev_t archive_entry_devmajor(archive_entry*);
35 dev_t archive_entry_devminor(archive_entry*);
36 mode_t archive_entry_filetype(archive_entry*);
37 void archive_entry_fflags(archive_entry*, uint *set, uint *clear);
38 char* archive_entry_fflags_text(archive_entry*);
39 gid_t archive_entry_gid(archive_entry*);
40 char* archive_entry_gname(archive_entry*);
41 wchar* archive_entry_gname_w(archive_entry*);
42 char* archive_entry_hardlink(archive_entry*);
43 wchar* archive_entry_hardlink_w(archive_entry*);
44 ino_t archive_entry_ino(archive_entry*);
45 mode_t archive_entry_mode(archive_entry*);
46 time_t archive_entry_mtime(archive_entry*);
47 int archive_entry_mtime_nsec(archive_entry*);
48 uint archive_entry_nlink(archive_entry*);
49 char* archive_entry_pathname(archive_entry*);
50 wchar* archive_entry_pathname_w(archive_entry*);
51 dev_t archive_entry_rdev(archive_entry*);
52 dev_t archive_entry_rdevmajor(archive_entry*);
53 dev_t archive_entry_rdevminor(archive_entry*);
54 int64_t archive_entry_size(archive_entry*);
55 char* archive_entry_strmode(archive_entry*);
56 char* archive_entry_symlink(archive_entry*);
57 wchar* archive_entry_symlink_w(archive_entry*);
58 uid_t archive_entry_uid(archive_entry*);
59 char* archive_entry_uname(archive_entry*);
60 wchar* archive_entry_uname_w(archive_entry*);
61
62 void archive_entry_set_atime(archive_entry*, time_t, int);
63 void archive_entry_set_ctime(archive_entry*, time_t, int);
64 void archive_entry_set_dev(archive_entry*, dev_t);
65 void archive_entry_set_devmajor(archive_entry*, dev_t);
66 void archive_entry_set_devminor(archive_entry*, dev_t);
67 void archive_entry_set_filetype(archive_entry*, uint);
68 void archive_entry_set_fflags(archive_entry*, uint set, uint clear);
69 wchar* archive_entry_copy_fflags_text_w(archive_entry*, wchar*);
70 void    archive_entry_set_gid(archive_entry*, gid_t);
71 void    archive_entry_set_gname(archive_entry*, char*);
72 void    archive_entry_copy_gname(archive_entry*, char*);
73 void    archive_entry_copy_gname_w(archive_entry*, wchar*);
74 void    archive_entry_set_hardlink(archive_entry*, char*);
75 void    archive_entry_copy_hardlink(archive_entry*, char*);
76 void    archive_entry_copy_hardlink_w(archive_entry*, wchar*);
77 void    archive_entry_set_ino(archive_entry*, uint);
78 void    archive_entry_set_link(archive_entry*, char*);
79 void    archive_entry_set_mode(archive_entry*, mode_t);
80 void    archive_entry_set_mtime(archive_entry*, time_t, long);
81 void    archive_entry_set_nlink(archive_entry*, uint);
82 void    archive_entry_set_pathname(archive_entry*, char*);
83 void    archive_entry_copy_pathname(archive_entry*, char*);
84 void    archive_entry_copy_pathname_w(archive_entry*, wchar*);
85 void    archive_entry_set_perm(archive_entry*, mode_t);
86 void    archive_entry_set_rdev(archive_entry*, dev_t);
87 void    archive_entry_set_rdevmajor(archive_entry*, dev_t);
88 void    archive_entry_set_rdevminor(archive_entry*, dev_t);
89 void    archive_entry_set_size(archive_entry*, int64_t);
90 void    archive_entry_set_symlink(archive_entry*, char*);
91 void    archive_entry_copy_symlink(archive_entry*, char*);
92 void    archive_entry_copy_symlink_w(archive_entry*, wchar*);
93 void    archive_entry_set_uid(archive_entry*, uid_t);
94 void    archive_entry_set_uname(archive_entry*, char*);
95 void    archive_entry_copy_uname(archive_entry*, char*);
96 void    archive_entry_copy_uname_w(archive_entry*, wchar*);
97
98 stat_t* archive_entry_stat(archive_entry*);
99 void archive_entry_copy_stat(archive_entry*, stat_t*);
100
101 const int ARCHIVE_ENTRY_ACL_EXECUTE = 1;
102 const int ARCHIVE_ENTRY_ACL_WRITE = 2;
103 const int ARCHIVE_ENTRY_ACL_READ = 4;
104
105 const int ARCHIVE_ENTRY_ACL_TYPE_ACCESS = 256;
106 const int ARCHIVE_ENTRY_ACL_TYPE_DEFAULT = 512;
107
108 const int ARCHIVE_ENTRY_ACL_USER = 10001;
109 const int ARCHIVE_ENTRY_ACL_USER_OBJ = 10002;
110 const int ARCHIVE_ENTRY_ACL_GROUP = 10003;
111 const int ARCHIVE_ENTRY_ACL_GROUP_OBJ = 10004;
112 const int ARCHIVE_ENTRY_ACL_MASK = 10005;
113 const int ARCHIVE_ENTRY_ACL_OTHER = 10006;
114
115 void archive_entry_acl_clear(archive_entry*);
116 void archive_entry_acl_add_entry(archive_entry*, int type, int permset, int tag, int qual, char* name);
117 void archive_entry_acl_add_entry_w(archive_entry*, int type, int permset, int tag, int qual, wchar* name);
118
119 int archive_entry_acl_reset(archive_entry*, int want_type);
120 int archive_entry_acl_next(archive_entry*, int want_type, int* type, int* permset, int* tag, int* qual, char** name);
121 int archive_entry_acl_next_w(archive_entry*, int want_type, int* type, int* permset, int* tag, int* qual, wchar** name);
122
123 const int ARCHIVE_ENTRY_ACL_STYLE_EXTRA_ID = 1024;
124 const int ARCHIVE_ENTRY_ACL_STYLE_MARK_DEFAULT = 2048;
125 wchar* archive_entry_acl_text_w(archive_entry*, int flags);
126
127 int archive_entry_acl_count(archive_entry*, int want_type);
128
129 int __archive_entry_acl_parse_w(archive_entry*, wchar*, int type);
130
131 void archive_entry_xattr_clear(archive_entry*);
132 void archive_entry_xattr_add_entry(archive_entry*, char* name, void* value, size_t size);
133
134 int archive_entry_xattr_count(archive_entry*);
135 int archive_entry_xattr_reset(archive_entry*);
136 int archive_entry_xattr_next(archive_entry*, char** name, void** value, size_t*);
137
138 struct archive_entry_linkresolver;
139
140 archive_entry_linkresolver* archive_entry_linkresolver_new();
141 void archive_entry_linkresolver_free(archive_entry_linkresolver*);
142 char* archive_entry_linkresolve(archive_entry_linkresolver*, archive_entry*);
Note: See TracBrowser for help on using the browser.