Rename pmgrp_t to alpm_group_t
Signed-off-by: Allan McRae <allan@archlinux.org>
This commit is contained in:
parent
37b6cceed4
commit
1fdbe79022
9 changed files with 20 additions and 20 deletions
|
@ -137,12 +137,12 @@ typedef struct _alpm_fileconflict_t {
|
|||
} alpm_fileconflict_t;
|
||||
|
||||
/** Package group */
|
||||
typedef struct _pmgrp_t {
|
||||
typedef struct _alpm_group_t {
|
||||
/** group name */
|
||||
char *name;
|
||||
/** list of alpm_pkg_t packages */
|
||||
alpm_list_t *packages;
|
||||
} pmgrp_t;
|
||||
} alpm_group_t;
|
||||
|
||||
/** Package upgrade delta */
|
||||
typedef struct _pmdelta_t {
|
||||
|
@ -411,7 +411,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
|
||||
*/
|
||||
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.
|
||||
* @param db pointer to the package database to get the group from
|
||||
|
|
|
@ -239,7 +239,7 @@ alpm_list_t SYMEXPORT *alpm_db_get_pkgcache(alpm_db_t *db)
|
|||
}
|
||||
|
||||
/** 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);
|
||||
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) {
|
||||
const char *grpname = i->data;
|
||||
alpm_list_t *j;
|
||||
pmgrp_t *grp = NULL;
|
||||
alpm_group_t *grp = NULL;
|
||||
int found = 0;
|
||||
|
||||
/* 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;
|
||||
}
|
||||
|
||||
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;
|
||||
|
||||
|
@ -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) {
|
||||
pmgrp_t *info = i->data;
|
||||
alpm_group_t *info = i->data;
|
||||
|
||||
if(strcmp(info->name, target) == 0) {
|
||||
return info;
|
||||
|
|
|
@ -104,7 +104,7 @@ 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);
|
||||
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 */
|
||||
|
||||
|
|
|
@ -30,17 +30,17 @@
|
|||
#include "log.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);
|
||||
|
||||
return grp;
|
||||
}
|
||||
|
||||
void _alpm_grp_free(pmgrp_t *grp)
|
||||
void _alpm_grp_free(alpm_group_t *grp)
|
||||
{
|
||||
if(grp == NULL) {
|
||||
return;
|
||||
|
|
|
@ -22,8 +22,8 @@
|
|||
|
||||
#include "alpm.h"
|
||||
|
||||
pmgrp_t *_alpm_grp_new(const char *name);
|
||||
void _alpm_grp_free(pmgrp_t *grp);
|
||||
alpm_group_t *_alpm_grp_new(const char *name);
|
||||
void _alpm_grp_free(alpm_group_t *grp);
|
||||
|
||||
#endif /* _ALPM_GROUP_H */
|
||||
|
||||
|
|
|
@ -220,7 +220,7 @@ alpm_list_t SYMEXPORT *alpm_find_grp_pkgs(alpm_list_t *dbs,
|
|||
|
||||
for(i = dbs; i; i = i->next) {
|
||||
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)
|
||||
continue;
|
||||
|
|
|
@ -303,7 +303,7 @@ static int query_group(alpm_list_t *targets)
|
|||
|
||||
if(targets == NULL) {
|
||||
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;
|
||||
|
||||
for(p = grp->packages; p; p = alpm_list_next(p)) {
|
||||
|
@ -313,7 +313,7 @@ static int query_group(alpm_list_t *targets)
|
|||
}
|
||||
} else {
|
||||
for(i = targets; i; i = alpm_list_next(i)) {
|
||||
pmgrp_t *grp;
|
||||
alpm_group_t *grp;
|
||||
grpname = alpm_list_getdata(i);
|
||||
grp = alpm_db_readgrp(db_local, grpname);
|
||||
if(grp) {
|
||||
|
|
|
@ -47,7 +47,7 @@ static int remove_target(const char *target)
|
|||
}
|
||||
|
||||
/* 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) {
|
||||
pm_fprintf(stderr, PM_LOG_ERROR, "'%s': target not found\n", target);
|
||||
return -1;
|
||||
|
|
|
@ -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);
|
||||
pmgrp_t *grp = alpm_db_readgrp(db, grpname);
|
||||
alpm_group_t *grp = alpm_db_readgrp(db, grpname);
|
||||
|
||||
if(grp) {
|
||||
/* 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);
|
||||
|
||||
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) {
|
||||
for(k = grp->packages; k; k = alpm_list_next(k)) {
|
||||
|
|
Loading…
Add table
Reference in a new issue