pike.git / src / modules / SANE / sane.c

version» Context lines:

pike.git/src/modules/SANE/sane.c:601:    SANE_Parameters p;    rgb_group *r;    struct object *o;    struct object *t;    int current_row;    SANE_Byte *buffer;    int bufferpos, nonblocking;    struct svalue callback;   };    - static void nonblocking_row_scan_callback( int fd, void *_c ) + static int nonblocking_row_scan_callback( int fd, void *_c )   {    struct row_scan_struct *c = (struct row_scan_struct *)_c;    int done = 0;    int nbytes;       do    {    int ec;    THREADS_ALLOW();    if( (ec = sane_read( c->h, c->buffer+c->bufferpos,
pike.git/src/modules/SANE/sane.c:643:    memcpy( c->r, c->buffer, c->p.bytes_per_line );    break;    default:break;    }    c->bufferpos=0;    }    }    THREADS_DISALLOW();       if( !nbytes || c->bufferpos ) -  return; /* await more data */ +  return 0; /* await more data */       c->current_row++;       if( c->current_row == c->p.lines )    done = 1;       ref_push_object( c->o );    push_int( c->current_row-1 );    ref_push_object( c->t );    push_int( done );
pike.git/src/modules/SANE/sane.c:667:       if( done )    {    set_read_callback( fd, 0, 0 );    free_object( c->o );    free_object( c->t );    free_svalue( &c->callback );    free( c->buffer );    free( c );    } +  return 0;   }      /*! @decl void nonblocking_row_scan(function(Image.Image,int,Scanner,int:void) callback)    */   static void f_scanner_nonblocking_row_scan( INT32 UNUSED(args) )   {    SANE_Parameters p;    SANE_Handle h = THIS->h;    struct svalue *s;    int fd;