wez             Sun Feb  6 16:41:36 2005 EDT

  Modified files:              
    /php-src/main/streams       memory.c 
    /php-src/main       php_memory_streams.h 
  Log:
  add an open mode for the memory streams that allows the stream to take
  ownership of the passed-in buffer
  
  
http://cvs.php.net/diff.php/php-src/main/streams/memory.c?r1=1.6&r2=1.7&ty=u
Index: php-src/main/streams/memory.c
diff -u php-src/main/streams/memory.c:1.6 php-src/main/streams/memory.c:1.7
--- php-src/main/streams/memory.c:1.6   Thu Jan  8 03:17:59 2004
+++ php-src/main/streams/memory.c       Sun Feb  6 16:41:35 2005
@@ -16,7 +16,7 @@
    +----------------------------------------------------------------------+
  */
 
-/* $Id: memory.c,v 1.6 2004/01/08 08:17:59 andi Exp $ */
+/* $Id: memory.c,v 1.7 2005/02/06 21:41:35 wez Exp $ */
 
 #define _GNU_SOURCE
 #include "php.h"
@@ -237,7 +237,7 @@
        if ((stream = php_stream_memory_create_rel(mode)) != NULL) {
                ms = stream->abstract;
                
-               if (mode == TEMP_STREAM_READONLY) {
+               if (mode == TEMP_STREAM_READONLY || mode == 
TEMP_STREAM_TAKE_BUFFER) {
                        /* use the buffer directly */
                        ms->data = buf;
                        ms->fsize = length;
http://cvs.php.net/diff.php/php-src/main/php_memory_streams.h?r1=1.11&r2=1.12&ty=u
Index: php-src/main/php_memory_streams.h
diff -u php-src/main/php_memory_streams.h:1.11 
php-src/main/php_memory_streams.h:1.12
--- php-src/main/php_memory_streams.h:1.11      Fri Feb 20 03:04:30 2004
+++ php-src/main/php_memory_streams.h   Sun Feb  6 16:41:36 2005
@@ -16,7 +16,7 @@
    +----------------------------------------------------------------------+
  */
 
-/* $Id: php_memory_streams.h,v 1.11 2004/02/20 08:04:30 hholzgra Exp $ */
+/* $Id: php_memory_streams.h,v 1.12 2005/02/06 21:41:36 wez Exp $ */
 
 #ifndef PHP_MEMORY_STREAM_H
 #define PHP_MEMORY_STREAM_H
@@ -27,6 +27,7 @@
 
 #define TEMP_STREAM_DEFAULT  0
 #define TEMP_STREAM_READONLY 1
+#define TEMP_STREAM_TAKE_BUFFER 2
 
 #define php_stream_memory_create(mode) _php_stream_memory_create((mode) 
STREAMS_CC TSRMLS_CC)
 #define php_stream_memory_create_rel(mode) _php_stream_memory_create((mode) 
STREAMS_REL_CC TSRMLS_CC)

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to