diff options
Diffstat (limited to 'blob.h')
-rw-r--r-- | blob.h | 5 |
1 files changed, 4 insertions, 1 deletions
@@ -25,7 +25,9 @@ typedef struct blob { #define BLOB_PTR_LEN(ptr,len) (blob_t){(void*)(ptr), (len)} #define BLOB_PTR_PTR(beg,end) BLOB_PTR_LEN((beg),(end)-(beg)+1) #define BLOB_BUF(buf) (blob_t){(void*)(buf), sizeof(buf)} -#define BLOB_STR(str) (blob_t){(char*)(str), strlen(str)} +#define BLOB_STRLEN(str) (blob_t){(str), strlen(str)} +#define BLOB_STR_INIT(str) {(str), sizeof(str)-1} +#define BLOB_STR(str) (blob_t) BLOB_STR_INIT(str) extern const blob_t BLOB_NULL; @@ -46,6 +48,7 @@ blob_t blob_pull(blob_t *b, int len); void blob_pull_skip(blob_t *b, int len); int blob_pull_matching(blob_t *b, blob_t e); unsigned int blob_pull_uint(blob_t *b, int radix); +blob_t blob_pull_spn(blob_t *b, const blob_t spn); blob_t blob_pull_cspn(blob_t *b, const blob_t cspn); blob_t blob_expand_head(blob_t *b, blob_t limits, unsigned char sep); |