Wykres commitów

362 Commity (99f7e7872f2619c3ebec2590b91de3fb0ca28a1a)

Autor SHA1 Wiadomość Data
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
Mattias Ellert 9e639753a3 Include <sys/types.h> for definition of u_long on MacOS X 2011-10-30 10:32:34 +01:00
m. allan noah 28ccc11d91 Add new blank page and rotation detection algos 2011-06-06 20:45:34 -04:00
Reinhold Kainhofer c0b26b4568 sanei_usb: Add function sanei_usb_get_endpoint, add range check in sanei_usb_set_endpoint
Since we now have the possibility to change the endpoint used for a particular USB communication type,
we also need a way to retrieve the current endpoint, so that one can e.g. reset the endpoint to the
old value after a single usb operation on a different endpoint.
2011-01-31 22:42:29 +01:00
m. allan noah 40e40989d9 rebuild autofoo for magicolor and snmp support 2011-01-18 21:31:13 -05:00
Reinhold Kainhofer 6dc2a7d03a Add some sanity checks 2011-01-15 21:41:06 +01:00
Reinhold Kainhofer 039f21aaf8 Add function to set USB endpoints to use
Added
 void sanei_usb_set_endpoint (SANE_Int dn, SANE_Int ep_type, SANE_Int ep);

This function allows the user to set the endpoint to use on
the given device for the given endpoint type (e.g. bulk in).
Some scanners have multiple bulk in/out endpoints but use
only one for communication (not the one detected during auto-detection),
so one call to the new function will change the used endpoint.
Some scanners use two different endpoint for different purposes,
so in that case each read/write call needs to be preceeded
by a call to that function to set the proper endpoint.

ep_type is a bitmask and is usually of the form
    (USB_DIR_IN|USB_ENDPOINT_TYPE_BULK)
2011-01-15 21:40:55 +01:00
Chris Bagwell 9de4dcd8a5 Fixes for "make distcheck" on cygwin.
Allow "make dist" when translations are disabled.
Allow "make check" to work by linking in liblib.la.

Signed-off-by: Chris Bagwell <chris@cnpbagwell.com>
2011-01-02 20:00:22 -06:00
Chris Bagwell 650ea7cf8a update generate files using latest autoconf tools.
Signed-off-by: Chris Bagwell <chris@cnpbagwell.com>
2011-01-02 13:07:31 -06:00
Alex Belkin 842c98d204 Added Samsung SCX-4500W scan over network support for xerox_mfp backend (by Alexander Kuznetsov).
autoconf and automake reconfigure.
2010-09-30 15:11:56 +04:00
Reinhold Kainhofer 093fff631c Fix SANE_CONFIG_DIR handling, use it for dll.d/; Add sanei_config_get_paths
* include/sane/sanei_config.h sanei/sanei_config.c: Add function
        sanei_config_get_paths to obtain all configuration pathes (from env var
        SANE_CONFIG_DIR and default paths); fix pointers to invalid/freed
        strings when SANE_CONFIG_DIR is set

* backend/dll.c: When searching for the dll.d/ directory, also use
        the SANE_CONFIG_DIR env variable.
2010-09-18 10:35:35 +02:00
Stéphane Voltz 226d4cf172 valgrind memory leaks/overwrite fixes 2010-09-17 06:49:41 +02:00
Stéphane Voltz 056994c6c4 use same estimation method for getTransX than in getTransY 2010-09-12 21:20:19 +02:00
Julien BLACHE 60b79b6463 sanei_magic: kill unused variable 2010-06-23 18:21:34 +02:00
Stéphane Voltz a717c4658a add sanei_usb_reset function 2010-05-16 07:37:34 +02:00
Chris Bagwell 0109113ea3 Don't include -lresmgr in all backends
resmgr library is only used (optionally) by
sanei_usb and sanei_scsi.  So only need to
link it in for those backends.  This was
a stray piece from initial cleanup of LIBS
in sane-backends 1.0.20.

