summaryrefslogtreecommitdiff
path: root/lib/libalpm/db.c
diff options
context:
space:
mode:
authorAaron Griffin <aaron@archlinux.org>2006-11-20 09:10:23 +0000
committerAaron Griffin <aaron@archlinux.org>2006-11-20 09:10:23 +0000
commitaa1c0ba9f8787fc3b1a1190103e394b0c1c95922 (patch)
treeed0c9675f7fc5da043a69b36e0b8c6c8e05cb583 /lib/libalpm/db.c
parentb8b9596b13de957566211b0e1db3e473ed66e147 (diff)
downloadpacman-aa1c0ba9f8787fc3b1a1190103e394b0c1c95922.tar.xz
* repo-add script - to add entries to a db file directly from package data (no PKGBUILD)
* libalpm api changes - move from a _getinfo(p, WHAT_WE_WANT) scheme to a typesafe _get_what_we_want(p) scheme [not 100% complete yet] * some const correctness changes * removal of PM_* types in alpm.h in favor of the pm*_t types used throughout libalpm
Diffstat (limited to 'lib/libalpm/db.c')
-rw-r--r--lib/libalpm/db.c25
1 files changed, 25 insertions, 0 deletions
diff --git a/lib/libalpm/db.c b/lib/libalpm/db.c
index 641a6f3f..c3e071b0 100644
--- a/lib/libalpm/db.c
+++ b/lib/libalpm/db.c
@@ -223,4 +223,29 @@ pmdb_t *_alpm_db_register(char *treename, alpm_cb_db_register callback)
return(db);
}
+
+const char *alpm_db_get_name(pmdb_t *db)
+{
+ /* Sanity checks */
+ ASSERT(handle != NULL, return(NULL));
+ ASSERT(db != NULL, return(NULL));
+
+ return db->treename;
+}
+
+const char *alpm_db_get_url(pmdb_t *db)
+{
+ char path[PATH_MAX];
+ pmserver_t *s;
+
+ /* Sanity checks */
+ ASSERT(handle != NULL, return(NULL));
+ ASSERT(db != NULL, return(NULL));
+
+ s = (pmserver_t*)db->servers->data;
+
+ snprintf(path, PATH_MAX, "%s://%s%s", s->s_url->scheme, s->s_url->host, s->s_url->doc);
+ return strdup(path);
+}
+
/* vim: set noet: */