summaryrefslogtreecommitdiff
path: root/src/apk_solver.h
diff options
context:
space:
mode:
authorTimo Teräs <timo.teras@iki.fi>2013-06-11 14:06:06 +0300
committerTimo Teräs <timo.teras@iki.fi>2013-06-13 18:22:00 +0300
commitb8c44536ca911418fee1c9ab4eecbb913a1ca852 (patch)
treea89e68b12f4d3daf089c475beeb71c53ffb8cc3a /src/apk_solver.h
parentf292a858677ae0e1af8910ffbd4b338f4b36c18b (diff)
downloadapk-tools-b8c44536ca911418fee1c9ab4eecbb913a1ca852.tar.gz
apk-tools-b8c44536ca911418fee1c9ab4eecbb913a1ca852.tar.bz2
apk-tools-b8c44536ca911418fee1c9ab4eecbb913a1ca852.tar.xz
apk-tools-b8c44536ca911418fee1c9ab4eecbb913a1ca852.zip
solver: rewrite as deductive solver -- core features
Implementing basic dependency handling, install_if and awareness of pinning.
Diffstat (limited to 'src/apk_solver.h')
-rw-r--r--src/apk_solver.h29
1 files changed, 12 insertions, 17 deletions
diff --git a/src/apk_solver.h b/src/apk_solver.h
index c839f7b..15620e9 100644
--- a/src/apk_solver.h
+++ b/src/apk_solver.h
@@ -1,7 +1,7 @@
/* apk_solver.h - Alpine Package Keeper (APK)
*
* Copyright (C) 2005-2008 Natanael Copa <n@tanael.org>
- * Copyright (C) 2008-2011 Timo Teräs <timo.teras@iki.fi>
+ * Copyright (C) 2008-2013 Timo Teräs <timo.teras@iki.fi>
* All rights reserved.
*
* This program is free software; you can redistribute it and/or modify it
@@ -15,22 +15,18 @@
struct apk_name;
struct apk_package;
-struct apk_solution_entry {
- struct apk_package *pkg;
- unsigned short repository_tag : 15;
- unsigned reinstall : 1;
-};
-APK_ARRAY(apk_solution_array, struct apk_solution_entry);
-
struct apk_change {
- struct apk_package *oldpkg;
- struct apk_package *newpkg;
- unsigned short repository_tag : 15;
+ struct apk_package *old_pkg;
+ struct apk_package *new_pkg;
+ unsigned old_repository_tag : 15;
+ unsigned new_repository_tag : 15;
unsigned reinstall : 1;
};
APK_ARRAY(apk_change_array, struct apk_change);
struct apk_changeset {
+ int num_install, num_remove, num_adjust;
+ int num_total_changes;
struct apk_change_array *changes;
};
@@ -44,17 +40,16 @@ void apk_solver_set_name_flags(struct apk_name *name,
int apk_solver_solve(struct apk_database *db,
unsigned short solver_flags,
struct apk_dependency_array *world,
- struct apk_solution_array **solution,
struct apk_changeset *changeset);
+
int apk_solver_commit_changeset(struct apk_database *db,
struct apk_changeset *changeset,
struct apk_dependency_array *world);
void apk_solver_print_errors(struct apk_database *db,
- struct apk_solution_array *solution,
- struct apk_dependency_array *world,
- int unsatisfiable);
-int apk_solver_commit(struct apk_database *db,
- unsigned short solver_flags,
+ struct apk_changeset *changeset,
+ struct apk_dependency_array *world);
+
+int apk_solver_commit(struct apk_database *db, unsigned short solver_flags,
struct apk_dependency_array *world);
#endif