Rename pmgrp_t to alpm_group_t

Signed-off-by: Allan McRae <allan@archlinux.org>
This commit is contained in:
Allan McRae 2011-06-28 14:37:16 +10:00
parent 37b6cceed4
commit 1fdbe79022
9 changed files with 20 additions and 20 deletions

View file

@ -137,12 +137,12 @@ typedef struct _alpm_fileconflict_t {
} alpm_fileconflict_t; } alpm_fileconflict_t;
/** Package group */ /** Package group */
typedef struct _pmgrp_t { typedef struct _alpm_group_t {
/** group name */ /** group name */
char *name; char *name;
/** list of alpm_pkg_t packages */ /** list of alpm_pkg_t packages */
alpm_list_t *packages; alpm_list_t *packages;
} pmgrp_t; } alpm_group_t;
/** Package upgrade delta */ /** Package upgrade delta */
typedef struct _pmdelta_t { typedef struct _pmdelta_t {
@ -411,7 +411,7 @@ alpm_list_t *alpm_db_get_pkgcache(alpm_db_t *db);
* @param name of the group * @param name of the group
* @return the groups entry on success, NULL on error * @return the groups entry on success, NULL on error
*/ */
pmgrp_t *alpm_db_readgrp(alpm_db_t *db, const char *name); alpm_group_t *alpm_db_readgrp(alpm_db_t *db, const char *name);
/** Get the group cache of a package database. /** Get the group cache of a package database.
* @param db pointer to the package database to get the group from * @param db pointer to the package database to get the group from

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. */ /** Get a group entry from a package database. */
pmgrp_t SYMEXPORT *alpm_db_readgrp(alpm_db_t *db, const char *name) alpm_group_t SYMEXPORT *alpm_db_readgrp(alpm_db_t *db, const char *name)
{ {
ASSERT(db != NULL, return NULL); ASSERT(db != NULL, return NULL);
db->handle->pm_errno = 0; db->handle->pm_errno = 0;
@ -595,7 +595,7 @@ static int load_grpcache(alpm_db_t *db)
for(i = alpm_pkg_get_groups(pkg); i; i = i->next) { for(i = alpm_pkg_get_groups(pkg); i; i = i->next) {
const char *grpname = i->data; const char *grpname = i->data;
alpm_list_t *j; alpm_list_t *j;
pmgrp_t *grp = NULL; alpm_group_t *grp = NULL;
int found = 0; int found = 0;
/* first look through the group cache for a group with this name */ /* first look through the group cache for a group with this name */
@ -663,7 +663,7 @@ alpm_list_t *_alpm_db_get_grpcache(alpm_db_t *db)
return db->grpcache; return db->grpcache;
} }
pmgrp_t *_alpm_db_get_grpfromcache(alpm_db_t *db, const char *target) alpm_group_t *_alpm_db_get_grpfromcache(alpm_db_t *db, const char *target)
{ {
alpm_list_t *i; alpm_list_t *i;
@ -672,7 +672,7 @@ pmgrp_t *_alpm_db_get_grpfromcache(alpm_db_t *db, const char *target)
} }
for(i = _alpm_db_get_grpcache(db); i; i = i->next) { for(i = _alpm_db_get_grpcache(db); i; i = i->next) {
pmgrp_t *info = i->data; alpm_group_t *info = i->data;
if(strcmp(info->name, target) == 0) { if(strcmp(info->name, target) == 0) {
return info; return info;

View file

@ -104,7 +104,7 @@ alpm_pkg_t *_alpm_db_get_pkgfromcache(alpm_db_t *db, const char *target);
/* groups */ /* groups */
void _alpm_db_free_grpcache(alpm_db_t *db); 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_grpcache(alpm_db_t *db);
pmgrp_t *_alpm_db_get_grpfromcache(alpm_db_t *db, const char *target); alpm_group_t *_alpm_db_get_grpfromcache(alpm_db_t *db, const char *target);
#endif /* _ALPM_DB_H */ #endif /* _ALPM_DB_H */

View file

@ -30,17 +30,17 @@
#include "log.h" #include "log.h"
#include "alpm.h" #include "alpm.h"
pmgrp_t *_alpm_grp_new(const char *name) alpm_group_t *_alpm_grp_new(const char *name)
{ {
pmgrp_t* grp; alpm_group_t* grp;
CALLOC(grp, 1, sizeof(pmgrp_t), return NULL); CALLOC(grp, 1, sizeof(alpm_group_t), return NULL);
STRDUP(grp->name, name, free(grp); return NULL); STRDUP(grp->name, name, free(grp); return NULL);
return grp; return grp;
} }
void _alpm_grp_free(pmgrp_t *grp) void _alpm_grp_free(alpm_group_t *grp)
{ {
if(grp == NULL) { if(grp == NULL) {
return; return;

View file

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

View file

@ -220,7 +220,7 @@ alpm_list_t SYMEXPORT *alpm_find_grp_pkgs(alpm_list_t *dbs,
for(i = dbs; i; i = i->next) { for(i = dbs; i; i = i->next) {
alpm_db_t *db = i->data; alpm_db_t *db = i->data;
pmgrp_t *grp = alpm_db_readgrp(db, name); alpm_group_t *grp = alpm_db_readgrp(db, name);
if(!grp) if(!grp)
continue; continue;

View file

@ -303,7 +303,7 @@ static int query_group(alpm_list_t *targets)
if(targets == NULL) { if(targets == NULL) {
for(j = alpm_db_get_grpcache(db_local); j; j = alpm_list_next(j)) { for(j = alpm_db_get_grpcache(db_local); j; j = alpm_list_next(j)) {
pmgrp_t *grp = alpm_list_getdata(j); alpm_group_t *grp = alpm_list_getdata(j);
const alpm_list_t *p; const alpm_list_t *p;
for(p = grp->packages; p; p = alpm_list_next(p)) { for(p = grp->packages; p; p = alpm_list_next(p)) {
@ -313,7 +313,7 @@ static int query_group(alpm_list_t *targets)
} }
} else { } else {
for(i = targets; i; i = alpm_list_next(i)) { for(i = targets; i; i = alpm_list_next(i)) {
pmgrp_t *grp; alpm_group_t *grp;
grpname = alpm_list_getdata(i); grpname = alpm_list_getdata(i);
grp = alpm_db_readgrp(db_local, grpname); grp = alpm_db_readgrp(db_local, grpname);
if(grp) { if(grp) {

View file

@ -47,7 +47,7 @@ static int remove_target(const char *target)
} }
/* fallback to group */ /* fallback to group */
pmgrp_t *grp = alpm_db_readgrp(db_local, target); alpm_group_t *grp = alpm_db_readgrp(db_local, target);
if(grp == NULL) { if(grp == NULL) {
pm_fprintf(stderr, PM_LOG_ERROR, "'%s': target not found\n", target); pm_fprintf(stderr, PM_LOG_ERROR, "'%s': target not found\n", target);
return -1; 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); const char *grpname = alpm_list_getdata(i);
for(j = syncs; j; j = alpm_list_next(j)) { for(j = syncs; j; j = alpm_list_next(j)) {
alpm_db_t *db = alpm_list_getdata(j); alpm_db_t *db = alpm_list_getdata(j);
pmgrp_t *grp = alpm_db_readgrp(db, grpname); alpm_group_t *grp = alpm_db_readgrp(db, grpname);
if(grp) { if(grp) {
/* get names of packages in group */ /* get names of packages in group */
@ -418,7 +418,7 @@ static int sync_group(int level, alpm_list_t *syncs, alpm_list_t *targets)
alpm_db_t *db = alpm_list_getdata(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_grpcache(db); j; j = alpm_list_next(j)) {
pmgrp_t *grp = alpm_list_getdata(j); alpm_group_t *grp = alpm_list_getdata(j);
if(level > 1) { if(level > 1) {
for(k = grp->packages; k; k = alpm_list_next(k)) { for(k = grp->packages; k; k = alpm_list_next(k)) {