aboutsummaryrefslogtreecommitdiffstats
path: root/src/blob.c
diff options
context:
space:
mode:
authorTimo Teräs <timo.teras@iki.fi>2019-12-13 15:22:33 +0200
committerTimo Teräs <timo.teras@iki.fi>2020-04-01 15:58:49 +0300
commite79226010a0641f701b6e12392e176cc2cf58d72 (patch)
treedec5311a1fc0cfb837b4af4038cab7bdedc2bb4c /src/blob.c
parentd6c54f932054c58aee8f7a6d2bd49b115d804da1 (diff)
downloadaports-v3.0-wip.tar.bz2
aports-v3.0-wip.tar.xz
adb: introduce apk-tools database format, and few appletsv3.0-wip
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/blob.c')
-rw-r--r--src/blob.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/blob.c b/src/blob.c
index 69d6d0e21b..dd0aa03523 100644
--- a/src/blob.c
+++ b/src/blob.c
@@ -263,6 +263,13 @@ int apk_blob_compare(apk_blob_t a, apk_blob_t b)
return 1;
}
+int apk_blob_sort(apk_blob_t a, apk_blob_t b)
+{
+ int s = memcmp(a.ptr, b.ptr, min(a.len, b.len));
+ if (s != 0) return s;
+ return a.len - b.len;
+}
+
int apk_blob_ends_with(apk_blob_t a, apk_blob_t b)
{
if (a.len < b.len) return 0;