kopia lustrzana https://gitlab.com/sane-project/backends
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
rodzic
a922e76558
commit
0e70e29baf
25
ChangeLog
25
ChangeLog
|
@ -8,6 +8,31 @@
|
|||
* doc/.cvsignore sanei/.cvsignore: Added .libs. Sorted.
|
||||
* doc/descriptions/unsupported.desc: Updated HP ScanJet 2300c
|
||||
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>
|
||||
|
||||
|
|
|
@ -65,8 +65,6 @@
|
|||
#include "sane/sanei.h"
|
||||
#include "sane/saneopts.h"
|
||||
#include "sane/sanei_scsi.h"
|
||||
#include "abaton.h"
|
||||
|
||||
|
||||
#define BACKEND_NAME abaton
|
||||
#include "sane/sanei_backend.h"
|
||||
|
@ -78,6 +76,9 @@
|
|||
#include "sane/sanei_config.h"
|
||||
#define ABATON_CONFIG_FILE "abaton.conf"
|
||||
|
||||
#include "abaton.h"
|
||||
|
||||
|
||||
#define MM_PER_INCH 25.4
|
||||
|
||||
static int num_devices;
|
||||
|
|
|
@ -84,13 +84,6 @@ enum Abaton_Option
|
|||
NUM_OPTIONS
|
||||
};
|
||||
|
||||
typedef union
|
||||
{
|
||||
SANE_Word w;
|
||||
SANE_String s;
|
||||
}
|
||||
Option_Value;
|
||||
|
||||
enum ScannerModels
|
||||
{
|
||||
ABATON_300GS,
|
||||
|
|
|
@ -37,11 +37,12 @@
|
|||
#include "sane/sanei_config.h"
|
||||
#include "sane/saneopts.h"
|
||||
#include "sane/sanei_scsi.h"
|
||||
#include "agfafocus.h"
|
||||
|
||||
#define BACKEND_NAME agfafocus
|
||||
#include "sane/sanei_backend.h"
|
||||
|
||||
#include "agfafocus.h"
|
||||
|
||||
#ifndef PATH_MAX
|
||||
# define PATH_MAX 1024
|
||||
#endif
|
||||
|
|
|
@ -72,14 +72,6 @@ enum AgfaFocus_Option
|
|||
NUM_OPTIONS
|
||||
};
|
||||
|
||||
typedef union
|
||||
{
|
||||
SANE_Bool b;
|
||||
SANE_Word w;
|
||||
SANE_Word *wa; /* word array */
|
||||
SANE_String s;
|
||||
}
|
||||
Option_Value;
|
||||
|
||||
typedef struct AgfaFocus_Device
|
||||
{
|
||||
|
|
|
@ -63,7 +63,6 @@
|
|||
#include "sane/sanei.h"
|
||||
#include "sane/saneopts.h"
|
||||
#include "sane/sanei_scsi.h"
|
||||
#include "apple.h"
|
||||
|
||||
|
||||
/* SCSI commands that the Apple scanners understand: */
|
||||
|
@ -132,6 +131,8 @@
|
|||
#include "sane/sanei_config.h"
|
||||
#define APPLE_CONFIG_FILE "apple.conf"
|
||||
|
||||
#include "apple.h"
|
||||
|
||||
#define MM_PER_INCH 25.4
|
||||
|
||||
static int num_devices;
|
||||
|
|
|
@ -194,14 +194,6 @@ enum Apple_Option
|
|||
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 */
|
||||
/* But it Works well and I am not considering in "fix" it */
|
||||
|
|
|
@ -198,13 +198,6 @@ typedef enum
|
|||
}
|
||||
ARTEC_Software_Calibrate;
|
||||
|
||||
typedef union
|
||||
{
|
||||
SANE_Word w;
|
||||
SANE_Word *wa; /* word array */
|
||||
SANE_String s;
|
||||
}
|
||||
Option_Value;
|
||||
|
||||
typedef struct ARTEC_Device
|
||||
{
|
||||
|
|
|
@ -259,14 +259,6 @@ struct Artec48U_Line_Reader
|
|||
unsigned int **buffer_pointers_return);
|
||||
};
|
||||
|
||||
typedef union
|
||||
{
|
||||
SANE_Word w;
|
||||
SANE_Word *wa; /* word array */
|
||||
SANE_String s;
|
||||
}
|
||||
Option_Value;
|
||||
|
||||
struct Artec48U_Scanner
|
||||
{
|
||||
Artec48U_Scanner *next;
|
||||
|
|
|
@ -58,8 +58,6 @@
|
|||
#include <signal.h>
|
||||
#include <sys/stat.h>
|
||||
|
||||
#include "as6e.h"
|
||||
|
||||
#include "../include/sane/sane.h"
|
||||
#include "../include/sane/saneopts.h"
|
||||
|
||||
|
@ -67,6 +65,8 @@
|
|||
#include "../include/sane/sanei_backend.h"
|
||||
#include "../include/sane/sanei_config.h"
|
||||
|
||||
#include "as6e.h"
|
||||
|
||||
static int num_devices;
|
||||
static AS6E_Device *first_dev;
|
||||
static AS6E_Scan *first_handle;
|
||||
|
|
|
@ -51,13 +51,6 @@
|
|||
#include <sane/sane.h>
|
||||
|
||||
|
||||
typedef union
|
||||
{
|
||||
SANE_Word w; /* word */
|
||||
SANE_Word *wa; /* word array */
|
||||
SANE_String s; /* string */
|
||||
} Option_Value;
|
||||
|
||||
typedef enum
|
||||
{
|
||||
OPT_NUM_OPTS = 0,
|
||||
|
|
|
@ -171,13 +171,6 @@ enum Avision_Option
|
|||
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
|
||||
{
|
||||
/* in dpi */
|
||||
|
|
|
@ -56,12 +56,13 @@
|
|||
#include "sane/saneopts.h"
|
||||
#include "sane/sanei_scsi.h"
|
||||
#include "sane/sanei_config.h"
|
||||
#include "bh.h"
|
||||
|
||||
#define BACKEND_NAME bh
|
||||
#include "sane/sanei_backend.h"
|
||||
#define BUILD 4
|
||||
|
||||
#include "bh.h"
|
||||
|
||||
#define MIN(x,y) ((x)<(y) ? (x) : (y))
|
||||
#define MAX(x,y) ((x)>(y) ? (x) : (y))
|
||||
|
||||
|
|
|
@ -205,13 +205,6 @@ typedef enum
|
|||
|
||||
} 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 */
|
||||
#define MM_PER_INCH 25.4
|
||||
#define _OPT_VAL_WORD(s, o) ((s)->val[(o)].w)
|
||||
|
|
|
@ -109,7 +109,6 @@
|
|||
#include <sane/sane.h>
|
||||
#include <sane/saneopts.h>
|
||||
#include <sane/sanei_scsi.h>
|
||||
#include <canon.h>
|
||||
|
||||
#define BACKEND_NAME canon
|
||||
|
||||
|
@ -122,6 +121,8 @@
|
|||
#include <sane/sanei_config.h>
|
||||
#define CANON_CONFIG_FILE "canon.conf"
|
||||
|
||||
#include <canon.h>
|
||||
|
||||
#define MM_PER_INCH 25.4
|
||||
|
||||
static SANE_Byte primaryHigh[256], primaryLow[256], secondaryHigh[256],
|
||||
|
|
|
@ -216,14 +216,6 @@ typedef enum
|
|||
CANON_Option;
|
||||
|
||||
|
||||
typedef union
|
||||
{
|
||||
SANE_Word w;
|
||||
SANE_Word *wa; /* word array */
|
||||
SANE_String s;
|
||||
}
|
||||
Option_Value;
|
||||
|
||||
typedef struct CANON_Info
|
||||
{
|
||||
int model;
|
||||
|
|
|
@ -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
|
||||
{ int start; /* start position of image on film strip */
|
||||
int end; /* end position of image on film strip */
|
||||
|
|
|
@ -56,7 +56,6 @@
|
|||
#include "sane/sane.h"
|
||||
#include "sane/saneopts.h"
|
||||
#include "sane/sanei_scsi.h"
|
||||
#include "dmc.h"
|
||||
|
||||
#define BACKEND_NAME dmc
|
||||
#include "sane/sanei_backend.h"
|
||||
|
@ -68,6 +67,8 @@
|
|||
#include "sane/sanei_config.h"
|
||||
#define DMC_CONFIG_FILE "dmc.conf"
|
||||
|
||||
#include "dmc.h"
|
||||
|
||||
/* A linked-list of attached devices and handles */
|
||||
static DMC_Device *FirstDevice = NULL;
|
||||
static DMC_Camera *FirstHandle = NULL;
|
||||
|
|
|
@ -66,12 +66,6 @@ typedef enum {
|
|||
NUM_OPTIONS
|
||||
} DMC_Option;
|
||||
|
||||
typedef union {
|
||||
SANE_Word w;
|
||||
SANE_Word *wa; /* word array */
|
||||
SANE_String s;
|
||||
} Option_Value;
|
||||
|
||||
typedef struct DMC_Device {
|
||||
struct DMC_Device *next;
|
||||
SANE_Device sane;
|
||||
|
|
|
@ -311,15 +311,15 @@
|
|||
|
||||
#include <sane/sanei_pio.h>
|
||||
|
||||
#include "epson.h"
|
||||
#include "epson_scsi.h"
|
||||
#include "epson_usb.h"
|
||||
|
||||
#define BACKEND_NAME epson
|
||||
#include <sane/sanei_backend.h>
|
||||
|
||||
#include <sane/sanei_config.h>
|
||||
|
||||
#include "epson.h"
|
||||
#include "epson_scsi.h"
|
||||
#include "epson_usb.h"
|
||||
|
||||
#define EPSON_CONFIG_FILE "epson.conf"
|
||||
|
||||
#ifndef PATH_MAX
|
||||
|
|
|
@ -262,12 +262,6 @@ struct 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 {
|
||||
|
|
|
@ -12,13 +12,6 @@
|
|||
static int num_devices;
|
||||
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 driver. If a certain scanner cannot handle a certain option, there's
|
||||
|
|
|
@ -85,7 +85,6 @@
|
|||
#include "../include/sane/sane.h"
|
||||
#include "../include/sane/sanei.h"
|
||||
#include "../include/sane/saneopts.h"
|
||||
#include "gt68xx.h"
|
||||
|
||||
#define BACKEND_NAME gt68xx
|
||||
|
||||
|
@ -96,6 +95,7 @@
|
|||
#define SANE_I18N(text) text
|
||||
#endif
|
||||
|
||||
#include "gt68xx.h"
|
||||
#include "gt68xx_high.c"
|
||||
#include "gt68xx_devices.c"
|
||||
|
||||
|
|
|
@ -217,14 +217,6 @@ enum GT68xx_Option
|
|||
NUM_OPTIONS
|
||||
};
|
||||
|
||||
typedef union
|
||||
{
|
||||
SANE_Word w;
|
||||
SANE_Word *wa; /* word array */
|
||||
SANE_String s;
|
||||
}
|
||||
Option_Value;
|
||||
|
||||
/** Scanner object.
|
||||
*/
|
||||
struct GT68xx_Scanner
|
||||
|
|
|
@ -62,7 +62,6 @@
|
|||
#include "../include/sane/sane.h"
|
||||
#include "../include/sane/saneopts.h"
|
||||
#include "../include/sane/sanei_scsi.h"
|
||||
#include "ibm.h"
|
||||
|
||||
#define BACKEND_NAME ibm
|
||||
#include "../include/sane/sanei_backend.h"
|
||||
|
@ -74,6 +73,9 @@
|
|||
#include "../include/sane/sanei_config.h"
|
||||
#define IBM_CONFIG_FILE "ibm.conf"
|
||||
|
||||
#include "ibm.h"
|
||||
#include "ibm-scsi.c"
|
||||
|
||||
#define MM_PER_INCH 25.4
|
||||
#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 int is50 = 0; */
|
||||
|
||||
#include "ibm-scsi.c"
|
||||
|
||||
static size_t
|
||||
max_string_size (const SANE_String_Const strings[])
|
||||
|
|
|
@ -238,15 +238,6 @@ typedef enum
|
|||
}
|
||||
Ibm_Option;
|
||||
|
||||
typedef union
|
||||
{
|
||||
SANE_Bool b;
|
||||
SANE_Word w;
|
||||
SANE_Word *wa; /* word array */
|
||||
SANE_String s;
|
||||
}
|
||||
Option_Value;
|
||||
|
||||
typedef struct Ibm_Info
|
||||
{
|
||||
SANE_Range xres_range;
|
||||
|
|
|
@ -240,14 +240,6 @@ enum Leo_Option
|
|||
OPT_NUM_OPTIONS
|
||||
};
|
||||
|
||||
typedef union
|
||||
{
|
||||
SANE_Word w; /* word */
|
||||
SANE_Word *wa; /* word array */
|
||||
SANE_String s; /* string */
|
||||
}
|
||||
Option_Value;
|
||||
|
||||
/*--------------------------------------------------------------------------*/
|
||||
|
||||
/*
|
||||
|
|
|
@ -68,12 +68,12 @@
|
|||
#include "../include/sane/saneopts.h"
|
||||
#include "../include/sane/sanei_usb.h"
|
||||
|
||||
#include "ma1509.h"
|
||||
|
||||
#define BACKEND_NAME ma1509
|
||||
#include "../include/sane/sanei_backend.h"
|
||||
#include "../include/sane/sanei_config.h"
|
||||
|
||||
#include "ma1509.h"
|
||||
|
||||
#ifndef SANE_I18N
|
||||
#define SANE_I18N(text) text
|
||||
#endif
|
||||
|
|
|
@ -127,14 +127,6 @@ enum Ma1509_Option
|
|||
NUM_OPTIONS
|
||||
};
|
||||
|
||||
typedef union
|
||||
{
|
||||
SANE_Word w;
|
||||
SANE_Word *wa; /* word array */
|
||||
SANE_String s;
|
||||
}
|
||||
Option_Value;
|
||||
|
||||
typedef struct Ma1509_Device
|
||||
{
|
||||
struct Ma1509_Device *next;
|
||||
|
|
|
@ -204,14 +204,6 @@ enum Matsushita_Option
|
|||
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")
|
||||
|
|
|
@ -1047,7 +1047,7 @@ init_options(Microtek_Scanner *ms)
|
|||
{
|
||||
int i;
|
||||
SANE_Option_Descriptor *sod = ms->sod;
|
||||
Microtek_Option_Value *val = ms->val;
|
||||
Option_Value *val = ms->val;
|
||||
|
||||
DBG(15, "init_options...\n");
|
||||
|
||||
|
@ -3353,7 +3353,7 @@ sane_control_option (SANE_Handle handle,
|
|||
{
|
||||
Microtek_Scanner *scanner = handle;
|
||||
SANE_Option_Descriptor *sod;
|
||||
Microtek_Option_Value *val;
|
||||
Option_Value *val;
|
||||
SANE_Status status;
|
||||
|
||||
DBG(96, "sane_control_option (opt=%d,act=%d,val=%p,info=%p)\n",
|
||||
|
|
|
@ -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) *****/
|
||||
/*******************************************************************/
|
||||
|
@ -269,7 +258,7 @@ typedef struct Microtek_Scanner {
|
|||
Microtek_Device *dev; /* raw device info */
|
||||
|
||||
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 *gray_lut;
|
||||
|
|
|
@ -312,7 +312,7 @@ sane_get_parameters(SANE_Handle handle, SANE_Parameters *params)
|
|||
{
|
||||
Microtek2_Scanner *ms = handle;
|
||||
Microtek2_Device *md;
|
||||
Microtek2_Option_Value *val;
|
||||
Option_Value *val;
|
||||
Microtek2_Info *mi;
|
||||
int mode;
|
||||
int depth;
|
||||
|
@ -2002,7 +2002,7 @@ init_options(Microtek2_Scanner *ms, u_int8_t current_scan_source)
|
|||
|
||||
SANE_Option_Descriptor *sod;
|
||||
SANE_Status status;
|
||||
Microtek2_Option_Value *val;
|
||||
Option_Value *val;
|
||||
Microtek2_Device *md;
|
||||
Microtek2_Info *mi;
|
||||
int tablesize;
|
||||
|
@ -2842,7 +2842,7 @@ init_options(Microtek2_Scanner *ms, u_int8_t current_scan_source)
|
|||
|
||||
static SANE_Status
|
||||
set_option_dependencies(Microtek2_Scanner *ms, SANE_Option_Descriptor *sod,
|
||||
Microtek2_Option_Value *val)
|
||||
Option_Value *val)
|
||||
{
|
||||
|
||||
Microtek2_Device *md;
|
||||
|
@ -3019,7 +3019,7 @@ sane_control_option(SANE_Handle handle, SANE_Int option,
|
|||
Microtek2_Scanner *ms = handle;
|
||||
Microtek2_Device *md;
|
||||
Microtek2_Info *mi;
|
||||
Microtek2_Option_Value *val;
|
||||
Option_Value *val;
|
||||
SANE_Option_Descriptor *sod;
|
||||
SANE_Status status;
|
||||
|
||||
|
@ -3577,7 +3577,7 @@ sane_get_option_descriptor(SANE_Handle handle, SANE_Int n)
|
|||
/*---------- restore_gamma_options() -----------------------------------------*/
|
||||
|
||||
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);
|
||||
|
|
|
@ -592,15 +592,6 @@ enum Microtek2_Option
|
|||
/*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 */
|
||||
|
@ -1031,7 +1022,7 @@ typedef struct Microtek2_Device {
|
|||
typedef struct Microtek2_Scanner {
|
||||
struct Microtek2_Scanner *next; /* for linked list */
|
||||
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_Option_Descriptor sod[NUM_OPTIONS + 1]; /* option list for session */
|
||||
|
||||
|
@ -1300,7 +1291,7 @@ static SANE_Status
|
|||
reader_process(Microtek2_Scanner *);
|
||||
|
||||
static SANE_Status
|
||||
restore_gamma_options(SANE_Option_Descriptor *, Microtek2_Option_Value *);
|
||||
restore_gamma_options(SANE_Option_Descriptor *, Option_Value *);
|
||||
|
||||
static SANE_Status
|
||||
segreg_copy_pixels(Microtek2_Scanner *);
|
||||
|
@ -1313,7 +1304,7 @@ set_exposure(Microtek2_Scanner *);
|
|||
|
||||
static SANE_Status
|
||||
set_option_dependencies(Microtek2_Scanner *,
|
||||
SANE_Option_Descriptor *, Microtek2_Option_Value *);
|
||||
SANE_Option_Descriptor *, Option_Value *);
|
||||
|
||||
static SANE_Status
|
||||
shading_function(Microtek2_Scanner *, u_int8_t *);
|
||||
|
|
|
@ -74,12 +74,12 @@
|
|||
#include "../include/sane/sanei_thread.h"
|
||||
#endif
|
||||
|
||||
#include "mustek.h"
|
||||
|
||||
#define BACKEND_NAME mustek
|
||||
#include "../include/sane/sanei_backend.h"
|
||||
#include "../include/sane/sanei_config.h"
|
||||
|
||||
#include "mustek.h"
|
||||
|
||||
#ifndef SANE_I18N
|
||||
#define SANE_I18N(text) text
|
||||
#endif
|
||||
|
|
|
@ -202,14 +202,6 @@ enum Mustek_Option
|
|||
NUM_OPTIONS
|
||||
};
|
||||
|
||||
typedef union
|
||||
{
|
||||
SANE_Word w;
|
||||
SANE_Word *wa; /* word array */
|
||||
SANE_String s;
|
||||
}
|
||||
Option_Value;
|
||||
|
||||
typedef struct Mustek_Device
|
||||
{
|
||||
struct Mustek_Device *next;
|
||||
|
|
|
@ -75,14 +75,14 @@
|
|||
#include "../include/sane/sanei.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_config.h"
|
||||
#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))
|
||||
|
||||
/* converts millimeter to pixels at a given resolution */
|
||||
|
|
|
@ -235,14 +235,6 @@ enum Mustek_pp_Option
|
|||
NUM_OPTIONS
|
||||
};
|
||||
|
||||
typedef union
|
||||
{
|
||||
SANE_Word w;
|
||||
SANE_Word *wa; /* word array */
|
||||
SANE_String s;
|
||||
}
|
||||
Option_Value;
|
||||
|
||||
|
||||
typedef struct Mustek_pp_Handle {
|
||||
|
||||
|
|
|
@ -67,7 +67,6 @@
|
|||
#include "../include/sane/sane.h"
|
||||
#include "../include/sane/sanei.h"
|
||||
#include "../include/sane/saneopts.h"
|
||||
#include "mustek_usb.h"
|
||||
|
||||
#define BACKEND_NAME mustek_usb
|
||||
|
||||
|
@ -75,6 +74,7 @@
|
|||
#include "../include/sane/sanei_config.h"
|
||||
#include "../include/sane/sanei_usb.h"
|
||||
|
||||
#include "mustek_usb.h"
|
||||
#include "mustek_usb_high.c"
|
||||
|
||||
#ifndef SANE_I18N
|
||||
|
|
|
@ -164,14 +164,6 @@ enum Mustek_Usb_Option
|
|||
NUM_OPTIONS
|
||||
};
|
||||
|
||||
typedef union
|
||||
{
|
||||
SANE_Word w;
|
||||
SANE_Word *wa; /* word array */
|
||||
SANE_String s;
|
||||
}
|
||||
Option_Value;
|
||||
|
||||
typedef struct Mustek_Usb_Device
|
||||
{
|
||||
struct Mustek_Usb_Device *next;
|
||||
|
|
|
@ -121,8 +121,6 @@
|
|||
*/
|
||||
/* #define USE_RESOLUTION_LIST */
|
||||
|
||||
#include "nec.h"
|
||||
|
||||
#define BACKEND_NAME nec
|
||||
#include "sane/sanei_backend.h"
|
||||
|
||||
|
@ -138,6 +136,8 @@
|
|||
#include "sane/sanei_config.h"
|
||||
#define NEC_CONFIG_FILE "nec.conf"
|
||||
|
||||
#include "nec.h"
|
||||
|
||||
static int num_devices = 0;
|
||||
static NEC_Device *first_dev = NULL;
|
||||
static NEC_Scanner *first_handle = NULL;
|
||||
|
|
|
@ -124,14 +124,6 @@ typedef enum
|
|||
}
|
||||
NEC_Option;
|
||||
|
||||
typedef union
|
||||
{
|
||||
SANE_Word w;
|
||||
SANE_Word *wa; /* word array */
|
||||
SANE_String s;
|
||||
}
|
||||
Option_Value;
|
||||
|
||||
#ifdef USE_FORK
|
||||
|
||||
/* status defines for a buffer:
|
||||
|
|
|
@ -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 */
|
||||
|
||||
|
|
|
@ -49,8 +49,6 @@ extern int errno;
|
|||
#include "sane/sane.h"
|
||||
#include "sane/saneopts.h"
|
||||
|
||||
#include "pint.h"
|
||||
|
||||
#include <unistd.h>
|
||||
#include <fcntl.h>
|
||||
|
||||
|
@ -63,6 +61,8 @@ extern int errno;
|
|||
#include "sane/sanei_config.h"
|
||||
#define PINT_CONFIG_FILE "pint.conf"
|
||||
|
||||
#include "pint.h"
|
||||
|
||||
#define MM_PER_INCH 25.4
|
||||
#define DECIPOINTS_PER_MM (720.0 / MM_PER_INCH)
|
||||
#define TWELVEHUNDS_PER_MM (1200.0 / MM_PER_INCH)
|
||||
|
|
|
@ -73,14 +73,6 @@ typedef enum
|
|||
}
|
||||
PINT_Option;
|
||||
|
||||
typedef union
|
||||
{
|
||||
SANE_Word w;
|
||||
SANE_Word *wa; /* word array */
|
||||
SANE_String s;
|
||||
}
|
||||
Option_Value;
|
||||
|
||||
typedef struct PINT_Device
|
||||
{
|
||||
struct PINT_Device *next;
|
||||
|
|
|
@ -208,13 +208,6 @@ typedef struct Plustek_Device
|
|||
|
||||
} Plustek_Device, *pPlustek_Device;
|
||||
|
||||
typedef union
|
||||
{
|
||||
SANE_Word w;
|
||||
SANE_Word *wa; /* word array */
|
||||
SANE_String s;
|
||||
} Option_Value;
|
||||
|
||||
typedef struct Plustek_Scanner
|
||||
{
|
||||
struct Plustek_Scanner *next;
|
||||
|
|
|
@ -92,7 +92,6 @@
|
|||
#include "sane/sanei.h"
|
||||
#include "sane/saneopts.h"
|
||||
|
||||
#include "qcam.h"
|
||||
|
||||
#define BACKEND_NAME qcam
|
||||
#include "sane/sanei_backend.h"
|
||||
|
@ -104,6 +103,8 @@
|
|||
#include "sane/sanei_config.h"
|
||||
#define QCAM_CONFIG_FILE "qcam.conf"
|
||||
|
||||
#include "qcam.h"
|
||||
|
||||
/* status bits */
|
||||
#define NeedRamTable (1 << 1)
|
||||
#define BlackBalanceInProgress (1 << 6)
|
||||
|
|
|
@ -132,14 +132,6 @@ typedef enum
|
|||
}
|
||||
QC_Option;
|
||||
|
||||
typedef union
|
||||
{
|
||||
SANE_Word w;
|
||||
SANE_Word *wa; /* word array */
|
||||
SANE_String s;
|
||||
}
|
||||
Option_Value;
|
||||
|
||||
typedef enum
|
||||
{
|
||||
QC_UNIDIR,
|
||||
|
|
|
@ -58,7 +58,6 @@
|
|||
#include "sane/sane.h"
|
||||
#include "sane/saneopts.h"
|
||||
#include "sane/sanei_scsi.h"
|
||||
#include "ricoh.h"
|
||||
|
||||
#define BACKEND_NAME ricoh
|
||||
#include "sane/sanei_backend.h"
|
||||
|
@ -70,6 +69,8 @@
|
|||
#include "sane/sanei_config.h"
|
||||
#define RICOH_CONFIG_FILE "ricoh.conf"
|
||||
|
||||
#include "ricoh.h"
|
||||
|
||||
#define MM_PER_INCH 25.4
|
||||
#define MAX(a,b) ((a) > (b) ? (a) : (b))
|
||||
|
||||
|
|
|
@ -193,14 +193,6 @@ typedef enum
|
|||
}
|
||||
Ricoh_Option;
|
||||
|
||||
typedef union
|
||||
{
|
||||
SANE_Word w;
|
||||
SANE_Word *wa; /* word array */
|
||||
SANE_String s;
|
||||
}
|
||||
Option_Value;
|
||||
|
||||
typedef struct Ricoh_Info
|
||||
{
|
||||
SANE_Range xres_range;
|
||||
|
|
|
@ -268,14 +268,6 @@ enum Sceptre_Option
|
|||
OPT_NUM_OPTIONS
|
||||
};
|
||||
|
||||
typedef union
|
||||
{
|
||||
SANE_Word w; /* word */
|
||||
SANE_Word *wa; /* word array */
|
||||
SANE_String s; /* string */
|
||||
}
|
||||
Option_Value;
|
||||
|
||||
/*--------------------------------------------------------------------------*/
|
||||
|
||||
/*
|
||||
|
|
|
@ -146,11 +146,12 @@
|
|||
*/
|
||||
/* #define USE_SEPARATE_Y_RESOLUTION */
|
||||
|
||||
#include <sharp.h>
|
||||
|
||||
#define BACKEND_NAME sharp
|
||||
#include <sane/sanei_backend.h>
|
||||
|
||||
#include <sharp.h>
|
||||
|
||||
#ifndef PATH_MAX
|
||||
#define PATH_MAX 1024
|
||||
#endif
|
||||
|
|
|
@ -121,14 +121,6 @@ typedef enum
|
|||
}
|
||||
SHARP_Option;
|
||||
|
||||
typedef union
|
||||
{
|
||||
SANE_Word w;
|
||||
SANE_Word *wa; /* word array */
|
||||
SANE_String s;
|
||||
}
|
||||
Option_Value;
|
||||
|
||||
#ifdef USE_FORK
|
||||
|
||||
/* status defines for a buffer:
|
||||
|
|
|
@ -167,7 +167,7 @@ InitOptions(TInstance *this)
|
|||
static double afFullBed[] = { 22.0,30.0, 50.0, 80.0 }; /* TODO: calculate exactly! */
|
||||
static const SANE_Range *aRangesXY[] = { &rangeXmm,&rangeYmm,&rangeXmm,&rangeYmm };
|
||||
SANE_Option_Descriptor *pdesc;
|
||||
TOptionValue *pval;
|
||||
Option_Value *pval;
|
||||
/* shorthands */
|
||||
pdesc=this->aoptDesc+iOpt;
|
||||
pval=this->aoptVal+iOpt;
|
||||
|
|
|
@ -157,13 +157,6 @@ typedef struct TScanState {
|
|||
#define NUM_OPTIONS 16
|
||||
#endif
|
||||
|
||||
typedef union
|
||||
{
|
||||
SANE_Word w;
|
||||
SANE_Word *wa; /* word array */
|
||||
SANE_String s;
|
||||
}
|
||||
TOptionValue;
|
||||
|
||||
typedef struct TDevice {
|
||||
struct TDevice *pNext;
|
||||
|
@ -179,7 +172,7 @@ typedef struct TInstance {
|
|||
#ifndef INSANE_VERSION
|
||||
struct TInstance *pNext;
|
||||
SANE_Option_Descriptor aoptDesc[NUM_OPTIONS];
|
||||
TOptionValue aoptVal[NUM_OPTIONS];
|
||||
Option_Value aoptVal[NUM_OPTIONS];
|
||||
#endif
|
||||
SANE_Int agammaY[4096];
|
||||
SANE_Int agammaR[4096];
|
||||
|
|
|
@ -80,13 +80,13 @@
|
|||
#define MINOR_VERSION 4
|
||||
#define BUILD 27
|
||||
|
||||
#include "snapscan.h"
|
||||
|
||||
#define BACKEND_NAME snapscan
|
||||
|
||||
#include "../include/sane/sanei_backend.h"
|
||||
#include "../include/sane/saneopts.h"
|
||||
|
||||
#include "snapscan.h"
|
||||
|
||||
#define MIN(x,y) ((x)<(y) ? (x) : (y))
|
||||
#define MAX(x,y) ((x)>(y) ? (x) : (y))
|
||||
#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$
|
||||
* 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
|
||||
* Scanner ID cleanup
|
||||
*
|
||||
|
|
|
@ -255,15 +255,6 @@ typedef enum
|
|||
NUM_OPTS /* dummy (gives number of options) */
|
||||
} SnapScan_Options;
|
||||
|
||||
typedef union
|
||||
{
|
||||
SANE_Bool b;
|
||||
SANE_Word w;
|
||||
SANE_Word *wa; /* word array */
|
||||
SANE_String s;
|
||||
}
|
||||
Option_Value;
|
||||
|
||||
typedef enum
|
||||
{
|
||||
MD_COLOUR = 0, /* full colour */
|
||||
|
@ -378,6 +369,12 @@ struct snapscan_scanner
|
|||
|
||||
/*
|
||||
* $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
|
||||
* Scanner ID cleanup
|
||||
*
|
||||
|
|
|
@ -56,7 +56,6 @@
|
|||
#include "sane/saneopts.h"
|
||||
#include "sane/sanei_scsi.h"
|
||||
#include "sane/sanei_config.h"
|
||||
#include "tamarack.h"
|
||||
|
||||
/* For timeval... */
|
||||
#ifdef DEBUG
|
||||
|
@ -67,6 +66,8 @@
|
|||
#define BACKEND_NAME tamarack
|
||||
#include "sane/sanei_backend.h"
|
||||
|
||||
#include "tamarack.h"
|
||||
|
||||
#ifndef PATH_MAX
|
||||
# define PATH_MAX 1024
|
||||
#endif
|
||||
|
|
|
@ -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
|
||||
{
|
||||
|
|
|
@ -252,14 +252,6 @@ enum Teco_Option
|
|||
OPT_NUM_OPTIONS
|
||||
};
|
||||
|
||||
typedef union
|
||||
{
|
||||
SANE_Word w; /* word */
|
||||
SANE_Word *wa; /* word array */
|
||||
SANE_String s; /* string */
|
||||
}
|
||||
Option_Value;
|
||||
|
||||
/*--------------------------------------------------------------------------*/
|
||||
|
||||
/*
|
||||
|
|
|
@ -303,16 +303,6 @@ enum Teco_Option
|
|||
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;
|
||||
|
||||
/*--------------------------------------------------------------------------*/
|
||||
|
||||
/*
|
||||
|
|
|
@ -266,14 +266,6 @@ enum Teco_Option
|
|||
OPT_NUM_OPTIONS
|
||||
};
|
||||
|
||||
typedef union
|
||||
{
|
||||
SANE_Word w; /* word */
|
||||
SANE_Word *wa; /* word array */
|
||||
SANE_String s; /* string */
|
||||
}
|
||||
Option_Value;
|
||||
|
||||
/*--------------------------------------------------------------------------*/
|
||||
|
||||
/*
|
||||
|
|
|
@ -71,14 +71,6 @@ typedef enum
|
|||
}
|
||||
test_opts;
|
||||
|
||||
typedef union
|
||||
{
|
||||
SANE_Word w;
|
||||
SANE_Word *wa; /* word array */
|
||||
SANE_String s;
|
||||
}
|
||||
Option_Value;
|
||||
|
||||
|
||||
typedef struct Test_Device
|
||||
{
|
||||
|
|
|
@ -130,6 +130,9 @@ in ADF mode this is done often:
|
|||
#include "sane/sanei_scsi.h"
|
||||
#include "sane/sanei_debug.h"
|
||||
|
||||
#include "sane/sanei_backend.h"
|
||||
#include "sane/sanei_config.h"
|
||||
|
||||
#ifdef HAVE_OS2_H
|
||||
# include "../include/sane/sanei_thread.h"
|
||||
#endif
|
||||
|
@ -149,8 +152,6 @@ in ADF mode this is done often:
|
|||
#endif
|
||||
|
||||
#include "umax.h"
|
||||
#include "sane/sanei_backend.h"
|
||||
#include "sane/sanei_config.h"
|
||||
|
||||
/* ------------------------------------------------------------ SANE DEFINES ------------------------------- */
|
||||
|
||||
|
|
|
@ -177,17 +177,6 @@ enum Umax_Option
|
|||
};
|
||||
|
||||
|
||||
/* --------------------------------------------------------------------------------------------------------- */
|
||||
|
||||
|
||||
typedef union
|
||||
{
|
||||
SANE_Word w; /* word */
|
||||
SANE_Word *wa; /* word array */
|
||||
SANE_String s; /* string */
|
||||
} Option_Value;
|
||||
|
||||
|
||||
/* -------------------------------------------------------------------------------------------------------- */
|
||||
|
||||
|
||||
|
|
|
@ -71,12 +71,12 @@
|
|||
#include "../include/sane/saneopts.h"
|
||||
#include "../include/sane/sanei_config.h"
|
||||
|
||||
#include "umax_pp_mid.h"
|
||||
#include "umax_pp.h"
|
||||
|
||||
#define BACKEND_NAME umax_pp
|
||||
#include "../include/sane/sanei_backend.h"
|
||||
|
||||
#include "umax_pp_mid.h"
|
||||
#include "umax_pp.h"
|
||||
|
||||
#ifdef DMALLOC
|
||||
#include "dmalloc.h"
|
||||
|
|
|
@ -93,14 +93,6 @@ enum Umax_PP_Option
|
|||
NUM_OPTIONS
|
||||
};
|
||||
|
||||
typedef union
|
||||
{
|
||||
SANE_Word w;
|
||||
SANE_Word *wa; /* word array */
|
||||
SANE_String s;
|
||||
}
|
||||
Option_Value;
|
||||
|
||||
|
||||
typedef struct Umax_PP_Descriptor
|
||||
{
|
||||
|
|
|
@ -75,8 +75,6 @@
|
|||
#include <asm/types.h> /* XXX glibc */
|
||||
#include <linux/videodev.h>
|
||||
|
||||
#include "v4l.h"
|
||||
|
||||
#define BACKEND_NAME v4l
|
||||
#include "../include/sane/sanei_backend.h"
|
||||
|
||||
|
@ -87,6 +85,8 @@
|
|||
#include "../include/sane/sanei_config.h"
|
||||
#define V4L_CONFIG_FILE "v4l.conf"
|
||||
|
||||
#include "v4l.h"
|
||||
|
||||
static const SANE_Device **devlist = NULL;
|
||||
static int num_devices;
|
||||
static V4L_Device *first_dev;
|
||||
|
|
|
@ -65,14 +65,6 @@ typedef enum
|
|||
}
|
||||
V4L_Option;
|
||||
|
||||
typedef union
|
||||
{
|
||||
SANE_Word w;
|
||||
SANE_Word *wa; /* word array */
|
||||
SANE_String s;
|
||||
}
|
||||
Option_Value;
|
||||
|
||||
typedef struct V4L_Device
|
||||
{
|
||||
struct V4L_Device *next;
|
||||
|
|
|
@ -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>
|
||||
|
||||
#ifdef HAVE_SYS_HW_H
|
||||
/* OS/2 i/o-port access compatibility macros: */
|
||||
# define inb(p) _inp8 (p)
|
||||
# define outb(v,p) _outp8 ((p),(v))
|
||||
# define ioperm(b,l,o) _portaccess ((b),(b)+(l)-1)
|
||||
# define HAVE_IOPERM 1
|
||||
# define inb(p) _inp8 (p)
|
||||
# define outb(v,p) _outp8 ((p),(v))
|
||||
# define ioperm(b,l,o) _portaccess ((b),(b)+(l)-1)
|
||||
# define HAVE_IOPERM 1
|
||||
#endif
|
||||
|
||||
#ifndef HAVE_OS2_H
|
||||
#include <fcntl.h>
|
||||
#ifndef O_NONBLOCK
|
||||
# ifdef O_NDELAY
|
||||
# define O_NONBLOCK O_NDELAY
|
||||
# else
|
||||
# define O_NONBLOCK FNDELAY /* last resort */
|
||||
# define O_NONBLOCK FNDELAY /* last resort */
|
||||
# endif
|
||||
#endif
|
||||
#endif /* HAVE_OS2_H */
|
||||
|
||||
#ifndef __GLIBC__
|
||||
# ifndef u_int8_t
|
||||
# define u_int8_t unsigned char
|
||||
# endif
|
||||
# ifndef u_int16_t
|
||||
# define u_int16_t unsigned short
|
||||
# endif
|
||||
# ifndef u_int32_t
|
||||
# define u_int32_t unsigned int
|
||||
# endif
|
||||
#include <limits.h>
|
||||
#ifndef PATH_MAX
|
||||
# define PATH_MAX 1024
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_SIGPROCMASK
|
||||
# define SIGACTION sigaction
|
||||
# define SIGACTION sigaction
|
||||
#else
|
||||
|
||||
/* Just enough backwards compatibility that we get by in the backends
|
||||
|
@ -62,35 +72,38 @@
|
|||
# undef SIG_SETMASK
|
||||
# endif
|
||||
|
||||
# define sigset_t int
|
||||
# define sigemptyset(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 sigdelset(set,signal) do { *(set) &= ~sigmask (signal); } while (0)
|
||||
# define sigaction(sig,new,old) sigvec (sig,new,old)
|
||||
# define sigset_t int
|
||||
# define sigemptyset(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 sigdelset(set,signal) do { *(set) &= ~sigmask (signal); } while (0)
|
||||
# define sigaction(sig,new,old) sigvec (sig,new,old)
|
||||
|
||||
/* Note: it's not safe to just declare our own "struct sigaction" since
|
||||
some systems (e.g., some versions of OpenStep) declare that structure,
|
||||
but do not implement sigprocmask(). Hard to believe, aint it? */
|
||||
# define SIGACTION sigvec
|
||||
# define SIG_BLOCK 1
|
||||
# define SIG_UNBLOCK 2
|
||||
# define SIG_SETMASK 3
|
||||
# define SIGACTION sigvec
|
||||
# define SIG_BLOCK 1
|
||||
# define SIG_UNBLOCK 2
|
||||
# define SIG_SETMASK 3
|
||||
#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(get_devices) (const SANE_Device ***, SANE_Bool);
|
||||
extern SANE_Status ENTRY(open) (SANE_String_Const, SANE_Handle *);
|
||||
extern const SANE_Option_Descriptor *
|
||||
ENTRY(get_option_descriptor) (SANE_Handle, SANE_Int);
|
||||
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(start) (SANE_Handle);
|
||||
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(get_select_fd) (SANE_Handle, SANE_Int *);
|
||||
extern void ENTRY(cancel) (SANE_Handle);
|
||||
|
@ -100,17 +113,45 @@ extern void ENTRY(exit) (void);
|
|||
#ifndef STUBS
|
||||
/* Now redirect sane_* calls to backend's functions: */
|
||||
|
||||
#define sane_init(a,b) ENTRY(init) (a,b)
|
||||
#define sane_get_devices(a,b) ENTRY(get_devices) (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_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_start(a) ENTRY(start) (a)
|
||||
#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_get_select_fd(a,b) ENTRY(get_select_fd) (a,b)
|
||||
#define sane_cancel(a) ENTRY(cancel) (a)
|
||||
#define sane_close(a) ENTRY(close) (a)
|
||||
#define sane_exit(a) ENTRY(exit) (a)
|
||||
#define sane_init(a,b) ENTRY(init) (a,b)
|
||||
#define sane_get_devices(a,b) ENTRY(get_devices) (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_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_start(a) ENTRY(start) (a)
|
||||
#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_get_select_fd(a,b) ENTRY(get_select_fd) (a,b)
|
||||
#define sane_cancel(a) ENTRY(cancel) (a)
|
||||
#define sane_close(a) ENTRY(close) (a)
|
||||
#define sane_exit(a) ENTRY(exit) (a)
|
||||
#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
|
||||
/* @} */
|
||||
|
|
Ładowanie…
Reference in New Issue