summaryrefslogtreecommitdiff
path: root/src/apk_package.h
diff options
context:
space:
mode:
authorTimo Teräs <timo.teras@iki.fi>2010-12-14 19:51:16 +0200
committerTimo Teräs <timo.teras@iki.fi>2010-12-14 19:51:16 +0200
commit972bec32101fb6d03f82fdf1f3be6106097fbf37 (patch)
tree532e989e0b13f2d0659426b3f385265240efc524 /src/apk_package.h
parentfca1c30b801537ce35c1e4aa50331ae52c9bf567 (diff)
downloadapk-tools-972bec32101fb6d03f82fdf1f3be6106097fbf37.tar.gz
apk-tools-972bec32101fb6d03f82fdf1f3be6106097fbf37.tar.bz2
apk-tools-972bec32101fb6d03f82fdf1f3be6106097fbf37.tar.xz
apk-tools-972bec32101fb6d03f82fdf1f3be6106097fbf37.zip
various: use 'atoms' for certain package field and misc fixes
- implement a hash table for commonly shared fields such as license, version and architecture - use macroes to print blobs or pkgname-pkgver strings - fix some old cruft
Diffstat (limited to 'src/apk_package.h')
-rw-r--r--src/apk_package.h15
1 files changed, 9 insertions, 6 deletions
diff --git a/src/apk_package.h b/src/apk_package.h
index 8ba1ffe..0b0d317 100644
--- a/src/apk_package.h
+++ b/src/apk_package.h
@@ -63,8 +63,8 @@ struct apk_sign_ctx {
struct apk_dependency {
struct apk_name *name;
+ apk_blob_t *version;
int result_mask;
- char *version;
};
APK_ARRAY(apk_dependency_array, struct apk_dependency);
@@ -83,18 +83,21 @@ struct apk_installed_package {
struct apk_package {
apk_hash_node hash_node;
- unsigned repos;
struct apk_name *name;
- char *version, *arch;
- char *url, *description, *license;
+ struct apk_installed_package *ipkg;
+ apk_blob_t *version, *arch, *license;
+ char *url, *description;
+ char *filename;
struct apk_dependency_array *depends;
size_t installed_size, size;
- char *filename;
+ unsigned repos;
struct apk_checksum csum;
- struct apk_installed_package *ipkg;
};
APK_ARRAY(apk_package_array, struct apk_package *);
+#define PKG_VER_FMT "%s-" BLOB_FMT
+#define PKG_VER_PRINTF(pkg) pkg->name->name, BLOB_PRINTF(*pkg->version)
+
extern const char *apk_script_types[];
void apk_sign_ctx_init(struct apk_sign_ctx *ctx, int action,