diff options
author | Timo Teras <timo.teras@iki.fi> | 2009-07-14 09:33:32 +0300 |
---|---|---|
committer | Timo Teras <timo.teras@iki.fi> | 2009-07-14 09:33:47 +0300 |
commit | 4562f44f9bac793b8397fdf35491da5d7ef815fa (patch) | |
tree | ee3b623f6ba2324909abdef26d41aabce7a9d434 /src/apk_blob.h | |
parent | e69b81f5259f532d5f5ae9c0a0f9bbd81240fbaf (diff) | |
download | apk-tools-4562f44f9bac793b8397fdf35491da5d7ef815fa.tar.gz apk-tools-4562f44f9bac793b8397fdf35491da5d7ef815fa.tar.bz2 apk-tools-4562f44f9bac793b8397fdf35491da5d7ef815fa.tar.xz apk-tools-4562f44f9bac793b8397fdf35491da5d7ef815fa.zip |
bstream: make tokenizable and load index using bstream
some fixes on index reading code too.
Diffstat (limited to 'src/apk_blob.h')
-rw-r--r-- | src/apk_blob.h | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/apk_blob.h b/src/apk_blob.h index 1a07355..6359313 100644 --- a/src/apk_blob.h +++ b/src/apk_blob.h @@ -22,7 +22,7 @@ struct apk_blob { typedef struct apk_blob apk_blob_t; typedef int (*apk_blob_cb)(void *ctx, apk_blob_t blob); -#define APK_BLOB_IS_NULL(blob) (blob.ptr == NULL) +#define APK_BLOB_IS_NULL(blob) ((blob).ptr == NULL) #define APK_BLOB_NULL ((apk_blob_t){0, NULL}) #define APK_BLOB_BUF(buf) ((apk_blob_t){sizeof(buf), (char *)(buf)}) @@ -39,11 +39,12 @@ static inline apk_blob_t APK_BLOB_STR(const char *str) char *apk_blob_cstr(apk_blob_t str); int apk_blob_spn(apk_blob_t blob, const char *accept, apk_blob_t *l, apk_blob_t *r); int apk_blob_cspn(apk_blob_t blob, const char *reject, apk_blob_t *l, apk_blob_t *r); -int apk_blob_splitstr(apk_blob_t blob, const char *split, apk_blob_t *l, apk_blob_t *r); +int apk_blob_split(apk_blob_t blob, apk_blob_t split, apk_blob_t *l, apk_blob_t *r); int apk_blob_rsplit(apk_blob_t blob, char split, apk_blob_t *l, apk_blob_t *r); -unsigned apk_blob_uint(apk_blob_t blob, int base); 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); |