XBPS Library API  0.19
The X Binary Package System
Data Structures | Enumerations | Functions
Initialization and finalization functions

Data Structures

struct  xbps_fetch_cb_data
 Structure to be passed to the fetch function callback. More...
 
struct  xbps_handle
 Generic XBPS structure handler for initialization. More...
 
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_unpack_cb_data
 Structure to be passed to the unpack function callback. More...
 

Enumerations

enum  xbps_state_t
 

Functions

void xbps_end (struct xbps_handle *xhp)
 
int xbps_init (struct xbps_handle *xhp)
 

Detailed Description

Use these functions to initialize some parameters before start using libxbps and finalize usage to release resources at the end.

Enumeration Type Documentation

Integer representing the xbps callback returned state. Possible values:

  • XBPS_STATE_UKKNOWN: state hasn't been prepared or unknown error.
  • XBPS_STATE_TRANS_DOWNLOAD: transaction is downloading binary packages.
  • XBPS_STATE_TRANS_VERIFY: transaction is verifying binary package integrity.
  • XBPS_STATE_TRANS_RUN: transaction is performing operations: install, update, remove and replace.
  • XBPS_STATE_TRANS_CONFIGURE: transaction is configuring all unpacked packages.
  • XBPS_STATE_DOWNLOAD: a binary package is being downloaded.
  • XBPS_STATE_VERIFY: a binary package is being verified.
  • XBPS_STATE_REMOVE: a package is being removed.
  • XBPS_STATE_REMOVE_DONE: a package has been removed successfully.
  • XBPS_STATE_REMOVE_FILE: a package file is being removed.
  • XBPS_STATE_REMOVE_OBSOLETE: an obsolete package file is being removed.
  • XBPS_STATE_REPLACE: a package is being replaced.
  • XBPS_STATE_INSTALL: a package is being installed.
  • XBPS_STATE_INSTALL_DONE: a package has been installed successfully.
  • XBPS_STATE_UPDATE: a package is being updated.
  • XBPS_STATE_UPDATE_DONE: a package has been updated successfully.
  • XBPS_STATE_UNPACK: a package is being unpacked.
  • XBPS_STATE_CONFIGURE: a package is being configured.
  • XBPS_STATE_CONFIG_FILE: a package configuration file is being processed.
  • XBPS_STATE_REGISTER: a package is being registered.
  • XBPS_STATE_UNREGISTER: a package is being unregistered.
  • XBPS_STATE_REPOSYNC: a remote repository's package index is being synchronized.
  • XBPS_STATE_VERIFY_FAIL: binary package integrity has failed.
  • XBPS_STATE_DOWNLOAD_FAIL: binary package download has failed.
  • XBPS_STATE_REMOVE_FAIL: a package removal has failed.
  • XBPS_STATE_REMOVE_FILE_FAIL: a package file removal has failed.
  • XBPS_STATE_REMOVE_FILE_HASH_FAIL: a package file removal due to its hash has failed.
  • XBPS_STATE_REMOVE_FILE_OBSOLETE_FAIL: an obsolete package file removal has failed.
  • XBPS_STATE_CONFIGURE_FAIL: package configure has failed.
  • XBPS_STATE_CONFIG_FILE_FAIL: package configuration file operation has failed.
  • XBPS_STATE_UPDATE_FAIL: package update has failed.
  • XBPS_STATE_UNPACK_FAIL: package unpack has failed.
  • XBPS_STATE_REGISTER_FAIL: package register has failed.
  • XBPS_STATE_UNREGISTER_FAIL: package unregister has failed.
  • XBPS_STATE_REPOSYNC_FAIL: syncing remote repositories has failed.

Definition at line 269 of file xbps_api.h.

Function Documentation

void xbps_end ( struct xbps_handle xhp)

Releases all resources used by libxbps.

Parameters
[in]xhpPointer to an xbps_handle struct.

Definition at line 282 of file initend.c.

int xbps_init ( struct xbps_handle xhp)

Initialize the XBPS library with the following steps:

  • Set function callbacks for fetching and unpacking.
  • Set default cache connections for libfetch.
  • Parse configuration file.
Parameters
[in]xhpPointer to an xbps_handle struct.
Note
It's assumed that xhp is a valid pointer.
Returns
0 on success, an errno value otherwise.

Definition at line 136 of file initend.c.

References xbps_handle::cachedir, xbps_handle::conffile, xbps_handle::fetch_timeout, xbps_handle::flags, xbps_handle::metadir, xbps_handle::rootdir, and xbps_xasprintf().

+ Here is the call graph for this function: