libalpm
Arch Linux Package Manager Library
Functions
Interface Functions

Functions to initialize and release libalpm. More...

Functions

alpm_handle_talpm_initialize (const char *root, const char *dbpath, alpm_errno_t *err)
 Initializes the library.
int alpm_release (alpm_handle_t *myhandle)
 Release the library.

Detailed Description

Functions to initialize and release libalpm.


Function Documentation

alpm_handle_t* alpm_initialize ( const char *  root,
const char *  dbpath,
alpm_errno_t err 
)

Initializes the library.

This must be called before any other functions are called.

Parameters:
rootthe root path for all filesystem operations
dbpaththe absolute path to the libalpm database
erran optional variable to hold any error return codes
Returns:
a context handle on success, NULL on error, err will be set if provided

Definition at line 47 of file alpm.c.

References _alpm_db_register_local(), _alpm_handle_free(), _alpm_handle_new(), _alpm_set_directory_option(), ALPM_ERR_MEMORY, __alpm_handle_t::dbpath, __alpm_handle_t::lockfile, __alpm_handle_t::pm_errno, and __alpm_handle_t::root.

Referenced by main().

Here is the call graph for this function:

Here is the caller graph for this function:

int alpm_release ( alpm_handle_t myhandle)

Release the library.

This should be the last alpm call you make. After this returns, handle should be considered invalid and cannot be reused in any way.

Parameters:
myhandlethe context handle
Returns:
0 on success, -1 on error

Definition at line 95 of file alpm.c.

References _alpm_handle_free(), _alpm_handle_unlock(), alpm_db_unregister_all(), CHECK_HANDLE, __alpm_handle_t::db_local, __alpm_db_t::ops, and db_operations::unregister.

Referenced by main().

Here is the call graph for this function:

Here is the caller graph for this function: