Wykres commitów

442 Commity (075bd9b7e94aab0c6b7996bccca298460b3ca2a0)

Autor SHA1 Wiadomość Data
Olaf Meeuwissen be9736020f autofoo: Sync generated files
The AX_CXX_COMPILE_STDCXX* macros that were embedded in aclocal.m4
have been replaced with the versions found in the autoconf-archive
package from Debian 9.
2019-05-21 22:14:46 +09:00
Povilas Kanapickas 9e3b5d6381 Update generated files 2019-05-11 00:03:26 +03:00
Povilas Kanapickas 0921d36618 sanei_usb: Deduplicate endpoint setup code 2019-03-22 18:31:46 +02:00
Povilas Kanapickas 2653cbaec7 Run autoreconf and automake 2019-03-20 23:09:07 +02:00
Olaf Meeuwissen a78969384b autotools: Sync derived files
This was done by running

  libtoolize --copy
  autoreconf --force --install

on Debian GNU/Linux 9.3.
2018-03-17 10:35:57 +09:00
Olaf Meeuwissen 54627bdeac lib/isfdtype.c: Remove badly broken substitute
The substitute completely ignores the fdtype argument and only works
correctly for S_IFSOCK values.  This happened to be the only way the
function was invoked but for safety's sake this has been replaced by
a local implementation that does pretty much the same thing, without
the misleading bit.

Found courtesy of a [-Wunused-parameter] compiler warning on Alpine.
2017-07-15 21:58:51 +09:00
Olaf Meeuwissen c754d440ea sanei_thread: Fix [-Wunused-function] compiler warning
The sanei_thread_set_invalid static function is only used by code that
exists if USE_PTHREAD is defined.
2017-07-15 20:27:28 +09:00
Olaf Meeuwissen ddd7d821f6 sanei_thread: Fix [-Wformat=] compiler warnings 2017-07-15 17:07:13 +09:00
Olaf Meeuwissen ad09bbdd18 sanei_thread: Fix [-Wint-conversion] compiler warnings 2017-07-15 17:06:20 +09:00
Olaf Meeuwissen a08f5630d8 sanei_scsi: Fix [-Wdeprecated-declarations] compiler warning
The readdir_r() using loop in sanei_scsi_find_devices() has been
modified to use readdir().

With the exception of sane_cancel(), the SANE API is not re-entrant.
The sanei_scsi_find_devices() function is referenced neither directly
nor indirectly from any of the sane_cancel() implementations so there
is no inherent need to use readdir_r().
2017-07-08 18:40:09 +09:00
Olaf Meeuwissen fc4b250a09 .editorconfig: use utf-8 charset throughout 2017-05-29 21:14:30 +09:00
Olaf Meeuwissen f0f187f995 .editorconfig: trim trailing blank lines 2017-05-29 21:14:30 +09:00
Olaf Meeuwissen 23891a2646 .editorconfig: trim trailing whitespace 2017-05-29 21:14:29 +09:00
Jörg Frings-Fürst e21bb28e50 Source code string typo fixes 2017-05-13 18:38:43 +09:00
Martin Husemann 8995b1fc81 sanei_usb: fix number of bytes read for 64bit big-endian systems
Fixes 315337.
2017-05-06 12:10:52 +09:00
Olaf Meeuwissen 471e8ac0c1 sanei_pp: fix [-Wcpp] compiler warning
The `#warning` directive is turned into an error by `-Werror`.  The
directive triggers is guaranteed to trigger with __GNUC__ when no
parallel support is available.  This would prevent strict CI builds.

Output a message with all compilers that understand the pragma.  Those
that don't should ignore it, according to C99.
2016-09-25 16:28:11 +09:00
Olaf Meeuwissen 7d7030a409 sanei_usb: : fix [-Wunused-parameter] compiler warnings
These were issued in the absence of libusb.
2016-09-25 15:53:46 +09:00
Olaf Meeuwissen 23cc2e1ba0 Fix include guard typo
This seems to have been present since the beginning of sanei/sanei_scsi.c.
2016-08-03 22:12:45 +09:00
Olaf Meeuwissen bfd1626c4b Sync autofoo 2016-07-13 23:44:26 +09:00
Olaf Meeuwissen 2481e1e98b Sync autofoo 2016-07-10 21:54:24 +09:00
Olaf Meeuwissen c962368626 Sync autofoo 2016-07-01 23:45:43 +09:00
Olaf Meeuwissen a9c813944e Make libusb-1.0 the default for USB support
When libusb-1.0 is not found, libusb-0.1 will be tried.  On BeOS and
OS2, nothing should have changed in terms of detection of USB support.

