1: php_stream *example_opener(php_stream_wrapper *wrapper,
2: char *filename, char *mode, int options,
3: char **opened_path, php_stream_context *context
4: STREAMS_DC TSRMLS_DC)
5: {
6: php_stream *stream;
7: struct my_stream_data *data;
8:
9: filename += sizeof("example://") - 1;
10:
11: data = emalloc(sizeof(struct my_stream_data));
12: data->filedes = open(filename, O_RDWR);
13:
14: stream = php_stream_alloc(&my_ops, data, NULL, mode);
15:
16: if (opened_path) {
17: *opened_path = estrdup(filename);
18: }
19:
20: return stream;
21: }