Rename internal functions with grp in their name

The following function renames take place for the same reasoning as
the previous commit:

  _alpm_grp_new -> _alpm_group_new
  _alpm_grp_free -> _alpm_group_free
  _alpm_db_free_grpcache -> _alpm_db_free_groupcache
  _alpm_db_get_grpfromcache -> _alpm_db_get_groupfromcache

Signed-off-by: Allan McRae <allan@archlinux.org>
This commit is contained in:
Allan McRae 2011-06-29 15:52:33 +10:00
parent f1bb56cebf
commit b1894ccf06
4 changed files with 15 additions and 15 deletions

View File

@ -246,7 +246,7 @@ alpm_group_t SYMEXPORT *alpm_db_readgroup(alpm_db_t *db, const char *name)
ASSERT(name != NULL && strlen(name) != 0,
RET_ERR(db->handle, PM_ERR_WRONG_ARGS, NULL));
return _alpm_db_get_grpfromcache(db, name);
return _alpm_db_get_groupfromcache(db, name);
}
/** Get the group cache of a package database. */
@ -481,7 +481,7 @@ void _alpm_db_free_pkgcache(alpm_db_t *db)
_alpm_pkghash_free(db->pkgcache);
db->status &= ~DB_STATUS_PKGCACHE;
_alpm_db_free_grpcache(db);
_alpm_db_free_groupcache(db);
}
alpm_pkghash_t *_alpm_db_get_pkgcache_hash(alpm_db_t *db)
@ -530,7 +530,7 @@ int _alpm_db_add_pkgincache(alpm_db_t *db, alpm_pkg_t *pkg)
alpm_pkg_get_name(newpkg), db->treename);
db->pkgcache = _alpm_pkghash_add_sorted(db->pkgcache, newpkg);
_alpm_db_free_grpcache(db);
_alpm_db_free_groupcache(db);
return 0;
}
@ -556,7 +556,7 @@ int _alpm_db_remove_pkgfromcache(alpm_db_t *db, alpm_pkg_t *pkg)
_alpm_pkg_free(data);
_alpm_db_free_grpcache(db);
_alpm_db_free_groupcache(db);
return 0;
}
@ -613,9 +613,9 @@ static int load_grpcache(alpm_db_t *db)
continue;
}
/* we didn't find the group, so create a new one with this name */
grp = _alpm_grp_new(grpname);
grp = _alpm_group_new(grpname);
if(!grp) {
_alpm_db_free_grpcache(db);
_alpm_db_free_groupcache(db);
return -1;
}
grp->packages = alpm_list_add(grp->packages, pkg);
@ -627,7 +627,7 @@ static int load_grpcache(alpm_db_t *db)
return 0;
}
void _alpm_db_free_grpcache(alpm_db_t *db)
void _alpm_db_free_groupcache(alpm_db_t *db)
{
alpm_list_t *lg;
@ -639,7 +639,7 @@ void _alpm_db_free_grpcache(alpm_db_t *db)
"freeing group cache for repository '%s'\n", db->treename);
for(lg = db->grpcache; lg; lg = lg->next) {
_alpm_grp_free(lg->data);
_alpm_group_free(lg->data);
lg->data = NULL;
}
FREELIST(db->grpcache);
@ -663,7 +663,7 @@ alpm_list_t *_alpm_db_get_groupcache(alpm_db_t *db)
return db->grpcache;
}
alpm_group_t *_alpm_db_get_grpfromcache(alpm_db_t *db, const char *target)
alpm_group_t *_alpm_db_get_groupfromcache(alpm_db_t *db, const char *target)
{
alpm_list_t *i;

View File

@ -102,9 +102,9 @@ alpm_list_t *_alpm_db_get_pkgcache(alpm_db_t *db);
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);
void _alpm_db_free_groupcache(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);
alpm_group_t *_alpm_db_get_groupfromcache(alpm_db_t *db, const char *target);
#endif /* _ALPM_DB_H */

View File

@ -30,7 +30,7 @@
#include "log.h"
#include "alpm.h"
alpm_group_t *_alpm_grp_new(const char *name)
alpm_group_t *_alpm_group_new(const char *name)
{
alpm_group_t* grp;
@ -40,7 +40,7 @@ alpm_group_t *_alpm_grp_new(const char *name)
return grp;
}
void _alpm_grp_free(alpm_group_t *grp)
void _alpm_group_free(alpm_group_t *grp)
{
if(grp == NULL) {
return;

View File

@ -22,8 +22,8 @@
#include "alpm.h"
alpm_group_t *_alpm_grp_new(const char *name);
void _alpm_grp_free(alpm_group_t *grp);
alpm_group_t *_alpm_group_new(const char *name);
void _alpm_group_free(alpm_group_t *grp);
#endif /* _ALPM_GROUP_H */