handle.c File Reference

#include "config.h"
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <limits.h>
#include <sys/types.h>
#include <syslog.h>
#include <time.h>
#include <sys/stat.h>
#include <errno.h>
#include "handle.h"
#include "alpm_list.h"
#include "util.h"
#include "log.h"
#include "error.h"
#include "trans.h"
#include "alpm.h"
#include "server.h"

Include dependency graph for handle.c:

Go to the source code of this file.

Functions

pmhandle_t_alpm_handle_new ()
void _alpm_handle_free (pmhandle_t *handle)
alpm_cb_log alpm_option_get_logcb ()
alpm_cb_download alpm_option_get_dlcb ()
const char * alpm_option_get_root ()
const char * alpm_option_get_dbpath ()
alpm_list_talpm_option_get_cachedirs ()
const char * alpm_option_get_logfile ()
const char * alpm_option_get_lockfile ()
unsigned short alpm_option_get_usesyslog ()
alpm_list_talpm_option_get_noupgrades ()
alpm_list_talpm_option_get_noextracts ()
alpm_list_talpm_option_get_ignorepkgs ()
alpm_list_talpm_option_get_holdpkgs ()
alpm_list_talpm_option_get_ignoregrps ()
const char * alpm_option_get_xfercommand ()
unsigned short alpm_option_get_nopassiveftp ()
pmdb_talpm_option_get_localdb ()
alpm_list_talpm_option_get_syncdbs ()
void alpm_option_set_logcb (alpm_cb_log cb)
void alpm_option_set_dlcb (alpm_cb_download cb)
int alpm_option_set_root (const char *root)
int alpm_option_set_dbpath (const char *dbpath)
int alpm_option_add_cachedir (const char *cachedir)
void alpm_option_set_cachedirs (alpm_list_t *cachedirs)
int alpm_option_remove_cachedir (const char *cachedir)
int alpm_option_set_logfile (const char *logfile)
void alpm_option_set_usesyslog (unsigned short usesyslog)
void alpm_option_add_noupgrade (const char *pkg)
void alpm_option_set_noupgrades (alpm_list_t *noupgrade)
int alpm_option_remove_noupgrade (const char *pkg)
void alpm_option_add_noextract (const char *pkg)
void alpm_option_set_noextracts (alpm_list_t *noextract)
int alpm_option_remove_noextract (const char *pkg)
void alpm_option_add_ignorepkg (const char *pkg)
void alpm_option_set_ignorepkgs (alpm_list_t *ignorepkgs)
int alpm_option_remove_ignorepkg (const char *pkg)
void alpm_option_add_holdpkg (const char *pkg)
void alpm_option_set_holdpkgs (alpm_list_t *holdpkgs)
int alpm_option_remove_holdpkg (const char *pkg)
void alpm_option_add_ignoregrp (const char *grp)
void alpm_option_set_ignoregrps (alpm_list_t *ignoregrps)
int alpm_option_remove_ignoregrp (const char *grp)
void alpm_option_set_xfercommand (const char *cmd)
void alpm_option_set_nopassiveftp (unsigned short nopasv)
void alpm_option_set_usedelta (unsigned short usedelta)

Variables

pmhandle_thandle = NULL


Function Documentation

void _alpm_handle_free ( pmhandle_t handle  ) 

Definition at line 70 of file handle.c.

References _alpm_trans_free(), ALPM_LOG_FUNC, _pmhandle_t::cachedirs, _pmhandle_t::dbpath, _pmhandle_t::dbs_sync, FREE, FREELIST, _pmhandle_t::holdpkg, _pmhandle_t::ignoregrp, _pmhandle_t::ignorepkg, _pmhandle_t::lockfile, _pmhandle_t::logfile, _pmhandle_t::logstream, _pmhandle_t::noextract, _pmhandle_t::noupgrade, _pmhandle_t::root, _pmhandle_t::trans, _pmhandle_t::usesyslog, and _pmhandle_t::xfercommand.

Referenced by alpm_release().

Here is the call graph for this function:

Here is the caller graph for this function:

pmhandle_t* _alpm_handle_new (  ) 

Definition at line 47 of file handle.c.

References ALPM_LOG_FUNC, _pmhandle_t::cachedirs, CALLOC, _pmhandle_t::dbpath, _pmhandle_t::lckfd, _pmhandle_t::lockfile, _pmhandle_t::logfile, _pmhandle_t::logstream, PM_ERR_MEMORY, RET_ERR, _pmhandle_t::root, _pmhandle_t::uid, and _pmhandle_t::usedelta.

Referenced by alpm_initialize().

