X-Git-Url: https://git.m6w6.name/?p=m6w6%2Fext-http;a=blobdiff_plain;f=phpstr%2Fphpstr.h;fp=phpstr%2Fphpstr.h;h=976a795b4368e393e1e94732b5b5ff1d446469fa;hp=565b72b2ae076c6e362435ffbf8751c3e66dc27f;hb=3017eb87773ddee0b170d532ff92e195f2f69612;hpb=f3c78f084459a9f5b5b54233bbda879154cdcefa diff --git a/phpstr/phpstr.h b/phpstr/phpstr.h index 565b72b..976a795 100644 --- a/phpstr/phpstr.h +++ b/phpstr/phpstr.h @@ -107,6 +107,9 @@ PHPSTR_API phpstr *phpstr_from_string_ex(phpstr *buf, const char *string, size_t #define phpstr_resize(b, s) phpstr_resize_ex((b), (s), 0) PHPSTR_API size_t phpstr_resize_ex(phpstr *buf, size_t len, size_t override_size); +/* shrink memory chunk to actually used size (+1) */ +PHPSTR_API size_t phpstr_shrink(phpstr *buf); + /* append data to the phpstr */ #define phpstr_appends(b, a) phpstr_append((b), (a), sizeof(a)-1) #define phpstr_appendl(b, a) phpstr_append((b), (a), strlen(a))