diff options
author | Timo Teräs <timo.teras@iki.fi> | 2010-12-14 19:51:16 +0200 |
---|---|---|
committer | Timo Teräs <timo.teras@iki.fi> | 2010-12-14 19:51:16 +0200 |
commit | 972bec32101fb6d03f82fdf1f3be6106097fbf37 (patch) | |
tree | 532e989e0b13f2d0659426b3f385265240efc524 /src/apk_blob.h | |
parent | fca1c30b801537ce35c1e4aa50331ae52c9bf567 (diff) | |
download | aports-972bec32101fb6d03f82fdf1f3be6106097fbf37.tar.bz2 aports-972bec32101fb6d03f82fdf1f3be6106097fbf37.tar.xz |
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_blob.h')
-rw-r--r-- | src/apk_blob.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/apk_blob.h b/src/apk_blob.h index 877635cd34..f1c3a3546a 100644 --- a/src/apk_blob.h +++ b/src/apk_blob.h @@ -24,6 +24,9 @@ struct apk_blob { typedef struct apk_blob apk_blob_t; typedef int (*apk_blob_cb)(void *ctx, apk_blob_t blob); +#define BLOB_FMT "%.*s" +#define BLOB_PRINTF(b) (int)(b).len, (b).ptr + #define APK_CHECKSUM_NONE 0 #define APK_CHECKSUM_MD5 16 #define APK_CHECKSUM_SHA1 20 @@ -114,4 +117,8 @@ struct apk_indent { void apk_print_indented_words(struct apk_indent *i, const char *text); int apk_print_indented(struct apk_indent *i, apk_blob_t blob); +void apk_atom_init(void); +apk_blob_t *apk_blob_atomize(apk_blob_t blob); +apk_blob_t *apk_blob_atomize_dup(apk_blob_t blob); + #endif |