Moved union Option_Value from backend header files to sanei_backend.h. No need

to copy it over and over again. Changed header inclusion order in backend
files to include backend.h after sanei_backend.h. Based on a patch from stef
<stef-listes@wanadoo.fr>.
merge-requests/1/head
Henning Geinitz 2003-09-12 16:10:33 +00:00
rodzic a922e76558
commit 0e70e29baf
70 zmienionych plików z 185 dodań i 422 usunięć

Wyświetl plik

@ -8,6 +8,31 @@
* doc/.cvsignore sanei/.cvsignore: Added .libs. Sorted. * doc/.cvsignore sanei/.cvsignore: Added .libs. Sorted.
* doc/descriptions/unsupported.desc: Updated HP ScanJet 2300c * doc/descriptions/unsupported.desc: Updated HP ScanJet 2300c
and 2400c. and 2400c.
* backend/abaton.c backend/abaton.h backend/agfafocus.c
backend/agfafocus.h backend/apple.c backend/apple.h
backend/artec.h backend/artec_eplus48u.h backend/as6e.c
backend/as6e.h backend/avision.h backend/bh.c backend/bh.h
backend/canon.c backend/canon.h backend/coolscan.h backend/dmc.c
backend/dmc.h backend/epson.c backend/epson.h backend/fujitsu.h
backend/gt68xx.c backend/gt68xx_high.h backend/ibm.c backend/ibm.h
backend/leo.h backend/ma1509.c backend/ma1509.h
backend/matsushita.h backend/microtek.c backend/microtek.h
backend/microtek2.c backend/microtek2.h backend/mustek.c
backend/mustek.h backend/mustek_pp.c backend/mustek_pp.h
backend/mustek_usb.c backend/mustek_usb_high.h backend/nec.c
backend/nec.h backend/pie.c backend/pint.c backend/pint.h
backend/plustek.h backend/qcam.c backend/qcam.h backend/ricoh.c
backend/ricoh.h backend/sceptre.h backend/sharp.c backend/sharp.h
backend/sm3600.c backend/sm3600.h backend/snapscan.c
backend/snapscan.h backend/tamarack.c backend/tamarack.h
backend/teco1.h backend/teco2.h backend/teco3.h backend/test.h
backend/umax.c backend/umax.h backend/umax_pp.c backend/umax_pp.h
backend/v4l.c backend/v4l.h include/sane/sanei_backend.h:
Moved union Option_Value from backend header files to
sanei_backend.h. No need to copy it over and over again.
Changed header inclusion order in backend files to include
backend.h after sanei_backend.h. Based on a patch from stef
<stef-listes@wanadoo.fr>.
2003-09-09 Henning Meier-Geinitz <henning@meier-geinitz.de> 2003-09-09 Henning Meier-Geinitz <henning@meier-geinitz.de>

Wyświetl plik

@ -65,8 +65,6 @@
#include "sane/sanei.h" #include "sane/sanei.h"
#include "sane/saneopts.h" #include "sane/saneopts.h"
#include "sane/sanei_scsi.h" #include "sane/sanei_scsi.h"
#include "abaton.h"
#define BACKEND_NAME abaton #define BACKEND_NAME abaton
#include "sane/sanei_backend.h" #include "sane/sanei_backend.h"
@ -78,6 +76,9 @@
#include "sane/sanei_config.h" #include "sane/sanei_config.h"
#define ABATON_CONFIG_FILE "abaton.conf" #define ABATON_CONFIG_FILE "abaton.conf"
#include "abaton.h"
#define MM_PER_INCH 25.4 #define MM_PER_INCH 25.4
static int num_devices; static int num_devices;

Wyświetl plik

@ -84,13 +84,6 @@ enum Abaton_Option
NUM_OPTIONS NUM_OPTIONS
}; };
typedef union
{
SANE_Word w;
SANE_String s;
}
Option_Value;
enum ScannerModels enum ScannerModels
{ {
ABATON_300GS, ABATON_300GS,

Wyświetl plik

@ -37,11 +37,12 @@
#include "sane/sanei_config.h" #include "sane/sanei_config.h"
#include "sane/saneopts.h" #include "sane/saneopts.h"
#include "sane/sanei_scsi.h" #include "sane/sanei_scsi.h"
#include "agfafocus.h"
#define BACKEND_NAME agfafocus #define BACKEND_NAME agfafocus
#include "sane/sanei_backend.h" #include "sane/sanei_backend.h"
#include "agfafocus.h"
#ifndef PATH_MAX #ifndef PATH_MAX
# define PATH_MAX 1024 # define PATH_MAX 1024
#endif #endif

Wyświetl plik

@ -72,14 +72,6 @@ enum AgfaFocus_Option
NUM_OPTIONS NUM_OPTIONS
}; };
typedef union
{
SANE_Bool b;
SANE_Word w;
SANE_Word *wa; /* word array */
SANE_String s;
}
Option_Value;
typedef struct AgfaFocus_Device typedef struct AgfaFocus_Device
{ {

Wyświetl plik

@ -63,7 +63,6 @@
#include "sane/sanei.h" #include "sane/sanei.h"
#include "sane/saneopts.h" #include "sane/saneopts.h"
#include "sane/sanei_scsi.h" #include "sane/sanei_scsi.h"
#include "apple.h"
/* SCSI commands that the Apple scanners understand: */ /* SCSI commands that the Apple scanners understand: */
@ -132,6 +131,8 @@
#include "sane/sanei_config.h" #include "sane/sanei_config.h"
#define APPLE_CONFIG_FILE "apple.conf" #define APPLE_CONFIG_FILE "apple.conf"
#include "apple.h"
#define MM_PER_INCH 25.4 #define MM_PER_INCH 25.4
static int num_devices; static int num_devices;

Wyświetl plik

@ -194,14 +194,6 @@ enum Apple_Option
NUM_OPTIONS NUM_OPTIONS
}; };
typedef union
{
SANE_Word w;
SANE_Word *wa; /* word array */
SANE_String s;
}
Option_Value;
/* This is a hack to get fast the model of the Attached Scanner */ /* This is a hack to get fast the model of the Attached Scanner */
/* But it Works well and I am not considering in "fix" it */ /* But it Works well and I am not considering in "fix" it */

Wyświetl plik

