]> granicus.if.org Git - php/commitdiff
some minor docu-in-header changes
authorWez Furlong <wez@php.net>
Sat, 16 Mar 2002 03:50:17 +0000 (03:50 +0000)
committerWez Furlong <wez@php.net>
Sat, 16 Mar 2002 03:50:17 +0000 (03:50 +0000)
main/php_streams.h
main/streams.c

index 2b4c0162bc247433959eb67c47ffafe3f998648d..289ae46b63ff0e9cec35b1dad92ea3c92c0ac235 100755 (executable)
 
 /* See README.STREAMS in php4 root dir for more info about this stuff */
 
+/* The contents of the php_stream_ops and php_stream should only be accessed
+ * using the functions/macros in this header.
+ * If you need to get at something that doesn't have an API,
+ * drop me a line <wez@thebrainroom.com> and we can sort out a way to do
+ * it properly.
+ * 
+ * The only exceptions to this rule are that stream implementations can use
+ * the php_stream->abstract pointer to hold their context, and streams
+ * opened via stream_open_wrappers can use the zval ptr in
+ * php_stream->wrapperdata to hold meta data for php scripts to
+ * retrieve using fgetwrapperdata(). */
+
 typedef struct _php_stream php_stream;
 
 typedef struct _php_stream_ops  {
@@ -64,6 +76,7 @@ struct _php_stream  {
        int fclose_stdiocast;
        FILE *stdiocast;    /* cache this, otherwise we might leak! */
 }; /* php_stream */
+/* state definitions when closing down; these are private to streams.c */
 #define PHP_STREAM_FCLOSE_NONE 0
 #define PHP_STREAM_FCLOSE_FDOPEN       1
 #define PHP_STREAM_FCLOSE_FOPENCOOKIE 2
@@ -92,8 +105,7 @@ PHPAPI int php_stream_puts(php_stream *stream, char *buf);
  * Uses mmap if the src is a plain file and at offset 0 */
 #define PHP_STREAM_COPY_ALL            -1
 PHPAPI size_t php_stream_copy_to_stream(php_stream *src, php_stream *dest, size_t maxlen);
-/* read all data from stream and put into a buffer. Caller must free buffer when done,
- * according to allocopts.
+/* read all data from stream and put into a buffer. Caller must free buffer when done.
  * The copy will use mmap if available. */
 PHPAPI size_t php_stream_read_all(php_stream *src, char **buf, int persistent);
 
index 5e528514642301aebe55f2c1ce9fa8930ec6df1b..3b5831803676fd1b060379b51b1d5c4667ee0287 100755 (executable)
@@ -34,6 +34,7 @@
 #define MAP_FAILED ((void *) -1)
 #endif
 
+#define CHUNK_SIZE     8192
 
 #ifdef PHP_WIN32
 #define EWOULDBLOCK WSAEWOULDBLOCK
@@ -227,8 +228,6 @@ PHPAPI int php_stream_seek(php_stream *stream, off_t offset, int whence)
        return -1;
 }
 
-#define CHUNK_SIZE     8192
-
 PHPAPI size_t php_stream_read_all(php_stream *src, char **buf, int persistent)
 {
        size_t ret = 0;