pike.git / src / modules / _Stdio / buffer.cmod

version» Context lines:

pike.git/src/modules/_Stdio/buffer.cmod:19:   #include "iobuffer.h"   #include "module_support.h"      #include <arpa/inet.h>   #undef MP_INT   #include <gmp.h>      #define DEFAULT_CMOD_STORAGE static   DECLARATIONS    -  +    struct sysmem {    unsigned char *p;    size_t size;   };      static struct program *buffer_error_program;      /*! @module Stdio    */   
pike.git/src/modules/_Stdio/buffer.cmod:1207:    *! @type Stdio.IOBuffer    *! A chunk of memory. The whole memory area is added.    *! @type String.Buffer    *! A chunk of memory. The whole memory area is added.    *! @type array    *! Add all elements in the array individually. Each element may be    *! any one of the types listed here.    *! @endmixed    */    -  PIKEFUN IOBuffer add_hstring( string|object|array str, int size_size ) +  /* we can not use the actual type here. +  +  the reason is that this class is loaded before the master is, so +  we cannot possibly use things that require the master (such as +  resolving things.) +  */ +  PIKEFUN IOBuffer add_hstring( string|object|array(string|IOBuffer|array) str, int size_size )    {    IOBuffer *io = THIS;    size_t len = io_svalue_len(io, str);       if( size_size < (int)sizeof(size_t) &&    len > (((size_t)1)<<(8*size_size))-1 )    Pike_error("Too long string, need larger size field\n");       io_add_int( io, len, size_size );    io_append_svalue( io, str );
pike.git/src/modules/_Stdio/buffer.cmod:2274:    *! @endcode    *! @note    *! Just calling @[rewind_on_error] without assigning the return    *! value to something will not do anything. You need to keep the    *! object around while the rewind-to position is still valid.    *!    *! Keeping the object around forbids the buffer from moving data    *! inside itself, this means that it can only grow. So do not keep    *! the rewind key when it is not needed.    */ -  PIKEFUN object rewind_on_error() +  PIKEFUN IOBuffer.RewindKey rewind_on_error()    {    push_object( io_create_rewind_key( THIS, 1 ) );    }    -  PIKEFUN object rewind_key() +  PIKEFUN IOBuffer.RewindKey rewind_key()    {    push_object( io_create_rewind_key( THIS, 0 ) );    }       /*! @decl void create( int|void len )    *! @decl void create( string(8bit) contents )    *! @decl void create( System.Memory|String.Buffer contents )    *!    *! If passed an integer or no argument, create a buffer of that    *! size, or if no argument is given, 226 bytes.