diff options
author | Timo Teras <timo.teras@iki.fi> | 2009-07-14 13:27:21 +0300 |
---|---|---|
committer | Timo Teras <timo.teras@iki.fi> | 2009-07-14 13:27:21 +0300 |
commit | 8d1eeb58e450ef4a81497c3233a929350af3e467 (patch) | |
tree | d2dcec64c9449ea431fb259410e1136479e21bc8 /src/apk_blob.h | |
parent | ab37bd0b0c0da340222f8420ec2ee6ccdd13ce24 (diff) | |
download | apk-tools-8d1eeb58e450ef4a81497c3233a929350af3e467.tar.gz apk-tools-8d1eeb58e450ef4a81497c3233a929350af3e467.tar.bz2 apk-tools-8d1eeb58e450ef4a81497c3233a929350af3e467.tar.xz apk-tools-8d1eeb58e450ef4a81497c3233a929350af3e467.zip |
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.h | 12 |
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 |