Lines Matching refs:filter
224 php_stream_filter *filter = NULL; in php_stream_filter_create() local
231 filter = factory->create_filter(filtername, filterparams, persistent); in php_stream_filter_create()
239 while (period && !filter) { in php_stream_filter_create()
244 filter = factory->create_filter(filtername, filterparams, persistent); in php_stream_filter_create()
253 if (filter == NULL) { in php_stream_filter_create()
261 return filter; in php_stream_filter_create()
266 php_stream_filter *filter; in _php_stream_filter_alloc() local
268 filter = (php_stream_filter*) pemalloc_rel_orig(sizeof(php_stream_filter), persistent); in _php_stream_filter_alloc()
269 memset(filter, 0, sizeof(php_stream_filter)); in _php_stream_filter_alloc()
271 filter->fops = fops; in _php_stream_filter_alloc()
272 Z_PTR(filter->abstract) = abstract; in _php_stream_filter_alloc()
273 filter->is_persistent = persistent; in _php_stream_filter_alloc()
275 return filter; in _php_stream_filter_alloc()
278 PHPAPI void php_stream_filter_free(php_stream_filter *filter) in php_stream_filter_free() argument
280 if (filter->fops->dtor) in php_stream_filter_free()
281 filter->fops->dtor(filter); in php_stream_filter_free()
282 pefree(filter, filter->is_persistent); in php_stream_filter_free()
285 PHPAPI int php_stream_filter_prepend_ex(php_stream_filter_chain *chain, php_stream_filter *filter) in php_stream_filter_prepend_ex() argument
287 filter->next = chain->head; in php_stream_filter_prepend_ex()
288 filter->prev = NULL; in php_stream_filter_prepend_ex()
291 chain->head->prev = filter; in php_stream_filter_prepend_ex()
293 chain->tail = filter; in php_stream_filter_prepend_ex()
295 chain->head = filter; in php_stream_filter_prepend_ex()
296 filter->chain = chain; in php_stream_filter_prepend_ex()
301 PHPAPI void _php_stream_filter_prepend(php_stream_filter_chain *chain, php_stream_filter *filter) in _php_stream_filter_prepend() argument
303 php_stream_filter_prepend_ex(chain, filter); in _php_stream_filter_prepend()
306 PHPAPI int php_stream_filter_append_ex(php_stream_filter_chain *chain, php_stream_filter *filter) in php_stream_filter_append_ex() argument
310 filter->prev = chain->tail; in php_stream_filter_append_ex()
311 filter->next = NULL; in php_stream_filter_append_ex()
313 chain->tail->next = filter; in php_stream_filter_append_ex()
315 chain->head = filter; in php_stream_filter_append_ex()
317 chain->tail = filter; in php_stream_filter_append_ex()
318 filter->chain = chain; in php_stream_filter_append_ex()
330 status = filter->fops->filter(stream, filter, brig_inp, brig_outp, &consumed, PSFS_FLAG_NORMAL); in php_stream_filter_append_ex()
385 PHPAPI void _php_stream_filter_append(php_stream_filter_chain *chain, php_stream_filter *filter) in _php_stream_filter_append() argument
387 if (php_stream_filter_append_ex(chain, filter) != SUCCESS) { in _php_stream_filter_append()
388 if (chain->head == filter) { in _php_stream_filter_append()
392 filter->prev->next = NULL; in _php_stream_filter_append()
393 chain->tail = filter->prev; in _php_stream_filter_append()
398 PHPAPI int _php_stream_filter_flush(php_stream_filter *filter, int finish) in _php_stream_filter_flush() argument
408 if (!filter->chain || !filter->chain->stream) { in _php_stream_filter_flush()
413 chain = filter->chain; in _php_stream_filter_flush()
416 for(current = filter; current; current = current->next) { in _php_stream_filter_flush()
419 status = current->fops->filter(stream, current, inp, outp, NULL, flags); in _php_stream_filter_flush()
483 PHPAPI php_stream_filter *php_stream_filter_remove(php_stream_filter *filter, int call_dtor) in php_stream_filter_remove() argument
485 if (filter->prev) { in php_stream_filter_remove()
486 filter->prev->next = filter->next; in php_stream_filter_remove()
488 filter->chain->head = filter->next; in php_stream_filter_remove()
490 if (filter->next) { in php_stream_filter_remove()
491 filter->next->prev = filter->prev; in php_stream_filter_remove()
493 filter->chain->tail = filter->prev; in php_stream_filter_remove()
496 if (filter->res) { in php_stream_filter_remove()
497 zend_list_delete(filter->res); in php_stream_filter_remove()
501 php_stream_filter_free(filter); in php_stream_filter_remove()
504 return filter; in php_stream_filter_remove()