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

version» Context lines:

pike.git/src/modules/_Stdio/buffer.cmod:1519:    Pike_error("Illegal argument.\n");    }    }    io_unset_unwrite_on_error( io, &e );    io_trigger_output( io );    Pike_sp--;    pop_stack();    ref_push_object(io->this);    }    -  /*! @decl protected int `[](int off) +  /*! @decl protected int(-1..255) `[](int off)    *!    *! Return the character at the specified offset. -  +  *! +  *! @returns +  *! Returns the character at offset @[off] on success, +  *! and @expr{-1@} otherwise.    */    PIKEFUN int(8bit) `[]( int off )    flags ID_PROTECTED;    {    Buffer *io = THIS;    if( off < 0 )    off = io_len(io)-off;       if( io_avail( io, off ) )    Pike_sp[-1].u.integer = io_read_pointer(io)[off];    else    Pike_sp[-1].u.integer = -1;    }    -  /*! @decl protected int `[]=(int off, int char) +  /*! @decl protected void `[]=(int off, int char)    *!    *! Set the character at the specified offset to @[char].    */ -  PIKEFUN int(8bit) `[]=( int off, int val ) +  PIKEFUN void `[]=( int off, int val )    flags ID_PROTECTED;    {    Buffer *io = THIS;       io_ensure_malloced( io, 0 );       if( off < 0 ) off = io_len(io)-off;    again:    if( io_avail( io, off ) )    {
pike.git/src/modules/_Stdio/buffer.cmod:2632:    {    io_lock( THIS );    }          static struct object* io_create_rewind_key( Buffer *io, int how );       /*! @decl RewindKey rewind_on_error()    *! @decl RewindKey rewind_key()    *! -  *! These functions are very similar. The @[rewind_on_error] edition +  *! These functions are very similar. The @[rewind_on_error] variant    *! will create an object that, when it goes out of scope without    *! having been destructed explicitly, will cause the buffer to    *! rewind to the location it had when this function is called.    *!    *! This will happen if you throw an error @i{or@} otherwise let the    *! object fall out of scope.    *!    *! Use @[destruct(RewindKey)] or @[RewindKey.release] to stop the    *! buffer from being rewound.    *!