libalpm
Arch Linux Package Manager Library
Functions
handle.c File Reference
#include <errno.h>
#include <stdlib.h>
#include <string.h>
#include <limits.h>
#include <sys/types.h>
#include <syslog.h>
#include <sys/stat.h>
#include <fcntl.h>
#include "handle.h"
#include "alpm_list.h"
#include "util.h"
#include "log.h"
#include "delta.h"
#include "trans.h"
#include "alpm.h"
Include dependency graph for handle.c:

Go to the source code of this file.

Functions

alpm_handle_t_alpm_handle_new (void)
void _alpm_handle_free (alpm_handle_t *handle)
int _alpm_handle_lock (alpm_handle_t *handle)
 Lock the database.
int _alpm_handle_unlock (alpm_handle_t *handle)
 Remove a lock file.
alpm_cb_log alpm_option_get_logcb (alpm_handle_t *handle)
 Returns the callback used for logging.
alpm_cb_download alpm_option_get_dlcb (alpm_handle_t *handle)
 Returns the callback used to report download progress.
alpm_cb_fetch alpm_option_get_fetchcb (alpm_handle_t *handle)
 Returns the downloading callback.
alpm_cb_totaldl alpm_option_get_totaldlcb (alpm_handle_t *handle)
 Returns the callback used to report total download size.
alpm_cb_event alpm_option_get_eventcb (alpm_handle_t *handle)
 Returns the callback used for events.
alpm_cb_question alpm_option_get_questioncb (alpm_handle_t *handle)
 Returns the callback used for questions.
alpm_cb_progress alpm_option_get_progresscb (alpm_handle_t *handle)
 Returns the callback used for operation progress.
const char * alpm_option_get_root (alpm_handle_t *handle)
 Returns the root of the destination filesystem.
const char * alpm_option_get_dbpath (alpm_handle_t *handle)
 Returns the path to the database directory.
alpm_list_talpm_option_get_cachedirs (alpm_handle_t *handle)
const char * alpm_option_get_logfile (alpm_handle_t *handle)
 Returns the logfile name.
const char * alpm_option_get_lockfile (alpm_handle_t *handle)
 Get the name of the database lock file.
const char * alpm_option_get_gpgdir (alpm_handle_t *handle)
 Returns the path to libalpm's GnuPG home directory.
int alpm_option_get_usesyslog (alpm_handle_t *handle)
 Returns whether to use syslog (0 is FALSE, TRUE otherwise).
alpm_list_talpm_option_get_noupgrades (alpm_handle_t *handle)
alpm_list_talpm_option_get_noextracts (alpm_handle_t *handle)
alpm_list_talpm_option_get_ignorepkgs (alpm_handle_t *handle)
alpm_list_talpm_option_get_ignoregroups (alpm_handle_t *handle)
const char * alpm_option_get_arch (alpm_handle_t *handle)
 Returns the targeted architecture.
int alpm_option_get_usedelta (alpm_handle_t *handle)
int alpm_option_get_checkspace (alpm_handle_t *handle)
alpm_db_talpm_option_get_localdb (alpm_handle_t *handle)
 Get the database of locally installed packages.
alpm_list_talpm_option_get_syncdbs (alpm_handle_t *handle)
 Get the list of sync databases.
int alpm_option_set_logcb (alpm_handle_t *handle, alpm_cb_log cb)
 Sets the callback used for logging.
int alpm_option_set_dlcb (alpm_handle_t *handle, alpm_cb_download cb)
 Sets the callback used to report download progress.
int alpm_option_set_fetchcb (alpm_handle_t *handle, alpm_cb_fetch cb)
 Sets the downloading callback.
int alpm_option_set_totaldlcb (alpm_handle_t *handle, alpm_cb_totaldl cb)
 Sets the callback used to report total download size.
int alpm_option_set_eventcb (alpm_handle_t *handle, alpm_cb_event cb)
 Sets the callback used for events.
