summaryrefslogtreecommitdiff
path: root/src/apk_package.h
diff options
context:
space:
mode:
authorTimo Teräs <timo.teras@iki.fi>2013-06-15 20:39:05 +0300
committerTimo Teräs <timo.teras@iki.fi>2013-06-15 22:25:23 +0300
commitf79e3946a40bf6beb2a38050a866c0fb1ed4bcf4 (patch)
treee49fefbf64cc88b24db54fe726386fb4950bea8c /src/apk_package.h
parent5b02400b268e4e867a30cd76821ff7139502089e (diff)
downloadapk-tools-f79e3946a40bf6beb2a38050a866c0fb1ed4bcf4.tar.gz
apk-tools-f79e3946a40bf6beb2a38050a866c0fb1ed4bcf4.tar.bz2
apk-tools-f79e3946a40bf6beb2a38050a866c0fb1ed4bcf4.tar.xz
apk-tools-f79e3946a40bf6beb2a38050a866c0fb1ed4bcf4.zip
pkg: apk_pkg_foreach_* add matching generation
So same package it is possible to not match same package multiple times. Use generation count, so this is handled cleanly during recursion, like in the use case of search applet.
Diffstat (limited to 'src/apk_package.h')
-rw-r--r--src/apk_package.h20
1 files changed, 12 insertions, 8 deletions
diff --git a/src/apk_package.h b/src/apk_package.h
index b04bd79..979de5e 100644
--- a/src/apk_package.h
+++ b/src/apk_package.h
@@ -37,11 +37,12 @@ struct apk_provider;
#define APK_SIGN_GENERATE 4
#define APK_SIGN_VERIFY_AND_GENERATE 5
-#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
+#define APK_DEP_IRRELEVANT 0x01
+#define APK_DEP_SATISFIES 0x02
+#define APK_DEP_CONFLICTS 0x04
+#define APK_FOREACH_INSTALLED 0x10
+#define APK_FOREACH_MARKED 0x20
+#define APK_FOREACH_GENID_MASK 0xffffff00
struct apk_sign_ctx {
int keys_fd;
@@ -95,7 +96,8 @@ struct apk_package {
union {
struct apk_solver_package_state ss;
struct {
- int marked;
+ unsigned int marked;
+ unsigned int foreach_genid;
union {
int state_int;
void *state_ptr;
@@ -185,12 +187,14 @@ 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);
+unsigned int apk_foreach_genid(void);
void apk_pkg_foreach_matching_dependency(
- struct apk_package *pkg, struct apk_dependency_array *deps, int match, struct apk_package *mpkg,
+ struct apk_package *pkg, struct apk_dependency_array *deps,
+ unsigned 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,
+ struct apk_package *pkg, unsigned int match,
void cb(struct apk_package *pkg0, struct apk_dependency *dep0, struct apk_package *pkg, void *ctx),
void *ctx);