On all systems the --enable-libusb* flags are now ignored.  Instead, the
--with-usb and --without-usb flags now control support.  When neither is
given USB support will be enable if possible and disabled otherwise.  If
--with-usb is requested but not possible, ./configure will fail.  There
is no support to prefer libusb-0.1 over libusb-1.0.
2016-07-01 23:44:37 +09:00
Olaf Meeuwissen f03f1f66d4 Sync autofoo files 2016-06-29 22:15:06 +09:00
Olaf Meeuwissen 81f9557966 Clean up .gitignore file content
Removes empty lines and duplicates (note that .gitignore patterns are
recursive unless anchored with a leading /).
2016-06-27 22:40:20 +09:00
Olaf Meeuwissen cb4924f210 Stop distclean from removing files willy-nilly
The distclean target should only remove files that make creates.  If
there are any that need taking care of, they should be added in on a
per file basis in the Makefile.am that creates it.
2016-06-26 10:24:30 +09:00
Olaf Meeuwissen bdade6bb07 Sync derived files with previous changes 2016-06-26 10:24:29 +09:00
Olaf Meeuwissen d853463ef1 Sync derived files
This was done with

  AUTOMAKE="automake --add-missing --copy" autoreconf --force

on Debian GNU/Linux 8.5.
2016-06-14 06:30:48 +09:00
Olaf Meeuwissen 87e12bbf2e Sync derived files with autoreconf --force
For the record, this was done on Debian GNU/Linux 8.5.
2016-06-13 22:24:21 +09:00
Olaf Meeuwissen 2d6fad58b4 Respect GNU Standards user variables
Several variables are considered "user variables" by the GNU Standards.
This means that the user can pass these to their ./configure and make
invocations as they see fit.  These variables include CPPFLAGS, CFLAGS
and LDFLAGS.

This changeset pushes our use of these variables to the automake shadow
variables, AM_CPPFLAGS, AM_CFLAGS and AM_LDFLAGS, so that user variables
will no longer clobber flags required in order to build.
2016-06-13 22:03:14 +09:00
m. allan noah 1207ce5a40 Support SANE_USB_WORKAROUND env var
Here, we add a new env var (SANE_USB_WORKAROUND) to sanei_usb.c.
This allows end users to conditionally enable the workaround added
in commit 014b45d920. The default is
to not enable the workaround, because more recent Linux kernels no
longer seem to need it. Some users have even reported failure with
the workaround enabled.
2016-02-23 20:36:32 -05:00
Olaf Meeuwissen 04d5e4a0cf Move #include <pthread.h> to sanei_thread.h
The sanei header file may need pthread_t.  If it does, make sure it
is available.
2016-02-13 17:34:46 +09:00
Olaf Meeuwissen 57ae115eaf sanei_thread: fix [-Wmaybe-uninitialized] compiler warning 2015-12-27 18:38:16 +09:00
Olaf Meeuwissen cd3453948d sanei_usb: const_cast data buffer
The libusb_bulk_transfer() API caters to both reads and writes and
as a result of that will not take a const pointer.
2015-12-27 18:38:03 +09:00
Olaf Meeuwissen be084e0d7b sanei_usb: Move variable declarations to scope of usage
Fixes an [-Wunused-variable] when compiling without libusb.
2015-12-27 15:36:18 +09:00
Volker Diels-Grabsch baec5e0395 Use consistently __func__ instead of __FUNCTION__
Some parts of SANE used __FUNCTION__ while other parts used __func__.
Now, __func__ is used consistently throughout the SANE sources.  This
fixes all occurrences of the following GCC warning:

