New _alpm_conflict_dup function
Added function to cleanly duplicate a conflict. Signed-off-by: Nagy Gabor <ngaba@bibl.u-szeged.hu> Signed-off-by: Chantry Xavier <shiningxc@gmail.com>
This commit is contained in:
parent
f432ce41e0
commit
ea828b5693
|
@ -62,6 +62,17 @@ void _alpm_conflict_free(pmconflict_t *conflict)
|
||||||
FREE(conflict);
|
FREE(conflict);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pmconflict_t *_alpm_conflict_dup(const pmconflict_t *conflict)
|
||||||
|
{
|
||||||
|
pmconflict_t *newconflict;
|
||||||
|
CALLOC(newconflict, 1, sizeof(pmconflict_t), RET_ERR(PM_ERR_MEMORY, NULL));
|
||||||
|
|
||||||
|
STRDUP(newconflict->package1, conflict->package1, RET_ERR(PM_ERR_MEMORY, NULL));
|
||||||
|
STRDUP(newconflict->package2, conflict->package2, RET_ERR(PM_ERR_MEMORY, NULL));
|
||||||
|
|
||||||
|
return(newconflict);
|
||||||
|
}
|
||||||
|
|
||||||
int _alpm_conflict_isin(pmconflict_t *needle, alpm_list_t *haystack)
|
int _alpm_conflict_isin(pmconflict_t *needle, alpm_list_t *haystack)
|
||||||
{
|
{
|
||||||
alpm_list_t *i;
|
alpm_list_t *i;
|
||||||
|
|
|
@ -36,6 +36,7 @@ struct __pmfileconflict_t {
|
||||||
};
|
};
|
||||||
|
|
||||||
pmconflict_t *_alpm_conflict_new(const char *package1, const char *package2);
|
pmconflict_t *_alpm_conflict_new(const char *package1, const char *package2);
|
||||||
|
pmconflict_t *_alpm_conflict_dup(const pmconflict_t *conflict);
|
||||||
void _alpm_conflict_free(pmconflict_t *conflict);
|
void _alpm_conflict_free(pmconflict_t *conflict);
|
||||||
int _alpm_conflict_isin(pmconflict_t *needle, alpm_list_t *haystack);
|
int _alpm_conflict_isin(pmconflict_t *needle, alpm_list_t *haystack);
|
||||||
alpm_list_t *_alpm_innerconflicts(alpm_list_t *packages);
|
alpm_list_t *_alpm_innerconflicts(alpm_list_t *packages);
|
||||||
|
|
Loading…
Reference in New Issue