buf->pmem = (flags & PHPSTR_INIT_PERSISTENT) ? 1 : 0;
buf->data = (flags & PHPSTR_INIT_PREALLOC) ? pemalloc(buf->size, buf->pmem) : NULL;
buf->free = (flags & PHPSTR_INIT_PREALLOC) ? buf->size : 0;
buf->pmem = (flags & PHPSTR_INIT_PERSISTENT) ? 1 : 0;
buf->data = (flags & PHPSTR_INIT_PREALLOC) ? pemalloc(buf->size, buf->pmem) : NULL;
buf->free = (flags & PHPSTR_INIT_PREALLOC) ? buf->size : 0;
buf = phpstr_init(buf);
if (buf) {
while (argc > i++) {
phpstr_free_t f = va_arg(argv, phpstr_free_t);
phpstr *current = va_arg(argv, phpstr *);
buf = phpstr_init(buf);
if (buf) {
while (argc > i++) {
phpstr_free_t f = va_arg(argv, phpstr_free_t);
phpstr *current = va_arg(argv, phpstr *);
-PHPSTR_API void phpstr_chunked_output(phpstr **s, const char *data, size_t data_len, size_t chunk_len, void (*passthru)(const char *, size_t TSRMLS_DC) TSRMLS_DC)
+PHPSTR_API void phpstr_chunked_output(phpstr **s, const char *data, size_t data_len, size_t chunk_len, phpstr_passthru_func passthru, void *opaque TSRMLS_DC)
{
char *chunk = NULL;
size_t got = 0;
while ((got = phpstr_chunk_buffer(s, data, data_len, &chunk, chunk_len))) {
{
char *chunk = NULL;
size_t got = 0;
while ((got = phpstr_chunk_buffer(s, data, data_len, &chunk, chunk_len))) {
if (!chunk_len) {
/* we already got the last chunk,
and freed all resources */
if (!chunk_len) {
/* we already got the last chunk,
and freed all resources */