diff options
author | Timo Teräs <timo.teras@iki.fi> | 2019-12-13 15:22:33 +0200 |
---|---|---|
committer | Timo Teräs <timo.teras@iki.fi> | 2020-02-28 23:18:52 +0200 |
commit | 9530fbfa044bedf5821ff5ffffb7d4f3994f603f (patch) | |
tree | a54a0dcc1eff93429c822fcb89dfaccb73ab6285 /src/blob.c | |
parent | c054fbc11e9beca0d45285c3e1f448c81416c5ce (diff) | |
download | apk-tools-v3.0-wip.tar.bz2 apk-tools-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.c | 7 |
1 files changed, 7 insertions, 0 deletions
@@ -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; |