alpm_sys/
ffi.rs

1/* automatically generated by rust-bindgen 0.70.1 */
2
3pub type __mode_t = ::std::os::raw::c_uint;
4pub type __off_t = ::std::os::raw::c_long;
5pub type mode_t = __mode_t;
6pub type off_t = __off_t;
7pub type va_list = __builtin_va_list;
8#[repr(C)]
9#[derive(Debug, Copy, Clone)]
10pub struct archive {
11    _unused: [u8; 0],
12}
13#[repr(C)]
14#[derive(Debug, Copy, Clone)]
15pub struct archive_entry {
16    _unused: [u8; 0],
17}
18#[repr(C)]
19#[derive(Debug, Copy, Clone)]
20pub struct _alpm_list_t {
21    pub data: *mut ::std::os::raw::c_void,
22    pub prev: *mut _alpm_list_t,
23    pub next: *mut _alpm_list_t,
24}
25#[allow(clippy::unnecessary_operation, clippy::identity_op)]
26const _: () = {
27    ["Size of _alpm_list_t"][::std::mem::size_of::<_alpm_list_t>() - 24usize];
28    ["Alignment of _alpm_list_t"][::std::mem::align_of::<_alpm_list_t>() - 8usize];
29    ["Offset of field: _alpm_list_t::data"][::std::mem::offset_of!(_alpm_list_t, data) - 0usize];
30    ["Offset of field: _alpm_list_t::prev"][::std::mem::offset_of!(_alpm_list_t, prev) - 8usize];
31    ["Offset of field: _alpm_list_t::next"][::std::mem::offset_of!(_alpm_list_t, next) - 16usize];
32};
33pub type alpm_list_t = _alpm_list_t;
34pub type alpm_list_fn_free =
35    ::std::option::Option<unsafe extern "C" fn(item: *mut ::std::os::raw::c_void)>;
36pub type alpm_list_fn_cmp = ::std::option::Option<
37    unsafe extern "C" fn(
38        arg1: *const ::std::os::raw::c_void,
39        arg2: *const ::std::os::raw::c_void,
40    ) -> ::std::os::raw::c_int,
41>;
42extern "C" {
43    pub fn alpm_list_free(list: *mut alpm_list_t);
44}
45extern "C" {
46    pub fn alpm_list_free_inner(list: *mut alpm_list_t, fn_: alpm_list_fn_free);
47}
48extern "C" {
49    pub fn alpm_list_add(
50        list: *mut alpm_list_t,
51        data: *mut ::std::os::raw::c_void,
52    ) -> *mut alpm_list_t;
53}
54extern "C" {
55    pub fn alpm_list_append(
56        list: *mut *mut alpm_list_t,
57        data: *mut ::std::os::raw::c_void,
58    ) -> *mut alpm_list_t;
59}
60extern "C" {
61    pub fn alpm_list_append_strdup(
62        list: *mut *mut alpm_list_t,
63        data: *const ::std::os::raw::c_char,
64    ) -> *mut alpm_list_t;
65}
66extern "C" {
67    pub fn alpm_list_add_sorted(
68        list: *mut alpm_list_t,
69        data: *mut ::std::os::raw::c_void,
70        fn_: alpm_list_fn_cmp,
71    ) -> *mut alpm_list_t;
72}
73extern "C" {
74    pub fn alpm_list_join(first: *mut alpm_list_t, second: *mut alpm_list_t) -> *mut alpm_list_t;
75}
76extern "C" {
77    pub fn alpm_list_mmerge(
78        left: *mut alpm_list_t,
79        right: *mut alpm_list_t,
80        fn_: alpm_list_fn_cmp,
81    ) -> *mut alpm_list_t;
82}
83extern "C" {
84    pub fn alpm_list_msort(
85        list: *mut alpm_list_t,
86        n: usize,
87        fn_: alpm_list_fn_cmp,
88    ) -> *mut alpm_list_t;
89}
90extern "C" {
91    pub fn alpm_list_remove_item(
92        haystack: *mut alpm_list_t,
93        item: *mut alpm_list_t,
94    ) -> *mut alpm_list_t;
95}
96extern "C" {
97    pub fn alpm_list_remove(
98        haystack: *mut alpm_list_t,
99        needle: *const ::std::os::raw::c_void,
100        fn_: alpm_list_fn_cmp,
101        data: *mut *mut ::std::os::raw::c_void,
102    ) -> *mut alpm_list_t;
103}
104extern "C" {
105    pub fn alpm_list_remove_str(
106        haystack: *mut alpm_list_t,
107        needle: *const ::std::os::raw::c_char,
108        data: *mut *mut ::std::os::raw::c_char,
109    ) -> *mut alpm_list_t;
110}
111extern "C" {
112    pub fn alpm_list_remove_dupes(list: *const alpm_list_t) -> *mut alpm_list_t;
113}
114extern "C" {
115    pub fn alpm_list_strdup(list: *const alpm_list_t) -> *mut alpm_list_t;
116}
117extern "C" {
118    pub fn alpm_list_copy(list: *const alpm_list_t) -> *mut alpm_list_t;
119}
120extern "C" {
121    pub fn alpm_list_copy_data(list: *const alpm_list_t, size: usize) -> *mut alpm_list_t;
122}
123extern "C" {
124    pub fn alpm_list_reverse(list: *mut alpm_list_t) -> *mut alpm_list_t;
125}
126extern "C" {
127    pub fn alpm_list_nth(list: *const alpm_list_t, n: usize) -> *mut alpm_list_t;
128}
129extern "C" {
130    pub fn alpm_list_next(list: *const alpm_list_t) -> *mut alpm_list_t;
131}
132extern "C" {
133    pub fn alpm_list_previous(list: *const alpm_list_t) -> *mut alpm_list_t;
134}
135extern "C" {
136    pub fn alpm_list_last(list: *const alpm_list_t) -> *mut alpm_list_t;
137}
138extern "C" {
139    pub fn alpm_list_count(list: *const alpm_list_t) -> usize;
140}
141extern "C" {
142    pub fn alpm_list_find(
143        haystack: *const alpm_list_t,
144        needle: *const ::std::os::raw::c_void,
145        fn_: alpm_list_fn_cmp,
146    ) -> *mut ::std::os::raw::c_void;
147}
148extern "C" {
149    pub fn alpm_list_find_ptr(
150        haystack: *const alpm_list_t,
151        needle: *const ::std::os::raw::c_void,
152    ) -> *mut ::std::os::raw::c_void;
153}
154extern "C" {
155    pub fn alpm_list_find_str(
156        haystack: *const alpm_list_t,
157        needle: *const ::std::os::raw::c_char,
158    ) -> *mut ::std::os::raw::c_char;
159}
160extern "C" {
161    pub fn alpm_list_cmp_unsorted(
162        left: *const alpm_list_t,
163        right: *const alpm_list_t,
164        fn_: alpm_list_fn_cmp,
165    ) -> ::std::os::raw::c_int;
166}
167extern "C" {
168    pub fn alpm_list_diff_sorted(
169        left: *const alpm_list_t,
170        right: *const alpm_list_t,
171        fn_: alpm_list_fn_cmp,
172        onlyleft: *mut *mut alpm_list_t,
173        onlyright: *mut *mut alpm_list_t,
174    );
175}
176extern "C" {
177    pub fn alpm_list_diff(
178        lhs: *const alpm_list_t,
179        rhs: *const alpm_list_t,
180        fn_: alpm_list_fn_cmp,
181    ) -> *mut alpm_list_t;
182}
183extern "C" {
184    pub fn alpm_list_to_array(
185        list: *const alpm_list_t,
186        n: usize,
187        size: usize,
188    ) -> *mut ::std::os::raw::c_void;
189}
190#[doc = " The libalpm context handle.\n\n This struct represents an instance of libalpm.\n @ingroup libalpm_handle"]
191pub type alpm_handle_t = u8;
192#[doc = " A database.\n\n A database is a container that stores metadata about packages.\n\n A database can be located on the local filesystem or on a remote server.\n\n To use a database, it must first be registered via \\link alpm_register_syncdb \\endlink.\n If the database is already present in dbpath then it will be usable. Otherwise,\n the database needs to be downloaded using \\link alpm_db_update \\endlink. Even if the\n source of the database is the local filesystem.\n\n After this, the database can be used to query packages and groups. Any packages or groups\n from the database will continue to be owned by the database and do not need to be freed by\n the user. They will be freed when the database is unregistered.\n\n Databases are automatically unregistered when the \\link alpm_handle_t \\endlink is released.\n @ingroup libalpm_databases"]
193pub type alpm_db_t = u8;
194#[doc = " A package.\n\n A package can be loaded from disk via \\link alpm_pkg_load \\endlink or retrieved from a database.\n Packages from databases are automatically freed when the database is unregistered. Packages loaded\n from a file must be freed manually.\n\n Packages can then be queried for metadata or added to a transaction\n to be added or removed from the system.\n @ingroup libalpm_packages"]
195pub type alpm_pkg_t = u8;
196#[doc = " The extended data type used to store non-standard package data fields\n @ingroup libalpm_packages"]
197#[repr(C)]
198#[derive(Debug, Copy, Clone)]
199pub struct _alpm_pkg_xdata_t {
200    pub name: *mut ::std::os::raw::c_char,
201    pub value: *mut ::std::os::raw::c_char,
202}
203#[allow(clippy::unnecessary_operation, clippy::identity_op)]
204const _: () = {
205    ["Size of _alpm_pkg_xdata_t"][::std::mem::size_of::<_alpm_pkg_xdata_t>() - 16usize];
206    ["Alignment of _alpm_pkg_xdata_t"][::std::mem::align_of::<_alpm_pkg_xdata_t>() - 8usize];
207    ["Offset of field: _alpm_pkg_xdata_t::name"]
208        [::std::mem::offset_of!(_alpm_pkg_xdata_t, name) - 0usize];
209    ["Offset of field: _alpm_pkg_xdata_t::value"]
210        [::std::mem::offset_of!(_alpm_pkg_xdata_t, value) - 8usize];
211};
212#[doc = " The extended data type used to store non-standard package data fields\n @ingroup libalpm_packages"]
213pub type alpm_pkg_xdata_t = _alpm_pkg_xdata_t;
214#[doc = " The time type used by libalpm. Represents a unix time stamp\n @ingroup libalpm_misc"]
215pub type alpm_time_t = i64;
216#[doc = " File in a package"]
217#[repr(C)]
218#[derive(Debug, Copy, Clone)]
219pub struct _alpm_file_t {
220    #[doc = " Name of the file"]
221    pub name: *mut ::std::os::raw::c_char,
222    #[doc = " Size of the file"]
223    pub size: off_t,
224    #[doc = " The file's permissions"]
225    pub mode: mode_t,
226}
227#[allow(clippy::unnecessary_operation, clippy::identity_op)]
228const _: () = {
229    ["Size of _alpm_file_t"][::std::mem::size_of::<_alpm_file_t>() - 24usize];
230    ["Alignment of _alpm_file_t"][::std::mem::align_of::<_alpm_file_t>() - 8usize];
231    ["Offset of field: _alpm_file_t::name"][::std::mem::offset_of!(_alpm_file_t, name) - 0usize];
232    ["Offset of field: _alpm_file_t::size"][::std::mem::offset_of!(_alpm_file_t, size) - 8usize];
233    ["Offset of field: _alpm_file_t::mode"][::std::mem::offset_of!(_alpm_file_t, mode) - 16usize];
234};
235#[doc = " File in a package"]
236pub type alpm_file_t = _alpm_file_t;
237#[doc = " Package filelist container"]
238#[repr(C)]
239#[derive(Debug, Copy, Clone)]
240pub struct _alpm_filelist_t {
241    #[doc = " Amount of files in the array"]
242    pub count: usize,
243    #[doc = " An array of files"]
244    pub files: *mut alpm_file_t,
245}
246#[allow(clippy::unnecessary_operation, clippy::identity_op)]
247const _: () = {
248    ["Size of _alpm_filelist_t"][::std::mem::size_of::<_alpm_filelist_t>() - 16usize];
249    ["Alignment of _alpm_filelist_t"][::std::mem::align_of::<_alpm_filelist_t>() - 8usize];
250    ["Offset of field: _alpm_filelist_t::count"]
251        [::std::mem::offset_of!(_alpm_filelist_t, count) - 0usize];
252    ["Offset of field: _alpm_filelist_t::files"]
253        [::std::mem::offset_of!(_alpm_filelist_t, files) - 8usize];
254};
255#[doc = " Package filelist container"]
256pub type alpm_filelist_t = _alpm_filelist_t;
257#[doc = " Local package or package file backup entry"]
258#[repr(C)]
259#[derive(Debug, Copy, Clone)]
260pub struct _alpm_backup_t {
261    #[doc = " Name of the file (without .pacsave extension)"]
262    pub name: *mut ::std::os::raw::c_char,
263    #[doc = " Hash of the filename (used internally)"]
264    pub hash: *mut ::std::os::raw::c_char,
265}
266#[allow(clippy::unnecessary_operation, clippy::identity_op)]
267const _: () = {
268    ["Size of _alpm_backup_t"][::std::mem::size_of::<_alpm_backup_t>() - 16usize];
269    ["Alignment of _alpm_backup_t"][::std::mem::align_of::<_alpm_backup_t>() - 8usize];
270    ["Offset of field: _alpm_backup_t::name"]
271        [::std::mem::offset_of!(_alpm_backup_t, name) - 0usize];
272    ["Offset of field: _alpm_backup_t::hash"]
273        [::std::mem::offset_of!(_alpm_backup_t, hash) - 8usize];
274};
275#[doc = " Local package or package file backup entry"]
276pub type alpm_backup_t = _alpm_backup_t;
277extern "C" {
278    #[doc = " Determines whether a package filelist contains a given path.\n The provided path should be relative to the install root with no leading\n slashes, e.g. \"etc/localtime\". When searching for directories, the path must\n have a trailing slash.\n @param filelist a pointer to a package filelist\n @param path the path to search for in the package\n @return a pointer to the matching file or NULL if not found"]
279    pub fn alpm_filelist_contains(
280        filelist: *const alpm_filelist_t,
281        path: *const ::std::os::raw::c_char,
282    ) -> *mut alpm_file_t;
283}
284#[doc = " Package group"]
285#[repr(C)]
286#[derive(Debug, Copy, Clone)]
287pub struct _alpm_group_t {
288    #[doc = " group name"]
289    pub name: *mut ::std::os::raw::c_char,
290    #[doc = " list of alpm_pkg_t packages"]
291    pub packages: *mut alpm_list_t,
292}
293#[allow(clippy::unnecessary_operation, clippy::identity_op)]
294const _: () = {
295    ["Size of _alpm_group_t"][::std::mem::size_of::<_alpm_group_t>() - 16usize];
296    ["Alignment of _alpm_group_t"][::std::mem::align_of::<_alpm_group_t>() - 8usize];
297    ["Offset of field: _alpm_group_t::name"][::std::mem::offset_of!(_alpm_group_t, name) - 0usize];
298    ["Offset of field: _alpm_group_t::packages"]
299        [::std::mem::offset_of!(_alpm_group_t, packages) - 8usize];
300};
301#[doc = " Package group"]
302pub type alpm_group_t = _alpm_group_t;
303extern "C" {
304    #[doc = " Find group members across a list of databases.\n If a member exists in several databases, only the first database is used.\n IgnorePkg is also handled.\n @param dbs the list of alpm_db_t *\n @param name the name of the group\n @return the list of alpm_pkg_t * (caller is responsible for alpm_list_free)"]
305    pub fn alpm_find_group_pkgs(
306        dbs: *mut alpm_list_t,
307        name: *const ::std::os::raw::c_char,
308    ) -> *mut alpm_list_t;
309}
310#[repr(u32)]
311#[doc = " libalpm's error type"]
312#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
313pub enum _alpm_errno_t {
314    #[doc = " No error"]
315    ALPM_ERR_OK = 0,
316    #[doc = " Failed to allocate memory"]
317    ALPM_ERR_MEMORY = 1,
318    #[doc = " A system error occurred"]
319    ALPM_ERR_SYSTEM = 2,
320    #[doc = " Permmision denied"]
321    ALPM_ERR_BADPERMS = 3,
322    #[doc = " Should be a file"]
323    ALPM_ERR_NOT_A_FILE = 4,
324    #[doc = " Should be a directory"]
325    ALPM_ERR_NOT_A_DIR = 5,
326    #[doc = " Function was called with invalid arguments"]
327    ALPM_ERR_WRONG_ARGS = 6,
328    #[doc = " Insufficient disk space"]
329    ALPM_ERR_DISK_SPACE = 7,
330    #[doc = " Handle should be null"]
331    ALPM_ERR_HANDLE_NULL = 8,
332    #[doc = " Handle should not be null"]
333    ALPM_ERR_HANDLE_NOT_NULL = 9,
334    #[doc = " Failed to acquire lock"]
335    ALPM_ERR_HANDLE_LOCK = 10,
336    #[doc = " Failed to open database"]
337    ALPM_ERR_DB_OPEN = 11,
338    #[doc = " Failed to create database"]
339    ALPM_ERR_DB_CREATE = 12,
340    #[doc = " Database should not be null"]
341    ALPM_ERR_DB_NULL = 13,
342    #[doc = " Database should be null"]
343    ALPM_ERR_DB_NOT_NULL = 14,
344    #[doc = " The database could not be found"]
345    ALPM_ERR_DB_NOT_FOUND = 15,
346    #[doc = " Database is invalid"]
347    ALPM_ERR_DB_INVALID = 16,
348    #[doc = " Database has an invalid signature"]
349    ALPM_ERR_DB_INVALID_SIG = 17,
350    #[doc = " The localdb is in a newer/older format than libalpm expects"]
351    ALPM_ERR_DB_VERSION = 18,
352    #[doc = " Failed to write to the database"]
353    ALPM_ERR_DB_WRITE = 19,
354    #[doc = " Failed to remove entry from database"]
355    ALPM_ERR_DB_REMOVE = 20,
356    #[doc = " Server URL is in an invalid format"]
357    ALPM_ERR_SERVER_BAD_URL = 21,
358    #[doc = " The database has no configured servers"]
359    ALPM_ERR_SERVER_NONE = 22,
360    #[doc = " A transaction is already initialized"]
361    ALPM_ERR_TRANS_NOT_NULL = 23,
362    #[doc = " A transaction has not been initialized"]
363    ALPM_ERR_TRANS_NULL = 24,
364    #[doc = " Duplicate target in transaction"]
365    ALPM_ERR_TRANS_DUP_TARGET = 25,
366    #[doc = " Duplicate filename in transaction"]
367    ALPM_ERR_TRANS_DUP_FILENAME = 26,
368    #[doc = " A transaction has not been initialized"]
369    ALPM_ERR_TRANS_NOT_INITIALIZED = 27,
370    #[doc = " Transaction has not been prepared"]
371    ALPM_ERR_TRANS_NOT_PREPARED = 28,
372    #[doc = " Transaction was aborted"]
373    ALPM_ERR_TRANS_ABORT = 29,
374    #[doc = " Failed to interrupt transaction"]
375    ALPM_ERR_TRANS_TYPE = 30,
376    #[doc = " Tried to commit transaction without locking the database"]
377    ALPM_ERR_TRANS_NOT_LOCKED = 31,
378    #[doc = " A hook failed to run"]
379    ALPM_ERR_TRANS_HOOK_FAILED = 32,
380    #[doc = " Package not found"]
381    ALPM_ERR_PKG_NOT_FOUND = 33,
382    #[doc = " Package is in ignorepkg"]
383    ALPM_ERR_PKG_IGNORED = 34,
384    #[doc = " Package is invalid"]
385    ALPM_ERR_PKG_INVALID = 35,
386    #[doc = " Package has an invalid checksum"]
387    ALPM_ERR_PKG_INVALID_CHECKSUM = 36,
388    #[doc = " Package has an invalid signature"]
389    ALPM_ERR_PKG_INVALID_SIG = 37,
390    #[doc = " Package does not have a signature"]
391    ALPM_ERR_PKG_MISSING_SIG = 38,
392    #[doc = " Cannot open the package file"]
393    ALPM_ERR_PKG_OPEN = 39,
394    #[doc = " Failed to remove package files"]
395    ALPM_ERR_PKG_CANT_REMOVE = 40,
396    #[doc = " Package has an invalid name"]
397    ALPM_ERR_PKG_INVALID_NAME = 41,
398    #[doc = " Package has an invalid architecture"]
399    ALPM_ERR_PKG_INVALID_ARCH = 42,
400    #[doc = " Signatures are missing"]
401    ALPM_ERR_SIG_MISSING = 43,
402    #[doc = " Signatures are invalid"]
403    ALPM_ERR_SIG_INVALID = 44,
404    #[doc = " Dependencies could not be satisfied"]
405    ALPM_ERR_UNSATISFIED_DEPS = 45,
406    #[doc = " Conflicting dependencies"]
407    ALPM_ERR_CONFLICTING_DEPS = 46,
408    #[doc = " Files conflict"]
409    ALPM_ERR_FILE_CONFLICTS = 47,
410    #[doc = " Download failed"]
411    ALPM_ERR_RETRIEVE = 48,
412    #[doc = " Invalid Regex"]
413    ALPM_ERR_INVALID_REGEX = 49,
414    #[doc = " Error in libarchive"]
415    ALPM_ERR_LIBARCHIVE = 50,
416    #[doc = " Error in libcurl"]
417    ALPM_ERR_LIBCURL = 51,
418    #[doc = " Error in external download program"]
419    ALPM_ERR_EXTERNAL_DOWNLOAD = 52,
420    #[doc = " Error in gpgme"]
421    ALPM_ERR_GPGME = 53,
422    #[doc = " Missing compile-time features"]
423    ALPM_ERR_MISSING_CAPABILITY_SIGNATURES = 54,
424}
425#[doc = " libalpm's error type"]
426pub use self::_alpm_errno_t as alpm_errno_t;
427extern "C" {
428    #[doc = " Returns the current error code from the handle.\n @param handle the context handle\n @return the current error code of the handle"]
429    pub fn alpm_errno(handle: *mut alpm_handle_t) -> alpm_errno_t;
430}
431extern "C" {
432    #[doc = " Returns the string corresponding to an error number.\n @param err the error code to get the string for\n @return the string relating to the given error code"]
433    pub fn alpm_strerror(err: alpm_errno_t) -> *const ::std::os::raw::c_char;
434}
435extern "C" {
436    #[doc = " Initializes the library.\n Creates handle, connects to database and creates lockfile.\n This must be called before any other functions are called.\n @param root the root path for all filesystem operations\n @param dbpath the absolute path to the libalpm database\n @param err an optional variable to hold any error return codes\n @return a context handle on success, NULL on error, err will be set if provided"]
437    pub fn alpm_initialize(
438        root: *const ::std::os::raw::c_char,
439        dbpath: *const ::std::os::raw::c_char,
440        err: *mut alpm_errno_t,
441    ) -> *mut alpm_handle_t;
442}
443extern "C" {
444    #[doc = " Release the library.\n Disconnects from the database, removes handle and lockfile\n This should be the last alpm call you make.\n After this returns, handle should be considered invalid and cannot be reused\n in any way.\n @param handle the context handle\n @return 0 on success, -1 on error"]
445    pub fn alpm_release(handle: *mut alpm_handle_t) -> ::std::os::raw::c_int;
446}
447pub mod _alpm_siglevel_t {
448    #[doc = " PGP signature verification options"]
449    pub type Type = ::std::os::raw::c_uint;
450    #[doc = " Packages require a signature"]
451    pub const ALPM_SIG_PACKAGE: Type = 1;
452    #[doc = " Packages do not require a signature,\n but check packages that do have signatures"]
453    pub const ALPM_SIG_PACKAGE_OPTIONAL: Type = 2;
454    #[doc = " Packages do not require a signature,\n but check packages that do have signatures"]
455    pub const ALPM_SIG_PACKAGE_MARGINAL_OK: Type = 4;
456    #[doc = " Allow packages with signatures that are unknown trust"]
457    pub const ALPM_SIG_PACKAGE_UNKNOWN_OK: Type = 8;
458    #[doc = " Databases require a signature"]
459    pub const ALPM_SIG_DATABASE: Type = 1024;
460    #[doc = " Databases do not require a signature,\n but check databases that do have signatures"]
461    pub const ALPM_SIG_DATABASE_OPTIONAL: Type = 2048;
462    #[doc = " Allow databases with signatures that are marginal trust"]
463    pub const ALPM_SIG_DATABASE_MARGINAL_OK: Type = 4096;
464    #[doc = " Allow databases with signatures that are unknown trust"]
465    pub const ALPM_SIG_DATABASE_UNKNOWN_OK: Type = 8192;
466    #[doc = " The Default siglevel"]
467    pub const ALPM_SIG_USE_DEFAULT: Type = 1073741824;
468}
469#[doc = " PGP signature verification options"]
470pub use self::_alpm_siglevel_t::Type as alpm_siglevel_t;
471#[repr(u32)]
472#[doc = " PGP signature verification status return codes"]
473#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
474pub enum _alpm_sigstatus_t {
475    #[doc = " Signature is valid"]
476    ALPM_SIGSTATUS_VALID = 0,
477    #[doc = " The key has expired"]
478    ALPM_SIGSTATUS_KEY_EXPIRED = 1,
479    #[doc = " The signature has expired"]
480    ALPM_SIGSTATUS_SIG_EXPIRED = 2,
481    #[doc = " The key is not in the keyring"]
482    ALPM_SIGSTATUS_KEY_UNKNOWN = 3,
483    #[doc = " The key has been disabled"]
484    ALPM_SIGSTATUS_KEY_DISABLED = 4,
485    #[doc = " The signature is invalid"]
486    ALPM_SIGSTATUS_INVALID = 5,
487}
488#[doc = " PGP signature verification status return codes"]
489pub use self::_alpm_sigstatus_t as alpm_sigstatus_t;
490#[repr(u32)]
491#[doc = " The trust level of a PGP key"]
492#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
493pub enum _alpm_sigvalidity_t {
494    #[doc = " The signature is fully trusted"]
495    ALPM_SIGVALIDITY_FULL = 0,
496    #[doc = " The signature is marginally trusted"]
497    ALPM_SIGVALIDITY_MARGINAL = 1,
498    #[doc = " The signature is never trusted"]
499    ALPM_SIGVALIDITY_NEVER = 2,
500    #[doc = " The signature has unknown trust"]
501    ALPM_SIGVALIDITY_UNKNOWN = 3,
502}
503#[doc = " The trust level of a PGP key"]
504pub use self::_alpm_sigvalidity_t as alpm_sigvalidity_t;
505#[doc = " A PGP key"]
506#[repr(C)]
507#[derive(Debug, Copy, Clone)]
508pub struct _alpm_pgpkey_t {
509    #[doc = " The actual key data"]
510    pub data: *mut ::std::os::raw::c_void,
511    #[doc = " The key's fingerprint"]
512    pub fingerprint: *mut ::std::os::raw::c_char,
513    #[doc = " UID of the key"]
514    pub uid: *mut ::std::os::raw::c_char,
515    #[doc = " Name of the key's owner"]
516    pub name: *mut ::std::os::raw::c_char,
517    #[doc = " Email of the key's owner"]
518    pub email: *mut ::std::os::raw::c_char,
519    #[doc = " When the key was created"]
520    pub created: alpm_time_t,
521    #[doc = " When the key expires"]
522    pub expires: alpm_time_t,
523    #[doc = " The length of the key"]
524    pub length: ::std::os::raw::c_uint,
525    #[doc = " has the key been revoked"]
526    pub revoked: ::std::os::raw::c_uint,
527    #[doc = " A character representing the  encryption algorithm used by the public key\n\n ? = unknown\n R = RSA\n D = DSA\n E = EDDSA"]
528    pub pubkey_algo: ::std::os::raw::c_char,
529}
530#[allow(clippy::unnecessary_operation, clippy::identity_op)]
531const _: () = {
532    ["Size of _alpm_pgpkey_t"][::std::mem::size_of::<_alpm_pgpkey_t>() - 72usize];
533    ["Alignment of _alpm_pgpkey_t"][::std::mem::align_of::<_alpm_pgpkey_t>() - 8usize];
534    ["Offset of field: _alpm_pgpkey_t::data"]
535        [::std::mem::offset_of!(_alpm_pgpkey_t, data) - 0usize];
536    ["Offset of field: _alpm_pgpkey_t::fingerprint"]
537        [::std::mem::offset_of!(_alpm_pgpkey_t, fingerprint) - 8usize];
538    ["Offset of field: _alpm_pgpkey_t::uid"][::std::mem::offset_of!(_alpm_pgpkey_t, uid) - 16usize];
539    ["Offset of field: _alpm_pgpkey_t::name"]
540        [::std::mem::offset_of!(_alpm_pgpkey_t, name) - 24usize];
541    ["Offset of field: _alpm_pgpkey_t::email"]
542        [::std::mem::offset_of!(_alpm_pgpkey_t, email) - 32usize];
543    ["Offset of field: _alpm_pgpkey_t::created"]
544        [::std::mem::offset_of!(_alpm_pgpkey_t, created) - 40usize];
545    ["Offset of field: _alpm_pgpkey_t::expires"]
546        [::std::mem::offset_of!(_alpm_pgpkey_t, expires) - 48usize];
547    ["Offset of field: _alpm_pgpkey_t::length"]
548        [::std::mem::offset_of!(_alpm_pgpkey_t, length) - 56usize];
549    ["Offset of field: _alpm_pgpkey_t::revoked"]
550        [::std::mem::offset_of!(_alpm_pgpkey_t, revoked) - 60usize];
551    ["Offset of field: _alpm_pgpkey_t::pubkey_algo"]
552        [::std::mem::offset_of!(_alpm_pgpkey_t, pubkey_algo) - 64usize];
553};
554#[doc = " A PGP key"]
555pub type alpm_pgpkey_t = _alpm_pgpkey_t;
556#[doc = " Signature result. Contains the key, status, and validity of a given\n signature."]
557#[repr(C)]
558#[derive(Debug, Copy, Clone)]
559pub struct _alpm_sigresult_t {
560    #[doc = " The key of the signature"]
561    pub key: alpm_pgpkey_t,
562    #[doc = " The status of the signature"]
563    pub status: alpm_sigstatus_t,
564    #[doc = " The validity of the signature"]
565    pub validity: alpm_sigvalidity_t,
566}
567#[allow(clippy::unnecessary_operation, clippy::identity_op)]
568const _: () = {
569    ["Size of _alpm_sigresult_t"][::std::mem::size_of::<_alpm_sigresult_t>() - 80usize];
570    ["Alignment of _alpm_sigresult_t"][::std::mem::align_of::<_alpm_sigresult_t>() - 8usize];
571    ["Offset of field: _alpm_sigresult_t::key"]
572        [::std::mem::offset_of!(_alpm_sigresult_t, key) - 0usize];
573    ["Offset of field: _alpm_sigresult_t::status"]
574        [::std::mem::offset_of!(_alpm_sigresult_t, status) - 72usize];
575    ["Offset of field: _alpm_sigresult_t::validity"]
576        [::std::mem::offset_of!(_alpm_sigresult_t, validity) - 76usize];
577};
578#[doc = " Signature result. Contains the key, status, and validity of a given\n signature."]
579pub type alpm_sigresult_t = _alpm_sigresult_t;
580#[doc = " Signature list. Contains the number of signatures found and a pointer to an\n array of results. The array is of size count."]
581#[repr(C)]
582#[derive(Debug, Copy, Clone)]
583pub struct _alpm_siglist_t {
584    #[doc = " The amount of results in the array"]
585    pub count: usize,
586    #[doc = " An array of sigresults"]
587    pub results: *mut alpm_sigresult_t,
588}
589#[allow(clippy::unnecessary_operation, clippy::identity_op)]
590const _: () = {
591    ["Size of _alpm_siglist_t"][::std::mem::size_of::<_alpm_siglist_t>() - 16usize];
592    ["Alignment of _alpm_siglist_t"][::std::mem::align_of::<_alpm_siglist_t>() - 8usize];
593    ["Offset of field: _alpm_siglist_t::count"]
594        [::std::mem::offset_of!(_alpm_siglist_t, count) - 0usize];
595    ["Offset of field: _alpm_siglist_t::results"]
596        [::std::mem::offset_of!(_alpm_siglist_t, results) - 8usize];
597};
598#[doc = " Signature list. Contains the number of signatures found and a pointer to an\n array of results. The array is of size count."]
599pub type alpm_siglist_t = _alpm_siglist_t;
600extern "C" {
601    #[doc = " Check the PGP signature for the given package file.\n @param pkg the package to check\n @param siglist a pointer to storage for signature results\n @return 0 if valid, -1 if an error occurred or signature is invalid"]
602    pub fn alpm_pkg_check_pgp_signature(
603        pkg: *mut alpm_pkg_t,
604        siglist: *mut alpm_siglist_t,
605    ) -> ::std::os::raw::c_int;
606}
607extern "C" {
608    #[doc = " Check the PGP signature for the given database.\n @param db the database to check\n @param siglist a pointer to storage for signature results\n @return 0 if valid, -1 if an error occurred or signature is invalid"]
609    pub fn alpm_db_check_pgp_signature(
610        db: *mut alpm_db_t,
611        siglist: *mut alpm_siglist_t,
612    ) -> ::std::os::raw::c_int;
613}
614extern "C" {
615    #[doc = " Clean up and free a signature result list.\n Note that this does not free the siglist object itself in case that\n was allocated on the stack; this is the responsibility of the caller.\n @param siglist a pointer to storage for signature results\n @return 0 on success, -1 on error"]
616    pub fn alpm_siglist_cleanup(siglist: *mut alpm_siglist_t) -> ::std::os::raw::c_int;
617}
618extern "C" {
619    #[doc = " Decode a loaded signature in base64 form.\n @param base64_data the signature to attempt to decode\n @param data the decoded data; must be freed by the caller\n @param data_len the length of the returned data\n @return 0 on success, -1 on failure to properly decode"]
620    pub fn alpm_decode_signature(
621        base64_data: *const ::std::os::raw::c_char,
622        data: *mut *mut ::std::os::raw::c_uchar,
623        data_len: *mut usize,
624    ) -> ::std::os::raw::c_int;
625}
626extern "C" {
627    #[doc = " Extract the Issuer Key ID from a signature\n @param handle the context handle\n @param identifier the identifier of the key.\n This may be the name of the package or the path to the package.\n @param sig PGP signature\n @param len length of signature\n @param keys a pointer to storage for key IDs\n @return 0 on success, -1 on error"]
628    pub fn alpm_extract_keyid(
629        handle: *mut alpm_handle_t,
630        identifier: *const ::std::os::raw::c_char,
631        sig: *const ::std::os::raw::c_uchar,
632        len: usize,
633        keys: *mut *mut alpm_list_t,
634    ) -> ::std::os::raw::c_int;
635}
636#[repr(u32)]
637#[doc = " Types of version constraints in dependency specs."]
638#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
639pub enum _alpm_depmod_t {
640    #[doc = " No version constraint"]
641    ALPM_DEP_MOD_ANY = 1,
642    #[doc = " Test version equality (package=x.y.z)"]
643    ALPM_DEP_MOD_EQ = 2,
644    #[doc = " Test for at least a version (package>=x.y.z)"]
645    ALPM_DEP_MOD_GE = 3,
646    #[doc = " Test for at most a version (package<=x.y.z)"]
647    ALPM_DEP_MOD_LE = 4,
648    #[doc = " Test for greater than some version (package>x.y.z)"]
649    ALPM_DEP_MOD_GT = 5,
650    #[doc = " Test for less than some version (package<x.y.z)"]
651    ALPM_DEP_MOD_LT = 6,
652}
653#[doc = " Types of version constraints in dependency specs."]
654pub use self::_alpm_depmod_t as alpm_depmod_t;
655#[repr(u32)]
656#[doc = " File conflict type.\n Whether the conflict results from a file existing on the filesystem, or with\n another target in the transaction."]
657#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
658pub enum _alpm_fileconflicttype_t {
659    #[doc = " The conflict results with a another target in the transaction"]
660    ALPM_FILECONFLICT_TARGET = 1,
661    #[doc = " The conflict results from a file existing on the filesystem"]
662    ALPM_FILECONFLICT_FILESYSTEM = 2,
663}
664#[doc = " File conflict type.\n Whether the conflict results from a file existing on the filesystem, or with\n another target in the transaction."]
665pub use self::_alpm_fileconflicttype_t as alpm_fileconflicttype_t;
666#[doc = " The basic dependency type.\n\n This type is used throughout libalpm, not just for dependencies\n but also conflicts and providers."]
667#[repr(C)]
668#[derive(Debug, Copy, Clone)]
669pub struct _alpm_depend_t {
670    #[doc = "  Name of the provider to satisfy this dependency"]
671    pub name: *mut ::std::os::raw::c_char,
672    #[doc = "  Version of the provider to match against (optional)"]
673    pub version: *mut ::std::os::raw::c_char,
674    #[doc = " A description of why this dependency is needed (optional)"]
675    pub desc: *mut ::std::os::raw::c_char,
676    #[doc = " A hash of name (used internally to speed up conflict checks)"]
677    pub name_hash: ::std::os::raw::c_ulong,
678    #[doc = " How the version should match against the provider"]
679    pub mod_: alpm_depmod_t,
680}
681#[allow(clippy::unnecessary_operation, clippy::identity_op)]
682const _: () = {
683    ["Size of _alpm_depend_t"][::std::mem::size_of::<_alpm_depend_t>() - 40usize];
684    ["Alignment of _alpm_depend_t"][::std::mem::align_of::<_alpm_depend_t>() - 8usize];
685    ["Offset of field: _alpm_depend_t::name"]
686        [::std::mem::offset_of!(_alpm_depend_t, name) - 0usize];
687    ["Offset of field: _alpm_depend_t::version"]
688        [::std::mem::offset_of!(_alpm_depend_t, version) - 8usize];
689    ["Offset of field: _alpm_depend_t::desc"]
690        [::std::mem::offset_of!(_alpm_depend_t, desc) - 16usize];
691    ["Offset of field: _alpm_depend_t::name_hash"]
692        [::std::mem::offset_of!(_alpm_depend_t, name_hash) - 24usize];
693    ["Offset of field: _alpm_depend_t::mod_"]
694        [::std::mem::offset_of!(_alpm_depend_t, mod_) - 32usize];
695};
696#[doc = " The basic dependency type.\n\n This type is used throughout libalpm, not just for dependencies\n but also conflicts and providers."]
697pub type alpm_depend_t = _alpm_depend_t;
698#[doc = " Missing dependency."]
699#[repr(C)]
700#[derive(Debug, Copy, Clone)]
701pub struct _alpm_depmissing_t {
702    #[doc = " Name of the package that has the dependency"]
703    pub target: *mut ::std::os::raw::c_char,
704    #[doc = " The dependency that was wanted"]
705    pub depend: *mut alpm_depend_t,
706    #[doc = " If the depmissing was caused by a conflict, the name of the package\n that would be installed, causing the satisfying package to be removed"]
707    pub causingpkg: *mut ::std::os::raw::c_char,
708}
709#[allow(clippy::unnecessary_operation, clippy::identity_op)]
710const _: () = {
711    ["Size of _alpm_depmissing_t"][::std::mem::size_of::<_alpm_depmissing_t>() - 24usize];
712    ["Alignment of _alpm_depmissing_t"][::std::mem::align_of::<_alpm_depmissing_t>() - 8usize];
713    ["Offset of field: _alpm_depmissing_t::target"]
714        [::std::mem::offset_of!(_alpm_depmissing_t, target) - 0usize];
715    ["Offset of field: _alpm_depmissing_t::depend"]
716        [::std::mem::offset_of!(_alpm_depmissing_t, depend) - 8usize];
717    ["Offset of field: _alpm_depmissing_t::causingpkg"]
718        [::std::mem::offset_of!(_alpm_depmissing_t, causingpkg) - 16usize];
719};
720#[doc = " Missing dependency."]
721pub type alpm_depmissing_t = _alpm_depmissing_t;
722#[doc = " A conflict that has occurred between two packages."]
723#[repr(C)]
724#[derive(Debug, Copy, Clone)]
725pub struct _alpm_conflict_t {
726    #[doc = " The first package"]
727    pub package1: *mut alpm_pkg_t,
728    #[doc = " The second package"]
729    pub package2: *mut alpm_pkg_t,
730    #[doc = " The conflict"]
731    pub reason: *mut alpm_depend_t,
732}
733#[allow(clippy::unnecessary_operation, clippy::identity_op)]
734const _: () = {
735    ["Size of _alpm_conflict_t"][::std::mem::size_of::<_alpm_conflict_t>() - 24usize];
736    ["Alignment of _alpm_conflict_t"][::std::mem::align_of::<_alpm_conflict_t>() - 8usize];
737    ["Offset of field: _alpm_conflict_t::package1"]
738        [::std::mem::offset_of!(_alpm_conflict_t, package1) - 0usize];
739    ["Offset of field: _alpm_conflict_t::package2"]
740        [::std::mem::offset_of!(_alpm_conflict_t, package2) - 8usize];
741    ["Offset of field: _alpm_conflict_t::reason"]
742        [::std::mem::offset_of!(_alpm_conflict_t, reason) - 16usize];
743};
744#[doc = " A conflict that has occurred between two packages."]
745pub type alpm_conflict_t = _alpm_conflict_t;
746#[doc = " File conflict.\n\n A conflict that has happened due to a two packages containing the same file,\n or a package contains a file that is already on the filesystem and not owned\n by that package."]
747#[repr(C)]
748#[derive(Debug, Copy, Clone)]
749pub struct _alpm_fileconflict_t {
750    #[doc = " The name of the package that caused the conflict"]
751    pub target: *mut ::std::os::raw::c_char,
752    #[doc = " The type of conflict"]
753    pub type_: alpm_fileconflicttype_t,
754    #[doc = " The name of the file that the package conflicts with"]
755    pub file: *mut ::std::os::raw::c_char,
756    #[doc = " The name of the package that also owns the file if there is one"]
757    pub ctarget: *mut ::std::os::raw::c_char,
758}
759#[allow(clippy::unnecessary_operation, clippy::identity_op)]
760const _: () = {
761    ["Size of _alpm_fileconflict_t"][::std::mem::size_of::<_alpm_fileconflict_t>() - 32usize];
762    ["Alignment of _alpm_fileconflict_t"][::std::mem::align_of::<_alpm_fileconflict_t>() - 8usize];
763    ["Offset of field: _alpm_fileconflict_t::target"]
764        [::std::mem::offset_of!(_alpm_fileconflict_t, target) - 0usize];
765    ["Offset of field: _alpm_fileconflict_t::type_"]
766        [::std::mem::offset_of!(_alpm_fileconflict_t, type_) - 8usize];
767    ["Offset of field: _alpm_fileconflict_t::file"]
768        [::std::mem::offset_of!(_alpm_fileconflict_t, file) - 16usize];
769    ["Offset of field: _alpm_fileconflict_t::ctarget"]
770        [::std::mem::offset_of!(_alpm_fileconflict_t, ctarget) - 24usize];
771};
772#[doc = " File conflict.\n\n A conflict that has happened due to a two packages containing the same file,\n or a package contains a file that is already on the filesystem and not owned\n by that package."]
773pub type alpm_fileconflict_t = _alpm_fileconflict_t;
774extern "C" {
775    #[doc = " Checks dependencies and returns missing ones in a list.\n Dependencies can include versions with depmod operators.\n @param handle the context handle\n @param pkglist the list of local packages\n @param remove an alpm_list_t* of packages to be removed\n @param upgrade an alpm_list_t* of packages to be upgraded (remove-then-upgrade)\n @param reversedeps handles the backward dependencies\n @return an alpm_list_t* of alpm_depmissing_t pointers."]
776    pub fn alpm_checkdeps(
777        handle: *mut alpm_handle_t,
778        pkglist: *mut alpm_list_t,
779        remove: *mut alpm_list_t,
780        upgrade: *mut alpm_list_t,
781        reversedeps: ::std::os::raw::c_int,
782    ) -> *mut alpm_list_t;
783}
784extern "C" {
785    #[doc = " Find a package satisfying a specified dependency.\n The dependency can include versions with depmod operators.\n @param pkgs an alpm_list_t* of alpm_pkg_t where the satisfyer will be searched\n @param depstring package or provision name, versioned or not\n @return a alpm_pkg_t* satisfying depstring"]
786    pub fn alpm_find_satisfier(
787        pkgs: *mut alpm_list_t,
788        depstring: *const ::std::os::raw::c_char,
789    ) -> *mut alpm_pkg_t;
790}
791extern "C" {
792    #[doc = " Find a package satisfying a specified dependency.\n First look for a literal, going through each db one by one. Then look for\n providers. The first satisfyer that belongs to an installed package is\n returned. If no providers belong to an installed package then an\n alpm_question_select_provider_t is created to select the provider.\n The dependency can include versions with depmod operators.\n\n @param handle the context handle\n @param dbs an alpm_list_t* of alpm_db_t where the satisfyer will be searched\n @param depstring package or provision name, versioned or not\n @return a alpm_pkg_t* satisfying depstring"]
793    pub fn alpm_find_dbs_satisfier(
794        handle: *mut alpm_handle_t,
795        dbs: *mut alpm_list_t,
796        depstring: *const ::std::os::raw::c_char,
797    ) -> *mut alpm_pkg_t;
798}
799extern "C" {
800    #[doc = " Check the package conflicts in a database\n\n @param handle the context handle\n @param pkglist the list of packages to check\n\n @return an alpm_list_t of alpm_conflict_t"]
801    pub fn alpm_checkconflicts(
802        handle: *mut alpm_handle_t,
803        pkglist: *mut alpm_list_t,
804    ) -> *mut alpm_list_t;
805}
806extern "C" {
807    #[doc = " Returns a newly allocated string representing the dependency information.\n @param dep a dependency info structure\n @return a formatted string, e.g. \"glibc>=2.12\""]
808    pub fn alpm_dep_compute_string(dep: *const alpm_depend_t) -> *mut ::std::os::raw::c_char;
809}
810extern "C" {
811    #[doc = " Return a newly allocated dependency information parsed from a string\n\\link alpm_dep_free should be used to free the dependency \\endlink\n @param depstring a formatted string, e.g. \"glibc=2.12\"\n @return a dependency info structure"]
812    pub fn alpm_dep_from_string(depstring: *const ::std::os::raw::c_char) -> *mut alpm_depend_t;
813}
814extern "C" {
815    #[doc = " Free a dependency info structure\n @param dep struct to free"]
816    pub fn alpm_dep_free(dep: *mut alpm_depend_t);
817}
818extern "C" {
819    #[doc = " Free a fileconflict and its members.\n @param conflict the fileconflict to free"]
820    pub fn alpm_fileconflict_free(conflict: *mut alpm_fileconflict_t);
821}
822extern "C" {
823    #[doc = " Free a depmissing and its members\n @param miss the depmissing to free"]
824    pub fn alpm_depmissing_free(miss: *mut alpm_depmissing_t);
825}
826extern "C" {
827    #[doc = " Free a conflict and its members.\n @param conflict the conflict to free"]
828    pub fn alpm_conflict_free(conflict: *mut alpm_conflict_t);
829}
830#[repr(u32)]
831#[doc = " Type of events."]
832#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
833pub enum _alpm_event_type_t {
834    #[doc = " Dependencies will be computed for a package."]
835    ALPM_EVENT_CHECKDEPS_START = 1,
836    #[doc = " Dependencies were computed for a package."]
837    ALPM_EVENT_CHECKDEPS_DONE = 2,
838    #[doc = " File conflicts will be computed for a package."]
839    ALPM_EVENT_FILECONFLICTS_START = 3,
840    #[doc = " File conflicts were computed for a package."]
841    ALPM_EVENT_FILECONFLICTS_DONE = 4,
842    #[doc = " Dependencies will be resolved for target package."]
843    ALPM_EVENT_RESOLVEDEPS_START = 5,
844    #[doc = " Dependencies were resolved for target package."]
845    ALPM_EVENT_RESOLVEDEPS_DONE = 6,
846    #[doc = " Inter-conflicts will be checked for target package."]
847    ALPM_EVENT_INTERCONFLICTS_START = 7,
848    #[doc = " Inter-conflicts were checked for target package."]
849    ALPM_EVENT_INTERCONFLICTS_DONE = 8,
850    #[doc = " Processing the package transaction is starting."]
851    ALPM_EVENT_TRANSACTION_START = 9,
852    #[doc = " Processing the package transaction is finished."]
853    ALPM_EVENT_TRANSACTION_DONE = 10,
854    #[doc = " Package will be installed/upgraded/downgraded/re-installed/removed; See\n alpm_event_package_operation_t for arguments."]
855    ALPM_EVENT_PACKAGE_OPERATION_START = 11,
856    #[doc = " Package was installed/upgraded/downgraded/re-installed/removed; See\n alpm_event_package_operation_t for arguments."]
857    ALPM_EVENT_PACKAGE_OPERATION_DONE = 12,
858    #[doc = " Target package's integrity will be checked."]
859    ALPM_EVENT_INTEGRITY_START = 13,
860    #[doc = " Target package's integrity was checked."]
861    ALPM_EVENT_INTEGRITY_DONE = 14,
862    #[doc = " Target package will be loaded."]
863    ALPM_EVENT_LOAD_START = 15,
864    #[doc = " Target package is finished loading."]
865    ALPM_EVENT_LOAD_DONE = 16,
866    #[doc = " Scriptlet has printed information; See alpm_event_scriptlet_info_t for\n arguments."]
867    ALPM_EVENT_SCRIPTLET_INFO = 17,
868    #[doc = " Database files will be downloaded from a repository."]
869    ALPM_EVENT_DB_RETRIEVE_START = 18,
870    #[doc = " Database files were downloaded from a repository."]
871    ALPM_EVENT_DB_RETRIEVE_DONE = 19,
872    #[doc = " Not all database files were successfully downloaded from a repository."]
873    ALPM_EVENT_DB_RETRIEVE_FAILED = 20,
874    #[doc = " Package files will be downloaded from a repository."]
875    ALPM_EVENT_PKG_RETRIEVE_START = 21,
876    #[doc = " Package files were downloaded from a repository."]
877    ALPM_EVENT_PKG_RETRIEVE_DONE = 22,
878    #[doc = " Not all package files were successfully downloaded from a repository."]
879    ALPM_EVENT_PKG_RETRIEVE_FAILED = 23,
880    #[doc = " Disk space usage will be computed for a package."]
881    ALPM_EVENT_DISKSPACE_START = 24,
882    #[doc = " Disk space usage was computed for a package."]
883    ALPM_EVENT_DISKSPACE_DONE = 25,
884    #[doc = " An optdepend for another package is being removed; See\n alpm_event_optdep_removal_t for arguments."]
885    ALPM_EVENT_OPTDEP_REMOVAL = 26,
886    #[doc = " A configured repository database is missing; See\n alpm_event_database_missing_t for arguments."]
887    ALPM_EVENT_DATABASE_MISSING = 27,
888    #[doc = " Checking keys used to create signatures are in keyring."]
889    ALPM_EVENT_KEYRING_START = 28,
890    #[doc = " Keyring checking is finished."]
891    ALPM_EVENT_KEYRING_DONE = 29,
892    #[doc = " Downloading missing keys into keyring."]
893    ALPM_EVENT_KEY_DOWNLOAD_START = 30,
894    #[doc = " Key downloading is finished."]
895    ALPM_EVENT_KEY_DOWNLOAD_DONE = 31,
896    #[doc = " A .pacnew file was created; See alpm_event_pacnew_created_t for arguments."]
897    ALPM_EVENT_PACNEW_CREATED = 32,
898    #[doc = " A .pacsave file was created; See alpm_event_pacsave_created_t for\n arguments."]
899    ALPM_EVENT_PACSAVE_CREATED = 33,
900    #[doc = " Processing hooks will be started."]
901    ALPM_EVENT_HOOK_START = 34,
902    #[doc = " Processing hooks is finished."]
903    ALPM_EVENT_HOOK_DONE = 35,
904    #[doc = " A hook is starting"]
905    ALPM_EVENT_HOOK_RUN_START = 36,
906    #[doc = " A hook has finished running."]
907    ALPM_EVENT_HOOK_RUN_DONE = 37,
908}
909#[doc = " Type of events."]
910pub use self::_alpm_event_type_t as alpm_event_type_t;
911#[doc = " An event that may represent any event."]
912#[repr(C)]
913#[derive(Debug, Copy, Clone)]
914pub struct _alpm_event_any_t {
915    #[doc = " Type of event"]
916    pub type_: alpm_event_type_t,
917}
918#[allow(clippy::unnecessary_operation, clippy::identity_op)]
919const _: () = {
920    ["Size of _alpm_event_any_t"][::std::mem::size_of::<_alpm_event_any_t>() - 4usize];
921    ["Alignment of _alpm_event_any_t"][::std::mem::align_of::<_alpm_event_any_t>() - 4usize];
922    ["Offset of field: _alpm_event_any_t::type_"]
923        [::std::mem::offset_of!(_alpm_event_any_t, type_) - 0usize];
924};
925#[doc = " An event that may represent any event."]
926pub type alpm_event_any_t = _alpm_event_any_t;
927#[repr(u32)]
928#[doc = " An enum over the kind of package operations."]
929#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
930pub enum _alpm_package_operation_t {
931    #[doc = " Package (to be) installed. (No oldpkg)"]
932    ALPM_PACKAGE_INSTALL = 1,
933    #[doc = " Package (to be) upgraded"]
934    ALPM_PACKAGE_UPGRADE = 2,
935    #[doc = " Package (to be) re-installed"]
936    ALPM_PACKAGE_REINSTALL = 3,
937    #[doc = " Package (to be) downgraded"]
938    ALPM_PACKAGE_DOWNGRADE = 4,
939    #[doc = " Package (to be) removed (No newpkg)"]
940    ALPM_PACKAGE_REMOVE = 5,
941}
942#[doc = " An enum over the kind of package operations."]
943pub use self::_alpm_package_operation_t as alpm_package_operation_t;
944#[doc = " A package operation event occurred."]
945#[repr(C)]
946#[derive(Debug, Copy, Clone)]
947pub struct _alpm_event_package_operation_t {
948    #[doc = " Type of event"]
949    pub type_: alpm_event_type_t,
950    #[doc = " Type of operation"]
951    pub operation: alpm_package_operation_t,
952    #[doc = " Old package"]
953    pub oldpkg: *mut alpm_pkg_t,
954    #[doc = " New package"]
955    pub newpkg: *mut alpm_pkg_t,
956}
957#[allow(clippy::unnecessary_operation, clippy::identity_op)]
958const _: () = {
959    ["Size of _alpm_event_package_operation_t"]
960        [::std::mem::size_of::<_alpm_event_package_operation_t>() - 24usize];
961    ["Alignment of _alpm_event_package_operation_t"]
962        [::std::mem::align_of::<_alpm_event_package_operation_t>() - 8usize];
963    ["Offset of field: _alpm_event_package_operation_t::type_"]
964        [::std::mem::offset_of!(_alpm_event_package_operation_t, type_) - 0usize];
965    ["Offset of field: _alpm_event_package_operation_t::operation"]
966        [::std::mem::offset_of!(_alpm_event_package_operation_t, operation) - 4usize];
967    ["Offset of field: _alpm_event_package_operation_t::oldpkg"]
968        [::std::mem::offset_of!(_alpm_event_package_operation_t, oldpkg) - 8usize];
969    ["Offset of field: _alpm_event_package_operation_t::newpkg"]
970        [::std::mem::offset_of!(_alpm_event_package_operation_t, newpkg) - 16usize];
971};
972#[doc = " A package operation event occurred."]
973pub type alpm_event_package_operation_t = _alpm_event_package_operation_t;
974#[doc = " An optional dependency was removed."]
975#[repr(C)]
976#[derive(Debug, Copy, Clone)]
977pub struct _alpm_event_optdep_removal_t {
978    #[doc = " Type of event"]
979    pub type_: alpm_event_type_t,
980    #[doc = " Package with the optdep"]
981    pub pkg: *mut alpm_pkg_t,
982    #[doc = " Optdep being removed"]
983    pub optdep: *mut alpm_depend_t,
984}
985#[allow(clippy::unnecessary_operation, clippy::identity_op)]
986const _: () = {
987    ["Size of _alpm_event_optdep_removal_t"]
988        [::std::mem::size_of::<_alpm_event_optdep_removal_t>() - 24usize];
989    ["Alignment of _alpm_event_optdep_removal_t"]
990        [::std::mem::align_of::<_alpm_event_optdep_removal_t>() - 8usize];
991    ["Offset of field: _alpm_event_optdep_removal_t::type_"]
992        [::std::mem::offset_of!(_alpm_event_optdep_removal_t, type_) - 0usize];
993    ["Offset of field: _alpm_event_optdep_removal_t::pkg"]
994        [::std::mem::offset_of!(_alpm_event_optdep_removal_t, pkg) - 8usize];
995    ["Offset of field: _alpm_event_optdep_removal_t::optdep"]
996        [::std::mem::offset_of!(_alpm_event_optdep_removal_t, optdep) - 16usize];
997};
998#[doc = " An optional dependency was removed."]
999pub type alpm_event_optdep_removal_t = _alpm_event_optdep_removal_t;
1000#[doc = " A scriptlet was ran."]
1001#[repr(C)]
1002#[derive(Debug, Copy, Clone)]
1003pub struct _alpm_event_scriptlet_info_t {
1004    #[doc = " Type of event"]
1005    pub type_: alpm_event_type_t,
1006    #[doc = " Line of scriptlet output"]
1007    pub line: *const ::std::os::raw::c_char,
1008}
1009#[allow(clippy::unnecessary_operation, clippy::identity_op)]
1010const _: () = {
1011    ["Size of _alpm_event_scriptlet_info_t"]
1012        [::std::mem::size_of::<_alpm_event_scriptlet_info_t>() - 16usize];
1013    ["Alignment of _alpm_event_scriptlet_info_t"]
1014        [::std::mem::align_of::<_alpm_event_scriptlet_info_t>() - 8usize];
1015    ["Offset of field: _alpm_event_scriptlet_info_t::type_"]
1016        [::std::mem::offset_of!(_alpm_event_scriptlet_info_t, type_) - 0usize];
1017    ["Offset of field: _alpm_event_scriptlet_info_t::line"]
1018        [::std::mem::offset_of!(_alpm_event_scriptlet_info_t, line) - 8usize];
1019};
1020#[doc = " A scriptlet was ran."]
1021pub type alpm_event_scriptlet_info_t = _alpm_event_scriptlet_info_t;
1022#[doc = " A database is missing.\n\n The database is registered but has not been downloaded"]
1023#[repr(C)]
1024#[derive(Debug, Copy, Clone)]
1025pub struct _alpm_event_database_missing_t {
1026    #[doc = " Type of event"]
1027    pub type_: alpm_event_type_t,
1028    #[doc = " Name of the database"]
1029    pub dbname: *const ::std::os::raw::c_char,
1030}
1031#[allow(clippy::unnecessary_operation, clippy::identity_op)]
1032const _: () = {
1033    ["Size of _alpm_event_database_missing_t"]
1034        [::std::mem::size_of::<_alpm_event_database_missing_t>() - 16usize];
1035    ["Alignment of _alpm_event_database_missing_t"]
1036        [::std::mem::align_of::<_alpm_event_database_missing_t>() - 8usize];
1037    ["Offset of field: _alpm_event_database_missing_t::type_"]
1038        [::std::mem::offset_of!(_alpm_event_database_missing_t, type_) - 0usize];
1039    ["Offset of field: _alpm_event_database_missing_t::dbname"]
1040        [::std::mem::offset_of!(_alpm_event_database_missing_t, dbname) - 8usize];
1041};
1042#[doc = " A database is missing.\n\n The database is registered but has not been downloaded"]
1043pub type alpm_event_database_missing_t = _alpm_event_database_missing_t;
1044#[doc = " A package was downloaded."]
1045#[repr(C)]
1046#[derive(Debug, Copy, Clone)]
1047pub struct _alpm_event_pkgdownload_t {
1048    #[doc = " Type of event"]
1049    pub type_: alpm_event_type_t,
1050    #[doc = " Name of the file"]
1051    pub file: *const ::std::os::raw::c_char,
1052}
1053#[allow(clippy::unnecessary_operation, clippy::identity_op)]
1054const _: () = {
1055    ["Size of _alpm_event_pkgdownload_t"]
1056        [::std::mem::size_of::<_alpm_event_pkgdownload_t>() - 16usize];
1057    ["Alignment of _alpm_event_pkgdownload_t"]
1058        [::std::mem::align_of::<_alpm_event_pkgdownload_t>() - 8usize];
1059    ["Offset of field: _alpm_event_pkgdownload_t::type_"]
1060        [::std::mem::offset_of!(_alpm_event_pkgdownload_t, type_) - 0usize];
1061    ["Offset of field: _alpm_event_pkgdownload_t::file"]
1062        [::std::mem::offset_of!(_alpm_event_pkgdownload_t, file) - 8usize];
1063};
1064#[doc = " A package was downloaded."]
1065pub type alpm_event_pkgdownload_t = _alpm_event_pkgdownload_t;
1066#[doc = " A pacnew file was created."]
1067#[repr(C)]
1068#[derive(Debug, Copy, Clone)]
1069pub struct _alpm_event_pacnew_created_t {
1070    #[doc = " Type of event"]
1071    pub type_: alpm_event_type_t,
1072    #[doc = " Whether the creation was result of a NoUpgrade or not"]
1073    pub from_noupgrade: ::std::os::raw::c_int,
1074    #[doc = " Old package"]
1075    pub oldpkg: *mut alpm_pkg_t,
1076    #[doc = " New Package"]
1077    pub newpkg: *mut alpm_pkg_t,
1078    #[doc = " Filename of the file without the .pacnew suffix"]
1079    pub file: *const ::std::os::raw::c_char,
1080}
1081#[allow(clippy::unnecessary_operation, clippy::identity_op)]
1082const _: () = {
1083    ["Size of _alpm_event_pacnew_created_t"]
1084        [::std::mem::size_of::<_alpm_event_pacnew_created_t>() - 32usize];
1085    ["Alignment of _alpm_event_pacnew_created_t"]
1086        [::std::mem::align_of::<_alpm_event_pacnew_created_t>() - 8usize];
1087    ["Offset of field: _alpm_event_pacnew_created_t::type_"]
1088        [::std::mem::offset_of!(_alpm_event_pacnew_created_t, type_) - 0usize];
1089    ["Offset of field: _alpm_event_pacnew_created_t::from_noupgrade"]
1090        [::std::mem::offset_of!(_alpm_event_pacnew_created_t, from_noupgrade) - 4usize];
1091    ["Offset of field: _alpm_event_pacnew_created_t::oldpkg"]
1092        [::std::mem::offset_of!(_alpm_event_pacnew_created_t, oldpkg) - 8usize];
1093    ["Offset of field: _alpm_event_pacnew_created_t::newpkg"]
1094        [::std::mem::offset_of!(_alpm_event_pacnew_created_t, newpkg) - 16usize];
1095    ["Offset of field: _alpm_event_pacnew_created_t::file"]
1096        [::std::mem::offset_of!(_alpm_event_pacnew_created_t, file) - 24usize];
1097};
1098#[doc = " A pacnew file was created."]
1099pub type alpm_event_pacnew_created_t = _alpm_event_pacnew_created_t;
1100#[doc = " A pacsave file was created."]
1101#[repr(C)]
1102#[derive(Debug, Copy, Clone)]
1103pub struct _alpm_event_pacsave_created_t {
1104    #[doc = " Type of event"]
1105    pub type_: alpm_event_type_t,
1106    #[doc = " Old package"]
1107    pub oldpkg: *mut alpm_pkg_t,
1108    #[doc = " Filename of the file without the .pacsave suffix"]
1109    pub file: *const ::std::os::raw::c_char,
1110}
1111#[allow(clippy::unnecessary_operation, clippy::identity_op)]
1112const _: () = {
1113    ["Size of _alpm_event_pacsave_created_t"]
1114        [::std::mem::size_of::<_alpm_event_pacsave_created_t>() - 24usize];
1115    ["Alignment of _alpm_event_pacsave_created_t"]
1116        [::std::mem::align_of::<_alpm_event_pacsave_created_t>() - 8usize];
1117    ["Offset of field: _alpm_event_pacsave_created_t::type_"]
1118        [::std::mem::offset_of!(_alpm_event_pacsave_created_t, type_) - 0usize];
1119    ["Offset of field: _alpm_event_pacsave_created_t::oldpkg"]
1120        [::std::mem::offset_of!(_alpm_event_pacsave_created_t, oldpkg) - 8usize];
1121    ["Offset of field: _alpm_event_pacsave_created_t::file"]
1122        [::std::mem::offset_of!(_alpm_event_pacsave_created_t, file) - 16usize];
1123};
1124#[doc = " A pacsave file was created."]
1125pub type alpm_event_pacsave_created_t = _alpm_event_pacsave_created_t;
1126#[repr(u32)]
1127#[doc = " Kind of hook."]
1128#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
1129pub enum _alpm_hook_when_t {
1130    ALPM_HOOK_PRE_TRANSACTION = 1,
1131    ALPM_HOOK_POST_TRANSACTION = 2,
1132}
1133#[doc = " Kind of hook."]
1134pub use self::_alpm_hook_when_t as alpm_hook_when_t;
1135#[doc = " pre/post transaction hooks are to be ran."]
1136#[repr(C)]
1137#[derive(Debug, Copy, Clone)]
1138pub struct _alpm_event_hook_t {
1139    #[doc = " Type of event"]
1140    pub type_: alpm_event_type_t,
1141    #[doc = " Type of hook"]
1142    pub when: alpm_hook_when_t,
1143}
1144#[allow(clippy::unnecessary_operation, clippy::identity_op)]
1145const _: () = {
1146    ["Size of _alpm_event_hook_t"][::std::mem::size_of::<_alpm_event_hook_t>() - 8usize];
1147    ["Alignment of _alpm_event_hook_t"][::std::mem::align_of::<_alpm_event_hook_t>() - 4usize];
1148    ["Offset of field: _alpm_event_hook_t::type_"]
1149        [::std::mem::offset_of!(_alpm_event_hook_t, type_) - 0usize];
1150    ["Offset of field: _alpm_event_hook_t::when"]
1151        [::std::mem::offset_of!(_alpm_event_hook_t, when) - 4usize];
1152};
1153#[doc = " pre/post transaction hooks are to be ran."]
1154pub type alpm_event_hook_t = _alpm_event_hook_t;
1155#[doc = " A pre/post transaction hook was ran."]
1156#[repr(C)]
1157#[derive(Debug, Copy, Clone)]
1158pub struct _alpm_event_hook_run_t {
1159    #[doc = " Type of event"]
1160    pub type_: alpm_event_type_t,
1161    #[doc = " Name of hook"]
1162    pub name: *const ::std::os::raw::c_char,
1163    #[doc = " Description of hook to be outputted"]
1164    pub desc: *const ::std::os::raw::c_char,
1165    #[doc = " position of hook being run"]
1166    pub position: usize,
1167    #[doc = " total hooks being run"]
1168    pub total: usize,
1169}
1170#[allow(clippy::unnecessary_operation, clippy::identity_op)]
1171const _: () = {
1172    ["Size of _alpm_event_hook_run_t"][::std::mem::size_of::<_alpm_event_hook_run_t>() - 40usize];
1173    ["Alignment of _alpm_event_hook_run_t"]
1174        [::std::mem::align_of::<_alpm_event_hook_run_t>() - 8usize];
1175    ["Offset of field: _alpm_event_hook_run_t::type_"]
1176        [::std::mem::offset_of!(_alpm_event_hook_run_t, type_) - 0usize];
1177    ["Offset of field: _alpm_event_hook_run_t::name"]
1178        [::std::mem::offset_of!(_alpm_event_hook_run_t, name) - 8usize];
1179    ["Offset of field: _alpm_event_hook_run_t::desc"]
1180        [::std::mem::offset_of!(_alpm_event_hook_run_t, desc) - 16usize];
1181    ["Offset of field: _alpm_event_hook_run_t::position"]
1182        [::std::mem::offset_of!(_alpm_event_hook_run_t, position) - 24usize];
1183    ["Offset of field: _alpm_event_hook_run_t::total"]
1184        [::std::mem::offset_of!(_alpm_event_hook_run_t, total) - 32usize];
1185};
1186#[doc = " A pre/post transaction hook was ran."]
1187pub type alpm_event_hook_run_t = _alpm_event_hook_run_t;
1188#[doc = " Packages downloading about to start."]
1189#[repr(C)]
1190#[derive(Debug, Copy, Clone)]
1191pub struct _alpm_event_pkg_retrieve_t {
1192    #[doc = " Type of event"]
1193    pub type_: alpm_event_type_t,
1194    #[doc = " Number of packages to download"]
1195    pub num: usize,
1196    #[doc = " Total size of packages to download"]
1197    pub total_size: off_t,
1198}
1199#[allow(clippy::unnecessary_operation, clippy::identity_op)]
1200const _: () = {
1201    ["Size of _alpm_event_pkg_retrieve_t"]
1202        [::std::mem::size_of::<_alpm_event_pkg_retrieve_t>() - 24usize];
1203    ["Alignment of _alpm_event_pkg_retrieve_t"]
1204        [::std::mem::align_of::<_alpm_event_pkg_retrieve_t>() - 8usize];
1205    ["Offset of field: _alpm_event_pkg_retrieve_t::type_"]
1206        [::std::mem::offset_of!(_alpm_event_pkg_retrieve_t, type_) - 0usize];
1207    ["Offset of field: _alpm_event_pkg_retrieve_t::num"]
1208        [::std::mem::offset_of!(_alpm_event_pkg_retrieve_t, num) - 8usize];
1209    ["Offset of field: _alpm_event_pkg_retrieve_t::total_size"]
1210        [::std::mem::offset_of!(_alpm_event_pkg_retrieve_t, total_size) - 16usize];
1211};
1212#[doc = " Packages downloading about to start."]
1213pub type alpm_event_pkg_retrieve_t = _alpm_event_pkg_retrieve_t;
1214#[doc = " Events.\n This is a union passed to the callback that allows the frontend to know\n which type of event was triggered (via type). It is then possible to\n typecast the pointer to the right structure, or use the union field, in order\n to access event-specific data."]
1215#[repr(C)]
1216#[derive(Copy, Clone)]
1217pub union _alpm_event_t {
1218    #[doc = " Type of event it's always safe to access this."]
1219    pub type_: alpm_event_type_t,
1220    #[doc = " The any event type. It's always safe to access this."]
1221    pub any: alpm_event_any_t,
1222    #[doc = " Package operation"]
1223    pub package_operation: alpm_event_package_operation_t,
1224    #[doc = " An optdept was remove"]
1225    pub optdep_removal: alpm_event_optdep_removal_t,
1226    #[doc = " A scriptlet was ran"]
1227    pub scriptlet_info: alpm_event_scriptlet_info_t,
1228    #[doc = " A database is missing"]
1229    pub database_missing: alpm_event_database_missing_t,
1230    #[doc = " A package was downloaded"]
1231    pub pkgdownload: alpm_event_pkgdownload_t,
1232    #[doc = " A pacnew file was created"]
1233    pub pacnew_created: alpm_event_pacnew_created_t,
1234    #[doc = " A pacsave file was created"]
1235    pub pacsave_created: alpm_event_pacsave_created_t,
1236    #[doc = " Pre/post transaction hooks are being ran"]
1237    pub hook: alpm_event_hook_t,
1238    #[doc = " A hook was ran"]
1239    pub hook_run: alpm_event_hook_run_t,
1240    #[doc = " Download packages"]
1241    pub pkg_retrieve: alpm_event_pkg_retrieve_t,
1242}
1243#[allow(clippy::unnecessary_operation, clippy::identity_op)]
1244const _: () = {
1245    ["Size of _alpm_event_t"][::std::mem::size_of::<_alpm_event_t>() - 40usize];
1246    ["Alignment of _alpm_event_t"][::std::mem::align_of::<_alpm_event_t>() - 8usize];
1247    ["Offset of field: _alpm_event_t::type_"]
1248        [::std::mem::offset_of!(_alpm_event_t, type_) - 0usize];
1249    ["Offset of field: _alpm_event_t::any"][::std::mem::offset_of!(_alpm_event_t, any) - 0usize];
1250    ["Offset of field: _alpm_event_t::package_operation"]
1251        [::std::mem::offset_of!(_alpm_event_t, package_operation) - 0usize];
1252    ["Offset of field: _alpm_event_t::optdep_removal"]
1253        [::std::mem::offset_of!(_alpm_event_t, optdep_removal) - 0usize];
1254    ["Offset of field: _alpm_event_t::scriptlet_info"]
1255        [::std::mem::offset_of!(_alpm_event_t, scriptlet_info) - 0usize];
1256    ["Offset of field: _alpm_event_t::database_missing"]
1257        [::std::mem::offset_of!(_alpm_event_t, database_missing) - 0usize];
1258    ["Offset of field: _alpm_event_t::pkgdownload"]
1259        [::std::mem::offset_of!(_alpm_event_t, pkgdownload) - 0usize];
1260    ["Offset of field: _alpm_event_t::pacnew_created"]
1261        [::std::mem::offset_of!(_alpm_event_t, pacnew_created) - 0usize];
1262    ["Offset of field: _alpm_event_t::pacsave_created"]
1263        [::std::mem::offset_of!(_alpm_event_t, pacsave_created) - 0usize];
1264    ["Offset of field: _alpm_event_t::hook"][::std::mem::offset_of!(_alpm_event_t, hook) - 0usize];
1265    ["Offset of field: _alpm_event_t::hook_run"]
1266        [::std::mem::offset_of!(_alpm_event_t, hook_run) - 0usize];
1267    ["Offset of field: _alpm_event_t::pkg_retrieve"]
1268        [::std::mem::offset_of!(_alpm_event_t, pkg_retrieve) - 0usize];
1269};
1270#[doc = " Events.\n This is a union passed to the callback that allows the frontend to know\n which type of event was triggered (via type). It is then possible to\n typecast the pointer to the right structure, or use the union field, in order\n to access event-specific data."]
1271pub type alpm_event_t = _alpm_event_t;
1272#[doc = " Event callback.\n\n Called when an event occurs\n @param ctx user-provided context\n @param event the event that occurred"]
1273pub type alpm_cb_event = ::std::option::Option<
1274    unsafe extern "C" fn(ctx: *mut ::std::os::raw::c_void, event: *mut alpm_event_t),
1275>;
1276pub mod _alpm_question_type_t {
1277    #[doc = " Type of question.\n Unlike the events or progress enumerations, this enum has bitmask values\n so a frontend can use a bitmask map to supply preselected answers to the\n different types of questions."]
1278    pub type Type = ::std::os::raw::c_uint;
1279    #[doc = " Should target in ignorepkg be installed anyway?"]
1280    pub const ALPM_QUESTION_INSTALL_IGNOREPKG: Type = 1;
1281    #[doc = " Should a package be replaced?"]
1282    pub const ALPM_QUESTION_REPLACE_PKG: Type = 2;
1283    #[doc = " Should a conflicting package be removed?"]
1284    pub const ALPM_QUESTION_CONFLICT_PKG: Type = 4;
1285    #[doc = " Should a corrupted package be deleted?"]
1286    pub const ALPM_QUESTION_CORRUPTED_PKG: Type = 8;
1287    #[doc = " Should unresolvable targets be removed from the transaction?"]
1288    pub const ALPM_QUESTION_REMOVE_PKGS: Type = 16;
1289    #[doc = " Provider selection"]
1290    pub const ALPM_QUESTION_SELECT_PROVIDER: Type = 32;
1291    #[doc = " Should a key be imported?"]
1292    pub const ALPM_QUESTION_IMPORT_KEY: Type = 64;
1293}
1294#[doc = " Type of question.\n Unlike the events or progress enumerations, this enum has bitmask values\n so a frontend can use a bitmask map to supply preselected answers to the\n different types of questions."]
1295pub use self::_alpm_question_type_t::Type as alpm_question_type_t;
1296#[doc = " A question that can represent any other question."]
1297#[repr(C)]
1298#[derive(Debug, Copy, Clone)]
1299pub struct _alpm_question_any_t {
1300    #[doc = " Type of question"]
1301    pub type_: alpm_question_type_t,
1302    #[doc = " Answer"]
1303    pub answer: ::std::os::raw::c_int,
1304}
1305#[allow(clippy::unnecessary_operation, clippy::identity_op)]
1306const _: () = {
1307    ["Size of _alpm_question_any_t"][::std::mem::size_of::<_alpm_question_any_t>() - 8usize];
1308    ["Alignment of _alpm_question_any_t"][::std::mem::align_of::<_alpm_question_any_t>() - 4usize];
1309    ["Offset of field: _alpm_question_any_t::type_"]
1310        [::std::mem::offset_of!(_alpm_question_any_t, type_) - 0usize];
1311    ["Offset of field: _alpm_question_any_t::answer"]
1312        [::std::mem::offset_of!(_alpm_question_any_t, answer) - 4usize];
1313};
1314#[doc = " A question that can represent any other question."]
1315pub type alpm_question_any_t = _alpm_question_any_t;
1316#[doc = " Should target in ignorepkg be installed anyway?"]
1317#[repr(C)]
1318#[derive(Debug, Copy, Clone)]
1319pub struct _alpm_question_install_ignorepkg_t {
1320    #[doc = " Type of question"]
1321    pub type_: alpm_question_type_t,
1322    #[doc = " Answer: whether or not to install pkg anyway"]
1323    pub install: ::std::os::raw::c_int,
1324    #[doc = " The ignored package that we are deciding whether to install"]
1325    pub pkg: *mut alpm_pkg_t,
1326}
1327#[allow(clippy::unnecessary_operation, clippy::identity_op)]
1328const _: () = {
1329    ["Size of _alpm_question_install_ignorepkg_t"]
1330        [::std::mem::size_of::<_alpm_question_install_ignorepkg_t>() - 16usize];
1331    ["Alignment of _alpm_question_install_ignorepkg_t"]
1332        [::std::mem::align_of::<_alpm_question_install_ignorepkg_t>() - 8usize];
1333    ["Offset of field: _alpm_question_install_ignorepkg_t::type_"]
1334        [::std::mem::offset_of!(_alpm_question_install_ignorepkg_t, type_) - 0usize];
1335    ["Offset of field: _alpm_question_install_ignorepkg_t::install"]
1336        [::std::mem::offset_of!(_alpm_question_install_ignorepkg_t, install) - 4usize];
1337    ["Offset of field: _alpm_question_install_ignorepkg_t::pkg"]
1338        [::std::mem::offset_of!(_alpm_question_install_ignorepkg_t, pkg) - 8usize];
1339};
1340#[doc = " Should target in ignorepkg be installed anyway?"]
1341pub type alpm_question_install_ignorepkg_t = _alpm_question_install_ignorepkg_t;
1342#[doc = " Should a package be replaced?"]
1343#[repr(C)]
1344#[derive(Debug, Copy, Clone)]
1345pub struct _alpm_question_replace_t {
1346    #[doc = " Type of question"]
1347    pub type_: alpm_question_type_t,
1348    #[doc = " Answer: whether or not to replace oldpkg with newpkg"]
1349    pub replace: ::std::os::raw::c_int,
1350    #[doc = " Package to be replaced"]
1351    pub oldpkg: *mut alpm_pkg_t,
1352    #[doc = " Package to replace with."]
1353    pub newpkg: *mut alpm_pkg_t,
1354    #[doc = " DB of newpkg"]
1355    pub newdb: *mut alpm_db_t,
1356}
1357#[allow(clippy::unnecessary_operation, clippy::identity_op)]
1358const _: () = {
1359    ["Size of _alpm_question_replace_t"]
1360        [::std::mem::size_of::<_alpm_question_replace_t>() - 32usize];
1361    ["Alignment of _alpm_question_replace_t"]
1362        [::std::mem::align_of::<_alpm_question_replace_t>() - 8usize];
1363    ["Offset of field: _alpm_question_replace_t::type_"]
1364        [::std::mem::offset_of!(_alpm_question_replace_t, type_) - 0usize];
1365    ["Offset of field: _alpm_question_replace_t::replace"]
1366        [::std::mem::offset_of!(_alpm_question_replace_t, replace) - 4usize];
1367    ["Offset of field: _alpm_question_replace_t::oldpkg"]
1368        [::std::mem::offset_of!(_alpm_question_replace_t, oldpkg) - 8usize];
1369    ["Offset of field: _alpm_question_replace_t::newpkg"]
1370        [::std::mem::offset_of!(_alpm_question_replace_t, newpkg) - 16usize];
1371    ["Offset of field: _alpm_question_replace_t::newdb"]
1372        [::std::mem::offset_of!(_alpm_question_replace_t, newdb) - 24usize];
1373};
1374#[doc = " Should a package be replaced?"]
1375pub type alpm_question_replace_t = _alpm_question_replace_t;
1376#[doc = " Should a conflicting package be removed?"]
1377#[repr(C)]
1378#[derive(Debug, Copy, Clone)]
1379pub struct _alpm_question_conflict_t {
1380    #[doc = " Type of question"]
1381    pub type_: alpm_question_type_t,
1382    #[doc = " Answer: whether or not to remove conflict->package2"]
1383    pub remove: ::std::os::raw::c_int,
1384    #[doc = " Conflict info"]
1385    pub conflict: *mut alpm_conflict_t,
1386}
1387#[allow(clippy::unnecessary_operation, clippy::identity_op)]
1388const _: () = {
1389    ["Size of _alpm_question_conflict_t"]
1390        [::std::mem::size_of::<_alpm_question_conflict_t>() - 16usize];
1391    ["Alignment of _alpm_question_conflict_t"]
1392        [::std::mem::align_of::<_alpm_question_conflict_t>() - 8usize];
1393    ["Offset of field: _alpm_question_conflict_t::type_"]
1394        [::std::mem::offset_of!(_alpm_question_conflict_t, type_) - 0usize];
1395    ["Offset of field: _alpm_question_conflict_t::remove"]
1396        [::std::mem::offset_of!(_alpm_question_conflict_t, remove) - 4usize];
1397    ["Offset of field: _alpm_question_conflict_t::conflict"]
1398        [::std::mem::offset_of!(_alpm_question_conflict_t, conflict) - 8usize];
1399};
1400#[doc = " Should a conflicting package be removed?"]
1401pub type alpm_question_conflict_t = _alpm_question_conflict_t;
1402#[doc = " Should a corrupted package be deleted?"]
1403#[repr(C)]
1404#[derive(Debug, Copy, Clone)]
1405pub struct _alpm_question_corrupted_t {
1406    #[doc = " Type of question"]
1407    pub type_: alpm_question_type_t,
1408    #[doc = " Answer: whether or not to remove filepath"]
1409    pub remove: ::std::os::raw::c_int,
1410    #[doc = " File to remove"]
1411    pub filepath: *const ::std::os::raw::c_char,
1412    #[doc = " Error code indicating the reason for package invalidity"]
1413    pub reason: alpm_errno_t,
1414}
1415#[allow(clippy::unnecessary_operation, clippy::identity_op)]
1416const _: () = {
1417    ["Size of _alpm_question_corrupted_t"]
1418        [::std::mem::size_of::<_alpm_question_corrupted_t>() - 24usize];
1419    ["Alignment of _alpm_question_corrupted_t"]
1420        [::std::mem::align_of::<_alpm_question_corrupted_t>() - 8usize];
1421    ["Offset of field: _alpm_question_corrupted_t::type_"]
1422        [::std::mem::offset_of!(_alpm_question_corrupted_t, type_) - 0usize];
1423    ["Offset of field: _alpm_question_corrupted_t::remove"]
1424        [::std::mem::offset_of!(_alpm_question_corrupted_t, remove) - 4usize];
1425    ["Offset of field: _alpm_question_corrupted_t::filepath"]
1426        [::std::mem::offset_of!(_alpm_question_corrupted_t, filepath) - 8usize];
1427    ["Offset of field: _alpm_question_corrupted_t::reason"]
1428        [::std::mem::offset_of!(_alpm_question_corrupted_t, reason) - 16usize];
1429};
1430#[doc = " Should a corrupted package be deleted?"]
1431pub type alpm_question_corrupted_t = _alpm_question_corrupted_t;
1432#[doc = " Should unresolvable targets be removed from the transaction?"]
1433#[repr(C)]
1434#[derive(Debug, Copy, Clone)]
1435pub struct _alpm_question_remove_pkgs_t {
1436    #[doc = " Type of question"]
1437    pub type_: alpm_question_type_t,
1438    #[doc = " Answer: whether or not to skip packages"]
1439    pub skip: ::std::os::raw::c_int,
1440    #[doc = " List of alpm_pkg_t* with unresolved dependencies"]
1441    pub packages: *mut alpm_list_t,
1442}
1443#[allow(clippy::unnecessary_operation, clippy::identity_op)]
1444const _: () = {
1445    ["Size of _alpm_question_remove_pkgs_t"]
1446        [::std::mem::size_of::<_alpm_question_remove_pkgs_t>() - 16usize];
1447    ["Alignment of _alpm_question_remove_pkgs_t"]
1448        [::std::mem::align_of::<_alpm_question_remove_pkgs_t>() - 8usize];
1449    ["Offset of field: _alpm_question_remove_pkgs_t::type_"]
1450        [::std::mem::offset_of!(_alpm_question_remove_pkgs_t, type_) - 0usize];
1451    ["Offset of field: _alpm_question_remove_pkgs_t::skip"]
1452        [::std::mem::offset_of!(_alpm_question_remove_pkgs_t, skip) - 4usize];
1453    ["Offset of field: _alpm_question_remove_pkgs_t::packages"]
1454        [::std::mem::offset_of!(_alpm_question_remove_pkgs_t, packages) - 8usize];
1455};
1456#[doc = " Should unresolvable targets be removed from the transaction?"]
1457pub type alpm_question_remove_pkgs_t = _alpm_question_remove_pkgs_t;
1458#[doc = " Provider selection"]
1459#[repr(C)]
1460#[derive(Debug, Copy, Clone)]
1461pub struct _alpm_question_select_provider_t {
1462    #[doc = " Type of question"]
1463    pub type_: alpm_question_type_t,
1464    #[doc = " Answer: which provider to use (index from providers)"]
1465    pub use_index: ::std::os::raw::c_int,
1466    #[doc = " List of alpm_pkg_t* as possible providers"]
1467    pub providers: *mut alpm_list_t,
1468    #[doc = " What providers provide for"]
1469    pub depend: *mut alpm_depend_t,
1470}
1471#[allow(clippy::unnecessary_operation, clippy::identity_op)]
1472const _: () = {
1473    ["Size of _alpm_question_select_provider_t"]
1474        [::std::mem::size_of::<_alpm_question_select_provider_t>() - 24usize];
1475    ["Alignment of _alpm_question_select_provider_t"]
1476        [::std::mem::align_of::<_alpm_question_select_provider_t>() - 8usize];
1477    ["Offset of field: _alpm_question_select_provider_t::type_"]
1478        [::std::mem::offset_of!(_alpm_question_select_provider_t, type_) - 0usize];
1479    ["Offset of field: _alpm_question_select_provider_t::use_index"]
1480        [::std::mem::offset_of!(_alpm_question_select_provider_t, use_index) - 4usize];
1481    ["Offset of field: _alpm_question_select_provider_t::providers"]
1482        [::std::mem::offset_of!(_alpm_question_select_provider_t, providers) - 8usize];
1483    ["Offset of field: _alpm_question_select_provider_t::depend"]
1484        [::std::mem::offset_of!(_alpm_question_select_provider_t, depend) - 16usize];
1485};
1486#[doc = " Provider selection"]
1487pub type alpm_question_select_provider_t = _alpm_question_select_provider_t;
1488#[doc = " Should a key be imported?"]
1489#[repr(C)]
1490#[derive(Debug, Copy, Clone)]
1491pub struct _alpm_question_import_key_t {
1492    #[doc = " Type of question"]
1493    pub type_: alpm_question_type_t,
1494    #[doc = " Answer: whether or not to import key"]
1495    pub import: ::std::os::raw::c_int,
1496    #[doc = " UID of the key to import"]
1497    pub uid: *const ::std::os::raw::c_char,
1498    #[doc = " Fingerprint the key to import"]
1499    pub fingerprint: *const ::std::os::raw::c_char,
1500}
1501#[allow(clippy::unnecessary_operation, clippy::identity_op)]
1502const _: () = {
1503    ["Size of _alpm_question_import_key_t"]
1504        [::std::mem::size_of::<_alpm_question_import_key_t>() - 24usize];
1505    ["Alignment of _alpm_question_import_key_t"]
1506        [::std::mem::align_of::<_alpm_question_import_key_t>() - 8usize];
1507    ["Offset of field: _alpm_question_import_key_t::type_"]
1508        [::std::mem::offset_of!(_alpm_question_import_key_t, type_) - 0usize];
1509    ["Offset of field: _alpm_question_import_key_t::import"]
1510        [::std::mem::offset_of!(_alpm_question_import_key_t, import) - 4usize];
1511    ["Offset of field: _alpm_question_import_key_t::uid"]
1512        [::std::mem::offset_of!(_alpm_question_import_key_t, uid) - 8usize];
1513    ["Offset of field: _alpm_question_import_key_t::fingerprint"]
1514        [::std::mem::offset_of!(_alpm_question_import_key_t, fingerprint) - 16usize];
1515};
1516#[doc = " Should a key be imported?"]
1517pub type alpm_question_import_key_t = _alpm_question_import_key_t;
1518#[doc = " Questions.\n This is an union passed to the callback that allows the frontend to know\n which type of question was triggered (via type). It is then possible to\n typecast the pointer to the right structure, or use the union field, in order\n to access question-specific data."]
1519#[repr(C)]
1520#[derive(Copy, Clone)]
1521pub union _alpm_question_t {
1522    #[doc = " The type of question. It's always safe to access this."]
1523    pub type_: alpm_question_type_t,
1524    #[doc = " A question that can represent any question.\n It's always safe to access this."]
1525    pub any: alpm_question_any_t,
1526    #[doc = " Should target in ignorepkg be installed anyway?"]
1527    pub install_ignorepkg: alpm_question_install_ignorepkg_t,
1528    #[doc = " Should a package be replaced?"]
1529    pub replace: alpm_question_replace_t,
1530    #[doc = " Should a conflicting package be removed?"]
1531    pub conflict: alpm_question_conflict_t,
1532    #[doc = " Should a corrupted package be deleted?"]
1533    pub corrupted: alpm_question_corrupted_t,
1534    #[doc = " Should unresolvable targets be removed from the transaction?"]
1535    pub remove_pkgs: alpm_question_remove_pkgs_t,
1536    #[doc = " Provider selection"]
1537    pub select_provider: alpm_question_select_provider_t,
1538    #[doc = " Should a key be imported?"]
1539    pub import_key: alpm_question_import_key_t,
1540}
1541#[allow(clippy::unnecessary_operation, clippy::identity_op)]
1542const _: () = {
1543    ["Size of _alpm_question_t"][::std::mem::size_of::<_alpm_question_t>() - 32usize];
1544    ["Alignment of _alpm_question_t"][::std::mem::align_of::<_alpm_question_t>() - 8usize];
1545    ["Offset of field: _alpm_question_t::type_"]
1546        [::std::mem::offset_of!(_alpm_question_t, type_) - 0usize];
1547    ["Offset of field: _alpm_question_t::any"]
1548        [::std::mem::offset_of!(_alpm_question_t, any) - 0usize];
1549    ["Offset of field: _alpm_question_t::install_ignorepkg"]
1550        [::std::mem::offset_of!(_alpm_question_t, install_ignorepkg) - 0usize];
1551    ["Offset of field: _alpm_question_t::replace"]
1552        [::std::mem::offset_of!(_alpm_question_t, replace) - 0usize];
1553    ["Offset of field: _alpm_question_t::conflict"]
1554        [::std::mem::offset_of!(_alpm_question_t, conflict) - 0usize];
1555    ["Offset of field: _alpm_question_t::corrupted"]
1556        [::std::mem::offset_of!(_alpm_question_t, corrupted) - 0usize];
1557    ["Offset of field: _alpm_question_t::remove_pkgs"]
1558        [::std::mem::offset_of!(_alpm_question_t, remove_pkgs) - 0usize];
1559    ["Offset of field: _alpm_question_t::select_provider"]
1560        [::std::mem::offset_of!(_alpm_question_t, select_provider) - 0usize];
1561    ["Offset of field: _alpm_question_t::import_key"]
1562        [::std::mem::offset_of!(_alpm_question_t, import_key) - 0usize];
1563};
1564#[doc = " Questions.\n This is an union passed to the callback that allows the frontend to know\n which type of question was triggered (via type). It is then possible to\n typecast the pointer to the right structure, or use the union field, in order\n to access question-specific data."]
1565pub type alpm_question_t = _alpm_question_t;
1566#[doc = " Question callback.\n\n This callback allows user to give input and decide what to do during certain events\n @param ctx user-provided context\n @param question the question being asked."]
1567pub type alpm_cb_question = ::std::option::Option<
1568    unsafe extern "C" fn(ctx: *mut ::std::os::raw::c_void, question: *mut alpm_question_t),
1569>;
1570#[repr(u32)]
1571#[doc = " An enum over different kinds of progress alerts."]
1572#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
1573pub enum _alpm_progress_t {
1574    #[doc = " Package install"]
1575    ALPM_PROGRESS_ADD_START = 0,
1576    #[doc = " Package upgrade"]
1577    ALPM_PROGRESS_UPGRADE_START = 1,
1578    #[doc = " Package downgrade"]
1579    ALPM_PROGRESS_DOWNGRADE_START = 2,
1580    #[doc = " Package reinstall"]
1581    ALPM_PROGRESS_REINSTALL_START = 3,
1582    #[doc = " Package removal"]
1583    ALPM_PROGRESS_REMOVE_START = 4,
1584    #[doc = " Conflict checking"]
1585    ALPM_PROGRESS_CONFLICTS_START = 5,
1586    #[doc = " Diskspace checking"]
1587    ALPM_PROGRESS_DISKSPACE_START = 6,
1588    #[doc = " Package Integrity checking"]
1589    ALPM_PROGRESS_INTEGRITY_START = 7,
1590    #[doc = " Loading packages from disk"]
1591    ALPM_PROGRESS_LOAD_START = 8,
1592    #[doc = " Checking signatures of packages"]
1593    ALPM_PROGRESS_KEYRING_START = 9,
1594}
1595#[doc = " An enum over different kinds of progress alerts."]
1596pub use self::_alpm_progress_t as alpm_progress_t;
1597#[doc = " Progress callback\n\n Alert the front end about the progress of certain events.\n Allows the implementation of loading bars for events that\n make take a while to complete.\n @param ctx user-provided context\n @param progress the kind of event that is progressing\n @param pkg for package operations, the name of the package being operated on\n @param percent the percent completion of the action\n @param howmany the total amount of items in the action\n @param current the current amount of items completed\n/\n/** Progress callback"]
1598pub type alpm_cb_progress = ::std::option::Option<
1599    unsafe extern "C" fn(
1600        ctx: *mut ::std::os::raw::c_void,
1601        progress: alpm_progress_t,
1602        pkg: *const ::std::os::raw::c_char,
1603        percent: ::std::os::raw::c_int,
1604        howmany: usize,
1605        current: usize,
1606    ),
1607>;
1608#[repr(u32)]
1609#[doc = " File download events.\n These events are reported by ALPM via download callback."]
1610#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
1611pub enum _alpm_download_event_type_t {
1612    #[doc = " A download was started"]
1613    ALPM_DOWNLOAD_INIT = 0,
1614    #[doc = " A download made progress"]
1615    ALPM_DOWNLOAD_PROGRESS = 1,
1616    #[doc = " Download will be retried"]
1617    ALPM_DOWNLOAD_RETRY = 2,
1618    #[doc = " A download completed"]
1619    ALPM_DOWNLOAD_COMPLETED = 3,
1620}
1621#[doc = " File download events.\n These events are reported by ALPM via download callback."]
1622pub use self::_alpm_download_event_type_t as alpm_download_event_type_t;
1623#[doc = " Context struct for when a download starts."]
1624#[repr(C)]
1625#[derive(Debug, Copy, Clone)]
1626pub struct _alpm_download_event_init_t {
1627    #[doc = " whether this file is optional and thus the errors could be ignored"]
1628    pub optional: ::std::os::raw::c_int,
1629}
1630#[allow(clippy::unnecessary_operation, clippy::identity_op)]
1631const _: () = {
1632    ["Size of _alpm_download_event_init_t"]
1633        [::std::mem::size_of::<_alpm_download_event_init_t>() - 4usize];
1634    ["Alignment of _alpm_download_event_init_t"]
1635        [::std::mem::align_of::<_alpm_download_event_init_t>() - 4usize];
1636    ["Offset of field: _alpm_download_event_init_t::optional"]
1637        [::std::mem::offset_of!(_alpm_download_event_init_t, optional) - 0usize];
1638};
1639#[doc = " Context struct for when a download starts."]
1640pub type alpm_download_event_init_t = _alpm_download_event_init_t;
1641#[doc = " Context struct for when a download progresses."]
1642#[repr(C)]
1643#[derive(Debug, Copy, Clone)]
1644pub struct _alpm_download_event_progress_t {
1645    #[doc = " Amount of data downloaded"]
1646    pub downloaded: off_t,
1647    #[doc = " Total amount need to be downloaded"]
1648    pub total: off_t,
1649}
1650#[allow(clippy::unnecessary_operation, clippy::identity_op)]
1651const _: () = {
1652    ["Size of _alpm_download_event_progress_t"]
1653        [::std::mem::size_of::<_alpm_download_event_progress_t>() - 16usize];
1654    ["Alignment of _alpm_download_event_progress_t"]
1655        [::std::mem::align_of::<_alpm_download_event_progress_t>() - 8usize];
1656    ["Offset of field: _alpm_download_event_progress_t::downloaded"]
1657        [::std::mem::offset_of!(_alpm_download_event_progress_t, downloaded) - 0usize];
1658    ["Offset of field: _alpm_download_event_progress_t::total"]
1659        [::std::mem::offset_of!(_alpm_download_event_progress_t, total) - 8usize];
1660};
1661#[doc = " Context struct for when a download progresses."]
1662pub type alpm_download_event_progress_t = _alpm_download_event_progress_t;
1663#[doc = " Context struct for when a download retries."]
1664#[repr(C)]
1665#[derive(Debug, Copy, Clone)]
1666pub struct _alpm_download_event_retry_t {
1667    #[doc = " If the download will resume or start over"]
1668    pub resume: ::std::os::raw::c_int,
1669}
1670#[allow(clippy::unnecessary_operation, clippy::identity_op)]
1671const _: () = {
1672    ["Size of _alpm_download_event_retry_t"]
1673        [::std::mem::size_of::<_alpm_download_event_retry_t>() - 4usize];
1674    ["Alignment of _alpm_download_event_retry_t"]
1675        [::std::mem::align_of::<_alpm_download_event_retry_t>() - 4usize];
1676    ["Offset of field: _alpm_download_event_retry_t::resume"]
1677        [::std::mem::offset_of!(_alpm_download_event_retry_t, resume) - 0usize];
1678};
1679#[doc = " Context struct for when a download retries."]
1680pub type alpm_download_event_retry_t = _alpm_download_event_retry_t;
1681#[doc = " Context struct for when a download completes."]
1682#[repr(C)]
1683#[derive(Debug, Copy, Clone)]
1684pub struct _alpm_download_event_completed_t {
1685    #[doc = " Total bytes in file"]
1686    pub total: off_t,
1687    #[doc = " download result code:\n    0 - download completed successfully\n    1 - the file is up-to-date\n   -1 - error"]
1688    pub result: ::std::os::raw::c_int,
1689}
1690#[allow(clippy::unnecessary_operation, clippy::identity_op)]
1691const _: () = {
1692    ["Size of _alpm_download_event_completed_t"]
1693        [::std::mem::size_of::<_alpm_download_event_completed_t>() - 16usize];
1694    ["Alignment of _alpm_download_event_completed_t"]
1695        [::std::mem::align_of::<_alpm_download_event_completed_t>() - 8usize];
1696    ["Offset of field: _alpm_download_event_completed_t::total"]
1697        [::std::mem::offset_of!(_alpm_download_event_completed_t, total) - 0usize];
1698    ["Offset of field: _alpm_download_event_completed_t::result"]
1699        [::std::mem::offset_of!(_alpm_download_event_completed_t, result) - 8usize];
1700};
1701#[doc = " Context struct for when a download completes."]
1702pub type alpm_download_event_completed_t = _alpm_download_event_completed_t;
1703#[doc = " Type of download progress callbacks.\n @param ctx user-provided context\n @param filename the name of the file being downloaded\n @param event the event type\n @param data the event data of type alpm_download_event_*_t"]
1704pub type alpm_cb_download = ::std::option::Option<
1705    unsafe extern "C" fn(
1706        ctx: *mut ::std::os::raw::c_void,
1707        filename: *const ::std::os::raw::c_char,
1708        event: alpm_download_event_type_t,
1709        data: *mut ::std::os::raw::c_void,
1710    ),
1711>;
1712#[doc = " A callback for downloading files\n @param ctx user-provided context\n @param url the URL of the file to be downloaded\n @param localpath the directory to which the file should be downloaded\n @param force whether to force an update, even if the file is the same\n @return 0 on success, 1 if the file exists and is identical, -1 on\n error."]
1713pub type alpm_cb_fetch = ::std::option::Option<
1714    unsafe extern "C" fn(
1715        ctx: *mut ::std::os::raw::c_void,
1716        url: *const ::std::os::raw::c_char,
1717        localpath: *const ::std::os::raw::c_char,
1718        force: ::std::os::raw::c_int,
1719    ) -> ::std::os::raw::c_int,
1720>;
1721extern "C" {
1722    #[doc = " Get the database of locally installed packages.\n The returned pointer points to an internal structure\n of libalpm which should only be manipulated through\n libalpm functions.\n @return a reference to the local database"]
1723    pub fn alpm_get_localdb(handle: *mut alpm_handle_t) -> *mut alpm_db_t;
1724}
1725extern "C" {
1726    #[doc = " Get the list of sync databases.\n Returns a list of alpm_db_t structures, one for each registered\n sync database.\n\n @param handle the context handle\n @return a reference to an internal list of alpm_db_t structures"]
1727    pub fn alpm_get_syncdbs(handle: *mut alpm_handle_t) -> *mut alpm_list_t;
1728}
1729extern "C" {
1730    #[doc = " Register a sync database of packages.\n Databases can not be registered when there is an active transaction.\n\n @param handle the context handle\n @param treename the name of the sync repository\n @param level what level of signature checking to perform on the\n database; note that this must be a '.sig' file type verification\n @return an alpm_db_t* on success (the value), NULL on error"]
1731    pub fn alpm_register_syncdb(
1732        handle: *mut alpm_handle_t,
1733        treename: *const ::std::os::raw::c_char,
1734        level: ::std::os::raw::c_int,
1735    ) -> *mut alpm_db_t;
1736}
1737extern "C" {
1738    #[doc = " Unregister all package databases.\n Databases can not be unregistered while there is an active transaction.\n\n @param handle the context handle\n @return 0 on success, -1 on error (pm_errno is set accordingly)"]
1739    pub fn alpm_unregister_all_syncdbs(handle: *mut alpm_handle_t) -> ::std::os::raw::c_int;
1740}
1741extern "C" {
1742    #[doc = " Unregister a package database.\n Databases can not be unregistered when there is an active transaction.\n\n @param db pointer to the package database to unregister\n @return 0 on success, -1 on error (pm_errno is set accordingly)"]
1743    pub fn alpm_db_unregister(db: *mut alpm_db_t) -> ::std::os::raw::c_int;
1744}
1745extern "C" {
1746    #[doc = " Get the handle of a package database.\n @param db pointer to the package database\n @return the alpm handle that the package database belongs to"]
1747    pub fn alpm_db_get_handle(db: *mut alpm_db_t) -> *mut alpm_handle_t;
1748}
1749extern "C" {
1750    #[doc = " Get the name of a package database.\n @param db pointer to the package database\n @return the name of the package database, NULL on error"]
1751    pub fn alpm_db_get_name(db: *const alpm_db_t) -> *const ::std::os::raw::c_char;
1752}
1753extern "C" {
1754    #[doc = " Get the signature verification level for a database.\n Will return the default verification level if this database is set up\n with ALPM_SIG_USE_DEFAULT.\n @param db pointer to the package database\n @return the signature verification level"]
1755    pub fn alpm_db_get_siglevel(db: *mut alpm_db_t) -> ::std::os::raw::c_int;
1756}
1757extern "C" {
1758    #[doc = " Check the validity of a database.\n This is most useful for sync databases and verifying signature status.\n If invalid, the handle error code will be set accordingly.\n @param db pointer to the package database\n @return 0 if valid, -1 if invalid (pm_errno is set accordingly)"]
1759    pub fn alpm_db_get_valid(db: *mut alpm_db_t) -> ::std::os::raw::c_int;
1760}
1761extern "C" {
1762    #[doc = " Get the list of servers assigned to this db.\n @param db pointer to the database to get the servers from\n @return a char* list of servers"]
1763    pub fn alpm_db_get_servers(db: *const alpm_db_t) -> *mut alpm_list_t;
1764}
1765extern "C" {
1766    #[doc = " Sets the list of servers for the database to use.\n @param db the database to set the servers. The list will be duped and\n the original will still need to be freed by the caller.\n @param servers a char* list of servers."]
1767    pub fn alpm_db_set_servers(
1768        db: *mut alpm_db_t,
1769        servers: *mut alpm_list_t,
1770    ) -> ::std::os::raw::c_int;
1771}
1772extern "C" {
1773    #[doc = " Add a download server to a database.\n @param db database pointer\n @param url url of the server\n @return 0 on success, -1 on error (pm_errno is set accordingly)"]
1774    pub fn alpm_db_add_server(
1775        db: *mut alpm_db_t,
1776        url: *const ::std::os::raw::c_char,
1777    ) -> ::std::os::raw::c_int;
1778}
1779extern "C" {
1780    #[doc = " Remove a download server from a database.\n @param db database pointer\n @param url url of the server\n @return 0 on success, 1 on server not present,\n -1 on error (pm_errno is set accordingly)"]
1781    pub fn alpm_db_remove_server(
1782        db: *mut alpm_db_t,
1783        url: *const ::std::os::raw::c_char,
1784    ) -> ::std::os::raw::c_int;
1785}
1786extern "C" {
1787    #[doc = " Get the list of cache servers assigned to this db.\n @param db pointer to the database to get the servers from\n @return a char* list of servers"]
1788    pub fn alpm_db_get_cache_servers(db: *const alpm_db_t) -> *mut alpm_list_t;
1789}
1790extern "C" {
1791    #[doc = " Sets the list of cache servers for the database to use.\n @param db the database to set the servers. The list will be duped and\n the original will still need to be freed by the caller.\n @param servers a char* list of servers."]
1792    pub fn alpm_db_set_cache_servers(
1793        db: *mut alpm_db_t,
1794        servers: *mut alpm_list_t,
1795    ) -> ::std::os::raw::c_int;
1796}
1797extern "C" {
1798    #[doc = " Add a download cache server to a database.\n @param db database pointer\n @param url url of the server\n @return 0 on success, -1 on error (pm_errno is set accordingly)"]
1799    pub fn alpm_db_add_cache_server(
1800        db: *mut alpm_db_t,
1801        url: *const ::std::os::raw::c_char,
1802    ) -> ::std::os::raw::c_int;
1803}
1804extern "C" {
1805    #[doc = " Remove a download cache server from a database.\n @param db database pointer\n @param url url of the server\n @return 0 on success, 1 on server not present,\n -1 on error (pm_errno is set accordingly)"]
1806    pub fn alpm_db_remove_cache_server(
1807        db: *mut alpm_db_t,
1808        url: *const ::std::os::raw::c_char,
1809    ) -> ::std::os::raw::c_int;
1810}
1811extern "C" {
1812    #[doc = " Update package databases.\n\n An update of the package databases in the list \\a dbs will be attempted.\n Unless \\a force is true, the update will only be performed if the remote\n databases were modified since the last update.\n\n This operation requires a database lock, and will return an applicable error\n if the lock could not be obtained.\n\n Example:\n @code\n alpm_list_t *dbs = alpm_get_syncdbs(config->handle);\n ret = alpm_db_update(config->handle, dbs, force);\n if(ret < 0) {\n     pm_printf(ALPM_LOG_ERROR, _(\"failed to synchronize all databases (%s)\\n\"),\n         alpm_strerror(alpm_errno(config->handle)));\n }\n @endcode\n\n @note After a successful update, the \\link alpm_db_get_pkgcache()\n package cache \\endlink will be invalidated\n @param handle the context handle\n @param dbs list of package databases to update\n @param force if true, then forces the update, otherwise update only in case\n the databases aren't up to date\n @return 0 on success, -1 on error (pm_errno is set accordingly),\n 1 if all databases are up to to date"]
1813    pub fn alpm_db_update(
1814        handle: *mut alpm_handle_t,
1815        dbs: *mut alpm_list_t,
1816        force: ::std::os::raw::c_int,
1817    ) -> ::std::os::raw::c_int;
1818}
1819extern "C" {
1820    #[doc = " Get a package entry from a package database.\n Looking up a package is O(1) and will be significantly faster than\n iterating over the pkgcahe.\n @param db pointer to the package database to get the package from\n @param name of the package\n @return the package entry on success, NULL on error"]
1821    pub fn alpm_db_get_pkg(
1822        db: *mut alpm_db_t,
1823        name: *const ::std::os::raw::c_char,
1824    ) -> *mut alpm_pkg_t;
1825}
1826extern "C" {
1827    #[doc = " Get the package cache of a package database.\n This is a list of all packages the db contains.\n @param db pointer to the package database to get the package from\n @return the list of packages on success, NULL on error"]
1828    pub fn alpm_db_get_pkgcache(db: *mut alpm_db_t) -> *mut alpm_list_t;
1829}
1830extern "C" {
1831    #[doc = " Get a group entry from a package database.\n Looking up a group is O(1) and will be significantly faster than\n iterating over the groupcahe.\n @param db pointer to the package database to get the group from\n @param name of the group\n @return the groups entry on success, NULL on error"]
1832    pub fn alpm_db_get_group(
1833        db: *mut alpm_db_t,
1834        name: *const ::std::os::raw::c_char,
1835    ) -> *mut alpm_group_t;
1836}
1837extern "C" {
1838    #[doc = " Get the group cache of a package database.\n @param db pointer to the package database to get the group from\n @return the list of groups on success, NULL on error"]
1839    pub fn alpm_db_get_groupcache(db: *mut alpm_db_t) -> *mut alpm_list_t;
1840}
1841extern "C" {
1842    #[doc = " Searches a database with regular expressions.\n @param db pointer to the package database to search in\n @param needles a list of regular expressions to search for\n @param ret pointer to list for storing packages matching all\n regular expressions - must point to an empty (NULL) alpm_list_t *.\n @return 0 on success, -1 on error (pm_errno is set accordingly)"]
1843    pub fn alpm_db_search(
1844        db: *mut alpm_db_t,
1845        needles: *const alpm_list_t,
1846        ret: *mut *mut alpm_list_t,
1847    ) -> ::std::os::raw::c_int;
1848}
1849pub mod _alpm_db_usage_t {
1850    #[doc = " The usage level of a database."]
1851    pub type Type = ::std::os::raw::c_uint;
1852    #[doc = " Enable refreshes for this database"]
1853    pub const ALPM_DB_USAGE_SYNC: Type = 1;
1854    #[doc = " Enable search for this database"]
1855    pub const ALPM_DB_USAGE_SEARCH: Type = 2;
1856    #[doc = " Enable installing packages from this database"]
1857    pub const ALPM_DB_USAGE_INSTALL: Type = 4;
1858    #[doc = " Enable sysupgrades with this database"]
1859    pub const ALPM_DB_USAGE_UPGRADE: Type = 8;
1860    #[doc = " Enable all usage levels"]
1861    pub const ALPM_DB_USAGE_ALL: Type = 15;
1862}
1863#[doc = " The usage level of a database."]
1864pub use self::_alpm_db_usage_t::Type as alpm_db_usage_t;
1865extern "C" {
1866    #[doc = " Sets the usage of a database.\n @param db pointer to the package database to set the status for\n @param usage a bitmask of alpm_db_usage_t values\n @return 0 on success, or -1 on error"]
1867    pub fn alpm_db_set_usage(
1868        db: *mut alpm_db_t,
1869        usage: ::std::os::raw::c_int,
1870    ) -> ::std::os::raw::c_int;
1871}
1872extern "C" {
1873    #[doc = " Gets the usage of a database.\n @param db pointer to the package database to get the status of\n @param usage pointer to an alpm_db_usage_t to store db's status\n @return 0 on success, or -1 on error"]
1874    pub fn alpm_db_get_usage(
1875        db: *mut alpm_db_t,
1876        usage: *mut ::std::os::raw::c_int,
1877    ) -> ::std::os::raw::c_int;
1878}
1879pub mod _alpm_loglevel_t {
1880    #[doc = " Logging Levels"]
1881    pub type Type = ::std::os::raw::c_uint;
1882    #[doc = " Error"]
1883    pub const ALPM_LOG_ERROR: Type = 1;
1884    #[doc = " Warning"]
1885    pub const ALPM_LOG_WARNING: Type = 2;
1886    #[doc = " Debug"]
1887    pub const ALPM_LOG_DEBUG: Type = 4;
1888    #[doc = " Function"]
1889    pub const ALPM_LOG_FUNCTION: Type = 8;
1890}
1891#[doc = " Logging Levels"]
1892pub use self::_alpm_loglevel_t::Type as alpm_loglevel_t;
1893#[doc = " The callback type for logging.\n\n libalpm will call this function whenever something is to be logged.\n many libalpm will produce log output. Additionally any calls to \\link alpm_logaction\n \\endlink will also call this callback.\n @param ctx user-provided context\n @param level the currently set loglevel\n @param fmt the printf like format string\n @param args printf like arguments"]
1894pub type alpm_cb_log = ::std::option::Option<
1895    unsafe extern "C" fn(
1896        ctx: *mut ::std::os::raw::c_void,
1897        level: alpm_loglevel_t,
1898        fmt: *const ::std::os::raw::c_char,
1899        args: *mut __va_list_tag,
1900    ),
1901>;
1902extern "C" {
1903    #[doc = " A printf-like function for logging.\n @param handle the context handle\n @param prefix caller-specific prefix for the log\n @param fmt output format\n @return 0 on success, -1 on error (pm_errno is set accordingly)"]
1904    pub fn alpm_logaction(
1905        handle: *mut alpm_handle_t,
1906        prefix: *const ::std::os::raw::c_char,
1907        fmt: *const ::std::os::raw::c_char,
1908        ...
1909    ) -> ::std::os::raw::c_int;
1910}
1911extern "C" {
1912    #[doc = " Returns the callback used for logging.\n @param handle the context handle\n @return the currently set log callback"]
1913    pub fn alpm_option_get_logcb(handle: *mut alpm_handle_t) -> alpm_cb_log;
1914}
1915extern "C" {
1916    #[doc = " Returns the callback used for logging.\n @param handle the context handle\n @return the currently set log callback context"]
1917    pub fn alpm_option_get_logcb_ctx(handle: *mut alpm_handle_t) -> *mut ::std::os::raw::c_void;
1918}
1919extern "C" {
1920    #[doc = " Sets the callback used for logging.\n @param handle the context handle\n @param cb the cb to use\n @param ctx user-provided context to pass to cb\n @return 0 on success, -1 on error (pm_errno is set accordingly)"]
1921    pub fn alpm_option_set_logcb(
1922        handle: *mut alpm_handle_t,
1923        cb: alpm_cb_log,
1924        ctx: *mut ::std::os::raw::c_void,
1925    ) -> ::std::os::raw::c_int;
1926}
1927extern "C" {
1928    #[doc = " Returns the callback used to report download progress.\n @param handle the context handle\n @return the currently set download callback"]
1929    pub fn alpm_option_get_dlcb(handle: *mut alpm_handle_t) -> alpm_cb_download;
1930}
1931extern "C" {
1932    #[doc = " Returns the callback used to report download progress.\n @param handle the context handle\n @return the currently set download callback context"]
1933    pub fn alpm_option_get_dlcb_ctx(handle: *mut alpm_handle_t) -> *mut ::std::os::raw::c_void;
1934}
1935extern "C" {
1936    #[doc = " Sets the callback used to report download progress.\n @param handle the context handle\n @param cb the cb to use\n @param ctx user-provided context to pass to cb\n @return 0 on success, -1 on error (pm_errno is set accordingly)"]
1937    pub fn alpm_option_set_dlcb(
1938        handle: *mut alpm_handle_t,
1939        cb: alpm_cb_download,
1940        ctx: *mut ::std::os::raw::c_void,
1941    ) -> ::std::os::raw::c_int;
1942}
1943extern "C" {
1944    #[doc = " Returns the downloading callback.\n @param handle the context handle\n @return the currently set fetch callback"]
1945    pub fn alpm_option_get_fetchcb(handle: *mut alpm_handle_t) -> alpm_cb_fetch;
1946}
1947extern "C" {
1948    #[doc = " Returns the downloading callback.\n @param handle the context handle\n @return the currently set fetch callback context"]
1949    pub fn alpm_option_get_fetchcb_ctx(handle: *mut alpm_handle_t) -> *mut ::std::os::raw::c_void;
1950}
1951extern "C" {
1952    #[doc = " Sets the downloading callback.\n @param handle the context handle\n @param cb the cb to use\n @param ctx user-provided context to pass to cb\n @return 0 on success, -1 on error (pm_errno is set accordingly)"]
1953    pub fn alpm_option_set_fetchcb(
1954        handle: *mut alpm_handle_t,
1955        cb: alpm_cb_fetch,
1956        ctx: *mut ::std::os::raw::c_void,
1957    ) -> ::std::os::raw::c_int;
1958}
1959extern "C" {
1960    #[doc = " Returns the callback used for events.\n @param handle the context handle\n @return the currently set event callback"]
1961    pub fn alpm_option_get_eventcb(handle: *mut alpm_handle_t) -> alpm_cb_event;
1962}
1963extern "C" {
1964    #[doc = " Returns the callback used for events.\n @param handle the context handle\n @return the currently set event callback context"]
1965    pub fn alpm_option_get_eventcb_ctx(handle: *mut alpm_handle_t) -> *mut ::std::os::raw::c_void;
1966}
1967extern "C" {
1968    #[doc = " Sets the callback used for events.\n @param handle the context handle\n @param cb the cb to use\n @param ctx user-provided context to pass to cb\n @return 0 on success, -1 on error (pm_errno is set accordingly)"]
1969    pub fn alpm_option_set_eventcb(
1970        handle: *mut alpm_handle_t,
1971        cb: alpm_cb_event,
1972        ctx: *mut ::std::os::raw::c_void,
1973    ) -> ::std::os::raw::c_int;
1974}
1975extern "C" {
1976    #[doc = " Returns the callback used for questions.\n @param handle the context handle\n @return the currently set question callback"]
1977    pub fn alpm_option_get_questioncb(handle: *mut alpm_handle_t) -> alpm_cb_question;
1978}
1979extern "C" {
1980    #[doc = " Returns the callback used for questions.\n @param handle the context handle\n @return the currently set question callback context"]
1981    pub fn alpm_option_get_questioncb_ctx(
1982        handle: *mut alpm_handle_t,
1983    ) -> *mut ::std::os::raw::c_void;
1984}
1985extern "C" {
1986    #[doc = " Sets the callback used for questions.\n @param handle the context handle\n @param cb the cb to use\n @param ctx user-provided context to pass to cb\n @return 0 on success, -1 on error (pm_errno is set accordingly)"]
1987    pub fn alpm_option_set_questioncb(
1988        handle: *mut alpm_handle_t,
1989        cb: alpm_cb_question,
1990        ctx: *mut ::std::os::raw::c_void,
1991    ) -> ::std::os::raw::c_int;
1992}
1993extern "C" {
1994    #[doc = "Returns the callback used for operation progress.\n @param handle the context handle\n @return the currently set progress callback"]
1995    pub fn alpm_option_get_progresscb(handle: *mut alpm_handle_t) -> alpm_cb_progress;
1996}
1997extern "C" {
1998    #[doc = "Returns the callback used for operation progress.\n @param handle the context handle\n @return the currently set progress callback context"]
1999    pub fn alpm_option_get_progresscb_ctx(
2000        handle: *mut alpm_handle_t,
2001    ) -> *mut ::std::os::raw::c_void;
2002}
2003extern "C" {
2004    #[doc = " Sets the callback used for operation progress.\n @param handle the context handle\n @param cb the cb to use\n @param ctx user-provided context to pass to cb\n @return 0 on success, -1 on error (pm_errno is set accordingly)"]
2005    pub fn alpm_option_set_progresscb(
2006        handle: *mut alpm_handle_t,
2007        cb: alpm_cb_progress,
2008        ctx: *mut ::std::os::raw::c_void,
2009    ) -> ::std::os::raw::c_int;
2010}
2011extern "C" {
2012    #[doc = " Returns the root path. Read-only.\n @param handle the context handle"]
2013    pub fn alpm_option_get_root(handle: *mut alpm_handle_t) -> *const ::std::os::raw::c_char;
2014}
2015extern "C" {
2016    #[doc = " Returns the path to the database directory. Read-only.\n @param handle the context handle"]
2017    pub fn alpm_option_get_dbpath(handle: *mut alpm_handle_t) -> *const ::std::os::raw::c_char;
2018}
2019extern "C" {
2020    #[doc = " Get the name of the database lock file. Read-only.\n This is the name that the lockfile would have. It does not\n matter if the lockfile actually exists on disk.\n @param handle the context handle"]
2021    pub fn alpm_option_get_lockfile(handle: *mut alpm_handle_t) -> *const ::std::os::raw::c_char;
2022}
2023extern "C" {
2024    #[doc = " Gets the currently configured cachedirs,\n @param handle the context handle\n @return a char* list of cache directories"]
2025    pub fn alpm_option_get_cachedirs(handle: *mut alpm_handle_t) -> *mut alpm_list_t;
2026}
2027extern "C" {
2028    #[doc = " Sets the cachedirs.\n @param handle the context handle\n @param cachedirs a char* list of cachdirs. The list will be duped and\n the original will still need to be freed by the caller.\n @return 0 on success, -1 on error (pm_errno is set accordingly)"]
2029    pub fn alpm_option_set_cachedirs(
2030        handle: *mut alpm_handle_t,
2031        cachedirs: *mut alpm_list_t,
2032    ) -> ::std::os::raw::c_int;
2033}
2034extern "C" {
2035    #[doc = " Append a cachedir to the configured cachedirs.\n @param handle the context handle\n @param cachedir the cachedir to add\n @return 0 on success, -1 on error (pm_errno is set accordingly)"]
2036    pub fn alpm_option_add_cachedir(
2037        handle: *mut alpm_handle_t,
2038        cachedir: *const ::std::os::raw::c_char,
2039    ) -> ::std::os::raw::c_int;
2040}
2041extern "C" {
2042    #[doc = " Remove a cachedir from the configured cachedirs.\n @param handle the context handle\n @param cachedir the cachedir to remove\n @return 0 on success, -1 on error (pm_errno is set accordingly)"]
2043    pub fn alpm_option_remove_cachedir(
2044        handle: *mut alpm_handle_t,
2045        cachedir: *const ::std::os::raw::c_char,
2046    ) -> ::std::os::raw::c_int;
2047}
2048extern "C" {
2049    #[doc = " Gets the currently configured hookdirs,\n @param handle the context handle\n @return a char* list of hook directories"]
2050    pub fn alpm_option_get_hookdirs(handle: *mut alpm_handle_t) -> *mut alpm_list_t;
2051}
2052extern "C" {
2053    #[doc = " Sets the hookdirs.\n @param handle the context handle\n @param hookdirs a char* list of hookdirs. The list will be duped and\n the original will still need to be freed by the caller.\n @return 0 on success, -1 on error (pm_errno is set accordingly)"]
2054    pub fn alpm_option_set_hookdirs(
2055        handle: *mut alpm_handle_t,
2056        hookdirs: *mut alpm_list_t,
2057    ) -> ::std::os::raw::c_int;
2058}
2059extern "C" {
2060    #[doc = " Append a hookdir to the configured hookdirs.\n @param handle the context handle\n @param hookdir the hookdir to add\n @return 0 on success, -1 on error (pm_errno is set accordingly)"]
2061    pub fn alpm_option_add_hookdir(
2062        handle: *mut alpm_handle_t,
2063        hookdir: *const ::std::os::raw::c_char,
2064    ) -> ::std::os::raw::c_int;
2065}
2066extern "C" {
2067    #[doc = " Remove a hookdir from the configured hookdirs.\n @param handle the context handle\n @param hookdir the hookdir to remove\n @return 0 on success, -1 on error (pm_errno is set accordingly)"]
2068    pub fn alpm_option_remove_hookdir(
2069        handle: *mut alpm_handle_t,
2070        hookdir: *const ::std::os::raw::c_char,
2071    ) -> ::std::os::raw::c_int;
2072}
2073extern "C" {
2074    #[doc = " Gets the currently configured overwritable files,\n @param handle the context handle\n @return a char* list of overwritable file globs"]
2075    pub fn alpm_option_get_overwrite_files(handle: *mut alpm_handle_t) -> *mut alpm_list_t;
2076}
2077extern "C" {
2078    #[doc = " Sets the overwritable files.\n @param handle the context handle\n @param globs a char* list of overwritable file globs. The list will be duped and\n the original will still need to be freed by the caller.\n @return 0 on success, -1 on error (pm_errno is set accordingly)"]
2079    pub fn alpm_option_set_overwrite_files(
2080        handle: *mut alpm_handle_t,
2081        globs: *mut alpm_list_t,
2082    ) -> ::std::os::raw::c_int;
2083}
2084extern "C" {
2085    #[doc = " Append an overwritable file to the configured overwritable files.\n @param handle the context handle\n @param glob the file glob to add\n @return 0 on success, -1 on error (pm_errno is set accordingly)"]
2086    pub fn alpm_option_add_overwrite_file(
2087        handle: *mut alpm_handle_t,
2088        glob: *const ::std::os::raw::c_char,
2089    ) -> ::std::os::raw::c_int;
2090}
2091extern "C" {
2092    #[doc = " Remove a file glob from the configured overwritable files globs.\n @note The overwritable file list contains a list of globs. The glob to\n remove must exactly match the entry to remove. There is no glob expansion.\n @param handle the context handle\n @param glob the file glob to remove\n @return 0 on success, -1 on error (pm_errno is set accordingly)"]
2093    pub fn alpm_option_remove_overwrite_file(
2094        handle: *mut alpm_handle_t,
2095        glob: *const ::std::os::raw::c_char,
2096    ) -> ::std::os::raw::c_int;
2097}
2098extern "C" {
2099    #[doc = " Gets the filepath to the currently set logfile.\n @param handle the context handle\n @return the path to the logfile"]
2100    pub fn alpm_option_get_logfile(handle: *mut alpm_handle_t) -> *const ::std::os::raw::c_char;
2101}
2102extern "C" {
2103    #[doc = " Sets the logfile path.\n @param handle the context handle\n @param logfile path to the new location of the logfile\n @return 0 on success, -1 on error (pm_errno is set accordingly)"]
2104    pub fn alpm_option_set_logfile(
2105        handle: *mut alpm_handle_t,
2106        logfile: *const ::std::os::raw::c_char,
2107    ) -> ::std::os::raw::c_int;
2108}
2109extern "C" {
2110    #[doc = " Returns the path to libalpm's GnuPG home directory.\n @param handle the context handle\n @return the path to libalpms's GnuPG home directory"]
2111    pub fn alpm_option_get_gpgdir(handle: *mut alpm_handle_t) -> *const ::std::os::raw::c_char;
2112}
2113extern "C" {
2114    #[doc = " Sets the path to libalpm's GnuPG home directory.\n @param handle the context handle\n @param gpgdir the gpgdir to set"]
2115    pub fn alpm_option_set_gpgdir(
2116        handle: *mut alpm_handle_t,
2117        gpgdir: *const ::std::os::raw::c_char,
2118    ) -> ::std::os::raw::c_int;
2119}
2120extern "C" {
2121    #[doc = " Returns the user to switch to for sensitive operations.\n @return the user name"]
2122    pub fn alpm_option_get_sandboxuser(handle: *mut alpm_handle_t)
2123        -> *const ::std::os::raw::c_char;
2124}
2125extern "C" {
2126    #[doc = " Sets the user to switch to for sensitive operations.\n @param handle the context handle\n @param sandboxuser the user to set"]
2127    pub fn alpm_option_set_sandboxuser(
2128        handle: *mut alpm_handle_t,
2129        sandboxuser: *const ::std::os::raw::c_char,
2130    ) -> ::std::os::raw::c_int;
2131}
2132extern "C" {
2133    #[doc = " Returns whether to use syslog (0 is FALSE, TRUE otherwise).\n @param handle the context handle\n @return 0 on success, -1 on error (pm_errno is set accordingly)"]
2134    pub fn alpm_option_get_usesyslog(handle: *mut alpm_handle_t) -> ::std::os::raw::c_int;
2135}
2136extern "C" {
2137    #[doc = " Sets whether to use syslog (0 is FALSE, TRUE otherwise).\n @param handle the context handle\n @param usesyslog whether to use the syslog (0 is FALSE, TRUE otherwise)"]
2138    pub fn alpm_option_set_usesyslog(
2139        handle: *mut alpm_handle_t,
2140        usesyslog: ::std::os::raw::c_int,
2141    ) -> ::std::os::raw::c_int;
2142}
2143extern "C" {
2144    #[doc = " Get the list of no-upgrade files\n @param handle the context handle\n @return the char* list of no-upgrade files"]
2145    pub fn alpm_option_get_noupgrades(handle: *mut alpm_handle_t) -> *mut alpm_list_t;
2146}
2147extern "C" {
2148    #[doc = " Add a file to the no-upgrade list\n @param handle the context handle\n @param path the path to add\n @return 0 on success, -1 on error (pm_errno is set accordingly)"]
2149    pub fn alpm_option_add_noupgrade(
2150        handle: *mut alpm_handle_t,
2151        path: *const ::std::os::raw::c_char,
2152    ) -> ::std::os::raw::c_int;
2153}
2154extern "C" {
2155    #[doc = " Sets the list of no-upgrade files\n @param handle the context handle\n @param noupgrade a char* list of file to not upgrade.\n The list will be duped and the original will still need to be freed by the caller.\n @return 0 on success, -1 on error (pm_errno is set accordingly)"]
2156    pub fn alpm_option_set_noupgrades(
2157        handle: *mut alpm_handle_t,
2158        noupgrade: *mut alpm_list_t,
2159    ) -> ::std::os::raw::c_int;
2160}
2161extern "C" {
2162    #[doc = " Remove an entry from the no-upgrade list\n @param handle the context handle\n @param path the path to remove\n @return 0 on success, -1 on error (pm_errno is set accordingly)"]
2163    pub fn alpm_option_remove_noupgrade(
2164        handle: *mut alpm_handle_t,
2165        path: *const ::std::os::raw::c_char,
2166    ) -> ::std::os::raw::c_int;
2167}
2168extern "C" {
2169    #[doc = " Test if a path matches any of the globs in the no-upgrade list\n @param handle the context handle\n @param path the path to test\n @return 0 is the path matches a glob, negative if there is no match and\n positive is the  match was inverted"]
2170    pub fn alpm_option_match_noupgrade(
2171        handle: *mut alpm_handle_t,
2172        path: *const ::std::os::raw::c_char,
2173    ) -> ::std::os::raw::c_int;
2174}
2175extern "C" {
2176    #[doc = " Get the list of no-extract files\n @param handle the context handle\n @return the char* list of no-extract files"]
2177    pub fn alpm_option_get_noextracts(handle: *mut alpm_handle_t) -> *mut alpm_list_t;
2178}
2179extern "C" {
2180    #[doc = " Add a file to the no-extract list\n @param handle the context handle\n @param path the path to add\n @return 0 on success, -1 on error (pm_errno is set accordingly)"]
2181    pub fn alpm_option_add_noextract(
2182        handle: *mut alpm_handle_t,
2183        path: *const ::std::os::raw::c_char,
2184    ) -> ::std::os::raw::c_int;
2185}
2186extern "C" {
2187    #[doc = " Sets the list of no-extract files\n @param handle the context handle\n @param noextract a char* list of file to not extract.\n The list will be duped and the original will still need to be freed by the caller.\n @return 0 on success, -1 on error (pm_errno is set accordingly)"]
2188    pub fn alpm_option_set_noextracts(
2189        handle: *mut alpm_handle_t,
2190        noextract: *mut alpm_list_t,
2191    ) -> ::std::os::raw::c_int;
2192}
2193extern "C" {
2194    #[doc = " Remove an entry from the no-extract list\n @param handle the context handle\n @param path the path to remove\n @return 0 on success, -1 on error (pm_errno is set accordingly)"]
2195    pub fn alpm_option_remove_noextract(
2196        handle: *mut alpm_handle_t,
2197        path: *const ::std::os::raw::c_char,
2198    ) -> ::std::os::raw::c_int;
2199}
2200extern "C" {
2201    #[doc = " Test if a path matches any of the globs in the no-extract list\n @param handle the context handle\n @param path the path to test\n @return 0 is the path matches a glob, negative if there is no match and\n positive is the  match was inverted"]
2202    pub fn alpm_option_match_noextract(
2203        handle: *mut alpm_handle_t,
2204        path: *const ::std::os::raw::c_char,
2205    ) -> ::std::os::raw::c_int;
2206}
2207extern "C" {
2208    #[doc = " Get the list of ignored packages\n @param handle the context handle\n @return the char* list of ignored packages"]
2209    pub fn alpm_option_get_ignorepkgs(handle: *mut alpm_handle_t) -> *mut alpm_list_t;
2210}
2211extern "C" {
2212    #[doc = " Add a file to the ignored package list\n @param handle the context handle\n @param pkg the package to add\n @return 0 on success, -1 on error (pm_errno is set accordingly)"]
2213    pub fn alpm_option_add_ignorepkg(
2214        handle: *mut alpm_handle_t,
2215        pkg: *const ::std::os::raw::c_char,
2216    ) -> ::std::os::raw::c_int;
2217}
2218extern "C" {
2219    #[doc = " Sets the list of packages to ignore\n @param handle the context handle\n @param ignorepkgs a char* list of packages to ignore\n The list will be duped and the original will still need to be freed by the caller.\n @return 0 on success, -1 on error (pm_errno is set accordingly)"]
2220    pub fn alpm_option_set_ignorepkgs(
2221        handle: *mut alpm_handle_t,
2222        ignorepkgs: *mut alpm_list_t,
2223    ) -> ::std::os::raw::c_int;
2224}
2225extern "C" {
2226    #[doc = " Remove an entry from the ignorepkg list\n @param handle the context handle\n @param pkg the package to remove\n @return 0 on success, -1 on error (pm_errno is set accordingly)"]
2227    pub fn alpm_option_remove_ignorepkg(
2228        handle: *mut alpm_handle_t,
2229        pkg: *const ::std::os::raw::c_char,
2230    ) -> ::std::os::raw::c_int;
2231}
2232extern "C" {
2233    #[doc = " Get the list of ignored groups\n @param handle the context handle\n @return the char* list of ignored groups"]
2234    pub fn alpm_option_get_ignoregroups(handle: *mut alpm_handle_t) -> *mut alpm_list_t;
2235}
2236extern "C" {
2237    #[doc = " Add a file to the ignored group list\n @param handle the context handle\n @param grp the group to add\n @return 0 on success, -1 on error (pm_errno is set accordingly)"]
2238    pub fn alpm_option_add_ignoregroup(
2239        handle: *mut alpm_handle_t,
2240        grp: *const ::std::os::raw::c_char,
2241    ) -> ::std::os::raw::c_int;
2242}
2243extern "C" {
2244    #[doc = " Sets the list of groups to ignore\n @param handle the context handle\n @param ignoregrps a char* list of groups to ignore\n The list will be duped and the original will still need to be freed by the caller.\n @return 0 on success, -1 on error (pm_errno is set accordingly)"]
2245    pub fn alpm_option_set_ignoregroups(
2246        handle: *mut alpm_handle_t,
2247        ignoregrps: *mut alpm_list_t,
2248    ) -> ::std::os::raw::c_int;
2249}
2250extern "C" {
2251    #[doc = " Remove an entry from the ignoregroup list\n @param handle the context handle\n @param grp the group to remove\n @return 0 on success, -1 on error (pm_errno is set accordingly)"]
2252    pub fn alpm_option_remove_ignoregroup(
2253        handle: *mut alpm_handle_t,
2254        grp: *const ::std::os::raw::c_char,
2255    ) -> ::std::os::raw::c_int;
2256}
2257extern "C" {
2258    #[doc = " Gets the list of dependencies that are assumed to be met\n @param handle the context handle\n @return a list of alpm_depend_t*"]
2259    pub fn alpm_option_get_assumeinstalled(handle: *mut alpm_handle_t) -> *mut alpm_list_t;
2260}
2261extern "C" {
2262    #[doc = " Add a depend to the assumed installed list\n @param handle the context handle\n @param dep the dependency to add\n @return 0 on success, -1 on error (pm_errno is set accordingly)"]
2263    pub fn alpm_option_add_assumeinstalled(
2264        handle: *mut alpm_handle_t,
2265        dep: *const alpm_depend_t,
2266    ) -> ::std::os::raw::c_int;
2267}
2268extern "C" {
2269    #[doc = " Sets the list of dependencies that are assumed to be met\n @param handle the context handle\n @param deps a list of *alpm_depend_t\n The list will be duped and the original will still need to be freed by the caller.\n @return 0 on success, -1 on error (pm_errno is set accordingly)"]
2270    pub fn alpm_option_set_assumeinstalled(
2271        handle: *mut alpm_handle_t,
2272        deps: *mut alpm_list_t,
2273    ) -> ::std::os::raw::c_int;
2274}
2275extern "C" {
2276    #[doc = " Remove an entry from the assume installed list\n @param handle the context handle\n @param dep the dep to remove\n @return 0 on success, -1 on error (pm_errno is set accordingly)"]
2277    pub fn alpm_option_remove_assumeinstalled(
2278        handle: *mut alpm_handle_t,
2279        dep: *const alpm_depend_t,
2280    ) -> ::std::os::raw::c_int;
2281}
2282extern "C" {
2283    #[doc = " Returns the allowed package architecture.\n @param handle the context handle\n @return the configured package architectures"]
2284    pub fn alpm_option_get_architectures(handle: *mut alpm_handle_t) -> *mut alpm_list_t;
2285}
2286extern "C" {
2287    #[doc = " Adds an allowed package architecture.\n @param handle the context handle\n @param arch the architecture to set"]
2288    pub fn alpm_option_add_architecture(
2289        handle: *mut alpm_handle_t,
2290        arch: *const ::std::os::raw::c_char,
2291    ) -> ::std::os::raw::c_int;
2292}
2293extern "C" {
2294    #[doc = " Sets the allowed package architecture.\n @param handle the context handle\n @param arches the architecture to set"]
2295    pub fn alpm_option_set_architectures(
2296        handle: *mut alpm_handle_t,
2297        arches: *mut alpm_list_t,
2298    ) -> ::std::os::raw::c_int;
2299}
2300extern "C" {
2301    #[doc = " Removes an allowed package architecture.\n @param handle the context handle\n @param arch the architecture to remove"]
2302    pub fn alpm_option_remove_architecture(
2303        handle: *mut alpm_handle_t,
2304        arch: *const ::std::os::raw::c_char,
2305    ) -> ::std::os::raw::c_int;
2306}
2307extern "C" {
2308    #[doc = " Get whether or not checking for free space before installing packages is enabled.\n @param handle the context handle\n @return 0 if disabled, 1 if enabled"]
2309    pub fn alpm_option_get_checkspace(handle: *mut alpm_handle_t) -> ::std::os::raw::c_int;
2310}
2311extern "C" {
2312    #[doc = " Enable/disable checking free space before installing packages.\n @param handle the context handle\n @param checkspace 0 for disabled, 1 for enabled"]
2313    pub fn alpm_option_set_checkspace(
2314        handle: *mut alpm_handle_t,
2315        checkspace: ::std::os::raw::c_int,
2316    ) -> ::std::os::raw::c_int;
2317}
2318extern "C" {
2319    #[doc = " Gets the configured database extension.\n @param handle the context handle\n @return the configured database extension"]
2320    pub fn alpm_option_get_dbext(handle: *mut alpm_handle_t) -> *const ::std::os::raw::c_char;
2321}
2322extern "C" {
2323    #[doc = " Sets the database extension.\n @param handle the context handle\n @param dbext the database extension to use\n @return 0 on success, -1 on error (pm_errno is set accordingly)"]
2324    pub fn alpm_option_set_dbext(
2325        handle: *mut alpm_handle_t,
2326        dbext: *const ::std::os::raw::c_char,
2327    ) -> ::std::os::raw::c_int;
2328}
2329extern "C" {
2330    #[doc = " Get the default siglevel.\n @param handle the context handle\n @return a \\link alpm_siglevel_t \\endlink bitfield of the siglevel"]
2331    pub fn alpm_option_get_default_siglevel(handle: *mut alpm_handle_t) -> ::std::os::raw::c_int;
2332}
2333extern "C" {
2334    #[doc = " Set the default siglevel.\n @param handle the context handle\n @param level a \\link alpm_siglevel_t \\endlink bitfield of the level to set\n @return 0 on success, -1 on error (pm_errno is set accordingly)"]
2335    pub fn alpm_option_set_default_siglevel(
2336        handle: *mut alpm_handle_t,
2337        level: ::std::os::raw::c_int,
2338    ) -> ::std::os::raw::c_int;
2339}
2340extern "C" {
2341    #[doc = " Get the configured local file siglevel.\n @param handle the context handle\n @return a \\link alpm_siglevel_t \\endlink bitfield of the siglevel"]
2342    pub fn alpm_option_get_local_file_siglevel(handle: *mut alpm_handle_t)
2343        -> ::std::os::raw::c_int;
2344}
2345extern "C" {
2346    #[doc = " Set the local file siglevel.\n @param handle the context handle\n @param level a \\link alpm_siglevel_t \\endlink bitfield of the level to set\n @return 0 on success, -1 on error (pm_errno is set accordingly)"]
2347    pub fn alpm_option_set_local_file_siglevel(
2348        handle: *mut alpm_handle_t,
2349        level: ::std::os::raw::c_int,
2350    ) -> ::std::os::raw::c_int;
2351}
2352extern "C" {
2353    #[doc = " Get the configured remote file siglevel.\n @param handle the context handle\n @return a \\link alpm_siglevel_t \\endlink bitfield of the siglevel"]
2354    pub fn alpm_option_get_remote_file_siglevel(
2355        handle: *mut alpm_handle_t,
2356    ) -> ::std::os::raw::c_int;
2357}
2358extern "C" {
2359    #[doc = " Set the remote file siglevel.\n @param handle the context handle\n @param level a \\link alpm_siglevel_t \\endlink bitfield of the level to set\n @return 0 on success, -1 on error (pm_errno is set accordingly)"]
2360    pub fn alpm_option_set_remote_file_siglevel(
2361        handle: *mut alpm_handle_t,
2362        level: ::std::os::raw::c_int,
2363    ) -> ::std::os::raw::c_int;
2364}
2365extern "C" {
2366    #[doc = " Enables/disables the download timeout.\n @param handle the context handle\n @param disable_dl_timeout 0 for enabled, 1 for disabled\n @return 0 on success, -1 on error (pm_errno is set accordingly)"]
2367    pub fn alpm_option_set_disable_dl_timeout(
2368        handle: *mut alpm_handle_t,
2369        disable_dl_timeout: ::std::os::raw::c_ushort,
2370    ) -> ::std::os::raw::c_int;
2371}
2372extern "C" {
2373    #[doc = " Gets the number of parallel streams to download database and package files.\n @param handle the context handle\n @return the number of parallel streams to download database and package files"]
2374    pub fn alpm_option_get_parallel_downloads(handle: *mut alpm_handle_t) -> ::std::os::raw::c_int;
2375}
2376extern "C" {
2377    #[doc = " Sets number of parallel streams to download database and package files.\n @param handle the context handle\n @param num_streams number of parallel download streams\n @return 0 on success, -1 on error"]
2378    pub fn alpm_option_set_parallel_downloads(
2379        handle: *mut alpm_handle_t,
2380        num_streams: ::std::os::raw::c_uint,
2381    ) -> ::std::os::raw::c_int;
2382}
2383extern "C" {
2384    #[doc = " Enables/disables the sandbox.\n @param handle the context handle\n @param disable_sandbox 0 for enabled, 1 for disabled\n @return 0 on success, -1 on error (pm_errno is set accordingly)"]
2385    pub fn alpm_option_set_disable_sandbox(
2386        handle: *mut alpm_handle_t,
2387        disable_sandbox: ::std::os::raw::c_ushort,
2388    ) -> ::std::os::raw::c_int;
2389}
2390#[repr(u32)]
2391#[doc = " Package install reasons."]
2392#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
2393pub enum _alpm_pkgreason_t {
2394    #[doc = " Explicitly requested by the user."]
2395    ALPM_PKG_REASON_EXPLICIT = 0,
2396    #[doc = " Installed as a dependency for another package."]
2397    ALPM_PKG_REASON_DEPEND = 1,
2398    #[doc = " Failed parsing of local database"]
2399    ALPM_PKG_REASON_UNKNOWN = 2,
2400}
2401#[doc = " Package install reasons."]
2402pub use self::_alpm_pkgreason_t as alpm_pkgreason_t;
2403#[repr(u32)]
2404#[doc = " Location a package object was loaded from."]
2405#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
2406pub enum _alpm_pkgfrom_t {
2407    #[doc = " Loaded from a file via \\link alpm_pkg_load \\endlink"]
2408    ALPM_PKG_FROM_FILE = 1,
2409    #[doc = " From the local database"]
2410    ALPM_PKG_FROM_LOCALDB = 2,
2411    #[doc = " From a sync database"]
2412    ALPM_PKG_FROM_SYNCDB = 3,
2413}
2414#[doc = " Location a package object was loaded from."]
2415pub use self::_alpm_pkgfrom_t as alpm_pkgfrom_t;
2416pub mod _alpm_pkgvalidation_t {
2417    #[doc = " Method used to validate a package."]
2418    pub type Type = ::std::os::raw::c_uint;
2419    #[doc = " The package's validation type is unknown"]
2420    pub const ALPM_PKG_VALIDATION_UNKNOWN: Type = 0;
2421    #[doc = " The package does not have any validation"]
2422    pub const ALPM_PKG_VALIDATION_NONE: Type = 1;
2423    #[doc = " The package is validated with md5"]
2424    pub const ALPM_PKG_VALIDATION_MD5SUM: Type = 2;
2425    #[doc = " The package is validated with sha256"]
2426    pub const ALPM_PKG_VALIDATION_SHA256SUM: Type = 4;
2427    #[doc = " The package is validated with a PGP signature"]
2428    pub const ALPM_PKG_VALIDATION_SIGNATURE: Type = 8;
2429}
2430#[doc = " Method used to validate a package."]
2431pub use self::_alpm_pkgvalidation_t::Type as alpm_pkgvalidation_t;
2432extern "C" {
2433    #[doc = " Create a package from a file.\n If full is false, the archive is read only until all necessary\n metadata is found. If it is true, the entire archive is read, which\n serves as a verification of integrity and the filelist can be created.\n The allocated structure should be freed using alpm_pkg_free().\n @param handle the context handle\n @param filename location of the package tarball\n @param full whether to stop the load after metadata is read or continue\n through the full archive\n @param level what level of package signature checking to perform on the\n package; note that this must be a '.sig' file type verification\n @param pkg address of the package pointer\n @return 0 on success, -1 on error (pm_errno is set accordingly)"]
2434    pub fn alpm_pkg_load(
2435        handle: *mut alpm_handle_t,
2436        filename: *const ::std::os::raw::c_char,
2437        full: ::std::os::raw::c_int,
2438        level: ::std::os::raw::c_int,
2439        pkg: *mut *mut alpm_pkg_t,
2440    ) -> ::std::os::raw::c_int;
2441}
2442extern "C" {
2443    #[doc = " Fetch a list of remote packages.\n @param handle the context handle\n @param urls list of package URLs to download\n @param fetched list of filepaths to the fetched packages, each item\n    corresponds to one in `urls` list. This is an output parameter,\n    the caller should provide a pointer to an empty list\n    (*fetched === NULL) and the callee fills the list with data.\n @return 0 on success or -1 on failure"]
2444    pub fn alpm_fetch_pkgurl(
2445        handle: *mut alpm_handle_t,
2446        urls: *const alpm_list_t,
2447        fetched: *mut *mut alpm_list_t,
2448    ) -> ::std::os::raw::c_int;
2449}
2450extern "C" {
2451    #[doc = " Find a package in a list by name.\n @param haystack a list of alpm_pkg_t\n @param needle the package name\n @return a pointer to the package if found or NULL"]
2452    pub fn alpm_pkg_find(
2453        haystack: *mut alpm_list_t,
2454        needle: *const ::std::os::raw::c_char,
2455    ) -> *mut alpm_pkg_t;
2456}
2457extern "C" {
2458    #[doc = " Free a package.\n Only packages loaded with \\link alpm_pkg_load \\endlink can be freed.\n Packages from databases will be freed by libalpm when they are unregistered.\n @param pkg package pointer to free\n @return 0 on success, -1 on error (pm_errno is set accordingly)"]
2459    pub fn alpm_pkg_free(pkg: *mut alpm_pkg_t) -> ::std::os::raw::c_int;
2460}
2461extern "C" {
2462    #[doc = " Check the integrity (with md5) of a package from the sync cache.\n @param pkg package pointer\n @return 0 on success, -1 on error (pm_errno is set accordingly)"]
2463    pub fn alpm_pkg_checkmd5sum(pkg: *mut alpm_pkg_t) -> ::std::os::raw::c_int;
2464}
2465extern "C" {
2466    #[doc = " Compare two version strings and determine which one is 'newer'.\n Returns a value comparable to the way strcmp works. Returns 1\n if a is newer than b, 0 if a and b are the same version, or -1\n if b is newer than a.\n\n Different epoch values for version strings will override any further\n comparison. If no epoch is provided, 0 is assumed.\n\n Keep in mind that the pkgrel is only compared if it is available\n on both versions handed to this function. For example, comparing\n 1.5-1 and 1.5 will yield 0; comparing 1.5-1 and 1.5-2 will yield\n -1 as expected. This is mainly for supporting versioned dependencies\n that do not include the pkgrel."]
2467    pub fn alpm_pkg_vercmp(
2468        a: *const ::std::os::raw::c_char,
2469        b: *const ::std::os::raw::c_char,
2470    ) -> ::std::os::raw::c_int;
2471}
2472extern "C" {
2473    #[doc = " Computes the list of packages requiring a given package.\n The return value of this function is a newly allocated\n list of package names (char*), it should be freed by the caller.\n @param pkg a package\n @return the list of packages requiring pkg"]
2474    pub fn alpm_pkg_compute_requiredby(pkg: *mut alpm_pkg_t) -> *mut alpm_list_t;
2475}
2476extern "C" {
2477    #[doc = " Computes the list of packages optionally requiring a given package.\n The return value of this function is a newly allocated\n list of package names (char*), it should be freed by the caller.\n @param pkg a package\n @return the list of packages optionally requiring pkg"]
2478    pub fn alpm_pkg_compute_optionalfor(pkg: *mut alpm_pkg_t) -> *mut alpm_list_t;
2479}
2480extern "C" {
2481    #[doc = " Test if a package should be ignored.\n Checks if the package is ignored via IgnorePkg, or if the package is\n in a group ignored via IgnoreGroup.\n @param handle the context handle\n @param pkg the package to test\n @return 1 if the package should be ignored, 0 otherwise"]
2482    pub fn alpm_pkg_should_ignore(
2483        handle: *mut alpm_handle_t,
2484        pkg: *mut alpm_pkg_t,
2485    ) -> ::std::os::raw::c_int;
2486}
2487extern "C" {
2488    #[doc = " Gets the handle of a package\n @param pkg a pointer to package\n @return the alpm handle that the package belongs to"]
2489    pub fn alpm_pkg_get_handle(pkg: *mut alpm_pkg_t) -> *mut alpm_handle_t;
2490}
2491extern "C" {
2492    #[doc = " Gets the name of the file from which the package was loaded.\n @param pkg a pointer to package\n @return a reference to an internal string"]
2493    pub fn alpm_pkg_get_filename(pkg: *mut alpm_pkg_t) -> *const ::std::os::raw::c_char;
2494}
2495extern "C" {
2496    #[doc = " Returns the package base name.\n @param pkg a pointer to package\n @return a reference to an internal string"]
2497    pub fn alpm_pkg_get_base(pkg: *mut alpm_pkg_t) -> *const ::std::os::raw::c_char;
2498}
2499extern "C" {
2500    #[doc = " Returns the package name.\n @param pkg a pointer to package\n @return a reference to an internal string"]
2501    pub fn alpm_pkg_get_name(pkg: *mut alpm_pkg_t) -> *const ::std::os::raw::c_char;
2502}
2503extern "C" {
2504    #[doc = " Returns the package version as a string.\n This includes all available epoch, version, and pkgrel components. Use\n alpm_pkg_vercmp() to compare version strings if necessary.\n @param pkg a pointer to package\n @return a reference to an internal string"]
2505    pub fn alpm_pkg_get_version(pkg: *mut alpm_pkg_t) -> *const ::std::os::raw::c_char;
2506}
2507extern "C" {
2508    #[doc = " Returns the origin of the package.\n @return an alpm_pkgfrom_t constant, -1 on error"]
2509    pub fn alpm_pkg_get_origin(pkg: *mut alpm_pkg_t) -> alpm_pkgfrom_t;
2510}
2511extern "C" {
2512    #[doc = " Returns the package description.\n @param pkg a pointer to package\n @return a reference to an internal string"]
2513    pub fn alpm_pkg_get_desc(pkg: *mut alpm_pkg_t) -> *const ::std::os::raw::c_char;
2514}
2515extern "C" {
2516    #[doc = " Returns the package URL.\n @param pkg a pointer to package\n @return a reference to an internal string"]
2517    pub fn alpm_pkg_get_url(pkg: *mut alpm_pkg_t) -> *const ::std::os::raw::c_char;
2518}
2519extern "C" {
2520    #[doc = " Returns the build timestamp of the package.\n @param pkg a pointer to package\n @return the timestamp of the build time"]
2521    pub fn alpm_pkg_get_builddate(pkg: *mut alpm_pkg_t) -> alpm_time_t;
2522}
2523extern "C" {
2524    #[doc = " Returns the install timestamp of the package.\n @param pkg a pointer to package\n @return the timestamp of the install time"]
2525    pub fn alpm_pkg_get_installdate(pkg: *mut alpm_pkg_t) -> alpm_time_t;
2526}
2527extern "C" {
2528    #[doc = " Returns the packager's name.\n @param pkg a pointer to package\n @return a reference to an internal string"]
2529    pub fn alpm_pkg_get_packager(pkg: *mut alpm_pkg_t) -> *const ::std::os::raw::c_char;
2530}
2531extern "C" {
2532    #[doc = " Returns the package's MD5 checksum as a string.\n The returned string is a sequence of 32 lowercase hexadecimal digits.\n @param pkg a pointer to package\n @return a reference to an internal string"]
2533    pub fn alpm_pkg_get_md5sum(pkg: *mut alpm_pkg_t) -> *const ::std::os::raw::c_char;
2534}
2535extern "C" {
2536    #[doc = " Returns the package's SHA256 checksum as a string.\n The returned string is a sequence of 64 lowercase hexadecimal digits.\n @param pkg a pointer to package\n @return a reference to an internal string"]
2537    pub fn alpm_pkg_get_sha256sum(pkg: *mut alpm_pkg_t) -> *const ::std::os::raw::c_char;
2538}
2539extern "C" {
2540    #[doc = " Returns the architecture for which the package was built.\n @param pkg a pointer to package\n @return a reference to an internal string"]
2541    pub fn alpm_pkg_get_arch(pkg: *mut alpm_pkg_t) -> *const ::std::os::raw::c_char;
2542}
2543extern "C" {
2544    #[doc = " Returns the size of the package. This is only available for sync database\n packages and package files, not those loaded from the local database.\n @param pkg a pointer to package\n @return the size of the package in bytes."]
2545    pub fn alpm_pkg_get_size(pkg: *mut alpm_pkg_t) -> off_t;
2546}
2547extern "C" {
2548    #[doc = " Returns the installed size of the package.\n @param pkg a pointer to package\n @return the total size of files installed by the package."]
2549    pub fn alpm_pkg_get_isize(pkg: *mut alpm_pkg_t) -> off_t;
2550}
2551extern "C" {
2552    #[doc = " Returns the package installation reason.\n @param pkg a pointer to package\n @return an enum member giving the install reason."]
2553    pub fn alpm_pkg_get_reason(pkg: *mut alpm_pkg_t) -> alpm_pkgreason_t;
2554}
2555extern "C" {
2556    #[doc = " Returns the list of package licenses.\n @param pkg a pointer to package\n @return a pointer to an internal list of strings."]
2557    pub fn alpm_pkg_get_licenses(pkg: *mut alpm_pkg_t) -> *mut alpm_list_t;
2558}
2559extern "C" {
2560    #[doc = " Returns the list of package groups.\n @param pkg a pointer to package\n @return a pointer to an internal list of strings."]
2561    pub fn alpm_pkg_get_groups(pkg: *mut alpm_pkg_t) -> *mut alpm_list_t;
2562}
2563extern "C" {
2564    #[doc = " Returns the list of package dependencies as alpm_depend_t.\n @param pkg a pointer to package\n @return a reference to an internal list of alpm_depend_t structures."]
2565    pub fn alpm_pkg_get_depends(pkg: *mut alpm_pkg_t) -> *mut alpm_list_t;
2566}
2567extern "C" {
2568    #[doc = " Returns the list of package optional dependencies.\n @param pkg a pointer to package\n @return a reference to an internal list of alpm_depend_t structures."]
2569    pub fn alpm_pkg_get_optdepends(pkg: *mut alpm_pkg_t) -> *mut alpm_list_t;
2570}
2571extern "C" {
2572    #[doc = " Returns a list of package check dependencies\n @param pkg a pointer to package\n @return a reference to an internal list of alpm_depend_t structures."]
2573    pub fn alpm_pkg_get_checkdepends(pkg: *mut alpm_pkg_t) -> *mut alpm_list_t;
2574}
2575extern "C" {
2576    #[doc = " Returns a list of package make dependencies\n @param pkg a pointer to package\n @return a reference to an internal list of alpm_depend_t structures."]
2577    pub fn alpm_pkg_get_makedepends(pkg: *mut alpm_pkg_t) -> *mut alpm_list_t;
2578}
2579extern "C" {
2580    #[doc = " Returns the list of packages conflicting with pkg.\n @param pkg a pointer to package\n @return a reference to an internal list of alpm_depend_t structures."]
2581    pub fn alpm_pkg_get_conflicts(pkg: *mut alpm_pkg_t) -> *mut alpm_list_t;
2582}
2583extern "C" {
2584    #[doc = " Returns the list of packages provided by pkg.\n @param pkg a pointer to package\n @return a reference to an internal list of alpm_depend_t structures."]
2585    pub fn alpm_pkg_get_provides(pkg: *mut alpm_pkg_t) -> *mut alpm_list_t;
2586}
2587extern "C" {
2588    #[doc = " Returns the list of packages to be replaced by pkg.\n @param pkg a pointer to package\n @return a reference to an internal list of alpm_depend_t structures."]
2589    pub fn alpm_pkg_get_replaces(pkg: *mut alpm_pkg_t) -> *mut alpm_list_t;
2590}
2591extern "C" {
2592    #[doc = " Returns the list of files installed by pkg.\n The filenames are relative to the install root,\n and do not include leading slashes.\n @param pkg a pointer to package\n @return a pointer to a filelist object containing a count and an array of\n package file objects"]
2593    pub fn alpm_pkg_get_files(pkg: *mut alpm_pkg_t) -> *mut alpm_filelist_t;
2594}
2595extern "C" {
2596    #[doc = " Returns the list of files backed up when installing pkg.\n @param pkg a pointer to package\n @return a reference to a list of alpm_backup_t objects"]
2597    pub fn alpm_pkg_get_backup(pkg: *mut alpm_pkg_t) -> *mut alpm_list_t;
2598}
2599extern "C" {
2600    #[doc = " Returns the database containing pkg.\n Returns a pointer to the alpm_db_t structure the package is\n originating from, or NULL if the package was loaded from a file.\n @param pkg a pointer to package\n @return a pointer to the DB containing pkg, or NULL."]
2601    pub fn alpm_pkg_get_db(pkg: *mut alpm_pkg_t) -> *mut alpm_db_t;
2602}
2603extern "C" {
2604    #[doc = " Returns the base64 encoded package signature.\n @param pkg a pointer to package\n @return a reference to an internal string"]
2605    pub fn alpm_pkg_get_base64_sig(pkg: *mut alpm_pkg_t) -> *const ::std::os::raw::c_char;
2606}
2607extern "C" {
2608    #[doc = " Extracts package signature either from embedded package signature\n or if it is absent then reads data from detached signature file.\n @param pkg a pointer to package.\n @param sig output parameter for signature data. Callee function allocates\n a buffer needed for the signature data. Caller is responsible for\n freeing this buffer.\n @param sig_len output parameter for the signature data length.\n @return 0 on success, negative number on error."]
2609    pub fn alpm_pkg_get_sig(
2610        pkg: *mut alpm_pkg_t,
2611        sig: *mut *mut ::std::os::raw::c_uchar,
2612        sig_len: *mut usize,
2613    ) -> ::std::os::raw::c_int;
2614}
2615extern "C" {
2616    #[doc = " Returns the method used to validate a package during install.\n @param pkg a pointer to package\n @return an enum member giving the validation method"]
2617    pub fn alpm_pkg_get_validation(pkg: *mut alpm_pkg_t) -> ::std::os::raw::c_int;
2618}
2619extern "C" {
2620    #[doc = " Gets the extended data field of a package.\n @param pkg a pointer to package\n @return a reference to a list of alpm_pkg_xdata_t objects"]
2621    pub fn alpm_pkg_get_xdata(pkg: *mut alpm_pkg_t) -> *mut alpm_list_t;
2622}
2623extern "C" {
2624    #[doc = " Returns whether the package has an install scriptlet.\n @return 0 if FALSE, TRUE otherwise"]
2625    pub fn alpm_pkg_has_scriptlet(pkg: *mut alpm_pkg_t) -> ::std::os::raw::c_int;
2626}
2627extern "C" {
2628    #[doc = " Returns the size of the files that will be downloaded to install a\n package.\n @param newpkg the new package to upgrade to\n @return the size of the download"]
2629    pub fn alpm_pkg_download_size(newpkg: *mut alpm_pkg_t) -> off_t;
2630}
2631extern "C" {
2632    #[doc = " Set install reason for a package in the local database.\n The provided package object must be from the local database or this method\n will fail. The write to the local database is performed immediately.\n @param pkg the package to update\n @param reason the new install reason\n @return 0 on success, -1 on error (pm_errno is set accordingly)"]
2633    pub fn alpm_pkg_set_reason(
2634        pkg: *mut alpm_pkg_t,
2635        reason: alpm_pkgreason_t,
2636    ) -> ::std::os::raw::c_int;
2637}
2638extern "C" {
2639    #[doc = " Open a package changelog for reading.\n Similar to fopen in functionality, except that the returned 'file\n stream' could really be from an archive as well as from the database.\n @param pkg the package to read the changelog of (either file or db)\n @return a 'file stream' to the package changelog"]
2640    pub fn alpm_pkg_changelog_open(pkg: *mut alpm_pkg_t) -> *mut ::std::os::raw::c_void;
2641}
2642extern "C" {
2643    #[doc = " Read data from an open changelog 'file stream'.\n Similar to fread in functionality, this function takes a buffer and\n amount of data to read. If an error occurs pm_errno will be set.\n @param ptr a buffer to fill with raw changelog data\n @param size the size of the buffer\n @param pkg the package that the changelog is being read from\n @param fp a 'file stream' to the package changelog\n @return the number of characters read, or 0 if there is no more data or an\n error occurred."]
2644    pub fn alpm_pkg_changelog_read(
2645        ptr: *mut ::std::os::raw::c_void,
2646        size: usize,
2647        pkg: *const alpm_pkg_t,
2648        fp: *mut ::std::os::raw::c_void,
2649    ) -> usize;
2650}
2651extern "C" {
2652    #[doc = " Close a package changelog for reading.\n @param pkg the package to close the changelog of (either file or db)\n @param fp the 'file stream' to the package changelog to close\n @return 0 on success, -1 on error"]
2653    pub fn alpm_pkg_changelog_close(
2654        pkg: *const alpm_pkg_t,
2655        fp: *mut ::std::os::raw::c_void,
2656    ) -> ::std::os::raw::c_int;
2657}
2658extern "C" {
2659    #[doc = " Open a package mtree file for reading.\n @param pkg the local package to read the mtree of\n @return an archive structure for the package mtree file"]
2660    pub fn alpm_pkg_mtree_open(pkg: *mut alpm_pkg_t) -> *mut archive;
2661}
2662extern "C" {
2663    #[doc = " Read next entry from a package mtree file.\n @param pkg the package that the mtree file is being read from\n @param archive the archive structure reading from the mtree file\n @param entry an archive_entry to store the entry header information\n @return 0 on success, 1 if end of archive is reached, -1 otherwise."]
2664    pub fn alpm_pkg_mtree_next(
2665        pkg: *const alpm_pkg_t,
2666        archive: *mut archive,
2667        entry: *mut *mut archive_entry,
2668    ) -> ::std::os::raw::c_int;
2669}
2670extern "C" {
2671    #[doc = " Close a package mtree file.\n @param pkg the local package to close the mtree of\n @param archive the archive to close"]
2672    pub fn alpm_pkg_mtree_close(
2673        pkg: *const alpm_pkg_t,
2674        archive: *mut archive,
2675    ) -> ::std::os::raw::c_int;
2676}
2677pub mod _alpm_transflag_t {
2678    #[doc = " Transaction flags"]
2679    pub type Type = ::std::os::raw::c_uint;
2680    #[doc = " Ignore dependency checks."]
2681    pub const ALPM_TRANS_FLAG_NODEPS: Type = 1;
2682    #[doc = " Delete files even if they are tagged as backup."]
2683    pub const ALPM_TRANS_FLAG_NOSAVE: Type = 4;
2684    #[doc = " Ignore version numbers when checking dependencies."]
2685    pub const ALPM_TRANS_FLAG_NODEPVERSION: Type = 8;
2686    #[doc = " Remove also any packages depending on a package being removed."]
2687    pub const ALPM_TRANS_FLAG_CASCADE: Type = 16;
2688    #[doc = " Remove packages and their unneeded deps (not explicitly installed)."]
2689    pub const ALPM_TRANS_FLAG_RECURSE: Type = 32;
2690    #[doc = " Modify database but do not commit changes to the filesystem."]
2691    pub const ALPM_TRANS_FLAG_DBONLY: Type = 64;
2692    #[doc = " Do not run hooks during a transaction"]
2693    pub const ALPM_TRANS_FLAG_NOHOOKS: Type = 128;
2694    #[doc = " Use ALPM_PKG_REASON_DEPEND when installing packages."]
2695    pub const ALPM_TRANS_FLAG_ALLDEPS: Type = 256;
2696    #[doc = " Only download packages and do not actually install."]
2697    pub const ALPM_TRANS_FLAG_DOWNLOADONLY: Type = 512;
2698    #[doc = " Do not execute install scriptlets after installing."]
2699    pub const ALPM_TRANS_FLAG_NOSCRIPTLET: Type = 1024;
2700    #[doc = " Ignore dependency conflicts."]
2701    pub const ALPM_TRANS_FLAG_NOCONFLICTS: Type = 2048;
2702    #[doc = " Do not install a package if it is already installed and up to date."]
2703    pub const ALPM_TRANS_FLAG_NEEDED: Type = 8192;
2704    #[doc = " Use ALPM_PKG_REASON_EXPLICIT when installing packages."]
2705    pub const ALPM_TRANS_FLAG_ALLEXPLICIT: Type = 16384;
2706    #[doc = " Do not remove a package if it is needed by another one."]
2707    pub const ALPM_TRANS_FLAG_UNNEEDED: Type = 32768;
2708    #[doc = " Remove also explicitly installed unneeded deps (use with ALPM_TRANS_FLAG_RECURSE)."]
2709    pub const ALPM_TRANS_FLAG_RECURSEALL: Type = 65536;
2710    #[doc = " Do not lock the database during the operation."]
2711    pub const ALPM_TRANS_FLAG_NOLOCK: Type = 131072;
2712}
2713#[doc = " Transaction flags"]
2714pub use self::_alpm_transflag_t::Type as alpm_transflag_t;
2715extern "C" {
2716    #[doc = " Returns the bitfield of flags for the current transaction.\n @param handle the context handle\n @return the bitfield of transaction flags"]
2717    pub fn alpm_trans_get_flags(handle: *mut alpm_handle_t) -> ::std::os::raw::c_int;
2718}
2719extern "C" {
2720    #[doc = " Returns a list of packages added by the transaction.\n @param handle the context handle\n @return a list of alpm_pkg_t structures"]
2721    pub fn alpm_trans_get_add(handle: *mut alpm_handle_t) -> *mut alpm_list_t;
2722}
2723extern "C" {
2724    #[doc = " Returns the list of packages removed by the transaction.\n @param handle the context handle\n @return a list of alpm_pkg_t structures"]
2725    pub fn alpm_trans_get_remove(handle: *mut alpm_handle_t) -> *mut alpm_list_t;
2726}
2727extern "C" {
2728    #[doc = " Initialize the transaction.\n @param handle the context handle\n @param flags flags of the transaction (like nodeps, etc; see alpm_transflag_t)\n @return 0 on success, -1 on error (pm_errno is set accordingly)"]
2729    pub fn alpm_trans_init(
2730        handle: *mut alpm_handle_t,
2731        flags: ::std::os::raw::c_int,
2732    ) -> ::std::os::raw::c_int;
2733}
2734extern "C" {
2735    #[doc = " Prepare a transaction.\n @param handle the context handle\n @param data the address of an alpm_list where a list\n of alpm_depmissing_t objects is dumped (conflicting packages)\n @return 0 on success, -1 on error (pm_errno is set accordingly)"]
2736    pub fn alpm_trans_prepare(
2737        handle: *mut alpm_handle_t,
2738        data: *mut *mut alpm_list_t,
2739    ) -> ::std::os::raw::c_int;
2740}
2741extern "C" {
2742    #[doc = " Commit a transaction.\n @param handle the context handle\n @param data the address of an alpm_list where detailed description\n of an error can be dumped (i.e. list of conflicting files)\n @return 0 on success, -1 on error (pm_errno is set accordingly)"]
2743    pub fn alpm_trans_commit(
2744        handle: *mut alpm_handle_t,
2745        data: *mut *mut alpm_list_t,
2746    ) -> ::std::os::raw::c_int;
2747}
2748extern "C" {
2749    #[doc = " Interrupt a transaction.\n @param handle the context handle\n @return 0 on success, -1 on error (pm_errno is set accordingly)"]
2750    pub fn alpm_trans_interrupt(handle: *mut alpm_handle_t) -> ::std::os::raw::c_int;
2751}
2752extern "C" {
2753    #[doc = " Release a transaction.\n @param handle the context handle\n @return 0 on success, -1 on error (pm_errno is set accordingly)"]
2754    pub fn alpm_trans_release(handle: *mut alpm_handle_t) -> ::std::os::raw::c_int;
2755}
2756extern "C" {
2757    #[doc = " Search for packages to upgrade and add them to the transaction.\n @param handle the context handle\n @param enable_downgrade allow downgrading of packages if the remote version is lower\n @return 0 on success, -1 on error (pm_errno is set accordingly)"]
2758    pub fn alpm_sync_sysupgrade(
2759        handle: *mut alpm_handle_t,
2760        enable_downgrade: ::std::os::raw::c_int,
2761    ) -> ::std::os::raw::c_int;
2762}
2763extern "C" {
2764    #[doc = " Add a package to the transaction.\n If the package was loaded by alpm_pkg_load(), it will be freed upon\n \\link alpm_trans_release \\endlink invocation.\n @param handle the context handle\n @param pkg the package to add\n @return 0 on success, -1 on error (pm_errno is set accordingly)"]
2765    pub fn alpm_add_pkg(handle: *mut alpm_handle_t, pkg: *mut alpm_pkg_t) -> ::std::os::raw::c_int;
2766}
2767extern "C" {
2768    #[doc = " Add a package removal to the transaction.\n @param handle the context handle\n @param pkg the package to uninstall\n @return 0 on success, -1 on error (pm_errno is set accordingly)"]
2769    pub fn alpm_remove_pkg(
2770        handle: *mut alpm_handle_t,
2771        pkg: *mut alpm_pkg_t,
2772    ) -> ::std::os::raw::c_int;
2773}
2774extern "C" {
2775    #[doc = " Check for new version of pkg in syncdbs.\n\n If the same package appears multiple dbs only the first will be checked\n\n This only checks the syncdb for a newer version. It does not access the network at all.\n See \\link alpm_db_update \\endlink to update a database."]
2776    pub fn alpm_sync_get_new_version(
2777        pkg: *mut alpm_pkg_t,
2778        dbs_sync: *mut alpm_list_t,
2779    ) -> *mut alpm_pkg_t;
2780}
2781extern "C" {
2782    #[doc = " Get the md5 sum of file.\n @param filename name of the file\n @return the checksum on success, NULL on error"]
2783    pub fn alpm_compute_md5sum(
2784        filename: *const ::std::os::raw::c_char,
2785    ) -> *mut ::std::os::raw::c_char;
2786}
2787extern "C" {
2788    #[doc = " Get the sha256 sum of file.\n @param filename name of the file\n @return the checksum on success, NULL on error"]
2789    pub fn alpm_compute_sha256sum(
2790        filename: *const ::std::os::raw::c_char,
2791    ) -> *mut ::std::os::raw::c_char;
2792}
2793extern "C" {
2794    #[doc = " Remove the database lock file\n @param handle the context handle\n @return 0 on success, -1 on error\n\n @note Safe to call from inside signal handlers."]
2795    pub fn alpm_unlock(handle: *mut alpm_handle_t) -> ::std::os::raw::c_int;
2796}
2797pub mod alpm_caps {
2798    #[doc = " Enum of possible compile time features"]
2799    pub type Type = ::std::os::raw::c_uint;
2800    #[doc = " localization"]
2801    pub const ALPM_CAPABILITY_NLS: Type = 1;
2802    #[doc = " Ability to download"]
2803    pub const ALPM_CAPABILITY_DOWNLOADER: Type = 2;
2804    #[doc = " Signature checking"]
2805    pub const ALPM_CAPABILITY_SIGNATURES: Type = 4;
2806}
2807extern "C" {
2808    #[doc = " Get the version of library.\n @return the library version, e.g. \"6.0.4\""]
2809    pub fn alpm_version() -> *const ::std::os::raw::c_char;
2810}
2811extern "C" {
2812    #[doc = " Get the capabilities of the library.\n @return a bitmask of the capabilities"]
2813    pub fn alpm_capabilities() -> ::std::os::raw::c_int;
2814}
2815extern "C" {
2816    #[doc = " Drop privileges by switching to a different user.\n @param handle the context handle\n @param sandboxuser the user to switch to\n @param sandbox_path if non-NULL, restrict writes to this filesystem path\n @return 0 on success, -1 on failure"]
2817    pub fn alpm_sandbox_setup_child(
2818        handle: *mut alpm_handle_t,
2819        sandboxuser: *const ::std::os::raw::c_char,
2820        sandbox_path: *const ::std::os::raw::c_char,
2821    ) -> ::std::os::raw::c_int;
2822}
2823pub type __builtin_va_list = [__va_list_tag; 1usize];
2824#[repr(C)]
2825#[derive(Debug, Copy, Clone)]
2826pub struct __va_list_tag {
2827    pub gp_offset: ::std::os::raw::c_uint,
2828    pub fp_offset: ::std::os::raw::c_uint,
2829    pub overflow_arg_area: *mut ::std::os::raw::c_void,
2830    pub reg_save_area: *mut ::std::os::raw::c_void,
2831}
2832#[allow(clippy::unnecessary_operation, clippy::identity_op)]
2833const _: () = {
2834    ["Size of __va_list_tag"][::std::mem::size_of::<__va_list_tag>() - 24usize];
2835    ["Alignment of __va_list_tag"][::std::mem::align_of::<__va_list_tag>() - 8usize];
2836    ["Offset of field: __va_list_tag::gp_offset"]
2837        [::std::mem::offset_of!(__va_list_tag, gp_offset) - 0usize];
2838    ["Offset of field: __va_list_tag::fp_offset"]
2839        [::std::mem::offset_of!(__va_list_tag, fp_offset) - 4usize];
2840    ["Offset of field: __va_list_tag::overflow_arg_area"]
2841        [::std::mem::offset_of!(__va_list_tag, overflow_arg_area) - 8usize];
2842    ["Offset of field: __va_list_tag::reg_save_area"]
2843        [::std::mem::offset_of!(__va_list_tag, reg_save_area) - 16usize];
2844};