summaryrefslogtreecommitdiff
path: root/main/php_streams.h
diff options
context:
space:
mode:
authorWez Furlong <wez@php.net>2002-03-17 14:21:01 +0000
committerWez Furlong <wez@php.net>2002-03-17 14:21:01 +0000
commit12a00923769aa26e18f3af6b11b4e6f37d6163d0 (patch)
tree54ad9bcc90886df75303de6766ce6b62c39223ff /main/php_streams.h
parenteffa6e8daa84075cf7c6c44a278efdd135dee1a3 (diff)
downloadphp-git-12a00923769aa26e18f3af6b11b4e6f37d6163d0.tar.gz
Fix for php_stream_gets when the implementation does not support it
natively (Thanks Marcus). Implement php_stream_make_seekable() and add STREAM_MUST_SEEK as an option to php_stream_open_wrapper(). See README.STREAMS for usage.
Diffstat (limited to 'main/php_streams.h')
-rwxr-xr-xmain/php_streams.h25
1 files changed, 24 insertions, 1 deletions
diff --git a/main/php_streams.h b/main/php_streams.h
index 65a83c8036..402156c335 100755
--- a/main/php_streams.h
+++ b/main/php_streams.h
@@ -146,13 +146,36 @@ PHPAPI int php_stream_cast(php_stream *stream, int castas, void **ret, int show_
#define php_stream_is_persistent(stream) (stream)->is_persistent
/* Wrappers support */
+
+#define IGNORE_PATH 0
+#define USE_PATH 1
+#define IGNORE_URL 2
+/* There's no USE_URL. */
+#define ENFORCE_SAFE_MODE 4
+#define REPORT_ERRORS 8
+/* If you don't need to write to the stream, but really need to
+ * be able to seek, use this flag in your options. */
+#define STREAM_MUST_SEEK 16
+
+#ifdef PHP_WIN32
+# define IGNORE_URL_WIN IGNORE_URL
+#else
+# define IGNORE_URL_WIN 0
+#endif
+
int php_init_stream_wrappers(TSRMLS_D);
int php_shutdown_stream_wrappers(TSRMLS_D);
PHPAPI int php_register_url_stream_wrapper(char *protocol, php_stream_wrapper *wrapper TSRMLS_DC);
PHPAPI int php_unregister_url_stream_wrapper(char *protocol TSRMLS_DC);
-
PHPAPI php_stream *php_stream_open_wrapper(char *path, char *mode, int options, char **opened_path TSRMLS_DC);
+#define PHP_STREAM_UNCHANGED 0 /* orig stream was seekable anyway */
+#define PHP_STREAM_RELEASED 1 /* newstream should be used; origstream is no longer valid */
+#define PHP_STREAM_FAILED 2 /* an error occurred while attempting conversion */
+#define PHP_STREAM_CRITICAL 3 /* an error occurred; origstream is in an unknown state; you should close origstream */
+/* DO NOT call this on streams that are referenced by resources! */
+PHPAPI int php_stream_make_seekable(php_stream *origstream, php_stream **newstream);
+
#endif
/*