summaryrefslogtreecommitdiff
path: root/src/apk_package.h
diff options
context:
space:
mode:
authorTimo Teräs <timo.teras@iki.fi>2013-06-13 20:48:38 +0300
committerTimo Teräs <timo.teras@iki.fi>2013-06-13 20:48:38 +0300
commitbcda66bf0862ec7e06b6a4133e16405c236fccea (patch)
tree50ab593db9fcc90a74def4aa410359f077f5d165 /src/apk_package.h
parente51232e710dfd32764e2c2d0599df83ab85a9c74 (diff)
downloadapk-tools-bcda66bf0862ec7e06b6a4133e16405c236fccea.tar.gz
apk-tools-bcda66bf0862ec7e06b6a4133e16405c236fccea.tar.bz2
apk-tools-bcda66bf0862ec7e06b6a4133e16405c236fccea.tar.xz
apk-tools-bcda66bf0862ec7e06b6a4133e16405c236fccea.zip
pkg: add global reverse dependency iterator helpers and use them
... in the error printing and the package deletion.
Diffstat (limited to 'src/apk_package.h')
-rw-r--r--src/apk_package.h26
1 files changed, 21 insertions, 5 deletions
diff --git a/src/apk_package.h b/src/apk_package.h
index 44e463c..3d6ee29 100644
--- a/src/apk_package.h
+++ b/src/apk_package.h
@@ -37,9 +37,11 @@ struct apk_provider;
#define APK_SIGN_GENERATE 4
#define APK_SIGN_VERIFY_AND_GENERATE 5
-#define APK_DEP_IRRELEVANT 0
-#define APK_DEP_SATISFIED 1
-#define APK_DEP_CONFLICTED 2
+#define APK_DEP_IRRELEVANT 0x00001
+#define APK_DEP_SATISFIES 0x00002
+#define APK_DEP_CONFLICTS 0x00004
+#define APK_FOREACH_INSTALLED 0x10000
+#define APK_FOREACH_MARKED 0x20000
struct apk_sign_ctx {
int keys_fd;
@@ -92,8 +94,13 @@ struct apk_package {
apk_hash_node hash_node;
union {
struct apk_solver_package_state ss;
- int state_int;
- void *state_ptr;
+ struct {
+ int marked;
+ union {
+ int state_int;
+ void *state_ptr;
+ };
+ };
};
struct apk_name *name;
struct apk_installed_package *ipkg;
@@ -179,4 +186,13 @@ int apk_pkg_write_index_entry(struct apk_package *pkg, struct apk_ostream *os);
int apk_pkg_version_compare(struct apk_package *a, struct apk_package *b);
+void apk_pkg_foreach_matching_dependency(
+ struct apk_package *pkg, struct apk_dependency_array *deps, int match, struct apk_package *mpkg,
+ void cb(struct apk_package *pkg0, struct apk_dependency *dep0, struct apk_package *pkg, void *ctx),
+ void *ctx);
+void apk_pkg_foreach_reverse_dependency(
+ struct apk_package *pkg, int match,
+ void cb(struct apk_package *pkg0, struct apk_dependency *dep0, struct apk_package *pkg, void *ctx),
+ void *ctx);
+
#endif