summaryrefslogtreecommitdiff
path: root/src/blob.c
diff options
context:
space:
mode:
authorTimo Teräs <timo.teras@iki.fi>2021-06-02 22:35:58 +0300
committerTimo Teräs <timo.teras@iki.fi>2021-06-02 22:35:58 +0300
commit1456296b43462cce0de55049b653c5225e7feac5 (patch)
tree3099b1f36b0199068e07620a24205c4830f8d567 /src/blob.c
parent209201bc5d400b68d71af0830efe9085c3648665 (diff)
downloadapk-tools-1456296b43462cce0de55049b653c5225e7feac5.tar.gz
apk-tools-1456296b43462cce0de55049b653c5225e7feac5.tar.bz2
apk-tools-1456296b43462cce0de55049b653c5225e7feac5.tar.xz
apk-tools-1456296b43462cce0de55049b653c5225e7feac5.zip
add adbgen applet to generate databases from it's text dump
Diffstat (limited to 'src/blob.c')
-rw-r--r--src/blob.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/blob.c b/src/blob.c
index aa7ca83..32cd92e 100644
--- a/src/blob.c
+++ b/src/blob.c
@@ -263,6 +263,12 @@ int apk_blob_sort(apk_blob_t a, apk_blob_t b)
return a.len - b.len;
}
+int apk_blob_starts_with(apk_blob_t a, apk_blob_t b)
+{
+ if (a.len < b.len) return 0;
+ return memcmp(a.ptr, b.ptr, b.len) == 0;
+}
+
int apk_blob_ends_with(apk_blob_t a, apk_blob_t b)
{
if (a.len < b.len) return 0;