int alpm_option_set_questioncb (alpm_handle_t *handle, alpm_cb_question cb)
 Sets the callback used for questions.
int alpm_option_set_progresscb (alpm_handle_t *handle, alpm_cb_progress cb)
 Sets the callback used for operation progress.
alpm_errno_t _alpm_set_directory_option (const char *value, char **storage, int must_exist)
int alpm_option_add_cachedir (alpm_handle_t *handle, const char *cachedir)
int alpm_option_set_cachedirs (alpm_handle_t *handle, alpm_list_t *cachedirs)
int alpm_option_remove_cachedir (alpm_handle_t *handle, const char *cachedir)
int alpm_option_set_logfile (alpm_handle_t *handle, const char *logfile)
 Sets the logfile name.
int alpm_option_set_gpgdir (alpm_handle_t *handle, const char *gpgdir)
 Sets the path to libalpm's GnuPG home directory.
int alpm_option_set_usesyslog (alpm_handle_t *handle, int usesyslog)
 Sets whether to use syslog (0 is FALSE, TRUE otherwise).
int alpm_option_add_noupgrade (alpm_handle_t *handle, const char *pkg)
int alpm_option_set_noupgrades (alpm_handle_t *handle, alpm_list_t *noupgrade)
int alpm_option_remove_noupgrade (alpm_handle_t *handle, const char *pkg)
int alpm_option_add_noextract (alpm_handle_t *handle, const char *pkg)
int alpm_option_set_noextracts (alpm_handle_t *handle, alpm_list_t *noextract)
int alpm_option_remove_noextract (alpm_handle_t *handle, const char *pkg)
int alpm_option_add_ignorepkg (alpm_handle_t *handle, const char *pkg)
int alpm_option_set_ignorepkgs (alpm_handle_t *handle, alpm_list_t *ignorepkgs)
int alpm_option_remove_ignorepkg (alpm_handle_t *handle, const char *pkg)
int alpm_option_add_ignoregroup (alpm_handle_t *handle, const char *grp)
int alpm_option_set_ignoregroups (alpm_handle_t *handle, alpm_list_t *ignoregrps)
int alpm_option_remove_ignoregroup (alpm_handle_t *handle, const char *grp)
int alpm_option_set_arch (alpm_handle_t *handle, const char *arch)
 Sets the targeted architecture.
int alpm_option_set_usedelta (alpm_handle_t *handle, int usedelta)
int alpm_option_set_checkspace (alpm_handle_t *handle, int checkspace)
int alpm_option_set_default_siglevel (alpm_handle_t *handle, alpm_siglevel_t level)
alpm_siglevel_t alpm_option_get_default_siglevel (alpm_handle_t *handle)

Function Documentation

void _alpm_handle_free ( alpm_handle_t handle)
int _alpm_handle_lock ( alpm_handle_t handle)

Lock the database.

Definition at line 91 of file handle.c.

References _alpm_makepath(), ASSERT, FREE, __alpm_handle_t::lckstream, and __alpm_handle_t::lockfile.

Referenced by alpm_db_update(), and alpm_trans_init().

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 41 of file handle.c.

References CALLOC, and handle.

Referenced by alpm_initialize().

Here is the caller graph for this function:

Remove a lock file.

Definition at line 126 of file handle.c.

References ASSERT, __alpm_handle_t::lckstream, and __alpm_handle_t::lockfile.

Referenced by alpm_db_update(), alpm_release(), and alpm_trans_release().

Here is the caller graph for this function:

alpm_errno_t _alpm_set_directory_option ( const char *  value,
char **  storage,
int  must_exist 
)

Definition at line 343 of file handle.c.

References ALPM_ERR_MEMORY, ALPM_ERR_NOT_A_DIR, ALPM_ERR_WRONG_ARGS, CALLOC, and FREE.

Referenced by alpm_initialize().

Here is the caller graph for this function: