diff options
author | Timo Teräs <timo.teras@iki.fi> | 2012-02-08 17:01:14 +0200 |
---|---|---|
committer | Timo Teräs <timo.teras@iki.fi> | 2012-02-08 17:01:14 +0200 |
commit | fe9b4a38888f82c0e4541cf31660d1e4329ac20d (patch) | |
tree | 28b10a69d1407122088bec06786d20321368f5a8 /src/apk_blob.h | |
parent | 3320fba50d8be0f12d4d01f7c12824a4dd504ac9 (diff) | |
download | apk-tools-fe9b4a38888f82c0e4541cf31660d1e4329ac20d.tar.gz apk-tools-fe9b4a38888f82c0e4541cf31660d1e4329ac20d.tar.bz2 apk-tools-fe9b4a38888f82c0e4541cf31660d1e4329ac20d.tar.xz apk-tools-fe9b4a38888f82c0e4541cf31660d1e4329ac20d.zip |
blob: optimize spn and cspn
Diffstat (limited to 'src/apk_blob.h')
-rw-r--r-- | src/apk_blob.h | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/apk_blob.h b/src/apk_blob.h index 55838ad..23bff3f 100644 --- a/src/apk_blob.h +++ b/src/apk_blob.h @@ -18,6 +18,9 @@ #include "apk_defines.h" +typedef const unsigned char *apk_spn_match; +typedef unsigned char apk_spn_match_def[256 / 8]; + struct apk_blob { long len; char *ptr; @@ -83,8 +86,8 @@ static inline apk_blob_t apk_blob_trim(apk_blob_t blob) } 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_spn(apk_blob_t blob, const apk_spn_match accept, apk_blob_t *l, apk_blob_t *r); +int apk_blob_cspn(apk_blob_t blob, const apk_spn_match reject, 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); apk_blob_t apk_blob_pushed(apk_blob_t buffer, apk_blob_t left); |