Wykres commitów

61 Commity (master)

Autor SHA1 Wiadomość Data
David Ward 1a933bba7e Cast pointer arguments if needed when using "%p" format specifier
Pointer arguments must have type (void *) when printed with the format
specifier "%p".
2022-03-08 19:00:00 -05:00
David Ward 6be83f469b Resolve compiler warnings about misleading indentation
This change is targeted at specific lines of code reported by GCC or
Clang as potentially causing unintended behavior.
2022-03-08 19:00:00 -05:00
Olaf Meeuwissen e79adde8b2
Use URL to refer users to copies of the GPL and LGPL
With the exception of use in three quotes as well as our inlcuded copy
of the GPL, all use of the Free Software Foundation's postal address
has been removed.

Re #320.
2021-02-12 17:41:38 +09:00
Fletcher Woodruff de903b84c4 dll: fix memory leak in load
In the case where we are unable to get a path for loading libs, and
instead just use LIBDIR, we set 'src = strdup(LIBDIR)'. However, we
never update orig_src to point to src before tokenizing the path with
strsep(), so the memory is never freed.

Update load to always set orig_src to src so that we don't leak memory.
2020-10-12 16:25:07 -06:00
Michael Cronenworth 9793d4f64e MinGW build fixes
- Fix define check on S_IFSOCK, looked like a typo
- Need a define check around syslog usage
- libdll_preload already has sanei_usb symbols and linking fails with
  duplicate symbol errors if this is left in
2020-06-19 09:34:27 -05:00
Olaf Meeuwissen fd407cc58b dll: Make previous change backwardly compatible
Older GCC do not know the cast-function-pragma and flag that as a
warning.  That results in an error on our Debian 9 build.
2019-12-22 18:34:45 +09:00
Olaf Meeuwissen e7f6c6e864 dll: Ignore [-Wcast-function-type] compiler warnings 2019-12-22 17:58:39 +09:00
Olaf Meeuwissen a993e6438e dll: Fix [-Wformat-truncation=] compiler warning
Per POSIX, `readdir` returns filenames that are at most `NAME_MAX` long.
2019-12-22 16:09:11 +09:00
Povilas Kanapickas b30406873c sanei_usb: Add support for record testing mode 2019-06-16 20:46:46 +03:00
Povilas Kanapickas 7de8efd395 sanei_usb: Add support for "development mode" replay testing 2019-06-16 20:46:46 +03:00
Povilas Kanapickas 21ed18b230 dll: Report when testing backend is unknown 2019-06-16 20:46:46 +03:00
Povilas Kanapickas 0122c060b7 sanei_usb: Add support for replay testing 2019-06-16 20:46:46 +03:00
Olaf Meeuwissen cadf5a9b1a Prevent segfault in case strndup cannot allocate memory
This complements 18f9e5598c
2019-06-15 14:45:36 +09:00
Povilas Kanapickas 18f9e5598c dll: Don't unnecessarily use alloca 2019-05-27 18:56:01 +03:00
Olaf Meeuwissen 23891a2646 .editorconfig: trim trailing whitespace 2017-05-29 21:14:29 +09:00
Olaf Meeuwissen 74b4a34e82 dll: fix pedantic compiler warning 2016-09-04 12:12:14 +09:00
Olaf Meeuwissen 5389808029 Fix memory leak 2016-08-02 21:56:09 +09:00
Olaf Meeuwissen 1006445982 Use DIR_SEP instead of hard-coding ":"
Fixes 313540
2016-08-02 21:38:43 +09:00
Niels Ole Salscheider e47cb8d2b4 Do not use STRINGIFY for LIBDIR but pass "LIBDIR" from build system 2015-08-31 20:31:54 -04:00
Chris Bagwell c8dde5e271 Make preload DLL backend's symbols make prototypes
Most errors were in return values. Some compilers, especially
64-bit ones, are picky about this and fail to compile.
2012-08-07 20:57:44 -05: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
Chris Bagwell 1dd768d534 Do not link in preload backends for libsane-dll
Current backend/Makefile.am states difference between libsane and
libsane-dll as:

> libsane.la and libsane-dll.la are the same thing except for
> the addition of backends listed by PRELOADABLE_BACKENDS that are
> statically linked in.

We were (mistakenly) linking in dll-preload.h and thus symbols
for all preload backends for both libraries but we were only
linking in those symbols for libsane.

This mistake became obvious on mingw which does not allow for
any unresolved symbols.  Resolve by forcing an empty preload
backend list for libsane-dll.
2011-11-06 16:39:06 -06: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
Julien BLACHE ca15c0fda2 Allow symlinks under SANE_CONFIG_DIR/dll.d 2010-07-09 18:57:44 +02:00
Julien BLACHE d3951b0734 SANE_CONFIG_DIR/dll.d isn't Debian-specific anymore
Fixup comment in the dll.d handling code, now that it's been merged into
SANE proper.
2010-07-09 18:55:14 +02: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
Chris Bagwell 23ff26f9a5 * acinclude.m4, configure.in: Put all libraries into their
own *_LIB variables instead of $LIB so that we do not have to
link in the world to all executables. Modified SANE_CHECK_U_TYPES
to be a little more portable to platforms that use #define
for u_* types. Create SANE_CHECK_BACKENDS macro so that
PRELOADABLE_BACKENDS can also be valided.  Auto-populated
PRELAODABLE_BACKENDS when detect dlopen() won't work.
Various protability cleanups.
* backend/dll.c: Make dll-preload.c a .h since its an include and
not compilable byitself.
* frontend/Makefile.in, frontend/scanimage.c, include/laaloca.h,
  lib/Makefile.am, lib/alloca.c, strcasestr.c, tools/Makefile.in,
  tools/sane-desc.c: Convert lib/ to automake.  Create a liblib.la
  for everyone to use and a libfelib.la for only frontend programs.
  Make all internal programs be prefixed with sanei_ as not to conflict
  with other programs libsane is linked in with that will also most
  likely create similar internal utils on problem platforms.
  * include/getopt.h, lib/getopt.c, lib/getopt1.c: Always compile
  and link in getopt_long() but prefix it with sanei_.  Its
  easier to always use internal version then try to figure out what
  platforms support getopt_long() and what header files to use.
  * backend/Makefile.am: Convert backend makefile to automake.
  Initial version that is feature parity with original but uses
  specific rules instead of wildcards and only links in libraries/objs
  really required. Room for more cleanup of whats linked in once
  all makefiles have been converted to automake.
