summaryrefslogtreecommitdiff
path: root/src/apk_blob.h
diff options
context:
space:
mode:
authorTimo Teräs <timo.teras@iki.fi>2020-09-30 14:11:37 +0300
committerTimo Teräs <timo.teras@iki.fi>2020-10-01 14:33:43 +0300
commit7ccda091c2c7cf18225b861962f952dc04a5295f (patch)
tree5556804d4fdf2721da18cde4552b5a9a4bd8c33f /src/apk_blob.h
parentc269e9c24da57ab1b69ad6c80e9a1cb52b2b67d2 (diff)
downloadapk-tools-7ccda091c2c7cf18225b861962f952dc04a5295f.tar.gz
apk-tools-7ccda091c2c7cf18225b861962f952dc04a5295f.tar.bz2
apk-tools-7ccda091c2c7cf18225b861962f952dc04a5295f.tar.xz
apk-tools-7ccda091c2c7cf18225b861962f952dc04a5295f.zip
adb: introduce apk-tools database format, and few applets
This is a flat buffers inspired format that allows fast mmaped access to the data with low overhead, signature support and relatively good forward support.
Diffstat (limited to 'src/apk_blob.h')
-rw-r--r--src/apk_blob.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/apk_blob.h b/src/apk_blob.h
index 008666e..9426721 100644
--- a/src/apk_blob.h
+++ b/src/apk_blob.h
@@ -68,6 +68,7 @@ static inline const EVP_MD *apk_checksum_default(void)
#define APK_BLOB_BUF(buf) ((apk_blob_t){sizeof(buf), (char *)(buf)})
#define APK_BLOB_CSUM(csum) ((apk_blob_t){(csum).type, (char *)(csum).data})
#define APK_BLOB_STRUCT(s) ((apk_blob_t){sizeof(s), (char*)&(s)})
+#define APK_BLOB_STRLIT(s) ((apk_blob_t){sizeof(s)-1, (char *)(s)})
#define APK_BLOB_PTR_LEN(beg,len) ((apk_blob_t){(len), (beg)})
#define APK_BLOB_PTR_PTR(beg,end) APK_BLOB_PTR_LEN((beg),(end)-(beg)+1)
@@ -95,6 +96,7 @@ apk_blob_t apk_blob_pushed(apk_blob_t buffer, apk_blob_t left);
unsigned long apk_blob_hash_seed(apk_blob_t, unsigned long seed);
unsigned long apk_blob_hash(apk_blob_t str);
int apk_blob_compare(apk_blob_t a, apk_blob_t b);
+int apk_blob_sort(apk_blob_t a, apk_blob_t b);
int apk_blob_ends_with(apk_blob_t str, apk_blob_t suffix);
int apk_blob_for_each_segment(apk_blob_t blob, const char *split,
apk_blob_cb cb, void *ctx);