pike.git / lib / modules / Stdio.pmod / module.pmod

version» Context lines:

pike.git/lib/modules/Stdio.pmod/module.pmod:1030: Inside #if defined(STDIO_CALLBACK_TEST_MODE)
   {    if (!(::mode() & PROP_IS_NONBLOCKING))    return ::write_oob (s, @args);       if (sizeof (args)) s = sprintf (s, @args);    return ::write_oob (s[..0]);    }      #else /* !STDIO_CALLBACK_TEST_MODE */    -  int write(sprintf_format|array(string) data_or_format, +  int write(sprintf_format|array(string)|object data_or_format,    sprintf_args ... args)    {    if (outbuffer) {    outbuffer->__fd_set_output(0);       if (sizeof(outbuffer)) {    // The write buffer isn't empty, so try to empty it. */    int bytes = outbuffer->output_to( ::write );    if (sizeof(outbuffer) && (bytes > 0)) {    // Not all was written. Probably EWOULDBLOCK.
pike.git/lib/modules/Stdio.pmod/module.pmod:1113:    BE_WERR("__stdio_read_callback()");       if (!___read_callback) {    if (___close_callback) {    return __stdio_close_callback();    }    return 0;    }       if (!errno()) { -  if( inbuffer ) +  if( object buffer = inbuffer )    { -  switch( inbuffer->input_from( this,UNDEFINED,1 ) ) +  buffer->allocate(DATA_CHUNK_SIZE); +  +  int bytes = ::read(buffer); +  +  if (bytes > 0)    { -  case 1..: -  return ___read_callback( ___id||this, inbuffer ); -  case 0: -  ::set_read_callback(__stdio_read_callback); -  return 0; -  case ..-1: +  return ___read_callback( ___id||this, buffer ); +  } +  else +  {    return __read_callback_error();    }    }    string s;   #ifdef STDIO_CALLBACK_TEST_MODE    s = ::read (1, 1);   #else    s = ::read(DATA_CHUNK_SIZE,1);   #endif    if (s) {