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

version» Context lines:

pike.git/src/modules/SANE/sane.c:1:   /*   || This file is part of Pike. For copyright information see COPYRIGHT.   || Pike is distributed under GPL, LGPL and MPL. See the file COPYING   || for more information.   */    + #include "module.h"   #include "config.h"      #if (defined(HAVE_SANE_SANE_H) || defined(HAVE_SANE_H)) && defined(HAVE_LIBSANE)   #ifdef HAVE_SANE_SANE_H   #include <sane/sane.h>   #elif defined(HAVE_SANE_H)   #include <sane.h>   #endif    - #include "global.h" - #include "stralloc.h" +    #include "pike_macros.h" - #include "object.h" +    #include "constants.h"   #include "interpret.h" - #include "svalue.h" +    #include "threads.h" - #include "array.h" +    #include "pike_error.h" - #include "mapping.h" - #include "multiset.h" +    #include "backend.h"   #include "operators.h"   #include "pike_types.h"   #include "module_support.h"   #include "builtin_functions.h"      #include "../Image/image.h"         #define sp Pike_sp
pike.git/src/modules/SANE/sane.c:202:      /*! @class Scanner    */      /*! @decl void create(string name)    */   static void f_scanner_create( INT32 args )   {    char *name;    if(!sane_is_inited) init_sane(); -  get_all_args( "create", args, "%s", &name ); +  get_all_args( NULL, args, "%s", &name );       if( sane_open( name, &THIS->h ) )    Pike_error("Failed to open scanner \"%s\"\n", name );   }      /*! @decl array(mapping) list_options()    *!    *! This method returns an array where every element is a    *! mapping, layed out as follows.    *!
pike.git/src/modules/SANE/sane.c:312:    *! If no value is specified, the option is set to it's default value    */   static void f_scanner_set_option( INT32 args )   {    char *name;    int no;    INT_TYPE int_value;    FLOAT_TYPE float_value;    SANE_Int tmp;    const SANE_Option_Descriptor *d; -  get_all_args( "set_option", args, "%s", &name ); +  get_all_args( NULL, args, "%s", &name );       no = find_option( name, &d );    if( args > 1 )    {    switch( d->type )    {    case SANE_TYPE_BOOL:    case SANE_TYPE_INT:    case SANE_TYPE_BUTTON: -  sp++;get_all_args( "set_option", args, "%I", &int_value );sp--; +  sp++;get_all_args( NULL, args, "%I", &int_value );sp--;    sane_control_option( THIS->h, no, SANE_ACTION_SET_VALUE,    &int_value, &tmp );    break;    case SANE_TYPE_FIXED: -  sp++;get_all_args( "set_option", args, "%F", &float_value );sp--; +  sp++;get_all_args( NULL, args, "%F", &float_value );sp--;    int_value = SANE_FIX(((double)float_value));    sane_control_option( THIS->h, no, SANE_ACTION_SET_VALUE,    &int_value, &tmp );    break;    case SANE_TYPE_STRING: -  sp++;get_all_args( "set_option", args, "%s", &name );sp--; +  sp++;get_all_args( NULL, args, "%s", &name );sp--;    sane_control_option( THIS->h, no, SANE_ACTION_SET_VALUE,    &name, &tmp );    case SANE_TYPE_GROUP:    break;    }    } else {    int_value = 1;    sane_control_option( THIS->h, no, SANE_ACTION_SET_AUTO, &int_value, &tmp );    }   }
pike.git/src/modules/SANE/sane.c:356:   /*! @decl mixed get_option( string name )    */   static void f_scanner_get_option( INT32 args )   {    char *name;    int no;    SANE_Int int_value;    float f;    SANE_Int tmp;    const SANE_Option_Descriptor *d; -  get_all_args( "get_option", args, "%s", &name ); +  get_all_args( NULL, args, "%s", &name );       no = find_option( name, &d );       switch( d->type )    {    case SANE_TYPE_BOOL:    case SANE_TYPE_INT:    case SANE_TYPE_BUTTON:    sane_control_option( THIS->h, no, SANE_ACTION_GET_VALUE,    &int_value, &tmp );
pike.git/src/modules/SANE/sane.c:815:   PIKE_MODULE_EXIT   {    if( sane_is_inited )    sane_exit();    if( image_program )    free_program( image_program );   }      #else   #include "program.h" - #include "module.h" +    #include "module_support.h"   PIKE_MODULE_INIT {    HIDE_MODULE();   }   PIKE_MODULE_EXIT {}   #endif