alpm.h: add/improve function documentation

Signed-off-by: Rémy Oudompheng <remy@archlinux.org>
This commit is contained in:
Rémy Oudompheng 2011-04-17 09:45:52 +02:00
parent 442e1420f9
commit 670b315c4d
3 changed files with 27 additions and 12 deletions

View file

@ -47,10 +47,7 @@
#include "remove.h" #include "remove.h"
#include "handle.h" #include "handle.h"
/** Add a package to the transaction. /** Add a package to the transaction. */
* @param pkg the package to add
* @return 0 on success, -1 on error (pm_errno is set accordingly)
*/
int SYMEXPORT alpm_add_pkg(pmpkg_t *pkg) int SYMEXPORT alpm_add_pkg(pmpkg_t *pkg)
{ {
const char *pkgname, *pkgver; const char *pkgname, *pkgver;

View file

@ -279,7 +279,8 @@ const char *alpm_db_get_name(const pmdb_t *db);
*/ */
const char *alpm_db_get_url(const pmdb_t *db); const char *alpm_db_get_url(const pmdb_t *db);
/** Set the serverlist of a database. /** Add a new server for a database.
* An empty string or NULL can be passed to empty the current server list.
* @param db database pointer * @param db database pointer
* @param url url of the server * @param url url of the server
* @return 0 on success, -1 on error (pm_errno is set accordingly) * @return 0 on success, -1 on error (pm_errno is set accordingly)
@ -314,10 +315,10 @@ pmgrp_t *alpm_db_readgrp(pmdb_t *db, const char *name);
*/ */
alpm_list_t *alpm_db_get_grpcache(pmdb_t *db); alpm_list_t *alpm_db_get_grpcache(pmdb_t *db);
/** Searches a database. /** Searches a database with regular expressions.
* @param db pointer to the package database to search in * @param db pointer to the package database to search in
* @param needles the list of strings to search for * @param needles a list of regular expressions to search for
* @return the list of packages on success, NULL on error * @return the list of packages matching all regular expressions on success, NULL on error
*/ */
alpm_list_t *alpm_db_search(pmdb_t *db, const alpm_list_t* needles); alpm_list_t *alpm_db_search(pmdb_t *db, const alpm_list_t* needles);
@ -339,7 +340,8 @@ int alpm_db_set_pkgreason(pmdb_t *db, const char *name, pmpkgreason_t reason);
/** Create a package from a file. /** Create a package from a file.
* If full is false, the archive is read only until all necessary * If full is false, the archive is read only until all necessary
* metadata is found. If it is true, the entire archive is read, which * metadata is found. If it is true, the entire archive is read, which
* serves as a verfication of integrity and the filelist can be created. * serves as a verification of integrity and the filelist can be created.
* The allocated structure should be freed using alpm_pkg_free().
* @param filename location of the package tarball * @param filename location of the package tarball
* @param full whether to stop the load after metadata is read or continue * @param full whether to stop the load after metadata is read or continue
* through the full archive * through the full archive
@ -813,9 +815,27 @@ int alpm_trans_release(void);
/** @name Common Transactions */ /** @name Common Transactions */
/** @{ */ /** @{ */
/** Search for packages to upgrade and add them to the transaction.
* @param enable_downgrade allow downgrading of packages if the remote version is lower
* @return 0 on success, -1 on error (pm_errno is set accordingly)
*/
int alpm_sync_sysupgrade(int enable_downgrade); int alpm_sync_sysupgrade(int enable_downgrade);
/** Add a package to the transaction.
* If the package was loaded by alpm_pkg_load(), it will be freed upon
* alpm_trans_release() invocation.
* @param pkg the package to add
* @return 0 on success, -1 on error (pm_errno is set accordingly)
*/
int alpm_add_pkg(pmpkg_t *pkg); int alpm_add_pkg(pmpkg_t *pkg);
/** Add a package removal action to the transaction.
* @param pkg the package to uninstall
* @return 0 on success, -1 on error (pm_errno is set accordingly)
*/
int alpm_remove_pkg(pmpkg_t *pkg); int alpm_remove_pkg(pmpkg_t *pkg);
/** @} */ /** @} */
/** @addtogroup alpm_api_depends Dependency Functions /** @addtogroup alpm_api_depends Dependency Functions

View file

@ -81,9 +81,7 @@ pmpkg_t SYMEXPORT *alpm_sync_newversion(pmpkg_t *pkg, alpm_list_t *dbs_sync)
return NULL; return NULL;
} }
/** Search for packages to upgrade and add them to the transaction. /** Search for packages to upgrade and add them to the transaction. */
* @return 0 on success, -1 on error (pm_errno is set accordingly)
*/
int SYMEXPORT alpm_sync_sysupgrade(int enable_downgrade) int SYMEXPORT alpm_sync_sysupgrade(int enable_downgrade)
{ {
alpm_list_t *i, *j, *k; alpm_list_t *i, *j, *k;