1#ifndef st400_h 2#define st400_h 3 4#define ST400_CONFIG_FILE "st400.conf" 5#define ST400_DEFAULT_DEVICE "/dev/scanner" 6 7/* maximum scanning area in inch (guessed) */ 8#define ST400_MAX_X 8.5 9#define ST400_MAX_Y 12.0 10 11enum ST400_Option { 12 OPT_NUM_OPTS = 0, 13 14 OPT_MODE_GROUP, 15 OPT_RESOLUTION, 16 OPT_DEPTH, 17 OPT_THRESHOLD, 18 19 OPT_GEOMETRY_GROUP, 20 OPT_TL_X, 21 OPT_TL_Y, 22 OPT_BR_X, 23 OPT_BR_Y, 24 25 NUM_OPTIONS /* must be last */ 26}; 27 28typedef struct { 29 size_t inq_voffset; /* offset in INQUIRY result */ 30 char *inq_vendor; 31 size_t inq_moffset; /* offset in INQUIRY result */ 32 char *inq_model; 33 34 size_t bits; /* 6 or 8 */ 35 unsigned long bufsize; /* internal buffer of scanner */ 36 unsigned long maxread; /* max bytes to read in a cmd (0 = no limit) */ 37 SANE_Int *dpi_list; /* NULL for default list */ 38 39 char *sane_vendor; 40 char *sane_model; 41 char *sane_type; 42} ST400_Model; 43 44 45typedef struct ST400_Device { 46 struct ST400_Device *next; 47 48 SANE_Device sane; 49 SANE_Parameters params; 50 SANE_Option_Descriptor opt[NUM_OPTIONS]; 51 SANE_Word val[NUM_OPTIONS]; 52 53 struct { 54 unsigned open :1; 55 unsigned scanning :1; 56 unsigned eof :1; 57 } status; 58 59 /* pixel values of entire scan window - for convenience */ 60 unsigned short x, y, w, h; 61 62 int fd; /* SCSI filedescriptor */ 63 64 /* backend buffer */ 65 SANE_Byte *buffer; 66 size_t bufsize; 67 SANE_Byte *bufp; /* next byte to transfer */ 68 size_t bytes_in_buffer; 69 70 ST400_Model *model; 71 72 /* scanner buffer */ 73 unsigned short wy, wh; /* current subwindow */ 74 unsigned long bytes_in_scanner; 75 unsigned short lines_to_read; 76} ST400_Device; 77 78#endif /* st400_h */ 79/* The End */ 80