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

version» Context lines:

pike.git/src/modules/_Stdio/buffer.cmod:990:    if( Pike_sp[-1].u.string->size_shift )    Pike_error("Can not handle non-8bit data\n");    io_append( io, Pike_sp[-1].u.string->str, Pike_sp[-1].u.string->len );    nbytes -= Pike_sp[-1].u.string->len;    pop_stack();    }    }       if (!bread) RETURN -1;    +  io_trigger_output( io ); +     RETURN bread;    }       /*! @decl int __fd_set_output( object|function(string:int) write_callback )    *!    *! This tells the buffer to trigger the write callback for the    *! specified filedescriptor when data is added to the buffer.    *!    *! This is used internally by Stdio.File to handle nonblocking    *! buffered mode, and is not really intended to be used directly.
pike.git/src/modules/_Stdio/buffer.cmod:1275:       /*! @decl Buffer add_int8( int(0..255) )    *! Adds a single byte to the buffer.    */    PIKEFUN Buffer add_int8( int i )    {    Buffer *io = THIS;    *io_add_space(io,1,0)=i;    io->len++;    Pike_sp--; +  io_trigger_output( io );    ref_push_object(Pike_fp->current_object);    }       /*! @decl Buffer add_int16( int(0..65535) )    *!    *! Add a 16-bit network byte order value to the buffer    */    PIKEFUN Buffer add_int16( int i )    {    Buffer *io = THIS;    unsigned char *p = io_add_space(io,2,0);    p[0] = i>>8;    p[1] = i;    io->len += 2; -  +  io_trigger_output( io );    ref_push_object(Pike_fp->current_object);    }       /*! @decl Buffer add_int32( int i )    *! Adds a 32 bit network byte order value to the buffer    */    PIKEFUN Buffer add_int32( int i )    {    Buffer *io = THIS;    unsigned char *p = io_add_space(io,4,0);    p[0] = i>>24;    p[1] = i>>16;    p[2] = i>>8;    p[3] = i;    io->len += 4; -  +  io_trigger_output( io );    ref_push_object(Pike_fp->current_object);    }       /*! @decl Buffer add_hstring( string(0..255) data, int size_size )    *! @decl Buffer add_hstring( Stdio.Buffer data, int size_size )    *! @decl Buffer add_hstring( System.Memory data, int size_size )    *! @decl Buffer add_hstring( String.Buffer data, int size_size )    *! @decl Buffer add_hstring( int(0..255) data, int size_size )    *! @decl Buffer add_hstring( array data, int size_size )    *! @decl Buffer add_hstring( int|string(0..255)|Stdio.Buffer|System.Memory|array data, int size_size, int offset )