Signed-off-by: Chris Bagwell <chris@cnpbagwell.com>
2010-04-06 09:49:58 -05:00
Chris Bagwell 1903d646b2 align autoconf/automake output to common version.
Signed-off-by: Chris Bagwell <chris@cnpbagwell.com>
2010-02-27 23:27:32 -06:00
m. allan noah 54a84f2053 Use standard gettext infrastructure, from Adi Roiban 2010-02-27 20:51:31 -05:00
Stéphane Voltz b37621d86a addition of the p5 backend to the distribution 2010-02-15 22:15:43 +01:00
m. allan noah dc6a1ef2b0 reset the libusb device handle after bus scan. patch from Hans Petter Selasky (FreeBSD) 2009-09-14 13:31:15 -04:00
m. allan noah 3a26db083f Add sanei_magic image processing library
Initial support for:
Deskew
Autocrop
Despeckle
2009-09-14 13:13:31 -04:00
m. allan noah 163f5fa345 New kodak backend, and all the autofoo changes required to build it
- remove some Kodak machines from unsupported list
- add sane-kodak manpage
- add kodak.desc
2009-06-22 23:06:22 -04:00
chris@cnpbagwell.com 581b94fb88 Fix sanei_tcp_read(). Revert some getopt logic.
* sanei/sanie_tcp.c, backend/epson2_net.c: Update
sanei_tcp_read() to better simulate old behavior of MSG_WAITALL.
recv() tends to return MTU sized chunks of data without that option.  And at
least cygwin doesn't support MSG_WAITALL.  Re-enable epson2 using that
function for big recieves.
* libgetopt.c, libgetopt1.c:
Revert some logic meant to be used only when we were always compiling
interal getopt() functions.  Fix header filename.
2009-06-09 19:12:43 -05:00
Nicolas Martin 1e381db161 Adds debug verbosity to last sanei_usb.c patch.
This commit adds some debug verbosity to the last committed sanei_usb.c patch
id 5b69fa8c6d
for fixing the choice of usb endpoints, in the sanei_usb_open() seek for endpoints loop.
2009-05-25 22:01:43 +02:00
Nicolas Martin 5b69fa8c6d Fix for Pixma MP730 in pixma backend and sanei_usb
Updated following files for Pixma MP730 support:
- backend/pixma_mp730.c:
  Add width scan area fitting
  Fix end scan sequence protocol
- sanei/sanei_usb.c:
  In sanei_usb_open(), changed the "seek for endpoints" loop
  so that it first looks for those interfaces (in config 0)
  that have been detected as potential scanners in
  sanei_usb_init()
2009-05-22 10:29:37 +02:00
chris@cnpbagwell.com 07c5723cab Merge branch 'master' of ssh://cbagwell-guest@git.debian.org/git/sane/sane-backends 2009-05-09 21:40:55 -05:00
chris@cnpbagwell.com 4d9e8138af standardize including local sane/ include files.
Source code was inconsistent on how they were referencing
include files in include/sane.  In certain cases, sane/sane.h
and sane/saneopts.h was really including external copies (with
some preprocessor implementations anyways).
2009-05-07 22:06:20 -05:00
m. allan noah 1541ad928f new .gitignore files 2009-05-05 16:06:38 -04:00
Chris Bagwell 6b5973313c * Makefile.in, aclocal.m4, configure, */Makefile.in: Regenerated
with newer automake.
* backend/Makefile.am, tools/sane-config.in: Add missing
$GPHOTO2_LDFLAGS so library can be found.
* tools/Makefile.am: Add mising $SCSI_LIBS to sane-find-scanner.
2009-05-03 22:01:23 +00:00
Julien BLACHE c5991b48a0 /proc/scsi is being deprecated in the Linux
kernel; use sysfs for SCSI device enumeration in
sanei_scsi_find_devices() by default, keep
sanei_proc_scsi_find_devices() as a fallback option.
2009-04-28 13:28:25 +00:00
Chris Bagwell 9d1375fd7e * acinclude.m4, tools/sane-config.in: Add in missing libraries
to sane-config missed during fix to stop using LIBS to link everything.
Add back in code to move LDFLAGS out of $GPHOTO2_LIBS and into
GPHOTO2_LDFLAGS.
2009-03-03 02:53:42 +00:00
Chris Bagwell be3f46204b * po/Makefile.am, configure.in: convert remaining directory,
po, to use automake.
2009-02-21 22:45:14 +00:00
Mattias Ellert 0827226249 Adding missing liblib dependencies 2009-02-20 16:51:09 +00:00
Chris Bagwell cb4fb37eca Have configure define configdir so all makefiles can use
it (fixes bug introduce with sanei converted to automake).
Enable running testsuite during distcheck.
2009-02-19 18:10:12 +00:00
Julien BLACHE ad1a44d92a Add support for libusb-1.0. 2009-02-19 13:57:45 +00:00
Chris Bagwell e380729334 * configure.in, tools/Makefile.am: convert tools to automake.
Add tools/openbsd to distribution package.
* include/Makefile.am: include files should have been installed
under sane/ directory when converted to automake.
* doc/Makefile.am: Cleanup. Use automake's built in support to
install docs within subdirectories.
2009-02-19 02:17:45 +00:00
Chris Bagwell aef46252cc convert frontend, include, and sanei directories to use
automake.  Only reference libsanei.la now. Use am_conditional
to compile sanei_jpeg.lo.  distcheck now runs sanei/wire_test.
2009-02-15 03:31:36 +00:00
Mattias Ellert 1d21f36d9f Don't compile sanei_jpeg if libjpeg is unavailable. 2009-02-01 15:21:46 +00:00
Chris Bagwell b52b0c0c14 * backend/epson2.c backend/pixma_bjnp.c, include/sane/sanei_backend.h,
sanei/sanei_tcp.c, sanie/sanei_udp.c: Improve portablity by
  removing usage of MSG_WAITALL since not all platforms support
  that (cygwin).  Default is to be blocking anyways.  Changed
  usage of MSG_NOTWAIT to use fcntl() function as needed as well.
  * configure.in, lib/Makefile.in, lib/strcasestr.c: Add internal
  strcasestr() for platforms missing it (cygwin).
  * pixma_common.c: My source match header prototype for picky
  compilers (cygwin).
  * backend/umax_pp_mid.c: Allow BACKEND_NAME to be filename
  yet debug to be SANE_DEBUG_UMAX_PP to match man page.
