summaryrefslogtreecommitdiffstats
path: root/src/apk_blob.h
diff options
context:
space:
mode:
authorTimo Teras <timo.teras@iki.fi>2009-07-14 13:27:21 +0300
committerTimo Teras <timo.teras@iki.fi>2009-07-14 13:27:21 +0300
commit8d1eeb58e450ef4a81497c3233a929350af3e467 (patch)
treed2dcec64c9449ea431fb259410e1136479e21bc8 /src/apk_blob.h
parentab37bd0b0c0da340222f8420ec2ee6ccdd13ce24 (diff)
downloadapk-tools-8d1eeb58e450ef4a81497c3233a929350af3e467.tar.bz2
apk-tools-8d1eeb58e450ef4a81497c3233a929350af3e467.tar.xz
blob: some helpers to replace snprintf
snprintf is dog slow. make the blob stuff have some helper functions so we can use them in code paths that are executed often.
Diffstat (limited to 'src/apk_blob.h')
-rw-r--r--src/apk_blob.h12
1 files changed, 7 insertions, 5 deletions
diff --git a/src/apk_blob.h b/src/apk_blob.h
index bea2d08..9ad79c4 100644
--- a/src/apk_blob.h
+++ b/src/apk_blob.h
@@ -44,13 +44,15 @@ int apk_blob_rsplit(apk_blob_t blob, char split, apk_blob_t *l, apk_blob_t *r);
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);
-unsigned int apk_blob_parse_uint(apk_blob_t *b, int radix);
-int apk_blob_parse_char(apk_blob_t *b);
-
int apk_blob_for_each_segment(apk_blob_t blob, const char *split,
apk_blob_cb cb, void *ctx);
-int apk_hexdump_parse(apk_blob_t to, apk_blob_t from);
-int apk_hexdump_format(int tolen, char *to, apk_blob_t from);
+void apk_blob_push_blob(apk_blob_t *to, apk_blob_t literal);
+void apk_blob_push_uint(apk_blob_t *to, unsigned int value, int radix);
+void apk_blob_push_hexdump(apk_blob_t *to, apk_blob_t binary);
+
+void apk_blob_pull_char(apk_blob_t *b, int expected);
+unsigned int apk_blob_pull_uint(apk_blob_t *b, int radix);
+void apk_blob_pull_hexdump(apk_blob_t *b, apk_blob_t to);
#endif