![]() |
XBPS Library API 20250705
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 | |
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 |
struct xbps_handle* xhp |
Pointer to our struct xbps_handle passed to xbps_init().
const char* arg |
int err |
xbps_state_t state |
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 |
struct xbps_handle* xhp |
Pointer to our struct xbps_handle passed to xbps_init().
off_t file_offset |
off_t file_dloaded |
bool cb_start |
bool 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 |
struct xbps_handle* xhp |
Pointer to our struct xbps_handle passed to xbps_init().
const char* pkgver |
ssize_t entry_extract_count |
ssize_t entry_total_count |
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] |
char | rootdir [XBPS_MAXPATH] |
char | cachedir [XBPS_MAXPATH] |
char | metadir [XBPS_MAXPATH] |
char | native_arch [64] |
int | flags |
xbps_array_t repositories |
Proplib array of strings with repositories, overriding the list in the configuration file.
Definition at line 573 of file xbps.h.
Referenced by xbps_init(), xbps_repo_remove(), xbps_repo_store(), and xbps_rpool_foreach().
xbps_dictionary_t pkgdb |
Proplib dictionary with the master package database stored in XBPS_META_PATH/XBPS_PKGDB.
Definition at line 590 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_update(), xbps_set_pkg_state_installed(), and xbps_transaction_update_packages().
xbps_dictionary_t transd |
Proplib dictionary with transaction objects, required by xbps_transaction_commit().
Definition at line 597 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 *) |
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 *) |
Pointer to the supplied function callback to be used in xbps_fetch_file().
void* fetch_cb_data |
char* pkgdb_plist |
Absolute pathname to the pkgdb plist file.
Definition at line 639 of file xbps.h.
Referenced by xbps_pkgdb_update().
const char* target_arch |
Target architecture, as set by XBPS_TARGET_ARCH from environment.
Definition at line 645 of file xbps.h.
Referenced by xbps_init(), xbps_pkg_arch_match(), xbps_pkg_exec_buffer(), xbps_repo_open(), and xbps_transaction_commit().
char confdir[XBPS_MAXPATH] |
Full path to the xbps configuration directory.
Definition at line 651 of file xbps.h.
Referenced by xbps_init().
char rootdir[XBPS_MAXPATH] |
Root directory for all operations in XBPS. If unset, defaults to '/'.
Definition at line 664 of file xbps.h.
Referenced by xbps_init(), xbps_pkg_exec_buffer(), xbps_pkgdb_lock(), xbps_symlink_target(), and xbps_transaction_commit().
char cachedir[XBPS_MAXPATH] |
Cache directory to store downloaded binary packages. If unset, defaults to XBPS_CACHE_PATH (relative to rootdir).
Definition at line 671 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().
char metadir[XBPS_MAXPATH] |
Metadata directory for all operations in XBPS. If unset, defaults to XBPS_CACHE_PATH (relative to rootdir).
Definition at line 678 of file xbps.h.
Referenced by xbps_init(), xbps_pkgdb_get_pkg_files(), xbps_pkgdb_lock(), xbps_repo_key_import(), and xbps_verify_signature().
char native_arch[64] |
Machine architecture, defaults to uname(2) machine if XBPS_ARCH is not set from environment.
Definition at line 685 of file xbps.h.
Referenced by xbps_init(), xbps_pkg_arch_match(), xbps_pkg_exec_buffer(), xbps_repo_open(), and xbps_transaction_commit().
int flags |
Flags to be set globally by ORing them, possible value:
- XBPS_FLAG_* (see above)
Definition at line 693 of file xbps.h.
Referenced by xbps_configure_pkg(), xbps_init(), xbps_repo_open(), 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:
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_dbg_printf(), xbps_debug_level, 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. |