warning: ISO C does not support '__FUNCTION__' predefined identifier
2015-12-20 15:27:45 +09:00
Volker Diels-Grabsch 93298674d0 Merge all compatibility macros around __func__ and __FUNCTION__
Various parts of SANE introduced their own compatibility macros for
old compilers that don't support __func__.  Most of these definitions
are identical or have minor differences.  This patch replaces them
with a single instance in the central header file for backends.
2015-12-20 15:27:45 +09:00
Volker Diels-Grabsch 7c8c8e29be Remove dead code due to unused variables
This fixes some occurrences of the following GCC warning:

warning: variable '...' set but not used
2015-12-20 15:21:45 +09:00
Volker Diels-Grabsch aba87a4582 Mark internal function toupper_ascii as static
This fixes the following GCC warning:

warning: no previous prototype for 'toupper_ascii'
2015-12-20 15:10:30 +09:00
Volker Diels-Grabsch badd7025b2 Bugfix: On error, return the actual error code in sanei_magic_rotate
Up to now, on failure the sanei_magic_rotate function returned a
success status.  This fixes the following GCC warning:

warning: variable 'ret' set but not used
2015-12-20 14:43:57 +09:00
Olaf Meeuwissen f1593204c7 Drop execute permission
Source code, description files and configuration templates should never
need to be executed.
2015-11-27 21:28:09 +09:00
Olaf Meeuwissen e094c5b43b Invert sense of sanei_thread validity check
Double negatives suck.
2015-11-24 18:19:31 +09:00
Olaf Meeuwissen fe12d31e68 Fix SANE_Pid related -Wsign-compare warnings
This may fix threading related issues on WIN32 platforms, BTW.
2015-11-24 18:19:31 +09:00
Olaf Meeuwissen fff1c5962a Fix "discards 'const' qualifier from pointer target type" warnings
The line variable is not (and cannot be) declared 'const'.  The string
variable points to a location in line, hence it is safe to cast away
'const'ness of the sanei_config_skip_whitespace() return value.
2015-11-11 22:41:58 +09:00
Thomas Klausner 72ecee97ce Add DragonFly BSD support (fixes 315205) 2015-11-08 19:00:32 +09:00
Alexander Hofmann 2239d2aaff Replace obsolete interface with standard include files 2015-10-07 18:09:33 +09:00
m. allan noah 2ecf18f6fb autoheader and automake
After recent PNG and SNMP changes, need to run autoheader and automake
2015-10-02 21:53:14 -04:00
Olaf Meeuwissen 5cae68b574 Make sequence-point warning go away
Sample code that mimicks the offending code gave different run-time
results when compiled with gcc-4.9.2 and clang-3.5.0.  Rewriting the
sample code so that results matched gcc-4.9.2 for both compilers was
used to determine how to "fix" the offending statement.
2015-09-28 20:36:16 +09:00
Olaf Meeuwissen 2f72ee5b8f Remove "nested" comment 2015-09-25 20:53:42 -04:00
Olaf Meeuwissen 22b17e232a Fix various types of unused variable warnings 2015-09-25 20:53:42 -04:00
m. allan noah 87bfd53512 Run autofoo for recent changes 2015-09-19 13:39:38 -04:00
Olaf Meeuwissen eb54dbf200 Don't detach unconditionally after pthread_join() 2015-09-19 13:39:37 -04:00
Olaf Meeuwissen efb2eb7251 Add sanei_ir.h from the directory it lives in
Fixes `make dist` target.
2015-09-19 13:39:37 -04:00
Luiz Angelo Daros de Luca 8434ea9162 Define IO_SUPPORT_MISSING when inb() and outb() aren't in <sys/io.h>
Fixes link issues on OpenWRT w/ musl on MIPS.
2015-09-19 13:39:37 -04:00
m. allan noah 7566619e53 rebuild with automake 1.14.1 2015-08-31 20:58:30 -04:00
Klaus Kämpf 5337625f3a New backend pieusb
This commit adds support for (slide) scanners based
on Pacific Image Electronics (PIE) oem scan hardware.

