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