Re: Streams filter API
| From: | Andi Gutmans | Date: | Wed, 21 Aug 2002 04:08:14 +0000 |
| Subject: | Re: Streams filter API | ||
| References: | 1 | Groups: | php.dev |
| Request: | Send a blank email to php-dev+get-87211@lists.php.net to get a copy of this message | ||
At 10:47 PM 8/20/2002 +0100, Wez Furlong wrote:
Filters are created using: php_stream_filter_create(char *filtername, char *filterparams,Hey, I think it's probably best to make filterparams a void * because then you can pass whatever you want (a structure with all the params and so on). Of course you can do it with your current prototype too but this is how it's usually done. I haven't looked into the API itself so if it doesn't make much sense ignore me :) Andiint filterparamslen, int persistent TSRMLS_DC);filtername corresponds to the name used to register the factory; if no exact match is found, it looks for a factory matching "<group>.*", and then passes the filtername to it's factory method. Filterparams is a binary safe string parameter which can carry some kind of options to a filter implementation. For example, it might specifit the compression level for a zlib filter, or it might control the number of bits used in a cypher, or some kind of key for cypto filters. The filter API doesn't touch this parameter; it's interpreted only by the factory object/method.