It is known to match the following USB scanners

  PIE PowerSlide 3600       Untested
  PIE PowerSlide 3650       Untested
  PIE PowerSlide 4000       Untested
  PIE PowerSlide 5000       Untested
  Reflecta CrystalScan 7200 Untested
  Reflecta ProScan 7200     Untested
  Reflecta DigitDia 4000    Untested
  Reflecta DigitDia 5000    Untested
  Reflecta DigitDia 6000    Ok

The backend is based on work by Jan Vleeshouwers and Michael Rickmann.

Special thanks to Stéphane Voltz for the code review.

Add pieusb to backend/Makefile.am
Add pieusb to doc/Makefile.am
Add missing sanei/sanei_ir.c, sanei/sanei_ir.h, adapt Makefile.am
configure.ac: Add 'pieusb' to ALL_BACKENDS
ChangeLog: Add pieusb as new backend
Mark infrared functions as internal: sane_ir_* -> sanei_ir_*
sanei/sanei_ir.c: fix memory leaks
pieusb: rename cmdGetMode and cmdSetScanHead
	... to their sanei_pieusb_cmd_... equivalent
pieusb: rename definition_list_head to pieusb_definition_list_head
Add pieusb to AUTHORS
pieusb: copyright 2012-2015
pieusb: don't include sanei_thread.h
2015-08-31 21:07:12 +02:00
Alessandro Zummo ccd15dc966 Revert "epsonds: enable double feed detection"
This reverts commit 005c3928a5.
2015-04-26 23:09:08 +02:00
Alessandro Zummo 005c3928a5 epsonds: enable double feed detection 2015-04-26 22:44:01 +02:00
m. allan noah 014b45d920 sanei_usb: Linux USB3/xhci workarounds
add calls to sanei_usb_set_altinterface in sanei_usb_close and
sanei_usb_clear_halt- hopefully work around USB3/xhci problems
in Linux. Also, remove some unused code, and fix debug messages.
2014-12-16 10:23:55 -05:00
Olaf Meeuwissen 365b619dfe Set USB configuration only if different from the current one
This follows up on earlier USB3 fixes.  It only addresses libusb-1.0
because there is no convenience API for libusb-0.1 to get the current
configuration.
2014-12-10 21:25:08 -05:00
Olaf Meeuwissen 5283a8792e Fix memory leak w/ libusb-1.0 (introduced in 71c1a00) 2014-12-10 21:24:53 -05:00
Olaf Meeuwissen 71c1a0068f Set USB configuration only if there are alternative ones
This fixes USB3 issues for the epson and epson2 backends.  Both these
backends already made sure to send an even number of reads and writes
but were affected nevertheless.

It also solves USB3 issues with the third party epkowa backend.  This
one doesn't bother to ensure even counts of packets read and written.
It works fine when this fix is applied (and it no longer clears halts
w/o a stall condition).  Note, there is no need to ensure even packet
counts.
2014-12-10 21:18:20 -05:00
Nils Philippsen 66cb9b55c2 remove code which is never reached 2013-11-05 14:47:27 +01:00
m. allan noah 3fdf42fe7b do our own upcasing to allow backend debugging in Turkish. 2013-09-17 20:53:07 -04:00
m. allan noah 9229049d4d Revert "Use "C" LC_CTYPE when converting backend names to env vars"
This reverts commit dd4f26a805.
2013-09-17 20:43:19 -04:00
Olaf Meeuwissen dd4f26a805 Use "C" LC_CTYPE when converting backend names to env vars 2013-08-27 20:48:24 -04:00
Chris Bagwell af10791227 Improve libusb's error code for permission issues.
libusb on my Linux box is returning EACCES error when invalid
permissions exist.  Modify open to translate that into
SANE_STATUS_ECCESS_DENIED since that error description is
used for this case.

Modify sanei_usb_test.c to not treat access denied or busy
error codes as real failures since its expected to occur on
boxes that USB device is already claimed by another driver
and if that device uses default root only permissions.
2013-08-26 21:21:20 -05:00
Chris Bagwell 8b0e4257a9 Add support for winpthreads needed by mingw64
Keep existing pthread-win32 support.

