Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
path: root/lib/libalpm/alpm.h
diff options
context:
space:
mode:
Diffstat (limited to 'lib/libalpm/alpm.h')
-rw-r--r--lib/libalpm/alpm.h66
1 files changed, 47 insertions, 19 deletions
diff --git a/lib/libalpm/alpm.h b/lib/libalpm/alpm.h
index cb643d29..7259957d 100644
--- a/lib/libalpm/alpm.h
+++ b/lib/libalpm/alpm.h
@@ -50,6 +50,7 @@ extern "C" {
typedef struct __pmdb_t pmdb_t;
typedef struct __pmpkg_t pmpkg_t;
+typedef struct __pmpgpsig_t pmpgpsig_t;
typedef struct __pmdelta_t pmdelta_t;
typedef struct __pmgrp_t pmgrp_t;
typedef struct __pmtrans_t pmtrans_t;
@@ -112,20 +113,20 @@ char *alpm_fetch_pkgurl(const char *url);
/** @name The logging callback. */
/* @{ */
alpm_cb_log alpm_option_get_logcb(void);
-void alpm_option_set_logcb(alpm_cb_log cb);
+int alpm_option_set_logcb(alpm_cb_log cb);
/* @} */
/** Get/set the download progress callback. */
alpm_cb_download alpm_option_get_dlcb(void);
-void alpm_option_set_dlcb(alpm_cb_download cb);
+int alpm_option_set_dlcb(alpm_cb_download cb);
/** Get/set the downloader callback. */
alpm_cb_fetch alpm_option_get_fetchcb(void);
-void alpm_option_set_fetchcb(alpm_cb_fetch cb);
+int alpm_option_set_fetchcb(alpm_cb_fetch cb);
/** Get/set the callback used when download size is known. */
alpm_cb_totaldl alpm_option_get_totaldlcb(void);
-void alpm_option_set_totaldlcb(alpm_cb_totaldl cb);
+int alpm_option_set_totaldlcb(alpm_cb_totaldl cb);
/** Get/set the root of the destination filesystem. */
const char *alpm_option_get_root(void);
@@ -137,7 +138,7 @@ int alpm_option_set_dbpath(const char *dbpath);
/** Get/set the list of package cache directories. */
alpm_list_t *alpm_option_get_cachedirs(void);
-void alpm_option_set_cachedirs(alpm_list_t *cachedirs);
+int alpm_option_set_cachedirs(alpm_list_t *cachedirs);
/** Add a single directory to the package cache paths. */
int alpm_option_add_cachedir(const char *cachedir);
@@ -158,39 +159,43 @@ int alpm_option_set_logfile(const char *logfile);
*/
const char *alpm_option_get_lockfile(void);
+/** Get/set the signature directory. */
+const char *alpm_option_get_signaturedir(void);
+int alpm_option_set_signaturedir(const char *signaturedir);
+
/** Get/set whether to use syslog (0 is FALSE, TRUE otherwise). */
int alpm_option_get_usesyslog(void);
-void alpm_option_set_usesyslog(int usesyslog);
+int alpm_option_set_usesyslog(int usesyslog);
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_add_noupgrade(const char *pkg);
+int alpm_option_set_noupgrades(alpm_list_t *noupgrade);
int alpm_option_remove_noupgrade(const char *pkg);
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_add_noextract(const char *pkg);
+int alpm_option_set_noextracts(alpm_list_t *noextract);
int alpm_option_remove_noextract(const char *pkg);
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_add_ignorepkg(const char *pkg);
+int alpm_option_set_ignorepkgs(alpm_list_t *ignorepkgs);
int alpm_option_remove_ignorepkg(const char *pkg);
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_add_ignoregrp(const char *grp);
+int alpm_option_set_ignoregrps(alpm_list_t *ignoregrps);
int alpm_option_remove_ignoregrp(const char *grp);
/** Get/set the targeted architecture. */
const char *alpm_option_get_arch(void);
-void alpm_option_set_arch(const char *arch);
+int alpm_option_set_arch(const char *arch);
int alpm_option_get_usedelta(void);
-void alpm_option_set_usedelta(int usedelta);
+int alpm_option_set_usedelta(int usedelta);
int alpm_option_get_checkspace(void);
-void alpm_option_set_checkspace(int checkspace);
+int alpm_option_set_checkspace(int checkspace);
/** @} */
@@ -409,6 +414,8 @@ const char *alpm_pkg_get_packager(pmpkg_t *pkg);
*/
const char *alpm_pkg_get_md5sum(pmpkg_t *pkg);
+const pmpgpsig_t *alpm_pkg_get_pgpsig(pmpkg_t *pkg);
+
/** Returns the architecture for which the package was built.
* @param pkg a pointer to package
* @return a reference to an internal string
@@ -550,6 +557,22 @@ alpm_list_t *alpm_pkg_unused_deltas(pmpkg_t *pkg);
/** @} */
/*
+ * Signatures
+ */
+
+int alpm_pkg_check_pgp_signature(pmpkg_t *pkg);
+int alpm_db_check_pgp_signature(pmdb_t *db);
+
+/* GPG signature verification option */
+typedef enum _pgp_verify_t {
+ PM_PGP_VERIFY_ALWAYS,
+ PM_PGP_VERIFY_OPTIONAL,
+ PM_PGP_VERIFY_NEVER
+} pgp_verify_t;
+
+int alpm_db_set_pgp_verify(pmdb_t *db, pgp_verify_t verify);
+
+/*
* Deltas
*/
@@ -916,6 +939,10 @@ enum _pmerrno_t {
PM_ERR_PKG_INVALID_NAME,
PM_ERR_PKG_INVALID_ARCH,
PM_ERR_PKG_REPO_NOT_FOUND,
+ /* Signatures */
+ PM_ERR_SIG_MISSINGDIR,
+ PM_ERR_SIG_INVALID,
+ PM_ERR_SIG_UNKNOWN,
/* Deltas */
PM_ERR_DLT_INVALID,
PM_ERR_DLT_PATCHFAILED,
@@ -929,8 +956,9 @@ enum _pmerrno_t {
PM_ERR_INVALID_REGEX,
/* External library errors */
PM_ERR_LIBARCHIVE,
- PM_ERR_LIBFETCH,
- PM_ERR_EXTERNAL_DOWNLOAD
+ PM_ERR_LIBCURL,
+ PM_ERR_EXTERNAL_DOWNLOAD,
+ PM_ERR_GPGME
};
/** The number of the last error that occurred. */