pike.git
/
src
/
modules
/
SANE
/
sane.c
version
»
Context lines:
10
20
40
80
file
none
3
pike.git/src/modules/SANE/sane.c:52:
static void init_sane(void) { if( sane_init( NULL, NULL ) ) Pike_error( "Sane init failed.\n" ); sane_is_inited = 1; } static void push_device( SANE_Device *d ) {
-
push_text( "name" ); push_text( d->name );
-
push_text( "vendor" ); push_text( d->vendor );
-
push_text( "model" ); push_text( d->model );
+
push_
static_
text( "name" ); push_text( d->name );
+
push_
static_
text( "vendor" ); push_text( d->vendor );
+
push_
static_
text( "model" ); push_text( d->model );
ref_push_string( literal_type_string ); push_text( d->type ); f_aggregate_mapping( 8 ); } /*! @decl array(mapping) list_scanners() *! *! Returns an array with all available scanners. *! *! @example
pike.git/src/modules/SANE/sane.c:105:
Pike_error("Failed to get device list\n"); } } #define THIS ((struct scanner *)Pike_fp->current_storage) static void push_option_descriptor( const SANE_Option_Descriptor *o ) { int i; struct svalue *osp = sp;
-
push_text( "name" );
+
push_
static_
text( "name" );
if( o->name ) push_text( o->name ); else push_int( 0 );
-
push_text( "title" );
+
push_
static_
text( "title" );
if( o->title ) push_text( o->title ); else push_int( 0 );
-
push_text( "desc" );
+
push_
static_
text( "desc" );
if( o->desc ) push_text( o->desc ); else push_int( 0 ); ref_push_string( literal_type_string ); switch( o->type ) {
-
case SANE_TYPE_BOOL: push_text( "boolean" ); break;
+
case SANE_TYPE_BOOL: push_
static_
text( "boolean" ); break;
case SANE_TYPE_INT: ref_push_string( literal_int_string ); break; case SANE_TYPE_FIXED: ref_push_string( literal_float_string ); break; case SANE_TYPE_STRING: ref_push_string( literal_string_string ); break;
-
case SANE_TYPE_BUTTON: push_text( "button" ); break;
-
case SANE_TYPE_GROUP: push_text( "group" ); break;
+
case SANE_TYPE_BUTTON: push_
static_
text( "button" ); break;
+
case SANE_TYPE_GROUP: push_
static_
text( "group" ); break;
}
-
push_text( "unit" );
+
push_
static_
text( "unit" );
switch( o->unit ) {
-
case SANE_UNIT_NONE: push_text( "none" ); break;
-
case SANE_UNIT_PIXEL: push_text( "pixel" ); break;
-
case SANE_UNIT_BIT: push_text( "bit" ); break;
-
case SANE_UNIT_MM: push_text( "mm" ); break;
-
case SANE_UNIT_DPI: push_text( "dpi" ); break;
-
case SANE_UNIT_PERCENT: push_text( "percent" ); break;
-
case SANE_UNIT_MICROSECOND: push_text( "microsecond" ); break;
+
case SANE_UNIT_NONE: push_
static_
text( "none" );
break;
+
case SANE_UNIT_PIXEL: push_
static_
text( "pixel" );
break;
+
case SANE_UNIT_BIT: push_
static_
text( "bit" );
break;
+
case SANE_UNIT_MM: push_
static_
text( "mm" );
break;
+
case SANE_UNIT_DPI: push_
static_
text( "dpi" );
break;
+
case SANE_UNIT_PERCENT: push_
static_
text( "percent" );
break;
+
case SANE_UNIT_MICROSECOND: push_
static_
text( "microsecond" );
break;
}
-
push_text( "size" ); push_int( o->size );
+
push_
static_
text( "size" ); push_int( o->size );
-
push_text( "cap" );
+
push_
static_
text( "cap" );
{ struct svalue *osp = sp;
-
if( o->cap & SANE_CAP_SOFT_SELECT ) push_text( "soft_select" );
-
if( o->cap & SANE_CAP_HARD_SELECT ) push_text( "hard_select" );
-
if( o->cap & SANE_CAP_EMULATED ) push_text( "emulated" );
-
if( o->cap & SANE_CAP_AUTOMATIC ) push_text( "automatic" );
-
if( o->cap & SANE_CAP_INACTIVE ) push_text( "inactive" );
-
if( o->cap & SANE_CAP_ADVANCED ) push_text( "advanced" );
+
if( o->cap & SANE_CAP_SOFT_SELECT ) push_
static_
text( "soft_select" );
+
if( o->cap & SANE_CAP_HARD_SELECT ) push_
static_
text( "hard_select" );
+
if( o->cap & SANE_CAP_EMULATED ) push_
static_
text( "emulated" );
+
if( o->cap & SANE_CAP_AUTOMATIC ) push_
static_
text( "automatic" );
+
if( o->cap & SANE_CAP_INACTIVE ) push_
static_
text( "inactive" );
+
if( o->cap & SANE_CAP_ADVANCED ) push_
static_
text( "advanced" );
f_aggregate_multiset( sp - osp ); }
-
push_text( "constaint" );
+
push_
static_
text( "constaint" );
switch( o->constraint_type ) { case SANE_CONSTRAINT_NONE: push_int( 0 ); break; case SANE_CONSTRAINT_RANGE:
-
ref_push_string( literal_type_string ); push_text( "range" );
-
push_text( "min" ); push_int( o->constraint.range->min );
-
push_text( "max" ); push_int( o->constraint.range->max );
-
push_text( "quant" ); push_int( o->constraint.range->quant );
+
ref_push_string( literal_type_string ); push_
static_
text( "range" );
+
push_
static_
text( "min" ); push_int( o->constraint.range->min );
+
push_
static_
text( "max" ); push_int( o->constraint.range->max );
+
push_
static_
text( "quant" ); push_int( o->constraint.range->quant );
f_aggregate_mapping( 8 ); break; case SANE_CONSTRAINT_WORD_LIST: ref_push_string( literal_type_string );
-
push_text( "list" );
-
push_text( "list" );
+
push_
static_
text( "list" );
+
push_
static_
text( "list" );
for( i = 0; i<o->constraint.word_list[0]; i++ ) if( o->type == SANE_TYPE_FIXED ) push_float( SANE_UNFIX(o->constraint.word_list[i+1]) ); else push_int( o->constraint.word_list[i+1] ); f_aggregate( o->constraint.word_list[0] ); f_aggregate_mapping( 4 ); break; case SANE_CONSTRAINT_STRING_LIST: ref_push_string( literal_type_string );
-
push_text( "list" );
-
push_text( "list" );
+
push_
static_
text( "list" );
+
push_
static_
text( "list" );
for( i = 0; o->constraint.string_list[i]; i++ ) push_text( o->constraint.string_list[i] ); f_aggregate( i ); f_aggregate_mapping( 4 ); break; } f_aggregate_mapping( sp - osp ); } /*! @class Scanner
pike.git/src/modules/SANE/sane.c:406:
*! @member int "depth" *! @member int "pixels_per_line" *! @member int "bytes_per_line" *! @endmapping */ static void f_scanner_get_parameters( INT32 args ) { SANE_Parameters p; pop_n_elems( args ); sane_get_parameters( THIS->h, &p );
-
push_text( "format" ); push_int( p.format );
-
push_text( "last_frame" ); push_int( p.last_frame );
-
push_text( "lines" ); push_int( p.lines );
-
push_text( "depth" ); push_int( p.depth );
-
push_text( "pixels_per_line" ); push_int( p.pixels_per_line );
-
push_text( "bytes_per_line" ); push_int( p.bytes_per_line );
+
push_
static_
text( "format" ); push_int( p.format );
+
push_
static_
text( "last_frame" ); push_int( p.last_frame );
+
push_
static_
text( "lines" ); push_int( p.lines );
+
push_
static_
text( "depth" ); push_int( p.depth );
+
push_
static_
text( "pixels_per_line" ); push_int( p.pixels_per_line );
+
push_
static_
text( "bytes_per_line" ); push_int( p.bytes_per_line );
f_aggregate_mapping( 12 ); } static struct program *image_program; static void get_grey_frame( SANE_Handle h, SANE_Parameters *p, SANE_Byte *data ) { SANE_Byte buffer[8000];
pike.git/src/modules/SANE/sane.c:474:
data[0] = *(pp++); data += 3; } } } static void assert_image_program(void) { if( !image_program ) {
-
push_text( "Image.Image" );
+
push_
static_
text( "Image.Image" );
APPLY_MASTER( "resolv", 1 ); image_program = program_from_svalue( sp - 1 ); sp--;/* Do not free image program.. */ } if( !image_program ) Pike_error("No Image.Image?!\n"); } /*! @decl Image.Image simple_scan() */