1
0
mirror of https://github.com/moparisthebest/pacman synced 2024-12-22 15:58:50 -05:00

Rename public functions with grp in their name

Using grp instead of group is a small saving at the cost of clarity.
Rename the following functions:

  alpm_option_get_ignoregrps -> alpm_option_get_ignoregroups
  alpm_option_add_ignoregrp -> alpm_option_add_ignoregroup
  alpm_option_set_ignoregrps -> alpm_option_set_ignoregroups
  alpm_option_remove_ignoregrp -> alpm_option_remove_ignoregroup
  alpm_db_readgrp -> alpm_db_readgroup
  alpm_db_get_grpcache -> alpm_db_get_groupcache
  alpm_find_grp_pkgs -> alpm_find_group_pkgs

Signed-off-by: Allan McRae <allan@archlinux.org>
This commit is contained in:
Allan McRae 2011-06-29 15:46:49 +10:00
parent 3bb469d558
commit f1bb56cebf
9 changed files with 26 additions and 26 deletions

View File

@ -311,10 +311,10 @@ int alpm_option_remove_ignorepkg(alpm_handle_t *handle, const char *pkg);
* should be ignored by a sysupgrade.
* @{
*/
alpm_list_t *alpm_option_get_ignoregrps(alpm_handle_t *handle);
int alpm_option_add_ignoregrp(alpm_handle_t *handle, const char *grp);
int alpm_option_set_ignoregrps(alpm_handle_t *handle, alpm_list_t *ignoregrps);
int alpm_option_remove_ignoregrp(alpm_handle_t *handle, const char *grp);
alpm_list_t *alpm_option_get_ignoregroups(alpm_handle_t *handle);
int alpm_option_add_ignoregroup(alpm_handle_t *handle, const char *grp);
int alpm_option_set_ignoregroups(alpm_handle_t *handle, alpm_list_t *ignoregrps);
int alpm_option_remove_ignoregroup(alpm_handle_t *handle, const char *grp);
/** @} */
/** Returns the targeted architecture. */
@ -411,13 +411,13 @@ 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_readgrp(alpm_db_t *db, const char *name);
alpm_group_t *alpm_db_readgroup(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
* @return the list of groups on success, NULL on error
*/
alpm_list_t *alpm_db_get_grpcache(alpm_db_t *db);
alpm_list_t *alpm_db_get_groupcache(alpm_db_t *db);
/** Searches a database with regular expressions.
* @param db pointer to the package database to search in
@ -700,7 +700,7 @@ int alpm_db_check_pgp_signature(alpm_db_t *db);
* Groups
*/
alpm_list_t *alpm_find_grp_pkgs(alpm_list_t *dbs, const char *name);
alpm_list_t *alpm_find_group_pkgs(alpm_list_t *dbs, const char *name);
/*
* Sync

View File

@ -239,7 +239,7 @@ alpm_list_t SYMEXPORT *alpm_db_get_pkgcache(alpm_db_t *db)
}
/** Get a group entry from a package database. */
alpm_group_t SYMEXPORT *alpm_db_readgrp(alpm_db_t *db, const char *name)
alpm_group_t SYMEXPORT *alpm_db_readgroup(alpm_db_t *db, const char *name)
{
ASSERT(db != NULL, return NULL);
db->handle->pm_errno = 0;
@ -250,12 +250,12 @@ alpm_group_t SYMEXPORT *alpm_db_readgrp(alpm_db_t *db, const char *name)
}
/** Get the group cache of a package database. */
alpm_list_t SYMEXPORT *alpm_db_get_grpcache(alpm_db_t *db)
alpm_list_t SYMEXPORT *alpm_db_get_groupcache(alpm_db_t *db)
{
ASSERT(db != NULL, return NULL);
db->handle->pm_errno = 0;
return _alpm_db_get_grpcache(db);
return _alpm_db_get_groupcache(db);
}
/** Searches a database. */
@ -646,7 +646,7 @@ void _alpm_db_free_grpcache(alpm_db_t *db)
db->status &= ~DB_STATUS_GRPCACHE;
}
alpm_list_t *_alpm_db_get_grpcache(alpm_db_t *db)
alpm_list_t *_alpm_db_get_groupcache(alpm_db_t *db)
{
if(db == NULL) {
return NULL;
@ -671,7 +671,7 @@ alpm_group_t *_alpm_db_get_grpfromcache(alpm_db_t *db, const char *target)
return NULL;
}
for(i = _alpm_db_get_grpcache(db); i; i = i->next) {
for(i = _alpm_db_get_groupcache(db); i; i = i->next) {
alpm_group_t *info = i->data;
if(strcmp(info->name, target) == 0) {

View File

@ -103,7 +103,7 @@ int _alpm_db_ensure_pkgcache(alpm_db_t *db, alpm_dbinfrq_t infolevel);
alpm_pkg_t *_alpm_db_get_pkgfromcache(alpm_db_t *db, const char *target);
/* groups */
void _alpm_db_free_grpcache(alpm_db_t *db);
alpm_list_t *_alpm_db_get_grpcache(alpm_db_t *db);
alpm_list_t *_alpm_db_get_groupcache(alpm_db_t *db);
alpm_group_t *_alpm_db_get_grpfromcache(alpm_db_t *db, const char *target);
#endif /* _ALPM_DB_H */

View File

@ -224,7 +224,7 @@ alpm_list_t SYMEXPORT *alpm_option_get_ignorepkgs(alpm_handle_t *handle)
return handle->ignorepkg;
}
alpm_list_t SYMEXPORT *alpm_option_get_ignoregrps(alpm_handle_t *handle)
alpm_list_t SYMEXPORT *alpm_option_get_ignoregroups(alpm_handle_t *handle)
{
CHECK_HANDLE(handle, return NULL);
return handle->ignoregrp;
@ -521,14 +521,14 @@ int SYMEXPORT alpm_option_remove_ignorepkg(alpm_handle_t *handle, const char *pk
return 0;
}
int SYMEXPORT alpm_option_add_ignoregrp(alpm_handle_t *handle, const char *grp)
int SYMEXPORT alpm_option_add_ignoregroup(alpm_handle_t *handle, const char *grp)
{
CHECK_HANDLE(handle, return -1);
handle->ignoregrp = alpm_list_add(handle->ignoregrp, strdup(grp));
return 0;
}
int SYMEXPORT alpm_option_set_ignoregrps(alpm_handle_t *handle, alpm_list_t *ignoregrps)
int SYMEXPORT alpm_option_set_ignoregroups(alpm_handle_t *handle, alpm_list_t *ignoregrps)
{
CHECK_HANDLE(handle, return -1);
if(handle->ignoregrp) FREELIST(handle->ignoregrp);
@ -536,7 +536,7 @@ int SYMEXPORT alpm_option_set_ignoregrps(alpm_handle_t *handle, alpm_list_t *ign
return 0;
}
int SYMEXPORT alpm_option_remove_ignoregrp(alpm_handle_t *handle, const char *grp)
int SYMEXPORT alpm_option_remove_ignoregroup(alpm_handle_t *handle, const char *grp)
{
char *vdata = NULL;
CHECK_HANDLE(handle, return -1);

View File

@ -213,14 +213,14 @@ int SYMEXPORT alpm_sync_sysupgrade(alpm_handle_t *handle, int enable_downgrade)
* @pram name the name of the group
* @return the list of alpm_pkg_t * (caller is responsible for alpm_list_free)
*/
alpm_list_t SYMEXPORT *alpm_find_grp_pkgs(alpm_list_t *dbs,
alpm_list_t SYMEXPORT *alpm_find_group_pkgs(alpm_list_t *dbs,
const char *name)
{
alpm_list_t *i, *j, *pkgs = NULL, *ignorelist = NULL;
for(i = dbs; i; i = i->next) {
alpm_db_t *db = i->data;
alpm_group_t *grp = alpm_db_readgrp(db, name);
alpm_group_t *grp = alpm_db_readgroup(db, name);
if(!grp)
continue;

View File

@ -502,7 +502,7 @@ static int setup_libalpm(void)
alpm_option_set_usedelta(handle, config->usedelta);
alpm_option_set_ignorepkgs(handle, config->ignorepkg);
alpm_option_set_ignoregrps(handle, config->ignoregrp);
alpm_option_set_ignoregroups(handle, config->ignoregrp);
alpm_option_set_noupgrades(handle, config->noupgrade);
alpm_option_set_noextracts(handle, config->noextract);

View File

@ -302,7 +302,7 @@ static int query_group(alpm_list_t *targets)
alpm_db_t *db_local = alpm_option_get_localdb(config->handle);
if(targets == NULL) {
for(j = alpm_db_get_grpcache(db_local); j; j = alpm_list_next(j)) {
for(j = alpm_db_get_groupcache(db_local); j; j = alpm_list_next(j)) {
alpm_group_t *grp = alpm_list_getdata(j);
const alpm_list_t *p;
@ -315,7 +315,7 @@ static int query_group(alpm_list_t *targets)
for(i = targets; i; i = alpm_list_next(i)) {
alpm_group_t *grp;
grpname = alpm_list_getdata(i);
grp = alpm_db_readgrp(db_local, grpname);
grp = alpm_db_readgroup(db_local, grpname);
if(grp) {
const alpm_list_t *p;
for(p = grp->packages; p; p = alpm_list_next(p)) {

View File

@ -47,7 +47,7 @@ static int remove_target(const char *target)
}
/* fallback to group */
alpm_group_t *grp = alpm_db_readgrp(db_local, target);
alpm_group_t *grp = alpm_db_readgroup(db_local, target);
if(grp == NULL) {
pm_fprintf(stderr, PM_LOG_ERROR, "'%s': target not found\n", target);
return -1;

View File

@ -398,7 +398,7 @@ static int sync_group(int level, alpm_list_t *syncs, alpm_list_t *targets)
const char *grpname = alpm_list_getdata(i);
for(j = syncs; j; j = alpm_list_next(j)) {
alpm_db_t *db = alpm_list_getdata(j);
alpm_group_t *grp = alpm_db_readgrp(db, grpname);
alpm_group_t *grp = alpm_db_readgroup(db, grpname);
if(grp) {
/* get names of packages in group */
@ -417,7 +417,7 @@ static int sync_group(int level, alpm_list_t *syncs, alpm_list_t *targets)
for(i = syncs; i; i = alpm_list_next(i)) {
alpm_db_t *db = alpm_list_getdata(i);
for(j = alpm_db_get_grpcache(db); j; j = alpm_list_next(j)) {
for(j = alpm_db_get_groupcache(db); j; j = alpm_list_next(j)) {
alpm_group_t *grp = alpm_list_getdata(j);
if(level > 1) {
@ -634,7 +634,7 @@ static int process_group(alpm_list_t *dbs, char *group)
{
int ret = 0;
alpm_list_t *i;
alpm_list_t *pkgs = alpm_find_grp_pkgs(dbs, group);
alpm_list_t *pkgs = alpm_find_group_pkgs(dbs, group);
int count = alpm_list_count(pkgs);
if(!count) {