diff options
author | Mattia Rizzolo <mattia@mapreri.org> | 2014-10-03 14:04:58 +0000 |
---|---|---|
committer | Mattia Rizzolo <mattia@mapreri.org> | 2014-10-03 14:04:58 +0000 |
commit | 2d113e8792747151bf5d830f1a1485f2f951f940 (patch) | |
tree | f29e273d53fe5735cdac171504d798bf45ea2007 /include |
Imported Upstream version 0.50upstream/0.50
Diffstat (limited to 'include')
-rw-r--r-- | include/Makefile | 8 | ||||
-rw-r--r-- | include/Makefile.in | 7 | ||||
-rw-r--r-- | include/getopt.h | 129 | ||||
-rw-r--r-- | include/lalloca.h | 47 | ||||
-rw-r--r-- | include/sane/config.h.in | 342 | ||||
-rw-r--r-- | include/sane/sanei_backend.h | 116 | ||||
-rw-r--r-- | include/sane/sanei_config.h | 76 | ||||
-rw-r--r-- | include/sane/sanei_signal.h | 50 | ||||
-rw-r--r-- | include/sane/stamp-h | 1 |
9 files changed, 776 insertions, 0 deletions
diff --git a/include/Makefile b/include/Makefile new file mode 100644 index 0000000..214d47e --- /dev/null +++ b/include/Makefile @@ -0,0 +1,8 @@ +# Generated automatically from Makefile.in by configure. +# This is just a dummy to ensure that the include directory gets created +# in a shadow-build. + +all: + +distclean: + rm -f Makefile diff --git a/include/Makefile.in b/include/Makefile.in new file mode 100644 index 0000000..c8de918 --- /dev/null +++ b/include/Makefile.in @@ -0,0 +1,7 @@ +# This is just a dummy to ensure that the include directory gets created +# in a shadow-build. + +all: + +distclean: + rm -f Makefile diff --git a/include/getopt.h b/include/getopt.h new file mode 100644 index 0000000..aa7877f --- /dev/null +++ b/include/getopt.h @@ -0,0 +1,129 @@ +/* Declarations for getopt. + Copyright (C) 1989, 90, 91, 92, 93, 94 Free Software Foundation, Inc. + + This program is free software; you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by the + Free Software Foundation; either version 2, or (at your option) any + later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software Foundation, + Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + +#ifndef _GETOPT_H +#define _GETOPT_H 1 + +#ifdef __cplusplus +extern "C" { +#endif + +/* For communication from `getopt' to the caller. + When `getopt' finds an option that takes an argument, + the argument value is returned here. + Also, when `ordering' is RETURN_IN_ORDER, + each non-option ARGV-element is returned here. */ + +extern char *optarg; + +/* Index in ARGV of the next element to be scanned. + This is used for communication to and from the caller + and for communication between successive calls to `getopt'. + + On entry to `getopt', zero means this is the first call; initialize. + + When `getopt' returns EOF, this is the index of the first of the + non-option elements that the caller should itself scan. + + Otherwise, `optind' communicates from one call to the next + how much of ARGV has been scanned so far. */ + +extern int optind; + +/* Callers store zero here to inhibit the error message `getopt' prints + for unrecognized options. */ + +extern int opterr; + +/* Set to an option character which was unrecognized. */ + +extern int optopt; + +/* Describe the long-named options requested by the application. + The LONG_OPTIONS argument to getopt_long or getopt_long_only is a vector + of `struct option' terminated by an element containing a name which is + zero. + + The field `has_arg' is: + no_argument (or 0) if the option does not take an argument, + required_argument (or 1) if the option requires an argument, + optional_argument (or 2) if the option takes an optional argument. + + If the field `flag' is not NULL, it points to a variable that is set + to the value given in the field `val' when the option is found, but + left unchanged if the option is not found. + + To have a long-named option do something other than set an `int' to + a compiled-in constant, such as set a value from `optarg', set the + option's `flag' field to zero and its `val' field to a nonzero + value (the equivalent single-letter option character, if there is + one). For long options that have a zero `flag' field, `getopt' + returns the contents of the `val' field. */ + +struct option +{ +#if defined (__STDC__) && __STDC__ + const char *name; +#else + char *name; +#endif + /* has_arg can't be an enum because some compilers complain about + type mismatches in all the code that assumes it is an int. */ + int has_arg; + int *flag; + int val; +}; + +/* Names for the values of the `has_arg' field of `struct option'. */ + +#define no_argument 0 +#define required_argument 1 +#define optional_argument 2 + +#if defined (__STDC__) && __STDC__ +#ifdef __GNU_LIBRARY__ +/* Many other libraries have conflicting prototypes for getopt, with + differences in the consts, in stdlib.h. To avoid compilation + errors, only prototype getopt for the GNU C library. */ +extern int getopt (int argc, char *const *argv, const char *shortopts); +#else /* not __GNU_LIBRARY__ */ +extern int getopt (); +#endif /* __GNU_LIBRARY__ */ +extern int getopt_long (int argc, char *const *argv, const char *shortopts, + const struct option *longopts, int *longind); +extern int getopt_long_only (int argc, char *const *argv, + const char *shortopts, + const struct option *longopts, int *longind); + +/* Internal only. Users should not call this directly. */ +extern int _getopt_internal (int argc, char *const *argv, + const char *shortopts, + const struct option *longopts, int *longind, + int long_only); +#else /* not __STDC__ */ +extern int getopt (); +extern int getopt_long (); +extern int getopt_long_only (); + +extern int _getopt_internal (); +#endif /* __STDC__ */ + +#ifdef __cplusplus +} +#endif + +#endif /* _GETOPT_H */ diff --git a/include/lalloca.h b/include/lalloca.h new file mode 100644 index 0000000..0fd4fc1 --- /dev/null +++ b/include/lalloca.h @@ -0,0 +1,47 @@ +/* sane - Scanner Access Now Easy. + Copyright (C) 1997 The Free Software Foundation + This file is part of the SANE package. + + SANE is free software; you can redistribute it and/or modify it under + the terms of the GNU General Public License as published by the Free + Software Foundation; either version 2 of the License, or (at your + option) any later version. + + SANE is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + for more details. + + You should have received a copy of the GNU General Public License + along with sane; see the file COPYING. If not, write to the Free + Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + + This file implements a dynamic linking based SANE meta backend. It + allows managing an arbitrary number of SANE backends by using + dynamic linking to load backends on demand. */ + +#ifndef lalloca_h +#define lalloca_h + +/* AIX requires this to be the first thing in the file. */ +#ifdef __GNUC__ +# define alloca __builtin_alloca +#else +# if HAVE_ALLOCA_H +# include <alloca.h> +# else +# ifdef _AIX +#pragma alloca +# else +# ifndef alloca /* predefined by HP cc +Olibcalls */ +# if __STDC__ +void *alloca (); +# else +char *alloca (); +# endif +# endif +# endif +# endif +#endif + +#endif /* lalloca_h */ diff --git a/include/sane/config.h.in b/include/sane/config.h.in new file mode 100644 index 0000000..28fffdc --- /dev/null +++ b/include/sane/config.h.in @@ -0,0 +1,342 @@ +#ifndef SANE_CONFIG_H +#define SANE_CONFIG_H + +/* Define if on AIX 3. + System headers sometimes define this. + We just want to avoid a redefinition error message. */ +#ifndef _ALL_SOURCE +#undef _ALL_SOURCE +#endif + +/* Define if using alloca.c. */ +#undef C_ALLOCA + +/* Define to empty if the keyword does not work. */ +#undef const + +/* Define to one of _getb67, GETB67, getb67 for Cray-2 and Cray-YMP systems. + This function is required for alloca.c support on those systems. */ +#undef CRAY_STACKSEG_END + +/* Define if you have alloca, as a function or macro. */ +#undef HAVE_ALLOCA + +/* Define if you have <alloca.h> and it should be used (not on Ultrix). */ +#undef HAVE_ALLOCA_H + +/* Define if you have a working `mmap' system call. */ +#undef HAVE_MMAP + +/* Define as __inline if that's what the C compiler calls it. */ +#undef inline + +/* Define if on MINIX. */ +#undef _MINIX + +/* Define to `long' if <sys/types.h> doesn't define. */ +#undef off_t + +/* Define if the system does not provide POSIX.1 features except + with this defined. */ +#undef _POSIX_1_SOURCE + +/* Define if you need to in order for stat and other things to work. */ +#undef _POSIX_SOURCE + +/* Define to `unsigned' if <sys/types.h> doesn't define. */ +#undef size_t + +/* Define to `unsigned char' if <sys/types.h> doesn't define. */ +#undef u_char + +/* Define to `unsigned int' if <sys/types.h> doesn't define. */ +#undef u_int + +/* Define to `unsigned long' if <sys/types.h> doesn't define. */ +#undef u_long + +/* Define to `long' if <sys/types.h> doesn't define. */ +#undef ssize_t + +/* Define to `int' if <sys/types.h> doesn't define. */ +#undef pid_t + +/* Define scsireq_t as `struct scsireq' if necessary. */ +#undef scsireq_t + +/* Define to the return type of signal handlers. */ +#undef RETSIGTYPE + +/* If using the C implementation of alloca, define if you know the + direction of stack growth for your system; otherwise it will be + automatically deduced at run-time. + STACK_DIRECTION > 0 => grows toward higher addresses + STACK_DIRECTION < 0 => grows toward lower addresses + STACK_DIRECTION = 0 => direction of growth unknown + */ +#undef STACK_DIRECTION + +/* Define if you have the ANSI C header files. */ +#undef STDC_HEADERS + +/* Define to 1 if NLS is requested. */ +#undef ENABLE_NLS + +/* Define as 1 if you have catgets and don't want to use GNU gettext. */ +#undef HAVE_CATGETS + +/* Define as 1 if you have gettext and don't want to use GNU gettext. */ +#undef HAVE_GETTEXT + +/* Define if your locale.h file contains LC_MESSAGES. */ +#undef HAVE_LC_MESSAGES + +/* Define to 1 if you have the stpcpy function. */ +#undef HAVE_STPCPY + +/* Define to the name of the distribution. */ +#undef PACKAGE + +/* The concatenation of the strings PACKAGE, "-", and VERSION. */ +#undef PACKAGE_VERSION + +/* Define to the version of the distribution. */ +#undef VERSION + +/* Define if you have the __argz_count function. */ +#undef HAVE___ARGZ_COUNT + +/* Define if you have the __argz_next function. */ +#undef HAVE___ARGZ_NEXT + +/* Define if you have the __argz_stringify function. */ +#undef HAVE___ARGZ_STRINGIFY + +/* Define if you have the dcgettext function. */ +#undef HAVE_DCGETTEXT + +/* Define if you have the getcwd function. */ +#undef HAVE_GETCWD + +/* Define if you have the getpagesize function. */ +#undef HAVE_GETPAGESIZE + +/* Define if you have the atexit function. */ +#undef HAVE_ATEXIT + +/* Define if you have the ioperm function. */ +#undef HAVE_IOPERM + +/* Define if you have the mkdir function. */ +#undef HAVE_MKDIR + +/* Define if you have the munmap function. */ +#undef HAVE_MUNMAP + +/* Define if you have the putenv function. */ +#undef HAVE_PUTENV + +/* Define if you have the scsireq_enter function. */ +#undef HAVE_SCSIREQ_ENTER + +/* Define if you have the sigprocmask function. */ +#undef HAVE_SIGPROCMASK + +/* Define if you have the setenv function. */ +#undef HAVE_SETENV + +/* Define if you have the setlocale function. */ +#undef HAVE_SETLOCALE + +/* Define if you have the stpcpy function. */ +#undef HAVE_STPCPY + +/* Define if you have the strcasecmp function. */ +#undef HAVE_STRCASECMP + +/* Define if you have the strchr function. */ +#undef HAVE_STRCHR + +/* Define if you have the strdup function. */ +#undef HAVE_STRDUP + +/* Define if you have the strncasecmp function. */ +#undef HAVE_STRNCASECMP + +/* Define if you have the strndup function. */ +#undef HAVE_STRNDUP + +/* Define if you have the strftime function. */ +#undef HAVE_STRFTIME + +/* Define if you have the strstr function. */ +#undef HAVE_STRSTR + +/* Define if you have the strsep function. */ +#undef HAVE_STRSEP + +/* Define if you have the strtod function. */ +#undef HAVE_STRTOD + +/* Define if you have the valloc function. */ +#undef HAVE_VALLOC + +/* Define if you have the snprintf function. */ +#undef HAVE_SNPRINTF + +/* Ignore HAVE_USLEEP under Apollo Domain because the usleep() + implementation in the Sys5.3 environment is broken. */ +#ifndef apollo + /* Define if you have the usleep function. */ +# undef HAVE_USLEEP +#endif + +/* Define if you have the <argz.h> header file. */ +#undef HAVE_ARGZ_H + +/* Define if you have the <fcntl.h> header file. */ +#undef HAVE_FCNTL_H + +/* Define if you have the <libintl.h> header file. */ +#undef HAVE_LIBINTL_H + +/* Define if you have the <libc.h> header file. */ +#undef HAVE_LIBC_H + +/* Define if you have the <limits.h> header file. */ +#undef HAVE_LIMITS_H + +/* Define if you have the <locale.h> header file. */ +#undef HAVE_LOCALE_H + +/* Define if you have the <malloc.h> header file. */ +#undef HAVE_MALLOC_H + +/* Define if you have the <nl_types.h> header file. */ +#undef HAVE_NL_TYPES_H + +/* Define if you have the <string.h> header file. */ +#undef HAVE_STRING_H + +/* Define if you have the <sys/select.h> header file. */ +#undef HAVE_SYS_SELECT_H + +/* Define if you have the <sys/time.h> header file. */ +#undef HAVE_SYS_TIME_H + +/* Define if you have the <sys/io.h> header file. */ +#undef HAVE_SYS_IO_H + +/* Define if you have the <asm/io.h> header file. */ +#undef HAVE_ASM_IO_H + +/* Define if you have the <scsi.h> header file. */ +#undef HAVE_SCSI_H + +/* Define if you have the <scsi/sg.h> header file. */ +#undef HAVE_SCSI_SG_H + +/* Define if you have the "/usr/src/linux/include/scsi/sg.h" header file. */ +#undef HAVE__USR_SRC_LINUX_INCLUDE_SCSI_SG_H + +/* Define if you have the <sys/dsreq.h> header file. */ +#undef HAVE_SYS_DSREQ_H + +/* Define if you have the <sys/scsi.h> header file. */ +#undef HAVE_SYS_SCSI_H + +/* Define if you have the <sys/scsi/targets/scgio.h> header file. */ +#undef HAVE_SYS_SCSI_TARGETS_SCGIO_H + +/* Define if you have the <sys/scsi/sgdefs.h> header file. */ +#undef HAVE_SYS_SCSI_SGDEFS_H + +/* Define if you have the <sys/scsicmd.h> header file. */ +#undef HAVE_SYS_SCSICMD_H + +/* Define if you have the <sys/scsiio.h> header file. */ +#undef HAVE_SYS_SCSIIO_H + +/* Define if you have the <sys/scanio.h> header file. */ +#undef HAVE_SYS_SCANIO_H + +/* Define if you have the <apollo/scsi.h> header file. */ +#undef HAVE_APOLLO_SCSI_H + +/* Define if you have the <bsd/dev/scsireg.h> header file. */ +#undef HAVE_BSD_DEV_SCSIREG_H + +/* Define if you have the <io/cam/cam.h> header file. */ +#undef HAVE_IO_CAM_CAM_H + +/* Define if you have the <camlib.h> header file. */ +#undef HAVE_CAMLIB_H + +/* Define if you have the <gscdds.h> header file. */ +#undef HAVE_GSCDDS_H + +/* Define if you have the <os2.h> header file. */ +#undef HAVE_OS2_H + +/* Define if you have EMX's sys/hw.h headers. */ +#undef HAVE_SYS_HW_H + +/* Define if you have sys/types.h. OS/2 wants them before select.h, etc. */ +#undef HAVE_SYS_TYPES_H + +/* Define if you have the <unistd.h> header file. */ +#undef HAVE_UNISTD_H + +/* Define if you have the <values.h> header file. */ +#undef HAVE_VALUES_H + +/* Define if you have the i library (-li). */ +#undef HAVE_LIBI + +/* Define if you have the intl library (-lintl). */ +#undef HAVE_LIBINTL + +/* Define if you have the m library (-lm). */ +#undef HAVE_LIBM + +/* Define if you have the <dlfcn.h> header file. */ +#undef HAVE_DLFCN_H + +/* Define if you have the dlopen function. */ +#undef HAVE_DLOPEN + +/* Define if you have the <dl.h> header file. */ +#undef HAVE_DL_H + +/* Define if you have the shl_load function. */ +#undef HAVE_SHL_LOAD + +/* Define if you have the GIMP header files and library. */ +#undef HAVE_LIBGIMP_GIMP_H + +/* Define if you have the GIMPfeatures header file. */ +#undef HAVE_LIBGIMP_GIMPFEATURES_H + +/* Define if you have libjpeg. */ +#undef HAVE_LIBJPEG + +/* Define if you have libz. */ +#undef HAVE_LIBZ + +/* Define if you have libpng. */ +#undef HAVE_LIBPNG + +/* Define if you have libtiff. */ +#undef HAVE_LIBTIFF + +#ifndef HAVE_STRNCASECMP + /* OS/2 needs this */ +# define strncasecmp(a, b, c) strnicmp(a, b, c) +#endif + +#if defined (__sun) && defined (__GNUC__) +# define _POSIX_SOURCE +# define __EXTENSIONS__ +#endif + +#endif /* SANE_CONFIG_H */ diff --git a/include/sane/sanei_backend.h b/include/sane/sanei_backend.h new file mode 100644 index 0000000..588e2d0 --- /dev/null +++ b/include/sane/sanei_backend.h @@ -0,0 +1,116 @@ +#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 +#endif + +#ifndef O_NONBLOCK +# ifdef O_NDELAY +# define O_NONBLOCK O_NDELAY +# else +# define O_NONBLOCK FNDELAY /* last resort */ +# endif +#endif + +#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 +#endif + +#ifdef HAVE_SIGPROCMASK +# define SIGACTION sigaction +#else + +/* Just enough backwards compatibility that we get by in the backends + without making handstands. */ +# ifdef sigset_t +# undef sigset_t +# endif +# ifdef sigemptyset +# undef sigemptyset +# endif +# ifdef sigfillset +# undef sigfillset +# endif +# ifdef sigaddset +# undef sigaddset +# endif +# ifdef sigdelset +# undef sigdelset +# endif +# ifdef sigprocmask +# undef sigprocmask +# endif +# ifdef SIG_BLOCK +# undef SIG_BLOCK +# endif +# ifdef SIG_UNBLOCK +# undef SIG_UNBLOCK +# endif +# ifdef SIG_SETMASK +# 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) + + /* 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 +#endif /* !HAVE_SIGPROCMASK */ + +/* Declare the 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 *); +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 *); +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); +extern void ENTRY(close) (SANE_Handle); +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) +#endif /* STUBS */ diff --git a/include/sane/sanei_config.h b/include/sane/sanei_config.h new file mode 100644 index 0000000..ac64007 --- /dev/null +++ b/include/sane/sanei_config.h @@ -0,0 +1,76 @@ +/* sane - Scanner Access Now Easy. + Copyright (C) 1997 Jeffrey S. Freedman + This file is part of the SANE package. + + This program is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public License as + published by the Free Software Foundation; either version 2 of the + License, or (at your option) any later version. + + This program is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place - Suite 330, Boston, + MA 02111-1307, USA. + + As a special exception, the authors of SANE give permission for + additional uses of the libraries contained in this release of SANE. + + The exception is that, if you link a SANE library with other files + to produce an executable, this does not by itself cause the + resulting executable to be covered by the GNU General Public + License. Your use of that executable is in no way restricted on + account of linking the SANE library code into it. + + This exception does not, however, invalidate any other reasons why + the executable file might be covered by the GNU General Public + License. + + If you submit changes to SANE to the maintainers to be included in + a subsequent release, you agree by submitting the changes that + those changes may be distributed with this exception intact. + + If you write modifications of your own for SANE, it is your choice + whether to permit this exception to apply to your modifications. + If you do not wish that, delete this exception notice. + + This file provides generic configuration support. */ + +#ifndef sanei_config_h + +#include <stdio.h> + +extern FILE *sanei_config_open (const char *name); +extern const char *sanei_config_skip_whitespace (const char *str); +/* Scan a string constant from the string pointed to by STR and return + a malloced copy of it in *STRING_CONST (it's the responsibility of + the caller to free the returned string at an appropriate time). + Whitespace in front of the string constant is ignored. Whitespace + can be included in the string constant by enclosing it in + double-quotes. A return val of NULL indicates that no string + constant was found. */ +extern const char *sanei_config_get_string (const char *str, + char **string_const); + +/* A convenience function to support expanding device name patterns + into a list of devices. Apart from a normal device name + (such as /dev/sdb), this function currently supports SCSI + device specifications of the form: + + scsi VENDOR MODEL TYPE BUS CHANNEL ID LUN + + Where VENDOR is the desired vendor name. MODEL is the desired + MODEL name. TYPE is the desired device type. All of these can be + set to * to match anything. To include whitespace in these + strings, enclose them in double-quotes ("). BUS, ID, and LUN are + the desired SCSI bus, id, and logical-unit numbers. These can be + set to * or simply omitted to match anything. */ +extern void sanei_config_attach_matching_devices (const char *name, + SANE_Status (*attach) + (const char *dev)); + +#endif /* sanei_config_h */ diff --git a/include/sane/sanei_signal.h b/include/sane/sanei_signal.h new file mode 100644 index 0000000..0033c1c --- /dev/null +++ b/include/sane/sanei_signal.h @@ -0,0 +1,50 @@ +#ifdef HAVE_SIGPROCMASK +# define SIGACTION sigaction +#else + +/* Just enough backwards compatibility that we get by in the backends + without making handstands. */ +# ifdef sigset_t +# undef sigset_t +# endif +# ifdef sigemptyset +# undef sigemptyset +# endif +# ifdef sigfillset +# undef sigfillset +# endif +# ifdef sigaddset +# undef sigaddset +# endif +# ifdef sigdelset +# undef sigdelset +# endif +# ifdef sigprocmask +# undef sigprocmask +# endif +# ifdef SIG_BLOCK +# undef SIG_BLOCK +# endif +# ifdef SIG_UNBLOCK +# undef SIG_UNBLOCK +# endif +# ifdef SIG_SETMASK +# 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) + + /* 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 +#endif /* !HAVE_SIGPROCMASK */ + diff --git a/include/sane/stamp-h b/include/sane/stamp-h new file mode 100644 index 0000000..9788f70 --- /dev/null +++ b/include/sane/stamp-h @@ -0,0 +1 @@ +timestamp |