Based on work from Michael Cronenworth for Fedora's mingw64
sane-backends package.
2013-08-15 13:51:05 -05:00
Chris Bagwell bc2dc68fa5 Improve snmp detection when cross compiling.
Improving here means do not set LIBS/CFLAGS if library is not detected.
This prevents some unknown options based to ld when host is Linux and
target is mingw32/64.  Further improvements are needed if one wants this
snmp support when cross compiling to really work.

Also, to make commit bisectable, updated all autofoo files using
'autoreconf -i -f' and repatching ltmain.sh.

Also, test-driver was missing from git repo but the Makefile.in
checked in expected it to exist.
2013-08-15 13:10:39 -05:00
Stéphane Voltz b10f87f7ed fixed range overflow due to rounding in sanei_constrain_value
- fixed a bug in sanei_constrain_value spotted by
  viresh_shirol@yahoo.co.uk where range max was exceeded due to rounding
  in quantization
- added test case for sane fixed values range
2013-08-04 09:04:47 +02:00
m. allan noah 9fc683d883 fujitsu backend v116
add swskip option
add sanei_magic_isBlank2
2013-04-03 21:54:48 -04:00
Stéphane Voltz 88e04fbb4d move test_wire.c from sanei to testsuite/sanei
- move sanei_w_* functions test program to test directory to keep
  production code separated from test code
2013-03-24 14:50:17 +01:00
Stéphane Voltz 5a1d5a62ee guard against device that went missing in claim/release interface
- add test for missing devices in claim or release
- changlog entry for all the sanei_usb work
2013-03-24 14:25:45 +01:00
Stéphane Voltz 2a66940c6b don't use kernel device when libusb is available 2013-03-24 14:20:06 +01:00
Stéphane Voltz d45f1bec5a fix memleak when reusing an already stored device 2013-03-24 14:20:06 +01:00
Stéphane Voltz a0b45146e1 rewrite sanei_usb_get_vendor_product
- rewrite sanei_usb_get_vendor_product using the same logic
  than sanei_usb_get_vendor_product_byname
2013-03-24 14:20:06 +01:00
Stéphane Voltz 018408bf20 white space cleanup 2013-03-24 14:20:06 +01:00
Stéphane Voltz 9e47eb4a37 unused and reassigned values fixes 2013-03-24 14:20:06 +01:00
Stéphane Voltz b3f01a9010 improve missing test logic 2013-03-24 14:20:06 +01:00
Stéphane Voltz 52ba4844ca add sanei_usb_exit() function
- create a sanei_usb_exit() function to free allocated resources during use
  of sanei_usb functions by a backend
2013-03-24 14:20:06 +01:00
Stéphane Voltz caf4614f61 correct debug messages
- change debug messages to match their new function using __func__
2013-03-24 14:20:06 +01:00
Stéphane Voltz 7fc3406d76 split device scanning logic from sanei_usb_init
- move bus scanning for device to a new sanei_usb_scan_devices
- call this new function from sanei_usb_init to preserve current behaviour
- split bus device scanning into several smaller functions on a per scanning    method
  method basis
