diff options
author | Timo Teräs <timo.teras@iki.fi> | 2012-02-29 11:26:12 +0200 |
---|---|---|
committer | Timo Teräs <timo.teras@iki.fi> | 2012-02-29 11:26:12 +0200 |
commit | 2f66295fc7ca65e5706b647971559aaddb5dfa55 (patch) | |
tree | 4e12e858065df56f76058600125ee4128c2f5353 /src/apk_database.h | |
parent | 15adb0475f49d461b21f4826f9f0e1a1b8562205 (diff) | |
download | apk-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_database.h')
-rw-r--r-- | src/apk_database.h | 22 |
1 files changed, 9 insertions, 13 deletions
diff --git a/src/apk_database.h b/src/apk_database.h index 137063b..7b1d20d 100644 --- a/src/apk_database.h +++ b/src/apk_database.h @@ -18,6 +18,9 @@ #include "apk_package.h" #include "apk_io.h" +#include "apk_provider_data.h" +#include "apk_solver_data.h" + extern const char * const apk_index_gz; extern const char * const apkindex_tar_gz; @@ -78,25 +81,18 @@ struct apk_db_dir_instance { gid_t gid; }; -#define PROVIDER_FMT "%s%s"BLOB_FMT -#define PROVIDER_PRINTF(n,p) (n)->name, (p)->version->len ? "-" : "", BLOB_PRINTF(*(p)->version) - -struct apk_provider { - struct apk_package *pkg; - apk_blob_t *version; -}; -APK_ARRAY(apk_provider_array, struct apk_provider); - struct apk_name { apk_hash_node hash_node; - union { - int state_int; - void *state_ptr; - }; char *name; struct apk_provider_array *providers; struct apk_name_array *rdepends; struct apk_name_array *rinstall_if; + + union { + struct apk_solver_name_state ss; + void *state_ptr; + int state_int; + }; }; struct apk_repository { |