index : pacman | |
Archlinux32 fork of pacman | gitolite user |
summaryrefslogtreecommitdiff |
-rw-r--r-- | lib/libalpm/alpm.h | 80 |
diff --git a/lib/libalpm/alpm.h b/lib/libalpm/alpm.h index 33291325..7fec293d 100644 --- a/lib/libalpm/alpm.h +++ b/lib/libalpm/alpm.h @@ -1,7 +1,7 @@ /* * alpm.h * - * Copyright (c) 2006-2010 Pacman Development Team <pacman-dev@archlinux.org> + * Copyright (c) 2006-2011 Pacman Development Team <pacman-dev@archlinux.org> * Copyright (c) 2002-2006 by Judd Vinet <jvinet@zeroflux.org> * Copyright (c) 2005 by Aurelien Foret <orelien@chez.com> * Copyright (c) 2005 by Christian Hamar <krics@linuxforum.hu> @@ -52,6 +52,7 @@ typedef struct __pmdepend_t pmdepend_t; typedef struct __pmdepmissing_t pmdepmissing_t; typedef struct __pmconflict_t pmconflict_t; typedef struct __pmfileconflict_t pmfileconflict_t; +typedef struct __pmpkghash_t pmpkghash_t; /* * Library @@ -97,66 +98,69 @@ typedef int (*alpm_cb_fetch)(const char *url, const char *localpath, * Options */ -alpm_cb_log alpm_option_get_logcb(); +alpm_cb_log alpm_option_get_logcb(void); void alpm_option_set_logcb(alpm_cb_log cb); -alpm_cb_download alpm_option_get_dlcb(); +alpm_cb_download alpm_option_get_dlcb(void); void alpm_option_set_dlcb(alpm_cb_download cb); -alpm_cb_fetch alpm_option_get_fetchcb(); +alpm_cb_fetch alpm_option_get_fetchcb(void); void alpm_option_set_fetchcb(alpm_cb_fetch cb); -alpm_cb_totaldl alpm_option_get_totaldlcb(); +alpm_cb_totaldl alpm_option_get_totaldlcb(void); void alpm_option_set_totaldlcb(alpm_cb_totaldl cb); -const char *alpm_option_get_root(); +const char *alpm_option_get_root(void); int alpm_option_set_root(const char *root); -const char *alpm_option_get_dbpath(); +const char *alpm_option_get_dbpath(void); int alpm_option_set_dbpath(const char *dbpath); -alpm_list_t *alpm_option_get_cachedirs(); +alpm_list_t *alpm_option_get_cachedirs(void); 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); -const char *alpm_option_get_logfile(); +const char *alpm_option_get_logfile(void); int alpm_option_set_logfile(const char *logfile); -const char *alpm_option_get_lockfile(); +const char *alpm_option_get_lockfile(void); /* no set_lockfile, path is determined from dbpath */ -int alpm_option_get_usesyslog(); +int alpm_option_get_usesyslog(void); void alpm_option_set_usesyslog(int usesyslog); -alpm_list_t *alpm_option_get_noupgrades(); +alpm_list_t *alpm_option_get_noupgrades(void); 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); -alpm_list_t *alpm_option_get_noextracts(); +alpm_list_t *alpm_option_get_noextracts(void); 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); -alpm_list_t *alpm_option_get_ignorepkgs(); +alpm_list_t *alpm_option_get_ignorepkgs(void); 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); -alpm_list_t *alpm_option_get_ignoregrps(); +alpm_list_t *alpm_option_get_ignoregrps(void); 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); -const char *alpm_option_get_arch(); +const char *alpm_option_get_arch(void); void alpm_option_set_arch(const char *arch); -int alpm_option_get_usedelta(); +int alpm_option_get_usedelta(void); void alpm_option_set_usedelta(int usedelta); -pmdb_t *alpm_option_get_localdb(); -alpm_list_t *alpm_option_get_syncdbs(); +int alpm_option_get_checkspace(void); +void alpm_option_set_checkspace(int checkspace); + +pmdb_t *alpm_option_get_localdb(void); +alpm_list_t *alpm_option_get_syncdbs(void); /* * Install reasons -- ie, why the package was installed @@ -171,8 +175,6 @@ typedef enum _pmpkgreason_t { * Databases */ -/* Preferred interfaces db_register_local and db_register_sync */ -pmdb_t *alpm_db_register_local(void); pmdb_t *alpm_db_register_sync(const char *treename); int alpm_db_unregister(pmdb_t *db); int alpm_db_unregister_all(void); @@ -185,7 +187,8 @@ int alpm_db_setserver(pmdb_t *db, const char *url); int alpm_db_update(int level, pmdb_t *db); pmpkg_t *alpm_db_get_pkg(pmdb_t *db, const char *name); -alpm_list_t *alpm_db_get_pkgcache(pmdb_t *db); +pmpkghash_t *alpm_db_get_pkgcache(pmdb_t *db); +alpm_list_t *alpm_db_get_pkgcache_list(pmdb_t *db); pmgrp_t *alpm_db_readgrp(pmdb_t *db, const char *name); alpm_list_t *alpm_db_get_grpcache(pmdb_t *db); @@ -235,7 +238,6 @@ size_t alpm_pkg_changelog_read(void *ptr, size_t size, /*int alpm_pkg_changelog_feof(const pmpkg_t *pkg, void *fp);*/ int alpm_pkg_changelog_close(const pmpkg_t *pkg, void *fp); int alpm_pkg_has_scriptlet(pmpkg_t *pkg); -int alpm_pkg_has_force(pmpkg_t *pkg); off_t alpm_pkg_download_size(pmpkg_t *newpkg); alpm_list_t *alpm_pkg_unused_deltas(pmpkg_t *pkg); @@ -255,6 +257,7 @@ off_t alpm_delta_get_size(pmdelta_t *delta); */ const char *alpm_grp_get_name(const pmgrp_t *grp); alpm_list_t *alpm_grp_get_pkgs(const pmgrp_t *grp); +alpm_list_t *alpm_find_grp_pkgs(alpm_list_t *dbs, const char *name); /* * Sync @@ -272,7 +275,7 @@ typedef enum _pmtransflag_t { PM_TRANS_FLAG_NODEPS = 1, PM_TRANS_FLAG_FORCE = (1 << 1), PM_TRANS_FLAG_NOSAVE = (1 << 2), - /* (1 << 3) flag can go here */ + PM_TRANS_FLAG_NODEPVERSION = (1 << 3), PM_TRANS_FLAG_CASCADE = (1 << 4), PM_TRANS_FLAG_RECURSE = (1 << 5), PM_TRANS_FLAG_DBONLY = (1 << 6), @@ -368,6 +371,10 @@ typedef enum _pmtransevt_t { * The repository's tree name is passed to the callback. */ PM_TRANS_EVT_RETRIEVE_START, + /** Disk space usage will be computed for a package */ + PM_TRANS_EVT_DISKSPACE_START, + /** Disk space usage was computed for a package */ + PM_TRANS_EVT_DISKSPACE_DONE, } pmtransevt_t; /*@}*/ @@ -379,6 +386,7 @@ typedef enum _pmtransconv_t { PM_TRANS_CONV_CORRUPTED_PKG = (1 << 3), PM_TRANS_CONV_LOCAL_NEWER = (1 << 4), PM_TRANS_CONV_REMOVE_PKGS = (1 << 5), + PM_TRANS_CONV_SELECT_PROVIDER = (1 << 6), } pmtransconv_t; /* Transaction Progress */ @@ -386,7 +394,9 @@ typedef enum _pmtransprog_t { PM_TRANS_PROGRESS_ADD_START, PM_TRANS_PROGRESS_UPGRADE_START, PM_TRANS_PROGRESS_REMOVE_START, - PM_TRANS_PROGRESS_CONFLICTS_START + PM_TRANS_PROGRESS_CONFLICTS_START, + PM_TRANS_PROGRESS_DISKSPACE_START, + PM_TRANS_PROGRESS_INTEGRITY_START, } pmtransprog_t; /* Transaction Event callback */ @@ -397,11 +407,11 @@ typedef void (*alpm_trans_cb_conv)(pmtransconv_t, void *, void *, void *, int *); /* Transaction Progress callback */ -typedef void (*alpm_trans_cb_progress)(pmtransprog_t, const char *, int, int, int); +typedef void (*alpm_trans_cb_progress)(pmtransprog_t, const char *, int, size_t, size_t); -int alpm_trans_get_flags(); -alpm_list_t * alpm_trans_get_add(); -alpm_list_t * alpm_trans_get_remove(); +int alpm_trans_get_flags(void); +alpm_list_t * alpm_trans_get_add(void); +alpm_list_t * alpm_trans_get_remove(void); int alpm_trans_init(pmtransflag_t flags, alpm_trans_cb_event cb_event, alpm_trans_cb_conv conv, alpm_trans_cb_progress cb_progress); @@ -411,10 +421,8 @@ int alpm_trans_interrupt(void); int alpm_trans_release(void); int alpm_sync_sysupgrade(int enable_downgrade); -int alpm_sync_target(char *target); -int alpm_sync_dbtarget(char *db, char *target); -int alpm_add_target(char *target); -int alpm_remove_target(char *target); +int alpm_add_pkg(pmpkg_t *pkg); +int alpm_remove_pkg(pmpkg_t *pkg); /* * Dependencies and conflicts @@ -429,10 +437,10 @@ typedef enum _pmdepmod_t { PM_DEP_MOD_LT } pmdepmod_t; -int alpm_depcmp(pmpkg_t *pkg, pmdepend_t *dep); alpm_list_t *alpm_checkdeps(alpm_list_t *pkglist, int reversedeps, alpm_list_t *remove, alpm_list_t *upgrade); -alpm_list_t *alpm_deptest(pmdb_t *db, alpm_list_t *targets); +pmpkg_t *alpm_find_satisfier(alpm_list_t *pkgs, const char *depstring); +pmpkg_t *alpm_find_dbs_satisfier(alpm_list_t *dbs, const char *depstring); const char *alpm_miss_get_target(const pmdepmissing_t *miss); pmdepend_t *alpm_miss_get_dep(pmdepmissing_t *miss); @@ -480,6 +488,7 @@ enum _pmerrno_t { PM_ERR_NOT_A_FILE, PM_ERR_NOT_A_DIR, PM_ERR_WRONG_ARGS, + PM_ERR_DISK_SPACE, /* Interface */ PM_ERR_HANDLE_NULL, PM_ERR_HANDLE_NOT_NULL, @@ -522,6 +531,7 @@ enum _pmerrno_t { PM_ERR_FILE_CONFLICTS, /* Misc */ PM_ERR_RETRIEVE, + PM_ERR_WRITE, PM_ERR_INVALID_REGEX, /* External library errors */ PM_ERR_LIBARCHIVE, |