summaryrefslogtreecommitdiff
path: root/librazor
diff options
context:
space:
mode:
authorKristian Høgsberg <krh@redhat.com>2008-06-20 21:38:29 -0400
committerKristian Høgsberg <krh@redhat.com>2008-06-20 21:38:29 -0400
commit4d070f05b5e5616c238302e0e49877e7bff2c2fe (patch)
treee8c53033f7d550aecc5ae87dcf3be97ad5c1c276 /librazor
parentfbdf16df80f78f67aea0e3ce682507c90e49c81c (diff)
Fix the razor_set_diff() callback prototype.
The old proto type didn't let us pass the razor_package.
Diffstat (limited to 'librazor')
-rw-r--r--librazor/razor.c10
-rw-r--r--librazor/razor.h19
2 files changed, 19 insertions, 10 deletions
diff --git a/librazor/razor.c b/librazor/razor.c
index 210da4c..b27f49d 100644
--- a/librazor/razor.c
+++ b/librazor/razor.c
@@ -33,8 +33,8 @@
#include <ctype.h>
#include <fnmatch.h>
-#include "razor.h"
#include "razor-internal.h"
+#include "razor.h"
void *
zalloc(size_t size)
@@ -423,7 +423,7 @@ razor_set_list_package_files(struct razor_set *set, const char *name)
void
razor_set_diff(struct razor_set *set, struct razor_set *upstream,
- razor_package_callback_t callback, void *data)
+ razor_diff_callback_t callback, void *data)
{
struct razor_package_iterator *pi1, *pi2;
struct razor_package *p1, *p2;
@@ -446,9 +446,11 @@ razor_set_diff(struct razor_set *set, struct razor_set *upstream,
}
if (p2 == NULL || res < 0)
- callback(name1, version1, NULL, arch1, data);
+ callback(RAZOR_DIFF_ACTION_REMOVE,
+ p1, name1, version1, arch1, data);
else if (p1 == NULL || res > 0)
- callback(name2, NULL, version2, arch2, data);
+ callback(RAZOR_DIFF_ACTION_ADD,
+ p2, name2, version2, arch2, data);
if (p1 != NULL && res <= 0)
razor_package_iterator_next(pi1, &p1,
diff --git a/librazor/razor.h b/librazor/razor.h
index 8e69f1d..dfe17d8 100644
--- a/librazor/razor.h
+++ b/librazor/razor.h
@@ -106,14 +106,21 @@ void razor_set_list_package_files(struct razor_set *set, const char *name);
void razor_set_list_unsatisfied(struct razor_set *set);
-typedef void (*razor_package_callback_t)(const char *name,
- const char *old_version,
- const char *new_version,
- const char *arch,
- void *data);
+enum razor_diff_action {
+ RAZOR_DIFF_ACTION_ADD,
+ RAZOR_DIFF_ACTION_REMOVE,
+};
+
+typedef void (*razor_diff_callback_t)(enum razor_diff_action action,
+ struct razor_package *package,
+ const char *name,
+ const char *version,
+ const char *arch,
+ void *data);
+
void
razor_set_diff(struct razor_set *set, struct razor_set *upstream,
- razor_package_callback_t callback, void *data);
+ razor_diff_callback_t callback, void *data);
/* Package transactions */