From 8d1eeb58e450ef4a81497c3233a929350af3e467 Mon Sep 17 00:00:00 2001 From: Timo Teras Date: Tue, 14 Jul 2009 13:27:21 +0300 Subject: 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. --- src/apk_blob.h | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'src/apk_blob.h') 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 -- cgit v1.2.3