summaryrefslogtreecommitdiff
path: root/main/php_streams.h
diff options
context:
space:
mode:
authorWez Furlong <wez@php.net>2002-03-24 18:05:49 +0000
committerWez Furlong <wez@php.net>2002-03-24 18:05:49 +0000
commit5ee65bd8f5e6b3b205bc3eb08e019f2a15c07a35 (patch)
treebd26669c2ff51733c3885aba15e1536dd1bc6d52 /main/php_streams.h
parent68b18b05fe9c715b342867201f9130f0bb5cde9d (diff)
downloadphp-git-5ee65bd8f5e6b3b205bc3eb08e019f2a15c07a35.tar.gz
Phase 1 of wrapper OO cleanup.
# Collecting underpants
Diffstat (limited to 'main/php_streams.h')
-rwxr-xr-xmain/php_streams.h18
1 files changed, 10 insertions, 8 deletions
diff --git a/main/php_streams.h b/main/php_streams.h
index 33fd4ee625..c8e05fd091 100755
--- a/main/php_streams.h
+++ b/main/php_streams.h
@@ -86,6 +86,7 @@
* retrieve using fgetwrapperdata(). */
typedef struct _php_stream php_stream;
+typedef struct _php_stream_wrapper php_stream_wrapper;
typedef struct _php_stream_ops {
/* stdio like functions - these are mandatory! */
@@ -100,15 +101,16 @@ typedef struct _php_stream_ops {
const char *label; /* label for this ops structure */
} php_stream_ops;
-/* options uses the IGNORE_URL family of defines from fopen_wrappers.h */
-typedef php_stream *(*php_stream_factory_func_t)(char *filename, char *mode, int options, char **opened_path, void * wrappercontext STREAMS_DC TSRMLS_DC);
-typedef void (*php_stream_wrapper_dtor_func_t)(php_stream *stream TSRMLS_DC);
+typedef struct _php_stream_wrapper_ops {
+ php_stream *(*opener)(php_stream_wrapper *wrapper, char *filename, char *mode,
+ int options, char **opened_path STREAMS_DC TSRMLS_DC);
+ php_stream *(*closer)(php_stream_wrapper *wrapper, php_stream *stream TSRMLS_DC);
+} php_stream_wrapper_ops;
-typedef struct _php_stream_wrapper {
- php_stream_factory_func_t create;
- php_stream_wrapper_dtor_func_t destroy;
- void * wrappercontext;
-} php_stream_wrapper;
+struct _php_stream_wrapper {
+ php_stream_wrapper_ops *wops; /* operations the wrapper can perform */
+ void *abstract; /* context for the wrapper */
+};
struct _php_stream {
php_stream_ops *ops;