Rename pmconflict_t to alpm_conflict_t

Signed-off-by: Allan McRae <allan@archlinux.org>
This commit is contained in:
Allan McRae 2011-06-28 14:33:55 +10:00
parent 6d876f9b6b
commit 220842b37b
7 changed files with 22 additions and 22 deletions

View file

@ -122,11 +122,11 @@ typedef struct _alpm_depmissing_t {
} alpm_depmissing_t; } alpm_depmissing_t;
/** Conflict */ /** Conflict */
typedef struct _pmconflict_t { typedef struct _alpm_conflict_t {
char *package1; char *package1;
char *package2; char *package2;
char *reason; char *reason;
} pmconflict_t; } alpm_conflict_t;
/** File conflict */ /** File conflict */
typedef struct _pmfileconflict_t { typedef struct _pmfileconflict_t {

View file

@ -40,12 +40,12 @@
#include "log.h" #include "log.h"
#include "deps.h" #include "deps.h"
static pmconflict_t *conflict_new(const char *package1, const char *package2, static alpm_conflict_t *conflict_new(const char *package1, const char *package2,
const char *reason) const char *reason)
{ {
pmconflict_t *conflict; alpm_conflict_t *conflict;
MALLOC(conflict, sizeof(pmconflict_t), return NULL); MALLOC(conflict, sizeof(alpm_conflict_t), return NULL);
STRDUP(conflict->package1, package1, return NULL); STRDUP(conflict->package1, package1, return NULL);
STRDUP(conflict->package2, package2, return NULL); STRDUP(conflict->package2, package2, return NULL);
@ -54,7 +54,7 @@ static pmconflict_t *conflict_new(const char *package1, const char *package2,
return conflict; return conflict;
} }
void _alpm_conflict_free(pmconflict_t *conflict) void _alpm_conflict_free(alpm_conflict_t *conflict)
{ {
FREE(conflict->package2); FREE(conflict->package2);
FREE(conflict->package1); FREE(conflict->package1);
@ -62,10 +62,10 @@ void _alpm_conflict_free(pmconflict_t *conflict)
FREE(conflict); FREE(conflict);
} }
pmconflict_t *_alpm_conflict_dup(const pmconflict_t *conflict) alpm_conflict_t *_alpm_conflict_dup(const alpm_conflict_t *conflict)
{ {
pmconflict_t *newconflict; alpm_conflict_t *newconflict;
CALLOC(newconflict, 1, sizeof(pmconflict_t), ); CALLOC(newconflict, 1, sizeof(alpm_conflict_t), );
STRDUP(newconflict->package1, conflict->package1, return NULL); STRDUP(newconflict->package1, conflict->package1, return NULL);
STRDUP(newconflict->package2, conflict->package2, return NULL); STRDUP(newconflict->package2, conflict->package2, return NULL);
@ -74,14 +74,14 @@ pmconflict_t *_alpm_conflict_dup(const pmconflict_t *conflict)
return newconflict; return newconflict;
} }
static int conflict_isin(pmconflict_t *needle, alpm_list_t *haystack) static int conflict_isin(alpm_conflict_t *needle, alpm_list_t *haystack)
{ {
alpm_list_t *i; alpm_list_t *i;
const char *npkg1 = needle->package1; const char *npkg1 = needle->package1;
const char *npkg2 = needle->package2; const char *npkg2 = needle->package2;
for(i = haystack; i; i = i->next) { for(i = haystack; i; i = i->next) {
pmconflict_t *conflict = i->data; alpm_conflict_t *conflict = i->data;
const char *cpkg1 = conflict->package1; const char *cpkg1 = conflict->package1;
const char *cpkg2 = conflict->package2; const char *cpkg2 = conflict->package2;
if((strcmp(cpkg1, npkg1) == 0 && strcmp(cpkg2, npkg2) == 0) if((strcmp(cpkg1, npkg1) == 0 && strcmp(cpkg2, npkg2) == 0)
@ -103,7 +103,7 @@ static int conflict_isin(pmconflict_t *needle, alpm_list_t *haystack)
static int add_conflict(alpm_handle_t *handle, alpm_list_t **baddeps, static int add_conflict(alpm_handle_t *handle, alpm_list_t **baddeps,
const char *pkg1, const char *pkg2, const char *reason) const char *pkg1, const char *pkg2, const char *reason)
{ {
pmconflict_t *conflict = conflict_new(pkg1, pkg2, reason); alpm_conflict_t *conflict = conflict_new(pkg1, pkg2, reason);
if(!conflict) { if(!conflict) {
return -1; return -1;
} }
@ -209,7 +209,7 @@ alpm_list_t *_alpm_outerconflicts(alpm_db_t *db, alpm_list_t *packages)
* *
* @param handle the context handle * @param handle the context handle
* @param pkglist the list of packages to check * @param pkglist the list of packages to check
* @return an alpm_list_t of pmconflict_t * @return an alpm_list_t of alpm_conflict_t
*/ */
alpm_list_t SYMEXPORT *alpm_checkconflicts(alpm_handle_t *handle, alpm_list_t SYMEXPORT *alpm_checkconflicts(alpm_handle_t *handle,
alpm_list_t *pkglist) alpm_list_t *pkglist)

View file

@ -24,8 +24,8 @@
#include "db.h" #include "db.h"
#include "package.h" #include "package.h"
pmconflict_t *_alpm_conflict_dup(const pmconflict_t *conflict); alpm_conflict_t *_alpm_conflict_dup(const alpm_conflict_t *conflict);
void _alpm_conflict_free(pmconflict_t *conflict); void _alpm_conflict_free(alpm_conflict_t *conflict);
alpm_list_t *_alpm_innerconflicts(alpm_handle_t *handle, alpm_list_t *packages); alpm_list_t *_alpm_innerconflicts(alpm_handle_t *handle, alpm_list_t *packages);
alpm_list_t *_alpm_outerconflicts(alpm_db_t *db, alpm_list_t *packages); alpm_list_t *_alpm_outerconflicts(alpm_db_t *db, alpm_list_t *packages);
alpm_list_t *_alpm_db_find_fileconflicts(alpm_handle_t *handle, alpm_list_t *_alpm_db_find_fileconflicts(alpm_handle_t *handle,

View file

@ -405,7 +405,7 @@ int _alpm_sync_prepare(alpm_handle_t *handle, alpm_list_t **data)
deps = _alpm_innerconflicts(handle, trans->add); deps = _alpm_innerconflicts(handle, trans->add);
for(i = deps; i; i = i->next) { for(i = deps; i; i = i->next) {
pmconflict_t *conflict = i->data; alpm_conflict_t *conflict = i->data;
alpm_pkg_t *rsync, *sync, *sync1, *sync2; alpm_pkg_t *rsync, *sync, *sync1, *sync2;
/* have we already removed one of the conflicting targets? */ /* have we already removed one of the conflicting targets? */
@ -432,7 +432,7 @@ int _alpm_sync_prepare(alpm_handle_t *handle, alpm_list_t **data)
handle->pm_errno = PM_ERR_CONFLICTING_DEPS; handle->pm_errno = PM_ERR_CONFLICTING_DEPS;
ret = -1; ret = -1;
if(data) { if(data) {
pmconflict_t *newconflict = _alpm_conflict_dup(conflict); alpm_conflict_t *newconflict = _alpm_conflict_dup(conflict);
if(newconflict) { if(newconflict) {
*data = alpm_list_add(*data, newconflict); *data = alpm_list_add(*data, newconflict);
} }
@ -464,7 +464,7 @@ int _alpm_sync_prepare(alpm_handle_t *handle, alpm_list_t **data)
deps = _alpm_outerconflicts(handle->db_local, trans->add); deps = _alpm_outerconflicts(handle->db_local, trans->add);
for(i = deps; i; i = i->next) { for(i = deps; i; i = i->next) {
pmconflict_t *conflict = i->data; alpm_conflict_t *conflict = i->data;
/* if conflict->package2 (the local package) is not elected for removal, /* if conflict->package2 (the local package) is not elected for removal,
we ask the user */ we ask the user */
@ -496,7 +496,7 @@ int _alpm_sync_prepare(alpm_handle_t *handle, alpm_list_t **data)
handle->pm_errno = PM_ERR_CONFLICTING_DEPS; handle->pm_errno = PM_ERR_CONFLICTING_DEPS;
ret = -1; ret = -1;
if(data) { if(data) {
pmconflict_t *newconflict = _alpm_conflict_dup(conflict); alpm_conflict_t *newconflict = _alpm_conflict_dup(conflict);
if(newconflict) { if(newconflict) {
*data = alpm_list_add(*data, newconflict); *data = alpm_list_add(*data, newconflict);
} }

View file

@ -783,7 +783,7 @@ static int sync_trans(alpm_list_t *targets)
break; break;
case PM_ERR_CONFLICTING_DEPS: case PM_ERR_CONFLICTING_DEPS:
for(i = data; i; i = alpm_list_next(i)) { for(i = data; i; i = alpm_list_next(i)) {
pmconflict_t *conflict = alpm_list_getdata(i); alpm_conflict_t *conflict = alpm_list_getdata(i);
/* only print reason if it contains new information */ /* only print reason if it contains new information */
if(strcmp(conflict->package1, conflict->reason) == 0 || if(strcmp(conflict->package1, conflict->reason) == 0 ||
strcmp(conflict->package2, conflict->reason) == 0) { strcmp(conflict->package2, conflict->reason) == 0) {

View file

@ -118,7 +118,7 @@ int pacman_upgrade(alpm_list_t *targets)
break; break;
case PM_ERR_CONFLICTING_DEPS: case PM_ERR_CONFLICTING_DEPS:
for(i = data; i; i = alpm_list_next(i)) { for(i = data; i; i = alpm_list_next(i)) {
pmconflict_t *conflict = alpm_list_getdata(i); alpm_conflict_t *conflict = alpm_list_getdata(i);
if(strcmp(conflict->package1, conflict->reason) == 0 || if(strcmp(conflict->package1, conflict->reason) == 0 ||
strcmp(conflict->package2, conflict->reason) == 0) { strcmp(conflict->package2, conflict->reason) == 0) {
printf(_(":: %s and %s are in conflict\n"), printf(_(":: %s and %s are in conflict\n"),

View file

@ -118,7 +118,7 @@ static int checkconflicts(alpm_list_t *pkglist)
/* check conflicts */ /* check conflicts */
data = alpm_checkconflicts(handle, pkglist); data = alpm_checkconflicts(handle, pkglist);
for(i = data; i; i = i->next) { for(i = data; i; i = i->next) {
pmconflict_t *conflict = alpm_list_getdata(i); alpm_conflict_t *conflict = alpm_list_getdata(i);
printf("%s conflicts with %s\n", printf("%s conflicts with %s\n",
conflict->package1, conflict->package2); conflict->package1, conflict->package2);
ret++; ret++;