Here is the caller graph for this function:

int alpm_option_add_cachedir ( const char *  cachedir  ) 

Definition at line 354 of file handle.c.

References _alpm_log(), alpm_list_add(), ALPM_LOG_FUNC, _pmhandle_t::cachedirs, PM_ERR_WRONG_ARGS, pm_errno, and PM_LOG_DEBUG.

Here is the call graph for this function:

void alpm_option_add_holdpkg ( const char *  pkg  ) 

Definition at line 509 of file handle.c.

References alpm_list_add(), and _pmhandle_t::holdpkg.

Here is the call graph for this function:

void alpm_option_add_ignoregrp ( const char *  grp  ) 

Definition at line 532 of file handle.c.

References alpm_list_add(), and _pmhandle_t::ignoregrp.

Here is the call graph for this function:

void alpm_option_add_ignorepkg ( const char *  pkg  ) 

Definition at line 486 of file handle.c.

References alpm_list_add(), and _pmhandle_t::ignorepkg.

Here is the call graph for this function:

void alpm_option_add_noextract ( const char *  pkg  ) 

Definition at line 463 of file handle.c.

References alpm_list_add(), and _pmhandle_t::noextract.

Here is the call graph for this function:

void alpm_option_add_noupgrade ( const char *  pkg  ) 

Definition at line 440 of file handle.c.

References alpm_list_add(), and _pmhandle_t::noupgrade.

Here is the call graph for this function:

alpm_list_t* alpm_option_get_cachedirs (  ) 

Definition at line 141 of file handle.c.

References _pmhandle_t::cachedirs, PM_ERR_HANDLE_NULL, and pm_errno.

Referenced by _alpm_filecache_find(), _alpm_filecache_setup(), and main().

Here is the caller graph for this function:

const char* alpm_option_get_dbpath (  ) 

Definition at line 132 of file handle.c.

References _pmhandle_t::dbpath, PM_ERR_HANDLE_NULL, and pm_errno.

Referenced by _alpm_db_register_local(), _alpm_db_register_sync(), alpm_db_update(), alpm_pkg_changelog_open(), and main().

Here is the caller graph for this function:

alpm_cb_download alpm_option_get_dlcb (  ) 

Definition at line 114 of file handle.c.

References _pmhandle_t::dlcb, PM_ERR_HANDLE_NULL, and pm_errno.

alpm_list_t* alpm_option_get_holdpkgs (  ) 

Definition at line 204 of file handle.c.

References _pmhandle_t::holdpkg, PM_ERR_HANDLE_NULL, and pm_errno.

alpm_list_t* alpm_option_get_ignoregrps (  ) 

Definition at line 213 of file handle.c.

References _pmhandle_t::ignoregrp, PM_ERR_HANDLE_NULL, and pm_errno.

alpm_list_t* alpm_option_get_ignorepkgs (  ) 

Definition at line 195 of file handle.c.

References _pmhandle_t::ignorepkg, PM_ERR_HANDLE_NULL, and pm_errno.

pmdb_t* alpm_option_get_localdb (  ) 

Definition at line 240 of file handle.c.

References _pmhandle_t::db_local, PM_ERR_HANDLE_NULL, and pm_errno.

Referenced by alpm_pkg_compute_requiredby(), and pacman_deptest().

Here is the caller graph for this function:

const char* alpm_option_get_lockfile (  ) 

Definition at line 159 of file handle.c.

References _pmhandle_t::lockfile, PM_ERR_HANDLE_NULL, and pm_errno.

Referenced by _alpm_lckmk(), _alpm_lckrm(), alpm_trans_release(), main(), pacman_add(), and pacman_remove().

Here is the caller graph for this function:

alpm_cb_log alpm_option_get_logcb (  ) 

Definition at line 105 of file handle.c.

References _pmhandle_t::logcb, PM_ERR_HANDLE_NULL, and pm_errno.

Referenced by _alpm_log().

Here is the caller graph for this function:

const char* alpm_option_get_logfile (  ) 

Definition at line 150 of file handle.c.

References _pmhandle_t::logfile, PM_ERR_HANDLE_NULL, and pm_errno.

Referenced by main().

Here is the caller graph for this function:

alpm_list_t* alpm_option_get_noextracts (  ) 

Definition at line 186 of file handle.c.

References _pmhandle_t::noextract, PM_ERR_HANDLE_NULL, and pm_errno.

unsigned short alpm_option_get_nopassiveftp (  ) 

Definition at line 231 of file handle.c.

References _pmhandle_t::nopassiveftp, PM_ERR_HANDLE_NULL, and pm_errno.