2013-03-24 14:20:06 +01:00
Stéphane Voltz ef52b75473 free devname only in the case of a reused device slot 2013-02-28 22:23:03 +01:00
Gerhard Jaeger ef5820ce62 Free heap memory, acquired via strdup for
devname, in sanei_usb_close().
2013-02-20 08:30:34 +01:00
Louis Lagendijk 3276babdec Added optional support in saned for systemd socket activation. This will allow for
using backend debugging using SANE_DEBUG_xxx to be used for saned controlled
scanning when using socket activation. When only the socket is received we
use the existing code path.
2013-01-10 20:59:26 +01:00
m. allan noah 9b142567fa Revert "forgot to do autoreconf"
This reverts commit aa6f185452.
2012-11-28 21:51:12 -05:00
Paul Newall aa6f185452 forgot to do autoreconf 2012-11-28 22:11:04 +00:00
Stéphane Voltz 8c062e89f4 make private functions static 2012-07-04 06:55:14 +02:00
m. allan noah d4ff20d857 Update sane_magic deskew algo
- allow paper to be +/- 1 inch from top of image
- correct integer overflow
- improve (disabled) debug logs
2012-05-09 21:17:33 -04:00
Ruediger Meier 0e3d873624 build fix, use the right scsi header on win32
Now we are using either ddk/ntddscsi.h or ntddscsi.h and even don't
stop if we have none of them.
2012-01-21 22:16:50 -06:00
Ruediger Meier 5311781404 cleanup, uniq PATH_SEP defines
Always use the same portable PATH_SEP define (note _WIN32
is not defined on cygwin).
2012-01-21 22:02:20 -06:00
Ruediger Meier ef66c1e767 fix, inconsistent PATH_SEP and DIR_SEP defines
PATH_SEP and DIR_SEP were inconsistently defined on cygwin since
5168206e (also see a28bd843)
2012-01-21 22:02:20 -06:00
Chris Bagwell 8ac464a47d add support for libusb-win32
It is API compatible with libusb-0.1 that is already supported
but uses different header file name to prevent conflict with
Window's own usb.h.
2011-12-27 17:35:35 -06:00
Chris Bagwell 2c4b1da0bf add FreeBSD Port's patches
epson2-commands.c: Include <sys/types.h> to resolve u_long.
epson2.c, magicolor.c, xerox_mfp-tcp.c: Include <sys/types.h>
and to <sys/socket.h> for anyone using setsockopt().
sanei_tcp.h: Include <sys/types.h> since ssize_t is referenced.
sanei_usb.c: Newer FreeBSD version checks.

All changes in this patch set come from FreeBSD ports patches.
Bug #312503.
2011-11-20 20:08:15 -06:00
Chris Bagwell 10b778b5d0 Map SANE_Pid to pthread_t
Not all platforms use an integer for pthread_t and so
couldn't compile on those; namely mingw.

This is least riskest version I could come up with. Backends
that do things like "SANE_Pid pid = -1" or "if (pid == -1)" will
need to switch to sanei_thread_set_invalid()
sanei_thread_is_invalid() to be able to compile on mingw.
2011-11-10 19:22:07 -06:00
Chris Bagwell ba10bb37cd remove unused variable. 2011-11-09 21:48:07 -06:00
Chris Bagwell e7f01c3b36 Add --disable-dynamic/--disable-preload and update docs
Options were in README but removed at some point.  They
are useful so add them back.

Document BACKENDS and PRELOADABLE_BACKENDS variables in
README as well as in configure --help output.
2011-11-08 21:28:30 -06:00
Chris Bagwell c64249fc31 fix compile failure on non-windows platform. 2011-11-08 21:22:42 -06:00
Chris Bagwell 1aa332d710 Updates to use sockets on mingw
Add missing WSAStartup() and WSACleanup() code required
on windows to use ws2_32 library.

Also, O_NONBLOCK is tricky even on other platforms so create
a function to set that so portability logic doesn't need to be
done in every backend.  Windows requires using a non standard
function to enable nonblocking mode and also doesn't support
querying current state.
2011-11-07 21:49:54 -06:00
Chris Bagwell 5061c2d5b2 More mingw portability updates.
Add check for winsock2.h for socket.h replancement. Also, use this
check to add ws2_32 library. Also, switch all winsock.h references
to winsock2.h.

Add check for getuid and getpass; which are not on mingw.

Add a syslog() replacement that is basically a print(). This
is also used by vsyslog() replacement.

Comment out parts of replacement sigprocmask.c on mingw.

To support these configure.in changes, I need to rebuild all
related files with autoconf 2.68 and libtool 2.4. Hand ported
our sane-backend specific changes to newer ltmain.sh.
2011-11-06 12:40:00 -06:00
Chris Bagwell 9bdff1dbdf mingw32 compile fixes
The following updates were made to all directories but backends.
That still needs work. There are also still some pthread issues
and syslog is missing.

 Windows doesn't support SIGHUP or SIGPIPE so make that optional.
 Only include socket header files when sys/socket.h is detected.
 Use winsock.h on windows.
 Only include syslog.h when vsyslog() was detect by configure.
 Skip FD_CLOEXEC when not supported by OS (not defined).
 Only include sys/ioctl.h on platforms that define it.
2011-11-05 11:19:34 -05:00