summaryrefslogtreecommitdiffstats
path: root/src/util
diff options
context:
space:
mode:
authorDan McGee <dan@archlinux.org>2012-02-02 06:45:52 +0100
committerDan McGee <dan@archlinux.org>2012-02-06 12:49:52 +0100
commitb488f229d2ec4f2e4b9e746d68422460ca664715 (patch)
tree31604f41d7c3780d3b76ac4bb87c10e676a16c54 /src/util
parentf12effc6ff4605ea81b3b765ff1655107aad29d8 (diff)
downloadpacman-b488f229d2ec4f2e4b9e746d68422460ca664715.tar.gz
pacman-b488f229d2ec4f2e4b9e746d68422460ca664715.tar.xz
ALPM API adjustments for sanity and consistency
This makes several small adjustments to our exposed method names, and in one case, parameters. The justification here is to make methods less odd in their naming convention. If a method takes an alpm_db_t argument, the method should be named 'alpm_db_*', but perhaps more importantly, if it doesn't take a database as the first parameter, it should not. Summary of changes: alpm_db_register_sync -> alpm_register_syncdb alpm_db_unregister_all -> alpm_unregister_all_syncdbs alpm_option_get_localdb -> aplpm_get_localdb alpm_option_get_syncdbs -> aplpm_get_syncdbs alpm_db_readgroup -> alpm_db_get_group alpm_db_set_pkgreason -> alpm_pkg_set_reason All methods keep the same argument list except for alpm_pkg_set_reason; there we drop the 'handle' argument as it can be retrieved from the passed in package object. Signed-off-by: Dan McGee <dan@archlinux.org>
Diffstat (limited to 'src/util')
-rw-r--r--src/util/cleanupdelta.c2
-rw-r--r--src/util/pactree.c6
-rw-r--r--src/util/testdb.c4
3 files changed, 6 insertions, 6 deletions
diff --git a/src/util/cleanupdelta.c b/src/util/cleanupdelta.c
index ea34fe7f..2f7720b5 100644
--- a/src/util/cleanupdelta.c
+++ b/src/util/cleanupdelta.c
@@ -71,7 +71,7 @@ static void checkdbs(alpm_list_t *dbnames) {
for(i = dbnames; i; i = alpm_list_next(i)) {
const char *dbname = i->data;
- db = alpm_db_register_sync(handle, dbname, level);
+ db = alpm_register_syncdb(handle, dbname, level);
if(db == NULL) {
fprintf(stderr, "error: could not register sync database '%s' (%s)\n",
dbname, alpm_strerror(alpm_errno(handle)));
diff --git a/src/util/pactree.c b/src/util/pactree.c
index 0adc2ea8..a7dab9f1 100644
--- a/src/util/pactree.c
+++ b/src/util/pactree.c
@@ -184,7 +184,7 @@ static int register_syncs(void) {
section = strndup(&line[1], linelen - 2);
if(section && strcmp(section, "options") != 0) {
- alpm_db_register_sync(handle, section, level);
+ alpm_register_syncdb(handle, section, level);
}
}
}
@@ -468,9 +468,9 @@ int main(int argc, char *argv[])
ret = 1;
goto finish;
}
- dblist = alpm_option_get_syncdbs(handle);
+ dblist = alpm_get_syncdbs(handle);
} else {
- dblist = alpm_list_add(dblist, alpm_option_get_localdb(handle));
+ dblist = alpm_list_add(dblist, alpm_get_localdb(handle));
freelist = 1;
}
diff --git a/src/util/testdb.c b/src/util/testdb.c
index c12aee04..f3a7b659 100644
--- a/src/util/testdb.c
+++ b/src/util/testdb.c
@@ -207,7 +207,7 @@ static int check_localdb(void)
return ret;
}
- db = alpm_option_get_localdb(handle);
+ db = alpm_get_localdb(handle);
pkglist = alpm_db_get_pkgcache(db);
ret += check_deps(pkglist);
ret += check_conflicts(pkglist);
@@ -224,7 +224,7 @@ static int check_syncdbs(alpm_list_t *dbnames)
for(i = dbnames; i; i = alpm_list_next(i)) {
const char *dbname = i->data;
- db = alpm_db_register_sync(handle, dbname, level);
+ db = alpm_register_syncdb(handle, dbname, level);
if(db == NULL) {
fprintf(stderr, "error: could not register sync database (%s)\n",
alpm_strerror(alpm_errno(handle)));