alpm_list_t* alpm_option_get_noupgrades (  ) 

Definition at line 177 of file handle.c.

References _pmhandle_t::noupgrade, PM_ERR_HANDLE_NULL, and pm_errno.

const char* alpm_option_get_root (  ) 

Definition at line 123 of file handle.c.

References PM_ERR_HANDLE_NULL, pm_errno, and _pmhandle_t::root.

Referenced by dump_pkg_backups(), dump_pkg_files(), and main().

Here is the caller graph for this function:

alpm_list_t* alpm_option_get_syncdbs (  ) 

Definition at line 249 of file handle.c.

References _pmhandle_t::dbs_sync, PM_ERR_HANDLE_NULL, and pm_errno.

Referenced by pacman_query(), and pacman_sync().

Here is the caller graph for this function:

unsigned short alpm_option_get_usesyslog (  ) 

Definition at line 168 of file handle.c.

References PM_ERR_HANDLE_NULL, pm_errno, and _pmhandle_t::usesyslog.

const char* alpm_option_get_xfercommand (  ) 

Definition at line 222 of file handle.c.

References PM_ERR_HANDLE_NULL, pm_errno, and _pmhandle_t::xfercommand.

int alpm_option_remove_cachedir ( const char *  cachedir  ) 

Definition at line 387 of file handle.c.

References _alpm_str_cmp(), alpm_list_remove(), _pmhandle_t::cachedirs, and FREE.

Here is the call graph for this function:

int alpm_option_remove_holdpkg ( const char *  pkg  ) 

Definition at line 520 of file handle.c.

References _alpm_str_cmp(), alpm_list_remove(), FREE, and _pmhandle_t::holdpkg.

Here is the call graph for this function:

int alpm_option_remove_ignoregrp ( const char *  grp  ) 

Definition at line 543 of file handle.c.

References _alpm_str_cmp(), alpm_list_remove(), FREE, and _pmhandle_t::ignoregrp.

Here is the call graph for this function:

int alpm_option_remove_ignorepkg ( const char *  pkg  ) 

Definition at line 497 of file handle.c.

References _alpm_str_cmp(), alpm_list_remove(), FREE, and _pmhandle_t::ignorepkg.

Here is the call graph for this function:

int alpm_option_remove_noextract ( const char *  pkg  ) 

Definition at line 474 of file handle.c.

References _alpm_str_cmp(), alpm_list_remove(), FREE, and _pmhandle_t::noextract.

Here is the call graph for this function:

int alpm_option_remove_noupgrade ( const char *  pkg  ) 

Definition at line 451 of file handle.c.

References _alpm_str_cmp(), alpm_list_remove(), FREE, and _pmhandle_t::noupgrade.

Here is the call graph for this function:

void alpm_option_set_cachedirs ( alpm_list_t cachedirs  ) 

Definition at line 381 of file handle.c.

References _pmhandle_t::cachedirs, and FREELIST.

Referenced by _alpm_filecache_setup().

Here is the caller graph for this function:

int alpm_option_set_dbpath ( const char *  dbpath  ) 

Definition at line 315 of file handle.c.

References _alpm_log(), ALPM_LOG_FUNC, _pmhandle_t::dbpath, FREE, _pmhandle_t::lockfile, PM_ERR_NOT_A_DIR, PM_ERR_WRONG_ARGS, pm_errno, and PM_LOG_DEBUG.

Referenced by main().

Here is the call graph for this function:

Here is the caller graph for this function:

void alpm_option_set_dlcb ( alpm_cb_download  cb  ) 

Definition at line 267 of file handle.c.

References _pmhandle_t::dlcb, PM_ERR_HANDLE_NULL, and pm_errno.

Referenced by main().

Here is the caller graph for this function:

void alpm_option_set_holdpkgs ( alpm_list_t holdpkgs  ) 

Definition at line 514 of file handle.c.

References FREELIST, and _pmhandle_t::holdpkg.

void alpm_option_set_ignoregrps ( alpm_list_t ignoregrps  ) 

Definition at line 537 of file handle.c.

References FREELIST, and _pmhandle_t::ignoregrp.

void alpm_option_set_ignorepkgs ( alpm_list_t ignorepkgs  ) 

Definition at line 491 of file handle.c.

References FREELIST, and _pmhandle_t::ignorepkg.

void alpm_option_set_logcb ( alpm_cb_log  cb  ) 

Definition at line 258 of file handle.c.

References _pmhandle_t::logcb, PM_ERR_HANDLE_NULL, and pm_errno.

