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

version» Context lines:

pike.git/src/modules/_Stdio/buffer.cmod:1652:    *! This currently simply returns a 0-length subbuffer.    */    PIKEFUN Buffer lock()    {    push_object( io_read_buffer( THIS, 0, 0 ) );    }       PIKEFUN string(0..255) _sprintf(int o, mapping UNUSED)    flags ID_PROTECTED;    { +  size_t bytes;    pop_n_elems(args-1);    Pike_sp--;    switch( o )    {    case 'O':    {    push_text("%O(%d bytes, read=[..%d] data=[%d..%d] free=[%d..%d] %s%s)");    ref_push_program(Pike_fp->current_object->prog);    /* io_len [..offset] [offset..len] [..allocated] */    push_int(io_len(THIS));
pike.git/src/modules/_Stdio/buffer.cmod:1678:    push_text( (THIS->str ? "string" : THIS->malloced ? "allocated" : "subbuffer" ) );    if( THIS->locked )    push_text(" (read only)");    else    push_text("");    f_sprintf(10);    }    break;       case 's': -  push_string( io_read_string( THIS, io_len(THIS)) ); +  bytes = io_len(THIS); +  push_string( io_read_string(THIS, bytes) ); +  io_rewind(THIS, bytes);    break;       case 'q':    push_text("%q"); -  push_string( io_read_string( THIS, io_len(THIS)) ); +  bytes = io_len(THIS); +  push_string( io_read_string(THIS, bytes) ); +  io_rewind(THIS, bytes);    f_sprintf(2);    break;    default:    push_undefined();    }    }       /*! @decl string(8bit) read_hstring( int(0..) n, void|int offset )    *!    *! Identical in functionality to @[read](@[read_number](@[n])) but