Each filter "class" implements a single method - filter() - which is called whenever a brigade is ready to be processed (writing/push mode), or whenever the caller would like some buckets from its output brigade (reading/pull mode).

Each instance of a filter has a pair of brigades to hold buckets either pending transformation or consumption by the next filter in the chain.

 1: typedef struct _php_stream_filter_ops {
 2: 
 3:        php_stream_filter_status_t (*filter)(
 4:                php_stream *stream,
 5:                php_stream_filter *thisfilter,
 6:                php_stream_bucket_brigade *buckets_in,
 7:                php_stream_bucket_brigade *buckets_out,
 8:                size_t *bytes_consumed,
 9:                int flags
10:                TSRMLS_DC);
11: 
12:        void (*dtor)(php_stream_filter *thisfilter TSRMLS_DC);
13: 
14:        const char *label;
15: 
16: } php_stream_filter_ops;