SANEI 1.3.1.74-c434
sanei.h
Go to the documentation of this file.
1/* sane - Scanner Access Now Easy.
2 Copyright (C) 1996 David Mosberger-Tang and Andreas Beck
3 Copyright (C) 2002, 2003 Henning Meier-Geinitz
4
5 This file is part of the SANE package.
6
7 SANE is free software; you can redistribute it and/or modify it
8 under the terms of the GNU General Public License as published by
9 the Free Software Foundation; either version 2 of the License, or
10 (at your option) any later version.
11
12 SANE is distributed in the hope that it will be useful, but WITHOUT
13 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
14 or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
15 License for more details.
16
17 You should have received a copy of the GNU General Public License
18 along with sane; see the file COPYING.
19 If not, see <https://www.gnu.org/licenses/>.
20
21 As a special exception, the authors of SANE give permission for
22 additional uses of the libraries contained in this release of SANE.
23
24 The exception is that, if you link a SANE library with other files
25 to produce an executable, this does not by itself cause the
26 resulting executable to be covered by the GNU General Public
27 License. Your use of that executable is in no way restricted on
28 account of linking the SANE library code into it.
29
30 This exception does not, however, invalidate any other reasons why
31 the executable file might be covered by the GNU General Public
32 License.
33
34 If you submit changes to SANE to the maintainers to be included in
35 a subsequent release, you agree by submitting the changes that
36 those changes may be distributed with this exception intact.
37
38 If you write modifications of your own for SANE, it is your choice
39 whether to permit this exception to apply to your modifications.
40 If you do not wish that, delete this exception notice.
41*/
42
48/* Doxygen documentation */
49
85#ifndef sanei_h
86#define sanei_h
87
88#include <sane/sane.h>
89
90#ifdef __cplusplus
91extern "C" {
92#endif
93
142/* @} */
143
144/* A few convenience macros: */
145
147#ifdef __GNUC__
148#define __sane_unused__ __attribute__((unused))
149#else
150#define __sane_unused__
151#endif
152
154#define NELEMS(a) ((int)(sizeof (a) / sizeof (a[0])))
155
157#define STRINGIFY1(x) #x
159#define STRINGIFY(x) STRINGIFY1(x)
160
162#define PASTE1(x,y) x##y
164#define PASTE(x,y) PASTE1(x,y)
165
166extern SANE_Status sanei_check_value (const SANE_Option_Descriptor * opt,
167 void * value);
168
169extern SANE_Status sanei_constrain_value (const SANE_Option_Descriptor * opt,
170 void * value, SANE_Word * info);
171
172#ifdef __cplusplus
173} // extern "C"
174#endif
175
176#endif /* sanei_h */
SANE_Status sanei_check_value(const SANE_Option_Descriptor *opt, void *value)
Check the constraints of a SANE option.
SANE_Status sanei_constrain_value(const SANE_Option_Descriptor *opt, void *value, SANE_Word *info)
Check the constraints of a SANE option and adjust its value if necessary.