2009-01-29 15:10:19 +00:00
m. allan noah 9afc59953a Revert mistaken commit of half-finished code 2009-01-20 13:38:38 +00:00
m. allan noah 0c8a3a0775 add MFC-7840W 2009-01-20 01:41:14 +00:00
Chris Bagwell c90e23a6d2 Updates to Makefiles to prepare for transition to automake.
Fix a few bugs with "all" and "uninstall" targets to work when
$(builddir) != $(srcdir).  Added $(DESTDIR) to uninstall target.
Made $(distdir) related to current directory to match automake.
2009-01-16 23:39:48 +00:00
m. allan noah 92261307ec * sanei/sanei_usb.c: rescan usb every time sanei_usb_init() is called
- remove missing devices, add new devices to global lists
- based on code from stef.dev@free.fr
2009-01-11 00:10:02 +00:00
Julien BLACHE e629a77f7e Fix assignment in if. 2008-12-01 10:11:54 +00:00
m. allan noah b57a64d79e * sanei/sanei_usb.c, include/sane/sanei_usb.h:
- shorten debug lines to fit in 80 chars
- add sanei_usb_clear_halt() required by upcoming canon_dr backend
2008-11-05 02:30:44 +00:00
Stéphane Voltz fb5ade52ad - handle the case where the attach callback or the config struct
is NULL
	- make use of new configuration parsing framework
2008-07-10 19:37:00 +00:00
Stéphane Voltz c74a1be430 - add support for SANE_Bool in sanei_check_value
- add sanei_constrain_value.lo to libsane dependencies
	- add makedepend for .lo files in sanei
	- add configuration parsing framework
2008-07-10 05:40:25 +00:00
Stéphane Voltz 777c8f4f6d - improved sanei_constrain_value to handle arrays (such as gamma
tables)
2008-06-10 04:59:45 +00:00
Mattias Ellert d5ae0bbc3d Fix for bug #306751: sanei-thread with pthreads on 64 bit 2008-05-15 12:50:25 +00:00
m. allan noah deafc44600 sanei/sanei_usb.c: allow sanei_usb_init() to run once per second
backend/fujitsu.c: backend v1.0.60, relocate call to sanei_usb_init(),          free sane_devArray before calloc'ing a new one
2008-04-28 00:48:48 +00:00
Julien BLACHE 57bfede65b Plug an information leak in the net backend.
When sending out a SANE_NET_CONTROL_OPTION RPC for the SANE_ACTION_GET_VALUE
action (and SANE_ACTION_SET_AUTO for the network protocol versions < 3), the
backend was not clearing the memory area for the value argument before
sending it over the network, resulting in an information leak for the
SANE_ACTION_GET_VALUE case.
2008-04-13 14:44:20 +00:00
Julien BLACHE 8ed0d66582 Do not blindly use ftok() in snapscani_mutex_open(). Compute an IPC key based
on the product ID, bus number and device number for libusb devices; fallback
to ftok() otherwise and check the return value.
2008-03-28 20:39:02 +00:00
m. allan noah 127c77c1e5 add class 6 to usb detection code, fix scsi detection bug 2008-03-28 14:13:23 +00:00
Mattias Ellert 22efa538b7 Fix warnings about ignored --datarootdir 2008-02-03 06:59:36 +00:00
Alessandro Zummo 5af50cf25d fix compilation with cygwin
closes: #307969
2008-01-08 23:04:04 +00:00
Alessandro Zummo a386b0a960 added udp support functions 2007-12-26 11:18:26 +00:00
Mattias Ellert ac71384c82 Typo 2007-11-16 18:37:07 +00:00
Gerhard Jaeger 66269b670e Added sanei_usb_get_descriptor() to retrieve more info about a
device descriptor
2007-11-16 08:46:32 +00:00
Mattias Ellert 71be983cdd use SCSITaskSGElement if available 2007-11-10 15:44:41 +00:00
Mattias Ellert 93e856b53f Cross compilation fixes and libtool update 2007-11-10 07:12:55 +00:00
Julien BLACHE b349d9c500 Fix boundary checking after the for() loop in sanei_ab306_open(). From Johannes Meixner at SuSE. 2007-10-25 13:23:52 +00:00
Ilia Sotnikov fbae3e1b40 * Fixed empty liblib.a, libsanei.a produced by libtool - '-static' flag
is now mentioned in both compile & link stages to tell 'libtool' that static
  library is being built (static libraries are disabled by default when
  configure produces libtool from ltmain.sh).
