summaryrefslogtreecommitdiffstats
path: root/lib/libalpm/alpm.h
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 /lib/libalpm/alpm.h
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 'lib/libalpm/alpm.h')
-rw-r--r--lib/libalpm/alpm.h39
1 files changed, 20 insertions, 19 deletions
diff --git a/lib/libalpm/alpm.h b/lib/libalpm/alpm.h
index 5b7f6275..ca650928 100644
--- a/lib/libalpm/alpm.h
+++ b/lib/libalpm/alpm.h
@@ -553,7 +553,7 @@ int alpm_option_set_default_siglevel(alpm_handle_t *handle, alpm_siglevel_t leve
* libalpm functions.
* @return a reference to the local database
*/
-alpm_db_t *alpm_option_get_localdb(alpm_handle_t *handle);
+alpm_db_t *alpm_get_localdb(alpm_handle_t *handle);
/** Get the list of sync databases.
* Returns a list of alpm_db_t structures, one for each registered
@@ -561,7 +561,7 @@ alpm_db_t *alpm_option_get_localdb(alpm_handle_t *handle);
* @param handle the context handle
* @return a reference to an internal list of alpm_db_t structures
*/
-alpm_list_t *alpm_option_get_syncdbs(alpm_handle_t *handle);
+alpm_list_t *alpm_get_syncdbs(alpm_handle_t *handle);
/** Register a sync database of packages.
* @param handle the context handle
@@ -570,20 +570,20 @@ alpm_list_t *alpm_option_get_syncdbs(alpm_handle_t *handle);
* database; note that this must be a '.sig' file type verification
* @return an alpm_db_t* on success (the value), NULL on error
*/
-alpm_db_t *alpm_db_register_sync(alpm_handle_t *handle, const char *treename,
+alpm_db_t *alpm_register_syncdb(alpm_handle_t *handle, const char *treename,
alpm_siglevel_t level);
-/** Unregister a package database.
- * @param db pointer to the package database to unregister
+/** Unregister all package databases.
+ * @param handle the context handle
* @return 0 on success, -1 on error (pm_errno is set accordingly)
*/
-int alpm_db_unregister(alpm_db_t *db);
+int alpm_unregister_all_syncdbs(alpm_handle_t *handle);
-/** Unregister all package databases.
- * @param handle the context handle
+/** Unregister a package database.
+ * @param db pointer to the package database to unregister
* @return 0 on success, -1 on error (pm_errno is set accordingly)
*/
-int alpm_db_unregister_all(alpm_handle_t *handle);
+int alpm_db_unregister(alpm_db_t *db);
/** Get the name of a package database.
* @param db pointer to the package database
@@ -636,7 +636,7 @@ alpm_list_t *alpm_db_get_pkgcache(alpm_db_t *db);
* @param name of the group
* @return the groups entry on success, NULL on error
*/
-alpm_group_t *alpm_db_readgroup(alpm_db_t *db, const char *name);
+alpm_group_t *alpm_db_get_group(alpm_db_t *db, const char *name);
/** Get the group cache of a package database.
* @param db pointer to the package database to get the group from
@@ -651,15 +651,6 @@ alpm_list_t *alpm_db_get_groupcache(alpm_db_t *db);
*/
alpm_list_t *alpm_db_search(alpm_db_t *db, const alpm_list_t *needles);
-/** Set install reason for a package in db.
- * @param handle the context handle
- * @param pkg the package to update
- * @param reason the new install reason
- * @return 0 on success, -1 on error (pm_errno is set accordingly)
- */
-int alpm_db_set_pkgreason(alpm_handle_t *handle, alpm_pkg_t *pkg,
- alpm_pkgreason_t reason);
-
/** @} */
/** @addtogroup alpm_api_packages Package Functions
@@ -929,6 +920,16 @@ off_t alpm_pkg_download_size(alpm_pkg_t *newpkg);
alpm_list_t *alpm_pkg_unused_deltas(alpm_pkg_t *pkg);
+/** Set install reason for a package in the local database.
+ * The provided package object must be from the local database or this method
+ * will fail. The write to the local database is performed immediately.
+ * @param pkg the package to update
+ * @param reason the new install reason
+ * @return 0 on success, -1 on error (pm_errno is set accordingly)
+ */
+int alpm_pkg_set_reason(alpm_pkg_t *pkg, alpm_pkgreason_t reason);
+
+
/* End of alpm_pkg */
/** @} */