Referenced by main().

Here is the caller graph for this function:

int alpm_option_set_logfile ( const char *  logfile  ) 

Definition at line 410 of file handle.c.

References _alpm_log(), ALPM_LOG_FUNC, FREE, _pmhandle_t::logfile, _pmhandle_t::logstream, PM_ERR_WRONG_ARGS, pm_errno, and PM_LOG_DEBUG.

Referenced by main().

Here is the call graph for this function:

Here is the caller graph for this function:

void alpm_option_set_noextracts ( alpm_list_t noextract  ) 

Definition at line 468 of file handle.c.

References FREELIST, and _pmhandle_t::noextract.

void alpm_option_set_nopassiveftp ( unsigned short  nopasv  ) 

Definition at line 561 of file handle.c.

References _pmhandle_t::nopassiveftp.

void alpm_option_set_noupgrades ( alpm_list_t noupgrade  ) 

Definition at line 445 of file handle.c.

References FREELIST, and _pmhandle_t::noupgrade.

int alpm_option_set_root ( const char *  root  ) 

Definition at line 276 of file handle.c.

References _alpm_log(), ALPM_LOG_FUNC, FREE, PM_ERR_NOT_A_DIR, PM_ERR_WRONG_ARGS, pm_errno, PM_LOG_DEBUG, and _pmhandle_t::root.

Referenced by main().

Here is the call graph for this function:

Here is the caller graph for this function:

void alpm_option_set_usedelta ( unsigned short  usedelta  ) 

Definition at line 566 of file handle.c.

References _pmhandle_t::usedelta.

void alpm_option_set_usesyslog ( unsigned short  usesyslog  ) 

Definition at line 435 of file handle.c.

References _pmhandle_t::usesyslog.

void alpm_option_set_xfercommand ( const char *  cmd  ) 

Definition at line 555 of file handle.c.

References FREE, and _pmhandle_t::xfercommand.


Variable Documentation

pmhandle_t* handle = NULL

Definition at line 45 of file handle.c.

Referenced by _alpm_add_commit(), _alpm_add_prepare(), _alpm_db_register_local(), _alpm_db_register_sync(), _alpm_downloadfiles_forreal(), _alpm_pkg_should_ignore(), _alpm_remove_commit(), _alpm_remove_loadtarget(), _alpm_sync_commit(), _alpm_trans_addtarget(), _alpm_trans_commit(), _alpm_trans_prepare(), _alpm_trans_sysupgrade(), alpm_conflict_get_package1(), alpm_conflict_get_package2(), alpm_db_get_name(), alpm_db_get_pkg(), alpm_db_get_url(), alpm_db_getgrpcache(), alpm_db_getpkgcache(), alpm_db_readgrp(), alpm_db_register_local(), alpm_db_register_sync(), alpm_db_search(), alpm_db_setserver(), alpm_db_unregister(), alpm_db_unregister_all(), alpm_db_update(), alpm_db_whatprovides(), alpm_fileconflict_get_ctarget(), alpm_fileconflict_get_file(), alpm_fileconflict_get_target(), alpm_fileconflict_get_type(), alpm_initialize(), alpm_logaction(), alpm_pkg_changelog_open(), alpm_pkg_checkmd5sum(), alpm_pkg_download_size(), alpm_pkg_get_arch(), alpm_pkg_get_backup(), alpm_pkg_get_builddate(), alpm_pkg_get_conflicts(), alpm_pkg_get_deltas(), alpm_pkg_get_depends(), alpm_pkg_get_desc(), alpm_pkg_get_filename(), alpm_pkg_get_files(), alpm_pkg_get_groups(), alpm_pkg_get_installdate(), alpm_pkg_get_isize(), alpm_pkg_get_licenses(), alpm_pkg_get_md5sum(), alpm_pkg_get_name(), alpm_pkg_get_optdepends(), alpm_pkg_get_packager(), alpm_pkg_get_provides(), alpm_pkg_get_reason(), alpm_pkg_get_replaces(), alpm_pkg_get_size(), alpm_pkg_get_url(), alpm_pkg_get_version(), alpm_pkg_has_scriptlet(), alpm_release(), alpm_trans_addtarget(), alpm_trans_commit(), alpm_trans_get_flags(), alpm_trans_get_pkgs(), alpm_trans_get_targets(), alpm_trans_get_type(), alpm_trans_init(), alpm_trans_interrupt(), alpm_trans_prepare(), alpm_trans_release(), and alpm_trans_sysupgrade().


Generated on Mon Jan 14 23:57:29 2008 for libalpm by  doxygen 1.5.4