• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /* sane - Scanner Access Now Easy.
2    Copyright (C) Marian Eichholz 2001
3    This file is part of the SANE package.
4 
5    This program is free software; you can redistribute it and/or
6    modify it under the terms of the GNU General Public License as
7    published by the Free Software Foundation; either version 2 of the
8    License, or (at your option) any later version.
9 
10    This program is distributed in the hope that it will be useful, but
11    WITHOUT ANY WARRANTY; without even the implied warranty of
12    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
13    General Public License for more details.
14 
15    You should have received a copy of the GNU General Public License
16    along with this program.  If not, see <https://www.gnu.org/licenses/>.
17 
18    As a special exception, the authors of SANE give permission for
19    additional uses of the libraries contained in this release of SANE.
20 
21    The exception is that, if you link a SANE library with other files
22    to produce an executable, this does not by itself cause the
23    resulting executable to be covered by the GNU General Public
24    License.  Your use of that executable is in no way restricted on
25    account of linking the SANE library code into it.
26 
27    This exception does not, however, invalidate any other reasons why
28    the executable file might be covered by the GNU General Public
29    License.
30 
31    If you submit changes to SANE to the maintainers to be included in
32    a subsequent release, you agree by submitting the changes that
33    those changes may be distributed with this exception intact.
34 
35    If you write modifications of your own for SANE, it is your choice
36    whether to permit this exception to apply to your modifications.
37    If you do not wish that, delete this exception notice.
38 */
39 
40 #ifndef SCANTOOL_H
41 #define SCANTOOL_H
42 
43 /* ======================================================================
44 
45  common declarations and definitions.
46 
47  (C) Marian Eichholz 2001
48 
49 ====================================================================== */
50 
51 #include <stdio.h>
52 #include <stdarg.h>
53 #include <stddef.h>
54 #include <string.h>
55 #include <unistd.h>
56 #include <stdlib.h>
57 #include <ctype.h>
58 #include <signal.h>
59 
60 #include <errno.h>
61 
62 #include <usb.h>
63 
64 #ifdef INSANE_VERSION
65 
66 /* make real exports */
67 #define __SM3600EXPORT__
68 
69 typedef enum { SANE_STATUS_GOOD,
70 	       SANE_STATUS_CANCELLED,
71 	       SANE_STATUS_UNSUPPORTED,
72 	       SANE_STATUS_EOF,
73 	       SANE_STATUS_NO_MEM,
74 	       SANE_STATUS_IO_ERROR,
75 	       SANE_STATUS_ACCESS_DENIED,
76 	       SANE_STATUS_INVAL,
77 	       SANE_STATUS_DEVICE_BUSY,
78 } SANE_Status;
79 
80 typedef int    SANE_Int;
81 
82 #endif
83 
84 #include "sm3600.h"
85 
86 extern char *achErrorMessages[];
87 
88 #ifdef INSANE_VERSION
89 
90 void DBG(int nLevel, const char *szFormat, ...);
91 
92 /* ====================================================================== */
93 
94 #ifdef INSTANTIATE_VARIABLES
95 #define GLOBAL
96 char *achErrorMessages[]={ "everything fine",
97 			  "operation canceled",
98 			  "unsupported function",
99 			  "end of scan or file",
100 			  "memory overflow",
101 			  "input/output error",
102 			  "permission problem",
103 			  "invalid parameter",
104 			  "device busy",
105 };
106 #else
107 #define GLOBAL extern
108 #endif
109 
110 #define PFMT_DEFAULT      0
111 #define PFMT_PBM          1
112 #define PFMT_PCL          2
113 #define PFMT_TIFFG4       3
114 
115 /* ====================================================================== */
116 
117 GLOBAL unsigned long      ulDebugMask;
118 GLOBAL TBool              bVerbose;
119 GLOBAL TBool              bInteractive;
120 GLOBAL char              *szLogFile;
121 GLOBAL char              *szScanFile;
122 GLOBAL int                idOutputFormat;
123 
124 GLOBAL TInstance          devInstance;
125 
126 /* ====================================================================== */
127 
128 #endif /* INSANE_VERSION */
129 
130 /* ====================================================================== */
131 
132 #endif
133