2007-07-02 17:21:24 +00:00
Julien BLACHE 5dcf165795 Switch sanei_scsi to the SG_IO ioctl interface, instead of the
asynchronous SG3 read/write interface.

Makes it possible to use SCSI scanners in 32/64bit mixed environments,
thanks to the ioctl 32bit compatibility layer, which is NOT possible
using the SG3 interface.
2007-06-21 19:35:53 +00:00
Ilia Sotnikov b861ff6af5 + Use libtool instead of ar/ranlib, which correctly handles dependencies
(eg. for parallel makes)
2007-06-12 06:38:58 +00:00
Gerhard Jaeger 3766614f83 * sanei/sanei_scsi.c: Fixed retrieval of HZ. 2007-02-07 07:16:53 +00:00
Mattias Ellert 49d756ca44 Fixing compiler warnings 2007-01-20 23:02:53 +00:00
Alessandro Zummo 7a34d599e5 * sanei/sanei_tcp.c: added a missing include
* backend/epson2.c: fixed a bug while moving scanner data,
removed support for line mode (block or ext modes will be used).
2007-01-20 20:59:05 +00:00
Alessandro Zummo bf5a1290f7 * epson2: restructured code once more, splitted
in multiple files, added networking
support, added FS G extended handshaking mode,
make proper use of extended commands when possible
* sanei/sanei_tcp.c: read now wait until all
the requested data is available.
2006-12-18 00:13:09 +00:00
Alessandro Zummo b400664851 2006-12-01 Alessandro Zummo <a.zummo@towertech.it>
* Added sanei_tcp interface.
2006-11-30 23:23:19 +00:00
Karl Heinz Kremer 3d057d04c6 Applied Henning's patch, Fixed some compiler warnings. 2006-06-11 19:46:09 +00:00
Gerhard Jaeger c25e16f38a Added patch created by Vitaly Lipatov <LAV AT vl3143.spb.edu>:
Add --with-lockdir to configure for set path to lock dir
  Set PATH_SANE_LOCK_DIR really to lock dir (instead localstatedir)
Updated german translation file.
2006-06-07 07:28:31 +00:00
Wittawat Yamwong 2baa01effa Modified sanei_read_int(): call usb_clear_halt() if and only if the endpoint
is halted.
2006-05-26 07:58:15 +00:00
Henning Geinitz 92d177c049 Added USB support for DragonFlyBSD (bug #303183). 2006-03-11 12:56:34 +00:00
Henning Geinitz 1695dd4278 Workaround for compilation problem on Windows/cygwin. 2006-02-04 20:51:07 +00:00
Henning Geinitz 2b425ad61c Added checks for altsetting =! 0. 2006-01-22 16:52:13 +00:00
Mattias Ellert 6f301b10ed Fixing compilation warnings 2006-01-22 09:04:41 +00:00
Henning Geinitz a157bd3f09 Added warning if libusb support is not built in and some more debug messages. 2006-01-07 18:04:17 +00:00
Gerhard Jaeger 29c677e984 Fixed problem, when the device name contains one or more
path-separators. These characters are now converted. The
problem occurs on 2.4 based installations as well as on OpenBSD.
2005-12-07 13:49:39 +00:00
Jochen Eisinger eb446e2de1 2005-11-28 Jochen Eisinger <jochen@penguin-breeder.org>
* sanei/sanei_pa4s2.c: incorrect test of a bit mask.
2005-11-28 22:24:17 +00:00
Mattias Ellert cfd52e328f Adding some debugging. Fixing some warnings. 2005-11-22 21:17:20 +00:00
Oliver Schwartz 034f05523d Fixes for Benq 5000 2005-11-02 19:22:06 +00:00