summaryrefslogtreecommitdiff
path: root/src/apk_solver_data.h
diff options
context:
space:
mode:
authorTimo Teräs <timo.teras@iki.fi>2012-02-29 11:26:12 +0200
committerTimo Teräs <timo.teras@iki.fi>2012-02-29 11:26:12 +0200
commit2f66295fc7ca65e5706b647971559aaddb5dfa55 (patch)
tree4e12e858065df56f76058600125ee4128c2f5353 /src/apk_solver_data.h
parent15adb0475f49d461b21f4826f9f0e1a1b8562205 (diff)
downloadapk-tools-2f66295fc7ca65e5706b647971559aaddb5dfa55.tar.gz
apk-tools-2f66295fc7ca65e5706b647971559aaddb5dfa55.tar.bz2
apk-tools-2f66295fc7ca65e5706b647971559aaddb5dfa55.tar.xz
apk-tools-2f66295fc7ca65e5706b647971559aaddb5dfa55.zip
solver: merge apk_name_state to apk_name
apk_name_state is now quite small; and we avoid overhead of two pointers (+ malloc overhead) when we just make it part of apk_name. It also fixes some problems (that got introduced) where apk_name_state was not allocated.
Diffstat (limited to 'src/apk_solver_data.h')
-rw-r--r--src/apk_solver_data.h45
1 files changed, 45 insertions, 0 deletions
diff --git a/src/apk_solver_data.h b/src/apk_solver_data.h
new file mode 100644
index 0000000..fd79e65
--- /dev/null
+++ b/src/apk_solver_data.h
@@ -0,0 +1,45 @@
+/* apk_solver_data.h - Alpine Package Keeper (APK)
+ *
+ * Copyright (C) 2005-2008 Natanael Copa <n@tanael.org>
+ * Copyright (C) 2008-2012 Timo Teräs <timo.teras@iki.fi>
+ * All rights reserved.
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 as published
+ * by the Free Software Foundation. See http://www.gnu.org/ for details.
+ */
+
+#ifndef APK_SOLVER_DATA_H
+#define APK_SOLVER_DATA_H
+
+#include "apk_defines.h"
+#include "apk_provider_data.h"
+
+struct apk_solver_name_state {
+ /* dynamic */
+ struct list_head unsolved_list;
+ struct apk_provider chosen;
+
+ unsigned int last_touched_decision;
+ unsigned short requirers;
+ unsigned short install_ifs;
+ unsigned short preferred_pinning;
+ unsigned short locked;
+
+ /* one time prepare/finish flags */
+ unsigned solver_flags_local : 4;
+ unsigned solver_flags_inheritable : 4;
+
+ unsigned decision_counted : 1;
+ unsigned originally_installed : 1;
+ unsigned has_available_pkgs : 1;
+ unsigned in_changeset : 1;
+ unsigned in_world_dependency : 1;
+
+ /* dynamic state flags */
+ unsigned none_excluded : 1;
+ unsigned name_touched : 1;
+ unsigned preferred_chosen : 1;
+};
+
+#endif