XBPS Library API 20240111
The X Binary Package System
|
Data Structures | |
struct | xbps_state_cb_data |
Structure to be passed as argument to the state function callback. All members are read-only and set internally by libxbps. More... | |
struct | xbps_fetch_cb_data |
Structure to be passed to the fetch function callback. More... | |
struct | xbps_unpack_cb_data |
Structure to be passed to the unpack function callback. More... | |
struct | xbps_handle |
Generic XBPS structure handler for initialization. More... | |
Enumerations | |
enum | xbps_state_t |
Functions | |
void void void void int | xbps_init (struct xbps_handle *xhp) |
void | xbps_end (struct xbps_handle *xhp) |
Use these functions to initialize some parameters before start using libxbps and finalize usage to release resources at the end.
struct xbps_state_cb_data |
Data Fields | |
struct xbps_handle * | xhp |
const char * | desc |
const char * | arg |
int | err |
xbps_state_t | state |
xhp |
Pointer to our struct xbps_handle passed to xbps_init().
arg |
struct xbps_fetch_cb_data |
This structure is passed as argument to the fetch progress function callback and its members will be updated when there's any progress. All members marked as read-only in this struct are set internally by xbps_unpack_binary_pkg() and shouldn't be modified in the passed function callback.
Data Fields | |
struct xbps_handle * | xhp |
off_t | file_size |
off_t | file_offset |
off_t | file_dloaded |
const char * | file_name |
bool | cb_start |
bool | cb_update |
bool | cb_end |
xhp |
Pointer to our struct xbps_handle passed to xbps_init().
cb_start |
cb_update |
struct xbps_unpack_cb_data |
This structure is passed as argument to the unpack progress function callback and its members will be updated when there's any progress. All members in this struct are set internally by libxbps and should be used in read-only mode in the supplied function callback.
Data Fields | |
struct xbps_handle * | xhp |
const char * | pkgver |
const char * | entry |
int64_t | entry_size |
ssize_t | entry_extract_count |
ssize_t | entry_total_count |
bool | entry_is_conf |
xhp |
Pointer to our struct xbps_handle passed to xbps_init().
pkgver |
struct xbps_handle |
This structure sets some global properties for libxbps, to set some function callbacks and data to the fetch, transaction and unpack functions, the root and cache directory, flags, etc.
Data Fields | |
xbps_array_t | repositories |
xbps_dictionary_t | pkgdb |
xbps_dictionary_t | transd |
int(* | state_cb )(const struct xbps_state_cb_data *, void *) |
void * | state_cb_data |
void(* | unpack_cb )(const struct xbps_unpack_cb_data *, void *) |
void * | unpack_cb_data |
void(* | fetch_cb )(const struct xbps_fetch_cb_data *, void *) |
void * | fetch_cb_data |
char * | pkgdb_plist |
const char * | target_arch |
char | confdir [XBPS_MAXPATH+sizeof(XBPS_SYSCONF_PATH)] |
char | rootdir [XBPS_MAXPATH] |
char | cachedir [XBPS_MAXPATH+sizeof(XBPS_CACHE_PATH)] |
char | metadir [XBPS_MAXPATH+sizeof(XBPS_META_PATH)] |
char | native_arch [64] |
int | flags |
repositories |
Proplib array of strings with repositories, overriding the list in the configuration file.
Definition at line 563 of file xbps.h.
Referenced by xbps_init(), xbps_repo_remove(), xbps_repo_store(), and xbps_rpool_foreach().
pkgdb |
Proplib dictionary with the master package database stored in XBPS_META_PATH/XBPS_PKGDB.
Definition at line 576 of file xbps.h.
Referenced by xbps_alternatives_register(), xbps_alternatives_set(), xbps_alternatives_unregister(), xbps_configure_packages(), xbps_find_pkg_orphans(), xbps_pkgdb_foreach_cb(), xbps_pkgdb_foreach_cb_multi(), xbps_pkgdb_get_pkg(), xbps_pkgdb_get_virtualpkg(), xbps_pkgdb_lock(), xbps_pkgdb_update(), xbps_set_pkg_state_installed(), and xbps_transaction_update_packages().
transd |
Proplib dictionary with transaction objects, required by xbps_transaction_commit().
Definition at line 583 of file xbps.h.
Referenced by xbps_transaction_autoremove_pkgs(), xbps_transaction_commit(), xbps_transaction_prepare(), and xbps_transaction_remove_pkg().
int(* state_cb) (const struct xbps_state_cb_data *, void *) |
state_cb_data |
void(* unpack_cb) (const struct xbps_unpack_cb_data *, void *) |
unpack_cb_data |
void(* fetch_cb) (const struct xbps_fetch_cb_data *, void *) |
Pointer to the supplied function callback to be used in xbps_fetch_file().
fetch_cb_data |
pkgdb_plist |
Absolute pathname to the pkgdb plist file.
Definition at line 625 of file xbps.h.
Referenced by xbps_pkgdb_lock(), and xbps_pkgdb_update().
target_arch |
Target architecture, as set by XBPS_TARGET_ARCH from environment.
Definition at line 631 of file xbps.h.
Referenced by xbps_init(), xbps_pkg_arch_match(), xbps_pkg_exec_buffer(), xbps_repo_path_with_name(), and xbps_transaction_commit().
confdir |
Full path to the xbps configuration directory.
Definition at line 637 of file xbps.h.
Referenced by xbps_init().
rootdir |
Root directory for all operations in XBPS. If unset, defaults to '/'.
Definition at line 650 of file xbps.h.
Referenced by xbps_init(), xbps_pkg_exec_buffer(), xbps_pkgdb_lock(), xbps_symlink_target(), and xbps_transaction_commit().
cachedir |
Cache directory to store downloaded binary packages. If unset, defaults to XBPS_CACHE_PATH (relative to rootdir).
Definition at line 657 of file xbps.h.
Referenced by xbps_binpkg_exists(), xbps_init(), xbps_pkg_path(), xbps_remote_binpkg_exists(), xbps_repository_pkg_path(), and xbps_transaction_commit().
metadir |
Metadata directory for all operations in XBPS. If unset, defaults to XBPS_CACHE_PATH (relative to rootdir).
Definition at line 664 of file xbps.h.
Referenced by xbps_init(), xbps_pkgdb_get_pkg_files(), xbps_pkgdb_lock(), xbps_repo_key_import(), and xbps_verify_signature().
native_arch |
Machine architecture, defaults to uname(2) machine if XBPS_ARCH is not set from environment.
Definition at line 671 of file xbps.h.
Referenced by xbps_init(), xbps_pkg_arch_match(), xbps_pkg_exec_buffer(), xbps_repo_path_with_name(), and xbps_transaction_commit().
flags |
Flags to be set globally by ORing them, possible value:
- XBPS_FLAG_* (see above)
Definition at line 679 of file xbps.h.
Referenced by xbps_configure_pkg(), xbps_init(), xbps_rpool_get_pkg(), xbps_transaction_commit(), xbps_transaction_install_pkg(), xbps_transaction_prepare(), and xbps_transaction_update_pkg().
enum xbps_state_t |
Integer representing the xbps callback returned state. Possible values:
void void void void int xbps_init | ( | struct xbps_handle * | xhp | ) |
Initialize the XBPS library with the following steps:
[in] | xhp | Pointer to an xbps_handle struct. |
Definition at line 46 of file initend.c.
References xbps_handle::cachedir, xbps_handle::confdir, xbps_handle::flags, xbps_handle::metadir, xbps_handle::native_arch, xbps_handle::repositories, xbps_handle::rootdir, xbps_handle::target_arch, xbps_path_clean(), xbps_path_join(), xbps_path_prepend(), and xbps_strlcpy().
void xbps_end | ( | struct xbps_handle * | xhp | ) |
Releases all resources used by libxbps.
[in] | xhp | Pointer to an xbps_handle struct. |