summaryrefslogtreecommitdiff
path: root/src/blob.c
diff options
context:
space:
mode:
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;