@ -198,13 +198,6 @@ typedef enum
} }
ARTEC_Software_Calibrate; ARTEC_Software_Calibrate;
typedef union
{
SANE_Word w;
SANE_Word *wa; /* word array */
SANE_String s;
}
Option_Value;
typedef struct ARTEC_Device typedef struct ARTEC_Device
{ {

Wyświetl plik

@ -259,14 +259,6 @@ struct Artec48U_Line_Reader
unsigned int **buffer_pointers_return); unsigned int **buffer_pointers_return);
}; };
typedef union
{
SANE_Word w;
SANE_Word *wa; /* word array */
SANE_String s;
}
Option_Value;
struct Artec48U_Scanner struct Artec48U_Scanner
{ {
Artec48U_Scanner *next; Artec48U_Scanner *next;

Wyświetl plik

@ -58,8 +58,6 @@
#include <signal.h> #include <signal.h>
#include <sys/stat.h> #include <sys/stat.h>
#include "as6e.h"
#include "../include/sane/sane.h" #include "../include/sane/sane.h"
#include "../include/sane/saneopts.h" #include "../include/sane/saneopts.h"
@ -67,6 +65,8 @@
#include "../include/sane/sanei_backend.h" #include "../include/sane/sanei_backend.h"
#include "../include/sane/sanei_config.h" #include "../include/sane/sanei_config.h"
#include "as6e.h"
static int num_devices; static int num_devices;
static AS6E_Device *first_dev; static AS6E_Device *first_dev;
static AS6E_Scan *first_handle; static AS6E_Scan *first_handle;

Wyświetl plik

@ -51,13 +51,6 @@
#include <sane/sane.h> #include <sane/sane.h>
typedef union
{
SANE_Word w; /* word */
SANE_Word *wa; /* word array */
SANE_String s; /* string */
} Option_Value;
typedef enum typedef enum
{ {
OPT_NUM_OPTS = 0, OPT_NUM_OPTS = 0,

Wyświetl plik

@ -171,13 +171,6 @@ enum Avision_Option
NUM_OPTIONS /* must come last */ NUM_OPTIONS /* must come last */
}; };
typedef union Option_Value
{
SANE_Word w;
SANE_Word *wa; /* word array */
SANE_String s;
} Option_Value;
typedef struct Avision_Dimensions typedef struct Avision_Dimensions
{ {
/* in dpi */ /* in dpi */

Wyświetl plik

@ -56,12 +56,13 @@
#include "sane/saneopts.h" #include "sane/saneopts.h"
#include "sane/sanei_scsi.h" #include "sane/sanei_scsi.h"
#include "sane/sanei_config.h" #include "sane/sanei_config.h"
#include "bh.h"
#define BACKEND_NAME bh #define BACKEND_NAME bh
#include "sane/sanei_backend.h" #include "sane/sanei_backend.h"
#define BUILD 4 #define BUILD 4
#include "bh.h"
#define MIN(x,y) ((x)<(y) ? (x) : (y)) #define MIN(x,y) ((x)<(y) ? (x) : (y))
#define MAX(x,y) ((x)>(y) ? (x) : (y)) #define MAX(x,y) ((x)>(y) ? (x) : (y))

Wyświetl plik

@ -205,13 +205,6 @@ typedef enum
} BH_Option; } BH_Option;
typedef union
{
SANE_Word w; /* word */
SANE_Word *wa; /* word array */
SANE_String s; /* string */
} Option_Value;
/* macros for accessing the value for an option within a scanning context */ /* macros for accessing the value for an option within a scanning context */
#define MM_PER_INCH 25.4 #define MM_PER_INCH 25.4
#define _OPT_VAL_WORD(s, o) ((s)->val[(o)].w) #define _OPT_VAL_WORD(s, o) ((s)->val[(o)].w)

Wyświetl plik

@ -109,7 +109,6 @@
#include <sane/sane.h> #include <sane/sane.h>
#include <sane/saneopts.h> #include <sane/saneopts.h>
#include <sane/sanei_scsi.h> #include <sane/sanei_scsi.h>
#include <canon.h>
#define BACKEND_NAME canon #define BACKEND_NAME canon
@ -122,6 +121,8 @@
#include <sane/sanei_config.h> #include <sane/sanei_config.h>
#define CANON_CONFIG_FILE "canon.conf" #define CANON_CONFIG_FILE "canon.conf"
#include <canon.h>
#define MM_PER_INCH 25.4 #define MM_PER_INCH 25.4
static SANE_Byte primaryHigh[256], primaryLow[256], secondaryHigh[256], static SANE_Byte primaryHigh[256], primaryLow[256], secondaryHigh[256],

Wyświetl plik

@ -216,14 +216,6 @@ typedef enum
CANON_Option; CANON_Option;
typedef union
{
SANE_Word w;
SANE_Word *wa; /* word array */
SANE_String s;
}
Option_Value;
typedef struct CANON_Info typedef struct CANON_Info
{ {
int model; int model;

Wyświetl plik

@ -106,14 +106,6 @@ enum Coolscan_Option
}; };
typedef union
{
SANE_Word w;
SANE_Word *wa; /* word array */
SANE_String s;
}
Option_Value;
typedef struct Image_Pos typedef struct Image_Pos
{ int start; /* start position of image on film strip */ { int start; /* start position of image on film strip */
int end; /* end position of image on film strip */ int end; /* end position of image on film strip */

Wyświetl plik

@ -56,7 +56,6 @@
#include "sane/sane.h" #include "sane/sane.h"
#include "sane/saneopts.h" #include "sane/saneopts.h"
#include "sane/sanei_scsi.h" #include "sane/sanei_scsi.h"
#include "dmc.h"
#define BACKEND_NAME dmc #define BACKEND_NAME dmc
#include "sane/sanei_backend.h" #include "sane/sanei_backend.h"
@ -68,6 +67,8 @@
#include "sane/sanei_config.h" #include "sane/sanei_config.h"
#define DMC_CONFIG_FILE "dmc.conf" #define DMC_CONFIG_FILE "dmc.conf"
#include "dmc.h"
/* A linked-list of attached devices and handles */ /* A linked-list of attached devices and handles */
static DMC_Device *FirstDevice = NULL; static DMC_Device *FirstDevice = NULL;
static DMC_Camera *FirstHandle = NULL; static DMC_Camera *FirstHandle = NULL;

Wyświetl plik

@ -66,12 +66,6 @@ typedef enum {
NUM_OPTIONS NUM_OPTIONS
} DMC_Option; } DMC_Option;
typedef union {
SANE_Word w;
SANE_Word *wa; /* word array */
SANE_String s;
} Option_Value;
typedef struct DMC_Device { typedef struct DMC_Device {
struct DMC_Device *next; struct DMC_Device *next;
SANE_Device sane; SANE_Device sane;

Wyświetl plik

@ -311,15 +311,15 @@
#include <sane/sanei_pio.h> #include <sane/sanei_pio.h>
#include "epson.h"
#include "epson_scsi.h"
#include "epson_usb.h"
#define BACKEND_NAME epson #define BACKEND_NAME epson
#include <sane/sanei_backend.h> #include <sane/sanei_backend.h>
#include <sane/sanei_config.h> #include <sane/sanei_config.h>
#include "epson.h"
#include "epson_scsi.h"
#include "epson_usb.h"
#define EPSON_CONFIG_FILE "epson.conf" #define EPSON_CONFIG_FILE "epson.conf"
#ifndef PATH_MAX #ifndef PATH_MAX

Wyświetl plik

@ -262,12 +262,6 @@ struct Epson_Device {
typedef struct Epson_Device Epson_Device; typedef struct Epson_Device Epson_Device;
typedef union {
SANE_Word w;
SANE_Word * wa; /* word array */
SANE_String s;
} Option_Value;
struct Epson_Scanner { struct Epson_Scanner {

Wyświetl plik

@ -12,13 +12,6 @@
static int num_devices; static int num_devices;
static struct fujitsu *first_dev; static struct fujitsu *first_dev;
typedef union
{
SANE_Word w;
SANE_String s;
}
Option_Value;
/* ------------------------------------------------------------------------- /* -------------------------------------------------------------------------
* This option list has to contain all options for all scanners supported by * This option list has to contain all options for all scanners supported by
* this driver. If a certain scanner cannot handle a certain option, there's * this driver. If a certain scanner cannot handle a certain option, there's

Wyświetl plik

@ -85,7 +85,6 @@
#include "../include/sane/sane.h" #include "../include/sane/sane.h"
#include "../include/sane/sanei.h" #include "../include/sane/sanei.h"
#include "../include/sane/saneopts.h" #include "../include/sane/saneopts.h"
#include "gt68xx.h"
#define BACKEND_NAME gt68xx #define BACKEND_NAME gt68xx
@ -96,6 +95,7 @@
#define SANE_I18N(text) text #define SANE_I18N(text) text
#endif #endif
#include "gt68xx.h"
#include "gt68xx_high.c" #include "gt68xx_high.c"
#include "gt68xx_devices.c" #include "gt68xx_devices.c"

Wyświetl plik

@ -217,14 +217,6 @@ enum GT68xx_Option
NUM_OPTIONS NUM_OPTIONS
}; };
typedef union
{
SANE_Word w;
SANE_Word *wa; /* word array */
SANE_String s;
}
Option_Value;
/** Scanner object. /** Scanner object.
*/ */
struct GT68xx_Scanner struct GT68xx_Scanner

Wyświetl plik

@ -62,7 +62,6 @@
#include "../include/sane/sane.h" #include "../include/sane/sane.h"
#include "../include/sane/saneopts.h" #include "../include/sane/saneopts.h"
#include "../include/sane/sanei_scsi.h" #include "../include/sane/sanei_scsi.h"
#include "ibm.h"
#define BACKEND_NAME ibm #define BACKEND_NAME ibm
#include "../include/sane/sanei_backend.h" #include "../include/sane/sanei_backend.h"
@ -74,6 +73,9 @@
#include "../include/sane/sanei_config.h" #include "../include/sane/sanei_config.h"
#define IBM_CONFIG_FILE "ibm.conf" #define IBM_CONFIG_FILE "ibm.conf"
#include "ibm.h"
#include "ibm-scsi.c"
#define MM_PER_INCH 25.4 #define MM_PER_INCH 25.4
#define MAX(a,b) ((a) > (b) ? (a) : (b)) #define MAX(a,b) ((a) > (b) ? (a) : (b))
@ -82,7 +84,6 @@ static Ibm_Device *first_dev = NULL;
static Ibm_Scanner *first_handle = NULL; static Ibm_Scanner *first_handle = NULL;
/* static int is50 = 0; */ /* static int is50 = 0; */
#include "ibm-scsi.c"
static size_t static size_t
max_string_size (const SANE_String_Const strings[]) max_string_size (const SANE_String_Const strings[])

Wyświetl plik

@ -238,15 +238,6 @@ typedef enum
} }
Ibm_Option; Ibm_Option;
typedef union
{
SANE_Bool b;
SANE_Word w;
SANE_Word *wa; /* word array */
SANE_String s;
}
Option_Value;
typedef struct Ibm_Info typedef struct Ibm_Info
{ {
SANE_Range xres_range; SANE_Range xres_range;

Wyświetl plik

@ -240,14 +240,6 @@ enum Leo_Option
OPT_NUM_OPTIONS OPT_NUM_OPTIONS
}; };
typedef union
{
SANE_Word w; /* word */
SANE_Word *wa; /* word array */
SANE_String s; /* string */
}
Option_Value;
/*--------------------------------------------------------------------------*/ /*--------------------------------------------------------------------------*/
/* /*

Wyświetl plik

@ -68,12 +68,12 @@
#include "../include/sane/saneopts.h" #include "../include/sane/saneopts.h"
#include "../include/sane/sanei_usb.h" #include "../include/sane/sanei_usb.h"
#include "ma1509.h"
#define BACKEND_NAME ma1509 #define BACKEND_NAME ma1509
#include "../include/sane/sanei_backend.h" #include "../include/sane/sanei_backend.h"
#include "../include/sane/sanei_config.h" #include "../include/sane/sanei_config.h"
#include "ma1509.h"
#ifndef SANE_I18N #ifndef SANE_I18N
#define SANE_I18N(text) text #define SANE_I18N(text) text
#endif #endif

Wyświetl plik

@ -127,14 +127,6 @@ enum Ma1509_Option
NUM_OPTIONS NUM_OPTIONS
}; };
typedef union
{
SANE_Word w;
SANE_Word *wa; /* word array */
SANE_String s;
}
Option_Value;
typedef struct Ma1509_Device typedef struct Ma1509_Device
{ {
struct Ma1509_Device *next; struct Ma1509_Device *next;

Wyświetl plik

@ -204,14 +204,6 @@ enum Matsushita_Option
OPT_NUM_OPTIONS OPT_NUM_OPTIONS
}; };
typedef union
{
SANE_Word w; /* word */
SANE_Word *wa; /* word array */
SANE_String s; /* string */
}
Option_Value;
/*--------------------------------------------------------------------------*/ /*--------------------------------------------------------------------------*/
#define BLACK_WHITE_STR SANE_I18N("Black & White") #define BLACK_WHITE_STR SANE_I18N("Black & White")

Wyświetl plik

@ -1047,7 +1047,7 @@ init_options(Microtek_Scanner *ms)
{ {
int i; int i;
SANE_Option_Descriptor *sod = ms->sod; SANE_Option_Descriptor *sod = ms->sod;
Microtek_Option_Value *val = ms->val; Option_Value *val = ms->val;
DBG(15, "init_options...\n"); DBG(15, "init_options...\n");
@ -3353,7 +3353,7 @@ sane_control_option (SANE_Handle handle,
{ {
Microtek_Scanner *scanner = handle; Microtek_Scanner *scanner = handle;
SANE_Option_Descriptor *sod; SANE_Option_Descriptor *sod;
Microtek_Option_Value *val; Option_Value *val;
SANE_Status status; SANE_Status status;
DBG(96, "sane_control_option (opt=%d,act=%d,val=%p,info=%p)\n", DBG(96, "sane_control_option (opt=%d,act=%d,val=%p,info=%p)\n",

Wyświetl plik

@ -114,17 +114,6 @@ enum Mtek_Option
}; };
/*******************************************************************/
/***** value structure for scanner options *****/
/*******************************************************************/
typedef union {
SANE_Word w;
SANE_Word *wa; /* word array */
SANE_String s;
} Microtek_Option_Value;
/*******************************************************************/ /*******************************************************************/
/***** scanner hardware information (as discovered by INQUIRY) *****/ /***** scanner hardware information (as discovered by INQUIRY) *****/
/*******************************************************************/ /*******************************************************************/
@ -269,7 +258,7 @@ typedef struct Microtek_Scanner {
Microtek_Device *dev; /* raw device info */ Microtek_Device *dev; /* raw device info */
SANE_Option_Descriptor sod[RNUM_OPTIONS]; /* option list for session */ SANE_Option_Descriptor sod[RNUM_OPTIONS]; /* option list for session */
Microtek_Option_Value val[RNUM_OPTIONS]; /* option values for session */ Option_Value val[RNUM_OPTIONS]; /* option values for session */
/* SANE_Int gamma_table[4][256];*/ /* SANE_Int gamma_table[4][256];*/
SANE_Int *gray_lut; SANE_Int *gray_lut;

Wyświetl plik

@ -312,7 +312,7 @@ sane_get_parameters(SANE_Handle handle, SANE_Parameters *params)
{ {
Microtek2_Scanner *ms = handle; Microtek2_Scanner *ms = handle;
Microtek2_Device *md; Microtek2_Device *md;
Microtek2_Option_Value *val; Option_Value *val;
Microtek2_Info *mi; Microtek2_Info *mi;
int mode; int mode;
int depth; int depth;
@ -2002,7 +2002,7 @@ init_options(Microtek2_Scanner *ms, u_int8_t current_scan_source)
SANE_Option_Descriptor *sod; SANE_Option_Descriptor *sod;
SANE_Status status; SANE_Status status;
Microtek2_Option_Value *val; Option_Value *val;
Microtek2_Device *md; Microtek2_Device *md;
Microtek2_Info *mi; Microtek2_Info *mi;
int tablesize; int tablesize;
@ -2842,7 +2842,7 @@ init_options(Microtek2_Scanner *ms, u_int8_t current_scan_source)
static SANE_Status static SANE_Status
set_option_dependencies(Microtek2_Scanner *ms, SANE_Option_Descriptor *sod, set_option_dependencies(Microtek2_Scanner *ms, SANE_Option_Descriptor *sod,
Microtek2_Option_Value *val) Option_Value *val)
{ {
Microtek2_Device *md; Microtek2_Device *md;
@ -3019,7 +3019,7 @@ sane_control_option(SANE_Handle handle, SANE_Int option,
Microtek2_Scanner *ms = handle; Microtek2_Scanner *ms = handle;
Microtek2_Device *md; Microtek2_Device *md;
Microtek2_Info *mi; Microtek2_Info *mi;
Microtek2_Option_Value *val; Option_Value *val;
SANE_Option_Descriptor *sod; SANE_Option_Descriptor *sod;
SANE_Status status; SANE_Status status;
@ -3577,7 +3577,7 @@ sane_get_option_descriptor(SANE_Handle handle, SANE_Int n)
/*---------- restore_gamma_options() -----------------------------------------*/ /*---------- restore_gamma_options() -----------------------------------------*/
static SANE_Status static SANE_Status
restore_gamma_options(SANE_Option_Descriptor *sod, Microtek2_Option_Value *val) restore_gamma_options(SANE_Option_Descriptor *sod, Option_Value *val)
{ {
DBG(40, "restore_gamma_options: val=%p, sod=%p\n", val, sod); DBG(40, "restore_gamma_options: val=%p, sod=%p\n", val, sod);

Wyświetl plik

@ -592,15 +592,6 @@ enum Microtek2_Option
/*60*/ NUM_OPTIONS /*60*/ NUM_OPTIONS
}; };
/******************************************************************************/
/* value structure for scanner options */
/******************************************************************************/
typedef union {
SANE_Word w;
SANE_Word *wa; /* word array */
SANE_String s;
} Microtek2_Option_Value;
/******************************************************************************/ /******************************************************************************/
/* Description of options not included in saneopts.h */ /* Description of options not included in saneopts.h */
@ -1031,7 +1022,7 @@ typedef struct Microtek2_Device {
typedef struct Microtek2_Scanner { typedef struct Microtek2_Scanner {
struct Microtek2_Scanner *next; /* for linked list */ struct Microtek2_Scanner *next; /* for linked list */
Microtek2_Device *dev; /* raw device info */ Microtek2_Device *dev; /* raw device info */
Microtek2_Option_Value val[NUM_OPTIONS + 1]; /* option values for session */ Option_Value val[NUM_OPTIONS + 1]; /* option values for session */
SANE_Parameters params; /* format, lastframe, lines, depth, ppl, bpl */ SANE_Parameters params; /* format, lastframe, lines, depth, ppl, bpl */
SANE_Option_Descriptor sod[NUM_OPTIONS + 1]; /* option list for session */ SANE_Option_Descriptor sod[NUM_OPTIONS + 1]; /* option list for session */
@ -1300,7 +1291,7 @@ static SANE_Status
reader_process(Microtek2_Scanner *); reader_process(Microtek2_Scanner *);
static SANE_Status static SANE_Status
restore_gamma_options(SANE_Option_Descriptor *, Microtek2_Option_Value *); restore_gamma_options(SANE_Option_Descriptor *, Option_Value *);
static SANE_Status static SANE_Status
segreg_copy_pixels(Microtek2_Scanner *); segreg_copy_pixels(Microtek2_Scanner *);
@ -1313,7 +1304,7 @@ set_exposure(Microtek2_Scanner *);
static SANE_Status static SANE_Status
set_option_dependencies(Microtek2_Scanner *, set_option_dependencies(Microtek2_Scanner *,
SANE_Option_Descriptor *, Microtek2_Option_Value *); SANE_Option_Descriptor *, Option_Value *);
static SANE_Status static SANE_Status
shading_function(Microtek2_Scanner *, u_int8_t *); shading_function(Microtek2_Scanner *, u_int8_t *);

Wyświetl plik

@ -74,12 +74,12 @@
#include "../include/sane/sanei_thread.h" #include "../include/sane/sanei_thread.h"
#endif #endif
#include "mustek.h"
#define BACKEND_NAME mustek #define BACKEND_NAME mustek
#include "../include/sane/sanei_backend.h" #include "../include/sane/sanei_backend.h"
#include "../include/sane/sanei_config.h" #include "../include/sane/sanei_config.h"
#include "mustek.h"
#ifndef SANE_I18N #ifndef SANE_I18N
#define SANE_I18N(text) text #define SANE_I18N(text) text
#endif #endif

Wyświetl plik

@ -202,14 +202,6 @@ enum Mustek_Option
NUM_OPTIONS NUM_OPTIONS
}; };
typedef union
{
SANE_Word w;
SANE_Word *wa; /* word array */
SANE_String s;
}
Option_Value;
typedef struct Mustek_Device typedef struct Mustek_Device
{ {
struct Mustek_Device *next; struct Mustek_Device *next;

Wyświetl plik

@ -75,14 +75,14 @@
#include "../include/sane/sanei.h" #include "../include/sane/sanei.h"
#include "../include/sane/saneopts.h" #include "../include/sane/saneopts.h"
#include "mustek_pp.h"
#include "mustek_pp_drivers.h"
#include "../include/sane/sanei_backend.h" #include "../include/sane/sanei_backend.h"
#include "../include/sane/sanei_config.h" #include "../include/sane/sanei_config.h"
#define MUSTEK_PP_CONFIG_FILE "mustek_pp.conf" #define MUSTEK_PP_CONFIG_FILE "mustek_pp.conf"
#include "mustek_pp.h"
#include "mustek_pp_drivers.h"
#define MIN(a,b) ((a) < (b) ? (a) : (b)) #define MIN(a,b) ((a) < (b) ? (a) : (b))
/* converts millimeter to pixels at a given resolution */ /* converts millimeter to pixels at a given resolution */

Wyświetl plik

@ -235,14 +235,6 @@ enum Mustek_pp_Option
NUM_OPTIONS NUM_OPTIONS
}; };
typedef union
{
SANE_Word w;
SANE_Word *wa; /* word array */
SANE_String s;
}
Option_Value;
typedef struct Mustek_pp_Handle { typedef struct Mustek_pp_Handle {

Wyświetl plik

@ -67,7 +67,6 @@
#include "../include/sane/sane.h" #include "../include/sane/sane.h"
#include "../include/sane/sanei.h" #include "../include/sane/sanei.h"
#include "../include/sane/saneopts.h" #include "../include/sane/saneopts.h"
#include "mustek_usb.h"
#define BACKEND_NAME mustek_usb #define BACKEND_NAME mustek_usb
@ -75,6 +74,7 @@
#include "../include/sane/sanei_config.h" #include "../include/sane/sanei_config.h"
#include "../include/sane/sanei_usb.h" #include "../include/sane/sanei_usb.h"
#include "mustek_usb.h"
#include "mustek_usb_high.c" #include "mustek_usb_high.c"
#ifndef SANE_I18N #ifndef SANE_I18N

Wyświetl plik

@ -164,14 +164,6 @@ enum Mustek_Usb_Option
NUM_OPTIONS NUM_OPTIONS
}; };
typedef union
{
SANE_Word w;
SANE_Word *wa; /* word array */
SANE_String s;
}
Option_Value;
typedef struct Mustek_Usb_Device typedef struct Mustek_Usb_Device
{ {
struct Mustek_Usb_Device *next; struct Mustek_Usb_Device *next;

Wyświetl plik

@ -121,8 +121,6 @@
*/ */
/* #define USE_RESOLUTION_LIST */ /* #define USE_RESOLUTION_LIST */
#include "nec.h"
#define BACKEND_NAME nec #define BACKEND_NAME nec
#include "sane/sanei_backend.h" #include "sane/sanei_backend.h"
@ -138,6 +136,8 @@
#include "sane/sanei_config.h" #include "sane/sanei_config.h"
#define NEC_CONFIG_FILE "nec.conf" #define NEC_CONFIG_FILE "nec.conf"
#include "nec.h"
static int num_devices = 0; static int num_devices = 0;
static NEC_Device *first_dev = NULL; static NEC_Device *first_dev = NULL;
static NEC_Scanner *first_handle = NULL; static NEC_Scanner *first_handle = NULL;

Wyświetl plik

@ -124,14 +124,6 @@ typedef enum
} }
NEC_Option; NEC_Option;
typedef union
{
SANE_Word w;
SANE_Word *wa; /* word array */
SANE_String s;
}
Option_Value;
#ifdef USE_FORK #ifdef USE_FORK
/* status defines for a buffer: /* status defines for a buffer:

Wyświetl plik

@ -210,14 +210,6 @@ enum Pie_Option
typedef union
{
SANE_Word w; /* word */
SANE_Word *wa; /* word array */
SANE_String s; /* string */
}
Option_Value;
/* This defines the information needed during calibration */ /* This defines the information needed during calibration */

Wyświetl plik

@ -49,8 +49,6 @@ extern int errno;
#include "sane/sane.h" #include "sane/sane.h"
#include "sane/saneopts.h" #include "sane/saneopts.h"
#include "pint.h"
#include <unistd.h> #include <unistd.h>
#include <fcntl.h> #include <fcntl.h>
@ -63,6 +61,8 @@ extern int errno;
#include "sane/sanei_config.h" #include "sane/sanei_config.h"
#define PINT_CONFIG_FILE "pint.conf" #define PINT_CONFIG_FILE "pint.conf"
#include "pint.h"
#define MM_PER_INCH 25.4 #define MM_PER_INCH 25.4
#define DECIPOINTS_PER_MM (720.0 / MM_PER_INCH) #define DECIPOINTS_PER_MM (720.0 / MM_PER_INCH)
#define TWELVEHUNDS_PER_MM (1200.0 / MM_PER_INCH) #define TWELVEHUNDS_PER_MM (1200.0 / MM_PER_INCH)

Wyświetl plik

@ -73,14 +73,6 @@ typedef enum
} }
PINT_Option; PINT_Option;
typedef union
{
SANE_Word w;
SANE_Word *wa; /* word array */
SANE_String s;
}
Option_Value;
typedef struct PINT_Device typedef struct PINT_Device
{ {
struct PINT_Device *next; struct PINT_Device *next;

Wyświetl plik

@ -208,13 +208,6 @@ typedef struct Plustek_Device
} Plustek_Device, *pPlustek_Device; } Plustek_Device, *pPlustek_Device;
typedef union
{
SANE_Word w;
SANE_Word *wa; /* word array */
SANE_String s;
} Option_Value;
typedef struct Plustek_Scanner typedef struct Plustek_Scanner
{ {
struct Plustek_Scanner *next; struct Plustek_Scanner *next;

Wyświetl plik

@ -92,7 +92,6 @@
#include "sane/sanei.h" #include "sane/sanei.h"
#include "sane/saneopts.h" #include "sane/saneopts.h"
#include "qcam.h"
#define BACKEND_NAME qcam #define BACKEND_NAME qcam
#include "sane/sanei_backend.h" #include "sane/sanei_backend.h"
@ -104,6 +103,8 @@
#include "sane/sanei_config.h" #include "sane/sanei_config.h"
#define QCAM_CONFIG_FILE "qcam.conf" #define QCAM_CONFIG_FILE "qcam.conf"
#include "qcam.h"
/* status bits */ /* status bits */
#define NeedRamTable (1 << 1) #define NeedRamTable (1 << 1)
#define BlackBalanceInProgress (1 << 6) #define BlackBalanceInProgress (1 << 6)

Wyświetl plik

@ -132,14 +132,6 @@ typedef enum
} }
QC_Option; QC_Option;
typedef union
{
SANE_Word w;
SANE_Word *wa; /* word array */
SANE_String s;
}
Option_Value;
typedef enum typedef enum
{ {
QC_UNIDIR, QC_UNIDIR,

Wyświetl plik

@ -58,7 +58,6 @@
#include "sane/sane.h" #include "sane/sane.h"
#include "sane/saneopts.h" #include "sane/saneopts.h"
#include "sane/sanei_scsi.h" #include "sane/sanei_scsi.h"
#include "ricoh.h"
#define BACKEND_NAME ricoh #define BACKEND_NAME ricoh
#include "sane/sanei_backend.h" #include "sane/sanei_backend.h"
@ -70,6 +69,8 @@
#include "sane/sanei_config.h" #include "sane/sanei_config.h"
#define RICOH_CONFIG_FILE "ricoh.conf" #define RICOH_CONFIG_FILE "ricoh.conf"
#include "ricoh.h"
#define MM_PER_INCH 25.4 #define MM_PER_INCH 25.4
#define MAX(a,b) ((a) > (b) ? (a) : (b)) #define MAX(a,b) ((a) > (b) ? (a) : (b))

Wyświetl plik

@ -193,14 +193,6 @@ typedef enum
} }
Ricoh_Option; Ricoh_Option;
typedef union
{
SANE_Word w;
SANE_Word *wa; /* word array */
SANE_String s;
}
Option_Value;
typedef struct Ricoh_Info typedef struct Ricoh_Info
{ {
SANE_Range xres_range; SANE_Range xres_range;

Wyświetl plik

@ -268,14 +268,6 @@ enum Sceptre_Option
OPT_NUM_OPTIONS OPT_NUM_OPTIONS
}; };
typedef union
{
SANE_Word w; /* word */
SANE_Word *wa; /* word array */
SANE_String s; /* string */
}
Option_Value;
/*--------------------------------------------------------------------------*/ /*--------------------------------------------------------------------------*/
/* /*

Wyświetl plik

@ -146,11 +146,12 @@
*/ */
/* #define USE_SEPARATE_Y_RESOLUTION */ /* #define USE_SEPARATE_Y_RESOLUTION */
#include <sharp.h>
#define BACKEND_NAME sharp #define BACKEND_NAME sharp
#include <sane/sanei_backend.h> #include <sane/sanei_backend.h>
#include <sharp.h>
#ifndef PATH_MAX #ifndef PATH_MAX
#define PATH_MAX 1024 #define PATH_MAX 1024
#endif #endif

Wyświetl plik

@ -121,14 +121,6 @@ typedef enum
} }
SHARP_Option; SHARP_Option;
typedef union
{
SANE_Word w;
SANE_Word *wa; /* word array */
SANE_String s;
}
Option_Value;
#ifdef USE_FORK #ifdef USE_FORK
/* status defines for a buffer: /* status defines for a buffer:

Wyświetl plik

@ -167,7 +167,7 @@ InitOptions(TInstance *this)
static double afFullBed[] = { 22.0,30.0, 50.0, 80.0 }; /* TODO: calculate exactly! */ static double afFullBed[] = { 22.0,30.0, 50.0, 80.0 }; /* TODO: calculate exactly! */
static const SANE_Range *aRangesXY[] = { &rangeXmm,&rangeYmm,&rangeXmm,&rangeYmm }; static const SANE_Range *aRangesXY[] = { &rangeXmm,&rangeYmm,&rangeXmm,&rangeYmm };
SANE_Option_Descriptor *pdesc; SANE_Option_Descriptor *pdesc;
TOptionValue *pval; Option_Value *pval;
/* shorthands */ /* shorthands */
pdesc=this->aoptDesc+iOpt; pdesc=this->aoptDesc+iOpt;
pval=this->aoptVal+iOpt; pval=this->aoptVal+iOpt;

Wyświetl plik

@ -157,13 +157,6 @@ typedef struct TScanState {
#define NUM_OPTIONS 16 #define NUM_OPTIONS 16
#endif #endif
typedef union
{
SANE_Word w;
SANE_Word *wa; /* word array */
SANE_String s;
}
TOptionValue;
typedef struct TDevice { typedef struct TDevice {
struct TDevice *pNext; struct TDevice *pNext;
@ -179,7 +172,7 @@ typedef struct TInstance {
#ifndef INSANE_VERSION #ifndef INSANE_VERSION
struct TInstance *pNext; struct TInstance *pNext;
SANE_Option_Descriptor aoptDesc[NUM_OPTIONS]; SANE_Option_Descriptor aoptDesc[NUM_OPTIONS];
TOptionValue aoptVal[NUM_OPTIONS]; Option_Value aoptVal[NUM_OPTIONS];
#endif #endif
SANE_Int agammaY[4096]; SANE_Int agammaY[4096];
SANE_Int agammaR[4096]; SANE_Int agammaR[4096];

Wyświetl plik

@ -80,13 +80,13 @@
#define MINOR_VERSION 4 #define MINOR_VERSION 4
#define BUILD 27 #define BUILD 27
#include "snapscan.h"
#define BACKEND_NAME snapscan #define BACKEND_NAME snapscan
#include "../include/sane/sanei_backend.h" #include "../include/sane/sanei_backend.h"
#include "../include/sane/saneopts.h" #include "../include/sane/saneopts.h"
#include "snapscan.h"
#define MIN(x,y) ((x)<(y) ? (x) : (y)) #define MIN(x,y) ((x)<(y) ? (x) : (y))
#define MAX(x,y) ((x)>(y) ? (x) : (y)) #define MAX(x,y) ((x)>(y) ? (x) : (y))
#define LIMIT(x,min,max) MIN(MAX(x, min), max) #define LIMIT(x,min,max) MIN(MAX(x, min), max)
@ -1762,6 +1762,12 @@ SANE_Status sane_get_select_fd (SANE_Handle h, SANE_Int * fd)
/* /*
* $Log$ * $Log$
* Revision 1.31 2003/09/12 16:10:33 hmg-guest
* Moved union Option_Value from backend header files to sanei_backend.h. No need
* to copy it over and over again. Changed header inclusion order in backend
* files to include backend.h after sanei_backend.h. Based on a patch from stef
* <stef-listes@wanadoo.fr>.
*
* Revision 1.30 2003/08/19 21:05:08 oliverschwartz * Revision 1.30 2003/08/19 21:05:08 oliverschwartz
* Scanner ID cleanup * Scanner ID cleanup
* *

Wyświetl plik

@ -255,15 +255,6 @@ typedef enum
NUM_OPTS /* dummy (gives number of options) */ NUM_OPTS /* dummy (gives number of options) */
} SnapScan_Options; } SnapScan_Options;
typedef union
{
SANE_Bool b;
SANE_Word w;
SANE_Word *wa; /* word array */
SANE_String s;
}
Option_Value;
typedef enum typedef enum
{ {
MD_COLOUR = 0, /* full colour */ MD_COLOUR = 0, /* full colour */
@ -378,6 +369,12 @@ struct snapscan_scanner
/* /*
* $Log$ * $Log$
* Revision 1.23 2003/09/12 16:10:33 hmg-guest
* Moved union Option_Value from backend header files to sanei_backend.h. No need
* to copy it over and over again. Changed header inclusion order in backend
* files to include backend.h after sanei_backend.h. Based on a patch from stef
* <stef-listes@wanadoo.fr>.
*
* Revision 1.22 2003/08/19 21:05:08 oliverschwartz * Revision 1.22 2003/08/19 21:05:08 oliverschwartz
* Scanner ID cleanup * Scanner ID cleanup
* *

Wyświetl plik

@ -56,7 +56,6 @@
#include "sane/saneopts.h" #include "sane/saneopts.h"
#include "sane/sanei_scsi.h" #include "sane/sanei_scsi.h"
#include "sane/sanei_config.h" #include "sane/sanei_config.h"
#include "tamarack.h"
/* For timeval... */ /* For timeval... */
#ifdef DEBUG #ifdef DEBUG
@ -67,6 +66,8 @@
#define BACKEND_NAME tamarack #define BACKEND_NAME tamarack
#include "sane/sanei_backend.h" #include "sane/sanei_backend.h"
#include "tamarack.h"
#ifndef PATH_MAX #ifndef PATH_MAX
# define PATH_MAX 1024 # define PATH_MAX 1024
#endif #endif

Wyświetl plik

@ -75,14 +75,6 @@ enum Tamarack_Option
}; };
typedef union
{
SANE_Word w;
SANE_Word *wa; /* word array */
SANE_String s;
}
Option_Value;
typedef struct Tamarack_Device typedef struct Tamarack_Device
{ {

Wyświetl plik

@ -252,14 +252,6 @@ enum Teco_Option
OPT_NUM_OPTIONS OPT_NUM_OPTIONS
}; };
typedef union
{
SANE_Word w; /* word */
SANE_Word *wa; /* word array */
SANE_String s; /* string */
}
Option_Value;
/*--------------------------------------------------------------------------*/ /*--------------------------------------------------------------------------*/
/* /*

Wyświetl plik

@ -303,16 +303,6 @@ enum Teco_Option
OPT_NUM_OPTIONS OPT_NUM_OPTIONS
}; };
typedef union
{
SANE_Word w; /* word */
SANE_Word *wa; /* word array */
SANE_String s; /* string */
SANE_Range white_level_range;
}
Option_Value;
/*--------------------------------------------------------------------------*/ /*--------------------------------------------------------------------------*/
/* /*

Wyświetl plik

@ -266,14 +266,6 @@ enum Teco_Option
OPT_NUM_OPTIONS OPT_NUM_OPTIONS
}; };
typedef union
{
SANE_Word w; /* word */
SANE_Word *wa; /* word array */
SANE_String s; /* string */
}
Option_Value;
/*--------------------------------------------------------------------------*/ /*--------------------------------------------------------------------------*/
/* /*

Wyświetl plik

@ -71,14 +71,6 @@ typedef enum
} }
test_opts; test_opts;
typedef union
{
SANE_Word w;
SANE_Word *wa; /* word array */
SANE_String s;
}
Option_Value;
typedef struct Test_Device typedef struct Test_Device
{ {

Wyświetl plik

@ -130,6 +130,9 @@ in ADF mode this is done often:
#include "sane/sanei_scsi.h" #include "sane/sanei_scsi.h"
#include "sane/sanei_debug.h" #include "sane/sanei_debug.h"
#include "sane/sanei_backend.h"
#include "sane/sanei_config.h"
#ifdef HAVE_OS2_H #ifdef HAVE_OS2_H
# include "../include/sane/sanei_thread.h" # include "../include/sane/sanei_thread.h"
#endif #endif
@ -149,8 +152,6 @@ in ADF mode this is done often:
#endif #endif
#include "umax.h" #include "umax.h"
#include "sane/sanei_backend.h"
#include "sane/sanei_config.h"
/* ------------------------------------------------------------ SANE DEFINES ------------------------------- */ /* ------------------------------------------------------------ SANE DEFINES ------------------------------- */

Wyświetl plik

@ -177,17 +177,6 @@ enum Umax_Option
}; };
/* --------------------------------------------------------------------------------------------------------- */
typedef union
{
SANE_Word w; /* word */
SANE_Word *wa; /* word array */
SANE_String s; /* string */
} Option_Value;
/* -------------------------------------------------------------------------------------------------------- */ /* -------------------------------------------------------------------------------------------------------- */

Wyświetl plik

@ -71,12 +71,12 @@
#include "../include/sane/saneopts.h" #include "../include/sane/saneopts.h"
#include "../include/sane/sanei_config.h" #include "../include/sane/sanei_config.h"
#include "umax_pp_mid.h"
#include "umax_pp.h"
#define BACKEND_NAME umax_pp #define BACKEND_NAME umax_pp
#include "../include/sane/sanei_backend.h" #include "../include/sane/sanei_backend.h"
#include "umax_pp_mid.h"
#include "umax_pp.h"
#ifdef DMALLOC #ifdef DMALLOC
#include "dmalloc.h" #include "dmalloc.h"

Wyświetl plik

@ -93,14 +93,6 @@ enum Umax_PP_Option
NUM_OPTIONS NUM_OPTIONS
}; };
typedef union
{
SANE_Word w;
SANE_Word *wa; /* word array */
SANE_String s;
}
Option_Value;
typedef struct Umax_PP_Descriptor typedef struct Umax_PP_Descriptor
{ {

Wyświetl plik

@ -75,8 +75,6 @@
#include <asm/types.h> /* XXX glibc */ #include <asm/types.h> /* XXX glibc */
#include <linux/videodev.h> #include <linux/videodev.h>
#include "v4l.h"
#define BACKEND_NAME v4l #define BACKEND_NAME v4l
#include "../include/sane/sanei_backend.h" #include "../include/sane/sanei_backend.h"
@ -87,6 +85,8 @@
#include "../include/sane/sanei_config.h" #include "../include/sane/sanei_config.h"
#define V4L_CONFIG_FILE "v4l.conf" #define V4L_CONFIG_FILE "v4l.conf"
#include "v4l.h"
static const SANE_Device **devlist = NULL; static const SANE_Device **devlist = NULL;
static int num_devices; static int num_devices;
static V4L_Device *first_dev; static V4L_Device *first_dev;

Wyświetl plik

@ -65,14 +65,6 @@ typedef enum
} }
V4L_Option; V4L_Option;
typedef union
{
SANE_Word w;
SANE_Word *wa; /* word array */
SANE_String s;
}
Option_Value;
typedef struct V4L_Device typedef struct V4L_Device
{ {
struct V4L_Device *next; struct V4L_Device *next;

Wyświetl plik

@ -1,35 +1,45 @@
/** @file sanei_backend.h
* Compatibility header file for backends
*
* This file provides some defines for macros missing on some platforms.
* It also has the SANE API entry points. sanei_backend.h muste be included
* by every backend.
*
* @sa sanei.h sanei_thread.h
*/
/** @name Compatibility macros
* @{
*/
#include <sane/sanei_debug.h> #include <sane/sanei_debug.h>
#ifdef HAVE_SYS_HW_H #ifdef HAVE_SYS_HW_H
/* OS/2 i/o-port access compatibility macros: */ /* OS/2 i/o-port access compatibility macros: */
# define inb(p) _inp8 (p) # define inb(p) _inp8 (p)
# define outb(v,p) _outp8 ((p),(v)) # define outb(v,p) _outp8 ((p),(v))
# define ioperm(b,l,o) _portaccess ((b),(b)+(l)-1) # define ioperm(b,l,o) _portaccess ((b),(b)+(l)-1)
# define HAVE_IOPERM 1 # define HAVE_IOPERM 1
#endif #endif
#ifndef HAVE_OS2_H
#include <fcntl.h>
#ifndef O_NONBLOCK #ifndef O_NONBLOCK
# ifdef O_NDELAY # ifdef O_NDELAY
# define O_NONBLOCK O_NDELAY # define O_NONBLOCK O_NDELAY
# else # else
# define O_NONBLOCK FNDELAY /* last resort */ # define O_NONBLOCK FNDELAY /* last resort */
# endif # endif
#endif #endif
#endif /* HAVE_OS2_H */
#ifndef __GLIBC__ #include <limits.h>
# ifndef u_int8_t #ifndef PATH_MAX
# define u_int8_t unsigned char # define PATH_MAX 1024
# endif
# ifndef u_int16_t
# define u_int16_t unsigned short
# endif
# ifndef u_int32_t
# define u_int32_t unsigned int
# endif
#endif #endif
#ifdef HAVE_SIGPROCMASK #ifdef HAVE_SIGPROCMASK
# define SIGACTION sigaction # define SIGACTION sigaction
#else #else
/* Just enough backwards compatibility that we get by in the backends /* Just enough backwards compatibility that we get by in the backends
@ -62,35 +72,38 @@
# undef SIG_SETMASK # undef SIG_SETMASK
# endif # endif
# define sigset_t int # define sigset_t int
# define sigemptyset(set) do { *(set) = 0; } while (0) # define sigemptyset(set) do { *(set) = 0; } while (0)
# define sigfillset(set) do { *(set) = ~0; } while (0) # define sigfillset(set) do { *(set) = ~0; } while (0)
# define sigaddset(set,signal) do { *(set) |= sigmask (signal); } while (0) # define sigaddset(set,signal) do { *(set) |= sigmask (signal); } while (0)
# define sigdelset(set,signal) do { *(set) &= ~sigmask (signal); } while (0) # define sigdelset(set,signal) do { *(set) &= ~sigmask (signal); } while (0)
# define sigaction(sig,new,old) sigvec (sig,new,old) # define sigaction(sig,new,old) sigvec (sig,new,old)
/* Note: it's not safe to just declare our own "struct sigaction" since /* Note: it's not safe to just declare our own "struct sigaction" since
some systems (e.g., some versions of OpenStep) declare that structure, some systems (e.g., some versions of OpenStep) declare that structure,
but do not implement sigprocmask(). Hard to believe, aint it? */ but do not implement sigprocmask(). Hard to believe, aint it? */
# define SIGACTION sigvec # define SIGACTION sigvec
# define SIG_BLOCK 1 # define SIG_BLOCK 1
# define SIG_UNBLOCK 2 # define SIG_UNBLOCK 2
# define SIG_SETMASK 3 # define SIG_SETMASK 3
#endif /* !HAVE_SIGPROCMASK */ #endif /* !HAVE_SIGPROCMASK */
/* @} */
/* Declare the entry points: */
/** @name Declaration of entry points:
* @{
*/
extern SANE_Status ENTRY(init) (SANE_Int *, SANE_Auth_Callback); extern SANE_Status ENTRY(init) (SANE_Int *, SANE_Auth_Callback);
extern SANE_Status ENTRY(get_devices) (const SANE_Device ***, SANE_Bool); extern SANE_Status ENTRY(get_devices) (const SANE_Device ***, SANE_Bool);
extern SANE_Status ENTRY(open) (SANE_String_Const, SANE_Handle *); extern SANE_Status ENTRY(open) (SANE_String_Const, SANE_Handle *);
extern const SANE_Option_Descriptor * extern const SANE_Option_Descriptor *
ENTRY(get_option_descriptor) (SANE_Handle, SANE_Int); ENTRY(get_option_descriptor) (SANE_Handle, SANE_Int);
extern SANE_Status ENTRY(control_option) (SANE_Handle, SANE_Int, SANE_Action, extern SANE_Status ENTRY(control_option) (SANE_Handle, SANE_Int, SANE_Action,
void *, SANE_Word *); void *, SANE_Word *);
extern SANE_Status ENTRY(get_parameters) (SANE_Handle, SANE_Parameters *); extern SANE_Status ENTRY(get_parameters) (SANE_Handle, SANE_Parameters *);
extern SANE_Status ENTRY(start) (SANE_Handle); extern SANE_Status ENTRY(start) (SANE_Handle);
extern SANE_Status ENTRY(read) (SANE_Handle, SANE_Byte *, SANE_Int, extern SANE_Status ENTRY(read) (SANE_Handle, SANE_Byte *, SANE_Int,
SANE_Int *); SANE_Int *);
extern SANE_Status ENTRY(set_io_mode) (SANE_Handle, SANE_Bool); extern SANE_Status ENTRY(set_io_mode) (SANE_Handle, SANE_Bool);
extern SANE_Status ENTRY(get_select_fd) (SANE_Handle, SANE_Int *); extern SANE_Status ENTRY(get_select_fd) (SANE_Handle, SANE_Int *);
extern void ENTRY(cancel) (SANE_Handle); extern void ENTRY(cancel) (SANE_Handle);
@ -100,17 +113,45 @@ extern void ENTRY(exit) (void);
#ifndef STUBS #ifndef STUBS
/* Now redirect sane_* calls to backend's functions: */ /* Now redirect sane_* calls to backend's functions: */
#define sane_init(a,b) ENTRY(init) (a,b) #define sane_init(a,b) ENTRY(init) (a,b)
#define sane_get_devices(a,b) ENTRY(get_devices) (a,b) #define sane_get_devices(a,b) ENTRY(get_devices) (a,b)
#define sane_open(a,b) ENTRY(open) (a,b) #define sane_open(a,b) ENTRY(open) (a,b)
#define sane_get_option_descriptor(a,b) ENTRY(get_option_descriptor) (a,b) #define sane_get_option_descriptor(a,b) ENTRY(get_option_descriptor) (a,b)
#define sane_control_option(a,b,c,d,e) ENTRY(control_option) (a,b,c,d,e) #define sane_control_option(a,b,c,d,e) ENTRY(control_option) (a,b,c,d,e)
#define sane_get_parameters(a,b) ENTRY(get_parameters) (a,b) #define sane_get_parameters(a,b) ENTRY(get_parameters) (a,b)
#define sane_start(a) ENTRY(start) (a) #define sane_start(a) ENTRY(start) (a)
#define sane_read(a,b,c,d) ENTRY(read) (a,b,c,d) #define sane_read(a,b,c,d) ENTRY(read) (a,b,c,d)
#define sane_set_io_mode(a,b) ENTRY(set_io_mode) (a,b) #define sane_set_io_mode(a,b) ENTRY(set_io_mode) (a,b)
#define sane_get_select_fd(a,b) ENTRY(get_select_fd) (a,b) #define sane_get_select_fd(a,b) ENTRY(get_select_fd) (a,b)
#define sane_cancel(a) ENTRY(cancel) (a) #define sane_cancel(a) ENTRY(cancel) (a)
#define sane_close(a) ENTRY(close) (a) #define sane_close(a) ENTRY(close) (a)
#define sane_exit(a) ENTRY(exit) (a) #define sane_exit(a) ENTRY(exit) (a)
#endif /* STUBS */ #endif /* STUBS */
/* @} */
/** @name Internationalization for SANE backends
* Add SANE_I18N() to all texts that can be translated.
* E.g. out_txt = SANE_I18N("Hello");
* @{
*/
#ifndef SANE_I18N
#define SANE_I18N(text) text
#endif
/* @} */
/** @name Option_Value union
* convenience union to access option values given to the backend
* @{
*/
#ifndef SANE_OPTION
#define SANE_OPTION 1
typedef union
{
SANE_Bool b;
SANE_Word w;
SANE_Word *wa; /* word array */
SANE_String s;
}
Option_Value;
#endif
/* @} */