summaryrefslogtreecommitdiff
path: root/src/apk_defines.h
diff options
context:
space:
mode:
authorTimo Teräs <timo.teras@iki.fi>2012-02-18 11:54:17 +0200
committerTimo Teräs <timo.teras@iki.fi>2012-02-20 13:02:09 +0200
commit6ae573887df6722a94ba589a7ee1675e7ea573d6 (patch)
tree5f563a8e10a1692ecf4120289e6f51787e9e1ba5 /src/apk_defines.h
parenta9d526836e1160b2233bf26a2d1dd6584dec5dd4 (diff)
downloadapk-tools-6ae573887df6722a94ba589a7ee1675e7ea573d6.tar.gz
apk-tools-6ae573887df6722a94ba589a7ee1675e7ea573d6.tar.bz2
apk-tools-6ae573887df6722a94ba589a7ee1675e7ea573d6.tar.xz
apk-tools-6ae573887df6722a94ba589a7ee1675e7ea573d6.zip
solver: rewrite backtracking and scoring system
* properly do absolute scoring now, the previous scoring where preference could get reduced could have caused incorrect early pruning of search tree * backtracking is now separated from package state, and first branching point is the decision if a name is left unassigned or if something _has_ to be assigned. this allows multiple future search tree optimizations like handling of common dependencies early. * merge common dependency names early to provide deeper forward checking.
Diffstat (limited to 'src/apk_defines.h')
-rw-r--r--src/apk_defines.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/apk_defines.h b/src/apk_defines.h
index 3c72c73..2ef0c3b 100644
--- a/src/apk_defines.h
+++ b/src/apk_defines.h
@@ -257,6 +257,11 @@ static inline int list_hashed(const struct list_head *n)
return n->next != n && n->next != NULL;
}
+static inline int list_empty(const struct list_head *n)
+{
+ return n->next == n;
+}
+
#define list_entry(ptr, type, member) container_of(ptr,type,member)
#define list_for_each(pos, head) \