2009-01-31 03:12:18 +00:00
m. allan noah 91598aa800 * backend/*.[ch]: nearly every backend used V_MAJOR
instead of SANE_CURRENT_MAJOR in sane_init()
* backend/snapscan.c: remove EXPECTED_VERSION check
since new SANE standard is forward compatible
2008-11-26 21:21:31 +00:00
Julien BLACHE 341363843a By popular demand, merge my Debian patch adding support for dll.conf
snippets under $configdir/dll.d.
2008-05-07 17:04:40 +00:00
Mattias Ellert 71f9081904 MacOS X updates 2007-11-10 11:35:34 +00:00
Mattias Ellert 49d756ca44 Fixing compiler warnings 2007-01-20 23:02:53 +00:00
Henning Geinitz 5168206e4b With cygwin, use ":" as DIR_SEP (patch from Philip Aston <paston@bea.com>). 2006-02-04 20:52:53 +00:00
Mattias Ellert 6f301b10ed Fixing compilation warnings 2006-01-22 09:04:41 +00:00
Henning Geinitz df2a8b6180 Fixed dynamic loading on current HP/UX systems (bug #302732). 2005-12-20 17:15:39 +00:00
Henning Geinitz 6c3427c52d Changes to support SANE on ZETA. Not all
patches have been applied yet, but it's a start. The backends
	  are not installed as shared libs but as add-ons, which are shared libs
	  but in a specific folder in [/system|~]/config/add-ons/ named SANE/.
	  The install target has been changed to account for this,
	  Some files don't exist in BeOS/ZETA (ipc.h, ...).
	  Bbackend function names get a prefix, I suppose to avoid namespace clashes.
	  Though we do have a libdl to implement dl_open, the native way is prefered.
	  Added a --with-docdir= configure arg.
	  BeOS has a broken get[name|addr]info() from bind. This is fixed in ZETA R1.
	  libtool needs -no-undefined. Various VPATH fixes.
	  Check for <be/drivers/USB_scanner.h>, but not used yet.
	  No S_IFSOCK (sockets are fds to /dev/net/api). Stub pio code, untested.
	  Patch from Francois Revol <revol@free.fr>.
2005-07-15 21:59:25 +00:00
Gerhard Jaeger b0dd4470cc Fixed OS/2 restriction for dlopening DLLs on OS/2, as
it only works for 7.3 filenames for some reason
(patches by Franz Bakan <fbakan@gmx.net>.
2005-06-30 08:18:29 +00:00
Henning Geinitz da5773b8cb Work around 8 char limit for dynamic loading on OS/2 (patch from Franz Bakan
<fbakan@gmx.net>).
2004-05-24 19:16:41 +00:00
Oliver Rauch a28bd84350 Added DIR_SEP and PATH_SEP defintions for windows 2004-05-16 22:08:03 +00:00
Henning Geinitz c824c6de2d Patch from Franz Bakan <fbakan@gmx.net>. 2004-04-23 15:21:14 +00:00
Henning Geinitz e7484c515e Silenced some compilation warnings. 2003-12-27 17:48:39 +00:00
Frank Zago 3bda0d541d Port to Cygwin. 2003-09-24 03:41:48 +00:00
Henning Geinitz dfe765e251 Fixed some compilation warnings. 2003-04-13 13:25:15 +00:00
Henning Geinitz 4d4f8a4c64 Added some missing debug messages. Fixed a warning. 2003-04-04 10:26:20 +00:00
Henning Geinitz f2cce09238 Intented according GNU coding standards. 2002-12-04 20:30:48 +00:00
Henning Geinitz 9e0f5f2a58 Ignore comments that are in the same line as the backend entries. Minor
manpage fixes.
2002-12-04 20:25:13 +00:00
Henning Geinitz 46fcee60aa Add dynamic loading support for MacOS X/Darwin (from Peter O'Gorman
<peter@pogma.com>).
2002-12-01 12:42:01 +00:00
Henning Geinitz 991bd09675 Fixed PACKAGE_VERSION breakage. PACKAGE_VERSION was redefined by autoconf 2.5
with a different meaning. Use PACKAGE_STRING instead.
2002-11-29 18:19:58 +00:00
Frank Zago 4851b683c3 Fixed some warnings. 2002-11-19 05:06:08 +00:00
Henning Geinitz 41e7fdda5f Don't call sane_exit twice. Call sane_init after sane_exit. Try to load from
$LD_LIBRARY_PATH ($SHLIB_PATH, $LIBPATH) first and only check LIBDIR if
opening failed. New version: 1.0.6.
Henning Meier-Geinitz <henning@meier-geinitz.de>
2002-04-21 14:02:58 +00:00
Henning Geinitz 7e4cd23e45 Added some debug messages (e.g. if dll.conf isn't found). Some adjustments concerning
debug levels. Removed some compilation warnings. New version: 1.0.5.
Henning Meier-Geinitz <henning@meier-geinitz.de>
2001-11-11 19:55:49 +00:00