diff --git a/.editorconfig b/.editorconfig index a907a12b5..6ae1cd130 100644 --- a/.editorconfig +++ b/.editorconfig @@ -7,3 +7,6 @@ # See http://editorconfig.org/#download for details. root = true ; look no further + +[*] +trim_trailing_whitespace = true diff --git a/AUTHORS b/AUTHORS index 8e041b190..74153b064 100644 --- a/AUTHORS +++ b/AUTHORS @@ -85,7 +85,7 @@ Backends: pnm: Andreas Beck, Gordon Matzigkeit, David Mosberger, Michael Herder, and Henning Geinitz qcam: Scott Laird (original driver), David Mosberger (SANE backend), - despeckling filter by Patrick Reynolds, + despeckling filter by Patrick Reynolds, B&W fixes by Andrew Kuchling ricoh: Feico W. Dillema rts8891: Stéphane Voltz diff --git a/ChangeLogs/ChangeLog-1.0.0 b/ChangeLogs/ChangeLog-1.0.0 index 0600ae194..b2633966f 100644 --- a/ChangeLogs/ChangeLog-1.0.0 +++ b/ChangeLogs/ChangeLog-1.0.0 @@ -3,7 +3,7 @@ * Version 1.0 released * From Brian J. Murrell: - + * backend/dll.conf: Mention dc210. * backend/cderror.h: New file. @@ -359,7 +359,7 @@ models. * backend/epson.c: Apply Christian Bucher's patch. - + * backend/dc25.h: New file (by Peter Fales ) * backend/dc25.c: Ditto. * backend/dc25.conf: Ditto. @@ -381,7 +381,7 @@ * backend/artec.c: Added code to default to using millimeters instead of pixels for measurements, can revert to pixels by defining PREFER_PIXEL_MODE at compilation time. - + Added code to cause sane_read to block until data available to return, also buffers as much data as possible before returning. @@ -690,7 +690,7 @@ needs to be installed before running configure. * backend/s9036.c: Don't depend on GNU C dynamically sized arrays. - + * backend/coolscan.c (send_one_LUT): Use alloca() instead of depending on GNU C dynamically sized arrays. Include . @@ -715,7 +715,7 @@ * sanei/sanei_pio.c: Ditto. * backend/epson.c, backend/epson.h, backend/epson.conf: Updated with Christian's version adds support for parallel port interface. - + * sanei/sanei_scsi.c (sanei_scsi_req_wait): Patch by Matto to let sense-handler decide whether a non-zero sense_buffer[0] really should be considered an error (needed for Microtek backend). @@ -724,7 +724,7 @@ unit SANE_UNIT_MICROSECOND. Patches by Oliver Rauch: - + * frontend/gtkglue.c (unit_string): Handle SANE_UNIT_MICROSECOND. * frontend/scanimage.c (print_unit): Ditto. (parse_scalar): Ditto. @@ -752,7 +752,7 @@ * backend/snapscan.c (DL_INFO): Increase from 0 to 1. (DL_MAJOR_ERROR): Ditto. This avoids printing error messages unless the user specifically requests them. - + * frontend/gtkglue.c: Include . * include/sane/config.h.in: Ignore HAVE_USLEEP under Apollo @@ -792,7 +792,7 @@ * backend/epson.conf: New file. Patches by Yuri Dario : - + * backend/epson.c (sane_init): Support config file. * sanei/sanei_ab306.c (outb): Add missing parens. @@ -841,7 +841,7 @@ * backend/snapscan.c: Upgrade to latest version (0.3 patch 7). * backend/snapscan.h: Ditto. - + * configure.in (V_MINOR): Up version to 0.71. * sanei/sanei_scsi.c (scsi_cmd) [USE == SOLARIS_INTERFACE]: "or" @@ -918,7 +918,7 @@ * tools/xerox (scale): Added improvements contributed by Joachim Woll . - * Upgrade to Oliver's latest UMAX backend. + * Upgrade to Oliver's latest UMAX backend. * include/Makefile.in (distclean): Add empty all rule. Add distclean rule to delete Makefile. @@ -1026,7 +1026,7 @@ * backend/mustek.c (dev_open): Fix debug message. * Solaris related patches by Martin Huber: - + * backend/umax-scsi.c (umax_wait_scanner): Sleep for 1 second instead of 100ms on Sun platforms---the SCHILYscg driver prints a warning message each time a device is busy. Duh. @@ -1145,7 +1145,7 @@ * Several changes in tools/find-scanner.c to run using above mentioned driver. - Fixed wrong IN_periph_devtype_cpu (was 1, should be 3). + Fixed wrong IN_periph_devtype_cpu (was 1, should be 3). 1997-12-14 David Mosberger-Tang @@ -1263,11 +1263,11 @@ * japi/SaneOption.java: Fix indentation. (unitString): New function. - + * japi/ImageCanvas.java: New file. * japi/Jscanimage.java: Ditto. * japi/ScanIt.java: Ditto. - + * japi/Makefile.in (CLASSES): Mention ScanIt.class and ImageCanvas.class. (all): Mention Jscanimage.class. @@ -1332,7 +1332,7 @@ correct value before connecting the toggled callback. Bugs reported by Petter Reinholdtsen : - + * sanei/sanei_config.c (sanei_config_open): Add missing cast to (char *). @@ -1364,7 +1364,7 @@ * backend/hp.c (sane_control_option): Only turn on RELOAD_PARAMS when value changed. - + * backend/qcam.c (sane_control_option): Only turn on RELOAD_PARAMS when value changed. @@ -1578,7 +1578,7 @@ * configure.in (CPPFLAGS): Ditto. * include/sane/config.h.in: Ditto. - * backend/epson.c: Updated + * backend/epson.c: Updated 1997-10-09 David Mosberger-Tang @@ -1704,7 +1704,7 @@ Tue Oct 7 15:44:33 1997 Kazuhiro Sasayama * backend/microtek.c: Updated with latest version from http://www.mir.com/mtek/ by Matt Marjanovic . * backend/microtek.h: Ditto. - + 1997-10-3 Jeff Freedman * sanei/sanei_scsi.c: Minor fixes for OS/2 support. @@ -1722,7 +1722,7 @@ Tue Oct 7 15:44:33 1997 Kazuhiro Sasayama [USE = OS2_INTERFACE]: OS/2 version of sanei_scsi_cmd(). (sanei_scsi_cmd, sanei_scsi_req_wait) [STUBBED_INTERFACE]: Return proper value. - + * include/sane/config.h.in (HAVE_STRNCASECMP, HAVE_OS2_H): Add #undef. If !HAVE_STRNCASECMP, define strncasecmp macro as alias for strnicmp. @@ -1739,7 +1739,7 @@ Tue Oct 7 15:44:33 1997 Kazuhiro Sasayama [USE = OS2_INTERFACE]: OS/2 version of sanei_scsi_cmd(). (sanei_scsi_cmd, sanei_scsi_req_wait) [STUBBED_INTERFACE]: Return proper value. - + * include/sane/config.h.in (HAVE_STRNCASECMP, HAVE_OS2_H): Add #undef. If !HAVE_STRNCASECMP, define strncasecmp macro as alias for strnicmp. @@ -2226,7 +2226,7 @@ Wed Jun 18 15:42:25 1997 David Mosberger-Tang * doc/sane.tex (section{Image Data Format}}): Clarify what valid bit-depths are. - + Tue Jun 17 07:47:51 1997 David Mosberger-Tang * backend/qcam.c (sane_get_parameters): Test for != QC_COLOR @@ -2748,7 +2748,7 @@ Sun Apr 20 09:09:06 1997 David Mosberger-Tang * frontend/Makefile.in: Ditto. * backend/Makefile.in: Ditto. * sanei/Makefile.in: Ditto. - + * frontend/saned.c (_PATH_HEQUIV): Define if not defined yet.. * configure.in: Check for libgimp/gimp.h instead of -lgimp since diff --git a/ChangeLogs/ChangeLog-1.0.1 b/ChangeLogs/ChangeLog-1.0.1 index 3adfafcf5..62ebe8ab6 100644 --- a/ChangeLogs/ChangeLog-1.0.1 +++ b/ChangeLogs/ChangeLog-1.0.1 @@ -67,7 +67,7 @@ * doc/sane-umax-doc.html: Ditto. * doc/sane-umax-doc.tex: Ditto. * doc/sane-umax-doc.man: Ditto. - + 1999-04-06 Petter Reinholdtsen * backend/snapscan.c (sane_exit sane_get_devices): Removed memory @@ -116,7 +116,7 @@ * configure.in (V_REV): New variable. (VERSION): Include ${V_REV} in vesion number. Substitute V_REV. - + * backend/umax.c (umax_do_request_sense): Make "static". * backend/canon.h: Move array "option_name"... @@ -222,7 +222,7 @@ BRY advanced options. * backend/umax.c: Updated with Oliver's latest version. - + * doc/sane-sharp.man: New file (by Kazuya Fukuda). * backend/sharp.c: Updated with Kazuya's latest version. * backend/sharp.h: Ditto. @@ -302,7 +302,7 @@ * backend/snapscan.c (gamma_8): Make static. (start_reader): Ditto. - + * backend/microtek.c (do_precalibrate): Make static. (finagle_precal): Ditto. (pack_flat_data): Ditto. @@ -446,4 +446,4 @@ s->val[foo].w not s->val[foo]. The latter compiles on gcc-2.7.2.3 without warning but causes an error on other compilers (e.g., egcs). - + diff --git a/ChangeLogs/ChangeLog-1.0.10 b/ChangeLogs/ChangeLog-1.0.10 index 57dee9aa8..c26d7c6da 100644 --- a/ChangeLogs/ChangeLog-1.0.10 +++ b/ChangeLogs/ChangeLog-1.0.10 @@ -155,7 +155,7 @@ 2003-01-17 Henning Meier-Geinitz * configure configure.in include/sane/config.h.in sanei/sanei_scsi.c: - Disable the new Linux SG interface for sparc64 to work-around 32 bit + Disable the new Linux SG interface for sparc64 to work-around 32 bit userland / 64 bit kernel problems. * doc/descriptions/unsupported.desc: Added HP ScanJet 3500c, 3530c, 3570c, 3570cxi, 5500C and Microtek ScanMaker 3800. Updated link for @@ -198,7 +198,7 @@ 2003-01-13 Gerhard Jaeger * doc/descriptions/unsupported.desc: Added HP ScanJet 2300C and various chipset - information for the unsupported Plustek devices + information for the unsupported Plustek devices * doc/descriptions/plustek.desc: cleanup @@ -306,9 +306,9 @@ ). Added detection of Genius Colorpage Vivid3x. It's unknown if it works. Updated .desc file. Don't print calib line warnings by default. - * doc/descriptions/microtek2.desc: Updated (From Karsten Festag + * doc/descriptions/microtek2.desc: Updated (From Karsten Festag ). - * po/Makefile.in po/sane-backends.pt.po: Added Portuguese translation + * po/Makefile.in po/sane-backends.pt.po: Added Portuguese translation for the gt68xx backend (from Pedro Morais ). * po/sane-backends.de.po: Added some missing translations. Removed some (wrong) fuzzy translations. @@ -316,17 +316,17 @@ 2003-01-08 Oliver Schwartz * doc/descriptions/snapscan.desc: - Added entries for Acer/Benq 310U, 320U, 340U and + Added entries for Acer/Benq 310U, 320U, 340U and Mitsubishi Diamondview 650U * backend/snapscan.c backend/snapscan.h backend/snapscan-scsi.c - backend/snapscan.conf: Backend version 1.4.18, added support for - Acer/Benq310U, fixed color correction for Agfa SnapScan 300 + backend/snapscan.conf: Backend version 1.4.18, added support for + Acer/Benq310U, fixed color correction for Agfa SnapScan 300 2003-01-08 Henning Meier-Geinitz * doc/descriptions/hpsj5s.desc doc/descriptions-external/hp4200.desc: Use uniform model names for HP scanners. - * doc/descriptions/unsupported.desc: Added Canon CanoScan D1250U2 + * doc/descriptions/unsupported.desc: Added Canon CanoScan D1250U2 and HP ScanJet 4400C. * po/artec_eplus48u.de.po po/epson.de.po po/epson.ru.po po/epson.sv.po po/gt68xx.de.po po/matsushita.fr.po @@ -343,7 +343,7 @@ are now in the per-language sane-backends.??.po files. * TODO: Updated .desc file, mapages, sanei_usb and OS/2 entries. Removed entry about po files. - * po/Makefile.in: Remove sane-backends.pot from list of distributed + * po/Makefile.in: Remove sane-backends.pot from list of distributed files. Add microtek2 files. * backend/microtek2.c backend/microtek2.h: Improved support for Scanmaker X12USL. Alpha support for Scanmaker 9800XL. Some bugfixes. @@ -370,7 +370,7 @@ 2003-01-07 Stéphane Voltz * doc/sane-umax_pp.man: updates and fixes - * doc/descriptions/umax_pp.desc: change model form HP3200C to + * doc/descriptions/umax_pp.desc: change model form HP3200C to Scanjet 3200C 2003-01-07 Matthew Duggan @@ -384,15 +384,15 @@ doc/descriptions/dc240.desc, doc/descriptions/gphoto2.desc: Update author information - * backend/dc25.c: Fix compiler warning + * backend/dc25.c: Fix compiler warning - * backend/dc210.c, backend/dc240.c, backend/dc210.conf, + * backend/dc210.c, backend/dc240.c, backend/dc210.conf, backend/dc240.conf, backend/gphoto2.conf, backend/dc25.conf: Irix fixes from mailing list 2003-01-05 Peter Fales - * backend/dc25.c: Mailing list fix. Change = to == + * backend/dc25.c: Mailing list fix. Change = to == dc25/dc20 tests. 2003-01-05 Henning Meier-Geinitz @@ -448,8 +448,8 @@ GT-6801 scanners. Added "afe" option for gt68xx.conf for selecting default afe values. Removed AFE and exposure SANE options. Added documentation for afe option in gt68xx.conf. New version: 1.0-35. - * doc/descriptions-external/hp4200.desc - doc/descriptions-external/hpoj.desc: Use Hewlett-Packard consitantly + * doc/descriptions-external/hp4200.desc + doc/descriptions-external/hpoj.desc: Use Hewlett-Packard consitantly (instead of HP). * doc/descriptions-external/scanwit.desc doc/descriptions-external/viceo.desc: Added description files for @@ -458,7 +458,7 @@ * backend/test.c doc/descriptions/test.desc: Make sure that frontend bugs concerning the select fd are detected. * doc/sane-scsi.man: Minor formatting change. - * sanei/sanei_usb.c: Explicitely set first configuration. When claiming + * sanei/sanei_usb.c: Explicitely set first configuration. When claiming the interface, use the interface number from bInterfaceNumber. Explicitely set the alternative setting. When closing, call clear_halt, and reset_ep, and release_interface explicitley. On errors in @@ -525,7 +525,7 @@ Updated links. * backend/test.c po/sane-backends.de.po: Minor spelling and translation fixes. - + 2002-12-04 Henning Meier-Geinitz * backend/epson_scsi.c backend/sm3600.c: Move config.h include to the @@ -551,7 +551,7 @@ * configure.os2: Removed. No longer necessary. 2002-12-04 Matthew Duggan - * backend/canon_pp-dev.c: Don't compare firmware version numbers - + * backend/canon_pp-dev.c: Don't compare firmware version numbers - multiple versions do actually exist. * doc/descriptions/canon_pp.desc: Bump version number. @@ -574,7 +574,7 @@ 2002-12-01 Rene Rebe * backend/avision.h backend/avision.c backend/avision.conf - doc/descriptions/avision.desc: updated the Avision backend - + doc/descriptions/avision.desc: updated the Avision backend - including auto-generated .desc file listing all devices also present in the avision.c device-list. * doc/descriptions/avision.desc: syntax fix @@ -609,7 +609,7 @@ in do_stop: really print exit status of reader process. * doc/sane-usb.man: PACKAGEVERSION fix. Removed HP exception. Added MacOS X. - * doc/gamma4scanimage.man doc/sane-artec_eplus48u.man + * doc/gamma4scanimage.man doc/sane-artec_eplus48u.man doc/sane-config.man doc/sane-find-scanner.man doc/sane-gt68xx.man doc/sane-mustek.man doc/sane-mustek_usb.man doc/sane.man doc/saned.man doc/scanimage.man: Added missing quotes around @@ -661,7 +661,7 @@ 2002-11-23 Max Vorobiev * backend/hpsj5s.c: Removed default port probing. - + 2002-11-22 Henning Meier-Geinitz * doc/sane.man: Formatting fixes. Updates some backend entries and @@ -782,7 +782,7 @@ * backend/umax_pp.c: revert a experimental change that went into cvs by mistake. * po/umax_pp.de.po: switch to iso-8858-1 - + 2002-11-07 Henning Meier-Geinitz * backend/gt68xx.c backend/gt68xx_devices.c backend/gt68xx_high.h @@ -820,7 +820,7 @@ found. Use msgcat if available. Don't update the .po files automatically. * TODO: Added entries about canon.c model extraction bug, and sanei_usb - issue. Updated entries about MAcOS X support. Removed po files entry. + issue. Updated entries about MAcOS X support. Removed po files entry. 2002-10-31 Henning Meier-Geinitz @@ -831,10 +831,10 @@ 2002-10-31 Stéphane Voltz - * backend/umax_pp.c backend/umax_pp.h backend/umax_pp_low.h + * backend/umax_pp.c backend/umax_pp.h backend/umax_pp_low.h backend/umax_pp_low.c tools/umax_pp.c: add UTA detection, version number updates - + 2002-10-30 Henning Meier-Geinitz @@ -843,8 +843,8 @@ 2002-10-27 Peter Fales - * configure, acinclude.m4, aclocal.m4 - Remove checks for - specific version numbers of gphoto2 - that's not good for long + * configure, acinclude.m4, aclocal.m4 - Remove checks for + specific version numbers of gphoto2 - that's not good for long term maintenance, and the API has settled down enough that all recent versions (both releases and CVS) are workable for SANE. It is still necessary to specify --with-gphoto2 if you want to diff --git a/ChangeLogs/ChangeLog-1.0.12 b/ChangeLogs/ChangeLog-1.0.12 index ccc16e71f..fbf5e4cb3 100644 --- a/ChangeLogs/ChangeLog-1.0.12 +++ b/ChangeLogs/ChangeLog-1.0.12 @@ -107,7 +107,7 @@ 2003-05-07 Henning Meier-Geinitz * po/Makefile.in po/sane-backends.no.po: Added Norwegian - translation (from Sigurd Stordal ). + translation (from Sigurd Stordal ). 2003-05-06 Michael Herder @@ -122,8 +122,8 @@ 2003-05-05 Henning Meier-Geinitz * po/sane-backends.fr.po: Updates for the French translation from - Yann E. MORIN . - * tools/check-po.awk: Added script to check the translations for + Yann E. MORIN . + * tools/check-po.awk: Added script to check the translations for completeness (from Yann E. MORIN). * tools/README: Added description of check-po.awk. Minor reordering. @@ -138,7 +138,7 @@ * TODO: Removed obsololete entries. * NEWS: Updated for 1.0.12. * backend/ibm.c backend/ibm-scsi.c: Only disable object position - command for Ricoh IS-420. + command for Ricoh IS-420. 2003-05-04 Oliver Rauch @@ -185,7 +185,7 @@ * backend/snapscan.c backend/snapscan.h backend/snapscan-options.c backend/snapscan-scsi.c doc/descriptions/snapscan.desc: SnapScan - backend 1.4.26, added support for Agfa Arcus 1200, better support + backend 1.4.26, added support for Agfa Arcus 1200, better support for Benq 5000. 2003-04-30 Henning Meier-Geinitz @@ -322,7 +322,7 @@ doc/descriptions-external/v4l2.desc doc/descriptions-external/viceo.desc: Added comments to explain the reasons for not including these backends into SANE. - + 2003-04-16 Henning Meier-Geinitz * doc/scanimage.man: Added EXAMPLES section. @@ -333,8 +333,8 @@ * AUTHORS backend/Makefile.in backend/dll.conf backend/ibm-scsi.c backend/ibm.c backend/ibm.conf backend/ibm.h doc/Makefile.in - doc/sane.man doc/sane-ibm.man doc/.cvsignore - doc/descriptions/ibm.desc: Added IBM backend for the + doc/sane.man doc/sane-ibm.man doc/.cvsignore + doc/descriptions/ibm.desc: Added IBM backend for the IBM 2456, the Ricoh IS-420 and maybe the IS-410 and IS-430 from mf . Added manual page, fixed some warnings, Added detection for IS-410 and IS-430. @@ -344,7 +344,7 @@ support it. * doc/sane-ibm.man doc/descriptions/ibm.desc: Mention alpha quality. Add maintainer address. - + 2003-04-14 Henning Meier-Geinitz * tools/sane-desc.c: Fixed some HTML bugs. @@ -383,7 +383,7 @@ * TODO: Removed license issue. Updated desc files and global variables entries. Updated v4l entry. * doc/scanimage.man: --batch format doesn't work, only --batch=format. - + 2003-04-10 Henning Meier-Geinitz * backend/test.c backend/test.h doc/descriptions/test.desc: Added @@ -393,7 +393,7 @@ * backend/canon630u-common.c: Removed last change in offset/gain calculation, which croaked for some cases. Give up early if we - can't talk on the USB. + can't talk on the USB. * backend/canon630u.c: Added option to force scanner recalibration. 2003-04-04 Henning Meier-Geinitz @@ -402,7 +402,7 @@ 2003-04-03 Eddy De Greef - * TODO: removed mustek_pp entry (Check that global variables are + * TODO: removed mustek_pp entry (Check that global variables are initialized propperly 2003-04-03 Henning Meier-Geinitz @@ -415,14 +415,14 @@ * backend/as6e.c: Fixed some warnings. * backend/coolscan.c backend/coolscan-scsi.h: Fixed a bunch of compilation warnings. - * backend/djpeg.c: Fixed some warnings. - * backend/dmc.c: Fixed some warnings. + * backend/djpeg.c: Fixed some warnings. + * backend/dmc.c: Fixed some warnings. 2003-04-03 Eddy De Greef * backend/mustek_pp.c: Fixed a potential crash bug that could be - triggered when calling sane_init/sane_get_devices/sane_exit - multiple times, and fixed some minor bugs to pass the + triggered when calling sane_init/sane_get_devices/sane_exit + multiple times, and fixed some minor bugs to pass the frontend/tstbackend.c tests. 2003-04-03 Oliver Schwartz @@ -487,7 +487,7 @@ 2003-03-28 Oliver Schirrmeister - * backend/fujitsu.c backend/fujitsu-scsi.h: + * backend/fujitsu.c backend/fujitsu-scsi.h: now really supports the fi-4120C 2003-03-26 Karl Heinz Kremer @@ -506,7 +506,7 @@ * doc/descriptions/unsupported.desc: Added Canon CanoScan FB620U. Added more info for HP ScanJet 3500c. - + 2003-03-24 Rene Rebe * include/sane/sanei_usb.h sanei/sanei_usb.c: support for @@ -544,12 +544,12 @@ * backend/fujitsu.c backund/fujitsu-scsi.h backend/fujitsu.h * patch from Ron Cemer - fixes the broken "ADF empty" detection on the Fujitsu scanners + fixes the broken "ADF empty" detection on the Fujitsu scanners when connected via USB. It also fixes a sense-request issues, - which were required in order to determine whether the ADF is + which were required in order to determine whether the ADF is empty. It also eliminates some duplicate code blocks. * renamed some functions - + 2003-03-13 Henning Meier-Geinitz * backend/gt68xx.c backend/gt68xx_devices.c backend/gt68xx_low.h @@ -568,11 +568,11 @@ * backend/fujitsu.c backund/fujitsu-scsi.h displays the offending byte when something is wrong in the window descriptor block. - + 2003-03-09 Eddy De Greef * backend/mustek_pp_cis.c backend/mustek_pp_cis.h: Fixed two - calibration bugs: one occasionally caused overexposed images at + calibration bugs: one occasionally caused overexposed images at all resolutions; the other one occasionally caused color inbalances when scanning narrow areas at high resolutions. @@ -676,7 +676,7 @@ or 0x04. * doc/descriptions/unsupported.desc: Added Compaq S4 100 and Microtek Scanmaker 4800. - + 2003-02-26 Henning Meier-Geinitz * doc/descriptions-external/hp5400.desc: Added description for hp5400 @@ -710,9 +710,9 @@ 2003-02-23 Stéphane Voltz - * backend/umax_pp_low.c backend/umax_pp_low.h backend/umax_pp_mid.c - backend/umax_pp_mid.h backend/umax_pp.c backend/umax_pp.h - backend/umax_pp.conf tools/umax_pp.c doc/sane-umax_pp.man: changed + * backend/umax_pp_low.c backend/umax_pp_low.h backend/umax_pp_mid.c + backend/umax_pp_mid.h backend/umax_pp.c backend/umax_pp.h + backend/umax_pp.conf tools/umax_pp.c doc/sane-umax_pp.man: changed highlight option to contrast, and gain to brightness. 2003-02-24 Henning Meier-Geinitz @@ -783,7 +783,7 @@ 2003-02-20 Oliver Schirrmeister * backend/fujitsu.c: make option RIF available for 3091 and 3092, bugfix * backend/fujitsu.c: set availability of options THRESHOLD und VARIANCE - + 2003-02-20 Oliver Schirrmeister * backend/fujitsu.c, backend/fujitsu.h: patch from : fi4220 support @@ -791,7 +791,7 @@ 2003-02-19 Henning Meier-Geinitz - * doc/descriptions-external/ma1509.desc: Added description of the + * doc/descriptions-external/ma1509.desc: Added description of the ma1509 backend for Mustek BearPaw 1200F scanners. * doc/descriptions/unsupported.desc: Added Avision, Brother, and Umax scanners. Removed Mustek BearPaw 1200F. @@ -842,7 +842,7 @@ 2003-02-15 Karl Heinz Kremer - * backend/epson.c backend/epson_usb.[ch]: Fix problem with + * backend/epson.c backend/epson_usb.[ch]: Fix problem with "usb syntax in config file * backend/epson.c: Move sanei_init_usb() to sane_init(). Thanks @@ -851,7 +851,7 @@ 2003-02-13 Henning Meier-Geinitz * doc/descriptions/unsupported.desc: Updated Canon, Fujitsu, and - Plustek entries. + Plustek entries. * TODO: Added entries about v4l, fujitsu, snapscan. 2003-02-11 Peter Fales @@ -859,10 +859,10 @@ * backend/dll.conf, doc/sane-gphoto2.man: Added a commented out gphoto2 entry in dll.conf, and mentioned it in the man page. - * backend/gphoto2.c: Bug fixes. Don't coredump if the + * backend/gphoto2.c: Bug fixes. Don't coredump if the gphoto2.conf file is missing, and don't require a speed to be set if the usb port is used. - + 2003-02-11 Peter Kirchgessner * backend/hp-handle.c: Fix problem with ifdef/ifndef for threads diff --git a/ChangeLogs/ChangeLog-1.0.13 b/ChangeLogs/ChangeLog-1.0.13 index a3f2705ab..b521e7033 100644 --- a/ChangeLogs/ChangeLog-1.0.13 +++ b/ChangeLogs/ChangeLog-1.0.13 @@ -347,7 +347,7 @@ 2003-10-16 m. allan noah * backend/fujitsu.c: memset the device struct and the scsi buff - when a new device is attached. Submitted by + when a new device is attached. Submitted by Chris Chesney . Initialized a couple vars in the 3091 init routines. @@ -368,7 +368,7 @@ * doc/descriptions/unsupported.desc: Added Pentax, Sicos, Syscan, and UMAX scanners. - + 2003-10-13 Henning Meier-Geinitz * backend/gt68xx_low.c: Fixed compilation bug when debugging is @@ -644,9 +644,9 @@ * po/Makefile.in: Added plustek_pp.c. * po/sane-backends.nl.po: Updated Dutch translation (from Martin Kho ). - * po/sane-backends.bg.po po/sane-backends.cs.po po/sane-backends.de.po - po/sane-backends.es.po po/sane-backends.fr.po po/sane-backends.it.po - po/sane-backends.no.po po/sane-backends.pt.po po/sane-backends.ru.po + * po/sane-backends.bg.po po/sane-backends.cs.po po/sane-backends.de.po + po/sane-backends.es.po po/sane-backends.fr.po po/sane-backends.it.po + po/sane-backends.no.po po/sane-backends.pt.po po/sane-backends.ru.po po/sane-backends.sv.po: Regenerated. * doc/Makefile.in: Fixed link to image in HTML manpages. @@ -668,10 +668,10 @@ information. Spelling fixes. Minor updates. * doc/sane.man: Updated contact information. Removed contributing section (now on homepage). Spelling fixes, general updates. - * sane-abaton.man sane-agfafocus.man sane-apple.man sane-bh.man - sane-dc210.man sane-dc240.man sane-dc25.man sane-gphoto2.man - sane-hp.man sane-microtek2.man sane-microtek.man - sane-mustek.man sane-mustek_pp.man sane-pint.man + * sane-abaton.man sane-agfafocus.man sane-apple.man sane-bh.man + sane-dc210.man sane-dc240.man sane-dc25.man sane-gphoto2.man + sane-hp.man sane-microtek2.man sane-microtek.man + sane-mustek.man sane-mustek_pp.man sane-pint.man sane-st400.man sane-usb.man sane-v4l.man: Updated links to sane-devel and SANE homepage. * sane.tex: Changed homepage and sane-devel-request address. @@ -734,12 +734,12 @@ 2003-09-21 Henning Meier-Geinitz * tools/sane-desc.c: PATH_MAX is too small for long comments on - win32. Actually return 0 if there is no second quotation mark. + win32. Actually return 0 if there is no second quotation mark. Patch from Frank Zago . Check for !word everywhere to avoid segfaults when a quotation mark is missing. * sanei/sanei_config.c: Actually return 0 if there is no second - quotation mark. + quotation mark. * backend/ma1509.c backend/mustek.c backend/mustek_usb.c backend/test.c doc/descriptions/ma1509.desc doc/descriptions/mustek.desc doc/descriptions/mustek_usb.desc @@ -761,7 +761,7 @@ (patch from Malcolm Parsons ) * configure.in configure include/sane/config.h.in: added detection of machine/cpufunc.h and i386_set_ioperm() for FreeBSD support. - + 2003-09-16 Stéphane Voltz @@ -848,7 +848,7 @@ 2003-08-21 Karl Heinz Kremer * backend/epson.c: Removed '//' comments - again ... - Added EPSON KOWA copyright + Added EPSON KOWA copyright 2003-08-21 Henning Meier-Geinitz @@ -873,8 +873,8 @@ 2003-08-15 Karl Heinz Kremer - * backend/epson.[ch]: Added support for GT-30000, with support for the - ADF in simplex mode (used some code from the EPSON Kowa IScan version + * backend/epson.[ch]: Added support for GT-30000, with support for the + ADF in simplex mode (used some code from the EPSON Kowa IScan version of the backend) * backend/epson_scsi.c: Use sanei_scsi_cmd2() to send commands to fix a problem with SBP-2 under FreeBSD @@ -884,7 +884,7 @@ * backend/umax_pp.c backend/umax_pp.h: added a check of values passed in gamma table. Fixed a bug which prevented custom gamm and UTA to be active - + 2003-08-14 Gerhard Jaeger * doc/sane-plustek.man: Added debug description @@ -939,7 +939,7 @@ 2003-07-28 Henning Meier-Geinitz * po/Makefile.in po/sane-backends.bg.po: Added Bulgarian - translation (from Pavel Constantinov + translation (from Pavel Constantinov ). 2003-07-28 Thomas Soumarmon @@ -962,10 +962,10 @@ 2003-07-26 Peter Fales * sanei/Makefile.in, backend/cderror.h, backend/jinclude.h, - backend/dc210.c, backend/dc240.c, backend/ gphoto2.c, + backend/dc210.c, backend/dc240.c, backend/ gphoto2.c, backend/djpeg.c, backend/cdjpeg.h, backend/Makefile.in, configure - configure.in, frontend/Makefile.in: Move jpeg support file - to sanei directofiles to include/sane, and associated + configure.in, frontend/Makefile.in: Move jpeg support file + to sanei directofiles to include/sane, and associated configure changes 2003-07-26 Henning Meier-Geinitz @@ -982,12 +982,12 @@ * sanei/linux_sg3_err.h: Added GPL + SANE exception license. 2003-07-25 Peter Fales - * include/sane/sanei_cderror.h, include/sane/sanei_jinclude.h + * include/sane/sanei_cderror.h, include/sane/sanei_jinclude.h include/sane/sanei_jpeg.h sanei/sanei_jpeg.c: Install these files as copies of the ones currently in backend. (The old files will be deleted later) * Moved backend/djpeg.README to README.djpeg and added usage info - + 2003-07-25 Henning Meier-Geinitz * backend/gt68xx.c backend/gt68xx.conf doc/sane-gt68xx.man @@ -1005,7 +1005,7 @@ license to GPL + SANE exception. * TODO: Added canon630u SANE_I18N and include file license problem. Updated .desc file section. - + 2003-07-24 Peter Kirchgessner * backend/hp.c, backend/hp-option.h, backend/hp-option.c @@ -1043,12 +1043,12 @@ 2003-07-21 Stéphane Voltz - * doc/descriptions/umax_pp.desc: removed unwanted status line for + * doc/descriptions/umax_pp.desc: removed unwanted status line for backend 2003-07-20 Stéphane Voltz - * doc/descriptions/umax_pp.desc: updated forgotten status to use new + * doc/descriptions/umax_pp.desc: updated forgotten status to use new keyword. 2003-07-20 Oliver Rauch @@ -1128,7 +1128,7 @@ * doc/descriptions/unsupported.desc: Added Memorex, Visioneer and Xerox scanners. Updated information for Visioneer scanners. - + 2003-06-28 Henning Meier-Geinitz * doc/descriptions/unsupported.desc: Added Visioneer OneTouch 5800 @@ -1161,12 +1161,12 @@ * doc/descriptions/mustek_pp.desc: Updated status fields of CIS type scanners. - + 2003-06-19 Henning Meier-Geinitz * doc/descriptions.txt: Changed unmaintained tag to lowercase. - * doc/descriptions/template.desc. - doc/descriptions-external/template.desc.: Updated according to + * doc/descriptions/template.desc. + doc/descriptions-external/template.desc.: Updated according to descriptions.txt. * doc/sane-gt68xx.man doc/descriptions/gt68xx.desc doc/gt68xx/gt68xx.CHANGES: Added RevScan 19200i. Updated @@ -1215,7 +1215,7 @@ 2003-06-15 Henning Meier-Geinitz * README.darwin: Minor updates. - * TODO: Added v4l2 problem, desc file issues. Removed sm3600 + * TODO: Added v4l2 problem, desc file issues. Removed sm3600 MacOS X problem + printing backends in configure. * doc/descriptions/unsupported.desc: Added Canon D2400UF and IS 12. @@ -1230,9 +1230,9 @@ 2003-06-11 Oliver Schirrmeister - * backend/fujitsu.c: fixed bug in that code when a scanner is + * backend/fujitsu.c: fixed bug in that code when a scanner is disconnected (anoah at pfeiffer dot edu) - + 2003-06-10 Michael Herder * po/Makefile.in: Added Czech translation @@ -1263,7 +1263,7 @@ backend/hp5400.h backend/hp5400_internal.c backend/hp5400_sanei.c - backend/hp5400_xfer.h + backend/hp5400_xfer.h to compile and run (on linux 2.4.21) as SANE backend and in the corresponding hp5400backend sourceforge project @@ -1307,7 +1307,7 @@ 2003-06-03 Oliver Schirrmeister - * backend/fujitsu.c, backend/fujitsu.h: separated the 4x20 + * backend/fujitsu.c, backend/fujitsu.h: separated the 4x20 into another model and color support for the 4x20 2003-06-03 Henning Meier-Geinitz @@ -1328,7 +1328,7 @@ * PROJECTS: Changed entry for win32 SANE project. 2003-05-28 Henning Meier-Geinitz - + * doc/descriptions/unsupported.html: Added link for Umax astra 4700. 2003-05-27 Henning Meier-Geinitz diff --git a/ChangeLogs/ChangeLog-1.0.14 b/ChangeLogs/ChangeLog-1.0.14 index d8150a9e8..3ebb8d81a 100644 --- a/ChangeLogs/ChangeLog-1.0.14 +++ b/ChangeLogs/ChangeLog-1.0.14 @@ -72,9 +72,9 @@ * backend/snapscan-mutex.c: Fixed compilation problem on OS/2 (Thanks to Franz Bakan). - * configure.in configure: SnapScan backend now compiled in by + * configure.in configure: SnapScan backend now compiled in by default on OS/2 - + 2004-04-15 Marian Eichholz * backend/sm3600.h backend/sm3600-scanmtek.c @@ -178,7 +178,7 @@ * backend/test.c changed some option group headers to advanced option menu. - + 2004-04-06 Jochen Eisinger * sanei/sanei_pa4s2.c include/sane/sanei_pa4s2.h, backend/mustek_pp.c: @@ -209,7 +209,7 @@ 2004-04-02 Oliver Schwartz - * backend/snapscan.c backend/snapscan-options.c + * backend/snapscan.c backend/snapscan-options.c backend/snapscan-scsi.c: Various bugfixes for gamma correction (Thanks to Robert Tsien) * po/sane-backends.de.po: Fix translation for "gamma table" @@ -232,8 +232,8 @@ * backend/gt68xx.c backend/gt68xx_devices.c backend/gt68xx_gt6801.c backend/gt68xx_gt6816.c backend/gt68xx_high.c doc/descriptions/gt68xx.desc - doc/gt68xx/gt68xx.CHANGES: Plustek U16B: Added - GT68XX_FLAG_SE_2400. Fixed color order.Increased debug + doc/gt68xx/gt68xx.CHANGES: Plustek U16B: Added + GT68XX_FLAG_SE_2400. Fixed color order.Increased debug level for setup_scan. Fixed CCD ocarse calibration. * doc/descriptions/microtek.desc: Added Agfa Studiostar. * doc/descriptions/unsupported.desc: Added Avigramm Minidoc, @@ -260,7 +260,7 @@ since new models use new ID strings. 2004-03-21 Henning Meier-Geinitz - + * backend/mustek.c doc/descriptions/mustek.desc doc/mustek/mustek.CHANGES: Added detection of Mustek ScanExpress 1200 FS. @@ -332,10 +332,10 @@ to scanner pages. 2004-03-04 Oliver Schirrmeister - * backend/fujitsu.c + * backend/fujitsu.c enabled dropoutcolor for fi4x20C 2004-03-04 Oliver Schirrmeister - * backend/fujitsu.c + * backend/fujitsu.c enabled dropoutcolor for fi4530C 2004-03-03 Gerhard Jaeger @@ -421,7 +421,7 @@ 2004-02-08 Karl Heinz Kremer * backend/epson*.[ch]: Reformat source code to get rid of different coding styles - used over the years (and by different authors). + used over the years (and by different authors). 2004-02-08 Frank Zago * README.windows: added info about USB scanners. @@ -454,13 +454,13 @@ * backend/mustek_pp.conf: fixed mistakes in examples 2004-02-07 Henning Meier-Geinitz - + * doc/descriptions/unsupported.desc: Added Genius Colorpage Vivid 1200EX and Mustek Paragon 800 II EP. 2004-02-04 Henning Meier-Geinitz - * sanei/sanei_usb.c: Fixed inconsistent error message (patch from + * sanei/sanei_usb.c: Fixed inconsistent error message (patch from Mattias Ellert ). 2004-02-01 Gerhard Jaeger @@ -627,7 +627,7 @@ * AUTHORS: added myself as u12 backend author. * backend/Makefile.in: added new backend u12. * backend/u12.c backend/u12.h backend/u12-scanner.h backend/u12-hwdef.h - backend/u12.conf backend/u12-shading.c backend/u12-tpa.c + backend/u12.conf backend/u12-shading.c backend/u12-tpa.c backend/u12-ccd.c backend/u12-hw.c backend/u12-if.c backend/u12-image.c backend/u12-io.c backend/u12-map.c backend/u12-motor.c: initial checkin. @@ -646,9 +646,9 @@ bug in the stop scan function for Plustek U16b. Added support for Genius Vivid4xe. * doc/descriptions/unsupported.desc: Added Visioneer 8820 and TCE S450. - + 2003-12-31 Henning Meier-Geinitz - + * doc/descriptions/unsupported.desc: Added HP and Epson scanners. 2003-12-29 Henning Meier-Geinitz @@ -723,11 +723,11 @@ * doc/descriptions/unsupported.desc: Added Canon 3200F. * backend/gt68xx_gt6801.h: Made internal function static. - + 2003-12-15 Oliver Schirrmeister * backends/fujitsu.[hc]: Bugfix: The options pagewidth and pageheight were disabled for the fi4530 - + 2003-12-15 Eugene Weiss * backend/as6e.c: fixed bugs 300123 and 300133. @@ -752,7 +752,7 @@ * AUTHORS: Eugene S. Weiss has CVS write access now. * doc/descriptions/unsupported.desc: Added and updated some - scanners. + scanners. * tools/sane-find-scanner.c: Actually use the number of the alt setting when printing descriptors. Fixes bug #300383 found by Gerard Klaver. @@ -792,7 +792,7 @@ * doc/descriptions/unsupported.desc: Added some scanners. 2003-12-06 Peter Fales - * acinclude.m4, aclocal.m4, configure: gphoto2 backend is now + * acinclude.m4, aclocal.m4, configure: gphoto2 backend is now enabled by default if gphoto2-config is found. Use "--with-gphoto2=no" to disable it. @@ -814,14 +814,14 @@ removed compiler warnings, made HMG's fix for bug #300257 permament. * doc/sane-canon630u.man: cleanup - + 2003-12-01 Jochen Eisinger * backend/mustek_pp_ccd300.c: Fixed horizontal offset of scan area and scaling for color scans - + 2003-11-27 Karl Heinz Kremer - + * doc/descriptions/epson.desc: Changed status for CX3200 and CX5200 from untested to good @@ -862,13 +862,13 @@ 2003-11-23 Jochen Eisinger - * backend/mustek_pp.c, sanei/sanei_pa4s2.c: added support for auto + * backend/mustek_pp.c, sanei/sanei_pa4s2.c: added support for auto probing of the port * configure{.in}, backend/mustek_pp_ccd.*, backend/Makefile.in, - backend/dll.conf, doc/sane-mustek_pp_ccd.man, doc/sane.man, - doc/Makefile.in, doc/descriptions/mustek_pp_ccd.desc: mustek_pp_ccd + backend/dll.conf, doc/sane-mustek_pp_ccd.man, doc/sane.man, + doc/Makefile.in, doc/descriptions/mustek_pp_ccd.desc: mustek_pp_ccd backend removed - * backend/mustek_pp.conf, mustek_pp_ccd300.[ch], + * backend/mustek_pp.conf, mustek_pp_ccd300.[ch], doc/sane-mustek_pp.man, doc/descriptions/mustek_pp.desc: fixed CCD support for mustek_pp backend * backend/mustek_pp_null.c: beautified debug scanner name diff --git a/ChangeLogs/ChangeLog-1.0.15 b/ChangeLogs/ChangeLog-1.0.15 index 6c2c351e9..ffdc8b9d6 100644 --- a/ChangeLogs/ChangeLog-1.0.15 +++ b/ChangeLogs/ChangeLog-1.0.15 @@ -51,7 +51,7 @@ * backend/niash_core.c backend/niash.c: moving critical timing for backward movement to niash_core - + 2004-10-24 Henning Meier-Geinitz * doc/descriptions/unsupported.desc @@ -84,7 +84,7 @@ 2004-10-19 Gerhard Jaeger - * backend/plustek.c: Using now the same strings for gain and offset + * backend/plustek.c: Using now the same strings for gain and offset like the umax_pp backend (bug #300962). * doc/plustek/Plustek-USB.changes: Update. * po/*.po: Update due to changes in the Plustek backend. @@ -97,8 +97,8 @@ 2004-10-18 Ullrich Sigwanz - * backend/niash_core.c: - * backend/niash.c: correcting vertical scanning start + * backend/niash_core.c: + * backend/niash.c: correcting vertical scanning start point for changed max. page height 2004-10-17 Ullrich Sigwanz @@ -136,7 +136,7 @@ 2004-10-17 Ullrich Sigwanz * backend/niash_core.c: rewrote buffer portioning - * backend/niash_core.c (2): updated debug info + * backend/niash_core.c (2): updated debug info * backend/niash.c: Enabling support of full DIN A4 size 2004-10-16 Oliver Rauch @@ -147,8 +147,8 @@ * doc/descriptions/unsupported.desc: Added various scanners. * po/sane-backends.da.po: Updated Danish translation (from Mogens - Jaeger ). - + Jaeger ). + 2004-10-14 Henning Meier-Geinitz * include/sane/sanei_wire.h sanei/sanei_wire.c: Limit the total @@ -184,7 +184,7 @@ * acinclude.m4 config.guess config.sub configure ltmain.sh: Update to libtool 1.5.10. * doc/descriptions/unsupported.desc: Added link to - Microtek Filmscan 35. + Microtek Filmscan 35. * backend/gt68xx.c backend/gt68xx.conf backend/gt68xx_high.c doc/descriptions/gt68xx.desc doc/gt68xx/gt68xx.CHANGES: Fixed typos. Added Packard Bell Diamond 2450 to .conf and @@ -204,7 +204,7 @@ * backend/fujitsu.c: bugfix: 3091 did not work (15.12.2003) M4099 supported (bw only) - enables brightness + enables brightness 2004-10-10 Henning Meier-Geinitz @@ -229,14 +229,14 @@ function _UnScrambleLine * doc/descriptions/niash.desc: changed status to complete removed the color only comment - + 2004-10-06 Gerhard Jaeger - * backend/plustek.c backend/u12.c backend/plustek_pp.c: + * backend/plustek.c backend/u12.c backend/plustek_pp.c: Using now the well known MODE definitions. * backend/plustek.h backend/plustek-usb.h: Cleanup. - * doc/plustek/Plustek-USB.changes - doc/plustek/Plustek-Parport.changes doc/u12/U12.changes: + * doc/plustek/Plustek-USB.changes + doc/plustek/Plustek-Parport.changes doc/u12/U12.changes: Update. * po/*.po: Update. @@ -244,7 +244,7 @@ * backend/microtek2.h doc/descriptions/microtek2.desc: New version: 0.96. Added Genius ColorPage-EP (from Karsten Festag - ). + ). * doc/descriptions/unsupported.desc: Added link to artiscan 9600 project. Removed Genius ColorPage-EP. * configure.in include/sane/config.h.in: Removed dangling @@ -256,7 +256,7 @@ * tools/sane-find-scanner.c: Fixed compilation problem when compiled without libusb support. Print sane-backends version number. Print if built without libusb. - + * backend/microtek2.c backend/microtek2.h: Added backend version 200410042220 from Karsten Festag . While attaching devices only read attributes from source 0 (= @@ -276,7 +276,7 @@ descriptors from /proc/bus/usb/devices dumps (e.g. from the unsupported scanner web pages). Minor modifications to some of the chipset tests. - + 2004-10-04 Peter Kirchgessner * backend/hp.h backend/hp.c backend/hp-scl.c: @@ -291,14 +291,14 @@ 2004-10-03 Thomas Soumarmon - * backend/hp5400_debug.c backend/hp5400_debug.h - backend/hp5400_internal.c backend/hp5400_sane.c: + * backend/hp5400_debug.c backend/hp5400_debug.h + backend/hp5400_internal.c backend/hp5400_sane.c: removing more hp5400 compilation warnings 2004-10-03 Henning Meier-Geinitz * doc/descriptions/unsupported.desc: Added Nikon LS-5000 ED (bug - #300972). + #300972). * include/sane/saneopts.h: Added option for turning off the scanner's lamp on exit (bug #300963). * backend/gt68xx.c backend/gt68xx_high.h: Used new lamp option @@ -330,11 +330,11 @@ * backend/hp5400_internal.c backend/hp5400_internal.h backend/hp5400_sanei.c backend/hp5400_sanei.h - backend/hp5400_sane.c: + backend/hp5400_sane.c: removing some compilation warnings 2004-10-02 Thomas Soumarmon - + * backend/hp5400_internal.c: hp5400 version mathing test has been removed by default. To enable it : @@ -372,7 +372,7 @@ * doc/descriptions/unsupported.desc: Added Compeye Simplex 1236C. 2004-09-14 Karl Heinz Kremer - + * backend/epson_usb.c: add USB device ID for CX6400 back in * backend/epson.c: disable "feed" command for Perfection 1640 w/ ADF @@ -389,7 +389,7 @@ doc/descriptions-external/genesys.desc: Moved HP 35xx series to unsupported.desc because these scanners use a RTS8801 chip (no Genesys chipset). - + 2004-09-06 Jochen Eisinger * backend/mustek_pp.c: clarify error message @@ -400,7 +400,7 @@ * backend/plustek.c: Bumped build number. * backend/plustek-usbdevs.c: Fixed bug #300913. - + 2004-09-05 Julien Blache * More auth_callback() fixes, although they're not critical. @@ -423,7 +423,7 @@ to gt68xx.conf to test yet unsupported scanners without changing the source code. * frontend/.cvsignore: Added tstbackend. - + 2004-09-02 Oliver Schwartz * backend/snapscan.c backend/snapscan-scsi.c backend/snapscan-options.c @@ -540,9 +540,9 @@ * backend/dll.conf: Added niash backend. * backend/Makefile.in: Added niash backend files and target. * backend/niash.c backend/niash_core.c backend/niash_core.h - backend/niash-xfer.c backend/niash-xfer.h backend/niash-types.h: + backend/niash-xfer.c backend/niash-xfer.h backend/niash-types.h: Niash backend files, initial checkin. - * doc/sane-niash.man, doc/descriptions/niash.desc, doc/niash/niash.TODO: + * doc/sane-niash.man, doc/descriptions/niash.desc, doc/niash/niash.TODO: Initial checkin. * doc/Makefile.in: Added niash documentation stuff. * doc/sane-man: Added niash manpage. @@ -559,15 +559,15 @@ 2004-07-28 Gerard Klaver * doc/descriptions/unsupported.desc: Added Logitech PageScan USB and - Grandtek Scopecam + Grandtek Scopecam 2004-07-26 Gerhard Jaeger - * sanei/sanei_usb.c sanei/sanei configure configure.in: Added + * sanei/sanei_usb.c sanei/sanei configure configure.in: Added resource manager library support. * backend/plustek.[ch] backend/plustek-usbdevs.c backend/plustek-usbhw.c - backend/plustek-usbshading.c backend/plustek.conf: Added speedup - parameters and TPA autodetection for UMAX3400/3450, added + backend/plustek-usbshading.c backend/plustek.conf: Added speedup + parameters and TPA autodetection for UMAX3400/3450, added disableSpeedup option. * doc/plustek/Plustek-USB-TODO.txt doc/plustek/Plustek-USB.changes doc/descriptions/plustek.desc: Updated. @@ -580,7 +580,7 @@ 2004-07-18 Karl Heinz Kremer - * doc/descriptions/epson.desc: Added CX-5400, RX-500 and RX-600; updated version + * doc/descriptions/epson.desc: Added CX-5400, RX-500 and RX-600; updated version * doc/descriptions/unsupported.desc: Removed RX-500 2004-07-16 Henning Meier-Geinitz @@ -592,21 +592,21 @@ 2004-07-16 Gerhard Jaeger - * doc/plustek/Makefile.module doc/plustek/BUILD + * doc/plustek/Makefile.module doc/plustek/BUILD doc/plustek/VERSION0 doc/plustek/VERSION1: Removed, no longer needed. * doc/plustek/Makefile.kernel2x doc/plustek/MakeModule.sh: Getting version information now out of the backends main file. * doc/plustek/Plustek_PARPORT.changes: Updated. * doc/descriptions/plustek_pp.desc: Updated. * doc/sane-plustek.man: Fixed typo. - * backend/plustek-pp.[ch], backend/plustek-pp_*.[ch]: - Added DevFS support for kernel 2.6, removed floating point + * backend/plustek-pp.[ch], backend/plustek-pp_*.[ch]: + Added DevFS support for kernel 2.6, removed floating point operations (Thanx to Rafal Rzepecki), bumped up build number, cleanup work. * doc/plustek/Plustek_USB.changes: Updated. * backend/plustek.c: Bumped up build number * backend/plustek-usbshading.c: Improved autowarmup, cleanup work. - * backend/plustek-usb.h backend/plustek-usbdevs.c + * backend/plustek-usb.h backend/plustek-usbdevs.c backend/plustek-usbhw.c backend/plustek-usnscan.c: Improved fastforward stuff, cleanup work. * sanei/sanei_lm983x.c: Cleanup work. @@ -618,7 +618,7 @@ 2004-07-12 Henning Meier-Geinitz - * doc/sane-coolscan2.man doc/sane-microtek2.man: Fixed + * doc/sane-coolscan2.man doc/sane-microtek2.man: Fixed manual page problems. 2004-07-10 Gerard Klaver @@ -646,14 +646,14 @@ * doc/descriptions/plustek.desc: Changed status of CanoScan D660U. * doc/plustek/Plustek-USB*: Update. * backend/plustek.c: Bumped up build number. - * backend/plustek-usb.[ch] backend/plustek-usbdevs.c - backend/plustek-usbhw.c backend/plustek-usbimg.c + * backend/plustek-usb.[ch] backend/plustek-usbdevs.c + backend/plustek-usbhw.c backend/plustek-usbimg.c backend/plustek-usbmap.c backend/plustek-usbscan.c: Added support for binary scanning for the CanoScan D660U, cleanup work. 2004-07-03 Peter Fales - * acinclude.m4, aclocal.m4, configure, tools/sane-config.in: + * acinclude.m4, aclocal.m4, configure, tools/sane-config.in: When using pkg-config to get library flags for gphoto2, any extra flags (such as -L) must be passed to sane-config.in so that it can find the libraries in a non-standard location. @@ -666,7 +666,7 @@ doc/plustek/Plustek-USB.changes. * doc/sane-plustek.man: Update. * doc/plustek/Plustek-USB.changes: Update. - * doc/descriptions/plustek.desc: Removed unsupported devices, + * doc/descriptions/plustek.desc: Removed unsupported devices, updated some states. * doc/descriptions/plustek_pp.desc: URL update. * doc/descriptions/u12.desc: URL update, changed state of backend. @@ -675,21 +675,21 @@ 2004-06-30 Frank Zago - * backend/leo.c doc/descriptions/leo.desc: added support for + * backend/leo.c doc/descriptions/leo.desc: added support for Genius FS-1130 Colorpage Scanner. 2004-06-30 Gerhard Jaeger - * doc/plustek/Makefile.kernel26: fixed floating point issues + * doc/plustek/Makefile.kernel26: fixed floating point issues for SuSE kernels. 2004-06-28 Henning Meier-Geinitz * doc/descriptions/unsupported.desc: Added Microtek and Xerox scanners. - * tools/sane-desc.c: Added xml output (patch from + * tools/sane-desc.c: Added xml output (patch from jose ). Other minor fixes. - + 2004-06-28 m. allan noah * backend/fujitsu.c: use model code instead of string compare @@ -697,7 +697,7 @@ 2004-06-21 Gerhard Jaeger - * doc/descriptions/unsupported.desc: removed Compac S4 100 + * doc/descriptions/unsupported.desc: removed Compac S4 100 (supported by the Plustek backend), added various Plustek devices, changed OpticPro m12 to OpticSlim M12 @@ -720,7 +720,7 @@ 2004-06-20 Mattias Ellert - * aclocal.m4, configure, sane/config.h.in, backend/Makefile.in, + * aclocal.m4, configure, sane/config.h.in, backend/Makefile.in, backend/agfafocus.c, backend/artec_eplus48u.c, backend/avision.c, backend/coolscan.c, backend/fujitsu.c, backend/pie.c, backend/plustek.c, backend/plustek_pp.c, backend/sp15c.c, @@ -775,14 +775,14 @@ 2004-06-17 Stéphane Voltz - * backend/umax_pp_low.c doc/descriptions/umax_pp.desc + * backend/umax_pp_low.c doc/descriptions/umax_pp.desc doc/sane-umax_pp.man: fixed overflows in 610P shading calibration coefficients, minor man update, 610P status change from minimal to good 2004-06-16 Oliver Schwartz - * backend/snapscan.h backend/snapscan.c backend/snapscan-usb.c: + * backend/snapscan.h backend/snapscan.c backend/snapscan-usb.c: Don't enforce even number of URB packages on 1212u_2 since it causes problems. See bug #300753. @@ -811,7 +811,7 @@ 2004-06-13 Karl Heinz Kremer * backend/sane_usb.c: Added Perfection 1650 back in that was removed by - mistake and finally removed Perfection 1250. + mistake and finally removed Perfection 1250. 2004-06-12 Stéphane Voltz @@ -888,7 +888,7 @@ 2004-05-29 Henning Meier-Geinitz - * backend/sp15c.c: Fixed the fix of the sanei_thread fix + * backend/sp15c.c: Fixed the fix of the sanei_thread fix (from Mattias Ellert). 2004-05-28 Henning Meier-Geinitz @@ -947,7 +947,7 @@ 2004-05-18 Michael Herder - * backend/Makefile.in: + * backend/Makefile.in: adjusted for use with sanei_thread and artec_eplus48u backend (thanks Mattias Ellert) @@ -968,19 +968,19 @@ 2004-05-15 Michael Herder - * backend/artec_eplus48u.c backend/artec_eplus48u.h: + * backend/artec_eplus48u.c backend/artec_eplus48u.h: applied patch from Mattias Ellert (thanks), which adds support for sanei_thread 2004-05-15 Stéphane Voltz - * backend/umax_pp_low.c backend/umax_pp.c tools/umax_pp.c: fixed + * backend/umax_pp_low.c backend/umax_pp.c tools/umax_pp.c: fixed origin shift bug for 610P. Added on guard against configuration that can put several 'port' option in conf file. 2004-05-13 Stéphane Voltz - * backend/umax_pp_low.c backend/umax_pp.c tools/umax_pp.c: fixed + * backend/umax_pp_low.c backend/umax_pp.c tools/umax_pp.c: fixed data lines reordering for 610P 2004-05-12 Henning Meier-Geinitz @@ -1011,11 +1011,11 @@ * tools/hotplug/libsane.usbmap: removed empty lines, latest hotplug cannot cope with them - + 2004-03-15 Stéphane Voltz * backend/umax_pp_low.c backend/umax_pp_low.h backend/umax_pp_mid.c - backend/umax_pp_mid.h backend/umax_pp.c backend/umax_pp.h + backend/umax_pp_mid.h backend/umax_pp.c backend/umax_pp.h tools/umax_pp.c: added support for 610P 2004-05-01 Henning Meier-Geinitz diff --git a/ChangeLogs/ChangeLog-1.0.16 b/ChangeLogs/ChangeLog-1.0.16 index 95329f44d..f96e19e5a 100644 --- a/ChangeLogs/ChangeLog-1.0.16 +++ b/ChangeLogs/ChangeLog-1.0.16 @@ -26,7 +26,7 @@ * NEWS: Updated. ----- CODE FREEZE FOR SANE 1.0.16 --- +---- CODE FREEZE FOR SANE 1.0.16 --- 2005-07-31 Henning Meier-Geinitz @@ -35,7 +35,7 @@ 2005-07-30 Karl Heinz Kremer * backend/epson_usb.c: Applied Olaf Meuwissen's patch to add - new device IDs. + new device IDs. 2005-07-30 Henning Meier-Geinitz @@ -45,7 +45,7 @@ correctly again. * acinclude.m4 configure configure.in: Avoid error messages in locking test. Make sure that io/cam/cam.h header file will be - detected correctly. + detected correctly. 2005-07-29 Gerard Klaver @@ -80,7 +80,7 @@ * doc/descriptions/unsupported.desc: Added unsupported scanners from hp_rts88xx.desc. Removed HP ScanJet 3770 (now in hp3770 backend). Added Lexmark X75 PrinTrio. - + 2005-07-22 Giuseppe Sacco * italian translation update @@ -89,7 +89,7 @@ * tools/hotplug/libsane.usermap: Added HP ScanJet 7400C (0x03f0, 0x0801), from Thomas Nadolny. -2005-07-21 Gerhard Jaeger +2005-07-21 Gerhard Jaeger * doc/plustek/Plustek-USB.changes: Update. * backend/plustek.c: Bumped build number. @@ -97,13 +97,13 @@ 2005-07-15 Oliver Schwartz - * backend/snapscan-options.c: Change TPO range for Epson 2480/2580 to - 55x80mm^2 which is the working range for the 2580. Reenabled + * backend/snapscan-options.c: Change TPO range for Epson 2480/2580 to + 55x80mm^2 which is the working range for the 2580. Reenabled 2400 DPI for 2480/2580. 2005-07-15 Oliver Schwartz - * backend/snapscan-mutex.c backend/snapscan-usb.c: Changes to support + * backend/snapscan-mutex.c backend/snapscan-usb.c: Changes to support SANE on ZETA. * backend/snapscan-scsi.c: Fix compiler warnings. @@ -119,7 +119,7 @@ 2005-07-15 Henning Meier-Geinitz - * backend/sp15c.c: Better 4->8 bit depth expansion algorithm (from + * backend/sp15c.c: Better 4->8 bit depth expansion algorithm (from Mattias Ellert ). * sanei/sanei_usb.c: Fixed comment (we still use 30 seconds USB timeout by default). @@ -164,7 +164,7 @@ the USB timeout. 2005-07-10 Henning Meier-Geinitz - + * backend/gt68xx.c backend/gt68xx_devices.c backend/gt68xx_generic.c backend/gt68xx_high.c doc/descriptions/gt68xx.desc doc/gt68xx/gt68xx.CHANGES @@ -173,7 +173,7 @@ Visioneer OneTouch 7300. Updated .desc. Moved check for stable lamp to its own function. Mustek ScanExpress A3 USB: Use CIS calibration. Use lamp warmup. Fixed CCD on GT6801 scanning (color - scanning was broken due to a change in motormode_2. + scanning was broken due to a change in motormode_2. 2005-07-09 Henning Meier-Geinitz @@ -186,7 +186,7 @@ po/sane-backends.ru.po po/sane-backends.sv.po: Updated Danish translation (from Mogens Jaeger ). Made sure that no errors occur because xgettext/xmsgfmt think that - "%" is a C format string. Regenerated all po files. + "%" is a C format string. Regenerated all po files. * configure configure.in include/sane/config.h.in: Make sure that getopt is not built on OS/2 (from Franz Bakan ). @@ -198,7 +198,7 @@ backend/teco1.c backend/teco1.h backend/teco2.c backend/teco2.h backend/teco3.c backend/teco3.h frontend/tstbackend.c: new email address. - + 2005-07-07 Gerhard Jaeger * doc/plustek/Plustek-USB.changes: Update. @@ -213,7 +213,7 @@ 2005-07-04 Gerhard Jaeger * doc/plustek/Plustek-USB.changes: Update. - * backend/plustek.[ch] backend/plustek-usbscan.c + * backend/plustek.[ch] backend/plustek-usbscan.c backend/plustek-usbshading.c backend/plustek-usbdevs.c backend/plustek-usbdevs.c backend/plustek-usbimg.c backend/plustek-usbmap.c backend/plustek-usbhw.c @@ -229,7 +229,7 @@ * backend/sm3600.c: Don't check the result of usb_find_busses(). Based on patch from Julien BLACHE - . + . * doc/descriptions/genesys.desc: Used "Medion/Lifetec/Tevion/Cytron" as manufacturer as in the other backends. Used "ScanJet 2300C" as model name as in other @@ -251,14 +251,14 @@ 2005-06-30 St�hane Voltz - * configure.in AUTHORS backend/dll.conf doc/sane.man doc/Makefile.in + * configure.in AUTHORS backend/dll.conf doc/sane.man doc/Makefile.in po/Makefile.in : Fixed forgotten modifications when adding the genesys backend 2005-06-30 Gerhard Jaeger - * tools/RenSaneDlls.cmd backend/dll.c: Fixed OS/2 restriction for - dlopening DLLs on OS/2, as it only works for 7.3 filenames for + * tools/RenSaneDlls.cmd backend/dll.c: 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 . 2005-06-27 St�hane Voltz @@ -283,19 +283,19 @@ * doc/descriptions/unsupported.desc: Removed Samsung SCX-4216F (supported by samsung backend). Dell 1600n has also network - connection. + connection. * doc/descriptions-external/brother.desc: Removed misleading - comment. + comment. * doc/descriptions-external/samsung.desc: Added several models, updated others. * doc/descriptions.txt: Added "Ethernet" to list of possible - interfaces. - + interfaces. + 2005-06-12 Henning Meier-Geinitz * doc/descriptions/unsupported.desc: Added Canon CanoScan LiDE 500F. - + 2005-06-04 Henning Meier-Geinitz * doc/descriptions/unsupported.desc: Added Genius ColorPage-SF600. @@ -336,12 +336,12 @@ * doc/descriptions/unsupported.desc: Added Avision DS310F. Added link for the UMAX Astra 4000. Fixed missing link for Genius ColorPage-Slim 1200 USB2. - + 2005-05-26 Henning Meier-Geinitz * doc/net.tex doc/sane.tex: Mention RPC codes explicitely and explain what request and reply means. based on patch from - Johannes Berg . + Johannes Berg . 2005-05-25 Jochen Eisinger @@ -377,10 +377,10 @@ Mustek BearPaw 1200 CU Plus model 0x21b works now. Fixed firmware and offset settings. Calibration is not completely ok yet, however. Code cleanup for setup_scan (only one function - for all chipsets). Simplified line mode/pixel mode setting + for all chipsets). Simplified line mode/pixel mode setting Updated TODO. Mustek BearPaw 2448 TA Plus is now only "basic". Too much trouble for "good". Removed option "fast - preview". By default for preview mode 8 bits/pixel are used. + preview". By default for preview mode 8 bits/pixel are used. Fixed indentation. Full scan really scans from y=0 on gt6816 scanners now. * po/sane-backends.bg.po po/sane-backends.cs.po @@ -400,7 +400,7 @@ 2005-05-15 frank - * tools/Makefile.in: remove superflous libraries for sane-desc + * tools/Makefile.in: remove superflous libraries for sane-desc * doc/descriptions/matsushita.desc: changed some scanner status from good to minimal * doc/descriptions/unsupported.desc: added a few Panasonic scanners. @@ -417,7 +417,7 @@ 2005-05-10 Gerhard Jaeger - * sanei/sanei_access.c: Added PATH_MAX, in case it's not defined + * sanei/sanei_access.c: Added PATH_MAX, in case it's not defined by any header (i.e. OS/2). 2005-05-07 Mattias Ellert @@ -443,7 +443,7 @@ * backend/qcam.c -indent -gnu, bugreport 300128 free (devlist) added, DEBUG output added and some small fixes. - + 2005-05-05 Henning Meier-Geinitz * doc/descriptions/unsupported.desc: Added Dell 922. @@ -451,16 +451,16 @@ doc/mustek/mustek.CHANGES: Added options to set the time after which the lamp of the A3 Pro is shut off and to shut it off immediately. - + 2005-05-02 Peter Fales - * backend/gphoto2.c: Fix core dump when no port is specified in + * backend/gphoto2.c: Fix core dump when no port is specified in the gphoto2 config file. (bug #301552) 2005-04-29 Henning Meier-Geinitz * doc/descriptions/sp15c.desc: Added ScanPartner 600C (bug - #301528). + #301528). * doc/descriptions/unsupported.desc: Removed several Brother scanner which are supported by the brother backend now. * doc/descriptions-external/brother.desc: Fixed link. @@ -499,12 +499,12 @@ * tools/hotplug/libsane.usermap: Fixed Minolta Scan Dual III entry (bug #301512). * doc/descriptions/mustek.desc: Added Mustek TwainScan II SP (bug - #301217). + #301217). * doc/descriptions-external/viceo.desc: Added Primax Colorado 2200 USB. * doc/descriptions/unsupported.desc: Added Canon PIXMA MP110. * AUTHORS: Marked Kazuya Fukuda as active. - + 2005-04-23 Julien Blache * LICENSE: Add an FAQ section. @@ -545,7 +545,7 @@ split up printf command to remove warning ISO C89 patch for bugreport 300160, ranges for width and height are wrong * doc/scanimage.man added text -B option buf size - + 2005-04-13 Mattias Ellert * backend/hp-option.c: Add missing SANE_I18N @@ -603,7 +603,7 @@ and to specify the group of the locking directory. * include/sane/config.h.in: ENABLE_LOCKING has been added by automake/autoconf. - * backend/Makefile.in: Added installation of + * backend/Makefile.in: Added installation of $(localstatesanedir)/lock/sane, were the lockfile should go to. Also added linking of sanei_access to the plustek backend. * include/Makefile.in: Added sane/sanei_access.h. @@ -638,7 +638,7 @@ * doc/descriptions/unsupported.desc doc/descriptions-external/genesys.desc: Added and updated - various scanners. + various scanners. 2005-03-04 Gerard Klaver @@ -717,7 +717,7 @@ * po/Makefile.in po/sane-backends.pl.po: Added Polish translation (from Jerzy Szczudlowski ). See bug #301054. - + 2005-02-04 Gerhard Jaeger * tools/hotplug/libsane.usermap: Added Epson CX6600 based on patch @@ -728,7 +728,7 @@ * backend/niash_xfer.c: * tools/hotplug/libsane.usermap: added ID for Silitek-HP-ScanJet-3400c-Clone - + 2005-01-19 Oliver Rauch * backend/coolscan.c: added initilization of dev->scanning = SANE_FALSE @@ -746,7 +746,7 @@ * doc/descriptions/unsupported.desc: Added UMAX Astraslim 6000. Added Trust SCSI Scan 19200 -Excellence Series-. Added - ColorPage-Vivid Pro II. + ColorPage-Vivid Pro II. * tools/hotplug/libsane.usermap: Added Epson Stylus RX425 based on bug report #301114. * doc/sane-agfafocus.man doc/sane-artec.man: Fixed some macros @@ -770,10 +770,10 @@ * doc/plustek/Plustek-USB.changes: Update. * backend/plustek.c: Bumped build number. Copyright Update. - * backend/plustek-usbscan.c backend/plustek-usbshading.c: - Using now PhyDpi.y as selector for the motor MCLK setting. + * backend/plustek-usbscan.c backend/plustek-usbshading.c: + Using now PhyDpi.y as selector for the motor MCLK setting. Copyright Update. - * backend/plustek-usbdevs.c: + * backend/plustek-usbdevs.c: Tweaked motor settings for EPSON and CANON1200. Copyright Update. * backend/plustek-*.[ch]: Copyright Update. @@ -783,9 +783,9 @@ 2005-01-09 Karl Heinz Kremer - * backend/epson.c: "flaming hack to get USB scanners working without timeouts + * backend/epson.c: "flaming hack to get USB scanners working without timeouts under linux" submitted by "Steve" (in comment to bug #300830) - * doc/descriptions/epson.desc, doc/sane-epson.man: + * doc/descriptions/epson.desc, doc/sane-epson.man: Added SCSI version of GT-5000 to supported list. 2004-12-29 Julien Blache @@ -798,8 +798,8 @@ * doc/descriptions-external/hpaio.desc join two lines so html conversion possible doc/descriptions-external/stv680.desc added two webcams with - different usb vid and pid - + different usb vid and pid + 2004-12-26 Henning Meier-Geinitz * doc/descriptions/unsupported.desc: Added several scanners. @@ -811,9 +811,9 @@ 2004-12-15 Gerard Klaver - * doc/descriptions-external/hpaio.desc stv680.desc + * doc/descriptions-external/hpaio.desc stv680.desc Info new external backends - + 2004-12-01 Oliver Schwartz * backend/snapscan.c backend/snapscan-scsi.c backend/snapscan-options.c: @@ -845,8 +845,8 @@ 2004-12-01 Oliver Schwartz - * backend/snapscan.h backend/snapscan.c backend/snapscan-scsi.c - backend/snapscan-options.c doc/descriptions/snapscan.desc: + * backend/snapscan.h backend/snapscan.c backend/snapscan-scsi.c + backend/snapscan-options.c doc/descriptions/snapscan.desc: Added support for Epson Perfection 1270 2004-12-01 Henning Meier-Geinitz @@ -882,7 +882,7 @@ moving the HP 82xx to the avision backend 2004-11-19 Gerhard Jaeger - + * backend/plustek.c backend/plustek-usb*: Major update, see doc/plustek/Plustek-USB.changes. Esp. improved support for multiple devices and autodetection. @@ -910,16 +910,16 @@ 2004-11-13 Frank Zago - * include/sane/sanei_backend.h: Added compiler attribute __unused__ + * include/sane/sanei_backend.h: Added compiler attribute __unused__ for unused variables/functions. * backend/leo.c backend/teco3.c backend/matsushita.c backend/sceptre.c backend/teco1.c: use __unused__ - * sanei/sanei_wire.c sanei/sanei_pa4s2.c sanei/sanei_scsi.c: + * sanei/sanei_wire.c sanei/sanei_pa4s2.c sanei/sanei_scsi.c: fixes for 64 bits platforms. * backend/sp15c-scsi.h backend/sp15c.h backend/dc210.c backend/dc210.h: fixes some warnings. - + 2004-11-13 Henning Meier-Geinitz * backend/v4l.c: 64 bit fix from Frank Zago - * doc/descriptions/epson.desc: Added a few new scanners based on - messages to the sane-devel mailing list. + * doc/descriptions/epson.desc: Added a few new scanners based on + messages to the sane-devel mailing list. 2005-12-11 Henning Meier-Geinitz @@ -42,7 +42,7 @@ non-fatal warnings/error messages. Several fixes for avoiding freezes/timeouts after cancelling a scan. Several fixes for warming up of lamp. Decreased scan width of Plustek OpticPro - 1248U. + 1248U. 2005-12-08 Gerhard Jaeger @@ -59,7 +59,7 @@ 2005-12-07 Gerhard Jaeger - * sanei/sanei_acces.c: Fixed problem, when the device name contains + * sanei/sanei_acces.c: 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. @@ -71,7 +71,7 @@ 2005-12-06 Stephane Voltz * backend/genesys_gl646.c: added AF init in powersave, fixed - long-standing bug related to a data read timeout between + long-standing bug related to a data read timeout between distinct scanning sessions 2005-12-06 Henning Meier-Geinitz @@ -107,7 +107,7 @@ * backend/genesys.c backend/genesys_conv_hlp.c: Modified calling parameters to stagger/line distance correction filter to better describe its inner working. - * backend/genesys_devices.c: Slowed down motor timings for + * backend/genesys_devices.c: Slowed down motor timings for LiDE 35/40/50/60. Removed untested message for LiDE 35/40/50/60. * backend/genesys_gl646.c: Fixed bug for odd pixel count. Added support for gray to lineart conversion. @@ -148,12 +148,12 @@ 2005-12-02 Oliver Schwartz - * backend/snapscan-sources.c: Another fix for lineart mode for the + * backend/snapscan-sources.c: Another fix for lineart mode for the Epson 3490 @ 3200 DPI - this time tested * backend/snapscan.c: Change version number to 1.4.50 2005-12-01 Henning Meier-Geinitz - + * doc/descriptions/unsupported.desc: Added link for Corex Cardscan 500. @@ -199,7 +199,7 @@ 2005-11-25 Henning Meier-Geinitz * po/sane-backends.da.po: Updated Danish translation (from Mogens - Jaeger ). + Jaeger ). 2005-11-25 Oliver Schwartz @@ -267,35 +267,35 @@ 2005-11-19 Pierre Willenbrock - * backend/genesys_gl841.c backend/genesys_devices.c: + * backend/genesys_gl841.c backend/genesys_devices.c: Added support for Canon LiDE 35/40/50 - * backend/genesys.c backend/genesys_low.h - backend/genesys_gl646.c: Reworked data conversion - process to convert CIS data, added new slope + * backend/genesys.c backend/genesys_low.h + backend/genesys_gl646.c: Reworked data conversion + process to convert CIS data, added new slope generation variant - * backend/genesys_conv.c backend/genesys_conv_hlp.c: - Moved conversion filter functions out of + * backend/genesys_conv.c backend/genesys_conv_hlp.c: + Moved conversion filter functions out of backend/genesys.c 2005-11-18 Oliver Schwartz - * backend/snapscan-options.c: Disable 2400 DPI for + * backend/snapscan-options.c: Disable 2400 DPI for Epson 3490, use 1600 DPI instead 2005-11-17 Gerhard Jaeger * doc/plustek/Plustek-PARPORT.changes: Update. - * backend/plustek_pp.c backend/plustek-pp.h + * backend/plustek_pp.c backend/plustek-pp.h backend/plustek-pp_ptdrv.c backend/plustek-pp_wrapper.c: - Fixed sizeof(long) issue for 64bit platforms, see + Fixed sizeof(long) issue for 64bit platforms, see bugreport #302195. * backend/plustek_pp.conf: Default config now only tries to access parport using libieee1284. 2005-11-15 Oliver Schwartz - * backend/snapscan.c backend/snapscan-options.c - backend/snapscan-scsi.c: Enabled quality calibration for the + * backend/snapscan.c backend/snapscan-options.c + backend/snapscan-scsi.c: Enabled quality calibration for the Epson 3490 * doc/descriptions/snapscan.desc: Changed status for Epson Perfection 3490 (good) and 3590 (basic) @@ -316,7 +316,7 @@ concerning status of these backends. 2005-11-10 Oliver Schwartz - * backend/snapscan.c backend/snapscan-sources.c: Added + * backend/snapscan.c backend/snapscan-sources.c: Added deinterlacing for Epson 3490 * backend/Makefile.in: added "snapscan" to FIRMWARE_DIRS @@ -340,7 +340,7 @@ 2005-11-02 Oliver Schwartz - * sanei/sanei_usb.c: Fixed output of transfer buffer for + * sanei/sanei_usb.c: Fixed output of transfer buffer for usb_read_bulk in OS/2. * backend/snapscan.c backend/snapscan-scsi.c: Fixes for Benq 5000 * backend/snapscan-usb.c: Avoid recursive calls of usb_sense_handler @@ -372,7 +372,7 @@ 240H Easy Webscan Gold to artec_eplus48u backend. * Makefile.in acinclude.m4 configure configure.in backend/Makefile.in frontend/Makefile.in lib/Makefile.in - sanei/Makefile.in tools/Makefile.in: + sanei/Makefile.in tools/Makefile.in: Run "makedepend" if it's available. This way "make" builds backends correctly even if only included files (e.g. headers) are changed. Don't be too verbose when running makedepend. @@ -382,7 +382,7 @@ Remove any libsane.* links in /usr/local/lib/sane. Such links are created by libtool. As they point to libsane-v4l.so, scanimage -L doesn't find any scanner in case of ld.so - misconfigurations. + misconfigurations. The install target is much quiter now and prints the libtool message only once now. * README.openbsd: Removed comment about broken library links. @@ -392,7 +392,7 @@ * po/*.po: Updated po files, corrected/updated german translation. * doc/plustek/Plustek-USB.changes: Update. * backend/plustek.c backend/plustek.h: Added OPTION_SPEEDUP. - * backend/plustek-usbdevs.c: Changed high-speed setting for + * backend/plustek-usbdevs.c: Changed high-speed setting for UMAX 3400, due to bugreport #302317. Fixed CanoScan N650U settings (bugreport #302433). @@ -409,7 +409,7 @@ 2005-10-24 Oliver Schwartz * backend/snapscan.c backend/snapscan-scsi.c backend/snapscan.h - backend/snapscan-options.c: Fix transparency range for Epson + backend/snapscan-options.c: Fix transparency range for Epson 2480/2580, fix preview for Epson 2580. 2005-10-24 Henning Meier-Geinitz @@ -420,17 +420,17 @@ 2005-10-23 Oliver Schwartz * backend/snapscan.c backend/snapscan-scsi.c: Fixes for buffer - size in high-res modes by Simon Munton, small changes to delay + size in high-res modes by Simon Munton, small changes to delay code. 2005-10-23 Henning Meier-Geinitz * tools/hotplug/libsane.usermap: Added Epson Stylus DX3850 (from - niels_kalle ). + niels_kalle ). 2005-10-22 Eddy De Greef - * backend/mustek_pp_cis.c: Decreased the maximum number of pixels + * backend/mustek_pp_cis.c: Decreased the maximum number of pixels on a line for CIS scanners a bit to avoid border artifacts. 2005-10-22 Eddy De Greef @@ -448,7 +448,7 @@ 2005-10-20 Oliver Schwartz - * backend/snapscan-scsi.c: Fixes for 16 bit + * backend/snapscan-scsi.c: Fixes for 16 bit quality calibration by Simon Munton 2005-10-18 Henning Meier-Geinitz @@ -463,7 +463,7 @@ * acinclude.m4 configure: Fixed check for libpthread functions. * tools/hotplug/libsane.usermap: Added Brother MFC 210C (from - Benjamin Mirza ). + Benjamin Mirza ). * doc/descriptions-external/epkowa.desc: Updated for iscan 1.17.0 (patch from Olaf Meeuwissen ). Bug #302183. @@ -489,7 +489,7 @@ doc/descriptions/mustek_usb2.desc doc/mustek_usb2/mustek_usb2.CHANGES: Removed typedefs for DWORD, WORD and so on. Used int, unsigned - short, ... directly in the code. + short, ... directly in the code. * AUTHORS configure configure.in backend/Makefile.in backend/dll.conf backend/lexmark-x1100.c backend/lexmark.c backend/lexmark.conf backend/lexmark.h doc/Makefile.in @@ -505,7 +505,7 @@ * backend/Makefile.in doc/Makefile.in tools/Makefile.in: Make "make dist" work again. * acinclude.m4 configure include/sane/config.h.in: Check for - pthread_cancel() and pthread_testcancel(). + pthread_cancel() and pthread_testcancel(). 2005-10-15 Jochen Eisinger @@ -539,7 +539,7 @@ * doc/descriptions/unsupported.desc: Added HP ScanJet 3800c. * frontend/scanimage.c: Use correct size for fgets. Patch from - Antoine Jacoutot . + Antoine Jacoutot . 2005-10-05 Mattias Ellert @@ -554,7 +554,7 @@ backend/mustek_usb2_reflective.c backend/mustek_usb2_transparent.c doc/Makefile.in doc/sane-mustek_usb2.man doc/mustek_usb2/mustek_usb2.CHANGES - doc/mustek_usb2/mustek_usb2.TODO: + doc/mustek_usb2/mustek_usb2.TODO: Added mustek_usb backend which supports the Mustek BearPaw 2448 TA Pro. Changes of the code before inclusion to CVS can be found in doc/mustek_usb2/mustek_usb2.CHANGES. @@ -578,7 +578,7 @@ * doc/plustek/Plustek-USB.changes: Update. * backend/plustek.c: Bumped build number. * backend/plustek-usbdevs.c backend/plustek-usb.h: Updated motor - settings for Canoscan LiDE25, thanks to Stephan February + settings for Canoscan LiDE25, thanks to Stephan February for providing these values. 2005-10-02 Henning Meier-Geinitz @@ -589,7 +589,7 @@ * AUTHORS: Fixed Rene Rebe's email address. * doc/descriptions/unsupported.desc: Removed Epson Perfection 4180 (supported by epkowa backend). - + 2005-10-01 Henning Meier-Geinitz * doc/descriptions-external/mustek_a3p1.desc @@ -606,7 +606,7 @@ 2005-09-29 Eddy De Greef - * backend/mustek_pp_cis.c: Minor bug fix: wrong model name was + * backend/mustek_pp_cis.c: Minor bug fix: wrong model name was reported for 1200CP+ driver. 2005-09-29 Henning Meier-Geinitz @@ -615,7 +615,7 @@ backend/gt68xx_generic.c backend/gt68xx_generic.h backend/gt68xx_high.c backend/gt68xx_low.c backend/gt68xx_low.h doc/sane-gt68xx.man doc/descriptions/gt68xx.desc - doc/gt68xx/gt68xx.CHANGES doc/gt68xx/gt68xx.TODO: + doc/gt68xx/gt68xx.CHANGES doc/gt68xx/gt68xx.TODO: Added support for Plustek OpticSlim M12 (untested). Based on patch from Gerhard Jaeger . Fixed gt68xx homepage links in man page. Changed minimum version of libusb to 0.1.8. @@ -658,8 +658,8 @@ 2005-09-25 Oliver Schwartz - * backend/snapscan-scsi.c: Removed debugging code for - Epson scanners until a working solution has been found. + * backend/snapscan-scsi.c: Removed debugging code for + Epson scanners until a working solution has been found. 2005-09-23 Henning Meier-Geinitz @@ -669,7 +669,7 @@ * configure configure.in: Added warning message that's printed when libusb or its header file is not available. * frontend/scanimage.c doc/scanimage.man: Added progress indicator - to scanimage (based on patch from Mario Goppold + to scanimage (based on patch from Mario Goppold ). Updated copyright information, added links to sane-devel mailing list. * sanei/sanei_usb.c: Ignore EBUSY from usb_set_configuration. This @@ -687,7 +687,7 @@ * backend/dc210.c backend/leo.c backend/matsushita.c backend/sceptre.c backend/sp15c-scsi.h backend/sp15c.h backend/teco1.c backend/teco2.c backend/teco3.c - include/sane/sanei_backend.h: Replaced __unused__ with + include/sane/sanei_backend.h: Replaced __unused__ with __sane_unused__ to avoid a namespace conflict. 2005-09-18 Henning Meier-Geinitz @@ -695,9 +695,9 @@ * backend/gt68xx.c backend/gt68xx_high.c doc/descriptions/gt68xx.descdoc/gt68xx/gt68xx.CHANGES doc/gt68xx/gt68xx.TODO: Fixed segfault that may happen with - Mustek ScanExpress A3 USB. + Mustek ScanExpress A3 USB. * doc/backend-writing.txt: Added some hints about number of - files. + files. * backend/mustek.conf doc/sane-mustek.man doc/descriptions/mustek.desc: Mustek Paragon 600 II EP works. Mentioned "parport0". @@ -720,7 +720,7 @@ 2005-09-07 Oliver Schirrmeister * backend/fujitsu.c: enabled dropoutcolor for all fi-* scanners. - Applied patch from Mario Goppold: Bugfixes for the M3092DCd + Applied patch from Mario Goppold: Bugfixes for the M3092DCd 2005-09-05 Henning Meier-Geinitz @@ -730,13 +730,13 @@ 2005-09-03 Oliver Schwartz * backend/snapscan.h backend/snapscan-scsi.c: (Hopefully) fixed - some debugging code for Epson scanners that only works after - firmware upload. + some debugging code for Epson scanners that only works after + firmware upload. 2005-09-02 Henning Meier-Geinitz * doc/descriptions/unsupported.desc: Added Epson Perfection 4490 - Photo. + Photo. * tools/hotplug/libsane.usermap: Added HP PSC 750. 2005-09-01 Henning Meier-Geinitz @@ -747,17 +747,17 @@ ColorPage Vivid 1200 X is reported to work. Genius ColorPage Vivid 4 XE seems to be the same as 4 X, it just doesn't have buttons. Cleanup of .desc file. Fixed gain setting. Mustek - ScanExpress A3 USB 600 dpi color scanning works now. + ScanExpress A3 USB 600 dpi color scanning works now. * tools/check-usb-chip.c: Added detection for SQ113 chip - (e.g. Mustek BearPaw 2448 TA Pro). + (e.g. Mustek BearPaw 2448 TA Pro). 2005-08-31 Henning Meier-Geinitz * doc/descriptions/unsupported.desc: Removed Mustek 1800 A3 Pro - (this is actually a P3600 A3 Pro). + (this is actually a P3600 A3 Pro). * doc/descriptions-external/mustek_usb2.desc: Mustek BearPaw 2448 TA Pro has status "good" now. - + 2005-08-30 Henning Meier-Geinitz * doc/descriptions/unsupported.desc: Removed Mustek BearPaw 2448 @@ -817,7 +817,7 @@ doc/descriptions/unsupported.desc: Marked microtek2 backend as unsupported. Changed link to point to old website directly. Listed Microtek ScanMaker 9800XL as supported (bug #301515). - + 2005-08-21 Mattias Ellert * ltmain.sh acinclude.am configure: Updated from libtool 1.5.18. @@ -826,7 +826,7 @@ * backend/gt68xx.c backend/gt68xx.conf backend/gt68xx_devices.c backend/gt68xx_low.h doc/descriptions/gt68xx.desc - doc/gt68xx/gt68xx.CHANGES doc/gt68xx/gt68xx.TODO: + doc/gt68xx/gt68xx.CHANGES doc/gt68xx/gt68xx.TODO: Increased number limit of scanners that can work with this backend to 50. Added support for Genius ColorPage Vivid 1200 X (untested). @@ -880,7 +880,7 @@ * backend/snapscan-options.c: Removed //-style comment 2005-08-16 Henning Meier-Geinitz - + * doc/descriptions/unsupported.desc: Added Canon PIXMA MP780 and Lexmark P6250. * tools/sane-find-scanner.c: Don't print anything else but the @@ -896,7 +896,7 @@ Removed direct dependence of sm3600 on libusb. Used sanei_usb instead. Based on patch from Fran~is Revol . Updated documentation accordingly. Fixed compilation warnings. - + 2005-08-15 Oliver Schwartz * backend/snapscan.c: Bumped version number @@ -906,8 +906,8 @@ 2005-08-15 Oliver Schwartz * backend/snapscan.c backend/snapscan-options.c backend/snapscan-scsi.c - backend/snapscan.h doc/descriptions/snapscan.desc - backend/snapscan.conf: Added support for Epson Perfection 3490/3590 + backend/snapscan.h doc/descriptions/snapscan.desc + backend/snapscan.conf: Added support for Epson Perfection 3490/3590 (thanks to Matt Judge). 2005-08-15 Gerhard Jaeger @@ -920,17 +920,17 @@ * backend/plustek.c: Bumped version and build number. Activated IPC between reader-process and parent. * backend/plustek-usbio.c: usbio_DetectLM983x() now returns error if - register could not be red, usbio_ResetLM983x() checks for reg7 + register could not be red, usbio_ResetLM983x() checks for reg7 value before writing. - * backend/plustek-usbhw.c: Added button support for Plustek/Genius + * backend/plustek-usbhw.c: Added button support for Plustek/Genius devices. Changed behaviour of usb_IsScannerReady(). Added special misc I/O setup for CIS devices (usb_ResetRegisters). * backend/plustek-usb.c: Minor fix for startup reset. Removed unnecessary calls to usbio_ResetLM983x(). - * backend/plustek-usbshading.c: Readded kCIS670 to add 5% extra to + * backend/plustek-usbshading.c: Readded kCIS670 to add 5% extra to LiDE20 fine calibration. * backend/plustek-usbcal.c: Tried to use the settings from SANE-1.0.13. - Added _TWEAK_GAIN to allow increasing GAIN during lamp coarse + Added _TWEAK_GAIN to allow increasing GAIN during lamp coarse calibration. Added call to speedtest function. 2005-08-14 Henning Meier-Geinitz @@ -965,7 +965,7 @@ included). * configure configure.in: Moved CPPFLAGS definition down to avoid problems with libtool tests for -fPIC. - + 2005-08-10 Gerhard Jaeger * backend/plustek_pp.c: Bumped build number. @@ -975,19 +975,19 @@ * doc/plustek/Plustek-PARPORT.changes: Update. 2005-08-09 Henning Meier-Geinitz - + * sanei/sanei_usb.c: Minor fixes for usbcalls interface (patch from Paul Smedley ). * doc/descriptions/unsupported.desc: Added Hewlett-Packard Scanjet - 4370. - + 4370. + 2005-08-08 Gerhard Jaeger * acinclude.m4 configure: Locking feature will be disabled on OS/2 per default (according to Paul Smedley ). * doc/plustek/Plustek-USB.changes: Update. * backend/plustek.c: Bumped build number. - * doc/plustek/Plustek-USB.txt doc/descriptions/plustek.desc + * doc/plustek/Plustek-USB.txt doc/descriptions/plustek.desc doc/sane-plustek.man backend/plustek-usb.c backend/plustek-usbdevs.c: Added support for CanoScan LiDE25. diff --git a/ChangeLogs/ChangeLog-1.0.18 b/ChangeLogs/ChangeLog-1.0.18 index b224cf046..d6cf379d1 100644 --- a/ChangeLogs/ChangeLog-1.0.18 +++ b/ChangeLogs/ChangeLog-1.0.18 @@ -6,7 +6,7 @@ 2006-07-02 Gerhard Jaeger - * backend/plustek.c: Fixed the fix (problem when trying to + * backend/plustek.c: Fixed the fix (problem when trying to select bit-depth). 2006-07-01 Wittawat Yamwong @@ -23,7 +23,7 @@ * NEWS: Added dell1600n_net backend. * doc/releases.txt: Typo fix. - * aclocal.m4 configure configure.in include/sane/config.h.in: + * aclocal.m4 configure configure.in include/sane/config.h.in: Disabled compilation warnings for release. ---- CODE FREEZE FOR SANE-BACKENDS 1.0.18 --- @@ -40,11 +40,11 @@ 2006-06-22 Henning Meier-Geinitz * doc/descriptions/epson.desc: Fixed USB id of CX6600 (patch from - Olaf Meeuwissen ). - * doc/descriptions-external/epkowa.desc: Updated (patch from - Olaf Meeuwissen ). + Olaf Meeuwissen ). + * doc/descriptions-external/epkowa.desc: Updated (patch from + Olaf Meeuwissen ). * doc/descriptions/unsupported.desc: Added Xerox WorkCentre - PE120i. + PE120i. 2006-06-19 Henning Meier-Geinitz @@ -66,7 +66,7 @@ 2006-06-14 Jon Chambers * backend/dell1600n_net.c: working backend added - + 2006-06-13 m. allan noah * backend/fujitsu.[ch]: update to v1.0.31, add 5220c usb id, @@ -75,7 +75,7 @@ * doc/descriptions/fujitsu.desc: usb id and version update 2006-06-12 Jochen Eisinger - + * doc/descriptions/mustek_pp.desc: Added Micromaxx MM-0851 ---- FEATURE FREEZE FOR SANE 1.0.18 --- @@ -85,16 +85,16 @@ * backend/coolscan2.c doc/descriptions/coolscan2.desc: Added (minimal) support for Nikon LS 50 ED, Coolscan V ED and (probably) Super Coolscan LS-5000 ED (patch from Giuseppe Sacco - ). + ). * backend/pixma.h: Fixed compilation problem on *BSD (ENODATA not - defined). + defined). * doc/descriptions/unsupported.desc: Added Canon 9950. Removed Epson 4490 (supported by epkowa). Removed Nikon scanners (supported by coolscan2 backend). Updated PLANon DocuPen R700. 2006-06-11 Eddy De Greef - * AUTHORS backend/mustek_pp_cis.c backend/mustek_pp_cis.h + * AUTHORS backend/mustek_pp_cis.c backend/mustek_pp_cis.h doc/sane-mustek_pp.man: e-mail address update. 2006-06-11 Henning Meier-Geinitz @@ -296,7 +296,7 @@ * AUTHORS: added Wittawat Yamwong * configure configure.in doc/Makefile.in doc/sane.man - doc/descriptions/pixma.desc backend/Makefile.in + doc/descriptions/pixma.desc backend/Makefile.in backend/dll.conf.in backend/pixma*.[ch]: added pixma backend * doc/descriptions-external/pixma.desc: removed because the backend is now a part of sane-backends. @@ -318,13 +318,13 @@ 2006-05-21 m. allan noah - * backend/fujitsu.c backend/fujitsu.conf.in + * backend/fujitsu.c backend/fujitsu.conf.in doc/descriptions/fujitsu.desc: added usb ids for fi-5110EOX 2006-05-21 Henning Meier-Geinitz * README.linux: Updated concerning USB permissions (really, this - time). + time). * doc/descriptions/unsupported.desc: Removed models that are now in pixma.desc. Updated comment for Plustek OpticPro S24. * doc/descriptions-external/hp_rts88xx.desc: Added reason for not @@ -342,7 +342,7 @@ 2006-05-18 Henning Meier-Geinitz * doc/descriptions-external/pixma.desc: Added some models (from - Wittawat Yamwong ). + Wittawat Yamwong ). 2006-05-14 m. allan noah @@ -350,7 +350,7 @@ do_cmd() - simplify timeout handling * backend/fujitsu-scsi.h: increase default timeoutes -2006-05-15 Stephane Voltz +2006-05-15 Stephane Voltz * backend/genesys_devices.c backend/genesys_gl646.c: tuned HP 2300 geometry description and added a safeguard against failed origin @@ -381,7 +381,7 @@ * doc/descriptions/lexmark.desc: X1150 is reported to work. * doc/descriptions-external/brother.desc: MFC-3820CN is reported - to work. + to work. 2006-04-27 Henning Meier-Geinitz @@ -394,7 +394,7 @@ * backend/genesys_devices.c: Increase length of acceleration slopes for Canon LiDE 35/40/50/60 -2006-04-21 Stephane Voltz +2006-04-21 Stephane Voltz * backend/genesys.c: add workraound with issue related to asic reset and data scan amount @@ -406,7 +406,7 @@ explanations are given once at the top. Don't repeat options that aren't changed anyway. * doc/descriptions/unsupported.desc: Added Microtek Scanmaker - 3880. + 3880. 2006-04-18 Giuseppe Sacco * Updated italian translation @@ -418,7 +418,7 @@ * backend/genesys_conv_hlp.c: Fix interpolation code to emit all pixels of a line. * doc/descriptions/unsupported.desc: Added missing scanners from - libsane.usermap. + libsane.usermap. 2006-04-18 Henning Meier-Geinitz @@ -428,11 +428,11 @@ ids. Minor cleanup. * doc/descriptions/avision.desc: Used avision-desc.sh to update the .desc file to current SANE CVS avision.c code. Added USB - ids. + ids. * doc/descriptions/plustek.desc: Added USB ids. Splitted some entries which have two different USB ids. Clarified comment about - UMAX 3400. - * tools/hotplug/libsane.usermap: Removed. Will be created + UMAX 3400. + * tools/hotplug/libsane.usermap: Removed. Will be created automatically by sane-desc. * tools/Makefile.in: Create libsane.usermap (for hotplug), libsane.db (for hotplug-ng) and libsane.rules (for udev) @@ -461,7 +461,7 @@ MP730. * doc/sane-mustek_usb2.man: Removed description of non-existing configuration file. - + 2006-04-12 Julien Blache * tools/sane-desc.c: Fix/optimize udev rules; tests on the same line are ANDed together, not ORed together, causing the rules to @@ -490,7 +490,7 @@ 2006-03-29 Henning Meier-Geinitz * backend/sp15c.c: Fixed ADF support. Patch from Andreas Degert - . + . * doc/descriptions-external/cs3200f.desc: Listed new cs3200f backend for Canon 3200F. * doc/descriptions/unsupported.desc: Added Canon PIXMA760, Tevion @@ -499,7 +499,7 @@ 2006-03-27 Pierre Willenbrock - * backend/genesys.c backend/genesys.h backend/genesys_low.h + * backend/genesys.c backend/genesys.h backend/genesys_low.h backend/genesys_conv.c backend/genesys_gl841.c: Added extended option "Threshold" for lineart mode(Thanks to Laurent Charpentier). @@ -509,10 +509,10 @@ 2006-03-24 Henning Meier-Geinitz * doc/descriptions/unsupported.desc: Added Iris Iriscan and Xerox - Documate 510. + Documate 510. 2006-03-21 Julien Blache - + * doc/*.man: More spelling fixes from A. Costa (through Debian). 2006-02-02 Oliver Schwartz @@ -521,7 +521,7 @@ firmware is not yet loaded 2006-03-18 Julien Blache - + * doc/sane-apple.man: Applied patch from A Costa (through Debian); english/spelling fixes for sane-apple(5). @@ -530,7 +530,7 @@ * doc/descriptions/unsupported.desc: Added Microtek ScanMaker 4850 II and Plustek OpticPro ST 64+. -2006-03-12 Stephane Voltz +2006-03-12 Stephane Voltz * backend/genesys_gl646.c: removed now unneeded #ifdef in gl646_send_gamma_table. @@ -552,7 +552,7 @@ 2006-03-09 Pierre Willenbrock - * backend/genesys.c backend/genesys_low.h: Removed little endian + * backend/genesys.c backend/genesys_low.h: Removed little endian conversions in slope table creation functions * backend/genesys_gl646.c backend/genesys_gl841.c: Added little endian conversions to gl*_send_slope_table functions @@ -573,7 +573,7 @@ SCX-4100 (bug #303166). * doc/descriptions/unsupported.desc: Added Brother MFC 9600, Canon PIXMA MP450, and Plustek ScanCopy 115. - + 2006-02-16 Gerhard Jaeger * doc/plustek/Plustek-PARPORT.changes: Update. diff --git a/ChangeLogs/ChangeLog-1.0.19 b/ChangeLogs/ChangeLog-1.0.19 index 2c4b8b287..d9e3333c5 100644 --- a/ChangeLogs/ChangeLog-1.0.19 +++ b/ChangeLogs/ChangeLog-1.0.19 @@ -102,7 +102,7 @@ 2008-01-16 m. allan noah * po/sane-backends.fr.po: updated translation from Yann E. MORIN - * backend/fujitsu.c, backend/fujitsu.conf.in, + * backend/fujitsu.c, backend/fujitsu.conf.in, doc/descriptions/fujitsu.desc: add usb id for S500M 2008-01-16 Jonathan Bravo Lopez @@ -251,7 +251,7 @@ added support for Perfection 4990 (Claus Boje). 2007-11-17 m. allan noah - * backend/fujitsu.c, backend/fujitsu.conf.in, + * backend/fujitsu.c, backend/fujitsu.conf.in, doc/descriptions/fujitsu.desc: add usb id for S510 2007-11-17 Rene Rebe @@ -276,7 +276,7 @@ * backend/plustek-usb.[ch] backend/plustek-usbcal.c backend/plustek-usbdevs.c backend/plustek-usbshading.c backend/plustek.[ch] backend/plustek.conf.in: - Tweaked TravelScan464 settings. Added possibility to disable + Tweaked TravelScan464 settings. Added possibility to disable dark-calibration with lamp on (touches devices like CanoScan1220 etc.) Use attribute packed for data access structs @@ -302,7 +302,7 @@ 2007-11-11 Pierre Willenbrock * backend/genesys.c, backend/genesys_gl646.c, - backend/genesys_gl841.c, backend/genesys_low.h: change + backend/genesys_gl841.c, backend/genesys_low.h: change bulk_write_register to take number of registers instead of byte size of register set @@ -335,7 +335,7 @@ * doc/descriptions/unsupported.desc: Updated some entries * backend/plustek-usb.c backend/plustek-usbimg.c backend/plustek-usbmap.c backend/plustek-usbscan.c backend/plustek-usbshading.c: Fixed copyright - * backend/plustek-usb.h backend/plustek-usbdevs.c + * backend/plustek-usb.h backend/plustek-usbdevs.c doc/descriptions/plustek.desc: Added support for TravelScan464 2007-10-28 Julien Blache @@ -370,9 +370,9 @@ sizeof(Genesys_Register_Set) 2007-10-25 Pierre Willenbrock - * backend/genesys_gl841.c: One more instance of + * backend/genesys_gl841.c: One more instance of sizeof(Genesys_Register_Set) vs 2 - * backend/genesys.c: Add check for small register set in + * backend/genesys.c: Add check for small register set in sanei_genesys_get_address 2007-10-24 Julien Blache @@ -550,7 +550,7 @@ 2007-07-15 m. allan noah - * doc/descriptions/fujitsu.desc, doc/sane-fujitsu.man: + * doc/descriptions/fujitsu.desc, doc/sane-fujitsu.man: update website and fi-60F status * Authors, backend/dll.conf.in: added cardscan backend @@ -628,7 +628,7 @@ * backend/hp5590.c: Do not localize option names 2007-04-29 Ilia Sotnikov - + * backend/hp5590_low.c: don't use libusb structs directly, define necessary of them by ourselves ('struct usb_ctrl_setup' -> 'struct usb_in_usb_ctrl_setup') @@ -756,7 +756,7 @@ 2007-02-11 Henning Meier-Geinitz * po/sane-backends.pl.po: Polish translation fix (from Jakub - Bogusz , bug #304410). + Bogusz , bug #304410). 2007-02-07 Gerhard Jaeger @@ -767,7 +767,7 @@ * backend/gt68xx.c backend/gt68xx_devices.c doc/descriptions/gt68xx.desc doc/gt68xx/gt68xx.CHANGES: Added .conf entry for Pluste OpticPro S12 and S24. Updated .desc - file. + file. * doc/descriptions/unsupported.desc: Added UMAX Astra 2850. Added Canon Imagerunner series. @@ -789,7 +789,7 @@ backend/fujitsu.c: updated email address * backend/fujitsu-scsi.h, backend/fujitsu.[ch]: update to v1.0.44, set SANE_CAP_HARD_SELECT on all buttons/sensors. - disable sending gamma LUT, quality errors reported. + disable sending gamma LUT, quality errors reported. support MS overscan. clamp the scan area to the pagesize on ADF. * doc/descriptions/fujitsu.desc: version number update @@ -854,7 +854,7 @@ * epson2: removed calls to alloca(), code reorganization fixed a bug with request_extended_status (reply - length is 33 on older scanners). + length is 33 on older scanners). * include/.cvsignore: added two more entries 2006-12-10 Pierre Willenbrock @@ -870,7 +870,7 @@ 2006-12-07 Alessandro Zummo * epson2: reordered includes, replaced __FUNCTION__, - use the new byteorder macros + use the new byteorder macros * moved acbyteorder.m4 to m4/byteorder.m4, added m4/stdint.m4 @@ -903,7 +903,7 @@ 2006-11-22 Gerhard Jaeger * doc/plustek/Plustek-USB.changes: update. - * backend/plustek.c: bumped build number, fixed option + * backend/plustek.c: bumped build number, fixed option descriptors, see bug #303786. 2006-11-22 Henning Meier-Geinitz @@ -930,7 +930,7 @@ (noticed by Jaroslaw Gorny) (bug #303962). * po/sane-backends.es.po: Updated (from Jonathan Bravo Lopez ). - * doc/descriptions-external/hp3900.desc + * doc/descriptions-external/hp3900.desc doc/descriptions-external/samsung.desc: Updated based on sane-devel information. * doc/descriptions/unsupported.desc: Added Canon Canoscan 4400F, @@ -943,14 +943,14 @@ Scanjet 4370 to "minimal" (bug #303839). * doc/scanimage.man frontend/scanimage.c: Added examples on how to set the scan area in the manual page (bug #303802). Mention how - to separate parameters from options in --help and manpage (bug + to separate parameters from options in --help and manpage (bug #303819). * doc/descriptions/unsupported.desc: Added EDT BizCardReader 900C. Moved Genius ColorPage-SF600 to gt68xx.desc. Minor updates. * backend/gt68xx.c backend/gt68xx_devices.c doc/descriptions/gt68xx.desc doc/gt68xx/gt68xx.CHANGES: Added - Support for Genius Colorpage SF600. + Support for Genius Colorpage SF600. 2006-09-24 Giuseppe Sacco @@ -990,7 +990,7 @@ * doc/plustek/Plustek-PARPORT.changes: update. * backend/plustek-pp.h backend/plustek-pp_ptdrv.c backend/plustek_pp.c: - fixed "not homing" problem, the sensor did not return when + fixed "not homing" problem, the sensor did not return when the driver gets the _IOCTL_STOP command fixed compilation issue for kernels > 2.6.15 fixed compiler warning conditions @@ -1017,7 +1017,7 @@ fix line correction (color alignment) for MP760 * doc/sane-pixma.man: update * doc/descriptions/pixma.desc: add MP360,MP530 and MP800R product ID - * doc/descriptions/unsupported.desc: remove Smartbase MP360 (supported + * doc/descriptions/unsupported.desc: remove Smartbase MP360 (supported by pixma backend) 2006-08-26 m. allan noah @@ -1053,7 +1053,7 @@ * backend/dell1600n_net.c: update for dell1600n_net.conf + reduce memory footprint * backend/dell1600n_net.conf.in: added - * backend/dell1600n_net.c: update for dell1600n_net.conf.in + * backend/dell1600n_net.c: update for dell1600n_net.conf.in 2006-08-11 Gerhard Jaeger @@ -1080,7 +1080,7 @@ 2006-08-06 Stephane Voltz * backend/genesys_gl646.c backend/genesys.c: fix y scan area offset - detection for HP2300, one more fixe related to bug #303681. + detection for HP2300, one more fixe related to bug #303681. 2006-08-01 Henning Meier-Geinitz @@ -1144,7 +1144,7 @@ 2006-07-04 m. allan noah - * backend/fujitsu.[ch] backend/fujitsu-scsi.h: + * backend/fujitsu.[ch] backend/fujitsu-scsi.h: update to v1.0.34, add S500 usb id, get more inq and vpd data, allow background color setting for some scanners * doc/descriptions/fujitsu.desc: version number update diff --git a/ChangeLogs/ChangeLog-1.0.2 b/ChangeLogs/ChangeLog-1.0.2 index beb0d2862..b17f00db9 100644 --- a/ChangeLogs/ChangeLog-1.0.2 +++ b/ChangeLogs/ChangeLog-1.0.2 @@ -33,7 +33,7 @@ * configure.in: Don't use -ansi and -pedantic unless --enable-warnings is used. Warnings are now disabled by default to prepare for the next release. - + 2000-02-24 Petter Reinholdtsen * tools/sane-desc.el: In backend web page, packends not included @@ -71,7 +71,7 @@ 2000-02-19 Karl Heinz Kremer - * backend/epson.*: Updated desc file with new version number and + * backend/epson.*: Updated desc file with new version number and some more supported scanners. Removed OPT_PREVIEW_RESOLUTION so that the frontend can handle the preview resolution. @@ -115,8 +115,8 @@ 2000-02-18 Abel Deuring * sharp.c / sharp.h: Options for resolution now conform to - the Sane API; fixed and initialisation bug. Updated backend - version number in sharp.desc. + the Sane API; fixed and initialisation bug. Updated backend + version number in sharp.desc. 2000-02-18 Oliver Rauch * updated umax backend to 1.0 build 17 @@ -132,7 +132,7 @@ * backend/m3096g-scsi.h backend/sp15c-scsi.h: Make lint_catcher static to avoid link problems with duplicate symbols. - + 2000-02-13 Petter Reinholdtsen * README.unixware2: Information from Wolfgang Rapp on how to build @@ -140,7 +140,7 @@ * ltconfig ltmain.sh: Upgraded to libtool 1.3.4 and added Oliver Rauch's soname patch. - + * backend/hp-accessor.c backend/hp-device.c backend/hp-handle.c backend/hp-hpmem.c backend/hp-option.c backend/hp-option.h backend/hp-scl.c backend/hp-scsi.h backend/hp.c backend/hp.desc @@ -162,8 +162,8 @@ * backend/artec.desc: updated backend version information. 2000-02-11 Karl Heinz Kremer - * backend/epson.c - Fixed default scan source when option equipment - is installed. The default is now always "Flatbed". + * backend/epson.c - Fixed default scan source when option equipment + is installed. The default is now always "Flatbed". 2000-02-08 Oliver Rauch @@ -215,7 +215,7 @@ 2000-02-05 Rene Rebe * backedn/avision.? only minor updates and the new home-page url ... - + 2000-02-05 Abel Deuring * fixed wrong buffer size handling for old Linux SG drivers in sanei_scsi.c @@ -234,7 +234,7 @@ 2000-02-01 Karl Heinz Kremer * backend/epson.[ch] More changes in the attach function to recognize USB scanners again. - * doc/sane-epson.man More updates to the man page. + * doc/sane-epson.man More updates to the man page. 2000-01-29 Oliver Rauch @@ -265,7 +265,7 @@ * backend/avision.c fixed to compile on HP/UX * backend/avision.desc fixed typo * AUTHORS changed my eMail address - + 2000-01-30 Petter Reinholdtsen * backend/dll.c backend/dll.aliases doc/sane-dll.man: Aliased and @@ -332,7 +332,7 @@ * include/sane/sanei_debug.h: Add fflush() after fprintf() in DBG macro. - + * AUTHORS backend/Makefile.in backend/m3096g.h backend/m3096g.c backend/m3096g-scsi.h backend/m3096g.desc backend/m3096g.conf backend/sp15c.h backend/sp15c.c backend/sp15c-scsi.h @@ -344,7 +344,7 @@ 2000-01-24 Abel Deuring - * backend/sharp.c, backend/sharp.h: update to version 0.30 + * backend/sharp.c, backend/sharp.h: update to version 0.30 (sorry, forgot to make this note some days earlier) 2000-01-24 Oliver Rauch @@ -356,7 +356,7 @@ * ChangeLog: updated (oversaw last time, sorry) * backend/avision.c: fixed some compiling warnings - + 2000-01-21 Petter Reinholdtsen * sanei/sanei_scsi.c: Bugfix: Added return type for dummy @@ -398,10 +398,10 @@ 2000-01-09 Karl Heinz Kremer - * backend/epson.* updated. This is a new backend still based - on the origial Sane 1.0.1 version, but with lots of work - done: Support for ADF/TPU, more function levels (up to B9 - and initial work for F5), parallel scanner support and initial + * backend/epson.* updated. This is a new backend still based + on the origial Sane 1.0.1 version, but with lots of work + done: Support for ADF/TPU, more function levels (up to B9 + and initial work for F5), parallel scanner support and initial support for USB scanners (don't use this yet, it still needs a lot of work to be functional and usable). @@ -515,8 +515,8 @@ - PhotoScanner: Allow scanning of slides/negatives only at multiple of 300 dpi. This fixes problem with preview which scanned at arbitrary resolutions. - - (by Marian Szebenyi): close pipe (coredump on Digital UNIX) - + - (by Marian Szebenyi): close pipe (coredump on Digital UNIX) + * backend/Makefile.in: Correct install target to also work on platforms where dll endings isn't .so (like HP/UX). Extract endings from libsane-dll.la. @@ -527,7 +527,7 @@ Generic support in the OS kernel. If NOT present it tells the user they may need SG drivers. Patch from Nick Lamb . - + * sanei/sanei_scsi.c [sanei_scsi_cmd sanei_scsi_open]: Digital UNIX 4.0D patches from Marian Szebenyi . @@ -537,7 +537,7 @@ * acinclude.m4 configure.in: Separate GTK_LIBS into LIBS and LDFLAGS to get the X programs to link on HP/UX. - + 1999-08-12 Petter Reinholdtsen * aclocal.m4 configure.in configure: Generate configure and @@ -553,7 +553,7 @@ * config.guess config.sub: Updated to latest versions from FSF. Better support for BeOS, WinNT and others. - + 1999-08-09 Petter Reinholdtsen * Started CVS branch DEVEL_1_9. diff --git a/ChangeLogs/ChangeLog-1.0.20 b/ChangeLogs/ChangeLog-1.0.20 index fbaacaab0..f0f4fa742 100644 --- a/ChangeLogs/ChangeLog-1.0.20 +++ b/ChangeLogs/ChangeLog-1.0.20 @@ -1,7 +1,7 @@ 2009-05-03 Chris Bagwell - * Makefile.in, aclocal.m4, configure, */Makefile.in: Regenerated + * Makefile.in, aclocal.m4, configure, */Makefile.in: Regenerated with newer automake. - * backend/Makefile.am, tools/sane-config.in: Add missing + * 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. @@ -56,7 +56,7 @@ 2009-04-27 Stéphane Voltz * backend/genesys.c backend/genesys_gl646.c backend/genesys_devices.c: - shading calibration fixes for HP2300 + shading calibration fixes for HP2300 2009-04-25 Alessandro Zummo * backend/epson2.c: fixed TPU warmup retry @@ -71,11 +71,11 @@ 2009-04-22 m. allan noah * include/sane/sane.h: convert new frame and status to #define -2009-04-21 Nicolas Martin +2009-04-21 Nicolas Martin * doc/sane-pixma.man, doc/descriptions/pixma.desc, backand/pixma_mp150.c: Updated documentation for Pixma MP240, reported to work fine by Nik. - + 2009-04-21 Alex Belkin * backend/xerox_mfp.c: update version number. @@ -90,10 +90,10 @@ 2009-04-20 Alessandro Zummo * backend/coolscan3.c: temporarily disable infrared. -2009-04-17 Nicolas Martin +2009-04-17 Nicolas Martin * doc/sane-pixma.man, doc/descriptions/pixma.desc: Updated documentation for Pixma MP540, reported to work fine by Rogge. - + 2009-04-17 Pierre Willenbrock * backend/genesys.c, backend/genesys_gl646.c, backend/genesys_gl841.c, backend/genesys_low.h: Always do shading @@ -145,22 +145,22 @@ backend/sane_strstatus.c: STATUS_HW_LOCKED & STATUS_WARMING_UP * doc/releases.txt: minor updates for new build system -2009-04-07 Nicolas Martin +2009-04-07 Nicolas Martin * doc/sane-pixma.man, doc/descriptions/pixma.desc: Updated documentation for i-SENSYS MF4018 support. - + 2009-04-07 Julien Blache * doc/descriptions-external/epkowa.desc: update for iScan 2.19.0, from Olaf Meeuwissen. -2009-04-05 Nicolas Martin +2009-04-05 Nicolas Martin * backend/pixma_io.h, backend/pixma_io_sanei.c, doc/sane-pixma.man: Increased timeouts for read bulk and write bulk operations to 10s Changed minimum timeout for interrupt read to 100ms For MAC OS X : added a wrapper to sanei_usb_read_int as darwin libusb does not handle timeouts in interrupt reads. This disables button scan for MAC OS X, updated man page with this info. - * backend/pixma_mp150.c: + * backend/pixma_mp150.c: Added 2 new Canon Pixma models but usb pid/vid yet unknown. 2009-04-05 m. allan noah @@ -181,7 +181,7 @@ - silenced some debug statements during scanner detections - increased timeouts to 20 seconds as 10 seconds is apparently - not enough for the combination of a Mac and an MX850. - + 2009-03-21 Alex Belkin * backend/xerox_mfp.conf.in: add Xerox Phaser 6110MFP * backend/xerox_mfp.c: compatibility with scanners w/o feeder. @@ -200,7 +200,7 @@ 2009-03-25 m. allan noah * backend/canon_dr.[ch]: backend v22 - - add deinterlacing code for DR-2510C in duplex and color + - add deinterlacing code for DR-2510C in duplex and color 2009-03-25 Pierre Willenbrock * backend/genesys.c, backend/genesys_gl646.c, @@ -263,7 +263,7 @@ - remove unused temp file code 2009-03-20 m. allan noah - * backend/hpljm1005.c: use private function instead of round() + * backend/hpljm1005.c: use private function instead of round() 2009-03-19 Pierre Willenbrock * backend/genesys_devices.c, backend/genesys.conf.in: @@ -287,7 +287,7 @@ Mobile Scanner (from Kelly Price) 2009-03-13 m. allan noah - * frontend/scanimage.c, doc/scanimage.man: make -B (buffer-size) + * frontend/scanimage.c, doc/scanimage.man: make -B (buffer-size) selectable, and make long name consistent. (#309672 by Johannes Berg) 2009-03-13 m. allan noah @@ -315,7 +315,7 @@ - Use hstrerror (h_errno) instead of strerror(errno) on gethostbyname() errors -2009-03-12 Nicolas Martin +2009-03-12 Nicolas Martin * doc/sane-pixma.man, doc/descriptions/pixma.desc: Added ImageClass MF4010 support in pixma backend docs. * backend/pixma_imageclass.c: @@ -346,7 +346,7 @@ with xsane preview 2009-03-06 m. allan noah - * backend/canon_dr.c, backend/canon_dr.conf.in, + * backend/canon_dr.c, backend/canon_dr.conf.in, doc/descriptions/canon_dr.desc: backend version 13 - new vendor ID for recent machines - add usb ids for several new machines @@ -402,7 +402,7 @@ 2009-02-28 Pierre Willenbrock * backend/genesys.conf.in, backend/genesys_devices.c, - backend/genesys_gl841.c, backend/genesys_low.h: Add support for + backend/genesys_gl841.c, backend/genesys_low.h: Add support for Ambir/Syscan DocketPORT 665 * backend/genesys.conf.in, backend/genesys_devices.c, backend/genesys_low.h: Add support for Visioneer Roadwarrior @@ -455,8 +455,8 @@ doc/sane-epjitsu.man: add S300M usb ID's 2009-02-23 Pierre Willenbrock - * backend/genesys_devices.c, backend/genesys_gl841.c, - backend/genesys_low.h: Add post_scan and eject_feed to struct + * backend/genesys_devices.c, backend/genesys_gl841.c, + backend/genesys_low.h: Add post_scan and eject_feed to struct Genesys_Model * backend/genesys.c, backend/genesys_gl646.c, backend/genesys_gl841.c: Move sanei_genesys_{start,stop}_motor into @@ -519,7 +519,7 @@ under sane/ directory when converted to automake. * doc/Makefile.am: Cleanup. Use automake's built in support to install docs within subdirectories. - * Makefile.am, testsuite: Convert testsuite to automake. Waiting + * Makefile.am, testsuite: Convert testsuite to automake. Waiting for test backend bugfix before enabling this to run during "distcheck". 2009-02-18 Julien Blache @@ -531,7 +531,7 @@ actually works. 2009-02-14 Chris Bagwell - * configure.in, doc/Makefile.am, frontend/Makefile.am, + * configure.in, doc/Makefile.am, frontend/Makefile.am, include/Makefile.am, sanei/Makefile.am, tools/Makefile.am: convert frontend, include, and sanei directories to use automake. Only reference libsanei.la now. Use am_conditional @@ -564,13 +564,13 @@ 2009-02-06 Chris Bagwell * configure.in, backend/Makefile.am: Add back in support for - optionally linking in sanei_jpeg.lo under backend directory; + optionally linking in sanei_jpeg.lo under backend directory; but using configure and not with GNU make extensions. Move back to libtool's -version-info instead of -version-number because the later has known bugs on platforms such as OS/2. 2009-02-04 Chris Bagwell - * configure.in, acinclude.ac: Cleanup autoconf 2.63 warnings. + * configure.in, acinclude.ac: Cleanup autoconf 2.63 warnings. add cv_ prefix to cached variable. Remove AC_ARG_PROGRAM as automake already invokes this. When prefered AC_USE_SYSTEM_EXTENSIONS exists, use that instead of AC_GNU_SOURCE/AC_AIX/AC_MINUX. @@ -586,11 +586,11 @@ lib/getopt1.c, toosl/sane-desc.c, include/lgetopt.h: Rename internal getopt.h to lgetopt.h to allow using external getopt.h when it exists. This allows to go - back to optionally compiling getopt()/getopt_long() and its + back to optionally compiling getopt()/getopt_long() and its prototypes and not have conflicts with external headers/symbols. 2009-02-04 Nicolas Martin - * doc/sane-pixma.man doc/descriptions/pixma.desc: + * doc/sane-pixma.man doc/descriptions/pixma.desc: Added ImageClass MF4120 support in pixma backend docs. 2009-02-03 Julien Blache @@ -613,11 +613,11 @@ * aclocalm4: fix prototype of internal strcasestr and usleep. * configure.in: Group all USB logic together and all SCSI logic together to aid understanding of whats no longer - valid. Allow sharing enable/disable options between all - USB drivers on multiple platforms. Combined CAM_LIBS and - SCSI_LIBS since they are mutually exclusive. + valid. Allow sharing enable/disable options between all + USB drivers on multiple platforms. Combined CAM_LIBS and + SCSI_LIBS since they are mutually exclusive. Skip some USB/SCSI checks when previous tests show it will always fail. - * backend/Makefile.am, tools/Makefile.in: Combine CAM_LIBS and + * backend/Makefile.am, tools/Makefile.in: Combine CAM_LIBS and SCSI_LIBS. Add missing SOCKET_LIBS to epson2. Add USB_LIB. * saned.c: Add limits.h for PATH_MAX. @@ -643,7 +643,7 @@ getgrent() and friends. getgrouplist is not posix and not on several platforms including cygwin. * acinclude.m4, configure.in: Put all libraries into their - own *_LIB variables instead of $LIB so that we do not have to + 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 @@ -680,7 +680,7 @@ * pixma_common.c: Make 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. + yet debug to be SANE_DEBUG_UMAX_PP to match man page. 2009-01-28 Julien Blache * doc/descriptions/epson.desc: added :scsi data for the GT-7000 @@ -697,9 +697,9 @@ and works around various timestamp issues. 2009-01-25 Pierre Willenbrock - * backend/genesys_gl841.c: Change status code for locked head to + * backend/genesys_gl841.c: Change status code for locked head to SANE_STATUS_HW_LOCKED - + 2009-01-21 m. allan noah * doc/descriptions/canon_dr.desc: correct version, status = new * doc/descriptions/epjitsu.desc, doc/descriptions/fujitsu.desc: version @@ -721,7 +721,7 @@ Updated backends with EXTRA_* files to allow Makefile's to always pass in BACKEND_NAME to be fixed to backend name instead of filename; while still making sure that - SANE_DEBUG_${BACKEND}* exist as documented in man pages. + SANE_DEBUG_${BACKEND}* exist as documented in man pages. Add references to epson and epson2 man pages about SANE_DEBUG_EPSONx_SCSI and _NET options. Created an epson2 man page; based mostly on epson page. @@ -749,23 +749,23 @@ 2009-01-19 Nicolas Martin * pixma_imageclass.c: Fixed select_source message length, and typo bug in last update. - Set MP4600 series for inverted checksumming. + Set MP4600 series for inverted checksumming. 2009-01-19 Stéphane Voltz * backend/genesys.c backend/genesys.conf.in backend/genesys.h - backend/genesys_devices.c backend/genesys_gl646.c + backend/genesys_devices.c backend/genesys_gl646.c backend/genesys_gl841.c backend/genesys_low.h: add support for uncalibrated scans in all modes for Visioneer Strobe XP200. Add support for buttons for MD5345/HP2300 and XP200 2009-01-18 m. allan noah - * doc/descriptions/unsupported.desc: everything reported from + * doc/descriptions/unsupported.desc: everything reported from 2008-07 to 2009-01 2009-01-18 Pierre Willenbrock * backend/genesys_low.h: Fix prototype of update_hardware_sensors. Make half-ccd mode optional. - * backend/genesys_gl841.c: Make dpihw depend on sensor pixel count + * backend/genesys_gl841.c: Make dpihw depend on sensor pixel count instead of sensor resolution. Make some Canon LiDE 35 specific gpio handling conditional, add missing SCANMOD shift. Make half-ccd mode optional. Reenable clock register setup from sensor @@ -775,7 +775,7 @@ 2009-01-17 Nicolas Martin * pixma_mp150.c: - Fixed "Busy mode" exit processing. + Fixed "Busy mode" exit processing. 2009-01-17 Julien Blache * doc/descriptions/hp.desc: add SCSI identifiers for the ScanJet @@ -793,7 +793,7 @@ 2009-01-16 Chris Bagwell * doc/Makefile.in, frontend/Makefile.in, include/Makefile.in, - japi/Makefile.in, lib/Makefile.in, po/Makefile.in, + japi/Makefile.in, lib/Makefile.in, po/Makefile.in, sanei/Makefile.in, testsuite/Makefile.in, tools/Makefile.in, backend/Makefile.in: Updates to Makefiles to prepare for transition to automake. @@ -803,14 +803,14 @@ 2009-01-16 Pierre Willenbrock * backend/genesys.c, backend/genesys.h, backend/genesys_devices.c, - backend/genesys_gl646.c, backend/genesys_gl841.c, - backend/genesys_low.h: Add support for buttons on + backend/genesys_gl646.c, backend/genesys_gl841.c, + backend/genesys_low.h: Add support for buttons on Canon LiDE 35/40/50. 2009-01-15 Nicolas Martin - * doc/sane-pixma.man, doc/descriptions/pixma.desc, + * doc/sane-pixma.man, doc/descriptions/pixma.desc, pixma_mp150.c, AUTHORS: - Updated docs and comments in pixma backend. + Updated docs and comments in pixma backend. Added Dennis Lou to pixma backend authors 2009-01-13 Louis Lagendijk @@ -851,7 +851,7 @@ - stop button reqests cancel 2009-01-10 Jeremy Johnson - * backend/hs2p.c: replaced ulong with u_long, + * backend/hs2p.c: replaced ulong with u_long, added static keyword for SANE_Status update_hs2p_data() 2009-01-06 Jonathan Bravo Lopez @@ -898,7 +898,7 @@ - added print_sense_data() - added SENSE_DATA *sdp to sense_handler() - modified read_data() to handler other data type codes/qualifiers - - read_adf_status() now is replaced with call to + - read_adf_status() now is replaced with call to read_data(fd,*buf,*bufsize,dtc,dtq) 2009-01-04 Nicolas Martin @@ -923,7 +923,7 @@ - deactivate double feed options if df-action == default 2008-12-21 Nicolas Martin - * doc/descriptions/pixma.desc, doc/sane-pixma.man, + * doc/descriptions/pixma.desc, doc/sane-pixma.man, backend/pixma_mp150.c: MP800/MP800R: Fixed bug and color planes shift issues, added TPU support for 48 bits images depth up to 1200 dpi. @@ -996,11 +996,11 @@ * doc/descriptions/canon_dr.desc, doc/sane-canon_dr.man: backend v8 2008-12-06 Louis Lagendijk - * backend/pixma_bjnp.c pixma_bjnp_private.h: + * backend/pixma_bjnp.c pixma_bjnp_private.h: replaced getlogin/getenv by getpwuid(geteuid) 2008-12-06 Louis Lagendijk - * backend/pixma_bjnp.c pixma_bjnp_private.h: + * backend/pixma_bjnp.c pixma_bjnp_private.h: On Ubuntu getlogin() returns NULL. So we now first try getlogin() and if that fails, we try getenv("USER") and if that fails we use a default user string @@ -1064,11 +1064,11 @@ 2008-11-25 Nicolas Martin * backend/pixma.c: - Fixed regression bug at end of scan for all PIXMA, noticeable + Fixed regression bug at end of scan for all PIXMA, noticeable in multipage ADF scan. 2008-11-23 Nicolas Martin - * backend/pixma_mp150.c, sane-backends/po/sane-backends.fr.po, + * backend/pixma_mp150.c, sane-backends/po/sane-backends.fr.po, doc/descriptions/pixma.desc, doc/sane-pixma.man: Support for MP630 in pixma backend. Updated docs for MP630, and network interface to various PIXMA models @@ -1153,7 +1153,7 @@ 2008-10-31 Stéphane Voltz * backend/rts8891.c backend/rts8891_low.c backend/rts8891_low.h: - added 600 and 1200 dpi scan for HP4400 and HP4470 with 'xpa' + added 600 and 1200 dpi scan for HP4400 and HP4470 with 'xpa' sensor. 2008-10-25 Nicolas Martin @@ -1175,9 +1175,9 @@ The rest is cosmetic only. 2008-10-21 Louis Lagendijk - * Added #ifdef around defintions of MIN and MAX in pixma_common.h + * Added #ifdef around defintions of MIN and MAX in pixma_common.h - Re-enable includes in pixma_bjnp.c as they are needed on Freebsd - - Replaced getaddrinfo by gethostbyname in pixma_bjnp.c as this is + - Replaced getaddrinfo by gethostbyname in pixma_bjnp.c as this is supported on OS/2 as well 2008-10-21 m. allan noah @@ -1205,15 +1205,15 @@ dpi scan mode for HP4400 2008-10-14 Nicolas Martin - * backend/pixma*.c, backend/pixma*.h (all pixma backend files), - doc/sane-pixma.man, doc/description/pixma.desc, + * backend/pixma*.c, backend/pixma*.h (all pixma backend files), + doc/sane-pixma.man, doc/description/pixma.desc, backend/Makefile.in - Added 3 new files backend/pixma_bjnp.c, backend/pixma_bjnp.h, + Added 3 new files backend/pixma_bjnp.c, backend/pixma_bjnp.h, backend/pixma_bjnp_private.h: - Thanks to Louis Lagendijk, added an implementation of Canon's BJNP network protocol to the pixma backend, for scanning with PIXMA devices over a LAN network. - - Fix for ADF scan reset session when ADF is loaded with more pages + - Fix for ADF scan reset session when ADF is loaded with more pages to scan than the frontend requests. - Updated pixma backend documentation and file headers. @@ -1229,13 +1229,13 @@ bug 2008-10-04 Nicolas Martin - * backend/pixma.c, backend/pixma.h, backend/pixma_common.c, - backend/pixma_io_sanei.c, backend/pixma_mp150.c, + * backend/pixma.c, backend/pixma.h, backend/pixma_common.c, + backend/pixma_io_sanei.c, backend/pixma_mp150.c, doc/sane-pixma.man, doc/description/pixma.desc: - MP970 scanning improvements, up to 4800 dpi. On the way soon, + MP970 scanning improvements, up to 4800 dpi. On the way soon, network BJNP protocol designed by Louis Lagendijk to be added to CVS. MX7600 reported to work fine with the backend. - ADF scanning: + ADF scanning: - improved for latest PIXMAs like MX850, MX310. - bug fix in Sane_start, when scanning several pages with ADF. ADF DUPLEX scanning: @@ -1251,10 +1251,10 @@ - change page length autodetection condition 2008-10-03 Stéphane Voltz - * include/sane/sane.h: added a SANE_CURRENT_MINOR define + * include/sane/sane.h: added a SANE_CURRENT_MINOR define 2008-10-02 Stéphane Voltz - * backend/rts8891.c backend/rts8891.h backend/rts8891_low.h: + * backend/rts8891.c backend/rts8891.h backend/rts8891_low.h: add a 'sensornumber' option to override detected sensor model 2008-10-02 m. allan noah @@ -1302,7 +1302,7 @@ 2008-09-25 m. allan noah * include/sane/saneopts.h: underscore not allowed in option names * frontend/scanimage.c: fix broken unknown length (-1) binary scans, - fix invalid tiff height with unknown length scans, fix compiler warn + fix invalid tiff height with unknown length scans, fix compiler warn 2008-09-20 Stéphane Voltz * backend/rts8891.c: fix typo in HP4400 variant detection @@ -1403,7 +1403,7 @@ descriptor 0 before attempting to get the value of option 0. 2008-08-04 Stéphane Voltz - * backend/umax_pp.c backend/umaxp_pp.h backend/umax_pp.conf.in: + * backend/umax_pp.c backend/umaxp_pp.h backend/umax_pp.conf.in: use configuration framework 2008-08-02 m. allan noah @@ -1467,7 +1467,7 @@ 2008-07-10 Stéphane Voltz * sanei/sanei_config.c: handle cases where config or callback - function is NULL + function is NULL * backend/rts8891.c: use new configuration parsing framework 2008-07-10 Stéphane Voltz @@ -1501,14 +1501,14 @@ * backend/fujitsu.[ch]: backend v69, support hot-unplugging scanners 2008-07-02 m. allan noah - * backend/fujitsu.[ch], backend/fujitsu-scsi.h: backend v68, + * backend/fujitsu.[ch], backend/fujitsu-scsi.h: backend v68, - add halftone type and pattern options - support M3097G with IPC and CMP options via modified VPD response * doc/descriptions/fujitsu.desc, doc/sane-fujitsu.man: backend v68, - manpage cleanup 2008-07-01 m. allan noah - * backend/fujitsu.[ch], backend/fujitsu-scsi.h: backend v67, + * backend/fujitsu.[ch], backend/fujitsu-scsi.h: backend v67, - add IPC/DTC/SDTC options - call check_for_cancel() in sane_cancel, unless reading flag is set @@ -1530,7 +1530,7 @@ 2008-06-25 Nicolas Martin * backend/pixma_imageclass.c: - Patch from Sam Varshavchik to deal with libusb 64 read issue, + Patch from Sam Varshavchik to deal with libusb 64 read issue, for ImageClass MFPs. 2008-06-24 m. allan noah @@ -1597,14 +1597,14 @@ 2008-05-29 Nicolas Martin * doc/sane-pixma.man: man update. - * backend/pixma_io_sanei.c: update status types, and take into + * backend/pixma_io_sanei.c: update status types, and take into account new ones. 2008-05-15 Mattias Ellert * backend/hp3900_sane.c: Correct typos. * po/Makefile.in: add backend/rts8891.c to localization. * po/sane-backends.sv.po: update Swedish localization. - + 2008-05-27 m. allan noah * frontend/scanimage.c: add %n for newline to -f option @@ -1640,7 +1640,7 @@ 2008-05-22 Jonathan Bravo Lopez * backend/hp3900_sane.c: use 1.1.0 well-known option group strings. - * backend/hp3900_config.c, backend/hp3900_debug.c, + * backend/hp3900_config.c, backend/hp3900_debug.c, backend/hp3900_rts8822.c, backend/hp3900_types.c, backend/hp3900_usb.c: Fixed reference position detection for HP3800/HPG2710 scanners. Code clean up. @@ -1710,7 +1710,7 @@ Fix for bug #306751: sanei-thread with pthreads on 64 bit 2008-05-12 Stéphane Voltz - * backend/rts8891.c + * backend/rts8891.c 150/300 dpi mode fixes for 'XPA' sensor HP4470 models 2008-05-08 Alessandro Zummo @@ -1774,7 +1774,7 @@ 2008-04-22 Nicolas Martin * backend/pixma_mp150.c: - Updated pixma backend to have MP970 (tested), and probably other + Updated pixma backend to have MP970 (tested), and probably other CCD sensor MPs, working for Grayscale scan. 2008-04-21 Nicolas Martin @@ -1803,13 +1803,13 @@ * backend/pixma_mp150.c, backend/pixma.h, backend/pixma_mp150.c doc/sane-pixma.man, doc/descriptions/pixma.desc: With feedback from MP970 owner, updated pixma backend for MP970 - CCD sensor support (yet in color only), and more generally, + CCD sensor support (yet in color only), and more generally, support for other CCD sensor PIXMA: MP800, MP810, MP830, MP960, - but yet untested, which produce shifted color planes - scanned images. Current trim based on sample images provided - in bug reports and other web pages, but might require some + but yet untested, which produce shifted color planes + scanned images. Current trim based on sample images provided + in bug reports and other web pages, but might require some few and simple final tweaks. - Also fixed a bug for MP220 at 1200 dpi, MP220 is now reported + Also fixed a bug for MP220 at 1200 dpi, MP220 is now reported to work fine. 2008-04-13 Julien Blache @@ -1869,13 +1869,13 @@ * backend/pixma_mp150.c, backend/pixma.h, backend/pixma_mp150.c doc/sane-pixma.man, doc/descriptions/pixma.desc: With feedback from MP970 owner, updated pixma backend for MP970 - CCD sensor support (yet in color only), and more generally, + CCD sensor support (yet in color only), and more generally, support for other CCD sensor PIXMA: MP800, MP810, MP830, MP960, - but yet untested, which produce shifted color planes - scanned images. Current trim based on sample images provided - in bug reports and other web pages, but might require some + but yet untested, which produce shifted color planes + scanned images. Current trim based on sample images provided + in bug reports and other web pages, but might require some few and simple final tweaks. - Also fixed a bug for MP220 at 1200 dpi, MP220 is now reported + Also fixed a bug for MP220 at 1200 dpi, MP220 is now reported to work fine. 2008-04-13 Julien Blache @@ -1913,7 +1913,7 @@ * doc/saned.man: document -a username. 2008-04-06 Nicolas Martin - * backend/pixma_mp150.c: + * backend/pixma_mp150.c: Modifications for PIXMA MP970, to manage the CCD sensor with PIXMA generation 3 protocol. To be tested. @@ -1936,13 +1936,13 @@ fixed 'reset stream' problem for MD6471. 2008-04-05 Stéphane Voltz - * backend/rts8891.c: + * backend/rts8891.c: split sane_control_option() to make it more readable 2008-04-02 Nicolas Martin - * backend/pixma_mp150.c, backend/pixma.c, doc/sane-pixma.man, - doc/descriptions/pixma.desc: - Added a 10s tempo before "NO PAPER" fail message appears in ADF scan, + * backend/pixma_mp150.c, backend/pixma.c, doc/sane-pixma.man, + doc/descriptions/pixma.desc: + Added a 10s tempo before "NO PAPER" fail message appears in ADF scan, declared PIXMA MX850, moved MP970 to Generation 3 protocol, but yet untested. @@ -1985,8 +1985,8 @@ instead of "sane-port". 2008-03-16 Nicolas Martin - * backend/pixma_mp150.c, backend/pixma.h, doc/sane-pixma.man, - doc/descriptions/pixma.desc: + * backend/pixma_mp150.c, backend/pixma.h, doc/sane-pixma.man, + doc/descriptions/pixma.desc: Changes to have new Canon PIXMA MX700 working with pixma backend Flatbed and ADF scan are supported. @@ -2015,21 +2015,21 @@ and more debug output in init_ms(), for fi-5900 2008-02-24 Nicolas Martin - * backend/pixma_mp150.c, doc/sane-pixma.man, - doc/descriptions/pixma.desc: + * backend/pixma_mp150.c, doc/sane-pixma.man, + doc/descriptions/pixma.desc: Changes to have Canon PIXMA MP140 now working with pixma backend - + 2008-02-23 Pierre Willenbrock * backend/genesys_gl841.c: Make LEDs go really dark when "lamp" is off 2008-02-22 Nicolas Martin - * backend/pixma_mp150.c, backend/pixma_mp730.c, - doc/sane-pixma.man, doc/descriptions/pixma.desc: + * backend/pixma_mp150.c, backend/pixma_mp730.c, + doc/sane-pixma.man, doc/descriptions/pixma.desc: Changed MP140 to experimental cause not working yet Changed MP710 to non-ADF scanner 2008-02-22 Pierre Willenbrock - * backend/genesys_gl841.c: Fix debugging output of + * backend/genesys_gl841.c: Fix debugging output of gl841_bulk_write_register 2008-02-21 Pierre Willenbrock @@ -2052,7 +2052,7 @@ doc/sane-pixma.man, doc/descriptions/pixma.desc, doc/descriptions-external/canon_mfp.desc: - > New models changes: + > New models changes: - added: Pixma MP210, MP470, MP520, MP610, MP710 - declared but untested: Pixma MP140, MP220, MP740 - declared experimental and untested: MP970 diff --git a/ChangeLogs/ChangeLog-1.0.21 b/ChangeLogs/ChangeLog-1.0.21 index 6c2ccd24f..cf1f44d46 100644 --- a/ChangeLogs/ChangeLog-1.0.21 +++ b/ChangeLogs/ChangeLog-1.0.21 @@ -24,14 +24,14 @@ - invert usb status, add 0x to usbids, add missing KV-S1045 usbid 2010-04-12 Nicolas Martin - * backend/pixma_mp150.c, backend/pixma_io_sanei.c, + * backend/pixma_mp150.c, backend/pixma_io_sanei.c, doc/descriptions/pixma.desc, doc/sane-pixma.man: pixma: added changes from Gernot Hassenpflug to fully support Canoscan 8800F. debug code clean-up in pixma_mp150.c 2010-04-12 Chris Bagwell - * backend/p5.c, backend/p5_device.c, backend/p5.h: + * backend/p5.c, backend/p5_device.c, backend/p5.h: Remove references to libc.h in p5.h. On OSX, it was including socket.h and causing compile fail with conflicting connect() functions. Since backend doesn't support network @@ -45,7 +45,7 @@ helps out ming when we define _BSDTYPES_DEFINED. 2010-03-25 Stéphane Voltz - * backend/p5.c backend/p5_device.[ch] backend/genesys_gl646.c: + * backend/p5.c backend/p5_device.[ch] backend/genesys_gl646.c: replace u_int8_t and u_int16_t by uint8_t and uint16_t 2010-04-06 Chris Bagwell @@ -86,7 +86,7 @@ 2010-03-15 Stéphane Voltz * backend/genesys.[ch] backend/genesys_devices.c backend/genesys_low.h - backend/genesys_gl646.[ch] backend/genesys_gl841.c: full transparency + backend/genesys_gl646.[ch] backend/genesys_gl841.c: full transparency adaptor support for gl646 based scanners 2010-03-11 Stéphane Voltz @@ -160,7 +160,7 @@ 2010-02-15 Stéphane Voltz * backend/p5.c backend/p5.h backend/p5_device.c backend/p5_device.h - backend/p5.conf.in doc/descriptions/p5.desc doc/sane-p5.man: add new p5 backend for + backend/p5.conf.in doc/descriptions/p5.desc doc/sane-p5.man: add new p5 backend for Primax PagePartner * backend/dll.conf.in backend/Makefile.* configure* doc/Makefile.* doc/sane.man: p5 backend integration changes @@ -174,7 +174,7 @@ * backend/kvs1025*: add new backend from Panasonic Russia, Ltd. * backend/Makefile.*, configure*, doc/Makefile.*, doc/sane.man: backend integration changes - * doc/desciptions/kvs1025.desc, doc/sane-kvs1025.man: + * doc/desciptions/kvs1025.desc, doc/sane-kvs1025.man: the parts Panasonic forgot 2010-02-12 m. allan noah @@ -262,12 +262,12 @@ lineart. 2010-01-30 Stéphane Voltz - * backend/genesys.conf.in backend/genesys_devices.c + * backend/genesys.conf.in backend/genesys_devices.c doc/descriptions/genesys.desc doc/sane-genesys.man: add Xerox Travel Scanner 100, work by Andrey Loginov 2010-01-29 Nicolas Martin - * backend/pixma_io.h, backend/pixma_imageclass.c, + * backend/pixma_io.h, backend/pixma_imageclass.c, doc/sane-pixma.man, doc/descriptions/pixma.desc: pixma: changed usb timeouts to 20 sec to support ImageClass MF3240. updated source code comments and documentation. @@ -288,10 +288,10 @@ for generation 3+ devices. 2010-01-19 Stéphane Voltz - * backend/genesys.c backend/genesys.conf.in backend/genesys.h - backend/genesys_conv.c backend/genesys_devices.c + * backend/genesys.c backend/genesys.conf.in backend/genesys.h + backend/genesys_conv.c backend/genesys_devices.c backend/genesys_gl646.c backend/genesys_gl841.c backend/genesys_low.h - doc/descriptions/genesys.desc doc/sane-genesys.man: add Visioneer + doc/descriptions/genesys.desc doc/sane-genesys.man: add Visioneer OneTouch 7100 (patch by Jack McGill). Add software lineart option. 2010-01-17 Stéphane Voltz @@ -330,12 +330,12 @@ sheetfed scanners 2009-12-09 Nicolas Martin - * doc/descriptions/pixma.desc, doc/sane-pixma.man, + * doc/descriptions/pixma.desc, doc/sane-pixma.man, backend/pixma_imageclass.c, backend/pixma_mp150.c: pixma: updated backend, docs and desc for support to MP560 and MF4330d/ADF 2009-12-06 Nicolas Martin - * doc/descriptions/pixma.desc, doc/sane-pixma.man, + * doc/descriptions/pixma.desc, doc/sane-pixma.man, backend/pixma.h, backend/pixma.c, backend/pixma_mp150.c: pixma: bumped version, added compilation type debug message. updated doc and desc (support for MX330) @@ -357,18 +357,18 @@ 2009-11-30 Stéphane Voltz * backend/gt68xx.c backend/gt68xx_high.c backend/gt68xx_high.h - backend/gt68xx_low.h backend/gt68xx_gt6816.h backend/gt68xx_gt6816.c: + backend/gt68xx_low.h backend/gt68xx_gt6816.h backend/gt68xx_gt6816.c: implement request '0x59' which detects document presence for 6816. Add a sensor option to reports document presence, and test for document before scan for 6816 sheetfed scanners. 2009-11-29 Stéphane Voltz * backend/gt68xx.c backend/gt68xx_high.c backend/gt68xx_high.h: - added 'clear calibration' button option and 'need calibration' + added 'clear calibration' button option and 'need calibration' sensor option. 2009-11-28 Nicolas Martin - * backend/pixma.c, backend/pixma_mp1580.c, + * backend/pixma.c, backend/pixma_mp1580.c, doc/descriptions/pixma.desc, doc/sane-pixma.man: pixma: fix pixma backend (end of scan), when compiled with USE_PTHREAD/-lpthread set support to complete for MP990 in documentation, as reported by Jean-Michel Poure. @@ -402,7 +402,7 @@ from good to complete for well supported models. 2009-11-16 Stéphane Voltz - * backend/genesys.conf.in backend/genesys_gl841.c + * backend/genesys.conf.in backend/genesys_gl841.c doc/descriptions/genesys.desc : applied fixes and status update from Jack McGill. @@ -446,7 +446,7 @@ pixma: updated doc to include support for MP270 and ImageClass MF3110 2009-10-18 Nicolas Martin - * backend/pixma_mp150.c, backend/pixma_imageclass.c, backend/pixma.h, + * backend/pixma_mp150.c, backend/pixma_imageclass.c, backend/pixma.h, doc/descriptions/pixma.desc, doc/sane-pixma.man: pixma: - bumped backend version to 0.16.1 @@ -489,7 +489,7 @@ 2009-09-27 Nicolas Martin * backend/pixma_bjnp.c, backend/pixma_mp730.c: - Print size_t values as %lu with cast to unsigned long + Print size_t values as %lu with cast to unsigned long as prescribed in the file doc/backend_writing.txt, to avoid compile warnings. Removed unused debug code. @@ -499,7 +499,7 @@ patch by Tollef Fog Heen . 2009-09-16 Nicolas Martin - * backend/pixma_mp150.c, doc/descriptions/pixma.desc, + * backend/pixma_mp150.c, doc/descriptions/pixma.desc, doc/sane-pixma.man: pixma backend: Updated documentation for: - Pixma MP260 support @@ -515,7 +515,7 @@ 2009-09-13 Nicolas Martin * backend/pixma_mp150.c, backend/pixma_mp730.c: - pixma backend: Declared new Pixma models MP250, MP490, MP560, MP640, + pixma backend: Declared new Pixma models MP250, MP490, MP560, MP640, and MP990, all yet untested, and modified some debug code. 2009-09-11 Mattias Ellert @@ -563,15 +563,15 @@ * doc/descriptions/fujitsu.desc: various status and comment updates 2009-08-07 Stéphane Voltz - * backend/genesys_gl646.c backend/genesys_devices.c: + * backend/genesys_gl646.c backend/genesys_devices.c: - small fixes for hp3670 support 2009-08-05 Stéphane Voltz - * backend/genesys.c: + * backend/genesys.c: - fixed shading calibration for hp2300 when dpi <= 300 2009-08-04 Stéphane Voltz - * backend/genesys.c backend/genesys_gl646.c backend/genesys_devices.c: + * backend/genesys.c backend/genesys_gl646.c backend/genesys_devices.c: - fixed document end detection for gl646 cis scanners - disable color filter fro gray mode for gl646 cis scanners @@ -583,7 +583,7 @@ * frontend/tstbackend.c: remove WARMING_UP_STATUS usage 2009-07-30 Jonathan Bravo Lopez - * backend/hp3900_config.c: + * backend/hp3900_config.c: - Fixed bug [#311856] possible for loop overflow 2009-07-29 m. allan noah @@ -603,7 +603,7 @@ 2009-07-25 Nicolas Martin * backend/pixma_mp150.c, doc/descriptions/pixma.desc, doc/sane-pixma.man: - - Fix in declarations for Pixma MX320, MX330 and MX860, + - Fix in declarations for Pixma MX320, MX330 and MX860, - Updated docs for MX860, confirmed to be supported. 2009-06-23 m. allan noah @@ -625,24 +625,24 @@ * backend/xerox_mfp.c: more sanity checking for debug mode. 2009-07-15 Stéphane Voltz - * backend/lexmark.h: disable deep debugging + * backend/lexmark.h: disable deep debugging 2009-07-10 Stéphane Voltz * backend/genesys.c backend/genesys_gl646.c backend/genesys_low.h - backend/genesys_gl646.h backend/genesys_gl841.c + backend/genesys_gl646.h backend/genesys_gl841.c backend/genesys_devices.c backend/genesys.h: - add shading calibration for sheetfed scanners - shading calibration fix for all gl646 based scanners 2009-07-06 Stéphane Voltz - * backend/lexmark.c backend/lexmark.h backend/lexmark_low.h: + * backend/lexmark.c backend/lexmark.h backend/lexmark_low.h: do not use resolution higher than sensor resolution when doing calibation. 2009-07-02 Nicolas Martin * backend/pixma.h, backend/pixma_mp150.c, doc/descriptions/pixma.desc, doc/sane-pixma.man: - Declared new models (yet untested) Pixma MX330 and MX860, updated docs. - - Bump backend minor version number. + - Bump backend minor version number. 2009-07-01 Alex Belkin * backend/xerox_mfp.conf.in: usbid for Samsung SCX-4500W @@ -750,12 +750,12 @@ Modifications to support Canon ImageClass MF5770 2009-06-04 Pierre Willenbrock - * backend/genesys_gl841.c: Make calibration steps always send + * backend/genesys_gl841.c: Make calibration steps always send registers before trying to acquire a line. 2009-05-29 Pierre Willenbrock - * doc/descriptions/genesys.desc: - Added description for Visioneer XP100r3, Visioneer Roadwarrior, + * doc/descriptions/genesys.desc: + Added description for Visioneer XP100r3, Visioneer Roadwarrior, demoted DocketPort 465 to "untested" 2009-05-28 m. allan noah @@ -788,20 +788,20 @@ * backend/pixma_imageclass.c, backend/pixma_mp730.c, sanei/sanei_usb.c: - pixma_imageclass.c: supported devices list cleanup. - pixma_mp730.c: fixed scan area width adjust and end of scan protocol for MP730. - - sanei/sanei_usb.c: in sanei_usb_open(), changed "endpoints seek loop" to + - sanei/sanei_usb.c: in sanei_usb_open(), changed "endpoints seek loop" to take into account only interfaces detected by sanei_usb_init() - Fixes Pixma MP730 usb wrong endpoints selection. + Fixes Pixma MP730 usb wrong endpoints selection. 2009-05-19 Pierre Willenbrock - * backend/genesys_devices.c, backend/genesys_low.h: + * backend/genesys_devices.c, backend/genesys_low.h: Add Pentax DSmobile 600, Syscan 485, DCT 487 - + 2009-05-18 Stéphane Voltz * backend/genesys_gl646.h: fixed missing part of the include 2009-05-13 Stéphane Voltz * backend/genesys_gl646.c backend/genesys_gl646.h: created a - genesys_gl646.h header file, moved all declarations from + genesys_gl646.h header file, moved all declarations from genesys_gl646.c to this file. 2009-05-13 Nicolas Martin @@ -831,7 +831,7 @@ - compare page counter of small scanners only in non-buffered mode - add back-side gray mirroring code for DR-2580C -2009-05-06 Nicolas Martin +2009-05-06 Nicolas Martin * doc/descriptions/pixma.desc: Updated descriptions in pixma backend for ImageClass MF4010 and MF4018. @@ -845,7 +845,7 @@ marked as completely supported * tools/check-usb-chip.c: Updated HP ScanJet model names displayed during the check_hp5590(). - * backend/hp5590.c, backend/hp5590_cmds.c, backend/hp5590_cmds.h, + * backend/hp5590.c, backend/hp5590_cmds.c, backend/hp5590_cmds.h, backend/hp5590_low.c, backend/hp5590_low.h, doc/sane-hp5590.man: Updated the list of supported devices (added HP 5500C which is similar to 4570C, 5500C which is similar to 4500C) - only strings/comments, no @@ -878,9 +878,9 @@ remove :new tag 2009-05-03 Chris Bagwell - * Makefile.in, aclocal.m4, configure, */Makefile.in: Regenerated + * Makefile.in, aclocal.m4, configure, */Makefile.in: Regenerated with newer automake. - * backend/Makefile.am, tools/sane-config.in: Add missing + * 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. diff --git a/ChangeLogs/ChangeLog-1.0.22 b/ChangeLogs/ChangeLog-1.0.22 index 0af106e47..b30861e5f 100644 --- a/ChangeLogs/ChangeLog-1.0.22 +++ b/ChangeLogs/ChangeLog-1.0.22 @@ -38,7 +38,7 @@ 2011-01-26 m. allan noah * backend/canon_dr.[ch], doc/descriptions/canon_dr.desc, - backend/canon_dr.conf.in, doc/sane-canon_dr.man: + backend/canon_dr.conf.in, doc/sane-canon_dr.man: canon_dr backend v37: - don't center window when using flatbed - improve request sense error messages @@ -53,12 +53,12 @@ 2011-01-18 m. allan noah * backend/canon_dr.[ch], doc/desc/canon_dr.desc, doc/sane-canon_dr.man: canon_dr backend v36: - - initial support for DR-3080 and DR-5060 - - add code to clamp scan width to an arbitrary byte width boundary - - add code to prevent setting of brightness/threshold/contrast - - don't send dropout color command on non-color scanners - - initial support for DR-7090C - - update credits + - initial support for DR-3080 and DR-5060 + - add code to clamp scan width to an arbitrary byte width boundary + - add code to prevent setting of brightness/threshold/contrast + - don't send dropout color command on non-color scanners + - initial support for DR-7090C + - update credits * po/pl.po: updated translation from Jakub Bogusz * po/de.po: updated translation from Matthias Mailander * backend/canon.conf.in: improved detection of scsi scanners @@ -85,7 +85,7 @@ 2011-01-06 Stéphane Voltz * backend/genesys.c backend/genesys_devices.c backend/genesys_gl847.c: fix lineart issue when yres is higher than - xres and dynamic lineart is enabled, make gl847 wait for head to + xres and dynamic lineart is enabled, make gl847 wait for head to park between scans, wait for head ot park in sane_close() 2011-01-05 Nicolas Martin @@ -136,7 +136,7 @@ * backend/genesys.c backend/genesys.conf.in backend/genesys_devices.c backend/genesys_gl841.c backend/genesys_low.h doc/descriptions/genesys.desc doc/descriptions/unsupported.desc - doc/sane-genesys.man: add Plustek OpticBook 3600 support + doc/sane-genesys.man: add Plustek OpticBook 3600 support by Chris Berry and Michael Rickmann 2010-12-27 Stéphane Voltz @@ -205,7 +205,7 @@ interface list. 2010-12-02 m. allan noah - * backend/fujitsu.[ch], backend/fujitsu-scsi.h: + * backend/fujitsu.[ch], backend/fujitsu-scsi.h: Fujitsu backend version 105 - backup and restore image params around image processing code - cache software crop/deskew parameters for use on backside of duplex @@ -216,7 +216,7 @@ and D2. 2010-11-24 m. allan noah - * backend/fujitsu.c, backend/fujitsu.conf.in, + * backend/fujitsu.c, backend/fujitsu.conf.in, doc/descriptions/fujitsu.desc, doc/sane-fujitsu.man: Fujitsu backend versions 103 and 104 - remove compiled-in default config file @@ -229,7 +229,7 @@ from Olaf Meeuwissen . 2010-11-17 Stéphane Voltz - * backend/genesys.c: don't write scan data unless specified by debug + * backend/genesys.c: don't write scan data unless specified by debug level. 2010-11-08 Marc Deslauriers @@ -247,16 +247,16 @@ 2010-11-01 Stéphane Voltz * frontend/scanimage.c: don't print readonly device options since they can't be set on command line - + 2010-11-01 Stéphane Voltz - * backend/genesys.c backend/genesys_devices.c backend/genesys_gl843.c + * backend/genesys.c backend/genesys_devices.c backend/genesys_gl843.c backend/genesys_gl843.h backend/genesys_gl847.c: up build number to 41, rework head parking, - fixed clear-calibration option reading, + fixed clear-calibration option reading, make calibration cache expire for non sheetfed gl847 scanners, tuned KV-SS080 timings to improve image quality, raised LiDE 100/200 defaukt gamma to 1.7 - + 2010-10-31 Julien Blache * doc/descriptions/hp.desc: add SCSI IDs for ScanJet 4c. @@ -266,10 +266,10 @@ config file. 2010-10-13 Stéphane Voltz - * backend/genesys_devices.c backend/genesys_gl843.c + * backend/genesys_devices.c backend/genesys_gl843.c backend/genesys_gl843.h: added 100, 150, 400 and 600 dpi modes for G4050 and G4010. Added 500 and 400 dpi modes for KV-SS080 - + 2010-09-30 Alex Belkin * Makefile.in backend/Makefile.am backend/Makefile.in backend/xerox_mfp-tcp.c backend/xerox_mfp-usb.c backend/xerox_mfp.c backend/xerox_mfp.conf.in backend/xerox_mfp.h @@ -355,7 +355,7 @@ 2010-08-31 Stéphane Voltz * backend/genesys_devices.c backend/genesys.conf.in backend/genesys.c - backend/genesys_gl843.[ch] backend/Makefile.am backend/Makefile.in: + backend/genesys_gl843.[ch] backend/Makefile.am backend/Makefile.in: support for gl843 based scanners, starting with KV-SS080. disable true gray for LIDE35/50 since it breaks scanning @@ -370,7 +370,7 @@ some MF8030 settings, but device not yet supported. 2010-07-22 Nicolas Martin - * backend/pixma_mp150.c, backend/pixma_imageclass.c, + * backend/pixma_mp150.c, backend/pixma_imageclass.c, doc/descriptions/pixma.desc, doc/sane-pixma.man: pixma: add support for PIXMA MX870. declared PIXMA MF8030, but not yet working. @@ -411,7 +411,7 @@ * backend/fujitsu.c: Fix compilation bug when jpeg support is enabled. 2010-06-23 Julien Blache - * various: corrected initialization, printing, etc. in many backends + * various: corrected initialization, printing, etc. in many backends 2010-06-21 Julien Blache * tools/sane-desc.c: udev rules: set libsane_matched=yes for SCSI @@ -506,7 +506,7 @@ backend/Makefile.in: start of LiDE 100 and LIDE 200 support 2010-05-16 Stéphane Voltz - * sanei/sanei_usb.c include/sane/sanei_usb.h: add a sanei_usb_reset() + * sanei/sanei_usb.c include/sane/sanei_usb.h: add a sanei_usb_reset() function. 2010-05-15 m. allan noah diff --git a/ChangeLogs/ChangeLog-1.0.23 b/ChangeLogs/ChangeLog-1.0.23 index 07d5e6982..3a30c8f53 100644 --- a/ChangeLogs/ChangeLog-1.0.23 +++ b/ChangeLogs/ChangeLog-1.0.23 @@ -8,16 +8,16 @@ was still conflicting the epjistu and snapscan backends. 2012-08-16 Rolf Bensch - * backend/pixma.[ch], backend/pixma_common.[ch], + * backend/pixma.[ch], backend/pixma_common.[ch], backend/pixma_imageclass.c, backend/pixma_mp*.c: Copyright updated. 2012-08-11 Rolf Bensch * backend/pixma.c, backend/pixma_mp150.c, backend/pixma_mp810.c: - Lineart fix for generation 1+2 scanners. + Lineart fix for generation 1+2 scanners. 2012-08-09 Paul Newall - * /backend/kodakaio.c: + * /backend/kodakaio.c: calling of poll tidied up, may fix problems with repeated scans. 2012-07-30 Stéphane Voltz @@ -51,35 +51,35 @@ fix batch scanning for gl646 scanners 2012-07-29 Paul Newall - * /doc/descriptions/kodakaio.desc: + * /doc/descriptions/kodakaio.desc: advent AW10 added. 2012-07-28 Paul Newall - * /doc/descriptions/kodakaio.desc: + * /doc/descriptions/kodakaio.desc: usbids added and version. 2012-07-28 Rolf Bensch * doc/descriptions/pixma.desc: scanners resorted by name - * backend/pixma_mp150.c, doc/descriptions/pixma.desc, + * backend/pixma_mp150.c, doc/descriptions/pixma.desc, doc/sane-pixma.man: new scanners reported by DMoeller - Canon PIXMA MX410 as untested - Canon PIXMA MX420 as complete - Canon PIXMA E500, E600, MX370 Series, MX430 Series, MX710 Series as untested and experimental * backend/pixma_mp150.c, doc/descriptions/pixma.desc: capabilities updated - for Canon PIXMA MX510 and MX890 + for Canon PIXMA MX510 and MX890 * backend/pixma_mp150.c, doc/sane-pixma.man: all 2012 untested new devices - marked as experimental + marked as experimental 2012-07-26 Rolf Bensch - * README.linux: + * README.linux: New detailled description for the installation of SANE backend. 2012-07-24 m. allan noah * backend/kvs40xx_opt.c: Oops- it is new * doc/descriptions/kvs40xx.desc: Fix typo (Yuri Chornoivan) * po/uk.po: Updated (Yuri Chornoivan) - * tools/Makefile.am, tools/Makefile.in, tools/sane-config.in: + * tools/Makefile.am, tools/Makefile.in, tools/sane-config.in: sane-config fixes (Ruediger Meier) 2012-07-15 Ilia Sotnikov @@ -100,7 +100,7 @@ 2012-06-28 Paul Newall * backend/kodakaio.c backend/kodakaio.conf.in backend/kodakaio.h doc/sane-kodakaio.man doc/descriptions/kodakaio.desc - configure.in makefile.am dllconf.in doc/makefile.am: Added new backend kodakaio for + configure.in makefile.am dllconf.in doc/makefile.am: Added new backend kodakaio for kodak ESP nnnn, Cnnn, hero AiOs, detection of cups added to configure since cups is used for network auto detection. @@ -113,9 +113,9 @@ enabled by capability PIXMA_CAP_48BIT * backend/pixma_mp150.c: unused capability PIXMA_CAP_48BIT removed * backend/pixma_mp810.c: - - new capability for CS9000F: PIXMA_CAP_48BIT + - new capability for CS9000F: PIXMA_CAP_48BIT - functions for scan mode detection improved - - lowest resolution for 48 bit flatbed scan modes is 150 dpi + - lowest resolution for 48 bit flatbed scan modes is 150 dpi * po/de.po: German translations for new scan modes 2012-06-04 Stéphane Voltz @@ -151,7 +151,7 @@ 2012-05-28 Stéphane Voltz * backend/genesys.c backend/genesys_devices.c backend/genesys_gl124.c backend/genesys_gl847.c backend/genesys_gl847.h backend/genesys_low.h - doc/descriptions/genesys.desc doc/sane-genesys.man: + doc/descriptions/genesys.desc doc/sane-genesys.man: add support for LiDE 700F up to 2400 dpi 2012-05-10 m. allan noah @@ -175,7 +175,7 @@ - improve (disabled) debug logs 2012-05-03 Rolf Bensch - * backend/pixma_io_sanei.c, backend/pixma_mp150.c, + * backend/pixma_io_sanei.c, backend/pixma_mp150.c, doc/descriptions/pixma.desc, doc/sane-pixma.man: Patch for Canon Pixma MP280 from Daniel Beer. - PIXMA_EOF mapped to PIXMA_ETIMEDOUT. @@ -187,15 +187,15 @@ 2012-04-20 Rolf Bensch * tools/sane-desc.c: tools/udev/libsane.rules supports scanner group - access to any scanner, with and without acl support. + access to any scanner, with and without acl support. 2012-04-17 Rolf Bensch * backend/pixma.c, backend/pixma_sane_options.c, po/de.po: New description for device specific option "source". 2012-04-17 Rolf Bensch - * backend/pixma.c: select first entries of dynamic dpi list - and dynamic mode list as default values after changing the scan source + * backend/pixma.c: select first entries of dynamic dpi list + and dynamic mode list as default values after changing the scan source 2012-04-04 Rolf Bensch * backend/pixma_mp150.c, doc/descriptions/pixma.desc, doc/sane-pixma.man: @@ -255,23 +255,23 @@ * backend/pixma_bjnp.c: Replace index() with strchr(). Bug #313563. 2012-02-29 Rolf Bensch - * backend/pixma.[ch], backend/pixma_common.c, - backend/pixma_sane_options.[ch]: New device specific option + * backend/pixma.[ch], backend/pixma_common.c, + backend/pixma_sane_options.[ch]: New device specific option 'threshold-curve'. Can be used to optimize 1 bit B/W lineart scans. 2012-02-27 Rolf Bensch - * backend/pixma_imageclass.c, doc/descriptions/pixma.desc, - doc/sane-pixma.man: New scanner Canon imageCLASS MF4410 from + * backend/pixma_imageclass.c, doc/descriptions/pixma.desc, + doc/sane-pixma.man: New scanner Canon imageCLASS MF4410 from Vasiliy Olekhov. 2012-02-16 Rolf Bensch - * backend/pixma.c, backend/pixma_sane_options.[ch]: + * backend/pixma.c, backend/pixma_sane_options.[ch]: New device specific option 'gamma'. 2012-02-09 Rolf Bensch - * backend/pixma.[ch], backend/pixma_common.[ch], + * backend/pixma.[ch], backend/pixma_common.[ch], backend/pixma_sane_options.[ch], backend/pixma_mp{150,810}.c: - 1 bit B/W lineart for pixma_mp150 and pixma_810 subdrivers. + 1 bit B/W lineart for pixma_mp150 and pixma_810 subdrivers. 2012-02-06 Rolf Bensch * backend/pixma_mp150, doc/descriptions/pixma.desc, doc/sane-pixma.man: @@ -281,15 +281,15 @@ * backend/pixma.h: set PIXMA_VERSION_{MAJOR,MINOR,BUILD} to 0.16.3. 2012-02-03 Rolf Bensch - * backend/scripts/pixma_gen_options.py: script to generate - backend/pixma_sane_options.c and backend/pixma_sane_options.h + * backend/scripts/pixma_gen_options.py: script to generate + backend/pixma_sane_options.c and backend/pixma_sane_options.h from pixma.c. Found in old pixma project archive file http://home.arcor.de/wittawat/pixma/mp150-0.13.1.tar.bz2. 2012-01-31 Rolf Bensch * backend/pixma.[ch], backend/pixma_imageclass.c, backend/pixma_mp[17]50.c, backend/pixma_mp730.c, backend/pixma_mp810.c: modify dpi_list dependent on - different scanner capabilities for normal (flatbed) and ADF/TPU modes. + different scanner capabilities for normal (flatbed) and ADF/TPU modes. 2012-01-23 Rolf Bensch * backend/pixma_mp150, doc/descriptions/pixma.desc, doc/sane-pixma.man: @@ -372,7 +372,7 @@ 2011-11-20 Stéphane Voltz * backend/genesys_*.[ch] doc/descriptions/genesys.desc: build - 66. Add hp N6310 and 4850C devices. Fix gl847 calibration. + 66. Add hp N6310 and 4850C devices. Fix gl847 calibration. GL843 XPA support groundwork. 2011-11-14 Chris Bagwell @@ -571,7 +571,7 @@ * doc/descriptions/canon_dr.desc: status of DR-5020 2011-07-06 Stéphane Voltz - * backend/genesys_low.h backend/genesys_gl847.c backend/genesys.c + * backend/genesys_low.h backend/genesys_gl847.c backend/genesys.c backend/genesys_gl124.c backend/genesys_gl843.c backend/genesys_gl646.c backend/genesys_gl841.c: improve 4800 dpi quality for LiDE 200 by increasing the number of lines scan for shading @@ -603,13 +603,13 @@ * backend/genesys.c backend/genesys_gl847.c: lineart fix 2011-06-13 Stéphane Voltz - * backend/genesys_devices.c backend/genesys_gl646.c + * backend/genesys_devices.c backend/genesys_gl646.c backend/genesys_gl646.h doc/descriptions/genesys.desc doc/sane-genesys.man: add full HP2400 support thanks a patch from Alexey Osipov 2011-06-13 Stéphane Voltz - * backend/genesys*.[ch] : rework of gl847 to reach 2400 dpi for + * backend/genesys*.[ch] : rework of gl847 to reach 2400 dpi for LiDE 100 and 4800 dpi for LiDE 200 2011-06-10 Stéphane Voltz @@ -644,11 +644,11 @@ USB autosuspend/power management and use power/control if available. 2011-03-18 Stéphane Voltz - * backend/genesys_low.c backend/genesys.c : rewrite big endian fixes + * backend/genesys_low.c backend/genesys.c : rewrite big endian fixes for gl847/gl124 based scanners. Improve calibration cache file handling. 2011-03-17 Stéphane Voltz - * backend/genesys_low.c: big endian fixes for gl847/gl124 based + * backend/genesys_low.c: big endian fixes for gl847/gl124 based scanners. Patch by Olaf Zimmermann . 2011-03-15 Stéphane Voltz diff --git a/ChangeLogs/ChangeLog-1.0.24 b/ChangeLogs/ChangeLog-1.0.24 index 45053b81e..f2e47abb3 100644 --- a/ChangeLogs/ChangeLog-1.0.24 +++ b/ChangeLogs/ChangeLog-1.0.24 @@ -90,7 +90,7 @@ 2013-08-07 Stéphane Voltz * backend/genesys.[ch] backend/genesys_conv.c doc/sane-genesys.man po/fr.po: add digital brightness and contrast options. - Add an option to set calibration cache file name. + Add an option to set calibration cache file name. 2013-08-07 Stéphane Voltz * frontend/tstbackend.c: add argument to get verbose messages during @@ -105,7 +105,7 @@ 2013-08-02 Stéphane Voltz * configure configure.in testsuite/Makefile.* testsuite/tools/*: add - a testsuite for sane-desc, then merge hwdb support for sane-desc by + a testsuite for sane-desc, then merge hwdb support for sane-desc by Tom Gundersen . 2013-07-31 m. allan noah @@ -291,7 +291,7 @@ 2013-03-04 Oliver Schwartz * backend/snapscan-options.c backend/snapscan-scsi.c backend/snapscan.c - backend/snapscan-sources.c backend/snapscan.h + backend/snapscan-sources.c backend/snapscan.h doc/descriptions/snapscan.desc: Added support for Acer Scanwit 2720S implemented by Andrew Goddbody. @@ -424,9 +424,9 @@ has added support for IPv6 2013-01-10 Louis Lagendijk - * Added optional support in sanedi.c 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 + * Added optional support in sanedi.c 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-08 Rolf Bensch @@ -486,7 +486,7 @@ speed up batch scans 2012-11-28 Paul Newall - * backend/kodakaio.c backend/kodakaio.h backend/kodakaio.conf.in + * backend/kodakaio.c backend/kodakaio.h backend/kodakaio.conf.in backend/Makefile.am backend/Makefile.in docs/descriptions/kodakaio.desc: Use avahi instead of cups for network autodetection @@ -512,7 +512,7 @@ without need for manual editing * pixma.[ch] pixma_mp810.c pixma_mp150.c Rewrite of button option handling. Button options can now be read - without triggering through the button-update option. Buton-update + without triggering through the button-update option. Buton-update options is left for ease of use with xsane Options are cached so that only when an option is read again all options are re-read. @@ -597,6 +597,6 @@ 2012-08-26 m. allan noah * ChangeLog*, configure*, Makefile.in, doc/desc/{kodakaio,kvs40xx}.desc: - Various updates related to starting 1.0.24git + Various updates related to starting 1.0.24git Older entries can be found in ChangeLog-1.0.23. diff --git a/ChangeLogs/ChangeLog-1.0.25 b/ChangeLogs/ChangeLog-1.0.25 index 06efddbbd..fea14d404 100644 --- a/ChangeLogs/ChangeLog-1.0.25 +++ b/ChangeLogs/ChangeLog-1.0.25 @@ -8,7 +8,7 @@ * backend/pixma.h, doc/descriptions/pixma.desc: Pixma backend version 0.17.23 2015-06-22 Louis Lagendijk - * doc/saned.man: updated to clarify systemd integration and + * doc/saned.man: updated to clarify systemd integration and configuration for thecase where saned is compiled with systemd glue. @@ -485,7 +485,7 @@ for autodetection in kodakaio so the detection of cups is no longer required. 2013-10-14 Paul Newall - * backend/kodakaio.c: fix bug #314301, + * backend/kodakaio.c: fix bug #314301, Segfault when unexpected data returned by avahi auto discovery. 2013-10-11 Rolf Bensch @@ -502,6 +502,6 @@ 2013-09-30 m. allan noah * ChangeLog*, configure*, doc/releases.txt: - Various updates related to starting 1.0.25git + Various updates related to starting 1.0.25git Older entries can be found in ChangeLog-1.0.24. diff --git a/ChangeLogs/ChangeLog-1.0.27 b/ChangeLogs/ChangeLog-1.0.27 index 5197a3fc9..c242cb4ec 100644 --- a/ChangeLogs/ChangeLog-1.0.27 +++ b/ChangeLogs/ChangeLog-1.0.27 @@ -21,7 +21,7 @@ Author: m. allan noah Date: Sun May 14 21:34:36 2017 -0400 updated uk.po translation - + Update from Yuri Chornoivan commit 479ccaedddcb0a491b351e20cac22595196df02a @@ -29,11 +29,11 @@ Author: Olaf Meeuwissen Date: Sun May 14 19:48:41 2017 +0900 autotools: Sync derived files - + This was done by running - + autoreconf --force --install - + on Debian GNU/Linux 8.8 and reverting the removal of SANE specific tweaks to ltmain.sh. @@ -54,7 +54,7 @@ Author: Jörg Frings-Fürst Date: Sat May 13 18:07:26 2017 +0900 Replace the startup gamma with the same from the standalone version - + Fixes https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=629470 commit 5c0812c51b6d48516acb9dd9efcfbe2b34f04a79 @@ -86,10 +86,10 @@ Author: Olaf Meeuwissen Date: Sat May 13 13:09:25 2017 +0900 Add a header to dll.conf - + Document dll.conf in a header, point to the dll.d directory for external backends and document the net backend w/ pointers to the manpages. - + Based on a patch by Julien BLACHE commit 77dcf26860b239dafb3094c863691aaef304805a @@ -97,11 +97,11 @@ Author: Christopher James Halse Rogers Date: Sat May 13 13:07:01 2017 +0900 Fix potential assert in avahi backend - + avahi_browser contains a reference to an AvahiClient, which may be avahi_client. If it does, then freeing avahi_browser references avahi_client, resulting in an assert() in Avahi's linked list macro. - + Fix this by freeing avahi_browser before avahi_client. See https://bugs.launchpad.net/bugs/831867 @@ -128,7 +128,7 @@ Author: René Rebe Date: Fri May 5 07:05:30 2017 +0200 epson2: fixed network transport for new scanners - + increased command buffer due memory overrun, and always read receive status, even for zero length on network scanenrs, should fix #315552 @@ -137,7 +137,7 @@ Author: Olaf Meeuwissen Date: Sat May 6 20:40:25 2017 +0900 Fix test for API specification generation - + If none of the formats can be generated but API specs are requested, bomb. The original test aimed to do so but was testing against "no", a value that was never assigned. @@ -147,10 +147,10 @@ Author: Olaf Meeuwissen Date: Sat May 6 12:24:13 2017 +0900 kvs20xx.c: don't assume sane_get_devices() has been called - + Nor that that function is called with a non-NULL argument. This aligns the implementation with that of kvs40xx.c. - + Fixes 315625. commit 8995b1fc81e4378d2b5b0b6b0d354735403210ed @@ -158,7 +158,7 @@ Author: Martin Husemann Date: Tue Mar 15 18:07:00 2016 +0900 sanei_usb: fix number of bytes read for 64bit big-endian systems - + Fixes 315337. commit b1a2c6105443c5279684f0c6827c268594aa234d @@ -172,10 +172,10 @@ Author: Klaus Kaempf Date: Wed May 3 17:52:15 2017 +0200 pieusb: Support ProScan 10T and Reflecta CrystalScan 3600 - + Neither of these scanner have an automated slide transport and fail on respective SCSI commands. - + - Add flags parameter to control if automatic slide transport is available - Reflect flags in pieusb.conf.in - rename SLIDE_LAMP_ON to SLIDE_INIT @@ -232,7 +232,7 @@ Author: Olaf Meeuwissen Date: Sun Apr 30 20:05:12 2017 +0900 Fix [-Werror=implicit-function-declaration] compiler error - + The fileno() is only available if its feature test macro passes. The various symbols are defined appropriately in ../include/sane/config.h during configuration of the build. @@ -248,7 +248,7 @@ Author: Aaron Muir Hamilton Date: Mon Apr 17 12:07:40 2017 +0000 Avoid attaching grayscale ICC profiles to rgb images, or vice-versa. - + If the ICC profile added does not match the colour format of the image, libpng will abort. This can leave the scanner motors in an incorrect state and possibly cause permanent damage. @@ -264,7 +264,7 @@ Author: Aaron Muir Hamilton Date: Sun Apr 16 15:13:06 2017 +0000 Separate ICC profile loading into a separate file. - + This cuts out some duplicate code, and enables us to reuse this logic for PNG, JPEG, and any other future output format. sanei_load_icc_profile also allows us to know that an ICC profile @@ -283,7 +283,7 @@ Author: Olaf Meeuwissen Date: Thu Apr 27 22:26:01 2017 +0900 utsushi.desc: PID 0156 is a ES-400 - + See Alioth issue 315695. commit a0321d2a92286afbc9557fa44e2de4f706cf2407 @@ -297,7 +297,7 @@ Author: Olaf Meeuwissen Date: Thu Apr 27 21:17:34 2017 +0900 Only swap 16-bit PNG bytes on machines that are not big-endian - + The SANE API specifies that image bytes are in machine native order. commit 28eb09eec4c64d9070b5747c93c25134395cab53 @@ -341,7 +341,7 @@ Author: m. allan noah Date: Tue Apr 11 21:22:05 2017 -0400 epjitsu backend v31 - + - hardware gray support for fi-60F/65F (disabled pending calibration) - merge fi-60F/65F settings - improve desc, conf and man files @@ -357,7 +357,7 @@ Author: m. allan noah Date: Sat Apr 8 21:44:27 2017 -0400 fujitsu backend v133 2017-04-08, MAN - + - initial support for fi-7600/7700 - autodetect various double feed capabilities using VPD - call send_lut if we are using a downloaded gamma table @@ -367,7 +367,7 @@ Author: Olaf Meeuwissen Date: Sat Apr 8 21:08:12 2017 +0900 genesys: Trigger reallocation of gamma tables on next sane_open() - + Fixes 315491. commit 6eb4a1f164ef116a3ed10ee42883a15c268ea01e @@ -381,7 +381,7 @@ Author: Olaf Meeuwissen Date: Fri Apr 7 20:28:02 2017 +0900 Add missing double quote - + Accidently removed in 38ce7fc086a6ecbee94ef31901a6eb874fb611b1. Thanks to Jon Nelson for pointing this out. @@ -432,7 +432,7 @@ Author: m. allan noah Date: Wed Mar 22 12:33:27 2017 -0400 epjitsu backend v30 again - + - typo in previous commit broke low resolution scans on fi-65F commit a7fde11e15e5604c7b37bc9553cbd08086c08e53 @@ -440,7 +440,7 @@ Author: m. allan noah Date: Tue Mar 21 21:35:59 2017 -0400 epjitsu backend v30 - + - bump build number commit 891e3984d0410fa8c698d99d79948df3237e258d @@ -448,7 +448,7 @@ Author: m. allan noah Date: Tue Mar 21 20:39:47 2017 -0400 epjitsu v30 - + - fix image truncation when using 150 DPI in Y direction - add 200 and 400 DPI Y direction support for fi-60F/65F @@ -457,7 +457,7 @@ Author: Olaf Meeuwissen Date: Sun Feb 19 16:45:45 2017 +0900 Address memory corruption and information leakage. - + Addresses CVE-2017-6318, Alioth#315576 and Debian's BTS#854804. commit eaa4d4407d96585b7cdbe194d8ac295eee3e6299 @@ -465,7 +465,7 @@ Author: m. allan noah Date: Sat Mar 18 19:15:03 2017 -0400 epjitsu backend v29 - + - fix infinite loop when scaling in Y direction commit 2f9ea038b157fc6d08ce882a1d9984d37b46d809 @@ -473,7 +473,7 @@ Author: Olaf Meeuwissen Date: Sat Mar 11 10:48:35 2017 +0900 Fix typo - + See http://lists.alioth.debian.org/pipermail/sane-devel/2017-March/035099.html commit 1e028b72cae0f4caaf48868504bd2cd1667d6da7 @@ -481,7 +481,7 @@ Author: Olaf Meeuwissen Date: Mon Mar 6 20:54:59 2017 +0900 pixma: updated status for MG5400 Series - + See http://lists.alioth.debian.org/pipermail/sane-devel/2017-March/035072.html and http://lists.alioth.debian.org/pipermail/sane-devel/2017-March/035082.html @@ -502,7 +502,7 @@ Author: Olaf Meeuwissen Date: Mon Dec 26 08:13:33 2016 +0900 Update backend maintenance status - + Following the project member list cleanup, only backends that list a project member with git write access in the AUTHORS file are now considered maintained. @@ -512,7 +512,7 @@ Author: Louis Lagendijk Date: Fri Jan 6 23:30:31 2017 +0100 Revert "pixma_mp150.c: Fix scanbutton detection for MB5000 series" - + This reverts commit 53aa78df3a6980791ce250c471d019c5c59b83ec. commit 306f8f16e78b52948a6e09fa0957b3e364e0189f @@ -520,7 +520,7 @@ Author: Louis Lagendijk Date: Fri Jan 6 23:29:59 2017 +0100 Revert "pixma_mp150.c: fix 1200 dpi scanning for MB5000 series" - + This reverts commit dfc5487571ed2915bda7bdedbd4c79015004361b. commit 9bc734042f6a2af159772eef412efe7c65ebb02f @@ -528,7 +528,7 @@ Author: Louis Lagendijk Date: Fri Jan 6 23:28:56 2017 +0100 Revert "pixma_mp150.c: scan param 0x26-0x29 should contain localtime HHMM, also for MB5000 series" - + This reverts commit eb712c6bd8ca6a42a1d3941583fa18b9981b8712. commit 6c439bce791522aa9cd3fc04cf62087bdd6c6875 @@ -536,7 +536,7 @@ Author: Louis Lagendijk Date: Fri Jan 6 23:28:31 2017 +0100 Revert "pixma_mp150.c: replace multiple if statements with case statement in handle_interrupt" - + This reverts commit 28dcd0aef4ac91b87527c17c8aa89e879f39f20d. commit 06b4b27ecfad1aa30c772fa0fac15d1c144c1e7a @@ -544,7 +544,7 @@ Author: Louis Lagendijk Date: Fri Jan 6 23:28:09 2017 +0100 Revert "pixma_mp150.c: fix parameter settings for MB5000 in send_scan_param" - + This reverts commit 1d2a40ec96aea0ba183415efea570301159d4159. commit 589e011992a21ae1edb4684eb89582350c47333f @@ -601,7 +601,7 @@ Author: Dave Platt Date: Thu Dec 15 23:12:07 2016 -0800 avision.c: abort "wait for light" loop if interrupted - + Adds a "cancelled" flag to the Avision device structure, cleared in sane_start() and set in sane_cancel(). Test this flag in wait_4_light() and bail out of the 90-second "wait for the @@ -612,7 +612,7 @@ Author: Dave Platt Date: Thu Dec 15 23:02:42 2016 -0800 avision.c: Recognize "backlight on" status - + Avision scanners can return an additional light-status value meaning "Transparent Media Adapter back-light is on". Accept this as equivalent to "on" during the lamp-warmup check prior to starting a @@ -625,16 +625,16 @@ Author: Dave Platt Date: Thu Dec 15 22:29:16 2016 -0800 avision.c: Add "skip-adf" option - + The code which tries aggressively to reset/initialize HP 82xx/83xx Automatic Document Feeders doesn't work well if there's no ADF attached, because the scanner reports a non-zero ADF model type in this case. The retry code makes several attempts to initialize the ADF, and then bails out with an "Operation not supported" error. - + Add a new "option skip-adf" which will cause the backend to believe the "ADF not present" status if that's what the scanner reports. - + Fixes #313751 commit f58ce8f9201364bd0fe28ef736d4b1345f3f71b2 @@ -679,7 +679,7 @@ Author: Alex Belkin Date: Sun Nov 6 22:28:03 2016 +0300 Pre-create temporary file for Jpeg scanning. - + Jpeg mode (as submitted by Samsung developer) uses temporary file with fixed name. This opens attacks on reading its content or overwriting any other user-writable file (with symlink). This change pre-creates @@ -697,13 +697,13 @@ Author: Alex Belkin Date: Sun Nov 6 21:38:47 2016 +0300 Indent of xerox_mfp-tcp.c and xerox_mfp-usb.c - + This is purely indent commit without any code changes, in follow-up to 83bbcfe7d546b4d0cd28269b647fb558c6a1e00a. - + Indent command used: astyle -A8 -U -H -k3 -W3 -o xerox_mfp-{usb,tcp}.c - + Proof that code is not changed: git log -w -p xerox_mfp-{usb,tcp}.c @@ -724,7 +724,7 @@ Author: Alex Belkin Date: Sun Nov 6 20:24:02 2016 +0300 Run indent: astyle -A8 -U -H -k3 -W3 -o xerox_mfp.[ch] - + This is purely indent commit w/o any code changes. To prove run `git diff -w`. @@ -733,7 +733,7 @@ Author: m. allan noah Date: Sat Oct 8 19:32:43 2016 -0400 fujitsu backend v132 - + - remove ipc_mode option and variables - set ipc mode based on other options - cleanup inverted logic DTC options @@ -750,7 +750,7 @@ Author: Rolf Bensch Date: Sat Oct 8 14:24:53 2016 +0200 pixma: new scanner Canon PIXMA MG3000 Series - + see bug report #315521 commit 3b63fdab2b94f14765f8ba165546f6d69fc23ea9 @@ -764,7 +764,7 @@ Author: Rolf Bensch Date: Wed Oct 5 19:51:35 2016 +0200 fix ADF scanning for Canon MF57x0 devices - + - ignore result from calibrate(): don't interrupt @ PIXMA_STATUS_BUSY - MF57x0 devices don't require abort_session() after the last page - reported by Dmitry Deshevoy @@ -786,7 +786,7 @@ Author: Olaf Meeuwissen Date: Sun Sep 25 17:00:54 2016 +0900 sane-find-scanner: disable USB if not supported - + This fixes a [-Wpedantic] compiler warning about ISO C forbidding empty translation units. The check-usb-chip.c file reduces to such a file in the case USB support was explicitly disabled or no usable library found. @@ -796,11 +796,11 @@ Author: Olaf Meeuwissen Date: Sun Sep 25 16:28:11 2016 +0900 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. @@ -809,7 +809,7 @@ Author: Olaf Meeuwissen Date: Sun Sep 25 15:53:46 2016 +0900 sanei_usb: : fix [-Wunused-parameter] compiler warnings - + These were issued in the absence of libusb. commit e6faafcdc94e253f7f4fe793fec6110ce37e8014 @@ -817,7 +817,7 @@ Author: Olaf Meeuwissen Date: Sun Sep 25 15:44:36 2016 +0900 xerox_mfp: fix [-Wunused-parameter] compiler warnings - + These are issued when libjpeg was not found during configuration. commit 32be261254a78d1f314b3ee86fd5e5b40ab91a86 @@ -832,7 +832,7 @@ Author: Olaf Meeuwissen Date: Wed Sep 21 22:11:09 2016 +0900 AWARE: Treat compiler warnings as errors on debian-8-full - + This build became compiler warning free in ee550e5d. Let's keep it that way! @@ -847,7 +847,7 @@ Author: Olaf Meeuwissen Date: Mon Sep 19 12:52:31 2016 +0900 pieusb: fix [-Wunused-parameter] compiler warnings - + The functions that trigger these warnings were not used. commit bf088a6ed15733237df446a84d6659c4e0145c9a @@ -855,7 +855,7 @@ Author: Olaf Meeuwissen Date: Mon Sep 19 17:45:35 2016 +0900 Merge comments - + This gets rid of a missing :usbid warning. commit e01f574b19be74081650e9be9bcb16a3420068ef @@ -869,7 +869,7 @@ Author: Olaf Meeuwissen Date: Mon Sep 19 15:26:14 2016 +0900 Add missing USB IDs - + Taken from http://www.linux-usb.org/usb.ids commit dd940a1f612f56d2acb929afd54614ebc6dfb309 @@ -883,7 +883,7 @@ Author: Olaf Meeuwissen Date: Mon Sep 12 20:12:28 2016 +0900 niash: fix [-Wunused-but-set-variable] compiler warning - + This makes explicit what the compiler has effectively been doing all along anyway since at least 727dd4ab (2004-08-03). @@ -892,7 +892,7 @@ Author: Olaf Meeuwissen Date: Mon Sep 12 20:05:42 2016 +0900 epson2: fix [-Wunused-but-set-variable] compiler warning - + This makes explicit what the compiler has effectively been doing all along anyway since at least 728e032a (2009-06-01). @@ -913,9 +913,9 @@ Author: Olaf Meeuwissen Date: Sun Sep 18 21:21:35 2016 +0900 Add fig2dev as prerequisite for API HTML docs - + The target for sane-html depends on sane.dvi which requires fig2dev. - + Thanks to: - https://lists.debian.org/debian-user/2016/08/msg00484.html - http://superuser.com/questions/1101439/error-building-sane-backend-on-debian @@ -931,7 +931,7 @@ Author: m. allan noah Date: Sun Sep 11 19:03:23 2016 -0400 canon_dr v56 - + - add initial support for P-150M (and probably P-150) commit 39ceeae616a2e1638c2760d4364adcaa210a413b @@ -945,7 +945,7 @@ Author: Olaf Meeuwissen Date: Wed Sep 7 21:01:26 2016 +0900 Prefer *our* `include/` files - + This fixes discrepancies in build results for VPATH builds. commit 737977199ccd2419a51e120c472981b1a1263ab0 @@ -959,7 +959,7 @@ Author: Olaf Meeuwissen Date: Sun Sep 4 14:39:52 2016 +0900 gphoto2: fix libgphoto2 logging integration - + In libgphoto2-2.5.0 (tagged for release on 2012-07-10) the GPLogFunc no longer takes a va_list. Instead, it passes a formatted message. @@ -968,7 +968,7 @@ Author: Olaf Meeuwissen Date: Sun Sep 4 12:50:19 2016 +0900 saned: fix [-Wunused-parameter] compiler warning - + The `__sane_unused__` attribute has been moved from sanei_backend.h to sanei.h to make it generally useful instead of limited to backends. @@ -977,11 +977,11 @@ Author: Olaf Meeuwissen Date: Sun Sep 4 12:13:16 2016 +0900 Drop build environments - + Adding them did not quite have the effect I thought it would. I had thought it would allow for easy linking to build logs by environment name. Alas, no such luck. - + This reverts commits: - 9c44317289f1be0a72089ffd030be84caf75b58c - 6209fecf3a11e90e2e5efc057cf650f4ab792b50 @@ -1009,7 +1009,7 @@ Author: Olaf Meeuwissen Date: Sun Aug 28 15:27:50 2016 +0900 magicolor: fix [-Werror] compiler warning - + This casts away const-ness in the hope that libsnmp doesn't change the session.peername. @@ -1018,7 +1018,7 @@ Author: Olaf Meeuwissen Date: Sun Aug 28 15:25:43 2016 +0900 magicolor: fix [-Werror=pointer-sign] compiler warnings - + The libsnmp API requires a u_char *session.community :-( commit c32d48ef5fd4a47a93933e6ffba5c8a93d26e43f @@ -1038,7 +1038,7 @@ Author: Olaf Meeuwissen Date: Sun Aug 28 13:55:30 2016 +0900 hp5400: fix [-Werror=overflow] compiler warning - + This explicitly implements what gcc and clang assign. commit 9c44317289f1be0a72089ffd030be84caf75b58c @@ -1070,7 +1070,7 @@ Author: Olaf Meeuwissen Date: Sun Aug 28 11:58:16 2016 +0900 md5: fix [-Wpointer-arith] compiler warnings - + This reverts commits 9aecb00947e6bf7ef1cf412aff2ab41202617b30 and cdad5961f3888f0a3c0c525d0efab33174c11a24 which fixed a different compiler warning that seems to have disappeared (at least on the @@ -1093,7 +1093,7 @@ Author: Olaf Meeuwissen Date: Wed Aug 3 22:16:26 2016 +0900 pixma: Fix include guard typo - + This was introduced in f573865 on 2008-10-18. commit 23cc2e1ba043ea8309923f5f1dcc5acaeee38a95 @@ -1101,7 +1101,7 @@ Author: Olaf Meeuwissen Date: Wed Aug 3 22:08:49 2016 +0900 Fix include guard typo - + This seems to have been present since the beginning of sanei/sanei_scsi.c. commit 63b55e2b591ba977a285a4c91fde0118c25246e7 @@ -1109,7 +1109,7 @@ Author: Olaf Meeuwissen Date: Wed Aug 3 22:05:03 2016 +0900 Drop check for sys/bitypes.h - + It was obsoleted in 70f3fdf on 2009-02-26. commit d263f25911a0b359b7edec0faa9320d5d13928da @@ -1117,7 +1117,7 @@ Author: Olaf Meeuwissen Date: Wed Aug 3 21:48:54 2016 +0900 Fix typo - + Appears to have been introduced in 0330a4d on 2009-02-02. There is no evidence that a scdds.h file has ever existed. @@ -1126,7 +1126,7 @@ Author: Olaf Meeuwissen Date: Wed Aug 3 20:53:06 2016 +0900 Drop unused CPP define - + The last reference to it was removed in 5dcf165 on 2007-06-21. commit 5389808029f0f81d204630f6e78abe11dfd61122 @@ -1140,7 +1140,7 @@ Author: Olaf Meeuwissen Date: Tue Aug 2 21:38:43 2016 +0900 Use DIR_SEP instead of hard-coding ":" - + Fixes 313540 commit b021c3bee8e9edc7854050a3975cef003586b2e5 @@ -1160,7 +1160,7 @@ Author: Olaf Meeuwissen Date: Mon Jul 18 20:55:14 2016 +0900 kvs40xx: fix [-Wunused-function] compiler warning - + This rather unceremoniously removed the function. Note that a near copy can be found in the kvs20xx backend code. @@ -1169,7 +1169,7 @@ Author: Olaf Meeuwissen Date: Mon Jul 18 20:53:51 2016 +0900 kvs20xx: fix [-Wunused-function] compiler warning - + This rather unceremoniously removed the function. Note that a near copy can be found in the kvs40xx backend code. @@ -1196,7 +1196,7 @@ Author: Olaf Meeuwissen Date: Mon Jul 18 16:51:08 2016 +0900 Use a single symbol to flag unused parameters - + The __sane_unused__ symbol was used slightly more often then UNUSEDARG and, more importantly, defined in include/sane/sanei_backend.h. That makes it readily available to virtually all backends. @@ -1206,7 +1206,7 @@ Author: Olaf Meeuwissen Date: Mon Jul 18 16:14:20 2016 +0900 niash: fix [-Wunused-parameter] compiler warning - + The attribute needs to go before the pointer designation for it to have any effect. @@ -1215,7 +1215,7 @@ Author: Olaf Meeuwissen Date: Mon Jul 18 16:11:39 2016 +0900 dc240: fix [-Wunused-parameter] compiler warning - + The attribute needs to go before the pointer designation for it to have any effect. @@ -1236,7 +1236,7 @@ Author: Olaf Meeuwissen Date: Thu Jul 14 20:50:14 2016 +0900 doc/sane.tex: drop html.sty in favour of url.sty - + The latter is part of the core TeX Live distribution which is readily available on all major operating systems. @@ -1257,7 +1257,7 @@ Author: Olaf Meeuwissen Date: Wed Jul 13 23:40:19 2016 +0900 Generate EPS figures too - + It's good to know how this is done so that we can modify any original figure if need be. @@ -1266,10 +1266,10 @@ Author: Olaf Meeuwissen Date: Wed Jul 13 23:24:29 2016 +0900 Generate PDF figures explicitly with fig2dev - + This utility has less dependencies and supports conversion to a pile of other formats that may come in handy as well. - + Clean up of generated PDF figures has been moved to the clean target as well. @@ -1278,11 +1278,11 @@ Author: Olaf Meeuwissen Date: Wed Jul 13 22:37:44 2016 +0900 doc/sane.tex: Replace epsfig with graphicx - + The graphicx package allows for file specification without a hardcoded extension. This provides more freedom in chosing how to prepare images in *.eps and *.pdf formats. - + Moreover, epsfig is considered mostly obsolete in the TeX community and graphicx is the "current 'preferred' solution" to embed figures. See https://www.ctan.org/pkg/epsfig. @@ -1292,7 +1292,7 @@ Author: Olaf Meeuwissen Date: Mon Jul 11 20:41:54 2016 +0900 Bump standard minor version - + This is to acknowledge the SANE_STATUS_GOOD fixes in net.tex that were committed in 4daf488 and 1100883. @@ -1301,7 +1301,7 @@ Author: Olaf Meeuwissen Date: Mon Jul 11 20:37:08 2016 +0900 Reclassify doc/html.sty - + It is a package used by doc/sane.tex. commit 2481e1e98b02e927cdb9c2e6e404252ef9e49041 @@ -1315,13 +1315,13 @@ Author: Olaf Meeuwissen Date: Sun Jul 10 20:35:04 2016 +0900 Refactor API spec conversion support - + Unless explicitly asked to do without, all formats for which required tools are found will be built. Checks cover PostScript, PDF and HTML. - + All logic and files involved are now collected in a single "section" and grouped in such a way that their function should be clearer. - + fixup! Refactor API spec conversion support commit d7c69d141ffb4f456d659b443aa4c3d3be82793e @@ -1341,7 +1341,7 @@ Author: Olaf Meeuwissen Date: Sun Jul 10 15:41:08 2016 +0900 Add support for PDF API spec output - + Note that pdflatex internally uses epstopdf which in turn requires a working ghostscript. @@ -1374,7 +1374,7 @@ Author: Olaf Meeuwissen Date: Wed Jul 6 20:23:12 2016 +0900 check-po.awk: fix awk invocation - + The awk utility has been moved to /usr/bin and the script relies on features present in gawk but not in mawk. @@ -1401,10 +1401,10 @@ Author: Olaf Meeuwissen Date: Fri Jul 1 23:37:49 2016 +0900 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 @@ -1422,7 +1422,7 @@ Author: Olaf Meeuwissen Date: Thu Jun 30 21:49:25 2016 +0900 Improve test shell builtin invocation portability - + Looks like I missed this when committing 309a8140. commit 828cd013e9a4411158af8816a63b133b6da19ed5 @@ -1430,12 +1430,12 @@ Author: Olaf Meeuwissen Date: Thu Jun 30 21:38:04 2016 +0900 Compile getopt replacement functions only if needed - + This ought to get rid of the last empty compilation unit warnings. This merges libfelib.la with liblib.la. The former was always used together with the latter. The latter was only ever used without the former when linking backends and tools. - + Tools might want to use the getopt functions, backends might just want to use MD5. @@ -1444,7 +1444,7 @@ Author: Olaf Meeuwissen Date: Wed Jun 29 22:21:10 2016 +0900 Sync autofoo - + Looks like the sorting of the DIST_COMMON file list is not stable. commit a298bfe5a8c65236ac13130e891a93bf3cf58976 @@ -1464,7 +1464,7 @@ Author: Olaf Meeuwissen Date: Tue Jun 28 22:42:09 2016 +0900 Compile replacement functions only if needed - + This ought to get rid of most empty compilation warnings. commit 0c2b86ac0b56ee7cb8b962102c54855f05887b08 @@ -1472,10 +1472,10 @@ Author: Olaf Meeuwissen Date: Mon Jun 27 22:33:28 2016 +0900 Fix distcheck issues in tools/ - + Automake is smart enough these days to compile the *.lo files that are used when linking. - + The umax_pp_CPPFLAGS are useless because backend/umax_pp_low.c undefines BACKEND_NAME unconditionally and sets it to what was passed here ;-) @@ -1484,7 +1484,7 @@ Author: Olaf Meeuwissen Date: Mon Jun 27 22:08:20 2016 +0900 Clean up .gitignore file content - + Removes empty lines and duplicates (note that .gitignore patterns are recursive unless anchored with a leading /). @@ -1493,7 +1493,7 @@ Author: Olaf Meeuwissen Date: Mon Jun 27 22:05:50 2016 +0900 Remove references to SANE CVS - + The references in in-file changelogs and the ChangeLog files have not been modified. Only those references that refer to current practices or locations. @@ -1503,7 +1503,7 @@ Author: Olaf Meeuwissen Date: Mon Jun 27 21:51:43 2016 +0900 Sync AUTHORS content with current status - + We've been using git for a while ;-). Also updates the write access info and fixes encoding issues. @@ -1512,7 +1512,7 @@ Author: Olaf Meeuwissen Date: Sun Jun 26 10:22:35 2016 +0900 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. @@ -1522,7 +1522,7 @@ Author: Olaf Meeuwissen Date: Sun Jun 26 10:11:42 2016 +0900 Remove overly zealous ignore patterns - + Text editor backup and temporary files like *~ are a per developer issue, add them to your global .gitignore. Other dot-files should be ignored on a case-by-case basis. @@ -1538,7 +1538,7 @@ Author: Olaf Meeuwissen Date: Sun Jun 26 10:05:12 2016 +0900 Fix sorting of ignore files - + We haven't been using CVS since ... 2009-05-04 :-| commit 0bc7b6aed7e3ac8ee78190f0e795ce9c62c3f36e @@ -1546,7 +1546,7 @@ Author: Olaf Meeuwissen Date: Sun Jun 26 09:16:54 2016 +0900 Sync *.po files with previous changes - + This changes the file/line references in all files (and picks up any new messages as a side effect). @@ -1567,7 +1567,7 @@ Author: Olaf Meeuwissen Date: Sun Jun 26 08:49:14 2016 +0900 Switch to using the gettext build machinery - + This adds two automatically maintained English variants that handle quote substitution in onrder to provide smart quotes. @@ -1576,7 +1576,7 @@ Author: Olaf Meeuwissen Date: Sun Jun 26 08:30:45 2016 +0900 Add gettext build machinery files for I18N/L10N support - + These are courtesy of autopoint and target gettext-0.18.1 because that is the version in Debian 7 (which is what Alioth is running). The one warning this produces on autoreconf is fixed in gettext-0.18.2, BTW. @@ -1586,7 +1586,7 @@ Author: Olaf Meeuwissen Date: Sat Jun 25 15:23:05 2016 +0900 Fix VPATH build issue - + The source *.po files weren't found when you configured outside of the top source directory. @@ -1631,7 +1631,7 @@ Author: Olaf Meeuwissen Date: Wed Jun 15 20:23:33 2016 +0900 Silence overly verbose targets - + This only takes effect with silent rules enabled. commit 43cdc1056af899520797b09f3f78ba64703ed74d @@ -1651,7 +1651,7 @@ Author: Olaf Meeuwissen Date: Tue Jun 14 21:24:53 2016 +0900 Tweak GitLab CI builds - + The idea is to build as much as possible for the *-full flavour build, make compiler warnings stand out and muddle on after errors so that we get all the problems in a single log. @@ -1661,7 +1661,7 @@ Author: Olaf Meeuwissen Date: Tue Jun 14 21:20:48 2016 +0900 Add missing autofoo file - + This should have gone in with d853463e. commit d853463ef1b97082d657a0be32d1b27a04940ea2 @@ -1669,11 +1669,11 @@ Author: Olaf Meeuwissen Date: Tue Jun 14 06:30:48 2016 +0900 Sync derived files - + This was done with - + AUTOMAKE="automake --add-missing --copy" autoreconf --force - + on Debian GNU/Linux 8.5. commit 17d78ab7c326069c3a596f17ded6418ef42930bc @@ -1693,7 +1693,7 @@ Author: Olaf Meeuwissen Date: Thu Feb 11 17:43:14 2016 +0900 Drop Makefile.in from EXTRA_DIST - + Automake is smart enough to include this on its own. commit 7bfa818c57485310994650528124a7036894eb36 @@ -1767,7 +1767,7 @@ Author: Olaf Meeuwissen Date: Sat Jan 9 17:11:19 2016 +0900 Drop a pile of unnecessary macro invocations - + These are already taken care of by other macros. commit ae89c8f98362a4e50d4b1a0ce8f3586b77a81989 @@ -1775,7 +1775,7 @@ Author: Olaf Meeuwissen Date: Sat Jan 9 15:59:35 2016 +0900 Update to automake-1.11.6 - + This turns on additional warnings and adds support for silent make rules (so compiler warning really stand out ;-). @@ -1784,7 +1784,7 @@ Author: Olaf Meeuwissen Date: Mon Jun 13 22:24:21 2016 +0900 Sync derived files with autoreconf --force - + For the record, this was done on Debian GNU/Linux 8.5. commit 309a8140e7285f87d5fc5ee24b942f1713e80be8 @@ -1792,7 +1792,7 @@ Author: Olaf Meeuwissen Date: Wed Oct 28 21:59:42 2015 +0900 Improve test shell builtin invocation portability - + POSIX 2008 obsoletes the -a and -o operands (according to the autoconf documentation). @@ -1801,11 +1801,11 @@ Author: Olaf Meeuwissen Date: Wed Oct 28 20:59:22 2015 +0900 Double quote code passed to AC_LANG_PROGRAM - + Upon re-reading the autoconf documentation, this seemed the right thing to do. The AC_LANG_PROGRAM macro does not quote its arguments so any occurence of [ and ] will get stripped out if not double quoted. - + Current code snippets passed do not use them but it is better to use a consistent quoting approach for such snippets. In other places in the configure.ac file double quoting is used already. @@ -1815,10 +1815,10 @@ Author: Olaf Meeuwissen Date: Thu Oct 22 22:18:19 2015 +0900 Update to autoconf-2.69 - + This gets rid of a number of obsoleted macros and replaces RETSIGTYPE with a void literal which can be assumed for C89 and later. - + This changeset was prepared using autoupdate and modified to get rid of whitespace and doubled [] changes. Changes to acinclude.m4 were added by hand. @@ -1828,12 +1828,12 @@ Author: Olaf Meeuwissen Date: Thu Oct 22 20:15:45 2015 +0900 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. @@ -1843,7 +1843,7 @@ Author: Olaf Meeuwissen Date: Wed Oct 21 22:33:53 2015 +0900 Prefer make variables over literal substitutions - + The AC_SUBST and PKG_CHECK_MODULE invocations in configure.ac as well as acinclude.m4 are sufficient to trigger automake to insert initialization logic for the variables these introduce. There is no need to do this by @@ -1856,7 +1856,7 @@ Author: Olaf Meeuwissen Date: Mon Oct 19 21:52:47 2015 +0900 Fix non-POSIX automake file variable warning - + This addresses warnings about the use of the $(wildcard) function. It has been replaced by a plain shell glob. There is one case where this will result in an error, when there are no matches, but that is @@ -1868,12 +1868,12 @@ Author: Olaf Meeuwissen Date: Mon Oct 19 21:04:53 2015 +0900 Add automake subdir-objects option - + This addresses autoreconf output such as: - + tools/Makefile.am:37: warning: source file '../backend/sane_strstatus.c' is in a subdirectory, tools/Makefile.am:37: but option 'subdir-objects' is disabled - + The option was introduced in automake version 1.9 and is slated for unconditional activation with automake-2.0. @@ -1882,11 +1882,11 @@ Author: Olaf Meeuwissen Date: Mon Oct 19 20:20:56 2015 +0900 Rename configure.in to configure.ac - + This name has been preferred since autoconf-2.52 and automake-1.5. Both were released in the summer of 2001. Support for configure.in is slated for removal in automake-2.0. - + The configure.ac file itself requires autoconf-2.54 or later (and does not care about the automake version). @@ -1907,7 +1907,7 @@ Author: m. allan noah Date: Thu Jun 9 21:51:18 2016 -0400 fujitsu backend v131 - + - hide compression-arg option when jpeg disabled - add Send/SC/GHS macros for recent scanners - add initial support for fi-74x0 @@ -1934,12 +1934,12 @@ Author: Alex Belkin Date: Sat May 7 22:33:03 2016 +0300 Color scanning for Samsung models, which support JPEG Lossy compression. - + Patch is submitted by Laxmeesh Onkar Markod - + Patch to code is applied almost verbatim, except, insignificant formatting fixes and making new functions static. - + Also, new USB ids added and scanner support is changed as reported. commit 1d2a40ec96aea0ba183415efea570301159d4159 @@ -2039,7 +2039,7 @@ Author: m. allan noah Date: Tue Apr 5 20:30:10 2016 -0400 canon_dr backend v55 - + fixed-width scanners were calculating left-side offset incorrectly in color initial support for DR-F120 rename all DUPLEX_INTERLACE_* to indicate start and end of line @@ -2074,18 +2074,18 @@ Date: Fri Mar 4 13:36:08 2016 +0100 pixma_imageclass: software lineart for all imageCLASS, imageRUNNER, i-SENSYS and laserBase scanners, supported by this sub-backend - + imageCLASS scanners: D420, D480, D530, MF810/820, MF3240, MF4010, MF4150, MF4270, MF4320, MF4360, MF4410, MF4570dw, MF4690, MF5630, MF6500, MF8030, MF8170c - + i-SENSYS scanners: MF210, MF220, MF3010, MF4500, MF4700, MF4800, MF5880dn, MF5900, MF6100, MF6680dn, MF8200C, MF8300, MF8500C - + imageRUNNER scanners: iR1133 - + laserBase scanners: MF5650 @@ -2118,7 +2118,7 @@ Author: Stéphane Voltz Date: Thu Mar 3 21:39:25 2016 +0100 use rewind instead of slow_back_home - + - if required by flags, do a rewind instead a slow_back_home that pollutes shading settings @@ -2157,7 +2157,7 @@ Author: Rolf Bensch Date: Thu Mar 3 13:36:44 2016 +0100 pixma: new global parameter to set duration of receive timeout loop - + The default value for receive timeout loop duration has not been changed. The loop still takes 8 seconds if a timeout occurs. @@ -2172,7 +2172,7 @@ Author: Stéphane Voltz Date: Sun Feb 28 12:26:12 2016 +0100 motor table fixes - + - add target speed for 600 dpi gray - add slope table for 4800/2400 dpi, gray and color @@ -2223,7 +2223,7 @@ Author: Stéphane Voltz Date: Wed Feb 24 06:17:50 2016 +0100 make 600 dpi mode work for LiDE 120 - + - add override for registers 0x16 and 0x70 since 120's sensor is set differently according to resolution @@ -2238,7 +2238,7 @@ Author: m. allan noah Date: Tue Feb 23 21:07:06 2016 -0500 fujitsu backend v130 - + run init_model before init_ms so some scanners can override set all M309x and M409x scanners s->broken_diag_serial = 1 @@ -2253,7 +2253,7 @@ Author: m. allan noah Date: Tue Feb 23 20:36:32 2016 -0500 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 014b45d920f1fb630e1a31bb01f1da02ea2a6a87. The default is @@ -2266,7 +2266,7 @@ Author: Stéphane Voltz Date: Tue Feb 23 21:39:22 2016 +0100 LiDE 120 working [75-300] dpi - + - fix sensor pixel number - enable calibration - default to 16 pixel DUMMY @@ -2360,7 +2360,7 @@ Author: Rolf Bensch Date: Wed Feb 17 20:59:32 2016 +0100 pixma_imageclass: fix for failed first usb command (timeout) - + Sometimes the first usb command to the scanner fails after a previous scan. A workaround was to reconnect the usb cable. This fix simply resends the failed command. @@ -2370,7 +2370,7 @@ Author: Rolf Bensch Date: Wed Feb 17 20:55:49 2016 +0100 pixma_imageclass: fixes for MF6100 Series - + - special ADF settings - the MF6100 Series is a Generation 2+ scanner, but uses the old read image command @@ -2397,7 +2397,7 @@ Author: Olaf Meeuwissen Date: Sat Feb 13 17:34:46 2016 +0900 Move #include to sanei_thread.h - + The sanei header file may need pthread_t. If it does, make sure it is available. @@ -2406,7 +2406,7 @@ Author: Rolf Bensch Date: Thu Feb 11 12:06:34 2016 +0100 pixma: Canon Pixma MG3600 Series is working - + Reported by Rajib Bandopadhyay commit 7bd773ade5ff1bc4170d2a1773428efe759aaa75 @@ -2450,7 +2450,7 @@ Author: Rolf Bensch Date: Fri Jan 8 18:34:27 2016 +0100 pixma: Canon PIXMA MG5700 Series is working - + Reported by Andrew Reginato, bug #315244 commit 0f47b47b759908e7b11800404d269087d60d87ad @@ -2458,10 +2458,10 @@ Author: Rolf Bensch Date: Fri Jan 8 17:32:36 2016 +0100 pixma_mp[150|810]: disable send_time() - + The function send_time() makes trouble with a lot of scanners. We send a warning to the debug output instead of sending the time. - + fix for [#315248] Canon MP250 with pixma backend is not working commit b040b150a08b0b5394ad3bc91a45966d97f58152 @@ -2469,7 +2469,7 @@ Author: Rolf Bensch Date: Fri Jan 8 16:54:30 2016 +0100 pixma: fix for [#315244] Add support for Canon PIXMA MG5700, MG6800, MG6900 and MG7700 - + These scanners are new and need further testing! commit 81c429082c3c139f8616de4a73733953cd5aa33f @@ -2483,7 +2483,7 @@ Author: Olaf Meeuwissen Date: Fri Jan 8 21:26:31 2016 +0900 md5: Avoid the need for casting - + This also modifies the code slightly to follow the original array access more closely. @@ -2492,9 +2492,9 @@ Author: Volker Diels-Grabsch Date: Sun Dec 6 01:23:51 2015 +0100 Introduce md5_set_uint32 - + This fixes the following GCC warning: - + warning: dereferencing type-punned pointer will break strict-aliasing rules commit f3471c2ca6ea22846dd6619aff7913610722a6c0 @@ -2502,7 +2502,7 @@ Author: Olaf Meeuwissen Date: Sat Jan 2 17:50:34 2016 +0900 saned: Use system header IPv6 test macros if available - + This should fix [-Wstrict-aliasing] compiler warnings on those systems where the IN6_IS_ADDR_LOOPBACK and IN6_IS_ADDR_V4MAPPED macros exist. POSIX.1-2001 states that they shall be defined in netinit/in.h so most @@ -2513,7 +2513,7 @@ Author: Olaf Meeuwissen Date: Sat Jan 2 16:06:34 2016 +0900 umax_pp: fix memory leak - + Found courtesy of [-Wunused-but-set-variable] compiler warning. commit 9d78ace3b7e60afa2b3cb829ac23e5f8b4ccdc07 @@ -2539,7 +2539,7 @@ Author: Olaf Meeuwissen Date: Thu Dec 31 17:43:25 2015 +0900 kodakaio: fix [-Wformat=] compiler warnings - + This uses the ANSI C approach that is used in a lot of existing code rather than what ISO C99 allows for consistency. @@ -2626,7 +2626,7 @@ Author: Olaf Meeuwissen Date: Wed Dec 23 22:17:40 2015 +0900 microtek2: fix another [-Wunused-but-set-variable] compiler warning - + This allows for the fact that the backend may be compiled with and without support for authorization. @@ -2641,7 +2641,7 @@ Author: Olaf Meeuwissen Date: Sat Dec 26 17:41:09 2015 +0900 magicolor: fix [-Wunused-function] compiler warning - + This function is only used when SNMP support is activated. commit 292dd42bb6585e2801623d1f33497581626d9d72 @@ -2661,7 +2661,7 @@ Author: Olaf Meeuwissen Date: Sat Dec 26 17:36:57 2015 +0900 lexmark: fix [-Wmaybe-uninitialized] compiler warning - + This adds a default handler to switch statement so low_get_start_loc() bails before the start_600 variable is used. @@ -2670,7 +2670,7 @@ Author: Olaf Meeuwissen Date: Sat Dec 26 17:28:34 2015 +0900 kodakaio: fix [-Wunused-function] compiler warning - + The function is only used when Avahi support is enabled and has been put in a suitable compilation scope. @@ -2769,7 +2769,7 @@ Author: Olaf Meeuwissen Date: Wed Dec 23 20:30:02 2015 +0900 avision: fix [-Wunused-but-set-variable] compiler warning - + The variable seems to have been superseded by conv_out_size in the else branch of set_calib_data(). @@ -2778,7 +2778,7 @@ Author: Olaf Meeuwissen Date: Wed Dec 23 20:27:20 2015 +0900 artec_eplus48u: fix [-Wunused-but-set-variable] compiler warning - + This leaves the sane_close() implementation just as broken as it has been from the initial commit sometime in 2002. @@ -2787,7 +2787,7 @@ Author: Olaf Meeuwissen Date: Wed Dec 23 20:26:21 2015 +0900 artec_eplus48u: fix [-Wunused-but-set-variable] compiler warning - + The variable was only used to silence a [-Wunused-parameter] warning. commit 5b21a24312f2cf2ced5d5c70b0f7d2c1f0c58f35 @@ -2795,7 +2795,7 @@ Author: Olaf Meeuwissen Date: Wed Dec 23 19:57:13 2015 +0900 artec: fix [-Wunused-but-set-variable] compiler warning - + The variable is used to assign return values but is not referenced by anything itself. @@ -2810,7 +2810,7 @@ Author: Olaf Meeuwissen Date: Wed Dec 23 18:53:06 2015 +0900 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. @@ -2819,7 +2819,7 @@ Author: Olaf Meeuwissen Date: Sat Dec 26 17:05:17 2015 +0900 sanei_usb: Move variable declarations to scope of usage - + Fixes an [-Wunused-variable] when compiling without libusb. commit 0d7882e34b5f5625261258a3a341a58a04beb304 @@ -2827,11 +2827,11 @@ Author: Olaf Meeuwissen Date: Sat Dec 26 16:51:44 2015 +0900 Change compile time warning policy - + The -Wall flag is now always enabled (when using gcc). The -Wextra flag (previously known as -W) and -pedantic flags are, by default, enabled during development but disabled for releases. - + All other flags have been removed. commit 5136e664b8608604f54a2cc1d466019922b311e6 @@ -2845,9 +2845,9 @@ Author: Olaf Meeuwissen Date: Sun Dec 20 17:33:55 2015 +0900 Improve readability of condition - + This also fixes the following GCC warning: - + warning: logical not is only applied to the left hand side of comparison commit 58052a7ce6b205e25a2fc85f31158595cad00258 @@ -2855,11 +2855,11 @@ Author: Volker Diels-Grabsch Date: Sat Dec 5 21:33:48 2015 +0100 Change GCC mode from ISO C90 to ISO C99 - + Add GCC flag "-std=c99". Also remove GCC flag "-ansi" which is an alias for "-std=c90" and would make the flag "-std=c99" ineffective. This fixes all occurrences of the following GCC warning: - + warning: ISO C90 does not support '__func__' predefined identifier commit baec5e039504de390cae41557b0b8323343721c3 @@ -2867,11 +2867,11 @@ Author: Volker Diels-Grabsch Date: Sat Dec 5 10:48:59 2015 +0100 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 commit 93298674d02b1127efdf4e726e92e797a0081c9e @@ -2879,7 +2879,7 @@ Author: Volker Diels-Grabsch Date: Sat Dec 5 20:44:14 2015 +0100 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 @@ -2890,9 +2890,9 @@ Author: Volker Diels-Grabsch Date: Sun Dec 6 03:32:51 2015 +0100 Remove dead code due to unused variables - + This fixes some occurrences of the following GCC warning: - + warning: variable '...' set but not used commit aba87a4582d594cf953b4bda5b5d42e37e13f21c @@ -2900,9 +2900,9 @@ Author: Volker Diels-Grabsch Date: Sun Dec 6 01:30:30 2015 +0100 Mark internal function toupper_ascii as static - + This fixes the following GCC warning: - + warning: no previous prototype for 'toupper_ascii' commit 13b6faee2a0696eb02a61f22121b7f4854987f2e @@ -2910,9 +2910,9 @@ Author: Volker Diels-Grabsch Date: Sun Dec 6 03:03:06 2015 +0100 Fix interface of helper function write_many - + This fixes two occurrences of the following GCC warning: - + warning: cast discards 'const' qualifier from pointer target type commit badd7025b21b2207cfb95001aeb324597e24b301 @@ -2920,10 +2920,10 @@ Author: Volker Diels-Grabsch Date: Sun Dec 6 02:37:10 2015 +0100 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 commit 6aced758f4a95fd858906f3e898ee967a9718641 @@ -2931,7 +2931,7 @@ Author: Volker Diels-Grabsch Date: Sun Nov 29 16:02:01 2015 +0100 Fix typos in comments - + While reading through the SANE sources I noticed some annoying typos in the comments. This patch is my contribution to make the SANE sources slightly more pleasant to read. @@ -2953,7 +2953,7 @@ Author: Stéphane Voltz Date: Tue Dec 15 06:05:07 2015 +0100 fix for #315050 - + - handle case where linesel is rounded to 0 when scan y resolution is below minimal scan resolution but higher than half of the minimum @@ -2962,7 +2962,7 @@ Author: m. allan noah Date: Sat Nov 28 08:34:58 2015 -0500 canon_dr desc update - + add note about mode switch on P-208 commit f1593204c72124f3077b0b29f3c128d30be415b5 @@ -2970,7 +2970,7 @@ Author: Olaf Meeuwissen Date: Fri Nov 27 21:26:46 2015 +0900 Drop execute permission - + Source code, description files and configuration templates should never need to be executed. @@ -2979,7 +2979,7 @@ Author: Olaf Meeuwissen Date: Fri Nov 13 22:06:30 2015 +0900 Invert sense of sanei_thread validity check - + Double negatives suck. commit fe12d31e6873f5c3de330f1de4c4fbc851df1e9f @@ -2987,7 +2987,7 @@ Author: Olaf Meeuwissen Date: Fri Nov 13 21:41:56 2015 +0900 Fix SANE_Pid related -Wsign-compare warnings - + This may fix threading related issues on WIN32 platforms, BTW. commit ed59056d40a143b3cf9243ea0068448a88ce3108 @@ -2995,7 +2995,7 @@ Author: m. allan noah Date: Mon Nov 23 21:26:09 2015 -0500 canon_dr backend v54 - + - br_x and br_y locked to page_width/height until changed commit d0ea697ab83360bf0ccddcd02565f85ea0f96b50 @@ -3003,7 +3003,7 @@ Author: m. allan noah Date: Mon Nov 23 21:08:30 2015 -0500 fujitsu backend v129 - + - br_x and br_y locked to page_width/height until changed - add USB ID's for fi-6xxxLA and fi-6xxxZLA scanners - add USB ID's for unsupported SP11xx scanners (genesys based) @@ -3013,7 +3013,7 @@ Author: m. allan noah Date: Thu Nov 12 21:10:49 2015 -0500 revert mustek_usb2 backend upgrade - + Instead of 100+ revert commits, I've lumped everything into a single commit. This removes all of dedf0ac30 through db7f038f1, plus the parts of 497d59180 which were specific to mustek_usb2 @@ -3035,7 +3035,7 @@ Author: Olaf Meeuwissen Date: Wed Nov 11 22:35:34 2015 +0900 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. @@ -3045,7 +3045,7 @@ Author: Olaf Meeuwissen Date: Wed Nov 11 22:33:34 2015 +0900 Fix "discards 'const' qualifier from pointer target type" warning - + The device2 variable is not modified so let's make that clear. commit d2576bbb948dd9d8e06f66dc4cede774c5518751 @@ -3053,7 +3053,7 @@ Author: Olaf Meeuwissen Date: Wed Nov 11 22:30:10 2015 +0900 Fix "discards 'const' qualifier from pointer target type" warnings - + The cs3_xfree() functions is really just a checked call to free() so its signature has been changed to match that. The warnings that causes have been fixed in the same way and on the same grounds as the previous commit. @@ -3063,7 +3063,7 @@ Author: Olaf Meeuwissen Date: Wed Nov 11 22:28:17 2015 +0900 Fix "discards 'const' qualifier from pointer target type" warnings - + The resources pointed to have been acquired by the backend. It is safe to cast away the 'const' qualifier when releasing these resources. @@ -3072,7 +3072,7 @@ Author: m. allan noah Date: Sun Nov 8 17:17:37 2015 -0500 automake for recent changes - + updates to mustek_usb2, canon_dr and umax_pp require automake run commit db7f038f108ca12966b947dd80f3772e2133495e @@ -3176,7 +3176,7 @@ Author: Jan Hauffa Date: Sat May 7 13:28:52 2011 +0200 Remove restriction to 8-bit color in negative mode. - + The only reason for that restriction was that the histogram stretching code, which has been removed earlier, could only handle 8-bit color. commit 4ced7a900a6463c460121eaed7583f4249ef74c2 @@ -3226,7 +3226,7 @@ Author: Jan Hauffa Date: Sun Apr 24 20:21:41 2011 +0200 Introduce support for multiple scanners. - + Keep all state local and ensure that all resources are freed by sane_exit. Ensure that each function returns only those error codes that are valid according to the SANE standard. commit 6865eaf6edef0cc5ea30bcc0d72b52189132f4d6 @@ -3336,7 +3336,7 @@ Author: Jan Hauffa Date: Wed Apr 20 23:10:53 2011 +0200 Extensive changes to reduce the amount of global variables in mustek_usb2_high.c. - + Might have made MustScanner_SetupScan less readable, though. commit 9444bf1156f0ab52937d101ba6120ae8685b645b @@ -3830,7 +3830,7 @@ Author: m. allan noah Date: Sun Nov 8 09:24:37 2015 -0500 fujitsu backend v128 - + do not ask fi-4340 for serial number commit 72ecee97ce9db13f148aedf52eb46911212d58e4 @@ -3850,7 +3850,7 @@ Author: Olaf Meeuwissen Date: Sun Nov 8 18:49:58 2015 +0900 Add missing include (fixes 315207) - + Both Linux and NetBSD mention this header for use of setsocketopt(). DragonFly BSD needs it for the SOL_SOCKET symbol. @@ -3865,7 +3865,7 @@ Author: Olaf Meeuwissen Date: Sun Nov 8 18:16:17 2015 +0900 Fix sane-desc testsuite logic - + This fixes test failures for release tarballs (pointed out by Mike Frysinger), clamps down on wildcards and prints a failure message when a test does not succeed. @@ -3875,7 +3875,7 @@ Author: m. allan noah Date: Fri Nov 6 21:39:35 2015 -0500 canon_dr v53 continued - + reorder geometry group options use bg_color to fill missing image data @@ -3884,7 +3884,7 @@ Author: m. allan noah Date: Fri Nov 6 12:19:20 2015 -0500 canon_dr backend v53 - + add swskip option commit b4bc0eb518ce74ffbfdbe0ce1a14bb404804cd57 @@ -3892,7 +3892,7 @@ Author: m. allan noah Date: Fri Nov 6 11:46:17 2015 -0500 canon_dr backend v53 - + replace image processing methods with sanei_magic commit 666c9a74ff26fd530b40db28f03b447209cf419e @@ -3900,7 +3900,7 @@ Author: m. allan noah Date: Thu Nov 5 21:42:29 2015 -0500 canon_dr backend v52 - + improve dropout option handling add software dropout implementation for downsampled modes @@ -3909,7 +3909,7 @@ Author: m. allan noah Date: Wed Nov 4 13:49:02 2015 -0500 canon_dr backend v52 - + add must_downsample and must_fully_buffer commit 01063a769d5431ca83069a9cf240894f893d01f0 @@ -3917,7 +3917,7 @@ Author: m. allan noah Date: Wed Nov 4 13:05:05 2015 -0500 canon_dr backend v52 - + set can_color=1 by default (recent models dont have 'C' in name) enable jpeg for DR-6080 @@ -3926,7 +3926,7 @@ Author: m. allan noah Date: Wed Nov 4 13:00:10 2015 -0500 cardscan backend v3 - + add USB IDs for newer model 800c commit 33495ef9b42a783c8f5f2c056ac5699481d3cc7e @@ -3946,11 +3946,11 @@ Author: Olaf Meeuwissen Date: Mon Oct 19 20:51:04 2015 +0900 Drop unused INCLUDES substitution variable - + This addresses the following autoreconf output: - + configure.ac:85: warning: 'INCLUDES' is the old name for 'AM_CPPFLAGS' (or '*_CPPFLAGS') - + The INCLUDES variable is not referenced anywhere in configure.ac or configure. In addition, none of the Makefile.am files use it. @@ -3959,7 +3959,7 @@ Author: Olaf Meeuwissen Date: Mon Oct 19 21:11:53 2015 +0900 Fix duplicate automake file variable initialization issue - + This was introduced in 74c00494. commit f8d35b8d2fdcacc9b664594d141102c2c80ac076 @@ -3967,7 +3967,7 @@ Author: m. allan noah Date: Mon Oct 26 08:34:17 2015 -0400 Update canon_dr.desc - + We had a few scanners that were reported by email or in tracker tickets, which had not been updated in the desc file. @@ -4012,9 +4012,9 @@ Author: Olaf Meeuwissen Date: Tue Oct 13 23:32:40 2015 +0900 Revert "Prevent use of uninitialized variable" - + This change introduces a variable that shadows the file scope one. - + This reverts commit 45e66aee952dcdada88293901580a111262fc1e9. commit 36876a83663832cf89fa945737d004ce9b46fb01 @@ -4040,7 +4040,7 @@ Author: Olaf Meeuwissen Date: Mon Oct 12 20:49:07 2015 +0900 Follow getopt_long usage in scanimage.c - + This is on the off chance that getopt_long is not in the system's standard library. @@ -4061,7 +4061,7 @@ Author: Matteo Croce Date: Sun Oct 11 19:50:03 2015 +0200 saned: use getopt_long() for option parsing - + The help message has been adjusted to match getopt_long conventions. commit 418d1ecea7571d10acd08df2edc7967a91e14b0d @@ -4075,7 +4075,7 @@ Author: Matteo Croce Date: Sun Sep 20 19:55:36 2015 +0200 saned: parse inetd args in main() - + move argument parsing logic from run_inetd() to main() commit 2c3cb206ce55a7ac9ff9b479de452a332ba2aa1a @@ -4083,7 +4083,7 @@ Author: Matteo Croce Date: Sun Sep 20 19:55:35 2015 +0200 saned: parse standalone args in main() - + move argument parsing logic from run_standalone() to main() commit 2239d2aaff16964a5d67293f5e4220d235e2c84d diff --git a/ChangeLogs/ChangeLog-1.0.3 b/ChangeLogs/ChangeLog-1.0.3 index dad5f74ca..56e1e79dc 100644 --- a/ChangeLogs/ChangeLog-1.0.3 +++ b/ChangeLogs/ChangeLog-1.0.3 @@ -7,40 +7,40 @@ * changed tools/sane-desc.el sane.gif->sane.png 2000-08-10 Henning Meier-Geinitz - * backend/avision.c: Changed // comment to /* */. This broke + * backend/avision.c: Changed // comment to /* */. This broke compilation on AIX cc, Irix cc and Sun cc. - + 2000-08-10 Rene Rebe * backend/avision.h: some updates + cleanups * backend/avision.c: use of DB () and sane_config_read () general cleanups (sorry for the big commit - I used Emacs auto-ident for some regions ...) - + 2000-08-07 Henning Meier-Geinitz - + * README.irix: Removed text about library version problems. * README.linux: Added comment about idescsi problems. * ltmain.sh: Changed Irix library version system (from Oliver Rauch). This should fix the library version problems under Irix. * backend/Makefile.in: Added all files in lib/ to LIBLIB. This fixes a bug concerning linking with external frontends. - + 2000-08-06 Henning Meier-Geinitz - + * backend/plustek.c: Removed "const" from function header. This fixes a compilation problem on aix/cc. * configure configure.in: Additional warnings are now disabled by default for the 1.0.3 realease. 2000-08-06 Henning Meier-Geinitz - + * backend/hp4200.desc: Added description file for HP 4200 USB scanner. 2000-08-05 Henning Meier-Geinitz * AUTHORS: Added link to PROJECTS. - * PROJECTS: Removed frontends that are included in the SANE + * PROJECTS: Removed frontends that are included in the SANE distribution. Added frontends: sanecgi, scanadf. Removed backends Kodak DS-20 (old camera, no specs available, not interested anymore), Logitech (old handscanner, author not interested anymore). Added @@ -78,24 +78,24 @@ 2000-07-31 Henning Meier-Geinitz * backend/mustek.*: Update to Mustek backend 1.0-96. Fixed Problem with detecting some three-pass scanners. - + 2000-07-31 Henning Meier-Geinitz * doc/sane.tex: Chapter 4 said, that this was standard version 0 (draft). Changed to 1 and removed "(draft)". - + 2000-07-31 Henning Meier-Geinitz * sanei/sanei_DomainOS.c sanei/sanei_ab306.c sanei/sanei_codec_ascii.c sanei/sanei_codec_bin.c sanei/sanei_config.c sanei/sanei_config2.c - sanei/sanei_constrain_value.c sanei/sanei_init_debug.c + sanei/sanei_constrain_value.c sanei/sanei_init_debug.c sanei/sanei_load_values.c sanei/sanei_net.c sanei/sanei_pa4s2.c sanei/sanei_pio.c sanei/sanei_save_values.c sanei/sanei_scsi.c - sanei/sanei_thread.c sanei/sanei_wire.c sanei/test_wire.c: Changed + sanei/sanei_thread.c sanei/sanei_wire.c sanei/test_wire.c: Changed include statements from #include to #include "sane...". * PROBLEMS: Updated Mustek entry. * TODO: Updated some entries that are done. * backend/avision.c backend/plustek.c: Changed include statements from #include to #include "sane...". - + 2000-07-30 Peter Kirchgessner * backend/hp.desc: Change Parallel to Parport in description @@ -104,22 +104,22 @@ * changed all to "config.h" in lib/*.c 2000-07-30 Henning Meier-Geinitz - + * backend/mustek.*: Update to Mustek backend 1.0-95. Changed from wait() to waitpid() and removed unused code. * configure configure.in backend/m3096g.c backend/sp15c.c: Reverted the V_REV patch. V_REV should not be used in backends. 2000-07-30 Henning Meier-Geinitz - - * configure configure.in: Add V_REV to CPPFLAGS (only V_MAJOR and + + * configure configure.in: Add V_REV to CPPFLAGS (only V_MAJOR and V_MINOR were defined until now). * doc/.cvsignore: Added sane-coolscan.5. 2000-07-29 Henning Meier-Geinitz - - * backend/sp15c.c backend/m3096g.c: Replace fgets with - sanei_config_read, return V_REV as part of version_code string + + * backend/sp15c.c backend/m3096g.c: Replace fgets with + sanei_config_read, return V_REV as part of version_code string (patch from Randolph Bentson). 2000-07-29 Chris Pinkham @@ -131,14 +131,14 @@ * backend/GUIDE: Added some comments about portability and documentation. - * backend/abaton.c backend/agfafocus.c backend/apple.c + * backend/abaton.c backend/agfafocus.c backend/apple.c backend/canon.c backend/coolscan.c backend/dc210.c backend/dc25.c backend/dll.c backend/dmc.c backend/microtek.c backend/microtek2.c backend/microtek2.c backend/mustek_pp.c backend/net.c backend/pint.c backend/pnm.c backend/qcam.c backend/ricoh.c backend/s9036.c - backend/sane_strstatus.c backend/sharp.c backend/snapscan.c + backend/sane_strstatus.c backend/sharp.c backend/snapscan.c backend/st400.c backend/stubs.c backend/tamarack.c backend/v4l.c: - Changed include statements from #include to + Changed include statements from #include to #include "sane...". * backend/avision.c backend/dc25.c: Use DBG(0, ...) instead of fprintf (stderr, ...) @@ -154,7 +154,7 @@ * README: Added Link to coolscan manpage. * backend/mustek.*: Update to Mustek backend 1.0-94. Fixed the #include bug. - + 2000-07-29 Karl Heinz Kremer * backend/epson.c: Changed the include statements for SANE includes @@ -183,9 +183,9 @@ backend/snapscan.desc backend/canon.desc backend/.cvsignore: Added manpage for canon and snapscan backends. Added :interface entry for canon. - * backend/canon-sane.c: Fixed possible segfault in + * backend/canon-sane.c: Fixed possible segfault in sane_control_option() when info is 0. - + 2000-07-22 Petter Reinholdtsen * backend/v4l.c: Bugfix: Avoid crashing in @@ -213,18 +213,18 @@ man sane-scsi 2000-07-25 Henning Meier-Geinitz - - * backend/snapscan.c: Use DBG(0, ...) instead of fprintf (stderr, ...) + + * backend/snapscan.c: Use DBG(0, ...) instead of fprintf (stderr, ...) * backend/abaton.c backend/agfafocus.c backend/apple.c backend/dc210.c backend/dll.c backend/dmc.c backend/microtek2.c backend/pint.c backend/qcam.c backend/ricoh.c backend/s9036.c backend/snapscan.c backend/tamarack.c: Use sanei_config_read instead of fgets. - * backend/dc210.c backend/microtek.c backend/pnm.c: Added + * backend/dc210.c backend/microtek.c backend/pnm.c: Added #include . * backend/dc25.c backend/m3096.c backend/m3096g.c backend/sp15.c backend/st400.c: Moved #include to the beginning. * AUTHORS: Changed agfa to agfafocus. - + 2000-07-25 Peter Kirchgessner * backend/hp.c hp-scl.c hp-option.c hp-handle.c hp-accessor.c @@ -232,14 +232,14 @@ 2000-07-25 Henning Meier-Geinitz - * configure.in configure include/sane/config.h.in + * configure.in configure include/sane/config.h.in include/sane/sanei_backend.h: Moved test for u_int* to configure. * include/sane/sanei_debug.h: Remove #warning (Irix compiler doesn't like this) * backend/mustek.* doc/sane-mustek.man: Update to Mustek backend - 1.0-92. Changed linedistance correction for MFS-8000SP. Fixed + 1.0-92. Changed linedistance correction for MFS-8000SP. Fixed margin positions and removed warning for MFS 6000CX. Warning is - printed in debug level 0 again. Removed test for gamma length. + printed in debug level 0 again. Removed test for gamma length. Fixed (partly) ADF handling. Man page update. More details in mustek.CHANGES. * NEWS: updated for new Mustek backend version. @@ -251,12 +251,12 @@ 2000-07-20 Abel Deuring * backend/sharp.c: removed fgets-call + minor bugfix * backend/sharp.desc: added entry ":manpage" - * sanei/sanei_scsi.c: added missing dummy function + * sanei/sanei_scsi.c: added missing dummy function sanei_scsi_req_flush_all_extended 2000-07-18 Henning Meier-Geinitz - - * configure.in configure: Fixed --enable-warnings to work as + + * configure.in configure: Fixed --enable-warnings to work as advertised. 2000-07-18 Petter Reinholdtsen @@ -268,16 +268,16 @@ vsyslog(). Implement replacement functions. 2000-07-17 Henning Meier-Geinitz - - * backend/snapscan.c backend/snapscan-scsi.c: Replace C++ comment + + * backend/snapscan.c backend/snapscan-scsi.c: Replace C++ comment with C comment. 2000-07-17 Henning Meier-Geinitz - + * include/sane/sanei_backend.h: Replace C++ comment with C comment. - + 2000-07-17 Henning Meier-Geinitz - + * backend/musteka4s2.desc: Removed. Now that the mustek_pp backend is part of SANE musteka4s2 is no longer neccessary. If somebody really wants to use the old musteka4s2 sources @@ -298,12 +298,12 @@ * backend/epson.desc: updated version number 2000-07-15 Henning Meier-Geinitz - + * backend/dc210.c: Replaced fprintf (stderr, ...) by DBG (). 2000-07-15 Henning Meier-Geinitz - - * doc/Makefile.in doc/sane-dc210.man doc/sane-v4l.man + + * doc/Makefile.in doc/sane-dc210.man doc/sane-v4l.man doc/.cvsignore: Added manpages for dc210 and v4l. These are just standard manpages. Please check and update them. @@ -313,7 +313,7 @@ * backend/mustek.* doc/sane-mustek.man: Update to Mustek backend 1.0-90. Fixed linedistance-handling for Paragon 8000SP. Fixed - mustek.conf port entry. Updated man page (parallel port + mustek.conf port entry. Updated man page (parallel port scanners and 600 II N). * NEWS: Updated (mustek backend version 1.0-90) @@ -323,11 +323,11 @@ * doc/.cvsignore: added sane-mustek_pp.5, sane-plustek.5 and sane-st400.5 - + 2000-07-15 Andreas Rick - * backend/coolscan.c: added missing initialization in - coolscan_read_data_block() + * backend/coolscan.c: added missing initialization in + coolscan_read_data_block() 2000-07-13 Petter Reinholdtsen @@ -358,7 +358,7 @@ * frontend/scanimage.c, doc/scanimage.man: Support for environment variable SANE_DEFAULT_DEVICE. - + 2000-07-11 Ingo Wilken * backend/st400.c, backend/st400.conf, backend/st400.h, @@ -366,7 +366,7 @@ * backend/st400.desc: updated information * README, backend/Makefile.in, doc/Makefile.in: added st400 backend * AUTHORS: added myself as maintainer of st400 backend - + 2000-07-09 Peter Kirchgessner * doc/sane-hp.man: Updated manual page (scantype --> scan source) @@ -394,10 +394,10 @@ * backend/plustek.desc: updated description - * backend/plustek.c backend/plustek.h backend/plustek-share.h - backend/plustek.conf: added Plustek backend code + * backend/plustek.c backend/plustek.h backend/plustek-share.h + backend/plustek.conf: added Plustek backend code - * backend/Makefile.in doc/Makefile.in backend/dll.conf: + * backend/Makefile.in doc/Makefile.in backend/dll.conf: added plustek entries * doc/sane-plustek.man: added manpage for Plustek backend @@ -442,7 +442,7 @@ 2000-06-30 Henning Meier-Geinitz - * backend/mustek.* Update to Mustek backend 1.0-89. Fixed "scan + * backend/mustek.* Update to Mustek backend 1.0-89. Fixed "scan slider doesn't return to start" bug. Details in backend/mustek.CHANGES. @@ -463,12 +463,12 @@ * backend/sp15.desc backend/dc25.desc backend/m3096g.desc: Added :interface entries. - + 2000-06-28 Oliver Rauch * Updated umax backend to version 1.0.21 take a look at backend/umax.CHANGES for details - updated umax.desc, umax manpage - + 2000-06-28 Abel Deuring * backend/sharp.esc: added "interface" entries @@ -486,31 +486,31 @@ Abel Deuring) 2000-06-26 Henning Meier-Geinitz - + * backend/musteka4s2.desc: Added all more scanners and :interface entries * backend/sagitta.desc: Removed on behalf of the author. Nobody has showed interest in this very old (and rare) scanner over the years. It's difficult to keep it up-to-date because a kernel - module is neccessary. Nobody volunteered to take over + module is neccessary. Nobody volunteered to take over maintainership. * backend/tamarack.c: Changed all fprintf to DBG calls. - + 2000-06-26 Abel Deuring - * sanei/sanei_scsi.c and include/sanei/sanei_scsi.h: - new functions sanei_scsi_cmd2 and sanei_scsi_req_enter2 + * sanei/sanei_scsi.c and include/sanei/sanei_scsi.h: + new functions sanei_scsi_cmd2 and sanei_scsi_req_enter2 for proper handling of "unusual" SCSI commands lengths * backend/canon-scsi.c: call sanei_scsi_cmd2, where necessary 2000-06-25 René Rebe * backend/avision.c: fixed sane_close () bug * backend/avision.desc: added some more scanners - + 2000-06-25 Henning Meier-Geinitz * backend/mustek.* doc/sane-mustek.man: Update to Mustek backend 1.0-87. Fixed gamma correction for 1200 A3 Pro. Fixed dependancy - of mustek.h on sane-backends.h. Fixed debug output bug in + of mustek.h on sane-backends.h. Fixed debug output bug in fix_linedistance_se. Updated documentation and mustek.conf. * README: Added v4l and fixed typo. @@ -521,7 +521,7 @@ 2000-06-25 Henning Meier-Geinitz - * doc/Makefile.in doc/sane-s9036.man doc/sane-tamarack.man + * doc/Makefile.in doc/sane-s9036.man doc/sane-tamarack.man doc/sane-ricoh.man doc/sane-avision.man doc/xcam.man .cvsignore: Added manpages for these backends and xcam. @@ -559,27 +559,27 @@ 2000-06-22 Henning Meier-Geinitz - * include/sane/sanei_pa4s2.h sanei/sanei_pa4s2.c Makefile.in + * include/sane/sanei_pa4s2.h sanei/sanei_pa4s2.c Makefile.in backend/Makefile.in sanei/Makefile.in: Added interface for - Mustek parallel port scanners (from Jochen Eisinger + Mustek parallel port scanners (from Jochen Eisinger ). This will be used by the Mustek parallel port backend mustek_pp (coming soon). * tools/sane-desc.el backend/template.desc.: Added support for - "interface" column in sane-desc.el. The new keyword is + "interface" column in sane-desc.el. The new keyword is ":interface", examples in "template.desc.". All maintainers should update their *.desc files. - * backend/mustek.desc abaton.desc agfafocus.desc apple.desc + * backend/mustek.desc abaton.desc agfafocus.desc apple.desc dc210.desc dmc.desc qcam.desc ricoh.desc s9036.desc snapscan.desc - tamarack.desc: added interface entry for the Mustek and + tamarack.desc: added interface entry for the Mustek and unmaintained backends. * backend/abaton.c apple.c qcam.c tamarack.c: fixed sane_close () bug for the unmaintained backends. - + 2000-06-18 Henning Meier-Geinitz - + * backend/mustek.* doc/sane-mustek.man: Update to Mustek backend 1.0-86. Added support for Mustek Paragon 1200 A3 pro (1, 8, and 24 bit/pixel; calibration doesn't work yet). Removed some remainings @@ -597,11 +597,11 @@ handling. 2000-05-21 Henning Meier-Geinitz - + * backend/mustek.*: Update to Mustek backend 1.0-85. Added double buffering. This may improve scan performance a bit. Removed - dead code (in dev_read_start). Changed linedistance correction - handling. Paragon 12000 SP color mode might work now with all + dead code (in dev_read_start). Changed linedistance correction + handling. Paragon 12000 SP color mode might work now with all firmware versions. Details in backend/mustek.CHANGES. 2000-05-27 Karl Heinz Kremer @@ -619,14 +619,14 @@ 2000-05-21 Henning Meier-Geinitz * README: Added quick install. Removed list of supported platforms - because it is unknown how accurate it is at the moment. Added + because it is unknown how accurate it is at the moment. Added description for --enable-scsibuffersize (partly from Abel Deuring). Removed operating system specific information. See README.* files instead. Added comment to read the PROBLEMS file. - Added/changed list of available documentation. Added comment on + Added/changed list of available documentation. Added comment on possible causes for the frontends not detecting scanners. Added comment on tools directory. Headings should be easier to find now. - + * README.aix: New file. Extracted from README. * README.hp-ux: New file. Extracted from README. @@ -634,9 +634,9 @@ * README.linux: New file. What is needed to get SCSI scanners to work under Linux. Workaround for Adaptec 1542 users (from Abel Deuring) - + 2000-05-18 Henning Meier-Geinitz - + * backend/mustek.* doc/sane-mustek.man: Update to Mustek backend 1.0-82. Added shrinked image fix to ScanExpress 12000SP models <= v2.0. Fixed remaining sane_cancel problems (in non_blocking @@ -646,7 +646,7 @@ details. * doc/.cvsignore: Added missing sane-sharp.5 - + 2000-05-07 Henning Meier-Geinitz * backend/mustek.* doc/sane-mustek.man: Update to Mustek backend @@ -656,7 +656,7 @@ source selection now shows only the options currently available. Fixed a bug concerning the ADF handling. sane_init () now uses sanei_config_read () and sanei_config_get_string () instead of - its own functions. Man page and .desc update. Look at + its own functions. Man page and .desc update. Look at backend/mustek.CHANGES for more details. 2000-04-27 Karl Heinz Kremer @@ -683,42 +683,42 @@ mustek.conf template to more reasonable defaults. Lots of small fixes and more complete debugging output. Look at backend/mustek.CHANGES for more details. - + 2000-04-15 Andreas Rick * backend/coolscan.* Update coolscan backend to version 0.4.3. This version includes support for the newer Nikon Coolscan models LS-30 and LS-2000. Dustremoval is not yet included. - + 2000-04-09 Henning Meier-Geinitz - * backend/mustek.* doc/sane-mustek.man: Update to Mustek backend + * backend/mustek.* doc/sane-mustek.man: Update to Mustek backend 1.0-79. Changed version system. Linedistance correction for the 600 II N is fixed. Added output of scanning time. Rewrite of the resolution encoding for the 3-pass scanners. Look at backend/mustek.CHANGES for details. - + 2000-04-05 Oliver Rauch * Updated umax backend to version 1.0.2-build-20 take a look at backend/umax.CHANGES for details 2000-04-05 Henning Meier-Geinitz - * frontend/xscanimage.c, frontend/preview.c: Fixed a small bug + * frontend/xscanimage.c, frontend/preview.c: Fixed a small bug concerning 3-pass scanners. gdk_input_add() was called three times without a preceding gdk_input_remove(). * frontend/scanimage.c: Fixed a bug where the scan was cancelled after a test for low mem even if enough memory is available. This probably only affected 3-pass scanners. - + 2000-04-02 Henning Meier-Geinitz * backend/mustek.*: Update to Mustek backend 0.78. Fixed several small bugs and spelling errors. Adjusted scanner names to Mustek style. Inquiry is even more verbose now. Look at backend/mustek.CHANGES for details. - + 2000-03-27 Karl Heinz Kremer * backend/epson.c backend/epson.desc: Removed status request for push button. This caused an @@ -737,7 +737,7 @@ problems with TPU and occasional crashes during startup. Added D1 level for Perfection 610. Added first version of support for set threshold and set - zoom. + zoom. 2000-03-19 Henning Meier-Geinitz @@ -755,18 +755,18 @@ * backend/mustek.desc: Added link to backend homepage. Added all the different scanner names used for the same model. Added Trust - scanners known to work. Removed firmware versions and scanner ids. + scanners known to work. Removed firmware versions and scanner ids. * backend/mustek.CHANGES: New file. More detailed changes for the Mustek backend. - + * doc/sane-mustek.man: Documentation for the 600 II N linedistance options. Added warning from PROBLEMS. Added link to backend homepage. Changed supported scanners list (see mustek.desc). Added more bug entries. * AUTHORS: Added new maintainer and email address - + 2000-03-18 Petter Reinholdtsen * backend/Makefile.in tools/libtool-get-dll-ext: New script to @@ -779,7 +779,7 @@ defined(__linux__). 2000-03-14 Abel Deuring - + * new version of ths Sharp backend (0.31): added support for the JX350 (Thanks to Shuhei Tomita for providing the patch) @@ -788,4 +788,4 @@ * Makefile.in (lsm) sane.lsm sane-1.0.1.lsm: New target to generate Linux Software Map (LSM) entry from template. Remove old file. - + diff --git a/ChangeLogs/ChangeLog-1.0.4 b/ChangeLogs/ChangeLog-1.0.4 index 94a64aa43..b925f5e2a 100644 --- a/ChangeLogs/ChangeLog-1.0.4 +++ b/ChangeLogs/ChangeLog-1.0.4 @@ -1,11 +1,11 @@ ************************ Release of sane-backends 1.0.4 ********************** 2000-12-22 Henning Meier-Geinitz - - * configure configure.in: Changed version to 1.0.4 and package to + + * configure configure.in: Changed version to 1.0.4 and package to sane-backends (from Oliver Rauch * NEWS: Updated/corrected version numbers of backends. - + 2000-12-10 Henning Meier-Geinitz * doc/sane-scsi.man: Small changes/updates concerning Linux @@ -72,12 +72,12 @@ Add HP ScanJet 6390C to list of supported scanners 2000-12-07 Henning Meier-Geinitz - + * TODO: Updated. Removed entries about plustek comment problembelm and libsane.la. Added entry about disabling local scanning. 2000-12-07 Gerhard Jaeger - + * backend/plustek-share.h backend/plustek.h backend/plustek.c removed warning conditions fixed a bug that causes wrong frontend displays @@ -91,9 +91,9 @@ Fixed problem with lamp control of SE scanners and reduced length of scan area for Paragon 1200 SP PRO. Removed warning for this scanner. Increased version number. - + 2000-12-05 Henning Meier-Geinitz - + * TODO: Updated. Added point about plustek-share.h using c++ comment and reminder to check config.in.h. Removed entriy about as6e.c stat result check. @@ -102,7 +102,7 @@ of stat. Add GPL header. 2000-12-05 Gerhard Jaeger - + * backend/plustek-share.h cleanup @@ -115,7 +115,7 @@ * TODO: Updated. Added entries about as6e stat problems and addition to sanei_scsi.c from FreeBSD ports. - + ************************* snapshot-2000-12-04 ******************************* 2000-12-04 Peter Kirchgessner @@ -135,7 +135,7 @@ * backend/epson.*: Version 0.1.38 Removed changes regarding 12/14 bit support because of SANE - feature freeze for 1.0.4. + feature freeze for 1.0.4. The following fixes are in the software compared to the version prior to the feature freeze: - refresh UI after a change in the scan mode setting (was not updated @@ -143,7 +143,7 @@ - Read values for "line distance" from the scanner instead of using hardcoded values. This makes sure the backend always uses the correct values regardless of firmware version. - - Fixed an "off-by-one" error in the color reordering routine that + - Fixed an "off-by-one" error in the color reordering routine that caused weird artifacts in some instances. 2000-12-03 Karl Heinz Kremer @@ -152,11 +152,11 @@ 2000-12-02 Karl Heinz Kremer - * backend/epson.*: Read information about optical resolution + * backend/epson.*: Read information about optical resolution and line distance from scanner instead of hardcoded values. - Add support for color depth > 8 bits per channel. + Add support for color depth > 8 bits per channel. (can use 12, 14 and 16 bits per channel) - EPSON backend is now version 0.36 + EPSON backend is now version 0.36 2000-11-30 Oliver Rauch @@ -169,11 +169,11 @@ 2000-11-30 Henning Meier-Geinitz * README.irix: Removed. Problem with libjpeg is solved. - * TODO: Updated. Removed hpoj addition. Added snapscan link. Added + * TODO: Updated. Removed hpoj addition. Added snapscan link. Added entry about net backend segfaulting if using net:localhost. Removed - artec O_SYNC problem. Removed Irix jpeg problem. Removed PTAL + artec O_SYNC problem. Removed Irix jpeg problem. Removed PTAL addition. - * doc/saned.man: Added paragraph about xinetd (from Matt Mozur + * doc/saned.man: Added paragraph about xinetd (from Matt Mozur ). Removed links to backends, added sane-"backendname" instead. * doc/sane-net.man: Added comment about segfaults if scanning @@ -181,7 +181,7 @@ * sanei/sanei_scsi.c: Added missing DBG_INIT (from FreeBSD ports). 2000-11-30 Gerhard Jaeger - + * backend/plustek.c backend/plustek.desc backend/plustek-share.h backend/plustek.h doc/sane-plustek.man: changed to version 0.38 - document update, minor bugfixes @@ -226,12 +226,12 @@ 1.0-100. Added option fast-preview that tries to use the fastest mode available for preview. This is supported for the 3-pass scanners (was option "preview in gray") and some of the - ScanExpress scanners (6000 SP, 12000 SP Plus). Use #include + ScanExpress scanners (6000 SP, 12000 SP Plus). Use #include "../include/sane/...". Put option force-wait into mustek.conf - (disabled). Removed block mode for Paragon 6000 SP and 8000 SP. + (disabled). Removed block mode for Paragon 6000 SP and 8000 SP. Code cleanup. More debug output. Details in backend/mustek.CHANGES. * doc/.cvsignore: Added sane-as6e.5 and sane-nec.5. - + 2000-11-26 Peter Kirchgessner * backend/hp.desc, doc/sane-hp.man @@ -243,16 +243,16 @@ 2000-11-25 Henning Meier-Geinitz - * configure configure.in acinclude.m4 aclocal.m4 - include/sane/config.h.in: Added test for PTAL library and headers - (patch from David Paschal ). Some reformating of + * configure configure.in acinclude.m4 aclocal.m4 + include/sane/config.h.in: Added test for PTAL library and headers + (patch from David Paschal ). Some reformating of the output of configure --help. * backend/GUIDE: Updated entry about #include. - + 2000-11-24 Henning Meier-Geinitz - * AUTHORS: Removed authors of xscanimage and xcam (now in + * AUTHORS: Removed authors of xscanimage and xcam (now in sane-frontends). * README.unixware2, README.unixware7: X-frontends are no longer included. Removed comments and sourcecode of "rev" (not supported/used @@ -296,7 +296,7 @@ * removed gimp and gtk parts from include/sane/config.h.in * removed gtk test from aclocal.m4 * removed xcam.c xscanimage.c sane-style.rc progress.c progress.h - preview.c preview.h preferences.c preferences.h gtkglue.c gtkglue.h + preview.c preview.h preferences.c preferences.h gtkglue.c gtkglue.h from frontend/ * removed parts for xcam and xscanimage from frontend/Makefile.in, configure.in and updated confiugre @@ -309,14 +309,14 @@ bug (from Peter Kirchgessner). * TODO: Removed entry about shared libs not working on AIX. Added entry about PTAL checks. Removed entry about DBG and microtek2. Added entry - about dc210 and jpeg functions. Added entry about using strchr() + about dc210 and jpeg functions. Added entry about using strchr() instead of index(). * sane.lsm: Added NEC. * backend/microtek2.c: (from karsten.festag@t-online.de (Karsten - Festag)) Use DBG instead of printf/fprintf. Use + Festag)) Use DBG instead of printf/fprintf. Use #include "../sane/include/..." instead of #include "sane/...". Fixed - warnings. - + warnings. + 2000-11-23 Karl Heinz Kremer * backend/epson.c: Display "Set Focus" control only for scanners that @@ -333,11 +333,11 @@ 2000-11-21 Abel Deuring * backend/sharp.c, backend/sharp.desc, doc/sharp.man: Support - for JX320 added + for JX320 added 2000-11-21 Henning Meier-Geinitz - * AUTHORS: Added FUKUDA Kazuya for the nec Backend. Used spaces instead + * AUTHORS: Added FUKUDA Kazuya for the nec Backend. Used spaces instead of tabs. * PROJECTS: Removed entry about NEC. Added/updated entries about Mustek USB scanners. @@ -345,11 +345,11 @@ * TODO: Removed entries about sanei_authorize and plain text passwords. * backend/Makefile.in backend/dll.conf backend/nec.conf backend/nec.c backend/nec.desc backend/nec.h doc/Makefile.in doc/sane-nec.man: - Added nec backend for the NEC scanners PC-IN500/4C (from Kazuya Fukuda + Added nec backend for the NEC scanners PC-IN500/4C (from Kazuya Fukuda ) 2000-11-20 Henning Meier-Geinitz - + * AUTHORS: Added Eugene S. Weiss. * PROJECTS: Removed Artec as6e backend. * README: Added link to man sane-as6e.5. @@ -360,7 +360,7 @@ * backend/as6e.c backend/as6e.h backend/as6e.desc doc/sane-as6e.man: Added backend for Artec AS6E parallel port scanner (from Eugene S. Weiss ). - + 2000-11-20 Jochen Eisinger * configure configure.in: Added test for /dev/urandom and @@ -422,13 +422,13 @@ * backend/avision.[c,h]: some fixes for brightness and contrast via the gamma-table. New config-option to force the backend to use DIN A4 ("option force-a4"). Clean up. - + 2000-11-14 Rene Rebe * backend/avision.[h,c]: Added gamma table support in hardware. Brightness and contrast emulation via the hardware gamma table. Code cleanup. * AUTHORS: Changed my e-mail address. - + 2000-11-13 Henning Meier-Geinitz * Makefile.in: Install sane.h and saneopts.h only. @@ -456,21 +456,21 @@ * README: Removed X-frontends. Point to sane-frontends and website. Some reformatting. * TODO: Updated concerning frontends split. - * PROJECTS: Removed entries about frontends (now in + * PROJECTS: Removed entries about frontends (now in sane-frontends/README) * PROBLEMS: Removed entries about frontends (now in sane-frontends/PROBLEMS) - + 2000-11-10 Henning Meier-Geinitz * sanei/sanei_constrain_value.c: If constraint_type is SANE_CONSTRAINT_RANGE and quantization is used, the results may be outside the limits of the range because quantization uses the - orginal value. Fixed by doing quantization with the already + orginal value. Fixed by doing quantization with the already checked value. 2000-11-10 Gerhard Jaeger - + * backend/plustek.c backend/plustek.desc backend/plustek-share.h backend/plustek.h doc/sane-plustek.man: updated to version 0.37 - support for xsane, new models @@ -480,28 +480,28 @@ * TODO: Updated. Added entries for viceo backend and addition to hp backend. Updated entries about the include issue. Added point about - additional options for pnm backend, install problem of libsane.la, - and some build problems and the --without-x problem. Some more - details for detecting older SANE versions. + additional options for pnm backend, install problem of libsane.la, + and some build problems and the --without-x problem. Some more + details for detecting older SANE versions. * LEVEL2: Added entry about sending messages from backend to frontend. Removed entry about image polarity. - * backend/mustek.c backend/mustek.h backend/mustek.CHANGES + * backend/mustek.c backend/mustek.h backend/mustek.CHANGES backend/mustek.desc: Update to Mustek backend 1.0-99. Better transparency adapter support for ScanExpress scanners. Changed color support for ScanExpress scanners (faster at some resolutions now). Paragon 1200 SP color mode should work now without garbage at - the end of an image. Some bugfixes. Details in + the end of an image. Some bugfixes. Details in backend/mustek.CHANGES. - + 2000-11-08 Jochen Eisinger * include/sane/sanei_debug.h: fixed typo 2000-10-30 Henning Meier-Geinitz - * TODO: Updated. Added points about --without-x and the + * TODO: Updated. Added points about --without-x and the #include stuff. Added xcam problem. Changed entry for Relisys scanner. @@ -514,7 +514,7 @@ 2000-10-29 Henning Meier-Geinitz * TODO: Updated. - + 2000-10-23 Peter Kirchgessner *backend/hp-accessor.c hp-device.c hp-handle.c hp-hpmem.c hp.h hp.c @@ -532,10 +532,10 @@ frontend/saned.c: removed vararg macros 2000-10-17 Henning Meier-Geinitz - + * doc/sane.tex: Added paragraph about image polarity as discussed on sane-devel. This is the version from Nick Lamb. - + 2000-10-15 Jochen Eisinger * include/sane/sanei_debug.h: sanei_debug_init was only declared @@ -565,7 +565,7 @@ anymore). Fix sane_cancel for Paragon series II scanners. Fix halftone and grain for Paragon series II scanners. Backtracking is used automaticly by all scanners now. Some safety checks, code - cleanup and more debug output. Details are in + cleanup and more debug output. Details are in backend/mustek.CHANGES. 2000-10-02 Oliver Rauch @@ -592,7 +592,7 @@ warnings. Added DBG lines for every SANE API call. * TODO: Added entries about the backend:devicename issue. Add a comment about fronends not to crash when length is -1. Added entry - about sane-pie. Added point about fronends not checking if too + about sane-pie. Added point about fronends not checking if too much data is delivered with sane_read. * PROJECTS: Added entry about sane-pie. @@ -623,11 +623,11 @@ about alpha channel (was added to LEVEL2 file). * LEVEL2: Add point about image data polarity. * frontend/scanimage.c: Removed some warnings. - + 2000-09-19 Gerhard Jaeger * backend/plustek.desc doc/sane-plustek.man: - updated information about supported scanners + updated information about supported scanners 2000-09-18 Henning Meier-Geinitz @@ -646,9 +646,9 @@ * backend/v4l.c: Remove X11 dependency. 2000-09-17 Henning Meier-Geinitz - + * frontend/xscanimage.c: Fixed gtk_main_quit bug (based on patch - from ). An error message was printed when + from ). An error message was printed when no sane device was found. 2000-09-17 Petter Reinholdtsen @@ -667,7 +667,7 @@ problems. Some other minor changes. 2000-09-15 Gerhard Jaeger - + * backend/plustek.c added some code to support timing measurement in debug sessions @@ -700,14 +700,14 @@ 2000-08-24 Gerhard Jaeger * Updated plustek backend to support multiple devices and 12bit color-depth - affected files: backend/plustek.c backend/plustek.h + affected files: backend/plustek.c backend/plustek.h backend/plustek-share.h backend/plustek.conf * backend/plustek.desc: updated information about supported scanner * doc/sane-plustek.man: updated manpage according to the changes 2000-08-23 Abel Deuring * sanei/sanei_scsi.c: Second attempt to fix the errno bug - in the Linux command queue handling. + in the Linux command queue handling. 2000-08-19 Henning Meier-Geinitz @@ -715,13 +715,13 @@ * sanei/sanei_ab306.c: Removed some comiler warnings. * doc/sane.tex: Set \date to the date of the last change (not the date of running latex (\today)) - * frontend/xscanimage.c: Fixed image size overrun (>ca. 400 MB). + * frontend/xscanimage.c: Fixed image size overrun (>ca. 400 MB). Removed some compiler warnings. - + 2000-08-15 Henning Meier-Geinitz * configure configure.in: Default to --enable-warnings again. - + 2000-08-15 Jochen Eisinger * backend/mustek_pp.c: fixed bug in config_ccd_1013 that prevents diff --git a/ChangeLogs/ChangeLog-1.0.5 b/ChangeLogs/ChangeLog-1.0.5 index 9c0a9923a..a7fdabada 100644 --- a/ChangeLogs/ChangeLog-1.0.5 +++ b/ChangeLogs/ChangeLog-1.0.5 @@ -22,7 +22,7 @@ * backend/umax*: bugfixes: * bugfix for DOR: - bottom-right edge keeps in position if possible when DOR is switched on - + * bugfix for Astra 610S color mode: - scale_y is set to 0.5 if y_resolutions is smaller than optical_res/2 this does fix the color scan problems for Astra 610S. @@ -33,7 +33,7 @@ * backend/dc25.c - Backed out the previously added mkdtemp() patch, as mkdtemp is not available on all platforms. * TODO: Removed entry about dc25 bug - + 2001-06-20 Henning Meier-Geinitz * TODO: Updated documentation entries. Added compilation bug in dc25.c. @@ -74,7 +74,7 @@ * TODO: Added link to libieee1284. 2001-06-13 Karl Heinz Kremer - + * backend/epson.desc: Added GT-9500 (same scanner as Expression 636) * backend/epson.c: Finally updated version # @@ -92,16 +92,16 @@ 2001-06-11 Henning Meier-Geinitz - * tools/umax_pp.c: Also use sanei_umax_pp_SetLamp() (patch from + * tools/umax_pp.c: Also use sanei_umax_pp_SetLamp() (patch from Tim Waugh ). 2001-06-11 Stéphane Voltz - * backend/umax_pp_low.c backend/umax_pp_low.h backend/umax_pp_mid.c: + * backend/umax_pp_low.c backend/umax_pp_low.h backend/umax_pp_mid.c: make use of PPGETMODES only when available in ppdev.h. Corrected OS/2 - typo in Outb() and rename sanei_umax_pp_Lamp() to + typo in Outb() and rename sanei_umax_pp_Lamp() to sanei_umax_pp_SetLamp(). - + 2001-06-05 Peter Fales @@ -191,7 +191,7 @@ 2001-06-06 Stéphane Voltz - * backend/umax_pp_low.c: OS/2 compile fixes (again). Backend + * backend/umax_pp_low.c: OS/2 compile fixes (again). Backend successfully built on Warp with EMX 0.9d. 2001-06-06 Stéphane Voltz @@ -221,7 +221,7 @@ * frontend/.cvsignore: Added test. * frontend/saned.c: Increase timeout to one hour. * backend/coolscan.c: Declared all internal functions static. - * tools/Makefile.in: Fixed typo that prevented make from removing + * tools/Makefile.in: Fixed typo that prevented make from removing mustek600iin-off. * sanei/sanei_scsi.c: Fixed some small bugs concerning error reporting. * frontend/scanimage.c: Fixed small bug in output for batch mode. @@ -252,9 +252,9 @@ * backend/mustek.c: Added some debug messages. * backend/net.c: Fixed yet another segfault. Added debug messages. * frontend/scanimage.c doc/scanimage.man: Added more options for - batch-scanning (patch from Caskey Dickson + batch-scanning (patch from Caskey Dickson ). - + 2001-06-02 Chris Pinkham * backend/artec.desc: updated version number to match artec.c. @@ -276,7 +276,7 @@ Removed references to sharp backend (grep for "JX"). Check for HAVE_SYS_SHM_H before including sys/shm.h and disable shared memory support if necessary. Free devlist allocated in - sane_get_devices() in sane_exit() resolution setting bug fixed + sane_get_devices() in sane_exit() resolution setting bug fixed (PC-IN500/4C 10dpi step). Removed resolution list. 2001-06-02 Oliver Rauch @@ -298,11 +298,11 @@ * backend/mustek.c: Updated some comments. * TODO: Removed the entry about the config_line[len-1] bug. * configure configure.in include/sane/config.h.in backend/qcam.c: - Check for struct flock and define it if necessary. + Check for struct flock and define it if necessary. * tools/Makefile.in: Make sure that backend/umax_pp_low.o exists when umax_pp.o is linked. - * backend/bh.c backend/m3096g.c backend/sp15c.c: Fixed - config_line[len-1] bug which could generate an access violation + * backend/bh.c backend/m3096g.c backend/sp15c.c: Fixed + config_line[len-1] bug which could generate an access violation if len==0. * lib/alloca.c lib/getnev.c lib/getopt.c lib/getopt1.c lib/isfdtype.c lib/md5.c lib sigprocmask.c lib/snprintf.c lib @@ -310,7 +310,7 @@ Used #include "../include/sane/config.h". * sanei/sanei_scsi.c: Fixed compilation issue for OS/2 in sanei_scsi_find_devices. - + --- cvs snapshot-2001-05-30 --- 2001-05-30 Marian Eichholz @@ -330,7 +330,7 @@ * tools/Makefile.in: Fixed umax_pp compilation problem with Solaris and other operating systems. - + 2001-05-29 Henning Meier-Geinitz * backend/canon.conf doc/sane-canon.man: Added config file and some @@ -340,8 +340,8 @@ 2001-05-29 Peter Fales - * backend/dc240.c - Fixed a fairly obscure problem that can result in - core dump. (Deleting pictures with gphoto, then launching + * backend/dc240.c - Fixed a fairly obscure problem that can result in + core dump. (Deleting pictures with gphoto, then launching xscanimage without power cycling the camera left bad data in the camera status table.) @@ -402,7 +402,7 @@ * TODO: Updated entry on library search path, sanei API documentation and sane_init() return value. - + * Makefile.in:New target 'libcheck' making sure libraries export only sane_* and sanei_* symbols. @@ -410,9 +410,9 @@ * TODO: Removed snapscan and microtek2 updates. Removed status change of as6e. Removed True64 Unix and HP/UX compilation problems. Added entry - about exporting symbols. Reformatted some entries. + about exporting symbols. Reformatted some entries. * backend/microtek2.c backend/microtek2.desc backend/microtek2.h: - Updated to version 0.9 (from Karsten Festag + Updated to version 0.9 (from Karsten Festag ). * doc/sane-snapscan.man: Added new scanners and authors. * AUTHORS: Added Sebastien Sable and Henrik Johansson. @@ -429,7 +429,7 @@ * backend/sm3600.desc: Changed status to new. * backend/as6e.desc: Changed status to alpha because backend isn't new any more. - * acinclude.m4 aclocal.m4 configure configure.in + * acinclude.m4 aclocal.m4 configure configure.in include/sane/config.h.in: Fixed u_int* bug for Tru64 by including sys/bitypes.h. * PROJECTS: Added hpoj project. @@ -441,7 +441,7 @@ 2001-05-25 Karl Heinz Kremer - * backend/epson.c: Allow more than 8 bit color depth even for + * backend/epson.c: Allow more than 8 bit color depth even for preview mode since Xsane can handle this. Some code cleanup. Removed ancient code that was used to determine the resolution back when the backend still had a slider for the resolution @@ -467,7 +467,7 @@ o Added support for Agfa StudioStar (weird pixel packing) o A couple of small fixes (missing 'static' declarations) o Upped version to 0.12.3 - + 2001-05-23 Matto Marjanovic * backend/microtek.c backend/microtek.h: Small fixes: @@ -526,7 +526,7 @@ and libraries that are not available on every system and inclusion of backends into CVS. Some minor fixes and clarifications. * NEWS: Updated concerning sane man page and new backends. - + 2001-05-17 Oliver Rauch * updated umax backend to version 1.0 build 26 @@ -539,7 +539,7 @@ 2001-05-16 Henning Meier-Geinitz * doc/.cvsignore: Added sane-sm3600.5. - + * PROJECTS: Removed sm3600. * TODO: Updates concerning memory leaks and access violations. @@ -547,10 +547,10 @@ * AUTHORS doc/Makefile.in: doc/sane-sm3600.man doc/sane.man: Updated documentation concerning sm3600 backend and added man page (from from Marian Eichholz ). - + * configure configure.in include/sane/config.h.in: Detect presence of libusb and enable sm3600 backend. - + * backend/Makefile.in backend/dll.c backend/sm3600-color.c backend/sm3600-homerun.c backend/sm3600-scantool.h backend/sm3600-scanutil.c backend/sm3600.desc @@ -636,7 +636,7 @@ * TODO: Removed pie from lists of bugs. Removed sane manual page. Added some context to the Tru64 problems. - + 2001-05-09 Henning Meier-Geinitz * doc/.cvsignore: Added sane.7. @@ -645,7 +645,7 @@ * doc/Makefile.in doc/sane.man: Added SANE manual page. * doc/sane.tex: Clarified the paragraph concerning sane_read. If *len != 0 the status must be SANE_STATUS_GOOD. - + 2001-05-08 Simon Munton * backend/pie.c: Free devlist in sane_exit. Removed redundant check for trailing newline in config file. @@ -679,7 +679,7 @@ illegal memory access 2001-05-04 Henning Meier-Geinitz - + * NEWS: Updated. * PROJECTS: Removed umax_pp. Added Canon FB620S and FS2710 backend. * TODO: Removed entry about umax_pp and comment about testing @@ -692,21 +692,21 @@ 2001-05-03 Henning Meier-Geinitz * AUTHORS README: Updated concerning umax_pp. - + * doc/Makefile.in doc/sane-umax_pp.man .cvsignore: Added manpage for umax_pp (patch from Stéphane Voltz ). - + * tools/README tools/Makefile.in tools/umax_pp.c tools/.cvsignore: - Added umax_pp test program (patch from Stéphane Voltz + Added umax_pp test program (patch from Stéphane Voltz ). - + * configure configure.in include/sane/config.h.in: Test for linux/ppdev.h (for umax_pp backend). - + * backend/umax_pp.c backend/umax_pp.h backend/umax_pp_low.c backend/umax_pp_low.h backend/umax_pp_mid.c backend/umax_pp_mid.h - backend/umax_pp.conf backend/umax_pp.desc backend/Makefile.in - dll.conf: Added umax_pp backend (patch from Stéphane Voltz + backend/umax_pp.conf backend/umax_pp.desc backend/Makefile.in + dll.conf: Added umax_pp backend (patch from Stéphane Voltz ). 2001-05-02 Henning Meier-Geinitz @@ -716,8 +716,8 @@ * doc/Makefile.in tools/sane-desc.el doc/.cvsignore: Install sane.ps and sane.dvi if latex/makeindex/dvips is available. - Generate sane-backends.html in doc/. New target: - install-mostang. Installs the sane standard + Generate sane-backends.html in doc/. New target: + install-mostang. Installs the sane standard (.ps, .ps.gz and html), the html manpages, and sane-backends.html on www.mostang.com. @@ -762,7 +762,7 @@ 2001-04-29 Henning Meier-Geinitz * sanei/sanei_wire.c: Don't free memory that's not alocced. - * sanei/sanei_config.c: Avoid reading uninitialized memory when + * sanei/sanei_config.c: Avoid reading uninitialized memory when checking SANE_CONFIG_DIR. * backend/mustek.c: Fixed several memory leaks. * frontend/scanimage.c: Fixed memory leak. @@ -817,7 +817,7 @@ * backend/net.desc: Added Jochen Eisinger's email address as contact for the net backend. * doc/sane-pnm.man: Point to pnm/saned security risks. - + 2001-04-21 Karl Heinz Kremer * backend/epson.conf: Commented out the usb config entry, this can @@ -833,14 +833,14 @@ comment about me working on a sane man page. Removed entry about OS/2 problems in sanei_scsi.c. * configure configure.in: Removed a newline in --help message. - * backend/pnm.c: Added several options: gamma tables + * backend/pnm.c: Added several options: gamma tables (-> arrays), resolution option (word list), read only test option (SANE_CAP_SOFT_DETECT), several options for returning status codes in sane_read (all of this is from Michael Herder ). Added build version info, print version information in sane_init. Use ../include/sane/ for includes. Version is 1.0.1. * backend/pnm.desc: Updated contact info and version. - + 2001-04-19 Gerhard Jaeger * backend/plustek.c: removed again that old fgets() call - sorry @@ -859,7 +859,7 @@ Update contact information for backends. dc240 status is :NEW. * TODO: added entries about as6e status shouldn't be :new, and installing all documentation files. - + 2001-04-16 Petter Reinholdtsen * Makefile.in: New target 'sort-cvsignore' to keep all .cvsignore @@ -873,7 +873,7 @@ 2001-04-16 Henning Meier-Geinitz * README: Updated xsane link. - * configure configure.in backend/dll.c backend/dll.desc + * configure configure.in backend/dll.c backend/dll.desc backend/net.c backend/net.desc include/sane/config.h.in Yet another change in the version system for dll and net. For sane_init return the version of the package but use @@ -884,7 +884,7 @@ * doc/realeases.txt -> doc/releases.txt. Fixed spelling error. Added entries about sane-backends.html, sane.ps, man pages, platforms page. - + 2001-04-14 Gerhard Jaeger * backend/plustek.c backend/plustek.desc backend/plustek.h backend/plustek-share.h @@ -917,7 +917,7 @@ * doc/scanimage.man: Add some more information about the -V option. * frontend/scanimage.c: The option -V now also prints the version of the backend (ususally dll). - + 2001-04-11 Abel Deuring * sanei/sanei_scsi.c: fixed a bug in error handling for the Linux SG driver verison 3.x @@ -926,11 +926,11 @@ * README.linux: Added a note, how to enable direct IO 2001-04-08 Henning Meier-Geinitz - + * backend/mustek.c backend/mustek.desc backend/mustek.CHANGES Added detection of the TA for the Paragon 1200 SP Pro. Added warning about not supported Trust scanners. Changed description - of contrast and brightness settings. Backend status is "stable" + of contrast and brightness settings. Backend status is "stable" now. New version: 1.0-106. * acinclude.m4 aclocal.m4: Fixed comment concerning dc240. * configure configure.in include/sane/config.h.in: Added test for @@ -938,7 +938,7 @@ Irix. * doc/sane-avision.man doc/sane-ricoh.man doc/sane-s9036.man doc/sane-tamarack.man: find-scanner is now called - sane-find-scanner and installed on the system so it's not + sane-find-scanner and installed on the system so it's not necessary to point to the tools directory. * frontend/scanimage.c: Fixed too long line in output. * sane-config.in: Name is sane-config again (was sane-backends-config @@ -946,7 +946,7 @@ * TODO: Removed entry about net.c not compiling on Irix and references to find-scanner in the man pages. Updated numbers of the compilation warnings. Still too many, however. - + 2001-04-07 Henning Meier-Geinitz * backend/sc240.c backend/dc240.h backend/dc240.conf @@ -968,7 +968,7 @@ 2001-03-31 Karl Heinz Kremer - * backend/epson.*: Next attempt to get the reported number of + * backend/epson.*: Next attempt to get the reported number of lines correct for the "color shuffling" part. Added more comments. @@ -986,7 +986,7 @@ Added entry about Kodak DC-240. * TODO: Added Umax 1200P/2000P & HP 320C + Kodak DC-240 as backends to be included. Added net.c compilation problem. - + 2001-03-10 Jochen Eisinger * frontend/saned.c: fixed bug that allowed access to a scanner @@ -998,8 +998,8 @@ 2001-02-26 Abel Deuring - * sanei/sanei_scsi.c: removed a possible null pointer - dereference in the Solaris/Schilling driver part. (Bug was + * sanei/sanei_scsi.c: removed a possible null pointer + dereference in the Solaris/Schilling driver part. (Bug was found and fixed by William L. Sebok) * backend/tamarack.c: inconsistent call to sanei_scsi_cmd fixed @@ -1048,8 +1048,8 @@ * sanei/linux_sg3_err.h: New version provided by Douglas Gilbert. Does not longer #include and #include - * sanei/sanei_scsi.c (Linux part): fixed some format errors in - debug output; added debug: system("cat /proc/scsi/sg/debug 1>&2"), + * sanei/sanei_scsi.c (Linux part): fixed some format errors in + debug output; added debug: system("cat /proc/scsi/sg/debug 1>&2"), if debug level >= 255. (Suggestion by Douglas Gilbert) 2001-01-23 Oliver Rauch @@ -1094,7 +1094,7 @@ modes, used options instead. Code cleanup. Updated manpage concerning sane-find-scanner. New version: 1.0-104. * configure: regenerated from configure.in. - + 2001-01-14 Petter Reinholdtsen * sanei/sanei_scsi.c: Make sure to initialize uninitialized @@ -1110,7 +1110,7 @@ * sanei/sanei_scsi-c: (Linux part) timeout for SCSI commands sent with the SG driver version increased; debug output of - device status, host status, driver status and sense buffer + device status, host status, driver status and sense buffer added. 2001-01-09 Henning Meier-Geinitz @@ -1149,20 +1149,20 @@ 2000-12-31 Henning Meier-Geinitz - * backend/mustek.CHANGES backend/mustek.c backend/mustek.desc + * backend/mustek.CHANGES backend/mustek.c backend/mustek.desc backend/mustek.h doc/sane-mustek.man: Added calibration for Pro scanners and the SE 12000 SP Plus. Added option to use the full legal size of the Paragon 1200 LS scanner. Added fast preview for Pro scanners. Bug fixes. New version: 1.0-103. - + 2000-12-25 Karl Heinz Kremer * sane-backends.lsm: Added keyword gphoto. - + 2001-10-31 Peter Fales - * acinclude.m4, aclocal.m4, configure - Fix build failure due to + * acinclude.m4, aclocal.m4, configure - Fix build failure due to renaming of gphoto2 header files 2001-10-30 Henning Meier-Geinitz @@ -40,7 +40,7 @@ 2001-10-28 Peter Fales * backend/gphoto2.c, backend/gphoto2.conf: the ghoto2 people - made some pretty radical changes to the API and broke + made some pretty radical changes to the API and broke the gphoto2 backend. Made the changes to allow the gphoto2 backend to work with the latest changes from the gphoto2 library CVS. @@ -72,7 +72,7 @@ umax.c umax-scanner.c umax-scsidef.h directory doc: sane-umax.man /umax/sane-umax-advanced-options-doc.html - umax/sane-umax-standard-options-doc.html umax/umax.CHANGES + umax/sane-umax-standard-options-doc.html umax/umax.CHANGES 2001-10-27 Oliver Schwartz @@ -357,9 +357,9 @@ * PROJECTS: Updated Winsane address. * TODO: Added net/saned and .desc file entries. Removed scanimage/adf extention entry. - * backend/pnm.c backend/pnm.desc: Make sure that *length=0 in + * backend/pnm.c backend/pnm.desc: Make sure that *length=0 in sane_read(). Added more debug output. - + 2001-09-18 Stéphane Voltz * backend/umax_pp_low.c backend/umax_pp.desc: @@ -379,7 +379,7 @@ 2001-09-17 Simon Munton * backend/pie.c backend/pie.conf: Changed ADLIB to AdLib as this is what the scanner returns and the comparison is case sensitive - + * doc/sane-pie.man: Update the status of the AdLib JetScan 630 2001-09-17 Henning Meier-Geinitz @@ -388,12 +388,12 @@ are included in the distribution now. Updated bearpaw and OS/2 entries. * NEWS: Created preliminary entry for 1.0.6. - + 2001-09-16 Peter Fales * backend/dc240.desc: Change status from new to alpha - acinclude.m4, aclocal.m4, configure: Cosmetic changes to + acinclude.m4, aclocal.m4, configure: Cosmetic changes to help text and change function used in gphoto2 lib check due to API change @@ -401,7 +401,7 @@ * backend/umax_pp_low.c backend/umax_pp_mid.c tools/umax_pp.c: - change ppdev support to compile and run on linux kernel + change ppdev support to compile and run on linux kernel prior to 2.4.5 2001-09-13 Henning Meier-Geinitz @@ -413,7 +413,7 @@ doc/mustek_usb/mustek_usb.TODO: Update to mustek_usb backend 1.0-6. Increased resolution to the maximum hardware supports. No fixed resolution any more. Gamma table support. Bugfixes. - + 2001-09-12 Peter Fales * acinclude.m4 aclocal.m4 configure configure.in: Changes to @@ -444,7 +444,7 @@ * backend/mustek.c backend/mustek.desc doc/mustek/mustek.CHANGES: Fixed problem with gamma correction. New version: 1.0-113. - * backend/mustek_usb.c backend/mustek_usb.desc + * backend/mustek_usb.c backend/mustek_usb.desc backend/mustek_usb_high.c backend/mustek_usb_low.c backend/mustek_usb_low.h backend/mustek_usb_mid.c backend/mustek_usb_mid.h doc/mustek_usb/mustek_usb.CHANGES: @@ -458,7 +458,7 @@ backend/mustek_usb_high.c backend/mustek_usb_high.h backend/mustek_usb_low.c backend/mustek_usb_low.h backend/mustek_usb_mid.c backend/mustek_usb_mid.h: - Added backend mustek_usb for Mustek USB scanners. Currently the + Added backend mustek_usb for Mustek USB scanners. Currently the 600 CU, 1200 CU, 1200 CU Plus and 1200 UB are supported. * backend/Makefile.in dll.conf: Added entries for mustek_usb. * doc/Makefile.in doc/mustek_usb/mustek_usb.CHANGES @@ -486,9 +486,9 @@ 2001-09-06 Stéphane Voltz * backend/umax_pp_low.c: made CmdSetDataBuffer static - * backend/Makefile.in: removed sanei_config2 from + * backend/Makefile.in: removed sanei_config2 from umax_pp depencies - + 2001-09-05 Jochen Eisinger * backend/net.c: ignoring size of parameter value for @@ -512,7 +512,7 @@ 2001-09-04 Jochen Eisinger * backend/net.desc doc/saned.man doc/sane-net.man: added - pointer to new saned homepage + pointer to new saned homepage (http://home.nexgo.de/jochen.eisinger/saned/) 2001-09-04 Peter Kirchgessner @@ -550,7 +550,7 @@ * backend/mustek.c backend/mustek.desc doc/sane-mustek.man doc/mustek/mustek.CHANGES: Update to backend version 1.0-112. Some minor fixes for returning the scan slider and OS/2. - + 2001-08-26 Oliver Rauch * backend/umax.c backend/umax.desc doc/umax/umax.CHANGES: @@ -560,7 +560,7 @@ * backend/umax_pp_low.c tools/umax_pp.c: Finished probe code cleaning, increased version number - + 2001-08-16 Henning Meier-Geinitz * configure configure.in: Fixed bug concerning libusb that @@ -577,22 +577,22 @@ doc/Makefile.in doc/sane-usb.man: Added sane USB interface. * include/sane/sanei_config.h sanei/sanei_config2.c: Added support for searching USB devices ("usb vendor product"). - * doc/sane-find-scanner.man tools/Makefile.in + * doc/sane-find-scanner.man tools/Makefile.in tools/sane-find-scanner.c: Added USB support. * doc/sane.man: Added information for USB scanners. * TODO: Removed USB entries. Removed entry about checking for /etc/ld.so.conf, this shouldn't be necessary any longer. Removed entry about saned freezing, no bug reports about this for a long time. Removed entry about moving .desc files, this doesn't seem to - be necessary. Added proposal to include libieeee1284. + be necessary. Added proposal to include libieeee1284. * doc/.cvsignore: Updated concerning sane-usb.5. - + 2001-08-05 Peter Fales * backend/dc240.c - Previously, the backend always assumed that the images were stored in the 100DC240 directory in the camera. It now determines the directory automatically. If - multiple directories are present, it will eventually let you + multiple directories are present, it will eventually let you pick the directory, but that feature hasn't been completed yet. @@ -639,10 +639,10 @@ 2001-07-11 Henning Meier-Geinitz * backend/mustek.c backend/mustek.desc backend/mustek.h - doc/mustek/mustek.CHANGES: Fixed bug in fix_line_distance_block + doc/mustek/mustek.CHANGES: Fixed bug in fix_line_distance_block that resulted in too much data transfered to the frontend. New version: 1.0-110. - + 2001-07-09 Henning Meier-Geinitz * backend/mustek.c backend/mustek.conf backend/mustek.desc @@ -650,7 +650,7 @@ Fixed problem with SCSI command queuing. Fixed problem that resulted in black images on some Paragon 6000SP scanners. Added option to disable backtracking. New version: 1.0-109. - + 2001-07-07 Henning Meier-Geinitz * doc/Makefile.in: Use 6 lines as top/bottom margin for man2html diff --git a/ChangeLogs/ChangeLog-1.0.7 b/ChangeLogs/ChangeLog-1.0.7 index d0cabcd75..8454b31c5 100644 --- a/ChangeLogs/ChangeLog-1.0.7 +++ b/ChangeLogs/ChangeLog-1.0.7 @@ -8,7 +8,7 @@ * TODO: Added entries about config.h, sane-backends.html, device file types, the HPUX -ansi problem, and make distclean. * backend/Makefile.in backend/coolscan2.desc: Added description file - for coolscan2 backend (from Major Andras + for coolscan2 backend (from Major Andras ). * backend/gphoto2.desc: gphoto2 is no longer "NEW". @@ -16,14 +16,14 @@ * PROJECTS: Added info about Canon N670U project. Added info about Sceptre S1200 project. - * backend/sceptre.desc backend/Makefile.in: New file (from Frank Zago + * backend/sceptre.desc backend/Makefile.in: New file (from Frank Zago ). * backend/microtek2.desc doc/sane-microtek2.man: Updated microtek2 documentation (from karsten.festag@t-online.de (Karsten Festag)). * Makefile.in README.netbsd: New file. Information about problems with shared libs. * configure configure.in: Include and also - when checking for struct semun in . This fixes a + when checking for struct semun in . This fixes a compilation problem on FreeBSD. 2002-01-31 Peter Fales @@ -31,7 +31,7 @@ * configure, acinclude.m4, aclocal.m4 - Latest gphoto2 updates changed the version number, breaking the gphoto2 backend. This is a one line change to correct that. - + 2002-01-31 Henning Meier-Geinitz * PROJECTS: Added info about GT-68xx backend. @@ -49,7 +49,7 @@ 2002-01-27 Gerhard Jaeger * backend/plustek-usbhw.c: Fixed LM9831 problem... - + 2002-01-27 Henning Meier-Geinitz * backend/microtek.c backend/microtek2.h: Fixed undefined behaviour @@ -98,7 +98,7 @@ * backend/snapscan.c backend/snapscan-scsi.c backend/snapscan.h Fix recognition of Acer 320U, Fix for spaces in model ID strings, Change snapscan version to 1.4.7 - + 2002-01-23 Henning Meier-Geinitz * backend/mustek.c backend/mustek_usb.c doc/mustek/mustek.CHANGES @@ -114,7 +114,7 @@ Change snapscan version to 1.4.6 * backend/snapscan.conf Use /dev/sg0 as default instead of the more uncommon /dev/sga - + ---- sane-backends-1.0.7-beta1 ---- 2002-01-21 Henning Meier-Geinitz @@ -172,7 +172,7 @@ po/umax.de.po: Moved the options contained in saneopts.h into a seperate file. So the backend po files are much smaller and easier to read and the saneopts translations are consistent through backends. - * backend/microtek2.c backend/microtek2.h: Update to backend + * backend/microtek2.c backend/microtek2.h: Update to backend 0.95-20020112 (from karsten.festag@t-online.de (Karsten Festag)). * include/sane/sanei.h include/sane/sanei_config.h include/sane/sanei_thread.h sanei/sanei_config.c: Made documentation @@ -189,7 +189,7 @@ * configure, acinclude.m4, aclocal.m4 - Update gphoto2 version check * backend/gphoto2.c - Improved support for options not supported by camera. Cosmetic cleanup. - + 2002-01-18 Rene Rebe * docs/sane-avision.man: added the new disable-gamma-table option @@ -267,8 +267,8 @@ converted gp_debug_printf to gp_log configure.in, configure, acinclude.m4, aclocal.m4 - Improvements - to the way gphoto2 is detected and used based on using - gphoto2-config. + to the way gphoto2 is detected and used based on using + gphoto2-config. 2002-01-15 Henning Meier-Geinitz @@ -280,18 +280,18 @@ translatable text in backend sources. 2002-01-14 Oliver Schwartz - + * backend/snapscan.c backend/snapscan-usb.c: Added workaround for bug in semctl() on PPC; backend version 1.4.5 - + 2002-01-14 Peter Fales * backend/gphoto2.c: Was requiring the device to have the IMAGE_CAPTURE capability - changed this to a warning instead of an error so the "Directory Browse" camera can be used. Don't require a port to be specified for the "Directory - Browse" camera. Fixed a bug that can result in extra data - at the end of the iamge. Allow the returned image image to be + Browse" camera. Fixed a bug that can result in extra data + at the end of the iamge. Allow the returned image image to be larger than the "estimate" specified in the configuration file. 2002-01-14 Henning Meier-Geinitz @@ -351,9 +351,9 @@ * frontend/saned.c: Check that the IP addresses of the peer are the same for control and data connections. Exit, if this is not the case. Changed some debug levels. - * PROJECTS: Updated some URLs. Removed m3096g and Mustek BearPaw + * PROJECTS: Updated some URLs. Removed m3096g and Mustek BearPaw (both are included now in SANE). Added test backend and SaneTwain. - * TODO: Removed primax (not a backend), fixed viceo URL, updated + * TODO: Removed primax (not a backend), fixed viceo URL, updated qcam entries, added entries about ipv6 support, removed saned address validation entry. Added entry about scanimage + NLS. * backend/mustek_usb.c backend/mustek_usb.desc @@ -368,10 +368,10 @@ addressed security issue with tempfile 2002-01-10 Oliver Schwartz - + * backend/snapscan.c backend/snapscan.h backend/snapscan.desc: - Update to snapscan-20020110 (Version 1.4.4) - - add support for SnapScan e42 + Update to snapscan-20020110 (Version 1.4.4) + - add support for SnapScan e42 2002-01-10 Gerhard Jaeger @@ -390,7 +390,7 @@ * backend/Makefile.in: Changed to compile the Plustek backend 2002-01-10 Henning Meier-Geinitz - + * po/pnm.de.po: Added German translation for pnm backend. * po/mustek.de.po po/mustek_usb.de.po: Updated German translations. They should be complete now. @@ -401,9 +401,9 @@ * README: Added description of --enable-translations. * doc/sane.man: Added comment about translations. * Makefile.in: Added Changelogs to DISTFILES. test/Makefile is - removed in make distclean now. + removed in make distclean now. * doc/backend-writing.txt: Added paragraph about getting started. - Added comments about ANSI C, compilation warnings, testing and + Added comments about ANSI C, compilation warnings, testing and keeping manpages up-to-date. * backend/pnm.c: Added SANE_I18N() marks. * TODO: Cleanup. Moved several entries to doc/backend-writing.txt. @@ -443,7 +443,7 @@ root dir to this file. Added standard variables and .PHONY. * backend/Makefile.in doc/Makefile.in frontend/Makefile.in japi/Makefile.in lib/Makefile.in po/Makefile.in sanei/Makefile.in - testsuite/Makefile.in tools/Makefile.in: Added target "dist". + testsuite/Makefile.in tools/Makefile.in: Added target "dist". Fixed .PHONY. * Makefile.in: Added targets "dist" and "sane-backends". make dist creates sane-backends-x.y.z.tar.gz and make sane-backends also @@ -476,8 +476,8 @@ * po/mustek.de.po mustek_usb.de.po: Added German translations for Mustek SCSI and USB backends. Translations for well-known options are missing. - * Makefile.in configure configure.in: Added option - --enable-translations to configure. I18N support is disabled by + * Makefile.in configure configure.in: Added option + --enable-translations to configure. I18N support is disabled by default. * po/.cvsignore: New file. * doc/sane-mustek_usb.man doc/mustek_usb/mustek_usb.CHANGES: @@ -490,7 +490,7 @@ * backend/Makefile.in backend/dll.conf backend/umax1220u-common.c backend/umax1220u.c backend/umax1220u.conf backend/umax1220u.desc: Added new backend umax1220u for UMAX Astra 1220U and 2000U - scanners (patch from Marcio Luis Teixeira + scanners (patch from Marcio Luis Teixeira ). * doc/Makefile.in doc/sane.man doc/sane-umax1220u.man: Added documentation fo umax1220u backend (patch from from Marcio Luis @@ -513,7 +513,7 @@ comparison, not host names as before. It's possible to put hostnames, FQDNs and IP addresses into saned.conf. Limitations: Only the first IP address in struct hostent is checked. IPv6 is - untested. The change is based on a patch by Petter Reinholdtsen + untested. The change is based on a patch by Petter Reinholdtsen . Return SANE_STATUS_ACCESS_DENIED if access was not granted instead of SANE_STATUS_IO_ERROR. @@ -526,7 +526,7 @@ 2001-01-06 Karl Heinz Kremer * backend/epson.c: Undefine TEST_IOCTL again, which was enabled - by accident. + by accident. 2002-01-06 Stéphane Voltz @@ -535,7 +535,7 @@ Corrected parport mode being set before being claimed. * backend/umax_pp.c: changed build number. * tools/umax_pp.c: changed version. - + 2002-01-05 Oliver Rauch * backend/umax-scanner.c, umax.c, umax.conf, umax.desc, umax.h: @@ -543,7 +543,7 @@ 2002-01-05 Karl Heinz Kremer - * backend/epson.[ch]: Check for (and set) s->fd to -1 when + * backend/epson.[ch]: Check for (and set) s->fd to -1 when scanner is closed. Removed black gamma table - only RGB is used, even for grayscale scans. Do not call access() when running on OS/2 or when using a parallel port scanner. @@ -626,22 +626,22 @@ 2001-12-25 Henning Meier-Geinitz * README.linux: Used "sane-find-scanner". Some minor changes. - * config.guess config.sub: Updated from + * config.guess config.sub: Updated from http://savannah.gnu.org/projects/config. * TODO: New section: "platform-specific". Added some problems with *BSD. Some minor fixes and additions. * tools/sane-find-scanner.c: Added OpenBSD device files. - * README.openbsd: New file. Some information on how to get SANE + * README.openbsd: New file. Some information on how to get SANE running on top of OpenBSD. 2001-12-22 Henning Meier-Geinitz * backend/mustek_usb.c backend/mustek_usb.conf backend/mustek_usb.desc - backend/mustek_usb_low.c backend/mustek_usb_low.h + backend/mustek_usb_low.c backend/mustek_usb_low.h doc/sane-mustek_usb.man doc/mustek_usb/mustek_usb.CHANGES: Made usb_low_read_rows more robust. Limited maximum block size and added option for this. New version: 1.0-9. - + 2001-12-21 Oliver Schwartz * backend/snapscan.c backend/snapscan.h @@ -649,7 +649,7 @@ 2001-12-20 Peter Fales - * backend/dc25.c - Fixed a potential security problem due to a + * backend/dc25.c - Fixed a potential security problem due to a race condition involving temporary file creation. Also did some cosmetic cleanup and removed some un-needed code. @@ -697,19 +697,19 @@ * sanei/sanei_ab306: Removed warning: `dev_io_fd' defined but not used. Variable used only by FreeBSD. Added test for FreeBSD. Patch from Stephen Torri . - + 2001-11-30 Henning Meier-Geinitz * testsuite/Makefile.in testsuite/README: Added comment about the need to enable pnm. Made output easier to read. 2001-11-29 Henning Meier-Geinitz - - * backend/mustek.c backend/mustek.desc doc/mustek/mustek.CHANGES: + + * backend/mustek.c backend/mustek.desc doc/mustek/mustek.CHANGES: Added check for TL_X > BR_X or TL_Y > BR_Y. New version: 1.0-115. * TODO: Added entry about TL_X < BR_X problems and semaphores for OS/2. Removed entry about BearPaw scanners. - + 2001-11-26 Abel Deuring * backend/sharp.c: added an additional check to prevent OS/2 from define "#define USE_FORK" @@ -722,13 +722,13 @@ * backend/umax_pp_low.c: fixed color calibration bug. Scans are of much better quality now. Manual settings now work correctly. * tools/umax_pp.c: changed version. - + 2001-11-22 Henning Meier-Geinitz * config.guess config.sub: Fetched new versions from http://savannah.gnu.org/projects/config. - * mkinstalldirs: Updated for OS/2 (from "Franz Bakan" + * mkinstalldirs: Updated for OS/2 (from "Franz Bakan" ). * backend/mustek.c backend/mustek.desc backend/mustek.h doc/mustek/mustek.CHANGES: Added OS/2 compatibility fixes @@ -774,7 +774,7 @@ 2001-11-15 Henning Meier-Geinitz * backend/mustek_usb.c backend/mustek_usb.conf backend/mustek_usb.desc - backend/mustek_usb.h backend/mustek_usb_high.c + backend/mustek_usb.h backend/mustek_usb_high.c backend/mustek_usb_high.h backend/mustek_usb_low.c backend/mustek_usb_low.h backend/mustek_usb_mid.c backend/mustek_usb_mid.h doc/sane-mustek_usb.man @@ -810,12 +810,12 @@ debug levels. Removed some compilation warnings. New version: 1.0.5. 2001-11-11 Abel Deuring - * sanei/sanei_scsi.c (Linux part): - - improved handling of status codes returned by the SG driver. - Device status INTERMEDIATE GOOD and CONDITION MET are now mapped - to SANE_STATUS_GOOD; device status BUSY and a few driver status + * sanei/sanei_scsi.c (Linux part): + - improved handling of status codes returned by the SG driver. + Device status INTERMEDIATE GOOD and CONDITION MET are now mapped + to SANE_STATUS_GOOD; device status BUSY and a few driver status codes are mapped to SANE_STATUS_DEVICE_BUSY - - On SCSI command completion, the (sometimes bogus) residual count + - On SCSI command completion, the (sometimes bogus) residual count is no longer subtracted from *req->dstlen * backend/sharp.c: if a READ command fails with SANE_STATUS_DEVICE_BUSY, retry a few times. @@ -830,7 +830,7 @@ * backend/umax_pp_low.c backend/umax_pp_low.h backend/umax_pp_mid.c backend/umax_pp_mid.h backend/umax_pp.c backend/umax_pp.h: - use ENABLE_DIRECTIO to compile in direct I/O. Corrected the long + use ENABLE_DIRECTIO to compile in direct I/O. Corrected the long standing scan area origin detection bug. Improved parport mode negociation. diff --git a/ChangeLogs/ChangeLog-1.0.8 b/ChangeLogs/ChangeLog-1.0.8 index 29517a999..e1ece003f 100644 --- a/ChangeLogs/ChangeLog-1.0.8 +++ b/ChangeLogs/ChangeLog-1.0.8 @@ -3,7 +3,7 @@ 2002-05-27 Henning Meier-Geinitz * backend/plustek-usbscan.c: Critical bugfix to avoid bumping the - scan slider at the end of the scan. Commited on behalf of + scan slider at the end of the scan. Commited on behalf of g-jaeger@t-online.de (G. Jaeger). 2002-05-26 Karl Heinz Kremer @@ -31,7 +31,7 @@ status to ":new" for release. * doc/descriptions/umax1220u.desc: Changed status from :new to :alpha as the baceknd was already in SANE 1.0.7. - + 2002-05-25 Andras Major * doc/descriptions/coolscan2.desc: changed status to :new. @@ -60,7 +60,7 @@ 2002-05-22 Henning Meier-Geinitz - * sanei/sanei_scsi.c: Fixed sanei_scsi_cmd2() for OPENSTEP (from + * sanei/sanei_scsi.c: Fixed sanei_scsi_cmd2() for OPENSTEP (from Oliver Schirrmeister ). 2002-05-21 Petter Reinholdtsen @@ -70,7 +70,7 @@ 2002-05-14 Oliver Schwartz - * backend/snapscan.conf: Added additional USB IDs for Acer 320U and + * backend/snapscan.conf: Added additional USB IDs for Acer 320U and Acer 620U 2002-05-09 Henning Meier-Geinitz @@ -124,11 +124,11 @@ 2002-05-02 Oliver Schwartz * backend/snapscan.c backend/snapscan-options.c - backend/snapscan-scsi.c backend/snapscan-usb.c po/snapscan.de.po: + backend/snapscan-scsi.c backend/snapscan-usb.c po/snapscan.de.po: Snapscan backend version 1.4.13 - Support for ADF - Fixed status handling after cancel - * doc/description/snapscan.desc: + * doc/description/snapscan.desc: - Add Guillemot Scan@home 1248 USB - Fix vendor URLs @@ -149,7 +149,7 @@ * TODO: Added entry to saned section: - Add support for IP ranges in saned.conf (like 10.0.0.0/8) - + 2002-04-28 Frank Zago * tools/Makefile.in tools/sane-find-scanner.c: bug fixes, better @@ -157,20 +157,20 @@ 2002-04-29 Kazuya Fukuda * backend/nec.c: fixed a compile problem for Dec Unix v4 - and probably other 64 bit platform. + and probably other 64 bit platform. * AUTHORS: Update email address for Kazuya Fukuda 2002-04-27 Oliver Schwartz * backend/snapscan.c backend/snapscan.h backend/snapscan-options.c - backend/snapscan-scsi.c backend/snapscan-usb.c po/snapscan.de.po: + backend/snapscan-scsi.c backend/snapscan-usb.c po/snapscan.de.po: Snapscan backend version 1.4.12 - Removed SCSI debug options - Fixed option handling (errors found by tstbackend) 2002-04-27 Henning Meier-Geinitz - * frontend/scanimage.c: Fixed scanimage SANE_CAP_AUTOMATIC bug + * frontend/scanimage.c: Fixed scanimage SANE_CAP_AUTOMATIC bug (from David Paschal ). 2002-04-26 Peter Fales @@ -224,7 +224,7 @@ * backend/dc240.c backend/gphoto2.c: Various minor bug fixes for problems found by tstbackend - * AUTHORS: Upate email address for Peter Fales + * AUTHORS: Upate email address for Peter Fales 2002-04-22 Frank Zago @@ -299,7 +299,7 @@ and FS2700, by Mitsuru Okaniwa and Ulrich Deiters -2002-04-19 Frank Zago +2002-04-19 Frank Zago * AUTHORS: fixed typos, formatting and added the tstbackend frontend. * frontend/Makefile.in frontend/tstbackend.c: a frontend to test @@ -332,7 +332,7 @@ 2002-04-17 Henning Meier-Geinitz * backend/fujitsu-scsi.h backend/fujitsu.c backend/fujitsu.conf - backend/fujitsu.h doc/sane-fujitsu.man + backend/fujitsu.h doc/sane-fujitsu.man doc/descriptions/fujitsu.desc: Added new fujitsu backend (from Oliver Schirrmeister ). This backend supersedes the m3096g backend and also includes the m3091 backend. @@ -374,7 +374,7 @@ 2002-04-14 Gerhard Jaeger * backend/plustek.[ch], backend/plustek-usbhw.c, backend/plustek-usbio.c, - backend/plustek-usbscan.c, backend/plustek-usbshading.c + backend/plustek-usbscan.c, backend/plustek-usbshading.c backend/plustek-usb.c, backend/plustek-devs.c backend/plustek-usb.h backend/plustek-share.h: Code cleanup, fixed OS/2 compilation breakage fixed problem that causes non LM983x based devices to crash, minor fixes @@ -407,7 +407,7 @@ for sorted sane-backends.html, and saneopts.??.po problem. Removed backends from list of inclusion beacuse of lack of response: v4l2, lhii, viceo (they stay in PROJECTS). Removed snapscan from - exported symbols bug list. Updated doxygen list. + exported symbols bug list. Updated doxygen list. 2002-04-12 Frank Zago @@ -415,10 +415,10 @@ info. 2002-04-12 Matthew Duggan - - * backend/canon_pp-io.c: Updated for new libieee1284 interface + + * backend/canon_pp-io.c: Updated for new libieee1284 interface (version 0.1.5) - * acinclude.m4 aclocal.m4 configure configure.in: + * acinclude.m4 aclocal.m4 configure configure.in: Added check for libieee1284 > 0.1.5 2002-04-08 Rene Rebe @@ -436,14 +436,14 @@ * backend/umax_pp_low.c: fixed 8 bits I/O support 2002-04-10 Oliver Schwartz - + * backend/snapscan-scsi.c Removed illegal character * backend/snapscan-usb.h Removed declaration of bqelements 2002-04-10 Oliver Schwartz - + * backend/snapscan-usb.c make bqelements static * backend/snapscan-scsi.c @@ -489,7 +489,7 @@ i * doc/descriptions/avision.desc: fixed syntax 2002-04-08 Henning Meier-Geinitz - + * Makefile.in: make libcheck now also checks for non-static variables. * v4l.c: Some variables haven't been static. sane_set_io_mode must return SANE_STATUS_GOOD if non_blocking == SANE_FALSE. @@ -503,10 +503,10 @@ i 2002-04-07 Henning Meier-Geinitz * backend/canon_pp.c backend/canon_pp-dev.c backend/canon_pp-io.c - backend/canon_pp-dev.h: Changed timeouts and added scanner sleeps - to improve reliability of 6x0P models. Also corrected typo which - caused full bed scans to fail. Disabled problematic detect for now, - will make detection slightly slower. Patch from Matthew Duggan + backend/canon_pp-dev.h: Changed timeouts and added scanner sleeps + to improve reliability of 6x0P models. Also corrected typo which + caused full bed scans to fail. Disabled problematic detect for now, + will make detection slightly slower. Patch from Matthew Duggan . * doc/descriptions/canon_pp.desc: Added man page, incremented version. Patch from Matthew Duggan . @@ -515,12 +515,12 @@ i * backend/Makefile.in backend/canon630u-common.c backend/canon630u.c backend/canon630u.conf backend/dll.conf backend/lm9830.h: Added canon630u backend. This backend supports the CanoScan 630u and - CanoScan 636u (hopefully). Patch from Nathan Rutman + CanoScan 636u (hopefully). Patch from Nathan Rutman . * doc/.cvsignore doc/Makefile.in doc/sane-canon630u.man doc/descriptions/canon630u.desc: Added documentation and description - of canon630u backend. Patch from Nathan Rutman - . + of canon630u backend. Patch from Nathan Rutman + . * PROJECTS doc/sane.man: Updated for canon630u backend. * AUTHORS: Updated for canon630u backend. * doc/saned.man: The path in the xinetd example pinted to /usr/local @@ -530,7 +530,7 @@ i 2002-04-06 Henning Meier-Geinitz - * backend/mustek.c doc/descriptions/mustek.desc + * backend/mustek.c doc/descriptions/mustek.desc doc/mustek/mustek.CHANGES: Fixed color three-pass scanning for some scanners. * PROJECTS: Added Hewlett-Packard ScanJet 2200c project. @@ -541,11 +541,11 @@ i * configure, acinclude.m4, aclocal.m4 - Another tweak to the allowed gphoto2 version numbers - + 2002-04-02 Henning Meier-Geinitz * acinclude.m4 aclocal.m4 configure configure.in: Added checks for - libieee1284. Enable canon_pp backend if found. Patch from + libieee1284. Enable canon_pp backend if found. Patch from "Matthew Duggan" . * backend/Makefile.in backend/canon_pp-dev.c backend/canon_pp-dev.h backend/canon_pp-io.c backend/canon_pp-io.h backend/canon_pp.c @@ -558,10 +558,10 @@ i * PROJECTS TODO: Removed canon_pp. * doc/.cvsignore: Added sane-canon_pp.5. * doc/descriptions-external/canon_pp.desc: Removed. - + 2002-03-30 Henning Meier-Geinitz - * doc/descriptions-external/test.desc: Added description of the test + * doc/descriptions-external/test.desc: Added description of the test backend. * PROJECTS: Added homepage of the test backend. @@ -569,7 +569,7 @@ i * backend/pnm.c doc/descriptions/pnm.desc: Check if option is settable when automatically setting it. New version: 1.0.7. - * backend/Makefile.in doc/Makefile.in frontend/Makefile.in + * backend/Makefile.in doc/Makefile.in frontend/Makefile.in include/Makefile.in po/Makefile.in tools/Makefile.in: Support for variable DESTDIR. If set, all files are installed to that location. Also print the filename of the installed file, not only the @@ -585,7 +585,7 @@ i 2002-03-27 Oliver Rauch * removed unused definitions in include/sane/saneopts.h: - SMEAR, TEN_BIT_MODE, TWELVE_BIT_MODE, RGB_PREVIEW_PATCH, + SMEAR, TEN_BIT_MODE, TWELVE_BIT_MODE, RGB_PREVIEW_PATCH, START_SCAN_PATCH 2002-03-26 Henning Meier-Geinitz @@ -603,8 +603,8 @@ i Updated to new mail-address and backend URL 2002-03-24 Oliver Schwartz - - * backend/snapscan.c: Fix segfault in sane_exit if no devices were + + * backend/snapscan.c: Fix segfault in sane_exit if no devices were found. 2002-03-24 Henning Meier-Geinitz @@ -613,11 +613,11 @@ i Update to libtool 1.4.2. Included local changes: use soname "libsane" for all os but AIX. Use "normal" shared libs (.so) instead of archives on AIX. Use 1 instead of 2 as major number with Irix. - * Makefile.in ltconfig: Removed ltconfig as it is no longer used by + * Makefile.in ltconfig: Removed ltconfig as it is no longer used by libtool. * TODO: More status indicators for backends to include. Removed - entry about the grand Fujitsu reunification. Updated entry about the - DBG warnings. Removed entry about splitted sane-backends.html. + entry about the grand Fujitsu reunification. Updated entry about the + DBG warnings. Removed entry about splitted sane-backends.html. Removed entries about libtool problems. Added entry about plustek on OS/2 problem. * backend/pnm.c doc/descriptions/pnm.desc: If fread returns 0, check @@ -629,17 +629,17 @@ i 2002-03-24 Oliver Schwartz - * backend/snapscan-options.c: New file (option functions moved from + * backend/snapscan-options.c: New file (option functions moved from snapscan.c) * backend/snapscan-utils.c: Removed file * backend/Makefile.in: Added snapscan-options.c, removed snapscan-utils.c * backend/snapscan.c backend/snapscan.h backend/snapscan-scsi.c - backend/snapscan-usb.c backend/snapscan.h backend/snapscan.conf: + backend/snapscan-usb.c backend/snapscan.h backend/snapscan.conf: Snapcan-backend ver. 1.4.9 - Moved option functions to snapscan-options.c - Autodetect USB scanners on Linux - Better error reporting - + 2002-03-21 Henning Meier-Geinitz * doc/backend-writing.txt: Updated concerning splitted .desc @@ -653,17 +653,17 @@ i * backend/pnm.c doc/descriptions/pnm.desc: Don't allow to set options that don't have SANE_CAP_SOFT_SELECT and don't allow read and write for options that are inactive. New version: 1.0.5. - + 2002-03-20 Henning Meier-Geinitz * sanei_wire.c: Set allocated memory to 0 to avoid delivering garbage to the frontend. - * backend/mustek.c backend/mustek.desc backend/mustek.h + * backend/mustek.c backend/mustek.desc backend/mustek.h doc/mustek/mustek.CHANGES: Fixed halftone pattern handling. The buffer was way too small. Option 0 has an empty name. Better debug output for dev_cmd. Set size for group options to 0. Set size of halftone pattern to non 0. - * backend/mustek_usb.c backend/mustek_usb.desc + * backend/mustek_usb.c backend/mustek_usb.desc doc/mustek_usb/mustek_usb.CHANGES: Option 0 has an empty name now. Group options have size 0 now. Check also for SANE_ACTION_SET_AUTO. Removed buggy output in sane_control_option. Added more debug output @@ -691,11 +691,11 @@ i doc/descriptions/sharp.desc doc/descriptions/sm3600.desc doc/descriptions/snapscan.desc doc/descriptions/sp15c.desc doc/descriptions/st400.desc doc/descriptions/tamarack.desc - doc/descriptions/template.desc. doc/descriptions/umax1220u.desc + doc/descriptions/template.desc. doc/descriptions/umax1220u.desc doc/descriptions/umax.desc doc/descriptions/umax_pp.desc doc/descriptions/v4l.desc: Moved descriptions of included backends from backend/*.desc. - * doc/descriptions-external/canon_pp.desc + * doc/descriptions-external/canon_pp.desc doc/descriptions-external/coolscan2.desc doc/descriptions-external/hp4200.desc doc/descriptions-external/hpoj.desc @@ -716,7 +716,7 @@ i * backend/Makefile.in: Updated DISTFILES. * backend/*.desc backend/template.desc.: Removed (now in doc/). * tools/.cvsignore: Added sane-desc.el. - + 2002-03-19 Frank Zago * matsushita backend: updates and fixes. @@ -739,7 +739,7 @@ i segfault when name="". Type for option 0 must be set to SANE_TYPE_INT explicitely. Updated GPL/SANE headers. * TODO: Added entry about auto-loading SCSI drivers. Removed entry - about new SANE types. Moved entry about config.guess to + about new SANE types. Moved entry about config.guess to doc/releases.txt. Added more info about libtool problems. * doc/releases.txt: Added info about config.guess and config.sub. * config.guess config.sub: Updated from upstream. @@ -747,19 +747,19 @@ i 2002-03-17 Peter Fales * backend/gphoto2.c - Minor bug fixes for problems found by tstbackend - + 2002-03-16 Gerhard Jaeger * backend/plustek.[ch]: fixed a bug, that causes segfaulting the backend - when using the USB autodetection stuff + when using the USB autodetection stuff 2002-03-15 Stéphane Voltz * backend/umax_pp_low.c: fixed 1200 dpi mode * backend/umax_pp: changes for translations support - * po/Makefile.in po/umax_pp.fr.po: create french translations for + * po/Makefile.in po/umax_pp.fr.po: create french translations for umax_pp backend - + 2002-03-12 Frank Zago * PROJECTS backend/teco.desc: new project @@ -774,7 +774,7 @@ i 2002-03-10 Frank Zago * PROJECTS: removed matsushita project. - * backend/sceptre.desc backend/matsushita.desc: updated the backend + * backend/sceptre.desc backend/matsushita.desc: updated the backend url. 2002-03-10 Abel Deuring @@ -805,7 +805,7 @@ i * po/plustek.de.po: Update * po/plustek.es.po, po/saneopts.es.po: Added spanish translation - thanks to Gustavo D. Vranjes + thanks to Gustavo D. Vranjes 2002-03-10 Stéphane Voltz @@ -827,7 +827,7 @@ i * include/sane/config.h.in: Fix comment for HAVE_USB_H. * TODO: Added entry about md5/getopt license issues. - + 2002-03-07 Abel Deuring * sanei/sanei_scsi.c: fixed a typo (Sg_scsi_id -> SG_scsi_id) @@ -840,22 +840,22 @@ i * po/Makefile,in doc/sane.man doc/Makefile.in backend/matsushita.desc backend/dll.conf backend/Makefile.in sane-backends.lsm AUTHORS - po/matsushita.fr.po doc/matsushita/matsushita.txt - doc/matsushita/matsushita10_trc.txt + po/matsushita.fr.po doc/matsushita/matsushita.txt + doc/matsushita/matsushita10_trc.txt doc/matsushita/matsushita11_trc.txt - doc/matsushita/matsushita12_trc.txt - doc/matsushita/matsushita13_trc.txt - doc/matsushita/matsushita14_trc.txt - doc/matsushita/matsushita1_trc.txt + doc/matsushita/matsushita12_trc.txt + doc/matsushita/matsushita13_trc.txt + doc/matsushita/matsushita14_trc.txt + doc/matsushita/matsushita1_trc.txt doc/matsushita/matsushita2_trc.txt - doc/matsushita/matsushita3_trc.txt - doc/matsushita/matsushita4_trc.txt - doc/matsushita/matsushita5_trc.txt - doc/matsushita/matsushita6_trc.txt - doc/matsushita/matsushita7_trc.txt - doc/matsushita/matsushita8_trc.txt - doc/matsushita/matsushita9_trc.txt doc/sane-matsushita.man - backend/matsushita.h backend/matsushita.conf + doc/matsushita/matsushita3_trc.txt + doc/matsushita/matsushita4_trc.txt + doc/matsushita/matsushita5_trc.txt + doc/matsushita/matsushita6_trc.txt + doc/matsushita/matsushita7_trc.txt + doc/matsushita/matsushita8_trc.txt + doc/matsushita/matsushita9_trc.txt doc/sane-matsushita.man + backend/matsushita.h backend/matsushita.conf backend/matsushita.c: Addition of the Matsushita / Panasonic backend * doc/.cvsignore: added sane-matsushita.5 @@ -892,7 +892,7 @@ i backend/sceptre.conf backend/sceptre.desc backend/sceptre.h: Added sceptre backend for the Sceptre VividScan 1200 (patch from Frank Zago ). - * doc/Makefile.in doc/sane-sceptre.5 doc/sane-sceptre.man doc/sane.man + * doc/Makefile.in doc/sane-sceptre.5 doc/sane-sceptre.man doc/sane.man doc/sceptre/preview_trace.txt doc/sceptre/s1200.txt doc/sceptre/scan_trace.txt: Added documentation for sceptre backend (patch from Frank Zago ). @@ -912,25 +912,25 @@ i * lib/inet_pton.c: Use u_int32_t instead of in in_addr_t which isn't defined at least for OS/2. * TODO: Added entry about DBG warnings. - * doc/sane.tex: Added some vendors (Abaton, Acer, Apple, Avision, - CANON, Fujitsu, IBM, NEC, Nikon, Plustek, Polaroid, Ricoh, Sharp, + * doc/sane.tex: Added some vendors (Abaton, Acer, Apple, Avision, + CANON, Fujitsu, IBM, NEC, Nikon, Plustek, Polaroid, Ricoh, Sharp, Siemens, Tamarack) and device types (film scanner, sheetfed scanner) to the SANE standard. Updated date. * doc/Makefile.in: Remove sanei-html in make distclean. * PROJECTS: Added Acer ScanWit 2720S. * backend/template.desc.: Added explanation for backend version, fixed - typo. + typo. 2002-02-16 Abel Deuring : * frontend/scanimage.c / part for the "-f" command line option: replaced the vprintf call with a loop of printf calls; fixed - a "too stingy" malloc + a "too stingy" malloc 2002-02-16 Peter Fales - * backend/dc240.c - Fix mismatches between format and + * backend/dc240.c - Fix mismatches between format and parameters in debug statements - + 2002-02-15 Henning Meier-Geinitz * include/sane/sanei.h include/sane/sanei_ab306.h @@ -948,14 +948,14 @@ i * backend/umax_pp_low.c backend/umax_pp_low.h backend/umax_pp_mid.h backend/umax_pp_mid.c backend/umax_pp.c backend/umax_pp.h - backend/umax_pp.conf: added ppdev character device name passing - from conf file. Allow model overide from conf option. DBG macros - clean-up. Fixed color inversion for 1660P models. Fixed potential + backend/umax_pp.conf: added ppdev character device name passing + from conf file. Allow model overide from conf option. DBG macros + clean-up. Fixed color inversion for 1660P models. Fixed potential crash when custom dump files could not be opened for writing. - * doc/sane-umax_pp.man: updates to match backned new parameter and + * doc/sane-umax_pp.man: updates to match backned new parameter and behaviour * tools/umax_pp.c: added device name argument - + 2002-02-14 Jochen Eisinger * sanei/sanei_auth.h: remove strange line-ending handling code @@ -982,7 +982,7 @@ i * configure, acinclude.m4, aclocal.m4 - Another tweak to the allowed gphoto2 version numbers - + 2002-02-13 Henning Meier-Geinitz * configure configure.in Makefile.in backend/Makefile.in @@ -1001,7 +1001,7 @@ i * frontend/saned.c: DNS queries for remote hosts are only done if necessary. It's now possible to use "+" without hosts/DNS entries for the connecting host. - * TODO: Removed entries for config.h, OpenBSD shared libs, and -ansi + * TODO: Removed entries for config.h, OpenBSD shared libs, and -ansi on HP-UX. Updated device type entry. 2002-02-10 Henning Meier-Geinitz @@ -1043,13 +1043,13 @@ i 2002-02-05 Stéphane Voltz * backend/umax_pp_low.c backend/umax_pp_low.h backend/umax_pp_mid.h - backend/umax_pp_mid.c backend/umax_pp.c backend/umax_pp.h: + backend/umax_pp_mid.c backend/umax_pp.c backend/umax_pp.h: tuned down duration of pauses in scanner ringing. Indent'ing all files. Include header files according to HAVE_XXX_H defines in config.h . * tools/umax_pp.c: updated version and added printing of config options - + 2002-02-05 Henning Meier-Geinitz * configure configure.in: Version is 1.0.7-cvs. Enable warnings by diff --git a/ChangeLogs/ChangeLog-1.0.9 b/ChangeLogs/ChangeLog-1.0.9 index c20a91829..99410f5f2 100644 --- a/ChangeLogs/ChangeLog-1.0.9 +++ b/ChangeLogs/ChangeLog-1.0.9 @@ -24,7 +24,7 @@ 2002-10-19 Henning Meier-Geinitz - * doc/descriptions-external/tevion9693usb.desc: Added Trust + * doc/descriptions-external/tevion9693usb.desc: Added Trust Easy Webscan 19200. ---- CODE FREEZE FOR SANE 1.0.9 --- @@ -123,7 +123,7 @@ 2002-10-09 Stéphane Voltz * backend/umax_pp.c: disable scanner protocol debug facility - + 2002-10-08 Karl Heinz Kremer * backend/epson.c: force color channel re-order for GT-2200 scanner @@ -145,7 +145,7 @@ 2002-10-05 Karl Heinz Kremer - * backend/epson.c: Fixed problem with incorrect response to + * backend/epson.c: Fixed problem with incorrect response to sane_get_parameters() in certain situations. 2002-10-04 Jochen Eisinger @@ -157,7 +157,7 @@ * backend/plustek.conf fixed option enableTPA * po/plustek.de.po po/plustek.es.po removed "Negative" - * backend/plustek.c backend/plustek-devs.c backend/plustek-usb.c + * backend/plustek.c backend/plustek-devs.c backend/plustek-usb.c backend/plustek-usbhw.c backend/plustek-usbimg.c backend/plustek-usbmap.c backend/plustek-usbscan.c backend/plustek-usbshading.c @@ -187,7 +187,7 @@ 2002-10-02 Matto Marjanovic * doc/descriptions/microtek.desc: Updated version number. - * backend/microtek.c: + * backend/microtek.c: Fixed bug in sane_read() [had failed to set return length to zero in non-STATUS_GOOD conditions]. Fixed bug in sane_set_io_mode() [had returned SANE_STATUS_UNSUPPORTED @@ -199,7 +199,7 @@ * doc/descriptions-external/gt68xx.desc: Added new scanners. Updated status of supported scanners. * doc/sane.tex: Added explanation of bit order for 1 bit modes. Added - comment about 1 bit color modes. Fixed missing \code command. New + comment about 1 bit color modes. Fixed missing \code command. New version: 1.03. * doc/backend-writing.txt: Added paragraph about checking geometry (from TODO). @@ -215,8 +215,8 @@ only works on linux (because need of USB control messages) 2002-09-30 Matthew Duggan - * backend/canon_pp.c backend/canon_pp-dev.c backend/canon_pp-dev.h: - Finally fixed cancelling, which I broke some time ago in the quest + * backend/canon_pp.c backend/canon_pp-dev.c backend/canon_pp-dev.h: + Finally fixed cancelling, which I broke some time ago in the quest for speed. FB620P still doesn't abort nicely (firmware bug?). * doc/sane-canon_pp.man: Added notes on FB620P problems. * doc/descriptions/canon_pp.desc: Bumped version number. @@ -237,7 +237,7 @@ -- snapshot 1.0.9-pre1 2002-09-29 Henning Meier-Geinitz - + * doc/descriptions/mustek_usb.desc: Added "ScanExpress" for all models to avoid confusion with BearPaw models. * Makefile.in: Added ChangeLog-1.0.6 ChangeLog-1.0.7 ChangeLog-1.0.8 @@ -278,7 +278,7 @@ * config.sub config.guess: Updated to current versions. * doc/releases.txt: Added paragraph about the different freeze types and a timetable. - + 2002-09-26 Oliver Schwartz * doc/snapscan.desc backend/snapscan.c backend/snapscan.h @@ -301,11 +301,11 @@ * doc/descriptions-external/gt68xx.desc: Added some untested scanners. Updated Mustek entries. * TODO: Removed hpsj5s .desc file problem. - + 2002-09-22 Peter Fales - * doc/sane-dc25.man, backend/dc25.c, backend/dc25.h, - backend/gphoto2.c, backend/gphoto2.h, backend/dc240.c, + * doc/sane-dc25.man, backend/dc25.c, backend/dc25.h, + backend/gphoto2.c, backend/gphoto2.h, backend/dc240.c, backend/dc240.h: Update authors email address 2002-09-19 Frank Zago @@ -330,7 +330,7 @@ * backend/fujitsu.c fujitsu.h fujitsu-scsi.h: added m3092 support * doc/descriptions/fujitsu doc/sane-fujitsu - added description + added description 2002-09-17 Matthew Duggan * backend/canon_pp.c backend/canon_pp.h backend/canon_pp.conf: @@ -338,11 +338,11 @@ * doc/sane-canon_pp.man : Added description of init_mode option. 2002-09-16 Matthew Duggan - * backend/canon_pp-dev.c backend/canon_pp-dev.h backend/canon_pp-io.c + * backend/canon_pp-dev.c backend/canon_pp-dev.h backend/canon_pp-io.c backend/canon_pp-io.h backend/canon_pp.c backend/canon_pp.h: Fix init problem, add changes to facilitate configurable wakeup mode (for faster starts on FB320P and FB620P). - * doc/sane-canon_pp.man doc/descriptions/canon_pp.desc: Updates + * doc/sane-canon_pp.man doc/descriptions/canon_pp.desc: Updates regarding FB310P and FB610P (rebadged Avisions) 2002-09-16 Henning Meier-Geinitz @@ -350,7 +350,7 @@ * backend/.cvsignore frontend/.cvsignore tools/.cvsignore: Added .libs. Patch from Sylvain Petreolle . * TODO: Added gt68xx project and viceo.desc entry. - * PROJECTS doc/descriptions-external/gt68xx.desc: Added gt68xx + * PROJECTS doc/descriptions-external/gt68xx.desc: Added gt68xx information. 2002-09-15 Karl Heinz Kremer @@ -394,7 +394,7 @@ * TODO: Updated backend list. Added comments for additions to sane.tex. Updated .desc file bug list. Removed scanimage entries. Added plustek man page issue. - + 2002-09-10 Peter Kirchgessner * doc/sane-hp.man: Added hints about special USB device names @@ -462,7 +462,7 @@ 2002-09-01 Matthew Duggan - * backend/canon_pp.c backend/canon_pp-dev.c backend/canon_pp-dev.h + * backend/canon_pp.c backend/canon_pp-dev.c backend/canon_pp-dev.h backend/canon_pp-io.c: Support for FB620P. * doc/sane-canon_pp.man doc/descriptions/canon_pp.desc: Added notes on support of FB620P @@ -493,21 +493,21 @@ * backend/v4l.c backend/v4l.h doc/descriptions/v4l.desc: Big clean up of Video for Linux backend. Removed old unused stuff from qcam and others including unused options and variables - concerning direct port access. Removed wcam license (no + concerning direct port access. Removed wcam license (no "substantial portions of code" are used any more). Removed unuesed headers. Made lots of global variables local. Lots of checks for null pointer dereferences and errors when opening files or using ioctl/mmap. Added option to select grey or color mode. Added support for different channels. Fixed lots of options. - Made sure ioctls are only used when necessary. + Made sure ioctls are only used when necessary. Used vendor == "Noname". Added ??? comments for suspicious code. Lots of minor fixes and cleanup. Added version number: 1.0-2. * backend/v4l-grab.h: Deleted (unused). - * backend/Makefile.in: Removed v4l-grab.h. + * backend/Makefile.in: Removed v4l-grab.h. * AUTHORS: Added myself as active maintainer of v4l. * doc/sane-v4l.man: Added warning about ALPHA software and bugs. Minor updates. - * doc/descriptions/bh.desc doc/descriptions/canon630u.desc + * doc/descriptions/bh.desc doc/descriptions/canon630u.desc doc/descriptions/dmc.desc doc/descriptions/sm3600.desc doc/descriptions/umax1220u.desc: Minor fixes and updates for the new .desc file format. @@ -575,8 +575,8 @@ 2002-08-17 Karl Heinz Kremer - * backend/epson.[ch]: Fixed typo in variable name. Fixed IEEE-1394 - problem with Perfection-2450. Fixed problem with older B3 level + * backend/epson.[ch]: Fixed typo in variable name. Fixed IEEE-1394 + problem with Perfection-2450. Fixed problem with older B3 level SCSI scanners that do not support the extended status request. 2002-08-17 Oliver Rauch @@ -617,12 +617,12 @@ 2002-08-07 Matthew Duggan * backend/canon_pp.c backend/canon_pp-dev.c backend/caon_pp-io.c - backend/canon_pp-dev.h: Many changes: Bug fixes, less memory leaks - (none left now?), more reliable, faster. Biggest changes are - speculative reads (ask scanner to read more while data processing + backend/canon_pp-dev.h: Many changes: Bug fixes, less memory leaks + (none left now?), more reliable, faster. Biggest changes are + speculative reads (ask scanner to read more while data processing occurs) and more reliable sending of commands. Slight performance increase over previous version. - * doc/sane-canon_pp.man: Added discussion noting that scanning + * doc/sane-canon_pp.man: Added discussion noting that scanning greyscale in green is bad for colour. 2002-08-07 Peter Kirchgessner @@ -650,7 +650,7 @@ msgids. Made sure that header is not marked fuzzy. * Makefile.in doc/Makefile.in japi/Makefile.in tools/Makefile.in: Minor DISTFILES and distclean updates. - * backend/mustek.c doc/descriptions/mustek.desc + * backend/mustek.c doc/descriptions/mustek.desc doc/mustek/mustek.CHANGES: Fixed some warnings. * TODO: Removed entries about "echo -e" and po problems. @@ -668,7 +668,7 @@ 2002-07-25 Matthew Duggan * backend/canon_pp.c: Now always uses as much scanner buffer as - possible, then feeds data to frontend. Results in large speed + possible, then feeds data to frontend. Results in large speed increase in ECP mode. Also fixed problems with saned compatibility. * backend/canon_pp.h: Added bytes_sent to scanner data structure. * doc/sane-canon_pp.man: Discuss hardware problems at high @@ -739,7 +739,7 @@ 2002-07-22 Matto Marjanovic - * doc/descriptions/microtek.desc: + * doc/descriptions/microtek.desc: Updated (status keywords, mostly). * backend/microtek.c: * backend/microtek.h: @@ -761,8 +761,8 @@ 2002-07-23 Matthew Duggan - * doc/descriptions/canon_pp.desc: Added "N640P ex" model to supported - scanners after report of successful test. Also, "EPP" really should + * doc/descriptions/canon_pp.desc: Added "N640P ex" model to supported + scanners after report of successful test. Also, "EPP" really should have been "ECP". 2002-07-22 Henning Meier-Geinitz @@ -787,7 +787,7 @@ * tools/sane-desc.c: Models are sorted alphanumerically now. Added support for priorities if one model is mentioned by two backends. Don't print tables when no suitable backend was found. - More comments. Fixed some warnings. Code cleanup. + More comments. Fixed some warnings. Code cleanup. * doc/Makefile.in: Added support for sane-desc.c. * doc/backend-writing.txt: Updated concerning sane-desc.c. * backend/mustek_usb.c backend/mustek_usb_high.h @@ -822,17 +822,17 @@ more expressive. Check for missing config descriptors before using them to avoid segfaults. * README.openbsd: Updated concerning USB scanners. - * README.openbsd README.netbsd: New files. Added some information + * README.openbsd README.netbsd: New files. Added some information about SCSI and USB problems. * tools/sane-find-scanner.c: Made verbosity option more flexible and - added quiet option. In quiet mode, print only the devices we have + added quiet option. In quiet mode, print only the devices we have found. Don't check USB devices with SCSI functions and vice versa if option force is not given. Don't do the libusb scan if an explicit device name was given. * doc/sane-usb.man: Updated supported platforms list. Minor wording improvements. * doc/sane-find-scanner.man: Documentation for the new options. - Splitted USB and SCSI parts. + Splitted USB and SCSI parts. * doc/descriptions/hpsj5s.desc: Added missing space in ":new :yes" line. * TODO: Added entry about desc files. Removed entries about @@ -841,20 +841,20 @@ types and OS X in sanei_scsi.c. 2002-07-13 Simon Munton - * doc/descriptions/pie.desc: removed unsupported scanner types, + * doc/descriptions/pie.desc: removed unsupported scanner types, use :status :untested for untested models, added AdLib scanners that are supported 2002-07-13 Oliver Schwartz - * backend/snapscan.c backend/snapscan.h + * backend/snapscan.c backend/snapscan.h backend/snapscan-options.c backend/snapscan-usb.c - backend/snapscan-scsi.c backend/snapscan.conf: + backend/snapscan-scsi.c backend/snapscan.conf: Snapscan backend version 1.4.15 - Improve support for Acer / Benq 5300 - use usb_sanei_read_bulk() and usb_sanei_write_bulk() - - correct scan area for e52 with TPO - * doc/description/snapscan.desc: + - correct scan area for e52 with TPO + * doc/description/snapscan.desc: - Adapted file to new syntax - Mark most scanners as "stable" @@ -891,9 +891,9 @@ * doc/descriptions/sp15c.desc: Added missing slash in URL. * doc/descriptions/fujitsu.desc: Changed status to :beta. Added some URLs. - * frontend/Makefile.in: Use LIBS = @LIBS@ to make sure that + * frontend/Makefile.in: Use LIBS = @LIBS@ to make sure that -lsyslog and -lsocket are linked for OS/2. - * doc/descriptions/abaton.desc: Added :status :untested for + * doc/descriptions/abaton.desc: Added :status :untested for Scan 300/S. * doc/descriptions/agfafocus.desc: Added status and comments (from the manpage). @@ -904,8 +904,8 @@ * doc/descriptions/net.desc doc/descriptions/test.desc: No bugs for quite some time, changed status to stable (knocking on wood). Updated comments. - * doc/descriptions.txt doc/descriptions/template.desc. - doc/descriptions-external/template.desc.: Updated concerning + * doc/descriptions.txt doc/descriptions/template.desc. + doc/descriptions-external/template.desc.: Updated concerning model status. * tools/sane-desc.c: Added support for :status :unsupported. @@ -918,7 +918,7 @@ * backend/mustek.c doc/descriptions/mustek.desc doc/mustek/mustek.CHANGES: Increased width and height of Paragon 800 and 600. - * doc/descriptions/mustek_usb.desc: Changed status to stable + * doc/descriptions/mustek_usb.desc: Changed status to stable (knocking on wood...). Added more Mustek URLs, fixed the existing one. Added per-model status. Added "compatible" comments. * doc/descriptions/mustek.desc: Fixed Mustek URL. Added Trust comment @@ -958,13 +958,13 @@ lists from the backends' .desc files. * doc/sane.man: Added security to the list of topics that can be reported to me. - * doc/descripions/template.desc. + * doc/descripions/template.desc. doc/descriptions-external/template.desc.: Updated concerning ":new". 2002-07-03 Henning Meier-Geinitz * configure configure.in include/sane/config.h.in: Added HAVE_LIBUSB - #define. Check for usb_get_busses to make sure, we have at least + #define. Check for usb_get_busses to make sure, we have at least version 0.1.6. Added OS/2 substitution for strncasecmp. * include/sane/sanei_usb.h sanei/sanei_usb.c: Added support for libusb. * README.netbsd: Removed. Shared libraries are supported since 1.0.8. @@ -974,7 +974,7 @@ * include/sane/sanei_usb.h sanei/sanei_usb.c: Used dn (device number) instead of fd (file descriptor) to avoid confusion. Updated doxygen documentation. - * doc/sane-usb.man: Updated concerning libusb. Added tips for access + * doc/sane-usb.man: Updated concerning libusb. Added tips for access via the kernel scanner drivers. 2002-06-29 Matthew Duggan @@ -985,7 +985,7 @@ 2002-06-28 Henning Meier-Geinitz - * tools/sane-find-scanner.c: For HP-UX, check the complete + * tools/sane-find-scanner.c: For HP-UX, check the complete /dev/rscsi/ directory for SCSI sscanners, not only the device files for the first two host adapters. * TODO: Added entries about sanei_usb/ibusb, config.h/OS/2, echo -e @@ -994,10 +994,10 @@ 2002-06-27 Henning Meier-Geinitz - * doc/sane-fujitsu.man doc/sane-tamarack.man: Added newline at + * doc/sane-fujitsu.man doc/sane-tamarack.man: Added newline at the end to keep Solaris' sed happy. - * sanei/sanei_scsi.c: Set buffer size to 64 kB for - SOLARIS_USCSI_INTERFACE (reported by Ed Randall + * sanei/sanei_scsi.c: Set buffer size to 64 kB for + SOLARIS_USCSI_INTERFACE (reported by Ed Randall ). 2002-06-25 Henning Meier-Geinitz @@ -1010,7 +1010,7 @@ 2002-06-21 Max Vorobiev * backend/hpsj5s.c: added fcntl.h include directive. - + 2002-06-15 Andras Major * doc/sane-coolscan2.man: corrected stupid mistake. @@ -1035,7 +1035,7 @@ now stops if one of the essential headers isn't found. * backend/dll.conf: Added entry for test backend (commented out). * doc/backend-writing.txt: Mentioned descriptions.txt. - * bachend/test.c backend/test.conf backend/test.h + * bachend/test.c backend/test.conf backend/test.h backend/test-picture.c doc/descriptions/test.desc doc/sane-test.man: Added support for lineart mode with pixels_per_line not divisible by 8. Added support for padded image formats. Added documentation for @@ -1043,7 +1043,7 @@ 2002-06-07 Henning Meier-Geinitz - * backend/mustek.c doc/descriptions/mustek.desc + * backend/mustek.c doc/descriptions/mustek.desc doc/mustek/mustek.CHANGES: Fixed problem for Paragon 6000SP (color and gray modes produced solid black images). Minor cleanups. New version: 1.0-125. @@ -1061,7 +1061,7 @@ * backend/umax_pp.c: reverted a change in color reordering for 1600P * po/Makefile.in po/umax_pp.de.po: added german translation courtesy of Heiko Schaefer - + 2002-06-04 Rene Rebe @@ -1073,15 +1073,15 @@ * backend/umax_pp_low.c: relaxed scanner detection not to fail on some parports. - + 2002-06-02 Henning Meier-Geinitz - * configure configure.in backend/Makefile.in: Added option + * configure configure.in backend/Makefile.in: Added option --disable-local-backends to configure. Only net and dll will be compiled if set. Also a warning is printed. * TODO: Removed entries about config.h.in macros and disabling local backends. - + 2002-06-01 Henning Meier-Geinitz * backend/pnm.c-bad: Removed because it was out-of-date and buggy. @@ -1104,7 +1104,7 @@ 2002-05-30 Stéphane Voltz - * backend/umax_pp_low.c backend/umax_pp.c: fixed 1600P detection, + * backend/umax_pp_low.c backend/umax_pp.c: fixed 1600P detection, IRIX compile fixes, final bits of software lineart 2002-05-29 Henning Meier-Geinitz diff --git a/INSTALL.linux b/INSTALL.linux index 39a8da690..a6873ae63 100644 --- a/INSTALL.linux +++ b/INSTALL.linux @@ -142,7 +142,7 @@ $ make install $ cd ~ $ scanimage > test.pnm - + 3. Advanced Installation Information ==================================== diff --git a/NEWS b/NEWS index bf78d65a7..9ff64bf22 100644 --- a/NEWS +++ b/NEWS @@ -7,7 +7,7 @@ New with 1.0.27 (see Note 1), released 2017-05-22: * 30+ new scanner models supported. * Made libusb-1.0 the default for USB support (see Note 2). * Switched code from C90 to C99 (Thanks to Volker Diels-Grabsch). -* Updated Linux USB3 workaround (see Note 3). +* Updated Linux USB3 workaround (see Note 3). * Documentation and translation updates. * Bugfixes (Avahi, threading, USB, ICC/PNG/JPEG, etc). * Reduced compiler warnings, improved code (see Note 4). @@ -17,7 +17,7 @@ skipped so that our development version numbers would more clearly be an extension of the prior release. This should make packaging a little easier for our downstream users. -Note 2: On all systems, the --enable-libusb* flags are now ignored. +Note 2: 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 enabled if possible and disabled otherwise. If --with-usb is requested but not possible, @@ -113,7 +113,7 @@ New with 1.0.21, released 2010-04-25: New with 1.0.20, released 2009-05-03: * New backends: canon_dr (Canon DR-series), coolscan3 (Nikon LS & Coolscan), - rts8891 (Umax & HP 44xx), xerox_mfp (Samsung/Xerox/Dell MFPs) + rts8891 (Umax & HP 44xx), xerox_mfp (Samsung/Xerox/Dell MFPs) * Many backends updated. * 75 more scanner models supported. * New build system (thanks Chris and Olaf). @@ -132,7 +132,7 @@ New with 1.0.20, released 2009-05-03: New with 1.0.19, released 2008-02-10: -* New backends: cardscan (Corex Cardscan 800c), epjitsu (Epson-based Fujitsu), +* New backends: cardscan (Corex Cardscan 800c), epjitsu (Epson-based Fujitsu), epson2 (various Epson scanners), hp3900 (HP ScanJet 3970 and more), hp5590 (HP ScanJet 5590 and more), hpljm1005 (HP LaserJet M1005 and more), hs2p (Ricoh IS400 series) @@ -190,7 +190,7 @@ New with 1.0.16, released 2005-08-07: * Updated backends: avision, canon, coolscan, epson, gphoto2, gt68xx, mustek, mustek_pp, niash, plustek, plustek_pp, qcam, sm3600, snapscan, teco2, umax_pp, v4l. -* More functionality/fixes for sanei_usb and sanei_pp. +* More functionality/fixes for sanei_usb and sanei_pp. * Added sanei_access to allow locking of SANE devices. * Hotplug updates. * scanimage updates. @@ -294,7 +294,7 @@ New with 1.0.10, released 2003-02-01: New with 1.0.9, released 2002-10-24: -* New backends: hpsj5s (Hewlett-Packard ScanJet 5S parport scanner), +* New backends: hpsj5s (Hewlett-Packard ScanJet 5S parport scanner), teco2 (some Relisys/Primax SCSI flatbed scanners, models VM3575, VM6565, VM6586 and VM6575), teco3 (some Relisys/Piotech/Trust/Plustek SCSI flatbed scanners, model VM3552). @@ -314,9 +314,9 @@ New with 1.0.9, released 2002-10-24: New with 1.0.8, released 2002-05-27: -* New backends: canon_pp (Canon parport scanners), canon630u (CanoScan 630u +* New backends: canon_pp (Canon parport scanners), canon630u (CanoScan 630u + 636u), coolscan2 (Nikon Coolscan LS-30, LS-40 ED, LS-4000 ED, and - LS-8000 ED), fujitsu (M3091, M3093, M3096 and similar scanners), + LS-8000 ED), fujitsu (M3091, M3093, M3096 and similar scanners), leo (Leo/Across FS-1130 scanner), matsushita (Panasonic KV-SS scanners), sceptre (Sceptre VividScan S1200), teco1 (some Teco/Relisys flatbed scanners), test (test frontends and SANE installation). @@ -341,7 +341,7 @@ New with 1.0.7, released 2002-02-04: * Updated backends: avision (v 1.0.15), dc240 (v 0.0), dc25 (v 1.2), dll (v 1.0.5), epson (v 1.0.219), gphoto2 (v 0.0), microtek2 (v 0.95), mustek (1.0.118), mustek_usb (v 1.0.10), plustek (v 0.41), pnm (v 1.0.4), - sharp (v 0.32), snapscan (v 1.4.7), st400 (v 1.6), umax (v 1.0-32), + sharp (v 0.32), snapscan (v 1.4.7), st400 (v 1.6), umax (v 1.0-32), umax_pp (v 1.0.6). * Added support for translating backend options. * Added support for USB control messages and lm983x and pv6830 chipsets. @@ -357,7 +357,7 @@ New with 1.0.6, released 2001-11-05: * New backends: gphoto2 (backend for gphoto2 supported cameras), mustek_usb (for Mustek USB scanners 600CU, 1200CU(+), 1200UB). -* Updated backends: dc240 (v 0.0), epson (v 0.2.12), hp (0.95), +* Updated backends: dc240 (v 0.0), epson (v 0.2.12), hp (0.95), m3096g (v 1.11), microtek2 (v 0.95), mustek (v1.0-113), net (v 1.0.5), pie (1.0-7), pnm (1.0-2), snapscan (v 1.4.0), umax (1.0-31), umax_pp (1). * Added generic support for USB devices. @@ -475,22 +475,22 @@ New with 1.01: Scanning from the ADF therefore should work now. * Updated Microtek backend (by Matto Marjanovic) - o Fixed off-by-1 error in revision-number parsing. - o dump_inquiry() now prints the "Vendor Specific String". - o Added model code/vendor name for the other 600ZS. + o Fixed off-by-1 error in revision-number parsing. + o dump_inquiry() now prints the "Vendor Specific String". + o Added model code/vendor name for the other 600ZS. o Made get_scan_status() retry delay increase with each try (will - this help the poor 600ZS?). - o Corrected base resolution for Agfa StudioScan II/IIsi (400dpi). + this help the poor 600ZS?). + o Corrected base resolution for Agfa StudioScan II/IIsi (400dpi). o Disabled backend's clever aspect-ratio correction code for expanded-mode scans with StudioScan II/IIsi (scanner handles it - internally - smart scanner.) + internally - smart scanner.) o Fixed gamma LUT code parsing stupidity: now correctly determines maximum allowed LUT size, and uses it. (Especially - necessary for StudioScan II/IIsi.) + necessary for StudioScan II/IIsi.) o The E6 claims to only support 256-byte LUT's, but the backend - now ignores that misinformation (and uses 1024). + now ignores that misinformation (and uses 1024). o Now ignores denial of expanded-mode by older E6's (model code - 0x63), in addition to newer E6's. + 0x63), in addition to newer E6's. * Updated Microtek2 backend (by Bernd Schroeder) o Added support for non-blocking I/O. @@ -576,8 +576,8 @@ New with 1.00: * Updated Microtek backend (by Matto Marjanovic). - Fix segfault on exit due to unnecessary free() in sane_close(). - Fix to red channel shift bug (which crept in during rewrite of - color-handling code). - - Addition of "patch level" to version codes. + color-handling code). + - Addition of "patch level" to version codes. * Updated Microtek2 backend - Added support for ScanMaker 330, ScanMaker 636, ScanMaker E3plus, @@ -606,25 +606,25 @@ New with 1.00: - Resolutions >300dpi in color mode sometimes result in corrupted images (parts duplicated/shifted *HORIZONTALLY*) depending on hardware configuration. Killing all other applications and disabling swap - (if sufficient physical memory available) may help. - I added some code which writes to every page of the buffer prior + (if sufficient physical memory available) may help. + I added some code which writes to every page of the buffer prior to scanning to fool the memory management and scanned a full page color scan with 600dpi * 1200dpi. Very slow but image seemed ok - after pnmscale. + after pnmscale. - Max. scan area: 0-216mm (hor.), 2.5-294.5mm (ver.) The scanners can't scan the first 2.5mm (ver.), so you *MUST* specify the scan area according to this restriction! - The scanners support only lineart (1 bpp), gray (8 bpp), color (24 bpp). - Although the scanners have 10 bit (6000 SP) or 12 bit (12000 SP) + Although the scanners have 10 bit (6000 SP) or 12 bit (12000 SP) A/D-converters, they can send only 8 bit values to the host. The higher resolution may only be used via gamma table. - For compatibility only 256 entry gamma tables may be specified, the actual gamma table sent to the scanner is linearly interpolated from it. - - In lineart mode only brightness may be adjusted. + - In lineart mode only brightness may be adjusted. - Cover open/closed reported only via debug output and ignored otherwise. - Use of SCSI card supplied with scanner is *NOT* recommended. (Don't forget termination!) - + * Updated UMAX backend (by Oliver Rauch) - added output of umax-backend-version in sane_init - added Linotype Hell Jade2 (Vobis ScanBoostar Premium) @@ -696,13 +696,13 @@ New with 0.74: but the code is now leaner and cleaner. o fixed the bugs that the backend didn't compile with non gcc compilers. o added an option to control exposure times. - o rewrote the code that processes the data that is received from the + o rewrote the code that processes the data that is received from the scanner and transfers it into the frontend buffer. The smallest unit of data that can be copied into the frontend buffer is now a pixel, no longer a complete line. o added (a yet) undocumented option "strip-height" that allows to control the number of lines that is read from the scanner with one "read image". - o fixed a bug that caused scanimage to sigsegv when calling sane_exit() + o fixed a bug that caused scanimage to sigsegv when calling sane_exit() without having written all data into the output file. o added code to support scanners with more than 8 bit output per color. Due to the lack of such a scanner this functionality is COMPLETELY UNTESTED @@ -727,20 +727,20 @@ New with 0.74: * Updated Nikon Coolscan backend (by Didier Carlier). * Updated UMAX backend (by Oliver Rauch): - o Cancelling a scan now works, cancelling a preview still makes problems! + o Cancelling a scan now works, cancelling a preview still makes problems! o Preview fix is activated for Astra 600S, Astra 610S and Vista S6E - scanners. (calibration by driver still does not work for these scanners). - - removed button for preview patch - o Quality calibration / calibration by driver now works for same scanners. - - added selection for type of shading data calculation - o Solved problem with black area at top of the image - (happend only with some SCSI-adapters). - o Added gamma download format type 0 and type 1 for older scanners. - o Added Astra 1220S as supported scanner: - - added 36 gamma input bits support for Astra 1220S + scanners. (calibration by driver still does not work for these scanners). + - removed button for preview patch + o Quality calibration / calibration by driver now works for same scanners. + - added selection for type of shading data calculation + o Solved problem with black area at top of the image + (happend only with some SCSI-adapters). + o Added gamma download format type 0 and type 1 for older scanners. + o Added Astra 1220S as supported scanner: + - added 36 gamma input bits support for Astra 1220S - added 36 output bits support, but there is no frontend that can - handle it! - o Added inquiry for Escom Image Scanner 256 (UMAX UG80). + handle it! + o Added inquiry for Escom Image Scanner 256 (UMAX UG80). * OS/2 (by Yuri Dario): o Updated SCSI support so sanei_scsi_find_devices is supported now. @@ -786,7 +786,7 @@ New with 0.73: - scalar gamma correction. Options that are not yet supported include: - + - 3-pass scanners - more than 8 bit per color output data. Provisions are made here and there in the code, to support more than 8 bit, but that's diff --git a/README.aix b/README.aix index b43dc3e4c..cfe50e418 100644 --- a/README.aix +++ b/README.aix @@ -1,7 +1,7 @@ Under AIX, you'll need the generic SCSI device driver gsc written by Matthew Jacob (nice piece of work!). When you install this driver, copy the header file gscdds.h to /usr/include, as -we look for it there. +we look for it there. Find this driver under: ftp://ftp.feral.com/pub/aix/gsc.tar.gz diff --git a/README.beos b/README.beos index e56b82c50..087b514e1 100644 --- a/README.beos +++ b/README.beos @@ -25,5 +25,5 @@ Compiler: gcc 2.95.3 User-level SCSI support: yes USB support: yes Shared library support: yes -Dynamic loading support: yes +Dynamic loading support: yes X11 clients: no diff --git a/README.djpeg b/README.djpeg index 8a456f955..7bc73d1f8 100644 --- a/README.djpeg +++ b/README.djpeg @@ -2,7 +2,7 @@ The JPEG decoder in SANE is taken mostly without change from The Independent JPEG Group's JPEG software, release 6a. Their "djpeg.README" file is included below. The only changes are to file names, e.g. djpeg.c -> sanei_jpeg.c, and function names, -e.g. sanei_jpeg_start_output_ppm() +e.g. sanei_jpeg_start_output_ppm() The Independent JPEG Group's JPEG software diff --git a/README.freebsd b/README.freebsd index 68cf1a860..b423b28a1 100644 --- a/README.freebsd +++ b/README.freebsd @@ -3,11 +3,11 @@ SANE and FreeBSD Building: --------- -Don't forget to use GNU make (gmake). E.g. "MAKE=gmake ./configure". +Don't forget to use GNU make (gmake). E.g. "MAKE=gmake ./configure". SANE should compile and install out-of-the-box. If you've installed some of the optional libraries that sane-backends -can make use of (see README for list) using Ports then you will need to +can make use of (see README for list) using Ports then you will need to let configure know about their locations: MAKE=gmake CPPFLAGS=-I/usr/local/include LDFLAGS=-L/usr/local/lib ./configure diff --git a/README.hp-ux b/README.hp-ux index 2333ef063..fb4dc1858 100644 --- a/README.hp-ux +++ b/README.hp-ux @@ -49,17 +49,17 @@ Class I H/W Path Driver S/W State H/W Type Description ============================================================================== [...] ext_bus 0 8/0/19/0 c720 CLAIMED INTERFACE Ultra Wide SCSI -target 0 8/0/19/0.6 tgt CLAIMED DEVICE +target 0 8/0/19/0.6 tgt CLAIMED DEVICE disk 0 8/0/19/0.6.0 sdisk CLAIMED DEVICE IBM DDYS-T09170N -target 1 8/0/19/0.7 tgt CLAIMED DEVICE +target 1 8/0/19/0.7 tgt CLAIMED DEVICE ctl 0 8/0/19/0.7.0 sctl CLAIMED DEVICE Initiator [...] ext_bus 1 8/16/5 c720 CLAIMED INTERFACE Built-in SCSI -target 4 8/16/5.1 tgt CLAIMED DEVICE +target 4 8/16/5.1 tgt CLAIMED DEVICE unknown -1 8/16/5.1.0 UNCLAIMED UNKNOWN EPSON Perfection1640 -target 2 8/16/5.2 tgt CLAIMED DEVICE +target 2 8/16/5.2 tgt CLAIMED DEVICE disk 1 8/16/5.2.0 sdisk CLAIMED DEVICE TOSHIBA CD-ROM XM-5401TA -target 3 8/16/5.7 tgt CLAIMED DEVICE +target 3 8/16/5.7 tgt CLAIMED DEVICE ctl 1 8/16/5.7.0 sctl CLAIMED DEVICE Initiator [...] diff --git a/README.linux b/README.linux index f255c3bd6..459e57d42 100644 --- a/README.linux +++ b/README.linux @@ -68,7 +68,7 @@ Example: # cat /proc/scsi/scsi Host: scsi0 Channel: 00 Id: 06 Lun: 00 Vendor: SCANNER Model: Rev: 2.02 - Type: Scanner ANSI SCSI revision: 01 CCS + Type: Scanner ANSI SCSI revision: 01 CCS In this case the real vendor and scanner name are not shown (Mustek Scannexpress 12000SP) but SANE will detect it nevertheless. @@ -76,7 +76,7 @@ Scannexpress 12000SP) but SANE will detect it nevertheless. If your scanner is supported by SANE, scanimage -L will list it now: # scanimage -L -device mustek:/dev/scanner' is a Mustek ScanExpress 12000SP flatbed scanner +device mustek:/dev/scanner' is a Mustek ScanExpress 12000SP flatbed scanner If this doesn't work you may have to add the right SCSI generic device name to the configuration file. This should be documented in the man page for @@ -85,7 +85,7 @@ your backend. To find out about the right SCSI device use sane-find-scanner: # sane-find-scanner found SCSI scanner "SCANNER 2.02" at /dev/scanner found SCSI scanner "SCANNER 2.02" at /dev/sg0 -found SCSI scanner "SCANNER 2.02" at /dev/sga +found SCSI scanner "SCANNER 2.02" at /dev/sga It may help to set a symbolic link /dev/scanner to the respective device if automatic detection does not work. @@ -98,10 +98,10 @@ in devfs". Adaptec 1542 SCSI adapter: Using buffer sizes of more than 32768 bytes with the aha1542 driver can - lead to kernel panic with older kernels. To avoid this, run configure with + lead to kernel panic with older kernels. To avoid this, run configure with the option --enable-scsibuffersize or set the environment variable - SANE_SG_BUFFERSIZE to 32768 before running scanimage or another frontend, - or download and install the SG driver 2.1.37 or newer from + SANE_SG_BUFFERSIZE to 32768 before running scanimage or another frontend, + or download and install the SG driver 2.1.37 or newer from http://www.torque.net/sg. idescsi: @@ -110,10 +110,10 @@ idescsi: SANE. If your scanner isn't found or you encounter segmentation faults try to disable idescsi. -SCSI Direct IO: Recent versions of the Linux SG driver for the 2.4 kernels - support direct IO, i.e., the SCSI adapter's DMA chip copies data directly - to/from user memory. Direct IO reduces memory usage, but it can lead to - access conflicts, if a backend uses shared memory. SANE does not use +SCSI Direct IO: Recent versions of the Linux SG driver for the 2.4 kernels + support direct IO, i.e., the SCSI adapter's DMA chip copies data directly + to/from user memory. Direct IO reduces memory usage, but it can lead to + access conflicts, if a backend uses shared memory. SANE does not use direct IO by default. If you want to use it, run configure --enable-scsi-directio=yes diff --git a/README.netbsd b/README.netbsd index ceab0b979..330f9490b 100644 --- a/README.netbsd +++ b/README.netbsd @@ -3,7 +3,7 @@ SANE and NetBSD Building: --------- -Don't forget to use GNU make (gmake). E.g. "MAKE=gmake ./configure". +Don't forget to use GNU make (gmake). E.g. "MAKE=gmake ./configure". SANE should compile and install out-of-the-box. SCSI-scanners: diff --git a/README.openbsd b/README.openbsd index 211ab0674..29170f689 100644 --- a/README.openbsd +++ b/README.openbsd @@ -3,7 +3,7 @@ SANE and OpenBSD Building: --------- -Don't forget to use GNU make (gmake). E.g. "MAKE=gmake ./configure". +Don't forget to use GNU make (gmake). E.g. "MAKE=gmake ./configure". SANE should compile and install out-of-the-box. If some libraries and headers (like libjpeg) are installed in /usr/local/, adding diff --git a/README.os2 b/README.os2 index 71cb8d80b..eb42dcda9 100644 --- a/README.os2 +++ b/README.os2 @@ -21,19 +21,19 @@ SANE (actually EMX 0.9D fix 03). SANE (Scanner Access Now Easy) ------------------------------ -For more info about the SANE Project, please visit +For more info about the SANE Project, please visit http://www.sane-project.org/ You should also check the main site for an updated list of supported scanners. -Note that I can't say you if your scanner is supported; check SANE homepage +Note that I can't say you if your scanner is supported; check SANE homepage instead. SUPPORT ------- -I'm sorry to tell you that it is hard for me to help you: if your scanner +I'm sorry to tell you that it is hard for me to help you: if your scanner doesn't work or your problem can't be reproduced on my pc, there are high choices that I can't fix the bug. Most problems are specific to same PC/scanner combinations, and can't be solved without having a full developement enviroment @@ -61,7 +61,7 @@ file, he is welcome (actually I'm using groff). INSTALLATION ------------ -If you already didn't it, install the correct driver for your scsi adapter. +If you already didn't it, install the correct driver for your scsi adapter. The drivers has usually a .ADD extension and looks like BASEDEV=AHA154X.ADD @@ -71,7 +71,7 @@ directory, so you have only to add BASEDEV=OS2ASPI.DMD /ALL -The /ALL switch is required only if you need to use other devices with +The /ALL switch is required only if you need to use other devices with aspirout.sys, e.g. if you have a CD-RW and CDRecord/2 installed. Last, add aspirout.sys to your config.sys @@ -86,7 +86,7 @@ available on Hobbes or Leo as emxrt.zip. find-scanner.exe can be used to recognize a scanner on the scsi bus. Then you should edit your xxx.conf file and add the scanner address, a string like -b0t4l0. This can be simplified using autodetection: with autodetection you can +b0t4l0. This can be simplified using autodetection: with autodetection you can use a string like scsi EPSON @@ -104,7 +104,7 @@ you should see your scanner following the list of internal devices: pnm:0 pnm:1 If it is not present, check your scsi driver, the aspi driver OS2ASPI.DMD and -aspirout.sys; on Warp4 you can use the Hardware Manager to check scanner +aspirout.sys; on Warp4 you can use the Hardware Manager to check scanner presence. Then look at your xxx.conf, maybe there is something wrong in the text. @@ -115,7 +115,7 @@ Once configured your system, create a proper .conf file (edit one of the supplied templates) and run scanimage -L - + The output should be like device `umax:b0t3l0' is a UMAX Vista-S8 flatbed scanner @@ -131,8 +131,8 @@ A simple scan will do a scan with default parameters. Run - scanimage -d umax --help - + scanimage -d umax --help + to get a full list of available switches. @@ -155,7 +155,7 @@ of scanimage.exe: here you have to add a list of valid saned servers. Run scanimage -L - + The output is like this device `umax:b0t3l0' is a UMAX Vista-S8 flatbed scanner @@ -174,7 +174,7 @@ Be aware that this configuration shouldn't work: I have been unable to get it working on my PC without running saned under the debugger PMGDB. The correct syntax for running scanimage over the net is - scanimage -d net:HOSTNAME:umax:b0t3l0 > test.pnm + scanimage -d net:HOSTNAME:umax:b0t3l0 > test.pnm where HOSTNAME is a valid DNS host name. You can log server access using syslogd: if syslogd is running, saned will @@ -199,10 +199,10 @@ Steps: - unzip this file somewhere; - copy src\* into sane-1.0.1; - enter sane-1.0.1 directory; -- apply patches to original distribution: +- apply patches to original distribution: [...\sane-1.0.1]gnupatch -p 0 < patch.os2 - run autoconf to rebuild the configure script -- edit configure and change autoconf default optimization flags; +- edit configure and change autoconf default optimization flags; search for -O2 -m486 and change to your preferred settings; - add the following line after :${LDFLAGS="...."} : ${LIBS="-lsocket"} @@ -211,15 +211,15 @@ Steps: - run make (compiler warnings are ok); - wait to complete all makes; -Remember to install a Unix like shell in your path; I use ksh.exe -renamed to sh.exe, and saved in d:\bin +Remember to install a Unix like shell in your path; I use ksh.exe +renamed to sh.exe, and saved in d:\bin (that's because most unix scripts uses SHELL=/bin/sh) You need also a compatible dl.a and syslog.a library; look in .\contrib for a couple of simple sources. Flags needed under EMX: --Zsysv-signals enables signal management as in SystemV, otherwise emx +-Zsysv-signals enables signal management as in SystemV, otherwise emx convention is used (and it is different from sysv). -Zcrtdll link dynamically with EMXLIBCM.DLL; diff --git a/README.solaris b/README.solaris index 240ee6ff7..12dae0505 100644 --- a/README.solaris +++ b/README.solaris @@ -92,7 +92,7 @@ can be found in To install it on a SPARC do: - cd /tmp + cd /tmp get SCHILYscg.sparc.tar.Z uncompress SCHILYscg.sparc.tar.Z tar -xvf SCHILYscg.sparc.tar @@ -105,7 +105,7 @@ NOTE: Be very careful with pkgadd as it does not check for the correct For Solaris on an x86 do: - cd /tmp + cd /tmp get SCHILYscg.i386.tar.Z uncompress SCHILYscg.i386.tar.Z tar -xvf SCHILYscg.i386.tar diff --git a/README.unixware7 b/README.unixware7 index 9e6d3cd94..7a48233b1 100644 --- a/README.unixware7 +++ b/README.unixware7 @@ -1,79 +1,79 @@ -SANE on UnixWare 7 -================== +SANE on UnixWare 7 +================== -The easiest way to get SANE working on a UnixWare 7.1.X system (UW 7.0.0 -and 7.0.1 are not supported) is to download and install the SANE binary -distribution from SCOs Skunkware web site. The URL is: +The easiest way to get SANE working on a UnixWare 7.1.X system (UW 7.0.0 +and 7.0.1 are not supported) is to download and install the SANE binary +distribution from SCOs Skunkware web site. The URL is: - ftp://ftp.sco.com/skunkware/uw7/Packages + ftp://ftp.sco.com/skunkware/uw7/Packages -Use the pkgadd command to install the files, e.g.: +Use the pkgadd command to install the files, e.g.: - # pkgadd -d `pwd`/sane-1.0.2.pkg + # pkgadd -d `pwd`/sane-1.0.2.pkg -A web page with further information specific to SANE on UnixWare 7 can be -found here: +A web page with further information specific to SANE on UnixWare 7 can be +found here: - http://www.sco.com/skunkware/sane/index.html + http://www.sco.com/skunkware/sane/index.html -However, please note that the SANE package that is available from the -Skunkware server will most likely contain the latest stable version of -SANE. Since SANE is continously being worked on, you might want to download +However, please note that the SANE package that is available from the +Skunkware server will most likely contain the latest stable version of +SANE. Since SANE is continously being worked on, you might want to download the latest source from the Git repository and build the source yourself. -To build SANE on a UnixWare 7.1.X system the following packages are required: +To build SANE on a UnixWare 7.1.X system the following packages are required: - * make (GNU make) + * make (GNU make) * glibs (contains gtk, glib, libjpeg, libpnm, libtiff etc.; only necessary for frontends xscanimage, xcam, and xsane which are - distributed separately) + distributed separately) -The packages can be downloaded from the Skunkware ftp server (see URL above). -I've used the following versions to build sane-1.0.2: +The packages can be downloaded from the Skunkware ftp server (see URL above). +I've used the following versions to build sane-1.0.2: - * make-3.78.1.pkg - * glibs-2.0.3.pkg + * make-3.78.1.pkg + * glibs-2.0.3.pkg -If you want to include support for The Gimp (this is optional), you need to -install the gimp package, too. This is the version I've used: +If you want to include support for The Gimp (this is optional), you need to +install the gimp package, too. This is the version I've used: - * gimp-1.0.4.pkg + * gimp-1.0.4.pkg -GCC is not required. SANE compiles quite happily (and faster) with UnixWares -native C compiler. +GCC is not required. SANE compiles quite happily (and faster) with UnixWares +native C compiler. -Set the LD_RUN_PATH variable to add /usr/local/lib to the list of directories -to be searched by the dynamic linker: +Set the LD_RUN_PATH variable to add /usr/local/lib to the list of directories +to be searched by the dynamic linker: - $ LD_RUN_PATH=/usr/local/lib - $ export LD_RUN_PATH + $ LD_RUN_PATH=/usr/local/lib + $ export LD_RUN_PATH -Run the configure script as following: +Run the configure script as following: - $ LIBS="-lsdi" ./configure + $ LIBS="-lsdi" ./configure -(The sdi library contains the SCSI passthrough functions the UW7 port of SANE -uses to access the scanner from user space.) +(The sdi library contains the SCSI passthrough functions the UW7 port of SANE +uses to access the scanner from user space.) -Run gmake to build SANE: +Run gmake to build SANE: - $ gmake + $ gmake -SCSI access from user space requires special privileges. If you want users -without root perms to be able to use the scanner you can use the filepriv -command to change the privileges that are associated with the SANE -applications: +SCSI access from user space requires special privileges. If you want users +without root perms to be able to use the scanner you can use the filepriv +command to change the privileges that are associated with the SANE +applications: - # /sbin/filepriv -f driver -f sysops /usr/local/bin/scanimage - # /sbin/filepriv -f driver -f sysops /usr/local/bin/xscanimage - # /sbin/filepriv -f sysops /usr/local/bin/xcam + # /sbin/filepriv -f driver -f sysops /usr/local/bin/scanimage + # /sbin/filepriv -f driver -f sysops /usr/local/bin/xscanimage + # /sbin/filepriv -f sysops /usr/local/bin/xcam -If you have built SANE with support for The Gimp you might want to create -a symlink from the plug-in directory to the xscanimage and xcam binaries, -e.g.: +If you have built SANE with support for The Gimp you might want to create +a symlink from the plug-in directory to the xscanimage and xcam binaries, +e.g.: - # ln -s /usr/local/bin/xscanimage \ - /usr/local/lib/gimp/1.0/plug-ins/xscanimage - # ln -s /usr/local/bin/xcam /usr/local/lib/gimp/1.0/plug-ins/xcam + # ln -s /usr/local/bin/xscanimage \ + /usr/local/lib/gimp/1.0/plug-ins/xscanimage + # ln -s /usr/local/bin/xcam /usr/local/lib/gimp/1.0/plug-ins/xcam Questions? Comments? Please send e-mail to jenss@sco.com or skunkware@sco.com! diff --git a/README.zeta b/README.zeta index 36f638248..9c0028e6c 100644 --- a/README.zeta +++ b/README.zeta @@ -1,8 +1,8 @@ SANE and Zeta ------------- -The Zeta port is based on existing BeOS port, with some changes -to accomodate yellowTAB's internal build procedure, and some new +The Zeta port is based on existing BeOS port, with some changes +to accomodate yellowTAB's internal build procedure, and some new conventions brought up by Zeta. Cf. README.beos for more historical stuff. @@ -22,5 +22,5 @@ Compiler: gcc 2.95.3 User-level SCSI support: yes USB support: yes Shared library support: yes -Dynamic loading support: yes +Dynamic loading support: yes X11 clients: no diff --git a/acinclude.m4 b/acinclude.m4 index 476d53658..09a9dd2dd 100644 --- a/acinclude.m4 +++ b/acinclude.m4 @@ -40,7 +40,7 @@ if test "${ac_cv_c_compiler_gnu}" = "yes"; then AS_HELP_STRING([--enable-warnings], [turn on tons of compiler warnings (GCC only)]), [ - if eval "test x$enable_warnings = xyes"; then + if eval "test x$enable_warnings = xyes"; then for flag in $EXTRA_WARNINGS; do JAPHAR_GREP_AM_CFLAGS($flag, [ AM_CFLAGS="$AM_CFLAGS $flag" ]) done @@ -97,7 +97,7 @@ AC_DEFUN([SANE_SET_AM_LDFLAGS], esac fi AC_SUBST(STRICT_LDFLAGS) - case "${host_os}" in + case "${host_os}" in aix*) #enable .so libraries, disable archives AM_LDFLAGS="$AM_LDFLAGS -Wl,-brtl" ;; @@ -180,7 +180,7 @@ AC_DEFUN([SANE_CHECK_IEEE1284], AC_CHECK_HEADER(ieee1284.h, [ AC_CACHE_CHECK([for libieee1284 >= 0.1.5], sane_cv_use_libieee1284, [ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include ]], [[ - struct parport p; char *buf; + struct parport p; char *buf; ieee1284_nibble_read(&p, 0, buf, 1); ]])], [sane_cv_use_libieee1284="yes"; IEEE1284_LIBS="-lieee1284" @@ -234,7 +234,7 @@ AC_DEFUN([SANE_CHECK_PTHREAD], LIBS="$save_LIBS" ],[ have_pthread=no; use_pthread=no ]) fi - + if test $use_pthread = yes ; then AC_DEFINE_UNQUOTED(USE_PTHREAD, "$use_pthread", [Define if pthreads should be used instead of forked processes.]) @@ -257,9 +257,9 @@ AC_DEFUN([SANE_CHECK_PTHREAD], # GPHOTO2 and dell1600n_net backends. AC_DEFUN([SANE_CHECK_JPEG], [ - AC_CHECK_LIB(jpeg,jpeg_start_decompress, + AC_CHECK_LIB(jpeg,jpeg_start_decompress, [ - AC_CHECK_HEADER(jconfig.h, + AC_CHECK_HEADER(jconfig.h, [ AC_MSG_CHECKING([for jpeglib - version >= 61 (6a)]) AC_EGREP_CPP(sane_correct_jpeg_lib_version_found, @@ -268,7 +268,7 @@ AC_DEFUN([SANE_CHECK_JPEG], #if JPEG_LIB_VERSION >= 61 sane_correct_jpeg_lib_version_found #endif - ], [sane_cv_use_libjpeg="yes"; JPEG_LIBS="-ljpeg"; + ], [sane_cv_use_libjpeg="yes"; JPEG_LIBS="-ljpeg"; AC_MSG_RESULT(yes)],[AC_MSG_RESULT(no)]) ],) ],) @@ -281,9 +281,9 @@ AC_DEFUN([SANE_CHECK_JPEG], # Checks for tiff library dell1600n_net backend. AC_DEFUN([SANE_CHECK_TIFF], [ - AC_CHECK_LIB(tiff,TIFFFdOpen, + AC_CHECK_LIB(tiff,TIFFFdOpen, [ - AC_CHECK_HEADER(tiffio.h, + AC_CHECK_HEADER(tiffio.h, [sane_cv_use_libtiff="yes"; TIFF_LIBS="-ltiff"],) ],) AC_SUBST(TIFF_LIBS) @@ -345,7 +345,7 @@ AC_DEFUN([SANE_CHECK_LOCKING], fi if test $use_locking = yes ; then INSTALL_LOCKPATH=install-lockpath - AC_DEFINE([ENABLE_LOCKING], 1, + AC_DEFINE([ENABLE_LOCKING], 1, [Define to 1 if device locking should be enabled.]) else INSTALL_LOCKPATH= @@ -397,13 +397,13 @@ AC_DEFUN([SANE_CHECK_GPHOTO2], [# If --with-gphoto2=no or --without-gphoto2, disable backend # as "$with_gphoto2" will be set to "no"]) - # If --with-gphoto2=yes (or not supplied), first check if + # If --with-gphoto2=yes (or not supplied), first check if # pkg-config exists, then use it to check if libgphoto2 is # present. If all that works, then see if we can actually link - # a program. And, if that works, then add the -l flags to - # GPHOTO2_LIBS and any other flags to GPHOTO2_LDFLAGS to pass to + # a program. And, if that works, then add the -l flags to + # GPHOTO2_LIBS and any other flags to GPHOTO2_LDFLAGS to pass to # sane-config. - if test "$with_gphoto2" != "no" ; then + if test "$with_gphoto2" != "no" ; then AC_CHECK_TOOL(HAVE_GPHOTO2, pkg-config, false) if test ${HAVE_GPHOTO2} != "false" ; then @@ -427,8 +427,8 @@ AC_DEFUN([SANE_CHECK_GPHOTO2], HAVE_GPHOTO2=false fi if test "${HAVE_GPHOTO2}" = "false"; then - GPHOTO2_CPPFLAGS="" - GPHOTO2_LIBS="" + GPHOTO2_CPPFLAGS="" + GPHOTO2_LIBS="" else SANE_EXTRACT_LDFLAGS(GPHOTO2_LIBS, GPHOTO2_LDFLAGS) if pkg-config --atleast-version=2.5.0 libgphoto2; then @@ -448,31 +448,31 @@ AC_DEFUN([SANE_CHECK_GPHOTO2], # Check for ss_family member in struct sockaddr_storage AC_DEFUN([SANE_CHECK_IPV6], [ - AC_MSG_CHECKING([whether to enable IPv6]) - AC_ARG_ENABLE(ipv6, + AC_MSG_CHECKING([whether to enable IPv6]) + AC_ARG_ENABLE(ipv6, AS_HELP_STRING([--disable-ipv6],[disable IPv6 support]), [ if test "$enableval" = "no" ; then - AC_MSG_RESULT([no, manually disabled]) - ipv6=no + AC_MSG_RESULT([no, manually disabled]) + ipv6=no fi ]) if test "$ipv6" != "no" ; then AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ - #define INET6 - #include + #define INET6 + #include #include ]], [[ - /* AF_INET6 available check */ - if (socket(AF_INET6, SOCK_STREAM, 0) < 0) - exit(1); - else - exit(0); + /* AF_INET6 available check */ + if (socket(AF_INET6, SOCK_STREAM, 0) < 0) + exit(1); + else + exit(0); ]])],[ - AC_MSG_RESULT(yes) - AC_DEFINE([ENABLE_IPV6], 1, [Define to 1 if the system supports IPv6]) + AC_MSG_RESULT(yes) + AC_DEFINE([ENABLE_IPV6], 1, [Define to 1 if the system supports IPv6]) ipv6=yes ],[ - AC_MSG_RESULT([no (couldn't compile test program)]) + AC_MSG_RESULT([no (couldn't compile test program)]) ipv6=no ]) fi @@ -507,7 +507,7 @@ AC_DEFUN([SANE_CHECK_IPV6], ipv6=no ]) ]) - fi + fi ]) # @@ -527,7 +527,7 @@ for be in ${BACKENDS}; do case $be in plustek_pp) case "$host_os" in - gnu*) + gnu*) echo "*** $be backend not supported on GNU/Hurd - $DISABLE_MSG" backend_supported="no" ;; @@ -555,7 +555,7 @@ for be in ${BACKENDS}; do fi ;; - dell1600n_net) + dell1600n_net) if test "${sane_cv_use_libjpeg}" != "yes" || test "${sane_cv_use_libtiff}" != "yes"; then echo "*** $be backend requires JPEG and TIFF library - $DISABLE_MSG" backend_supported="no" diff --git a/backend/Makefile.am b/backend/Makefile.am index f7fb403c6..3ae27904c 100644 --- a/backend/Makefile.am +++ b/backend/Makefile.am @@ -93,8 +93,8 @@ install-data-hook: install-becfg install-firmware-path $(INSTALL_LOCKPATH) # files that have been previously installed so that user modifications # are not lost. install-becfg: - @# Libtool has a bug where it will sometimes symlink the last - @# installed library in $(sanelibdir) to $(sanelibdir)/libsane.*. + @# Libtool has a bug where it will sometimes symlink the last + @# installed library in $(sanelibdir) to $(sanelibdir)/libsane.*. @# Having two libsane's can cause issues so get rid of it. -rm -f $(DESTDIR)$(sanelibdir)/libsane.* test -z "$(configdir)" || $(MKDIR_P) "$(DESTDIR)$(configdir)" @@ -217,7 +217,7 @@ COMMON_LIBS = ../lib/liblib.la # all related files within backend directory. General guideline # is to have a ${backend}.c and ${backend}.h. Some backends also # add a few support source files to convience library. -# Note: automake doesn't really use header files listed here. +# Note: automake doesn't really use header files listed here. # They are indications that they need to be distributed only. libabaton_la_SOURCES = abaton.c abaton.h libabaton_la_CPPFLAGS = $(AM_CPPFLAGS) -DBACKEND_NAME=abaton @@ -228,7 +228,7 @@ libabaton_la_CPPFLAGS = $(AM_CPPFLAGS) -DBACKEND_NAME=abaton # Also, it will need to link in related convenience library as well as # any external libraries required to resolve symbols. # -# All backends should include $(DIST_SANELIBS_LDFLAGS) so that +# All backends should include $(DIST_SANELIBS_LDFLAGS) so that # library is correctly versioned. # # If a backend has a config file, it must be listed here to get distributed. @@ -239,10 +239,10 @@ libsane_abaton_la_LIBADD = $(COMMON_LIBS) libabaton.la ../sanei/sanei_init_debug EXTRA_DIST += abaton.conf.in libagfafocus_la_SOURCES = agfafocus.c agfafocus.h -libagfafocus_la_CPPFLAGS = $(AM_CPPFLAGS) -DBACKEND_NAME=agfafocus +libagfafocus_la_CPPFLAGS = $(AM_CPPFLAGS) -DBACKEND_NAME=agfafocus nodist_libsane_agfafocus_la_SOURCES = agfafocus-s.c -libsane_agfafocus_la_CPPFLAGS = $(AM_CPPFLAGS) -DBACKEND_NAME=agfafocus +libsane_agfafocus_la_CPPFLAGS = $(AM_CPPFLAGS) -DBACKEND_NAME=agfafocus libsane_agfafocus_la_LDFLAGS = $(DIST_SANELIBS_LDFLAGS) libsane_agfafocus_la_LIBADD = $(COMMON_LIBS) libagfafocus.la ../sanei/sanei_init_debug.lo ../sanei/sanei_constrain_value.lo ../sanei/sanei_config.lo ../sanei/sanei_config2.lo sane_strstatus.lo ../sanei/sanei_thread.lo ../sanei/sanei_scsi.lo $(SCSI_LIBS) $(PTHREAD_LIBS) $(RESMGR_LIBS) EXTRA_DIST += agfafocus.conf.in @@ -280,12 +280,12 @@ libas6e_la_CPPFLAGS = $(AM_CPPFLAGS) -DBACKEND_NAME=as6e nodist_libsane_as6e_la_SOURCES = as6e-s.c libsane_as6e_la_CPPFLAGS = $(AM_CPPFLAGS) -DBACKEND_NAME=as6e libsane_as6e_la_LDFLAGS = $(DIST_SANELIBS_LDFLAGS) -libsane_as6e_la_LIBADD = $(COMMON_LIBS) libas6e.la ../sanei/sanei_init_debug.lo ../sanei/sanei_constrain_value.lo ../sanei/sanei_config.lo sane_strstatus.lo +libsane_as6e_la_LIBADD = $(COMMON_LIBS) libas6e.la ../sanei/sanei_init_debug.lo ../sanei/sanei_constrain_value.lo ../sanei/sanei_config.lo sane_strstatus.lo libavision_la_SOURCES = avision.c avision.h libavision_la_CPPFLAGS = $(AM_CPPFLAGS) -DBACKEND_NAME=avision -nodist_libsane_avision_la_SOURCES = avision-s.c +nodist_libsane_avision_la_SOURCES = avision-s.c libsane_avision_la_CPPFLAGS = $(AM_CPPFLAGS) -DBACKEND_NAME=avision libsane_avision_la_LDFLAGS = $(DIST_SANELIBS_LDFLAGS) libsane_avision_la_LIBADD = $(COMMON_LIBS) libavision.la ../sanei/sanei_init_debug.lo ../sanei/sanei_constrain_value.lo ../sanei/sanei_config.lo ../sanei/sanei_config2.lo sane_strstatus.lo ../sanei/sanei_usb.lo ../sanei/sanei_thread.lo ../sanei/sanei_scsi.lo $(MATH_LIB) $(SCSI_LIBS) $(USB_LIBS) $(PTHREAD_LIBS) $(RESMGR_LIBS) @@ -303,7 +303,7 @@ EXTRA_DIST += bh.conf.in libcanon_la_SOURCES = canon.c canon.h libcanon_la_CPPFLAGS = $(AM_CPPFLAGS) -DBACKEND_NAME=canon -nodist_libsane_canon_la_SOURCES = canon-s.c +nodist_libsane_canon_la_SOURCES = canon-s.c libsane_canon_la_CPPFLAGS = $(AM_CPPFLAGS) -DBACKEND_NAME=canon libsane_canon_la_LDFLAGS = $(DIST_SANELIBS_LDFLAGS) libsane_canon_la_LIBADD = $(COMMON_LIBS) libcanon.la ../sanei/sanei_init_debug.lo ../sanei/sanei_constrain_value.lo ../sanei/sanei_config.lo ../sanei/sanei_config2.lo sane_strstatus.lo ../sanei/sanei_scsi.lo $(MATH_LIB) $(SCSI_LIBS) $(RESMGR_LIBS) @@ -325,7 +325,7 @@ EXTRA_DIST += canon630u-common.c lm9830.h libcanon_dr_la_SOURCES = canon_dr.c canon_dr.h canon_dr-cmd.h libcanon_dr_la_CPPFLAGS = $(AM_CPPFLAGS) -DBACKEND_NAME=canon_dr -nodist_libsane_canon_dr_la_SOURCES = canon_dr-s.c +nodist_libsane_canon_dr_la_SOURCES = canon_dr-s.c libsane_canon_dr_la_CPPFLAGS = $(AM_CPPFLAGS) -DBACKEND_NAME=canon_dr libsane_canon_dr_la_LDFLAGS = $(DIST_SANELIBS_LDFLAGS) libsane_canon_dr_la_LIBADD = $(COMMON_LIBS) libcanon_dr.la ../sanei/sanei_init_debug.lo ../sanei/sanei_constrain_value.lo ../sanei/sanei_config.lo ../sanei/sanei_config2.lo sane_strstatus.lo ../sanei/sanei_usb.lo ../sanei/sanei_scsi.lo ../sanei/sanei_magic.lo $(MATH_LIB) $(SCSI_LIBS) $(USB_LIBS) $(RESMGR_LIBS) @@ -486,7 +486,7 @@ EXTRA_DIST += genesys_conv.c genesys_conv_hlp.c genesys_devices.c libgphoto2_i_la_SOURCES = gphoto2.c gphoto2.h libgphoto2_i_la_CPPFLAGS = $(AM_CPPFLAGS) $(GPHOTO2_CPPFLAGS) -DBACKEND_NAME=gphoto2 -nodist_libsane_gphoto2_la_SOURCES = gphoto2-s.c +nodist_libsane_gphoto2_la_SOURCES = gphoto2-s.c libsane_gphoto2_la_CPPFLAGS = $(AM_CPPFLAGS) -DBACKEND_NAME=gphoto2 libsane_gphoto2_la_LDFLAGS = $(DIST_SANELIBS_LDFLAGS) libsane_gphoto2_la_LIBADD = $(GPHOTO2_LDFLAGS) $(COMMON_LIBS) libgphoto2_i.la ../sanei/sanei_init_debug.lo ../sanei/sanei_constrain_value.lo ../sanei/sanei_config.lo sane_strstatus.lo $(SANEI_SANEI_JPEG_LO) $(GPHOTO2_LIBS) $(JPEG_LIBS) @@ -495,7 +495,7 @@ EXTRA_DIST += gphoto2.conf.in libgt68xx_la_SOURCES = gt68xx.c gt68xx.h libgt68xx_la_CPPFLAGS = $(AM_CPPFLAGS) -DBACKEND_NAME=gt68xx -nodist_libsane_gt68xx_la_SOURCES = gt68xx-s.c +nodist_libsane_gt68xx_la_SOURCES = gt68xx-s.c libsane_gt68xx_la_CPPFLAGS = $(AM_CPPFLAGS) -DBACKEND_NAME=gt68xx libsane_gt68xx_la_LDFLAGS = $(DIST_SANELIBS_LDFLAGS) libsane_gt68xx_la_LIBADD = $(COMMON_LIBS) libgt68xx.la ../sanei/sanei_init_debug.lo ../sanei/sanei_constrain_value.lo ../sanei/sanei_config.lo sane_strstatus.lo ../sanei/sanei_usb.lo $(MATH_LIB) $(USB_LIBS) $(RESMGR_LIBS) @@ -536,7 +536,7 @@ EXTRA_DIST += hp3900_config.c hp3900_debug.c hp3900_rts8822.c hp3900_sane.c hp39 libhp4200_la_SOURCES = hp4200.c hp4200.h libhp4200_la_CPPFLAGS = $(AM_CPPFLAGS) -DBACKEND_NAME=hp4200 -nodist_libsane_hp4200_la_SOURCES = hp4200-s.c +nodist_libsane_hp4200_la_SOURCES = hp4200-s.c libsane_hp4200_la_CPPFLAGS = $(AM_CPPFLAGS) -DBACKEND_NAME=hp4200 libsane_hp4200_la_LDFLAGS = $(DIST_SANELIBS_LDFLAGS) libsane_hp4200_la_LIBADD = $(COMMON_LIBS) libhp4200.la ../sanei/sanei_init_debug.lo ../sanei/sanei_constrain_value.lo ../sanei/sanei_config.lo sane_strstatus.lo ../sanei/sanei_usb.lo ../sanei/sanei_pv8630.lo $(MATH_LIB) $(USB_LIBS) $(RESMGR_LIBS) @@ -576,7 +576,7 @@ libsane_hpljm1005_la_LIBADD = $(COMMON_LIBS) libhpljm1005.la ../sanei/sanei_init libhpsj5s_la_SOURCES = hpsj5s.c hpsj5s.h libhpsj5s_la_CPPFLAGS = $(AM_CPPFLAGS) -DBACKEND_NAME=hpsj5s -nodist_libsane_hpsj5s_la_SOURCES = hpsj5s-s.c +nodist_libsane_hpsj5s_la_SOURCES = hpsj5s-s.c libsane_hpsj5s_la_CPPFLAGS = $(AM_CPPFLAGS) -DBACKEND_NAME=hpsj5s libsane_hpsj5s_la_LDFLAGS = $(DIST_SANELIBS_LDFLAGS) libsane_hpsj5s_la_LIBADD = $(COMMON_LIBS) libhpsj5s.la ../sanei/sanei_init_debug.lo ../sanei/sanei_constrain_value.lo ../sanei/sanei_config.lo sane_strstatus.lo $(IEEE1284_LIBS) @@ -585,7 +585,7 @@ EXTRA_DIST += hpsj5s.conf.in libhs2p_la_SOURCES = hs2p.c hs2p.h hs2p-saneopts.h libhs2p_la_CPPFLAGS = $(AM_CPPFLAGS) -DBACKEND_NAME=hs2p -nodist_libsane_hs2p_la_SOURCES = hs2p-s.c +nodist_libsane_hs2p_la_SOURCES = hs2p-s.c libsane_hs2p_la_CPPFLAGS = $(AM_CPPFLAGS) -DBACKEND_NAME=hs2p libsane_hs2p_la_LDFLAGS = $(DIST_SANELIBS_LDFLAGS) libsane_hs2p_la_LIBADD = $(COMMON_LIBS) libhs2p.la ../sanei/sanei_init_debug.lo ../sanei/sanei_constrain_value.lo ../sanei/sanei_config.lo ../sanei/sanei_config2.lo sane_strstatus.lo ../sanei/sanei_scsi.lo $(SCSI_LIBS) $(RESMGR_LIBS) @@ -633,7 +633,7 @@ libsane_kvs1025_la_LIBADD = $(COMMON_LIBS) libkvs1025.la ../sanei/sanei_init_deb EXTRA_DIST += kvs1025.conf.in libkvs20xx_la_SOURCES = kvs20xx.c kvs20xx_cmd.c kvs20xx_opt.c \ - kvs20xx_cmd.h kvs20xx.h + kvs20xx_cmd.h kvs20xx.h libkvs20xx_la_CPPFLAGS = $(AM_CPPFLAGS) -DBACKEND_NAME=kvs20xx nodist_libsane_kvs20xx_la_SOURCES = kvs20xx-s.c @@ -642,7 +642,7 @@ libsane_kvs20xx_la_LDFLAGS = $(DIST_SANELIBS_LDFLAGS) libsane_kvs20xx_la_LIBADD = $(COMMON_LIBS) libkvs20xx.la ../sanei/sanei_init_debug.lo ../sanei/sanei_constrain_value.lo ../sanei/sanei_config.lo sane_strstatus.lo ../sanei/sanei_usb.lo ../sanei/sanei_scsi.lo $(SCSI_LIBS) $(USB_LIBS) $(RESMGR_LIBS) libkvs40xx_la_SOURCES = kvs40xx.c kvs40xx_cmd.c kvs40xx_opt.c \ - kvs40xx.h + kvs40xx.h libkvs40xx_la_CPPFLAGS = $(AM_CPPFLAGS) -DBACKEND_NAME=kvs40xx nodist_libsane_kvs40xx_la_SOURCES = kvs40xx-s.c @@ -662,7 +662,7 @@ EXTRA_DIST += leo.conf.in liblexmark_la_SOURCES = lexmark.c lexmark.h lexmark_low.c liblexmark_la_CPPFLAGS = $(AM_CPPFLAGS) -DBACKEND_NAME=lexmark -nodist_libsane_lexmark_la_SOURCES = lexmark-s.c +nodist_libsane_lexmark_la_SOURCES = lexmark-s.c libsane_lexmark_la_CPPFLAGS = $(AM_CPPFLAGS) -DBACKEND_NAME=lexmark libsane_lexmark_la_LDFLAGS = $(DIST_SANELIBS_LDFLAGS) libsane_lexmark_la_LIBADD = $(COMMON_LIBS) liblexmark.la ../sanei/sanei_init_debug.lo ../sanei/sanei_constrain_value.lo ../sanei/sanei_config.lo sane_strstatus.lo ../sanei/sanei_usb.lo $(USB_LIBS) $(RESMGR_LIBS) @@ -735,12 +735,12 @@ libsane_mustek_pp_la_LDFLAGS = $(DIST_SANELIBS_LDFLAGS) libsane_mustek_pp_la_LIBADD = $(COMMON_LIBS) libmustek_pp.la ../sanei/sanei_init_debug.lo ../sanei/sanei_constrain_value.lo ../sanei/sanei_config.lo sane_strstatus.lo ../sanei/sanei_pa4s2.lo $(MATH_LIB) $(IEEE1284_LIBS) EXTRA_DIST += mustek_pp.conf.in # TODO: Why are these distributed but not compiled? -EXTRA_DIST += mustek_pp_ccd300.c mustek_pp_ccd300.h mustek_pp_cis.c mustek_pp_cis.h mustek_pp_null.c +EXTRA_DIST += mustek_pp_ccd300.c mustek_pp_ccd300.h mustek_pp_cis.c mustek_pp_cis.h mustek_pp_null.c libmustek_usb_la_SOURCES = mustek_usb.c mustek_usb.h libmustek_usb_la_CPPFLAGS = $(AM_CPPFLAGS) -DBACKEND_NAME=mustek_usb -nodist_libsane_mustek_usb_la_SOURCES = mustek_usb-s.c +nodist_libsane_mustek_usb_la_SOURCES = mustek_usb-s.c libsane_mustek_usb_la_CPPFLAGS = $(AM_CPPFLAGS) -DBACKEND_NAME=mustek_usb libsane_mustek_usb_la_LDFLAGS = $(DIST_SANELIBS_LDFLAGS) libsane_mustek_usb_la_LIBADD = $(COMMON_LIBS) libmustek_usb.la ../sanei/sanei_init_debug.lo ../sanei/sanei_constrain_value.lo ../sanei/sanei_config.lo sane_strstatus.lo ../sanei/sanei_usb.lo $(USB_LIBS) $(RESMGR_LIBS) @@ -789,7 +789,7 @@ EXTRA_DIST += niash_core.c niash_core.h niash_xfer.c niash_xfer.h libpie_la_SOURCES = pie.c pie-scsidef.h libpie_la_CPPFLAGS = $(AM_CPPFLAGS) -DBACKEND_NAME=pie -nodist_libsane_pie_la_SOURCES = pie-s.c +nodist_libsane_pie_la_SOURCES = pie-s.c libsane_pie_la_CPPFLAGS = $(AM_CPPFLAGS) -DBACKEND_NAME=pie libsane_pie_la_LDFLAGS = $(DIST_SANELIBS_LDFLAGS) libsane_pie_la_LIBADD = $(COMMON_LIBS) libpie.la ../sanei/sanei_init_debug.lo ../sanei/sanei_constrain_value.lo ../sanei/sanei_config.lo ../sanei/sanei_config2.lo sane_strstatus.lo ../sanei/sanei_scsi.lo ../sanei/sanei_thread.lo $(SCSI_LIBS) $(PTHREAD_LIBS) $(RESMGR_LIBS) @@ -819,7 +819,7 @@ libpint_la_CPPFLAGS = $(AM_CPPFLAGS) -DBACKEND_NAME=pint nodist_libsane_pint_la_SOURCES = pint-s.c libsane_pint_la_CPPFLAGS = $(AM_CPPFLAGS) -DBACKEND_NAME=pint libsane_pint_la_LDFLAGS = $(DIST_SANELIBS_LDFLAGS) -libsane_pint_la_LIBADD = $(COMMON_LIBS) libpint.la ../sanei/sanei_init_debug.lo ../sanei/sanei_constrain_value.lo ../sanei/sanei_config.lo sane_strstatus.lo +libsane_pint_la_LIBADD = $(COMMON_LIBS) libpint.la ../sanei/sanei_init_debug.lo ../sanei/sanei_constrain_value.lo ../sanei/sanei_config.lo sane_strstatus.lo libpixma_la_SOURCES = pixma.c pixma.h pixma_io_sanei.c pixma_io.h pixma_common.c pixma_common.h pixma_mp150.c pixma_mp730.c pixma_mp750.c pixma_mp810.c pixma_imageclass.c pixma_bjnp.c pixma_bjnp.h pixma_bjnp_private.h pixma_rename.h libpixma_la_CPPFLAGS = $(AM_CPPFLAGS) -DBACKEND_NAME=pixma @@ -856,10 +856,10 @@ EXTRA_DIST += plustek-pp_dac.c plustek-pp_dbg.h plustek-pp_detect.c plustek-pp_g libpnm_la_SOURCES = pnm.c libpnm_la_CPPFLAGS = $(AM_CPPFLAGS) -DBACKEND_NAME=pnm -nodist_libsane_pnm_la_SOURCES = pnm-s.c +nodist_libsane_pnm_la_SOURCES = pnm-s.c libsane_pnm_la_CPPFLAGS = $(AM_CPPFLAGS) -DBACKEND_NAME=pnm libsane_pnm_la_LDFLAGS = $(DIST_SANELIBS_LDFLAGS) -libsane_pnm_la_LIBADD = $(COMMON_LIBS) libpnm.la ../sanei/sanei_init_debug.lo ../sanei/sanei_constrain_value.lo ../sanei/sanei_config.lo sane_strstatus.lo +libsane_pnm_la_LIBADD = $(COMMON_LIBS) libpnm.la ../sanei/sanei_init_debug.lo ../sanei/sanei_constrain_value.lo ../sanei/sanei_config.lo sane_strstatus.lo libqcam_la_SOURCES = qcam.c qcam.h libqcam_la_CPPFLAGS = $(AM_CPPFLAGS) -DBACKEND_NAME=qcam @@ -963,7 +963,7 @@ EXTRA_DIST += sp15c.conf.in libst400_la_SOURCES = st400.c st400.h libst400_la_CPPFLAGS = $(AM_CPPFLAGS) -DBACKEND_NAME=st400 -nodist_libsane_st400_la_SOURCES = st400-s.c ../sanei/sanei_scsi.lo +nodist_libsane_st400_la_SOURCES = st400-s.c ../sanei/sanei_scsi.lo libsane_st400_la_CPPFLAGS = $(AM_CPPFLAGS) -DBACKEND_NAME=st400 libsane_st400_la_LDFLAGS = $(DIST_SANELIBS_LDFLAGS) libsane_st400_la_LIBADD = $(COMMON_LIBS) libst400.la ../sanei/sanei_init_debug.lo ../sanei/sanei_constrain_value.lo ../sanei/sanei_config.lo ../sanei/sanei_config2.lo sane_strstatus.lo ../sanei/sanei_scsi.lo $(SCSI_LIBS) $(RESMGR_LIBS) @@ -1050,7 +1050,7 @@ EXTRA_DIST += umax-scanner.c umax-scanner.h umax-scsidef.h umax-uc1200s.c umax-u libumax1220u_la_SOURCES = umax1220u.c libumax1220u_la_CPPFLAGS = $(AM_CPPFLAGS) -DBACKEND_NAME=umax1220u -nodist_libsane_umax1220u_la_SOURCES = umax1220u-s.c +nodist_libsane_umax1220u_la_SOURCES = umax1220u-s.c libsane_umax1220u_la_CPPFLAGS = $(AM_CPPFLAGS) -DBACKEND_NAME=umax1220u libsane_umax1220u_la_LDFLAGS = $(DIST_SANELIBS_LDFLAGS) libsane_umax1220u_la_LIBADD = $(COMMON_LIBS) libumax1220u.la ../sanei/sanei_init_debug.lo ../sanei/sanei_constrain_value.lo ../sanei/sanei_config.lo sane_strstatus.lo ../sanei/sanei_usb.lo ../sanei/sanei_pv8630.lo $(MATH_LIB) $(USB_LIBS) $(RESMGR_LIBS) @@ -1101,14 +1101,14 @@ EXTRA_DIST += dll.conf.in EXTRA_DIST += dll.aliases # libsane.la and libsane-dll.la are the same thing except for -# the addition of backends listed by PRELOADABLE_BACKENDS that are +# the addition of backends listed by PRELOADABLE_BACKENDS that are # statically linked in. # Also, libsane.la goes into $(libdir) where as all libsane-* # (including libsane-dll.la) go into $(libdir)/sane # FIXME: Since we are throwing in the kitchen sink, might as # well link in ../sanei/libsanei.la instead. But currently, -# libsanei.la is linking in sanei_auth which requires md5. +# libsanei.la is linking in sanei_auth which requires md5. # Shipping md5 could cause symbol conflicts with commonly used # md5 external libraries. Either need to prefix md5 with sanei_ # (see liblib.la and snprintf), or move sanei_auth outside diff --git a/backend/abaton.c b/backend/abaton.c index 4008c623f..3e487aa25 100644 --- a/backend/abaton.c +++ b/backend/abaton.c @@ -322,7 +322,7 @@ set_window (Abaton_Scanner * s) uint8_t cmd[10 + 40]; uint8_t *window = cmd + 10 + 8; int invert; - + memset (cmd, 0, sizeof (cmd)); cmd[0] = SET_WINDOW; cmd[8] = 40; @@ -379,11 +379,11 @@ set_window (Abaton_Scanner * s) s->val[OPT_HALFTONE_PATTERN].s); return SANE_STATUS_INVAL; } - + /* We have to invert these ones for some reason, so why not let the scanner do it for us... */ STORE8 (window + 21, invert ? 0x80 : 0); - + STORE16 (window + 22, (s->val[OPT_MIRROR].w != 0)); return sanei_scsi_cmd (s->fd, cmd, sizeof (cmd), 0, 0); @@ -511,7 +511,7 @@ calc_parameters (Abaton_Scanner * s) SANE_Int dpix = s->val[OPT_X_RESOLUTION].w; SANE_Int dpiy = s->val[OPT_Y_RESOLUTION].w; double ulx, uly, width, height; - + DBG (FLOW_CONTROL, "Entering calc_parameters\n"); if (!strcmp (val, SANE_VALUE_SCAN_MODE_LINEART) || !strcmp (val, SANE_VALUE_SCAN_MODE_HALFTONE)) @@ -549,7 +549,7 @@ calc_parameters (Abaton_Scanner * s) s->ULy = uly * dpiy; s->Width = width * dpix; s->Height = height * dpiy; - + DBG (VARIABLE_CONTROL, "(pixels) ulx: %d, uly: %d, width: %d, height: %d\n", s->ULx, s->ULy, s->Width, s->Height); @@ -653,7 +653,7 @@ init_options (Abaton_Scanner * s) s->opt[OPT_NUM_OPTS].cap = SANE_CAP_SOFT_DETECT; s->val[OPT_NUM_OPTS].w = NUM_OPTIONS; - + /* "Mode" group: */ s->opt[OPT_MODE_GROUP].title = "Scan Mode"; s->opt[OPT_MODE_GROUP].desc = ""; @@ -662,7 +662,7 @@ init_options (Abaton_Scanner * s) s->opt[OPT_MODE_GROUP].constraint_type = SANE_CONSTRAINT_NONE; mode_list[0]=SANE_VALUE_SCAN_MODE_LINEART; - + switch (s->hw->ScannerModel) { case ABATON_300GS: @@ -676,7 +676,7 @@ init_options (Abaton_Scanner * s) mode_list[1]=NULL; break; } - + /* scan mode */ s->opt[OPT_MODE].name = SANE_NAME_SCAN_MODE; s->opt[OPT_MODE].title = SANE_TITLE_SCAN_MODE; @@ -724,7 +724,7 @@ init_options (Abaton_Scanner * s) s->opt[OPT_PREVIEW].cap = SANE_CAP_SOFT_DETECT | SANE_CAP_SOFT_SELECT; s->opt[OPT_PREVIEW].type = SANE_TYPE_BOOL; s->val[OPT_PREVIEW].w = SANE_FALSE; - + /* halftone pattern */ s->opt[OPT_HALFTONE_PATTERN].name = SANE_NAME_HALFTONE_PATTERN; s->opt[OPT_HALFTONE_PATTERN].title = SANE_TITLE_HALFTONE_PATTERN; @@ -832,7 +832,7 @@ init_options (Abaton_Scanner * s) s->opt[OPT_NEGATIVE].unit = SANE_UNIT_NONE; s->opt[OPT_NEGATIVE].constraint_type = SANE_CONSTRAINT_NONE; s->val[OPT_NEGATIVE].w = SANE_FALSE; - + /* mirror-image */ s->opt[OPT_MIRROR].name = "mirror"; s->opt[OPT_MIRROR].title = "Mirror Image"; @@ -974,7 +974,7 @@ sane_open (SANE_String_Const devicename, SANE_Handle * handle) /* set up some universal parameters */ s->params.last_frame = SANE_TRUE; s->params.format = SANE_FRAME_GRAY; - + /* insert newly opened handle into list of open handles: */ s->next = first_handle; first_handle = s; @@ -1017,7 +1017,7 @@ sane_get_option_descriptor (SANE_Handle handle, SANE_Int option) if ((unsigned) option >= NUM_OPTIONS) return NULL; - + return s->opt + option; } @@ -1072,7 +1072,7 @@ sane_control_option (SANE_Handle handle, SANE_Int option, case OPT_HALFTONE_PATTERN: status = sanei_constrain_value (s->opt + option, s->val[option].s, info); - strcpy (val, s->val[option].s); + strcpy (val, s->val[option].s); return SANE_STATUS_GOOD; } } @@ -1103,7 +1103,7 @@ sane_control_option (SANE_Handle handle, SANE_Int option, if (info) *info |= SANE_INFO_RELOAD_PARAMS; return SANE_STATUS_GOOD; - + case OPT_RESOLUTION_BIND: s->val[option].w = *(SANE_Word *) val; if (*(SANE_Word *) val) { @@ -1114,7 +1114,7 @@ sane_control_option (SANE_Handle handle, SANE_Int option, SANE_INFO_RELOAD_OPTIONS; } return SANE_STATUS_GOOD; - + case OPT_X_RESOLUTION: if (s->val[OPT_PREVIEW].w || s->val[OPT_RESOLUTION_BIND].w) { s->val[OPT_Y_RESOLUTION].w = *(SANE_Word *)val; @@ -1155,7 +1155,7 @@ sane_control_option (SANE_Handle handle, SANE_Int option, calc_parameters (s); if (info) *info |= SANE_INFO_RELOAD_PARAMS - | SANE_INFO_INEXACT; + | SANE_INFO_INEXACT; return SANE_STATUS_GOOD; /* no side-effects whatsoever */ @@ -1176,7 +1176,7 @@ sane_control_option (SANE_Handle handle, SANE_Int option, free (s->val[option].s); s->val[option].s = strdup (val); return SANE_STATUS_GOOD; - + case OPT_MODE: status = mode_update (s, val); if (status != SANE_STATUS_GOOD) @@ -1295,7 +1295,7 @@ sane_read (SANE_Handle handle, SANE_Byte * buf, SANE_Int max_len, /* this is a sub-optimal way of doing this, I'm sure */ if (!s->scanning) return SANE_STATUS_EOF; - + if (!strcmp (s->val[OPT_MODE].s, "Gray16")) Pseudo8bit = SANE_TRUE; @@ -1352,13 +1352,13 @@ sane_read (SANE_Handle handle, SANE_Byte * buf, SANE_Int max_len, { rread = data_av; } - + DBG (IO_MESSAGE, "sane_read: (action) Actual read request for %u bytes.\n", rread); size = rread; - + STORE24 (read + 6, rread); status = sanei_scsi_cmd (s->fd, read, sizeof (read), @@ -1487,7 +1487,7 @@ sane_get_select_fd (SANE_Handle handle, SANE_Int * fd) { handle = handle; /* silence gcc */ fd = fd; /* silence gcc */ - + DBG (FLOW_CONTROL, "sane_get_select_fd: Don't call me please. " "Unimplemented function\n"); return SANE_STATUS_UNSUPPORTED; diff --git a/backend/abaton.h b/backend/abaton.h index 1f46dedb7..1ecd867f2 100644 --- a/backend/abaton.h +++ b/backend/abaton.h @@ -54,7 +54,7 @@ enum Abaton_Modes ABATON_MODE_HALFTONE, ABATON_MODE_GRAY }; - + enum Abaton_Option { OPT_NUM_OPTS = 0, @@ -66,7 +66,7 @@ enum Abaton_Option OPT_RESOLUTION_BIND, OPT_PREVIEW, OPT_HALFTONE_PATTERN, - + OPT_GEOMETRY_GROUP, OPT_TL_X, /* top-left x */ OPT_TL_Y, /* top-left y */ @@ -79,7 +79,7 @@ enum Abaton_Option OPT_THRESHOLD, OPT_NEGATIVE, OPT_MIRROR, - + /* must come last: */ NUM_OPTIONS }; @@ -110,7 +110,7 @@ typedef struct Abaton_Scanner SANE_Bool scanning; SANE_Bool AbortedByUser; - + SANE_Parameters params; /* The actual bpp, before "Pseudo-8-bit" fiddling */ diff --git a/backend/agfafocus.c b/backend/agfafocus.c index c2c56647e..175a74e76 100644 --- a/backend/agfafocus.c +++ b/backend/agfafocus.c @@ -116,11 +116,11 @@ max_string_size (const SANE_String_Const strings[]) } /* sets loc_s bytes long value at offset loc in scsi command to value size */ -static void +static void set_size (Byte * loc, int loc_s, size_t size) { int i; - + for (i = 0; i < loc_s; i++) { loc[loc_s - i - 1] = (size >> (i * 8)) & 0xff; @@ -142,10 +142,10 @@ get_size (Byte * loc, int loc_s) return j; } -static long +static long reserve_unit (int fd) { - struct + struct { /* Command */ Byte cmd; @@ -164,10 +164,10 @@ reserve_unit (int fd) return sanei_scsi_cmd (fd, &scsi_reserve, sizeof (scsi_reserve), 0, 0); } -static long +static long release_unit (int fd) { - struct + struct { /* Command */ Byte cmd; @@ -192,7 +192,7 @@ test_ready (int fd) SANE_Status status; int try; - struct + struct { /* Command */ Byte cmd; @@ -317,7 +317,7 @@ wait_ready (int fd) Byte tr_len[3]; Byte ctrl; } cmd; - + memset (&cmd, 0, sizeof (cmd)); cmd.cmd = 0x28; /* READ */ @@ -468,7 +468,7 @@ set_window (AgfaFocus_Scanner * s) Byte tonecurve; /* Tone curve (0 - 8) */ Byte ht_pattern; /* Halftone pattern */ Byte paddingtype; /* Padding type */ - + Byte bitordering[2]; /* Bit ordering (0 = left to right) */ Byte comprtype; /* Compression type */ Byte comprarg; /* Compression argument */ @@ -522,7 +522,7 @@ set_window (AgfaFocus_Scanner * s) set_size (cmd.tr_len, 3, 36 + 8); set_size (cmd.wd_len, 2, 36); break; - + case AGFACOLOR: set_size (cmd.tr_len, 3, 65 + 8); set_size (cmd.wd_len, 2, 65); @@ -582,7 +582,7 @@ set_window (AgfaFocus_Scanner * s) cmd.wd.ht_pattern = s->halftone; else cmd.wd.ht_pattern = 3; - + cmd.wd.intensity = brightness; cmd.wd.contrast = contrast; @@ -645,20 +645,20 @@ upload_dither_matrix (AgfaFocus_Scanner * s, int rows, int cols, int *dither_mat Byte re1[3]; Byte tr_len[3]; Byte ctrl; - + struct { Byte nrrows[2]; Byte nrcols[2]; - + struct { Byte data[2]; } element[256]; } wd; } cmd; - + SANE_Status status; int i; - + memset (&cmd, 0, sizeof (cmd)); cmd.cmd = 0x2a; /* WRITE */ @@ -670,9 +670,9 @@ upload_dither_matrix (AgfaFocus_Scanner * s, int rows, int cols, int *dither_mat for (i = 0; i < cols * rows; ++i) set_size (cmd.wd.element[i].data, 2, dither_matrix[i]); - + status = sanei_scsi_cmd (s->fd, &cmd, sizeof (cmd), 0, 0); - + if (status != SANE_STATUS_GOOD) /* Command failed */ return SANE_STATUS_IO_ERROR; @@ -692,7 +692,7 @@ upload_tonecurve (AgfaFocus_Scanner * s, int color_type, int input, int output, Byte re1[4]; Byte tr_len[3]; Byte ctrl; - + Byte re2[6]; Byte wd_len[2]; @@ -700,7 +700,7 @@ upload_tonecurve (AgfaFocus_Scanner * s, int color_type, int input, int output, Byte color_type[2]; Byte nrinput[2]; Byte nroutput[2]; - + struct { Byte data[2]; } outputval[256]; @@ -721,9 +721,9 @@ upload_tonecurve (AgfaFocus_Scanner * s, int color_type, int input, int output, for (i = 0; i < cols; ++i) for (j = 0; j < rows; ++j) set_size (cmd.wd.element[j + i * rows].data, 2, dither_matrix[j + i * rows]); - + status = sanei_scsi_cmd (s->fd, &cmd, sizeof (cmd), 0, 0); - + if (status != SANE_STATUS_GOOD) /* * Command failed * */ return SANE_STATUS_IO_ERROR; @@ -760,22 +760,22 @@ read_data (AgfaFocus_Scanner * s, SANE_Byte *buf, int lines, int bpl) set_size (cmd.tr_len, 3, lines); size = lines * bpl; - + status = sanei_scsi_cmd (s->fd, &cmd, sizeof (cmd), buf, &size); - + if (status != SANE_STATUS_GOOD) { DBG (1, "sanei_scsi_cmd() = %d\n", status); return SANE_STATUS_IO_ERROR; } - + if (size != ((unsigned int) lines * bpl)) { DBG (1, "sanei_scsi_cmd(): got %lu bytes, expected %d\n", (u_long) size, lines * bpl); return SANE_STATUS_INVAL; } - + DBG (1, "Got %lu bytes\n", (u_long) size); /* Reverse: */ @@ -788,7 +788,7 @@ read_data (AgfaFocus_Scanner * s, SANE_Byte *buf, int lines, int bpl) for (i = 0; i < size; i++) buf[i] = 255 - ((buf[i] * 256.0f) / 64.0f); } - + s->lines_available -= lines; return SANE_STATUS_GOOD; @@ -1182,7 +1182,7 @@ init_options (AgfaFocus_Scanner * s) s->opt[OPT_CONTRAST].constraint_type = SANE_CONSTRAINT_RANGE; s->opt[OPT_CONTRAST].constraint.range = &percentage_range; s->val[OPT_CONTRAST].w = 0; - + /* halftone patterns */ s->opt[OPT_HALFTONE_PATTERN].name = SANE_NAME_HALFTONE_PATTERN; s->opt[OPT_HALFTONE_PATTERN].title = SANE_TITLE_HALFTONE_PATTERN; @@ -1324,7 +1324,7 @@ sane_exit (void) sane_close (dev->handle); free (dev); } - + if (devlist) free (devlist); } @@ -1510,16 +1510,16 @@ sane_control_option (SANE_Handle handle, SANE_Int option, s->val[option].s = strdup (val); if (strcmp (s->val[option].s, "Gray (6 bit)") == 0) - s->mode = GRAY6BIT; + s->mode = GRAY6BIT; else if (strcmp (s->val[option].s, "Gray (8 bit)") == 0) - s->mode = GRAY8BIT; + s->mode = GRAY8BIT; else if (strcmp (s->val[option].s, "Color (18 bit)") == 0) - s->mode = COLOR18BIT; + s->mode = COLOR18BIT; else if (strcmp (s->val[option].s, "Color (24 bit)") == 0) - s->mode = COLOR24BIT; + s->mode = COLOR24BIT; else s->mode = LINEART; - + switch (s->mode) { case LINEART: @@ -1679,18 +1679,18 @@ sane_get_parameters (SANE_Handle handle, SANE_Parameters * params) case LINEART: { const char *halftone; - + s->image_composition = 0; - + /* in 1 bpp mode, lines need to be 8 pixel length */ - + if (s->params.pixels_per_line % 8) s->params.pixels_per_line += 8 - (s->params.pixels_per_line % 8); - + s->params.format = SANE_FRAME_GRAY; s->params.bytes_per_line = s->params.pixels_per_line / 8; s->bpp = s->params.depth = 1; - + halftone = s->val[OPT_HALFTONE_PATTERN].s; if (strcmp (halftone, "1") == 0 ) s->halftone = 1; @@ -1704,14 +1704,14 @@ sane_get_parameters (SANE_Handle handle, SANE_Parameters * params) s->halftone = 5; else s->halftone = 0; - + s->edge = s->val[OPT_SHARPEN].w; } break; case GRAY6BIT: s->image_composition = 2; - + s->params.format = SANE_FRAME_GRAY; s->params.bytes_per_line = s->params.pixels_per_line; s->bpp = 6; @@ -1722,7 +1722,7 @@ sane_get_parameters (SANE_Handle handle, SANE_Parameters * params) case GRAY8BIT: s->image_composition = 2; - + s->params.format = SANE_FRAME_GRAY; s->params.bytes_per_line = s->params.pixels_per_line; s->bpp = s->params.depth = 8; @@ -1760,9 +1760,9 @@ sane_get_parameters (SANE_Handle handle, SANE_Parameters * params) if (s->mode == COLOR18BIT || s->mode == COLOR24BIT) s->params.format = SANE_FRAME_RED + s->pass; - + s->params.last_frame = (s->params.format != SANE_FRAME_RED && s->params.format != SANE_FRAME_GREEN); - + if (params) *params = s->params; return SANE_STATUS_GOOD; @@ -1856,23 +1856,23 @@ reader_process (void *scanner) { /* No lines in scanner? Scan some more */ status = request_more_data (s); - + if (status != SANE_STATUS_GOOD) { close (fd); return 1; } } - + /* We only request as many lines as there are already scanned */ if (lines > s->lines_available) lines = s->lines_available; DBG (1, "Requesting %d lines, in scanner: %d, total: %d\n", lines, s->lines_available, s->params.lines); - + status = read_data (s, data, lines, bytes_per_line); - + if (status != SANE_STATUS_GOOD) { DBG (1, "sane_read: read_data() failed (%s)\n", @@ -1881,10 +1881,10 @@ reader_process (void *scanner) close (fd); return 1; } - + /* Sometimes the scanner will return more bytes per line than requested, so we copy only what we wanted. */ - + for (i = 0; i < lines; i++) if (write (fd, data + i * bytes_per_line, s->params.bytes_per_line) != s->params.bytes_per_line) { @@ -1895,7 +1895,7 @@ reader_process (void *scanner) lines_read += lines; } - + close (fd); return 0; } @@ -1906,14 +1906,14 @@ sane_start (SANE_Handle handle) AgfaFocus_Scanner *s = handle; SANE_Status status; int fds[2]; - + /* First make sure we have a current parameter set. Some of the parameters will be overwritten below, but that's OK. */ - + status = sane_get_parameters (s, 0); if (status != SANE_STATUS_GOOD) return status; - + /* don't initialise scanner if we're doing a three-pass scan */ if (s->pass == 0) @@ -1966,10 +1966,10 @@ sane_start (SANE_Handle handle) 42, 26, 38, 22, 43, 27, 39, 23, 4, 58, 14, 54, 1, 59, 15, 55, 36, 20, 46, 30, 33, 17, 47, 31, - 12, 52, 8, 62, 9, 49, 5, 63, + 12, 52, 8, 62, 9, 49, 5, 63, 44, 28, 40, 24, 41, 25, 37, 21 }; - + status = upload_dither_matrix (s, 8, 8, matrix); if (status != SANE_STATUS_GOOD) { @@ -2030,7 +2030,7 @@ sane_read (SANE_Handle handle, SANE_Byte * buf, SANE_Int max_len, if (!s->scanning) return do_cancel (s); - + if (nread < 0) { if (errno == EAGAIN) { return SANE_STATUS_GOOD; diff --git a/backend/agfafocus.h b/backend/agfafocus.h index 078b68e27..d60b63272 100644 --- a/backend/agfafocus.h +++ b/backend/agfafocus.h @@ -27,7 +27,7 @@ enum AgfaFocus_Scanner_Type AGFAGRAY64, AGFALINEART, AGFAGRAY256, - AGFACOLOR + AGFACOLOR }; typedef enum diff --git a/backend/apple.c b/backend/apple.c index 487d743fe..167f6ea24 100644 --- a/backend/apple.c +++ b/backend/apple.c @@ -227,14 +227,14 @@ static const uint8_t test_unit_ready[] = #if 0 -SANE_Int +SANE_Int xqstep (unsigned int Xres, unsigned int bpp) { return (SANE_Int) ((double) (8 * 1200)) / ((double) (Xres * bpp)); } -SANE_Int +SANE_Int yqstep (unsigned int Yres, unsigned int bpp) { return (SANE_Int) ((double) (1200)) / ((double) (Yres)); @@ -246,7 +246,7 @@ yqstep (unsigned int Yres, unsigned int bpp) /* The functions below return the quantized value of x,y in scanners dots aka 1/1200 of an inch */ -static SANE_Int +static SANE_Int xquant (double x, unsigned int Xres, unsigned int bpp, int dir) { double tmp; @@ -264,7 +264,7 @@ xquant (double x, unsigned int Xres, unsigned int bpp, int dir) -static SANE_Int +static SANE_Int yquant (double y, unsigned int Yres, int dir) { double tmp; @@ -986,7 +986,7 @@ calc_parameters (Apple_Scanner * s) s->ulx, s->uly, s->wx, s->wy); -/* +/* TODO: Remove this ugly hack (Protect). Read to learn why! @@ -1168,7 +1168,7 @@ mode_update (SANE_Handle handle, char *val) DISABLE (OPT_HALFTONE_PATTERN); if (s->hw->ScannerModel == COLORONESCANNER) ENABLE(OPT_COLOR_SENSOR); - + } /* End of Gray */ else if (!strcmp (val, "BiColor")) { @@ -1215,7 +1215,7 @@ mode_update (SANE_Handle handle, char *val) { DISABLE (OPT_THRESHOLD); DISABLE (OPT_AUTOBACKGROUND_THRESHOLD); - + if (s->hw->ScannerModel == COLORONESCANNER) { ENABLE (OPT_VOLT_REF); @@ -1302,7 +1302,7 @@ init_options (Apple_Scanner * s) s->opt[OPT_HWDETECT_GROUP].type = SANE_TYPE_GROUP; s->opt[OPT_HWDETECT_GROUP].cap = 0; s->opt[OPT_HWDETECT_GROUP].constraint_type = SANE_CONSTRAINT_NONE; - + s->opt[OPT_MODEL].name = "model"; s->opt[OPT_MODEL].title = "Model"; s->opt[OPT_MODEL].desc = "Model and capabilities"; @@ -1325,7 +1325,7 @@ init_options (Apple_Scanner * s) halftone_pattern_list[1]="bayer4x4"; halftone_pattern_list[2]="download"; halftone_pattern_list[3]=NULL; - + switch (s->hw->ScannerModel) { @@ -1515,7 +1515,7 @@ init_options (Apple_Scanner * s) s->opt[OPT_AUTOBACKGROUND_THRESHOLD].constraint.range = &byte_range; s->val[OPT_AUTOBACKGROUND_THRESHOLD].w = 64; - + /* AppleScanner & OneScanner options */ /* Select HalfTone Pattern */ @@ -2440,7 +2440,7 @@ sane_read (SANE_Handle handle, SANE_Byte * buf, SANE_Int max_len, #ifdef RESERVE_RELEASE_HACK uint8_t reserve[6]; uint8_t release[6]; -#endif +#endif uint8_t result[12]; size_t size; @@ -2457,7 +2457,7 @@ sane_read (SANE_Handle handle, SANE_Byte * buf, SANE_Int max_len, #else *len = 0; if (!s->scanning) return SANE_STATUS_EOF; - + if (!strcmp (s->val[OPT_MODE].s, "Gray16")) Pseudo8bit = SANE_TRUE; @@ -2493,7 +2493,7 @@ sane_read (SANE_Handle handle, SANE_Byte * buf, SANE_Int max_len, release[1]|=SETTHIRDPARTY; #endif - + do { size = sizeof (result); diff --git a/backend/apple.h b/backend/apple.h index 9e1443494..b4a0c03bb 100644 --- a/backend/apple.h +++ b/backend/apple.h @@ -91,7 +91,7 @@ enum Apple_Modes EMPTY_DONT_USE_IT, APPLE_MODE_COLOR }; - + enum Apple_Option { OPT_NUM_OPTS = 0, @@ -116,7 +116,7 @@ enum Apple_Option OPT_BRIGHTNESS, OPT_CONTRAST, OPT_THRESHOLD, - + /* AppleScanner only */ OPT_GRAYMAP, OPT_AUTOBACKGROUND, @@ -147,7 +147,7 @@ enum Apple_Option /* OneScanner && ColorOneScanner */ OPT_LED, OPT_CCD, - + /* ColorOneScanner only */ OPT_MTF_CIRCUIT, @@ -255,7 +255,7 @@ TODO: Initialize this beasts with malloc instead of statically allocation. SANE_Bool scanning; SANE_Bool AbortedByUser; - + int pass; /* pass number */ SANE_Parameters params; diff --git a/backend/artec.c b/backend/artec.c index 2d564a535..2ba8d6dad 100644 --- a/backend/artec.c +++ b/backend/artec.c @@ -1715,7 +1715,7 @@ artec_get_cap_data (ARTEC_Device * dev, int fd) DBG (7, "artec_get_cap_data()\n"); - /* DB always use the hard-coded capability info first + /* DB always use the hard-coded capability info first * if we get cap data from the scanner, we override */ cap_model = -1; for (loop = 0; loop < NELEMS (cap_data); loop++) diff --git a/backend/avision.c b/backend/avision.c index 61491a2f7..da3f4d18c 100644 --- a/backend/avision.c +++ b/backend/avision.c @@ -44,7 +44,7 @@ 74xx, Minolta FS-V1 ...) or Fujitsu ScanPartner with the AVISION SCSI-2/3 or USB command set and written by René Rebe and Meino Cramer. - + Copyright 2002 - 2015 by "Ren Rebe" @@ -54,7 +54,7 @@ Copyright 2002 by "Jose Paulo Moitinho de Almeida" - + Copyright 2010, 2011 by "Mike Kelly" @@ -73,7 +73,7 @@ OS/2 threading support "Falk Rohsiepe" Spelling and whitespace as well as HP5370 quirks - + Many additional special thanks to: Avision INC for providing protocol documentation. Avision INC for sponsoring an AV 8000S with ADF. @@ -90,7 +90,7 @@ Thanks to all the people and companies above. Without you the Avision backend would not be in the shape it is today! ;-) - + ********************************************************************************/ /* SANE-FLOW-DIAGRAMM (from umax.c) @@ -166,13 +166,13 @@ static Avision_HWEntry Avision_Device_List [] = "Avision", "AV100CS", 0}, /* status="untested" */ - + { "AVISION", "AV100IIICS", 0, 0, "Avision", "AV100IIICS", 0}, /* status="untested" */ - + { "AVISION", "AV100S", 0, 0, "Avision", "AV100S", @@ -199,7 +199,7 @@ static Avision_HWEntry Avision_Device_List [] = AV_INT_BUTTON | AV_2ND_LINE_INTERLACED | AV_NO_REAR | AV_SOFT_SCALE | AV_DOES_KEEP_WINDOW | AV_DOES_KEEP_GAMMA | AV_REAR_OFFSET}, /* comment="sheetfed duplex scanner" */ /* status="good" */ - + { NULL, NULL, 0x0638, 0x0A93, "Avision", "AV122 C2", @@ -213,7 +213,7 @@ static Avision_HWEntry Avision_Device_List [] = AV_INT_BUTTON | AV_ACCEL_TABLE}, /* comment="sheetfed scanner" */ /* status="complete" */ - + { NULL, NULL, 0x0638, 0x0A25, "Avision", "AV210", @@ -303,37 +303,37 @@ static Avision_HWEntry Avision_Device_List [] = "Avision", "AV240SC", 0}, /* status="untested" */ - + { "AVISION", "AV260CS", 0, 0, "Avision", "AV260CS", 0}, /* status="untested" */ - + { "AVISION", "AV360CS", 0, 0, "Avision", "AV360CS", 0}, /* status="untested" */ - + { "AVISION", "AV363CS", 0, 0, "Avision", "AV363CS", 0}, /* status="untested" */ - + { "AVISION", "AV420CS", 0, 0, "Avision", "AV420CS", 0}, /* status="untested" */ - + { "AVISION", "AV6120", 0, 0, "Avision", "AV6120", 0}, /* status="untested" */ - + { NULL, "AV610", 0x0638, 0x0a18, "Avision", "AV610", @@ -353,7 +353,7 @@ static Avision_HWEntry Avision_Device_List [] = AV_NO_BACKGROUND | AV_INT_BUTTON}, /* cancel button -> sense abort! */ /* status="good" */ - { NULL, NULL, + { NULL, NULL, 0x0638, 0x0a41, "Avision", "AM3000 Series", 0}, @@ -373,35 +373,35 @@ static Avision_HWEntry Avision_Device_List [] = 0}, /* comment="1 pass, 600 dpi" */ /* status="complete" */ - + { "AVISION", "AV620CS Plus", 0, 0, "Avision", "AV620CS Plus", 0}, /* comment="1 pass, 1200 dpi" */ /* status="complete" */ - + { "AVISION", "AV630CS", 0, 0, "Avision", "AV630CS", 0}, /* comment="1 pass, 1200 dpi" */ /* status="complete" */ - + { "AVISION", "AV630CSL", 0, 0, "Avision", "AV630CSL", 0}, /* comment="1 pass, 1200 dpi" */ /* status="untested" */ - + { "AVISION", "AV6240", 0, 0, "Avision", "AV6240", 0}, /* comment="1 pass, ??? dpi" */ /* status="complete" */ - + { NULL, NULL, 0x0638, 0x0A13, "Avision", "AV600U", @@ -422,70 +422,70 @@ static Avision_HWEntry Avision_Device_List [] = 0}, /* comment="1 pass, ??? dpi" */ /* status="untested" */ - + { "AVISION", "AV690U", 0, 0, "Avision", "AV690U", 0}, /* comment="1 pass, 2400 dpi" */ /* status="untested" */ - + { "AVISION", "AV800S", 0, 0, "Avision", "AV800S", 0}, /* comment="1 pass, ??? dpi" */ /* status="untested" */ - + { "AVISION", "AV810C", 0, 0, "Avision", "AV810C", 0}, /* comment="1 pass, ??? dpi" */ /* status="untested" */ - + { "AVISION", "AV820", 0, 0, "Avision", "AV820", 0}, /* comment="1 pass, ??? dpi" */ /* status="untested" */ - + { "AVISION", "AV820C", 0, 0, "Avision", "AV820C", 0}, /* comment="1 pass, ??? dpi" */ /* status="complete" */ - + { "AVISION", "AV820C Plus", 0, 0, "Avision", "AV820C Plus", 0}, /* comment="1 pass, ??? dpi" */ /* status="complete" */ - + { "AVISION", "AV830C", 0, 0, "Avision", "AV830C", 0}, /* comment="1 pass, ??? dpi" */ /* status="complete" */ - + { "AVISION", "AV830C Plus", 0, 0, "Avision", "AV830C Plus", 0}, /* comment="1 pass, ??? dpi" */ /* status="untested" */ - + { "AVISION", "AV880", 0, 0, "Avision", "AV880", 0}, /* comment="1 pass, ??? dpi" */ /* status="untested" */ - + { "AVISION", "AV880C", 0, 0, "Avision", "AV880C", @@ -613,7 +613,7 @@ static Avision_HWEntry Avision_Device_List [] = /* status="basic" */ /* and possibly more avisions ;-) */ - + { "HP", "ScanJet 5300C", 0x03f0, 0x0701, "Hewlett-Packard", "ScanJet 5300C", @@ -627,14 +627,14 @@ static Avision_HWEntry Avision_Device_List [] = AV_MULTI_CALIB_CMD | AV_INT_STATUS}, /* comment="1 pass, 2400 dpi - some FW revisions have x-axis image scaling problems over 1200 dpi" */ /* status="good" */ - + { "hp", "scanjet 7400c", 0x03f0, 0x0801, "Hewlett-Packard", "ScanJet 7400c", AV_LIGHT_CHECK_BOGUS | AV_NO_64BYTE_ALIGN | AV_INT_STATUS}, /* comment="1 pass, 2400 dpi - dual USB/SCSI interface" */ /* status="good" */ - + #ifdef FAKE_ENTRIES_FOR_DESC_GENERATION { "hp", "scanjet 7450c", 0x03f0, 0x0801, @@ -642,7 +642,7 @@ static Avision_HWEntry Avision_Device_List [] = AV_NO_64BYTE_ALIGN | AV_INT_STATUS}, /* comment="1 pass, 2400 dpi - dual USB/SCSI interface" */ /* status="good" */ - + { "hp", "scanjet 7490c", 0x03f0, 0x0801, "Hewlett-Packard", "ScanJet 7490c", @@ -681,8 +681,8 @@ static Avision_HWEntry Avision_Device_List [] = AV_ADF_FLIPPING_DUPLEX | AV_FIRMWARE}, /* comment="1 pass, 4800 (?) dpi - USB 2.0 and SCSI - only SCSI tested so far" */ /* status="good" */ - -#endif + +#endif { "HP", "C9930A", 0x03f0, 0x3805, "Hewlett-Packard", "ScanJet 8300", @@ -705,7 +705,7 @@ static Avision_HWEntry Avision_Device_List [] = /* comment="1 pass, 4800 (?) dpi - USB 2.0" */ /* status="good" */ -#endif +#endif { "Minolta", "#2882", 0, 0, "Minolta", "Dimage Scan Dual I", @@ -717,21 +717,21 @@ static Avision_HWEntry Avision_Device_List [] = "Minolta", "Scan Multi Pro", AV_FORCE_FILM | AV_NO_START_SCAN}, /* AV_FILMSCANNER (frame control)? */ /* status="untested" */ - + { "MINOLTA", "FS-V1", 0x0638, 0x026a, "Minolta", "Dimage Scan Dual II", AV_FILMSCANNER | AV_ONE_CALIB_CMD | AV_12_BIT_MODE}, /* comment="1 pass, film-scanner" */ /* status="good" */ - + { "MINOLTA", "Elite II", 0x0686, 0x4004, "Minolta", "Elite II", AV_FILMSCANNER | AV_ONE_CALIB_CMD}, /* comment="1 pass, film-scanner" */ /* status="untested" */ - + { "MINOLTA", "FS-V3", 0x0686, 0x400d, "Minolta", "Dimage Scan Dual III", @@ -759,33 +759,33 @@ static Avision_HWEntry Avision_Device_List [] = 0}, /* comment="" */ /* status="good" */ - + { "MITSBISH", "MCA-ADFC", 0, 0, "Mitsubishi", "MCA-ADFC", 0}, /* status="untested" */ - + { "MITSBISH", "MCA-S1200C", 0, 0, "Mitsubishi", "S1200C", 0}, /* status="untested" */ - + { "MITSBISH", "MCA-S600C", 0, 0, "Mitsubishi", "S600C", 0}, /* status="untested" */ - + { "MITSBISH", "SS600", 0, 0, "Mitsubishi", "SS600", 0}, /* status="good" */ - + /* The next are all untested ... */ - + { "FCPA", "ScanPartner", 0, 0, "Fujitsu", "ScanPartner", @@ -797,25 +797,25 @@ static Avision_HWEntry Avision_Device_List [] = "Fujitsu", "ScanPartner 10", AV_FUJITSU}, /* status="untested" */ - + { "FCPA", "ScanPartner 10C", 0, 0, "Fujitsu", "ScanPartner 10C", AV_FUJITSU}, /* status="untested" */ - + { "FCPA", "ScanPartner 15C", 0, 0, "Fujitsu", "ScanPartner 15C", AV_FUJITSU}, /* status="untested" */ - + { "FCPA", "ScanPartner 300C", 0, 0, "Fujitsu", "ScanPartner 300C", 0}, /* status="untested" */ - + { "FCPA", "ScanPartner 600C", 0, 0, "Fujitsu", "ScanPartner 600C", @@ -827,13 +827,13 @@ static Avision_HWEntry Avision_Device_List [] = "Fujitsu", "ScanPartner 620C", AV_LIGHT_CHECK_BOGUS}, /* status="good" */ - + { "FCPA", "ScanPartner Jr", 0, 0, "Fujitsu", "ScanPartner Jr", 0}, /* status="untested" */ - + { "FCPA", "ScanStation", 0, 0, "Fujitsu", "ScanStation", @@ -863,13 +863,13 @@ static Avision_HWEntry Avision_Device_List [] = "Kodak", "i40", AV_INT_BUTTON | AV_GRAY_MODES}, /* status="basic" */ - + { NULL, NULL, 0x040a, 0x6003, "Kodak", "i50", AV_INT_BUTTON}, /* status="untested" */ - + #ifdef FAKE_ENTRIES_FOR_DESC_GENERATION { NULL, NULL, 0x040a, 0x6003, @@ -877,13 +877,13 @@ static Avision_HWEntry Avision_Device_List [] = AV_INT_BUTTON}, /* status="untested" */ #endif - + { NULL, NULL, 0x040a, 0x6004, "Kodak", "i60", AV_INT_BUTTON}, /* status="untested" */ - + #ifdef FAKE_ENTRIES_FOR_DESC_GENERATION { NULL, NULL, 0x040a, 0x6004, @@ -891,19 +891,19 @@ static Avision_HWEntry Avision_Device_List [] = AV_INT_BUTTON}, /* status="untested" */ #endif - + { NULL, NULL, 0x040a, 0x6005, "Kodak", "i80", AV_INT_BUTTON}, - /* status="good" */ - + /* status="good" */ + { "iVina", "1200U", 0x0638, 0x0268, "iVina", "1200U", 0}, /* status="untested" */ - + { NULL, NULL, 0x04a7, 0x0424, "Visioneer", "Strobe XP 450", @@ -917,7 +917,7 @@ static Avision_HWEntry Avision_Device_List [] = AV_INT_BUTTON | AV_ACCEL_TABLE}, /* comment="sheetfed scanner" */ /* status="complete" */ - + { NULL, NULL, 0x04a7, 0x0479, "Visioneer", "Strobe XP 470", @@ -931,7 +931,7 @@ static Avision_HWEntry Avision_Device_List [] = AV_INT_BUTTON | AV_ACCEL_TABLE}, /* comment="sheetfed scanner" */ /* status="complete" */ - + { NULL, NULL, 0x04a7, 0x0420, "Visioneer", "9320", @@ -973,7 +973,7 @@ static Avision_HWEntry Avision_Device_List [] = 0}, /* comment="sheetfed scanner" */ /* status="complete" */ - + { NULL, NULL, 0x04a7, 0x0423, "Visioneer", "9750", @@ -1017,7 +1017,7 @@ static Avision_HWEntry Avision_Device_List [] = AV_INT_BUTTON}, /* comment="sheetfed scanner" */ /* status="complete" */ - + { NULL, NULL, 0x04a7, 0x049C, "Xerox", "DocuMate150", @@ -1047,7 +1047,7 @@ static Avision_HWEntry Avision_Device_List [] = "Xerox", "DocuMate250-G", AV_INT_BUTTON}, /* status="good" */ - + { NULL, NULL, 0x04a7, 0x0449, "Xerox", "DocuMate252", @@ -1059,7 +1059,7 @@ static Avision_HWEntry Avision_Device_List [] = "Xerox", "DocuMate252-G", AV_INT_BUTTON}, /* status="good" */ - + { NULL, NULL, 0x04a7, 0x0476, "Xerox", "DocuMate232", @@ -1077,7 +1077,7 @@ static Avision_HWEntry Avision_Device_List [] = "Xerox", "DocuMate262-G", AV_INT_BUTTON}, /* status="good" */ - + { NULL, NULL, 0x04a7, 0x04a7, "Xerox", "DocuMate262i", @@ -1095,7 +1095,7 @@ static Avision_HWEntry Avision_Device_List [] = "Xerox", "DocuMate272-G", AV_INT_BUTTON}, /* status="untested" */ - + { NULL, NULL, 0x04a7, 0x0446, "Xerox", "DocuMate510", @@ -1179,35 +1179,35 @@ static Avision_HWEntry Avision_Device_List [] = V6240 */ /* Possibly: -Lexmark 4600 MFP Option MFP Options -Lexmark 4600 MFP Option (C772n) MFP Options +Lexmark 4600 MFP Option MFP Options +Lexmark 4600 MFP Option (C772n) MFP Options Lexmark X215 -Lexmark Optra Image X242 +Lexmark Optra Image X242 Lexmark X443 Lexmark 3100 -Lexmark 3200 -Lexmark X340 MFP Multifunction -Lexmark X342n MFP Multifunction +Lexmark 3200 +Lexmark X340 MFP Multifunction +Lexmark X342n MFP Multifunction Lexmark X522 Lexmark X630 Lexmark X632E -Lexmark X642e MFP Multifunction -Lexmark X644e MFP Multifunction -Lexmark X646dte MFP Multifunction -Lexmark X646e MFP Multifunction -Lexmark X646ef MFP Multifunction -Lexmark X772e Multifunction -Lexmark X850e MFP Multifunction -Lexmark X852e MFP Multifunction -Lexmark X854e MFP Multifunction +Lexmark X642e MFP Multifunction +Lexmark X644e MFP Multifunction +Lexmark X646dte MFP Multifunction +Lexmark X646e MFP Multifunction +Lexmark X646ef MFP Multifunction +Lexmark X772e Multifunction +Lexmark X850e MFP Multifunction +Lexmark X852e MFP Multifunction +Lexmark X854e MFP Multifunction Lexmark X4500 MFP */ - + /* last entry detection */ { NULL, NULL, 0, 0, NULL, NULL, - 0} + 0} }; #if 0 @@ -1354,7 +1354,7 @@ static const uint8_t test_unit_ready[] = static const uint8_t get_status[] = { - AVISION_SCSI_GET_DATA_STATUS, 0x00, 0x00, 0x00, 0x00, 0x00, + AVISION_SCSI_GET_DATA_STATUS, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0c, 0x00 }; @@ -1363,9 +1363,9 @@ max_string_size (const SANE_String_Const strings[]) { size_t size, max_size = 0; int i; - + DBG (3, "max_string_size:\n"); - + for (i = 0; strings[i]; ++ i) { size = strlen (strings[i]) + 1; if (size > max_size) @@ -1386,7 +1386,7 @@ static void debug_print_raw (int dbg_level, char* info, const uint8_t* data, size_t count) { size_t i; - + DBG (dbg_level, "%s", info); for (i = 0; i < count; ++ i) { DBG (dbg_level, " [%lu] %1d%1d%1d%1d%1d%1d%1d%1db %3oo %3dd %2xx\n", @@ -1412,7 +1412,7 @@ static void debug_print_hex_raw (int dbg_level, char* info, const uint8_t* data, count--; i++; } *--t = 0; - + DBG (dbg_level, " [%08x] %s\n", address, text); address += 16; } @@ -1429,7 +1429,7 @@ static void debug_print_nvram_data (int dbg_level, char* func, func, get_quad(nvram->adf_duplex_scans)); DBG (dbg_level, "%s: flatbed scans: %d\n", func, get_quad(nvram->flatbed_scans)); - + DBG (dbg_level, "%s: flatbed leading edge: %d\n", func, (int16_t)get_double(nvram->flatbed_leading_edge)); DBG (dbg_level, "%s: flatbed side edge: %d\n", @@ -1442,7 +1442,7 @@ static void debug_print_nvram_data (int dbg_level, char* func, func, (int16_t)get_double(nvram->adf_rear_leading_edge)); DBG (dbg_level, "%s: ADF rear side edge: %d\n", func, (int16_t)get_double(nvram->adf_rear_side_edge)); - + DBG (dbg_level, "%s: born month: %d\n", func, get_double(nvram->born_month)); DBG (dbg_level, "%s: born day: %d\n", @@ -1456,7 +1456,7 @@ static void debug_print_nvram_data (int dbg_level, char* func, func, get_double(nvram->first_scan_day)); DBG (dbg_level, "%s: first scan year: %d\n", func, get_double(nvram->first_scan_year)); - + DBG (dbg_level, "%s: vert. magnification: %d\n", func, get_double(nvram->vertical_magnification)); @@ -1467,10 +1467,10 @@ static void debug_print_nvram_data (int dbg_level, char* func, func, nvram->ccd_type); DBG (dbg_level, "%s: scan speed: %d\n", func, nvram->scan_speed); - + DBG (dbg_level, "%s: serial: '%.24s'\n", /* 24 chars max */ func, nvram->serial); - + DBG (dbg_level, "%s: power saving time: %d\n", func, get_double(nvram->power_saving_time)); @@ -1495,11 +1495,11 @@ static void debug_print_avdimen (int dbg_level, char* func, { DBG (dbg_level, "%s: hw_xres: %d, hw_yres: %d, line_difference: %d\n", func, avdimen->hw_xres, avdimen->hw_yres, avdimen->line_difference); - + DBG (dbg_level, "%s: tlx: %ld, tly: %ld, brx: %ld, bry: %ld\n", func, avdimen->tlx, avdimen->tly, avdimen->brx, avdimen->bry); - + DBG (dbg_level, "%s: hw_pixel_per_line: %d, hw_lines: %d, hw_bytes_per_line: %d\n", func, avdimen->hw_pixels_per_line, avdimen->hw_lines, avdimen->hw_bytes_per_line); @@ -1520,18 +1520,18 @@ static void debug_print_calib_format (int dbg_level, char* func, uint8_t* result) { debug_print_raw (dbg_level + 2, "debug_print_calib_format:\n", result, 32); - + DBG (dbg_level, "%s: [0-1] pixels per line: %d\n", func, get_double ( &(result[0]) )); DBG (dbg_level, "%s: [2] bytes per channel: %d\n", func, result[2]); DBG (dbg_level, "%s: [3] line count: %d\n", func, result[3]); - + DBG (dbg_level, "%s: [4] FLAG:%s%s%s\n", func, result[4] == 1?" MUST_DO_CALIBRATION":"", result[4] == 2?" SCAN_IMAGE_DOES_CALIBRATION":"", result[4] == 3?" NEEDS_NO_CALIBRATION":""); - + DBG (dbg_level, "%s: [5] Ability1:%s%s%s%s%s%s%s%s\n", func, BIT(result[5],7)?" NONE_PACKED":" PACKED", @@ -1542,18 +1542,18 @@ static void debug_print_calib_format (int dbg_level, char* func, BIT(result[5],2)?" DARK_CALIB":"", BIT(result[5],1)?" NEEDS_WHITE_BLACK_SHADING_DATA":"", BIT(result[5],0)?" NEEDS_CALIB_TABLE_CHANNEL_BY_CHANNEL":""); - + DBG (dbg_level, "%s: [6] R gain: %d\n", func, result[6]); DBG (dbg_level, "%s: [7] G gain: %d\n", func, result[7]); DBG (dbg_level, "%s: [8] B gain: %d\n", func, result[8]); - + DBG (dbg_level, "%s: [9-10] R shading target: %x\n", func, get_double ( &(result[9]) ) ); DBG (dbg_level, "%s: [11-12] G shading target: %x\n", func, get_double ( &(result[11]) ) ); DBG (dbg_level, "%s: [13-14] B shading target: %x\n", func, get_double ( &(result[13]) ) ); - + DBG (dbg_level, "%s: [15-16] R dark shading target: %x\n", func, get_double ( &(result[15]) ) ); DBG (dbg_level, "%s: [17-18] G dark shading target: %x\n", @@ -1564,7 +1564,7 @@ static void debug_print_calib_format (int dbg_level, char* func, DBG (dbg_level, "%s: [21] true-gray gain: %d\n", func, result[21]); DBG (dbg_level, "%s: [22-23] true-gray shading target: %x\n", func, get_double ( &(result[22]) ) ); - + DBG (dbg_level, "%s: [24-25] true-gray dark shading target: %x\n", func, get_double ( &(result[24]) ) ); } @@ -1573,7 +1573,7 @@ static void debug_print_accel_info (int dbg_level, char* func, uint8_t* result) { debug_print_raw (dbg_level + 2, "debug_print_accel_info:\n", result, 24); - + DBG (dbg_level, "%s: [0-1] acceleration step count: %d\n", func, get_double ( &(result[0]) )); DBG (dbg_level, "%s: [2-3] stable step count: %d\n", @@ -1591,7 +1591,7 @@ static void debug_print_accel_info (int dbg_level, char* func, BIT(result[16],0)?" TWO_BYTES_PER_ELEM":" SINGLE_BYTE_PER_ELEM", BIT(result[16],1)?" LOW_HIGH_ORDER":" HIGH_LOW_ORDER"); DBG (dbg_level, "%s: [17] table count: %d\n", func, result[17]); - + } static void debug_print_window_descriptor (int dbg_level, char* func, @@ -1605,7 +1605,7 @@ static void debug_print_window_descriptor (int dbg_level, char* func, (uint8_t*)(&window->descriptor), sizeof(*window) - sizeof(window->header)); - + DBG (dbg_level, "%s: [0] window_id: %d\n", func, window->descriptor.winid); DBG (dbg_level, "%s: [2-3] x-axis res: %d\n", func, @@ -1618,7 +1618,7 @@ static void debug_print_window_descriptor (int dbg_level, char* func, func, get_quad (window->descriptor.uly)); DBG (dbg_level, "%s: [14-17] window width: %d\n", func, get_quad (window->descriptor.width)); - DBG (dbg_level, "%s: [18-21] window length: %d\n", func, + DBG (dbg_level, "%s: [18-21] window length: %d\n", func, get_quad (window->descriptor.length)); DBG (dbg_level, "%s: [22] brightness: %d\n", func, window->descriptor.brightness); @@ -1660,14 +1660,14 @@ static void debug_print_window_descriptor (int dbg_level, char* func, window->avision.type.normal.bitset2); DBG (dbg_level, "%s: [50] ir exposure time: %x\n", func, window->avision.type.normal.ir_exposure_time); - + DBG (dbg_level, "%s: [51-52] r exposure: %x\n", func, get_double (window->avision.type.normal.r_exposure_time)); DBG (dbg_level, "%s: [53-54] g exposure: %x\n", func, get_double (window->avision.type.normal.g_exposure_time)); DBG (dbg_level, "%s: [55-56] b exposure: %x\n", func, get_double (window->avision.type.normal.b_exposure_time)); - + DBG (dbg_level, "%s: [57] bitset3: %x\n", func, window->avision.type.normal.bitset3); DBG (dbg_level, "%s: [58] auto focus: %d\n", func, @@ -1685,7 +1685,7 @@ static int write_pnm_header (FILE* f, color_mode m, int depth, int width, int he int maxval = (1 << depth) - 1; const char* hdr_str = NULL; /* construct PNM header */ - + switch (m) { case AV_THRESHOLDED: case AV_DITHERED: @@ -1704,7 +1704,7 @@ static int write_pnm_header (FILE* f, color_mode m, int depth, int width, int he case AV_COLOR_MODE_LAST: ; /* silence compiler warning */ } - + return fprintf (f, hdr_str, width, height, maxval); } @@ -1712,19 +1712,19 @@ static SANE_Status sense_handler (int fd, u_char* sense, void* arg) { SANE_Status status = SANE_STATUS_IO_ERROR; /* default case */ - + char* text; char textbuf[64]; - + uint8_t error_code = sense[0] & 0x7f; uint8_t sense_key = sense[2] & 0xf; uint8_t additional_sense = sense[7]; - + fd = fd; /* silence gcc */ arg = arg; /* silence gcc */ - + DBG (3, "sense_handler:\n"); - + switch (error_code) { case 0x70: @@ -1736,15 +1736,15 @@ sense_handler (int fd, u_char* sense, void* arg) default: text = "unknown sense"; } - + debug_print_raw (1, "sense_handler: data:\n", sense, 8 + additional_sense); - + /* request valid? */ if (! (sense[0] & (1<<7))) { DBG (1, "sense_handler: sense not valid ...\n"); return status; } - + switch (sense_key) { case 0x00: @@ -1778,26 +1778,26 @@ sense_handler (int fd, u_char* sense, void* arg) sprintf (textbuf, "got unknown sense code 0x%02x", (int)sense_key); text = textbuf; } - + DBG (1, "sense_handler: sense code: %s\n", text); - + if (sense[2] & (1<<6)) - DBG (1, "sense_handler: end of scan\n"); - else + DBG (1, "sense_handler: end of scan\n"); + else DBG (1, "sense_handler: scan has not yet been completed\n"); - + if (sense[2] & (1<<5)) DBG (1, "sense_handler: incorrect logical length\n"); - else + else DBG (1, "sense_handler: correct logical length\n"); - { + { uint8_t asc = sense[12]; uint8_t ascq = sense[13]; - + #define ADDITIONAL_SENSE(asc,ascq,txt) \ case ( (asc << 8) + ascq): text = txt; break - + switch ( (asc << 8) + ascq ) { /* normal */ @@ -1808,9 +1808,9 @@ sense_handler (int fd, u_char* sense, void* arg) ADDITIONAL_SENSE (0x15,0x02, "Flatbed Home Sensor Error (OKI only"); ADDITIONAL_SENSE (0x15,0x03, "ADF Home Sensor Error (OKI only)"); ADDITIONAL_SENSE (0x15,0x04, "Lock Error (OKI only)"); - + ADDITIONAL_SENSE (0x1a,0x00, "parameter list length error"); - + ADDITIONAL_SENSE (0x20,0x00, "Invalid command"); ADDITIONAL_SENSE (0x24,0x00, "Invalid field in CDB"); ADDITIONAL_SENSE (0x25,0x00, "Logical unit not supported"); @@ -1822,7 +1822,7 @@ sense_handler (int fd, u_char* sense, void* arg) ADDITIONAL_SENSE (0x2f,0x00, "Command cleared by another initiator"); ADDITIONAL_SENSE (0x3D,0x00, "Invalid Bit in Identify Message"); - + ADDITIONAL_SENSE (0x43,0x00, "Message error"); ADDITIONAL_SENSE (0x44,0x00, "Internal target failure"); ADDITIONAL_SENSE (0x44,0x01, "Flatbed DRAM Error(OKI only)"); @@ -1830,12 +1830,12 @@ sense_handler (int fd, u_char* sense, void* arg) ADDITIONAL_SENSE (0x44,0x03, "Write NVRAM Error"); ADDITIONAL_SENSE (0x47,0x00, "SCSI parity error"); ADDITIONAL_SENSE (0x49,0x00, "Invalid message error"); - + ADDITIONAL_SENSE (0x60,0x00, "Lamp failure"); ADDITIONAL_SENSE (0x60,0x01, "Flatbed Lamp error (Oki only)"); ADDITIONAL_SENSE (0x60,0x02, "ADF lamp error (Oki only)"); ADDITIONAL_SENSE (0x62,0x00, "Scan head positioning error"); - + ADDITIONAL_SENSE (0x80,0x01, "ADF paper jam"; status = SANE_STATUS_JAMMED); ADDITIONAL_SENSE (0x80,0x02, "ADF cover open"; status = SANE_STATUS_COVER_OPEN); ADDITIONAL_SENSE (0x80,0x03, "ADF chute empty"; status = SANE_STATUS_NO_DOCS); @@ -1848,7 +1848,7 @@ sense_handler (int fd, u_char* sense, void* arg) ADDITIONAL_SENSE (0x80,0x0A, "ADF Paper Start"); ADDITIONAL_SENSE (0x80,0x0B, "Multiple ADF paper End and Start"); ADDITIONAL_SENSE (0x80,0x0C, "Multiple ADF paper End"); - + /* film scanner */ ADDITIONAL_SENSE (0x81,0x00, "ADF/MFP front door open"; status = SANE_STATUS_COVER_OPEN); ADDITIONAL_SENSE (0x81,0x01, "ADF holder cartridge open"; status = SANE_STATUS_COVER_OPEN); @@ -1861,19 +1861,19 @@ sense_handler (int fd, u_char* sense, void* arg) ADDITIONAL_SENSE (0x81,0x08, "ADF adapter error"); ADDITIONAL_SENSE (0xA0,0x01, "Filter Positioning Error"); - + ADDITIONAL_SENSE (0x90,0x00, "Scanner busy (FW busy)"); - + default: sprintf (textbuf, "Unknown sense code asc: 0x%02x, ascq: 0x%02x", (int)asc, (int)ascq); text = textbuf; } - + #undef ADDITIONAL_SENSE - + DBG (1, "sense_handler: sense code: %s\n", text); - + /* sense code specific for invalid request * it is possible to get a detailed error location here ;-)*/ if (sense_key == 0x05) { @@ -1883,10 +1883,10 @@ sense_handler (int fd, u_char* sense, void* arg) DBG (1, "sense_handler: error in command parameter\n"); else DBG (1, "sense_handler: error in data parameter\n"); - + DBG (1, "sense_handler: error in parameter byte: %d, %x\n", get_double(&(sense[16])), get_double(&(sense[16]))); - + /* bit pointer valid ?*/ if (sense[15] & (1<<3) ) DBG (1, "sense_handler: error in command parameter\n"); @@ -1895,7 +1895,7 @@ sense_handler (int fd, u_char* sense, void* arg) } } } - + return status; } @@ -1912,7 +1912,7 @@ avision_usb_status (Avision_Connection* av_con, int retry, int timeout) int t_retry = retry; #define valid_status(status,a) (status == SANE_STATUS_GOOD ? a : 0) - + DBG (4, "avision_usb_status: timeout %d, %d retries\n", timeout, retry); #ifndef HAVE_SANEI_USB_SET_TIMEOUT #error "You must update include/sane/sanei_usb.h and sanei/sanei_usb.c accordingly!" @@ -1928,7 +1928,7 @@ avision_usb_status (Avision_Connection* av_con, int retry, int timeout) --retry) { count = sizeof (usb_status); - + DBG (5, "==> (bulk read) going down ...\n"); status = sanei_usb_read_bulk (av_con->usb_dn, usb_status, &count); @@ -1939,10 +1939,10 @@ avision_usb_status (Avision_Connection* av_con, int retry, int timeout) av_con->usb_status = AVISION_USB_BULK_STATUS; } } - + /* reset retry count ... */ retry = t_retry; - + /* 2nd try interrupt status read - if not yet disabled */ for (; count == 0 && @@ -1952,23 +1952,23 @@ avision_usb_status (Avision_Connection* av_con, int retry, int timeout) --retry) { count = sizeof (usb_status); - + DBG (5, "==> (interrupt read) going down ...\n"); status = sanei_usb_read_int (av_con->usb_dn, usb_status, &count); DBG (5, "<== (interrupt read) got: %ld, status: %d\n", (u_long)count, valid_status(status, usb_status[0])); - + if (count > 0) av_con->usb_status = AVISION_USB_INT_STATUS; - } - + } + if (status != SANE_STATUS_GOOD) return status; - + if (count == 0) return SANE_STATUS_IO_ERROR; - + /* 0 = ok, 2 => request sense, 8 ==> busy, else error */ switch (usb_status[0]) { @@ -2051,7 +2051,7 @@ static SANE_Status avision_cmd (Avision_Connection* av_con, } else { SANE_Status status = SANE_STATUS_GOOD; - + size_t i, count, out_count; /* some commands on some devices need a rather long time to respond */ #define STD_TIMEOUT 30000 @@ -2065,11 +2065,11 @@ static SANE_Status avision_cmd (Avision_Connection* av_con, const uint8_t* m_cmd = (const uint8_t*)cmd; const uint8_t* m_src = (const uint8_t*)src; uint8_t* m_dst = (uint8_t*)dst; - + /* may I vote for the possibility to use C99 ... */ #define min_usb_size 10 #define max_usb_size 256 * 1024 /* or 0x10000, used by AV Windows driver during background raster read, ... ? */ - + /* 1st send command data - at least 10 Bytes for USB scanners */ uint8_t enlarged_cmd [min_usb_size]; if (cmd_size < min_usb_size) { @@ -2106,12 +2106,12 @@ write_usb_cmd: sanei_usb_set_timeout (write_timeout); DBG (8, "try to write cmd, count: %lu.\n", (u_long) count); status = sanei_usb_write_bulk (av_con->usb_dn, m_cmd, &count); - + DBG (8, "wrote %lu bytes\n", (u_long) count); if (status != SANE_STATUS_GOOD || count != cmd_size) { DBG (3, "=== Got error %d trying to write, wrote: %ld. ===\n", status, (long)count); - + if (status != SANE_STATUS_GOOD) /* == SANE_STATUS_EOF) */ { DBG (3, "try to read status to clear the FIFO\n"); status = avision_usb_status (av_con, 1, 500); @@ -2125,21 +2125,21 @@ write_usb_cmd: DBG (3, "Retrying to send command\n"); goto write_usb_cmd; } - + return SANE_STATUS_IO_ERROR; } - + /* 2nd send command data (if any) */ for (i = 0; i < src_size; ) { - + count = src_size - i; /* if (count > max_usb_size) count = max_usb_size; */ - + DBG (8, "try to write src, count: %lu.\n", (u_long) count); sanei_usb_set_timeout (write_timeout); status = sanei_usb_write_bulk (av_con->usb_dn, &(m_src[i]), &count); - + DBG (8, "wrote %lu bytes\n", (u_long) count); if (status == SANE_STATUS_GOOD) { i += count; @@ -2155,7 +2155,7 @@ write_usb_cmd: sanei_usb_set_timeout (read_timeout); while (out_count < *dst_size) { count = (*dst_size - out_count); - + DBG (8, "try to read %lu bytes\n", (u_long) count); status = sanei_usb_read_bulk(av_con->usb_dn, &(m_dst[out_count]), &count); @@ -2174,7 +2174,7 @@ write_usb_cmd: } } } - + /* last: read the device status via a pseudo interrupt transfer * this is needed - otherwise the scanner will hang ... */ sanei_usb_set_timeout (status_timeout); @@ -2182,49 +2182,49 @@ write_usb_cmd: /* next i/o hardening attempt - and yes this gets ugly ... */ if (status != SANE_STATUS_GOOD && status != SANE_STATUS_INVAL) goto write_usb_cmd; - + if (status == SANE_STATUS_INVAL) { struct { command_header header; uint8_t pad[4]; } sense_cmd; - + uint8_t sense_buffer[22]; - + DBG (3, "Error during status read!\n"); DBG (3, "=== Try to request sense ===\n"); - + /* we can not call avision_cmd recursively - we might ending in an endless recursion requesting sense for failing request sense transfers ...*/ - + memset (&sense_cmd, 0, sizeof (sense_cmd) ); memset (&sense_buffer, 0, sizeof (sense_buffer) ); sense_cmd.header.opc = AVISION_SCSI_REQUEST_SENSE; sense_cmd.header.len = sizeof (sense_buffer); - + count = sizeof(sense_cmd); - + DBG (8, "try to write %lu bytes\n", (u_long) count); sanei_usb_set_timeout (write_timeout); status = sanei_usb_write_bulk (av_con->usb_dn, (uint8_t*) &sense_cmd, &count); DBG (8, "wrote %lu bytes\n", (u_long) count); - + if (status != SANE_STATUS_GOOD) { DBG (3, "=== Got error %d trying to request sense! ===\n", status); } else { count = sizeof (sense_buffer); - + DBG (8, "try to read %lu bytes sense data\n", (u_long) count); sanei_usb_set_timeout (read_timeout); status = sanei_usb_read_bulk(av_con->usb_dn, sense_buffer, &count); DBG (8, "read %lu bytes sense data\n", (u_long) count); - + /* we need to read out the status from the scanner i/o buffer */ status = avision_usb_status (av_con, 1, status_timeout); - + /* some scanner return NEED_SENSE even after reading it */ if (status != SANE_STATUS_GOOD && status != SANE_STATUS_INVAL) DBG (3, "=== Got error %d trying to read sense! ===\n", status); @@ -2248,33 +2248,33 @@ bubble_sort (uint8_t* sort_data, size_t count) { size_t i, j, limit, k; double sum = 0.0; - + limit = count / 3; - + for (i = 0; i < limit; ++i) { uint16_t ti = 0; uint16_t tj = 0; - + for (j = (i + 1); j < count; ++j) { ti = get_double ((sort_data + i*2)); tj = get_double ((sort_data + j*2)); - + if (ti > tj) { set_double ((sort_data + i*2), tj); set_double ((sort_data + j*2), ti); } } } - + for (k = 0, i = limit; i < count; ++i) { sum += get_double ((sort_data + i*2)); ++ k; } - + /* DBG (7, "bubble_sort: %d values for average\n", k); */ - + if (k > 0) /* if avg to compute */ return (uint16_t) (sum / k); else @@ -2286,7 +2286,7 @@ add_color_mode (Avision_Device* dev, color_mode mode, SANE_String name) { int i; DBG (3, "add_color_mode: %d %s\n", mode, name); - + for (i = 0; i < AV_COLOR_MODE_LAST; ++i) { if (dev->color_list [i] == 0) { @@ -2298,7 +2298,7 @@ add_color_mode (Avision_Device* dev, color_mode mode, SANE_String name) return SANE_STATUS_GOOD; } } - + DBG (3, "add_color_mode: failed\n"); return SANE_STATUS_NO_MEM; } @@ -2307,13 +2307,13 @@ static int last_color_mode (Avision_Device* dev) { int i = 1; - + while (dev->color_list [i] != 0 && i < AV_COLOR_MODE_LAST) ++i; - + /* we are off by one */ --i; - + return i; } @@ -2331,7 +2331,7 @@ match_color_mode (Avision_Device* dev, SANE_String name) return dev->color_list_num [i]; } } - + DBG (3, "match_color_mode: source mode invalid\n"); return AV_GRAYSCALE; } @@ -2352,14 +2352,14 @@ static SANE_Bool is_adf_scan (Avision_Scanner* s) { return s->hw->scanner_type == AV_SHEETFEED || (s->hw->scanner_type == AV_FLATBED && s->source_mode_dim == AV_ADF_DIM); - + } static SANE_Status add_source_mode (Avision_Device* dev, source_mode mode, SANE_String name) { int i; - + for (i = 0; i < AV_SOURCE_MODE_LAST; ++i) { if (dev->source_list [i] == 0) { @@ -2371,7 +2371,7 @@ add_source_mode (Avision_Device* dev, source_mode mode, SANE_String name) return SANE_STATUS_GOOD; } } - + return SANE_STATUS_NO_MEM; } @@ -2379,7 +2379,7 @@ static source_mode match_source_mode (Avision_Device* dev, SANE_String name) { int i; - + DBG (3, "match_source_mode: \"%s\"\n", name); for (i = 0; i < AV_SOURCE_MODE_LAST; ++i) @@ -2390,7 +2390,7 @@ match_source_mode (Avision_Device* dev, SANE_String name) return dev->source_list_num [i]; } } - + DBG (3, "match_source_mode: source mode invalid\n"); return AV_NORMAL; } @@ -2399,7 +2399,7 @@ static source_mode_dim match_source_mode_dim (source_mode sm) { DBG (3, "match_source_mode_dim: %d\n", sm); - + switch (sm) { case AV_NORMAL: return AV_NORMAL_DIM; @@ -2420,7 +2420,7 @@ get_pixel_boundary (Avision_Scanner* s) { Avision_Device* dev = s->hw; int boundary; - + switch (s->c_mode) { case AV_TRUECOLOR: case AV_TRUECOLOR12: @@ -2447,7 +2447,7 @@ get_pixel_boundary (Avision_Scanner* s) default: boundary = 8; } - + return boundary; } @@ -2458,11 +2458,11 @@ compute_parameters (Avision_Scanner* s) int boundary = get_pixel_boundary (s); SANE_Bool gray_mode = color_mode_is_shaded (s->c_mode); - + /* interlaced duplex (higher end) or flipping paper (HP8xxx)? */ s->avdimen.interlaced_duplex = s->source_mode == AV_ADF_DUPLEX && dev->inquiry_duplex_interlaced; - + /* for infra-red we use the same code path es for interlaced duplex */ if (s->val[OPT_IR].w) @@ -2491,23 +2491,23 @@ compute_parameters (Avision_Scanner* s) break; } #endif - + DBG (3, "sane_compute_parameters:\n"); - + DBG (3, "sane_compute_parameters: boundary %d, gray_mode: %d, \n", boundary, gray_mode); - + /* TODO: Implement different x/y resolutions support */ s->avdimen.xres = s->val[OPT_RESOLUTION].w; s->avdimen.yres = s->val[OPT_RESOLUTION].w; - + /* soft scale ? */ if (dev->hw->feature_type & AV_SOFT_SCALE) { /* find supported hardware resolution */ const int* hw_res; const int* hw_res_list = dev->inquiry_asic_type == AV_ASIC_C5 ? hw_res_list_c5 : hw_res_list_generic; - + for (hw_res = hw_res_list; *hw_res && *hw_res < s->avdimen.xres; ++hw_res) /* just iterate */; s->avdimen.hw_xres = *hw_res; @@ -2515,11 +2515,11 @@ compute_parameters (Avision_Scanner* s) for (hw_res = hw_res_list; *hw_res && *hw_res < s->avdimen.yres; ++hw_res) /* just iterate */; s->avdimen.hw_yres = *hw_res; - + DBG (3, "sane_compute_parameters: soft scale, hw res: %dx%d\n", s->avdimen.hw_xres, s->avdimen.hw_yres); - + if (!s->avdimen.hw_xres || ! s->avdimen.hw_yres) { DBG (1, "sane_compute_parameters: no matching HW res for: %dx%d\n", s->avdimen.xres, @@ -2531,11 +2531,11 @@ compute_parameters (Avision_Scanner* s) s->avdimen.hw_xres = s->val[OPT_RESOLUTION].w; s->avdimen.hw_yres = s->val[OPT_RESOLUTION].w; } - + DBG (3, "sane_compute_parameters: tlx: %f, tly: %f, brx: %f, bry: %f\n", SANE_UNFIX (s->val[OPT_TL_X].w), SANE_UNFIX (s->val[OPT_TL_Y].w), SANE_UNFIX (s->val[OPT_BR_X].w), SANE_UNFIX (s->val[OPT_BR_Y].w)); - + /* window parameter in pixel */ s->avdimen.tlx = s->avdimen.hw_xres * SANE_UNFIX (s->val[OPT_TL_X].w) / MM_PER_INCH; @@ -2545,7 +2545,7 @@ compute_parameters (Avision_Scanner* s) / MM_PER_INCH; s->avdimen.bry = s->avdimen.hw_yres * SANE_UNFIX (s->val[OPT_BR_Y].w) / MM_PER_INCH; - + /* line difference */ if (color_mode_is_color (s->c_mode) && dev->inquiry_needs_software_colorpack && @@ -2553,27 +2553,27 @@ compute_parameters (Avision_Scanner* s) { s->avdimen.line_difference = (dev->inquiry_line_difference * s->avdimen.hw_yres) / dev->inquiry_optical_res; - + s->avdimen.bry += 2 * s->avdimen.line_difference; - + /* limit bry + line_difference to real scan boundary */ { long y_max = dev->inquiry_y_ranges[s->source_mode_dim] * s->avdimen.hw_yres / MM_PER_INCH; DBG (3, "sane_compute_parameters: y_max: %ld, bry: %ld, line_difference: %d\n", y_max, s->avdimen.bry, s->avdimen.line_difference); - + if (s->avdimen.bry + 2 * s->avdimen.line_difference > y_max) { DBG (1, "sane_compute_parameters: bry limited!\n"); s->avdimen.bry = y_max - 2 * s->avdimen.line_difference; } } - + } /* end if needs software colorpack */ else { s->avdimen.line_difference = 0; } - + /* add overscan */ if (dev->inquiry_tune_scan_length && is_adf_scan (s)) { /* some extra effort for precise rounding ... */ @@ -2584,7 +2584,7 @@ compute_parameters (Avision_Scanner* s) DBG (3, "sane_compute_parameters: overscan lines: %d\n", overscan); s->avdimen.bry += overscan; } - + /* rear offset compensation */ if (s->avdimen.interlaced_duplex && dev->hw->feature_type & AV_REAR_OFFSET) { const double offset = 0.5; /* in current affected models 1/2 inch */ @@ -2598,16 +2598,16 @@ compute_parameters (Avision_Scanner* s) } memset (&s->params, 0, sizeof (s->params)); - + s->avdimen.hw_pixels_per_line = (s->avdimen.brx - s->avdimen.tlx); s->avdimen.hw_pixels_per_line -= s->avdimen.hw_pixels_per_line % boundary; - + s->avdimen.hw_lines = (s->avdimen.bry - s->avdimen.tly - 2 * s->avdimen.line_difference); - + if (s->avdimen.interlaced_duplex && dev->scanner_type != AV_FILM) s->avdimen.hw_lines -= s->avdimen.hw_lines % dev->read_stripe_size; - + s->params.pixels_per_line = s->avdimen.hw_pixels_per_line * s->avdimen.xres / s->avdimen.hw_xres; s->params.lines = s->avdimen.hw_lines * s->avdimen.xres / s->avdimen.hw_xres; if (is_adf_scan (s)) @@ -2615,9 +2615,9 @@ compute_parameters (Avision_Scanner* s) s->params.lines = -1; if (s->c_mode == AV_THRESHOLDED || s->c_mode == AV_DITHERED) s->params.pixels_per_line -= s->params.pixels_per_line % 8; - + debug_print_avdimen (1, "sane_compute_parameters", &s->avdimen); - + switch (s->c_mode) { case AV_THRESHOLDED: @@ -2662,9 +2662,9 @@ compute_parameters (Avision_Scanner* s) DBG (1, "Invalid mode. %d\n", s->c_mode); return SANE_STATUS_INVAL; } /* end switch */ - + s->params.last_frame = SANE_TRUE; - + debug_print_params (1, "sane_compute_parameters", &s->params); return SANE_STATUS_GOOD; } @@ -2675,26 +2675,26 @@ inquiry (Avision_Connection av_con, uint8_t* data, size_t len) SANE_Status status; command_header inquiry; int try = 2; - + DBG (3, "inquiry: length: %ld\n", (long)len); - + memset (&inquiry, 0, sizeof(inquiry)); inquiry.opc = AVISION_SCSI_INQUIRY; inquiry.len = len; - + do { size_t size = inquiry.len; - + DBG (3, "inquiry: inquiring ...\n"); status = avision_cmd (&av_con, &inquiry, sizeof (inquiry), 0, 0, data, &size); if (status == SANE_STATUS_GOOD && size == inquiry.len) break; - + DBG (1, "inquiry: inquiry failed (%s)\n", sane_strstatus (status)); --try; } while (try > 0); - + return status; } @@ -2703,14 +2703,14 @@ wait_ready (Avision_Connection* av_con, int delay) { SANE_Status status; int try; - + for (try = 0; try < 10; ++ try) { DBG (3, "wait_ready: sending TEST_UNIT_READY\n"); status = avision_cmd (av_con, test_unit_ready, sizeof (test_unit_ready), 0, 0, 0, 0); sleep (delay); - + switch (status) { default: @@ -2734,45 +2734,45 @@ static SANE_Status wait_4_light (Avision_Scanner* s) { Avision_Device* dev = s->hw; - + /* read stuff */ struct command_read rcmd; char* light_status[] = - { "off", "on", "warming up", "needs warm up test", + { "off", "on", "warming up", "needs warm up test", "light check error", "backlight on", "RESERVED" }; - + SANE_Status status; uint8_t result; int try; size_t size = 1; - + DBG (3, "wait_4_light: getting light status.\n"); - + memset (&rcmd, 0, sizeof (rcmd)); - + rcmd.opc = AVISION_SCSI_READ; rcmd.datatypecode = 0xa0; /* get light status */ set_double (rcmd.datatypequal, dev->data_dq); set_triple (rcmd.transferlen, size); - + for (try = 0; try < 90; ++ try) { if (s->cancelled) { DBG (3, "wait_4_light: cancelled\n"); return SANE_STATUS_CANCELLED; } - + DBG (5, "wait_4_light: read bytes %lu\n", (u_long) size); status = avision_cmd (&s->av_con, &rcmd, sizeof (rcmd), 0, 0, &result, &size); - + if (status != SANE_STATUS_GOOD || size != sizeof (result)) { DBG (1, "wait_4_light: read failed (%s)\n", sane_strstatus (status)); return status; } - + DBG (3, "wait_4_light: command is %d. Result is %d (%s)\n", status, result, light_status[(result>5)?6:result]); - + if (result == 1 || result == 5) { return SANE_STATUS_GOOD; } @@ -2783,20 +2783,20 @@ wait_4_light (Avision_Scanner* s) else { struct command_send scmd; uint8_t light_on = 1; - + /* turn on the light */ DBG (3, "wait_4_light: setting light status.\n"); - + memset (&scmd, 0, sizeof (scmd)); - + scmd.opc = AVISION_SCSI_SEND; scmd.datatypecode = 0xa0; /* send light status */ set_double (scmd.datatypequal, dev->data_dq); set_triple (scmd.transferlen, size); - + status = avision_cmd (&s->av_con, &scmd, sizeof (scmd), &light_on, sizeof (light_on), 0, 0); - + if (status != SANE_STATUS_GOOD) { DBG (1, "wait_4_light: send failed (%s)\n", sane_strstatus (status)); return status; @@ -2804,7 +2804,7 @@ wait_4_light (Avision_Scanner* s) } sleep (1); } - + DBG (1, "wait_4_light: timed out after %d attempts\n", try); return SANE_STATUS_DEVICE_BUSY; } @@ -2846,27 +2846,27 @@ get_firmware_status (Avision_Connection* av_con) SANE_Status status; firmware_status result; - + DBG (3, "get_firmware_status\n"); - + size = sizeof (result); - + memset (&rcmd, 0, sizeof (rcmd)); rcmd.opc = AVISION_SCSI_READ; - + rcmd.datatypecode = 0x90; /* firmware status */ set_double (rcmd.datatypequal, 0); /* dev->data_dq not available */ set_triple (rcmd.transferlen, size); - + status = avision_cmd (av_con, &rcmd, sizeof (rcmd), 0, 0, &result, &size); if (status != SANE_STATUS_GOOD || size != sizeof (result)) { DBG (1, "get_firmware_status: read failed (%s)\n", sane_strstatus (status)); return (status); } - + debug_print_raw (6, "get_firmware_status: raw data:\n", (uint8_t*)&result, size); - + DBG (3, "get_firmware_status: [0] needs firmware %x\n", result.download_firmware); DBG (3, "get_firmware_status: [1] side edge: %d\n", get_double ( result.first_effective_pixel_flatbed )); DBG (3, "get_firmware_status: [3] side edge: %d\n", get_double ( result.first_effective_pixel_adf_front )); @@ -2883,28 +2883,28 @@ get_flash_ram_info (Avision_Connection* av_con) size_t size; SANE_Status status; uint8_t result[40]; - + DBG (3, "get_flash_ram_info\n"); - + size = sizeof (result); - + memset (&rcmd, 0, sizeof (rcmd)); rcmd.opc = AVISION_SCSI_READ; - + rcmd.datatypecode = 0x6a; /* flash ram information */ set_double (rcmd.datatypequal, 0); /* dev->data_dq not available */ set_triple (rcmd.transferlen, size); - + status = avision_cmd (av_con, &rcmd, sizeof (rcmd), 0, 0, result, &size); if (status != SANE_STATUS_GOOD || size != sizeof (result)) { DBG (1, "get_flash_ram_info: read failed (%s)\n", sane_strstatus (status)); return (status); } - + debug_print_raw (6, "get_flash_ram_info: raw data:\n", result, size); - - DBG (3, "get_flash_ram_info: [0] data type %x\n", result [0]); + + DBG (3, "get_flash_ram_info: [0] data type %x\n", result [0]); DBG (3, "get_flash_ram_info: [1] Ability1:%s%s%s%s%s%s%s%s\n", BIT(result[1],7)?" RESERVED_BIT7":"", BIT(result[1],6)?" RESERVED_BIT6":"", @@ -2914,7 +2914,7 @@ get_flash_ram_info (Avision_Connection* av_con) BIT(result[1],2)?" RAWLINE(r)":"", BIT(result[1],1)?" FIRMWARE(r/w)":"", BIT(result[1],0)?" CTAB(r/w)":""); - + DBG (3, "get_flash_ram_info: [2-5] size CTAB: %d\n", get_quad ( &(result[2]) ) ); @@ -2938,7 +2938,7 @@ get_flash_ram_info (Avision_Connection* av_con) DBG (3, "get_flash_ram_info: [30-33] size RESERVED: %d\n", get_quad ( &(result[30]) ) ); - + return SANE_STATUS_GOOD; } @@ -2947,23 +2947,23 @@ get_nvram_data (Avision_Scanner* s, nvram_data* nvram) { /* read stuff */ struct command_send rcmd; - + size_t size; SANE_Status status; - + DBG (3, "get_nvram_data\n"); - + size = sizeof (*nvram); - + memset (&rcmd, 0, sizeof (rcmd)); memset (nvram, 0, size); - + rcmd.opc = AVISION_SCSI_READ; - + rcmd.datatypecode = 0x69; /* Read NVM RAM data */ set_double (rcmd.datatypequal, 0); /* dev->data_dq not available */ set_triple (rcmd.transferlen, size); - + status = avision_cmd (&s->av_con, &rcmd, sizeof (rcmd), 0, 0, nvram, &size); if (status != SANE_STATUS_GOOD) { @@ -2971,9 +2971,9 @@ get_nvram_data (Avision_Scanner* s, nvram_data* nvram) sane_strstatus (status)); return (status); } - + debug_print_nvram_data (5, "get_nvram_data", nvram); - + return SANE_STATUS_GOOD; } @@ -2985,7 +2985,7 @@ get_and_parse_nvram (Avision_Scanner* s, char* str, int n) int x; nvram_data nvram; uint8_t inquiry_result [AVISION_INQUIRY_SIZE_V1]; - + status = inquiry (s->av_con, inquiry_result, sizeof(inquiry_result)); if (status == SANE_STATUS_GOOD) { i += snprintf (str+i, n-i, "Vendor: %.8s", @@ -2995,17 +2995,17 @@ get_and_parse_nvram (Avision_Scanner* s, char* str, int n) i += snprintf (str+i, n-i, "\nFirmware: %.4s", inquiry_result+32); } - + if (!s->hw->inquiry_nvram_read) return SANE_STATUS_GOOD; - + status = get_nvram_data (s, &nvram); if (status == SANE_STATUS_GOOD) { if (nvram.serial[0]) i += snprintf (str+i, n-i, "\nSerial: %.24s", nvram.serial); - + if (nvram.born_year) i += snprintf (str+i, n-i, "\nManufacturing date: %d-%d-%d", get_double(nvram.born_year), @@ -3016,7 +3016,7 @@ get_and_parse_nvram (Avision_Scanner* s, char* str, int n) get_double(nvram.first_scan_year), get_double(nvram.first_scan_month), get_double(nvram.first_scan_day)); - + x = get_quad (nvram.flatbed_scans); if (x) i += snprintf (str+i, n-i, "\nFlatbed scans: %d", x); @@ -3030,7 +3030,7 @@ get_and_parse_nvram (Avision_Scanner* s, char* str, int n) if (x) i += snprintf (str+i, n-i, "\nADF duplex scans: %d", x); } - + return status; } @@ -3039,21 +3039,21 @@ get_power_save_time (Avision_Scanner* s, SANE_Word* time) { SANE_Status status; nvram_data nvram; - + DBG (3, "get_power_save_time\n"); - + if (!s->hw->inquiry_nvram_read) return SANE_STATUS_INVAL; - + status = get_nvram_data (s, &nvram); - + if (status != SANE_STATUS_GOOD) { DBG (1, "get_power_save_time: read nvram failed (%s)\n", sane_strstatus (status)); return status; } - + *time = get_double (nvram.power_saving_time); - + return SANE_STATUS_GOOD; } @@ -3066,18 +3066,18 @@ send_nvram_data (Avision_Connection* av_con) struct command_send scmd; size_t size; SANE_Status status; - + DBG (3, "send_nvram_data\n"); - + size = sizeof (c7_nvram); - + memset (&scmd, 0, sizeof (scmd)); scmd.opc = AVISION_SCSI_SEND; - + scmd.datatypecode = 0x85; /* nvram data */ set_double (scmd.datatypequal, 0); /* dev->data_dq not available */ set_triple (scmd.transferlen, size); - + status = avision_cmd (av_con, &scmd, sizeof (scmd), &c7_nvram, size, 0, 0); if (status != SANE_STATUS_GOOD) { @@ -3085,7 +3085,7 @@ send_nvram_data (Avision_Connection* av_con) sane_strstatus (status)); return (status); } - + return SANE_STATUS_GOOD; } @@ -3096,18 +3096,18 @@ send_flash_ram_data (Avision_Connection* av_con) struct command_send scmd; size_t size; SANE_Status status; - + DBG (3, "send_flash_ram_data\n"); - + size = sizeof (c7_flash_ram); - + memset (&scmd, 0, sizeof (scmd)); scmd.opc = AVISION_SCSI_SEND; - + scmd.datatypecode = 0x86; /* flash data */ set_double (scmd.datatypequal, 0); set_triple (scmd.transferlen, size); - + status = avision_cmd (av_con, &scmd, sizeof (scmd), &c7_flash_ram, size, 0, 0); if (status != SANE_STATUS_GOOD) { @@ -3115,7 +3115,7 @@ send_flash_ram_data (Avision_Connection* av_con) sane_strstatus (status)); return (status); } - + return SANE_STATUS_GOOD; } #endif @@ -3177,28 +3177,28 @@ get_accessories_info (Avision_Scanner* s) { Avision_Device* dev = s->hw; int try = 3; - + /* read stuff */ struct command_read rcmd; size_t size; SANE_Status status; uint8_t result[8]; - + char* adf_model[] = { "Origami", "Oodles", "HP9930", "unknown" }; const int adf_models = sizeof (adf_model) / sizeof(char*) - 1; - + DBG (3, "get_accessories_info\n"); - + size = sizeof (result); - + memset (&rcmd, 0, sizeof (rcmd)); rcmd.opc = AVISION_SCSI_READ; - + rcmd.datatypecode = 0x64; /* detect accessories */ set_double (rcmd.datatypequal, dev->data_dq); set_triple (rcmd.transferlen, size); - + /* after resetting the ADF unit, try reprobing it again */ RETRY: @@ -3291,7 +3291,7 @@ string_for_button (Avision_Scanner* s, int button) case 2: return "duplex"; } } - + if (strcmp (dev->sane.model, "AV210C2") == 0 || strcmp (dev->sane.model, "AV210D2+") == 0 || strcmp (dev->sane.model, "AV220C2") == 0 || @@ -3303,7 +3303,7 @@ string_for_button (Avision_Scanner* s, int button) else goto return_scan; } - + /* those are unique, right now */ if (strcmp (dev->sane.model, "AV610") == 0) { @@ -3314,11 +3314,11 @@ string_for_button (Avision_Scanner* s, int button) case 2: return "scan"; } } - + /* last resort */ snprintf (buffer, sizeof (buffer), "button%d", button); return buffer; - + return_scan: return "scan"; } @@ -3327,7 +3327,7 @@ static SANE_Status get_button_status (Avision_Scanner* s) { Avision_Device* dev = s->hw; - + /* read stuff */ struct command_read rcmd; size_t size; @@ -3341,21 +3341,21 @@ get_button_status (Avision_Scanner* s) } result; unsigned int i; - + DBG (3, "get_button_status:\n"); - + size = sizeof (result); - + /* AV220 et.al. */ if (! (dev->hw->feature_type & AV_INT_BUTTON)) { memset (&rcmd, 0, sizeof (rcmd)); rcmd.opc = AVISION_SCSI_READ; - + rcmd.datatypecode = 0xA1; /* button status */ set_double (rcmd.datatypequal, dev->data_dq); set_triple (rcmd.transferlen, size); - + status = avision_cmd (&s->av_con, &rcmd, sizeof (rcmd), 0, 0, (uint8_t*)&result, &size); if (status != SANE_STATUS_GOOD || size != sizeof (result)) { @@ -3367,7 +3367,7 @@ get_button_status (Avision_Scanner* s) { /* only try to read the first 8 bytes ...*/ size = 8; - + /* no SCSI equivalent */ /* either there was a button press and this completes quickly or there is no point waiting for a future press */ @@ -3376,21 +3376,21 @@ get_button_status (Avision_Scanner* s) status = sanei_usb_read_int (s->av_con.usb_dn, (uint8_t*)&result, &size); DBG (5, "==> (interrupt read) got: %ld\n", (long)size); - + if (status != SANE_STATUS_GOOD) { DBG (1, "get_button_status: interrupt read failed (%s)\n", sane_strstatus (status)); return SANE_STATUS_GOOD; } - + if (size < sizeof (result)) memset ((char*)result.buttons + size, 0, sizeof (result) - size); - + /* hack to fill in meaningful values for the AV 210 / 610 and under some conditions the AV 220 */ if (size == 1) { /* AV 210, AV 610 */ DBG (1, "get_button_status: just one byte, filling the rest\n"); - + if (result.press_state > 0) { debug_print_raw (6, "get_button_status: raw data\n", (uint8_t*)&result, size); @@ -3402,72 +3402,72 @@ get_button_status (Avision_Scanner* s) return SANE_STATUS_GOOD; } else if (size >= 8 && result.press_state == 0) { /* AV 220 */ - + debug_print_raw (6, "get_button_status: raw data\n", (uint8_t*)&result, size); - + DBG (1, "get_button_status: zero buttons - filling values ...\n"); - + /* simulate button press of the last button ... */ result.press_state = 0x80 | 1; result.buttons[0] = dev->inquiry_buttons; /* 1 based */ } } - + debug_print_raw (6, "get_button_status: raw data\n", (uint8_t*)&result, size); - + DBG (3, "get_button_status: [0] Button status: %x\n", result.press_state); for (i = 0; i < 5; ++i) DBG (3, "get_button_status: [%d] Button number %d: %x\n", i+1, i, result.buttons[i]); DBG (3, "get_button_status: [7] Display: %d\n", result.display); - + { char* message_begin = s->val[OPT_MESSAGE].s; char* message_end = s->val[OPT_MESSAGE].s + s->opt[OPT_MESSAGE].size; char* message = message_begin; - + #define add_token(format,value) do { \ int n = snprintf (message, message_end - message, "%s" format, \ message == message_begin ? "" : ":", value); \ message += n > 0 ? n : 0; \ } while (0) - + if (result.display > 0) add_token ("%d", result.display); - + if (result.press_state >> 7) /* AV220 et.al. bit 6 is long/short press? */ { - + const unsigned int buttons_pressed = result.press_state & 0x7F; DBG (3, "get_button_status: %d button(s) pressed\n", buttons_pressed); - + /* reset the hardware button status */ if (! (dev->hw->feature_type & AV_INT_BUTTON)) { struct command_send scmd; uint8_t button_reset = 1; - + DBG (3, "get_button_status: resetting status\n"); - + memset (&scmd, 0, sizeof (scmd)); - + scmd.opc = AVISION_SCSI_SEND; scmd.datatypecode = 0xA1; /* button control */ set_double (scmd.datatypequal, dev->data_dq); set_triple (scmd.transferlen, size); - + status = avision_cmd (&s->av_con, &scmd, sizeof (scmd), &button_reset, sizeof (button_reset), 0, 0); - + if (status != SANE_STATUS_GOOD) { DBG (1, "get_button_status: send failed (%s)\n", sane_strstatus (status)); return status; } } - + for (i = 0; i < buttons_pressed; ++i) { const unsigned int button = result.buttons[i] - 1; /* 1 based ... */ DBG (3, "get_button_status: button %d pressed\n", button); @@ -3487,7 +3487,7 @@ get_button_status (Avision_Scanner* s) else DBG (3, "get_button_status: no button pressed\n"); } - + return SANE_STATUS_GOOD; #undef add_token } @@ -3496,33 +3496,33 @@ static SANE_Status get_frame_info (Avision_Scanner* s) { Avision_Device* dev = s->hw; - + /* read stuff */ struct command_read rcmd; size_t size; SANE_Status status; uint8_t result[8]; size_t i; - + DBG (3, "get_frame_info:\n"); - + size = sizeof (result); - + memset (&rcmd, 0, sizeof (rcmd)); rcmd.opc = AVISION_SCSI_READ; - + rcmd.datatypecode = 0x87; /* film holder sense */ set_double (rcmd.datatypequal, dev->data_dq); set_triple (rcmd.transferlen, size); - + status = avision_cmd (&s->av_con, &rcmd, sizeof (rcmd), 0, 0, result, &size); if (status != SANE_STATUS_GOOD || size != sizeof (result)) { DBG (1, "get_frame_info: read failed (%s)\n", sane_strstatus (status)); return (status); } - + debug_print_raw (6, "get_frame_info: raw data\n", result, size); - + DBG (3, "get_frame_info: [0] Holder type: %s\n", (result[0]==1)?"APS": (result[0]==2)?"Film holder (35mm)": @@ -3531,24 +3531,24 @@ get_frame_info (Avision_Scanner* s) DBG (3, "get_frame_info: [1] Current frame number: %d\n", result[1]); DBG (3, "get_frame_info: [2] Frame amount: %d\n", result[2]); DBG (3, "get_frame_info: [3] Mode: %s\n", BIT(result[3],4)?"APS":"Not APS"); - DBG (3, "get_frame_info: [3] Exposures (if APS): %s\n", + DBG (3, "get_frame_info: [3] Exposures (if APS): %s\n", ((i=(BIT(result[3],3)<<1)+BIT(result[2],2))==0)?"Unknown": (i==1)?"15":(i==2)?"25":"40"); - DBG (3, "get_frame_info: [3] Film Type (if APS): %s\n", + DBG (3, "get_frame_info: [3] Film Type (if APS): %s\n", ((i=(BIT(result[1],3)<<1)+BIT(result[0],2))==0)?"Unknown": (i==1)?"B&W Negative":(i==2)?"Color slide":"Color Negative"); dev->holder_type = result[0]; dev->current_frame = result[1]; - + dev->frame_range.min = 1; dev->frame_range.quant = 1; - + if (result[0] != 0xff) dev->frame_range.max = result[2]; else dev->frame_range.max = 1; - + return SANE_STATUS_GOOD; } @@ -3556,7 +3556,7 @@ static SANE_Status get_duplex_info (Avision_Scanner* s) { Avision_Device* dev = s->hw; - + /* read stuff */ struct command_read rcmd; @@ -3567,30 +3567,30 @@ get_duplex_info (Avision_Scanner* s) uint8_t lineart_line_difference[2]; uint8_t image_info; } result; - + size_t size; SANE_Status status; - + DBG (3, "get_duplex_info:\n"); - + size = sizeof (result); - + memset (&rcmd, 0, sizeof (rcmd)); rcmd.opc = AVISION_SCSI_READ; - + rcmd.datatypecode = 0xB1; /* read duplex info */ set_double (rcmd.datatypequal, dev->data_dq); set_triple (rcmd.transferlen, size); - + status = avision_cmd (&s->av_con, &rcmd, sizeof (rcmd), 0, 0, &result, &size); if (status != SANE_STATUS_GOOD || size != sizeof (result)) { DBG (1, "get_duplex_info: read failed (%s)\n", sane_strstatus (status)); return (status); } - + debug_print_raw (6, "get_duplex_info: raw data\n", (uint8_t*)&result, size); - + DBG (3, "get_duplex_info: [0] Mode: %s%s\n", BIT(result.mode,0)?"MERGED_PAGES":"", BIT(result.mode,1)?"2ND_PAGE_FOLLOWS":""); @@ -3606,7 +3606,7 @@ get_duplex_info (Avision_Scanner* s) BIT(result.image_info,1)?" ADF_BGR":" ADF_RGB", BIT(result.image_info,2)?" FLATBED_NEEDS_MIRROR_IMAGE":"", BIT(result.image_info,3)?" ADF_NEEDS_MIRROR_IMAGE":""); - + return SANE_STATUS_GOOD; } @@ -3617,45 +3617,45 @@ set_frame (Avision_Scanner* s, SANE_Word frame) struct command_send cmd; uint8_t data[8]; } scmd; - + Avision_Device* dev = s->hw; SANE_Status status; - + DBG (3, "set_frame: request frame %d\n", frame); - + /* Better check the current status of the film holder, because it can be changed between scans. */ status = get_frame_info (s); if (status != SANE_STATUS_GOOD) return status; - + /* No film holder? */ if (dev->holder_type == 0xff) { DBG (1, "set_frame: No film holder!!\n"); return SANE_STATUS_INVAL; } - + /* Requesting frame 0xff indicates eject/rewind */ if (frame != 0xff && (frame < 1 || frame > dev->frame_range.max) ) { DBG (1, "set_frame: Illegal frame (%d) requested (min=1, max=%d)\n", - frame, dev->frame_range.max); + frame, dev->frame_range.max); return SANE_STATUS_INVAL; } - + memset (&scmd, 0, sizeof (scmd)); scmd.cmd.opc = AVISION_SCSI_SEND; scmd.cmd.datatypecode = 0x87; /* send film holder "sense" */ set_double (scmd.cmd.datatypequal, dev->data_dq); set_triple (scmd.cmd.transferlen, sizeof (scmd.data) ); - + scmd.data[0] = dev->holder_type; - scmd.data[1] = frame; - + scmd.data[1] = frame; + status = avision_cmd (&s->av_con, &scmd.cmd, sizeof (scmd.cmd), &scmd.data, sizeof (scmd.data), 0, 0); if (status != SANE_STATUS_GOOD) { DBG (1, "set_frame: send_data (%s)\n", sane_strstatus (status)); - } + } return status; } @@ -3669,20 +3669,20 @@ attach (SANE_String_Const devname, Avision_ConnectionType con_type, Avision_Device* dev; SANE_Status status; - + Avision_Connection av_con; char mfg [9]; char model [17]; char rev [5]; - + unsigned int i; char* s; SANE_Bool found; - + DBG (3, "attach:\n"); memset (result, 0, sizeof(result)); - + for (dev = first_dev; dev; dev = dev->next) if (strcmp (dev->sane.name, devname) == 0) { if (devp) @@ -3693,25 +3693,25 @@ attach (SANE_String_Const devname, Avision_ConnectionType con_type, av_con.connection_type = con_type; if (av_con.connection_type == AV_USB) av_con.usb_status = AVISION_USB_UNTESTED_STATUS; - + /* set known USB status type */ if (attaching_hw && attaching_hw->feature_type & AV_INT_STATUS) av_con.usb_status = AVISION_USB_INT_STATUS; - + DBG (3, "attach: opening %s\n", devname); status = avision_open (devname, &av_con, sense_handler, 0); if (status != SANE_STATUS_GOOD) { DBG (1, "attach: open failed (%s)\n", sane_strstatus (status)); return SANE_STATUS_INVAL; } - + /* first: get the standard inquiry? */ status = inquiry (av_con, result, AVISION_INQUIRY_SIZE_V1); if (status != SANE_STATUS_GOOD) { DBG (1, "attach: 1st inquiry failed (%s)\n", sane_strstatus (status)); return status; } - + /* copy string information - and zero terminate them c-style */ memcpy (&mfg, result + 8, 8); mfg [8] = 0; @@ -3719,7 +3719,7 @@ attach (SANE_String_Const devname, Avision_ConnectionType con_type, model [16] = 0; memcpy (&rev, result + 32, 4); rev [4] = 0; - + /* shorten strings (-1 for last index -1 for last 0; >0 because one char at least) */ for (i = sizeof (mfg) - 2; i > 0; i--) { @@ -3734,10 +3734,10 @@ attach (SANE_String_Const devname, Avision_ConnectionType con_type, else break; } - + DBG (1, "attach: Inquiry gives mfg=%s, model=%s, product revision=%s.\n", mfg, model, rev); - + model_num = 0; found = 0; /* while not at at end of list NULL terminator */ @@ -3746,7 +3746,7 @@ attach (SANE_String_Const devname, Avision_ConnectionType con_type, { int matches = 0, match_count = 0; /* count number of matches */ DBG (1, "attach: Checking model: %d\n", model_num); - + if (Avision_Device_List[model_num].scsi_mfg) { ++match_count; if (strcmp(mfg, Avision_Device_List[model_num].scsi_mfg) == 0) @@ -3757,7 +3757,7 @@ attach (SANE_String_Const devname, Avision_ConnectionType con_type, if (strcmp(model, Avision_Device_List[model_num].scsi_model) == 0) ++matches; } - + /* we need 2 matches (mfg, model) for SCSI entries, or the ones available for "we know what we are looking for" USB entries */ if ((attaching_hw == &(Avision_Device_List [model_num]) && @@ -3775,16 +3775,16 @@ attach (SANE_String_Const devname, Avision_ConnectionType con_type, } ++model_num; } - + if (!found) { DBG (0, "attach: \"%s\" - \"%s\" not yet in whitelist!\n", mfg, model); DBG (0, "attach: You might want to report this output.\n"); DBG (0, "attach: To: rene@exactcode.de (the Avision backend author)\n"); - + status = SANE_STATUS_INVAL; goto close_scanner_and_return; } - + /* second: maybe ask for the firmware status and flash ram info */ if (Avision_Device_List [model_num].feature_type & AV_FIRMWARE) { @@ -3795,7 +3795,7 @@ attach (SANE_String_Const devname, Avision_ConnectionType con_type, sane_strstatus (status)); goto close_scanner_and_return; } - + DBG (3, "attach: reading flash ram info\n"); status = get_flash_ram_info (&av_con); if (status != SANE_STATUS_GOOD) { @@ -3803,7 +3803,7 @@ attach (SANE_String_Const devname, Avision_ConnectionType con_type, sane_strstatus (status)); goto close_scanner_and_return; } - + #ifdef FIRMWARE_DATABASE_INCLUDED /* Send new NV-RAM (firmware) data */ status = send_nvram_data (&av_con); @@ -3811,7 +3811,7 @@ attach (SANE_String_Const devname, Avision_ConnectionType con_type, goto close_scanner_and_return; #endif } - + /* third: get the extended Avision inquiry */ status = inquiry (av_con, result, AVISION_INQUIRY_SIZE_V1); if (status != SANE_STATUS_GOOD) { @@ -3824,17 +3824,17 @@ attach (SANE_String_Const devname, Avision_ConnectionType con_type, status = SANE_STATUS_NO_MEM; goto close_scanner_and_return; } - + memset (dev, 0, sizeof (*dev)); dev->hw = &Avision_Device_List[model_num]; - + dev->sane.name = strdup (devname); dev->sane.vendor = dev->hw->real_mfg ? dev->hw->real_mfg : strdup (mfg); dev->sane.model = dev->hw->real_model ? dev->hw->real_model : strdup (model); dev->connection.connection_type = av_con.connection_type; dev->connection.usb_status = av_con.usb_status; - + /* and finally Avision even extended this one later on the AV220C2 does not grok this */ dev->inquiry_asic_type = (int) result[91]; @@ -3846,13 +3846,13 @@ attach (SANE_String_Const devname, Avision_ConnectionType con_type, goto close_scanner_and_return; } } - + debug_print_raw (6, "attach: raw data:\n", result, sizeof (result) ); - + DBG (3, "attach: [8-15] Vendor id.: '%8.8s'\n", result+8); DBG (3, "attach: [16-31] Product id.: '%16.16s'\n", result+16); DBG (3, "attach: [32-35] Product rev.: '%4.4s'\n", result+32); - + i = (result[36] >> 4) & 0x7; switch (result[36] & 0x07) { case 0: @@ -3873,7 +3873,7 @@ attach (SANE_String_Const devname, Avision_ConnectionType con_type, DBG (3, "attach: [37] Optical res.: %d00 dpi\n", result[37]); DBG (3, "attach: [38] Maximum res.: %d00 dpi\n", result[38]); - + DBG (3, "attach: [39] Bitfield1:%s%s%s%s%s%s\n", BIT(result[39],7)?" TRANS":"", BIT(result[39],6)?" Q_SCAN":"", @@ -3881,7 +3881,7 @@ attach (SANE_String_Const devname, Avision_ConnectionType con_type, BIT(result[39],4)?" SUPPORTS_CALIB":"", BIT(result[39],2)?" NEW_PROTOCOL":"", (result[39] & 0x03) == 0x03 ? " AVISION":" OEM"); - + DBG (3, "attach: [40-41] X res. in gray: %d dpi\n", get_double ( &(result[40]) )); DBG (3, "attach: [42-43] Y res. in gray: %d dpi\n", @@ -3920,7 +3920,7 @@ get_double ( &(result[48] ) )); BIT(result[52],2)?" INDEX_COLOR":"", BIT(result[52],1)?" POWER_SAVING_TIMER":"", BIT(result[52],0)?" NVM_DATA_REC":""); - + /* print some more scanner features/params */ DBG (3, "attach: [53] line difference (software color pack): %d\n", result[53]); DBG (3, "attach: [54] color mode pixel boundary: %d\n", result[54]); @@ -3929,13 +3929,13 @@ get_double ( &(result[48] ) )); DBG (3, "attach: [57] lineart mode pixel boundary: %d\n", result[57]); DBG (3, "attach: [58] halftone mode pixel boundary: %d\n", result[58]); DBG (3, "attach: [59] error-diffusion mode pixel boundary: %d\n", result[59]); - + DBG (3, "attach: [60] channels per pixel:%s%s%s\n", BIT(result[60],7)?" 1":"", BIT(result[60],6)?" 3":"", (result[60] & 0x3F) != 0 ? " RESERVED":""); - - DBG (3, "attach: [61] bits per channel:%s%s%s%s%s%s%s\n", + + DBG (3, "attach: [61] bits per channel:%s%s%s%s%s%s%s\n", BIT(result[61],7)?" 1":"", BIT(result[61],6)?" 4":"", BIT(result[61],5)?" 6":"", @@ -3943,40 +3943,40 @@ get_double ( &(result[48] ) )); BIT(result[61],3)?" 10":"", BIT(result[61],2)?" 12":"", BIT(result[61],1)?" 16":""); - - DBG (3, "attach: [62] scanner type:%s%s%s%s%s%s\n", + + DBG (3, "attach: [62] scanner type:%s%s%s%s%s%s\n", BIT(result[62],7)?" Flatbed":"", BIT(result[62],6)?" Roller (ADF)":"", BIT(result[62],5)?" Flatbed (ADF)":"", BIT(result[62],4)?" Roller":"", /* does not feed multiple pages, AV25 */ BIT(result[62],3)?" Film scanner":"", BIT(result[62],2)?" Duplex":""); - + DBG (3, "attach: [75-76] Max shading target : %x\n", get_double ( &(result[75]) )); - + DBG (3, "attach: [77-78] Max X of transparency: %d dots * base_dpi\n", get_double ( &(result[77]) )); DBG (3, "attach: [79-80] Max Y of transparency: %d dots * base_dpi\n", get_double ( &(result[79]) )); - + DBG (3, "attach: [81-82] Max X of flatbed: %d dots * base_dpi\n", get_double ( &(result[81]) )); DBG (3, "attach: [83-84] Max Y of flatbed: %d dots * base_dpi\n", get_double ( &(result[83]) )); - + DBG (3, "attach: [85-86] Max X of ADF: %d dots * base_dpi\n", get_double ( &(result[85]) )); DBG (3, "attach: [87-88] Max Y of ADF: %d dots * base_dpi\n", get_double ( &(result[87]) )); /* 0xFFFF means unlimited length */ - + DBG (3, "attach: [89-90] Res. in Ex. mode: %d dpi\n", get_double ( &(result[89]) )); - + DBG (3, "attach: [91] ASIC: %d\n", result[91]); - + DBG (3, "attach: [92] Buttons: %d\n", result[92]); - + DBG (3, "attach: [93] ESA4:%s%s%s%s%s%s%s%s\n", BIT(result[93],7)?" SUPPORTS_ACCESSORIES_DETECT":"", BIT(result[93],6)?" ADF_IS_BGR_ORDERED":"", @@ -3986,7 +3986,7 @@ get_double ( &(result[48] ) )); BIT(result[93],2)?" SUPPORTS_LIGHT_DETECT":"", BIT(result[93],1)?" SUPPORTS_READ_PRNU_DATA":"", BIT(result[93],0)?" FLATBED_MIRRORS_IMAGE":""); - + DBG (3, "attach: [94] ESA5:%s%s%s%s%s%s%s%s\n", BIT(result[94],7)?" IGNORE_LINE_DIFFERENCE_FOR_ADF":"", BIT(result[94],6)?" NEEDS_SW_LINE_COLOR_PACK":"", @@ -3996,7 +3996,7 @@ get_double ( &(result[48] ) )); BIT(result[94],2)?" SUPPORTS_TUNE_SCAN_LENGTH":"", BIT(result[94],1)?" SUPPORTS_SWITCH_STRIP_FOR_DESKEW":"", /* Kodak i80 only */ BIT(result[94],0)?" SEARCHES_LEADING_SIDE_EDGE_BY_FIRMWARE":""); - + DBG (3, "attach: [95] ESA6:%s%s%s%s%s%s%s%s\n", BIT(result[95],7)?" SUPPORTS_PAPER_SIZE_AUTO_DETECTION":"", BIT(result[95],6)?" SUPPORTS_DO_HOUSEKEEPING":"", /* Kodak i80 only */ @@ -4006,7 +4006,7 @@ get_double ( &(result[48] ) )); BIT(result[95],2)?" SUPPORTS_GET_BACKGROUND_RASTER":"", /* AV220 et.al. */ BIT(result[95],1)?" SUPPORTS_NVRAM_RESET":"", BIT(result[95],0)?" SUPPORTS_BATCH_SCAN":""); - + DBG (3, "attach: [128] ESA7:%s%s%s%s%s%s%s%s\n", BIT(result[128],7)?" SUPPORTS_ADF_CONTINUOUS":"", BIT(result[128],6)?" SUPPORTS_YCbCr_COLOR":"", @@ -4016,7 +4016,7 @@ get_double ( &(result[48] ) )); BIT(result[128],2)?" SUPPORTS_JOB_CONTROL":"", BIT(result[128],1)?" SUPPORTS_INF_LENGTH":"", BIT(result[128],0)?" ULTRA_SONIC_DOUBLE_FEED_DETECTION":""); - + DBG (3, "attach: [129] YCbCr:%s%s%s%s%s%s%s%s\n", BIT(result[129],7)?" YCC4:2:0":"", BIT(result[129],6)?" YCC(profile2)":"", @@ -4026,7 +4026,7 @@ get_double ( &(result[48] ) )); BIT(result[129],2)?" JPEG(profile2)":"", BIT(result[129],1)?" JPEG(profile3)":"", BIT(result[129],0)?" JPEG(profile4)":""); - + /* I have no idea how film scanner could reliably be detected -ReneR */ if (dev->hw->feature_type & AV_FILMSCANNER) { dev->scanner_type = AV_FILM; @@ -4046,19 +4046,19 @@ get_double ( &(result[48] ) )); dev->inquiry_nvram_read = BIT(result[52],0); dev->inquiry_power_save_time = BIT(result[52],1); - + dev->inquiry_adf = BIT (result[62], 5); dev->inquiry_duplex = BIT (result[62], 2) || BIT (result[94], 5); - dev->inquiry_duplex_interlaced = BIT(result[62],2) || BIT (result[94], 4); + dev->inquiry_duplex_interlaced = BIT(result[62],2) || BIT (result[94], 4); /* the first avision scanners (AV3200) do not set the interlaced bit */ if (dev->inquiry_duplex && dev->inquiry_asic_type < AV_ASIC_C6) dev->inquiry_duplex_interlaced = 1; dev->inquiry_paper_length = BIT (result[95], 5); dev->inquiry_batch_scan = BIT (result[95], 0); /* AV122, DM152 */ - + dev->inquiry_detect_accessories = BIT (result[93], 7); - + dev->inquiry_needs_calibration = BIT (result[50], 4); dev->inquiry_keeps_window = BIT (result[50], 1); @@ -4066,7 +4066,7 @@ get_double ( &(result[48] ) )); dev->inquiry_keeps_window = 0; if (Avision_Device_List [model_num].feature_type & AV_DOES_KEEP_WINDOW) dev->inquiry_keeps_window = 1; - + dev->inquiry_needs_gamma = BIT (result[50], 3); dev->inquiry_keeps_gamma = BIT (result[50], 2); if (Avision_Device_List [model_num].feature_type & AV_DOES_NOT_KEEP_GAMMA) @@ -4076,33 +4076,33 @@ get_double ( &(result[48] ) )); dev->inquiry_3x3_matrix = BIT (result[51], 1); dev->inquiry_needs_software_colorpack = BIT (result[50],5); - + dev->inquiry_needs_line_pack = BIT (result[94], 6); - + dev->inquiry_adf_need_mirror = BIT (result[51], 0); dev->inquiry_adf_bgr_order = BIT (result[93], 6); if (Avision_Device_List [model_num].feature_type & AV_ADF_BGR_ORDER_INVERT) dev->inquiry_adf_bgr_order = ! dev->inquiry_adf_bgr_order; - + dev->inquiry_light_detect = BIT (result[93], 2); dev->inquiry_light_control = BIT (result[50], 7); dev->inquiry_button_control = BIT (result[50], 6) | BIT (result[51],2); - + dev->inquiry_exposure_control = BIT(result[51],7); dev->inquiry_max_shading_target = get_double ( &(result[75]) ); - + dev->inquiry_color_boundary = result[54]; if (dev->inquiry_color_boundary == 0) dev->inquiry_color_boundary = 8; - + dev->inquiry_gray_boundary = result[55]; if (dev->inquiry_gray_boundary == 0) dev->inquiry_gray_boundary = 8; - + dev->inquiry_dithered_boundary = result[59]; if (dev->inquiry_dithered_boundary == 0) dev->inquiry_dithered_boundary = 8; - + dev->inquiry_thresholded_boundary = result[57]; if (dev->inquiry_thresholded_boundary == 0) dev->inquiry_thresholded_boundary = 8; @@ -4121,7 +4121,7 @@ get_double ( &(result[48] ) )); default: ; } - + if (dev->inquiry_new_protocol) { dev->inquiry_optical_res = get_double ( &(result[89]) ); dev->inquiry_max_res = get_double ( &(result[44]) ); @@ -4136,7 +4136,7 @@ get_double ( &(result[48] ) )); DBG (1, "Inquiry optical resolution > max_resolution, adjusting!\n"); dev->inquiry_max_res = dev->inquiry_optical_res; } - + if (dev->inquiry_optical_res == 0) { DBG (1, "Inquiry optical resolution is invalid!\n"); @@ -4151,7 +4151,7 @@ get_double ( &(result[48] ) )); DBG (1, "Inquiry max resolution is invalid, using 1200 dpi!\n"); dev->inquiry_max_res = 1200; } - + DBG (1, "attach: optical resolution set to: %d dpi\n", dev->inquiry_optical_res); DBG (1, "attach: max resolution set to: %d dpi\n", dev->inquiry_max_res); @@ -4163,7 +4163,7 @@ get_double ( &(result[48] ) )); dev->inquiry_channels_per_pixel = 3; else dev->inquiry_channels_per_pixel = 1; - + if (BIT(result[61],1)) dev->inquiry_bits_per_channel = 16; else if (BIT(result[61],2)) @@ -4192,7 +4192,7 @@ get_double ( &(result[48] ) )); if (! (dev->hw->feature_type & AV_NO_BUTTON)) dev->inquiry_buttons = result[92]; - + /* get max x/y ranges for the different modes */ { double base_dpi; /* TODO: make int */ @@ -4205,39 +4205,39 @@ get_double ( &(result[48] ) )); */ base_dpi = dev->inquiry_optical_res; } - + /* .1 to slightly increase the size to match the one of American standard paper formats that would otherwise be .1 mm too large to scan ... */ dev->inquiry_x_ranges [AV_NORMAL_DIM] = (double)get_double (&(result[81])) * MM_PER_INCH / base_dpi + .1; dev->inquiry_y_ranges [AV_NORMAL_DIM] = (double)get_double (&(result[83])) * MM_PER_INCH / base_dpi; - + dev->inquiry_x_ranges [AV_TRANSPARENT_DIM] = (double)get_double (&(result[77])) * MM_PER_INCH / base_dpi + .1; dev->inquiry_y_ranges [AV_TRANSPARENT_DIM] = (double)get_double (&(result[79])) * MM_PER_INCH / base_dpi; - + dev->inquiry_x_ranges [AV_ADF_DIM] = (double)get_double (&(result[85])) * MM_PER_INCH / base_dpi + .1; dev->inquiry_y_ranges [AV_ADF_DIM] = (double)get_double (&(result[87])) * MM_PER_INCH / base_dpi; } - + dev->inquiry_tune_scan_length = BIT(result[94],2); if (Avision_Device_List [model_num].feature_type & AV_NO_TUNE_SCAN_LENGTH) dev->inquiry_tune_scan_length = 0; dev->inquiry_background_raster = BIT(result[95],2); - + if (dev->hw->feature_type & AV_NO_BACKGROUND) dev->inquiry_background_raster = 0; - + if (dev->inquiry_background_raster) { dev->inquiry_background_raster_pixel = get_double(&(result[85])) * dev->inquiry_optical_res / AVISION_BASE_RES; } - + /* check if x/y ranges are valid :-((( */ { source_mode_dim mode; @@ -4271,7 +4271,7 @@ get_double ( &(result[48] ) )); } else { dev->inquiry_x_ranges [mode] = A4_X_RANGE * MM_PER_INCH; - + if (dev->scanner_type == AV_SHEETFEED) dev->inquiry_y_ranges [mode] = SHEETFEED_Y_RANGE * MM_PER_INCH; else @@ -4283,7 +4283,7 @@ get_double ( &(result[48] ) )); dev->inquiry_x_ranges [mode], dev->inquiry_y_ranges [mode]); } /* end for all modes */ } - + /* We need a bigger buffer for USB devices, since they seem to have a firmware bug and do not support reading the calibration data in tiny chunks */ @@ -4298,26 +4298,26 @@ get_double ( &(result[48] ) )); dev->read_stripe_size = 32; else /* tested on AV3200 with it's max of 300dpi @color */ dev->read_stripe_size = 8; /* maybe made dynamic on scan res ... */ - + /* normally the data_dq is 0x0a0d - but some newer scanner hang with it ... */ if (dev->inquiry_new_protocol) /* TODO: match on ASIC? which model hung? */ dev->data_dq = 0x0a0d; else dev->data_dq = 0; - + avision_close (&av_con); - + ++ num_devices; dev->next = first_dev; first_dev = dev; if (devp) *devp = dev; - + return SANE_STATUS_GOOD; - + close_scanner_and_return: avision_close (&av_con); - + return status; } @@ -4327,39 +4327,39 @@ get_tune_scan_length (Avision_Scanner* s) { SANE_Status status; int i; - + struct command_read rcmd; size_t size; - + struct max_value { uint8_t max [2]; } payload; - + /* turn on the light */ DBG (3, "get_tune_scan_length:\n"); memset (&rcmd, 0, sizeof (rcmd)); size = sizeof (payload); - + rcmd.opc = AVISION_SCSI_READ; rcmd.datatypecode = 0xD2; /* Read General Ability/Parameter */ - + for (i = 1; i <= 8; ++i) { memset (&payload, 0, sizeof (payload)); - + set_double (rcmd.datatypequal, i); /* type */ set_triple (rcmd.transferlen, size); - + status = avision_cmd (&s->av_con, &rcmd, sizeof (rcmd), 0, 0, &payload, &size); - + if (status != SANE_STATUS_GOOD) { DBG (1, "get_tune_scan_length: read %d failed (%s)\n", i, sane_strstatus (status)); return status; } DBG (1, "get_tune_scan_length: %d: %d\n", i, get_double (payload.max)); } - + return SANE_STATUS_GOOD; } @@ -4367,7 +4367,7 @@ static SANE_Status send_tune_scan_length (Avision_Scanner* s) { int top, bottom; - + SANE_Status status; size_t size; struct command_send scmd; @@ -4375,31 +4375,31 @@ send_tune_scan_length (Avision_Scanner* s) uint8_t vertical [2]; /* uint8_t horizontal [2]; not send by the Windows driver, yet */ } payload; - + DBG (3, "send_tune_scan_length:\n"); - + memset (&scmd, 0, sizeof (scmd)); - + size = sizeof (payload); scmd.opc = AVISION_SCSI_SEND; scmd.datatypecode = 0x96; /* Attach/Truncate head(left) of scan length */ set_triple (scmd.transferlen, size); - + /* the SPEC says optical DPI, but real world measuring suggests it is 1200 as in the window descriptor */ top = 1200 * SANE_UNFIX (s->val[OPT_OVERSCAN_TOP].w) / MM_PER_INCH; DBG (3, "send_tune_scan_length: top: %d\n", top); - + set_double (scmd.datatypequal, 0x0001); /* attach, 0x000 is shorten */ set_double (payload.vertical, top); /* set_double (payload.horizontal, 0); */ - + /* we alway send it, even for 0 as the scanner keeps it in RAM and previous runs could already have set something */ - + status = avision_cmd (&s->av_con, &scmd, sizeof (scmd), &payload, sizeof (payload), 0, 0); - + if (status != SANE_STATUS_GOOD) { DBG (1, "send_tune_scan_length: send top/left failed (%s)\n", sane_strstatus (status)); return status; @@ -4411,16 +4411,16 @@ send_tune_scan_length (Avision_Scanner* s) set_double (payload.vertical, bottom); /*set_double (payload.horizontal, 0); */ - + size = sizeof (payload); status = avision_cmd (&s->av_con, &scmd, sizeof (scmd), &payload, sizeof (payload), 0, 0); - + if (status != SANE_STATUS_GOOD) { DBG (1, "send_tune_scan_length: send bottom/right failed (%s)\n", sane_strstatus (status)); return status; } - + return SANE_STATUS_GOOD; } @@ -4428,10 +4428,10 @@ static SANE_Status additional_probe (Avision_Scanner* s) { Avision_Device* dev = s->hw; - + /* we should wait until the scanner is ready before we perform further actions */ - + SANE_Status status; /* try to retrieve additional accessory information */ if (dev->inquiry_detect_accessories) { @@ -4439,28 +4439,28 @@ additional_probe (Avision_Scanner* s) if (status != SANE_STATUS_GOOD) return status; } - + /* for a film scanner try to retrieve additional frame information */ if (dev->scanner_type == AV_FILM) { status = get_frame_info (s); if (status != SANE_STATUS_GOOD) return status; } - + /* no scanner did support this so far: tried on AV220, DM152 */ if (0 && dev->inquiry_duplex) { status = get_duplex_info (s); if (status != SANE_STATUS_GOOD) return status; } - + /* get overscan ("head/tail tune") information: hangs AV220, zeros on AV122 */ if (0 && dev->inquiry_tune_scan_length) { status = get_tune_scan_length (s); if (status != SANE_STATUS_GOOD) return status; } - + /* create dynamic *-mode entries */ if (!dev->inquiry_no_gray_modes) { @@ -4474,7 +4474,7 @@ additional_probe (Avision_Scanner* s) if (dev->inquiry_bits_per_channel == 12) add_color_mode (dev, AV_GRAYSCALE12, "12bit Gray"); - + if (dev->inquiry_bits_per_channel >= 16) add_color_mode (dev, AV_GRAYSCALE16, "16bit Gray"); } @@ -4484,17 +4484,17 @@ additional_probe (Avision_Scanner* s) if (dev->inquiry_bits_per_channel == 12) add_color_mode (dev, AV_TRUECOLOR12, "12bit Color"); - + if (dev->inquiry_bits_per_channel >= 16) add_color_mode (dev, AV_TRUECOLOR16, "16bit Color"); } - + /* now choose the default mode - avoiding the 12/16 bit modes */ dev->color_list_default = last_color_mode (dev); if (dev->inquiry_bits_per_channel > 8 && dev->color_list_default > 0) { dev->color_list_default--; } - + if (dev->scanner_type == AV_SHEETFEED) { add_source_mode (dev, AV_ADF, "ADF Front"); @@ -4502,20 +4502,20 @@ additional_probe (Avision_Scanner* s) else { add_source_mode (dev, AV_NORMAL, "Normal"); - + if (dev->inquiry_light_box) add_source_mode (dev, AV_TRANSPARENT, "Transparency"); - + if (dev->inquiry_adf) add_source_mode (dev, AV_ADF, "ADF Front"); } - + if (dev->inquiry_duplex) { if (dev->inquiry_duplex_interlaced && !(dev->hw->feature_type & AV_NO_REAR)) add_source_mode (dev, AV_ADF_REAR, "ADF Back"); add_source_mode (dev, AV_ADF_DUPLEX, "ADF Duplex"); } - + return SANE_STATUS_GOOD; } @@ -4523,21 +4523,21 @@ static SANE_Status get_calib_format (Avision_Scanner* s, struct calibration_format* format) { SANE_Status status; - + struct command_read rcmd; uint8_t result [32]; size_t size; - + DBG (3, "get_calib_format:\n"); size = sizeof (result); - + memset (&rcmd, 0, sizeof (rcmd)); rcmd.opc = AVISION_SCSI_READ; rcmd.datatypecode = 0x60; /* get calibration format */ set_double (rcmd.datatypequal, s->hw->data_dq); set_triple (rcmd.transferlen, size); - + DBG (3, "get_calib_format: read_data: %lu bytes\n", (u_long) size); status = avision_cmd (&s->av_con, &rcmd, sizeof (rcmd), 0, 0, result, &size); if (status != SANE_STATUS_GOOD || size != sizeof (result) ) { @@ -4545,9 +4545,9 @@ get_calib_format (Avision_Scanner* s, struct calibration_format* format) sane_strstatus (status) ); return status; } - + debug_print_calib_format (3, "get_calib_format", result); - + format->pixel_per_line = get_double (&(result[0])); format->bytes_per_channel = result[2]; format->lines = result[3]; @@ -4562,21 +4562,21 @@ get_calib_format (Avision_Scanner* s, struct calibration_format* format) format->r_dark_shading_target = get_double (&(result[15])); format->g_dark_shading_target = get_double (&(result[17])); format->b_dark_shading_target = get_double (&(result[19])); - + /* now translate to normal! */ /* firmware return R--RG--GB--B with 3 line count */ /* software format it as 1 line if true color scan */ /* only line interleave format to be supported */ - + if (color_mode_is_color (s->c_mode) || BIT(format->ability1, 3)) { format->channels = 3; format->lines /= 3; /* line interleave */ } else format->channels = 1; - + DBG (3, "get_calib_format: channels: %d\n", format->channels); - + return SANE_STATUS_GOOD; } @@ -4587,26 +4587,26 @@ get_calib_data (Avision_Scanner* s, uint8_t data_type, { SANE_Status status; uint8_t *calib_ptr; - + size_t get_size, data_size, chunk_size; - + struct command_read rcmd; - + chunk_size = calib_size; - + DBG (3, "get_calib_data: type %x, size %lu, chunk_size: %lu\n", data_type, (u_long) calib_size, (u_long) chunk_size); - + memset (&rcmd, 0, sizeof (rcmd)); - + rcmd.opc = AVISION_SCSI_READ; rcmd.datatypecode = data_type; set_double (rcmd.datatypequal, s->hw->data_dq); - + calib_ptr = calib_data; get_size = chunk_size; data_size = calib_size; - + while (data_size) { if (get_size > data_size) get_size = data_size; @@ -4617,7 +4617,7 @@ get_calib_data (Avision_Scanner* s, uint8_t data_type, DBG (3, "get_calib_data: Reading %ld bytes calibration data\n", (long)get_size); - + status = avision_cmd (&s->av_con, &rcmd, sizeof (rcmd), 0, 0, calib_ptr, &get_size); if (status != SANE_STATUS_GOOD) { @@ -4631,7 +4631,7 @@ get_calib_data (Avision_Scanner* s, uint8_t data_type, data_size -= get_size; calib_ptr += get_size; } - + return SANE_STATUS_GOOD; } @@ -4640,22 +4640,22 @@ set_calib_data (Avision_Scanner* s, struct calibration_format* format, uint8_t* dark_data, uint8_t* white_data) { Avision_Device* dev = s->hw; - + const int elements_per_line = format->pixel_per_line * format->channels; - + SANE_Status status; - + uint8_t send_type; uint16_t send_type_q; - + struct command_send scmd; - + int i; - + DBG (3, "set_calib_data:\n"); - + send_type = 0x82; /* download calibration data */ - + /* do we use a color mode? */ if (format->channels > 1) { send_type_q = 0x12; /* color calib data */ @@ -4666,40 +4666,40 @@ set_calib_data (Avision_Scanner* s, struct calibration_format* format, else send_type_q = 0x11; /* gray/bw calib data */ } - + memset (&scmd, 0x00, sizeof (scmd)); scmd.opc = AVISION_SCSI_SEND; scmd.datatypecode = send_type; - + /* data corrections due to dark calibration data merge */ if (BIT (format->ability1, 2) ) { DBG (3, "set_calib_data: merging dark calibration data\n"); for (i = 0; i < elements_per_line; ++i) { uint16_t value_orig = get_double_le (white_data + i*2); uint16_t value_new = value_orig; - + value_new &= 0xffc0; value_new |= (get_double_le (dark_data + i*2) >> 10) & 0x3f; - + DBG (9, "set_calib_data: element %d, dark difference %d\n", i, value_orig - value_new); - + set_double_le ((white_data + i*2), value_new); } } - + /* send data in one command? */ /* FR: HP5370 reports one-pass, but needs multi (or other format in single) */ if (format->channels == 1 || ( ( (dev->hw->feature_type & AV_ONE_CALIB_CMD) || - ! BIT(format->ability1, 0) ) && + ! BIT(format->ability1, 0) ) && ! (dev->hw->feature_type & AV_MULTI_CALIB_CMD) ) ) /* one command (most scanners) */ { size_t send_size = elements_per_line * 2; DBG (3, "set_calib_data: all channels in one command\n"); DBG (3, "set_calib_data: send_size: %lu\n", (u_long) send_size); - + memset (&scmd, 0, sizeof (scmd) ); scmd.opc = AVISION_SCSI_SEND; scmd.datatypecode = send_type; @@ -4715,9 +4715,9 @@ set_calib_data (Avision_Scanner* s, struct calibration_format* format, int conv_out_size = format->pixel_per_line * 2; uint16_t* conv_out_data; /* here it is save to use 16bit data since we only move whole words around */ - + DBG (3, "set_calib_data: channels in single commands\n"); - + conv_out_data = (uint16_t*) malloc (conv_out_size); if (!conv_out_data) { status = SANE_STATUS_NO_MEM; @@ -4727,24 +4727,24 @@ set_calib_data (Avision_Scanner* s, struct calibration_format* format, for (channel = 0; channel < 3; ++ channel) { int i; - + /* no need for endianness handling since whole word copy */ uint16_t* casted_avg_data = (uint16_t*) white_data; - + DBG (3, "set_calib_data_calibration: channel: %i\n", channel); - + for (i = 0; i < format->pixel_per_line; ++ i) conv_out_data [i] = casted_avg_data [i * 3 + channel]; - + DBG (3, "set_calib_data: sending %i bytes now\n", conv_out_size); - + memset (&scmd, 0, sizeof (scmd)); scmd.opc = AVISION_SCSI_SEND; scmd.datatypecode = send_type; /* send calibration data */ set_double (scmd.datatypequal, channel); set_triple (scmd.transferlen, conv_out_size); - + status = avision_cmd (&s->av_con, &scmd, sizeof (scmd), conv_out_data, conv_out_size, 0, 0); if (status != SANE_STATUS_GOOD) { @@ -4756,14 +4756,14 @@ set_calib_data (Avision_Scanner* s, struct calibration_format* format, free (conv_out_data); } /* end else send calib data*/ } - + return SANE_STATUS_GOOD; } /* Sort data pixel by pixel and average first 2/3 of the data. The caller has to free return pointer. R,G,B pixels interleave to R,G,B line interleave. - + The input data data is in 16 bits little endian, always. That is a = b[1] << 8 + b[0] in all system. @@ -4776,34 +4776,34 @@ sort_and_average (struct calibration_format* format, uint8_t* data) const int elements_per_line = format->pixel_per_line * format->channels; const int stride = format->bytes_per_channel * elements_per_line; int i, line; - + uint8_t *sort_data, *avg_data; - + DBG (1, "sort_and_average:\n"); - + if (!format || !data) return NULL; - + sort_data = malloc (format->lines * 2); if (!sort_data) return NULL; - + avg_data = malloc (elements_per_line * 2); if (!avg_data) { free (sort_data); return NULL; } - + /* for each pixel */ for (i = 0; i < elements_per_line; ++ i) { uint8_t* ptr1 = data + i * format->bytes_per_channel; uint16_t temp; - + /* copy all lines for pixel i into the linear array sort_data */ for (line = 0; line < format->lines; ++ line) { uint8_t* ptr2 = ptr1 + line * stride; /* pixel */ - + if (format->bytes_per_channel == 1) temp = 0xffff * *ptr2 / 255; else @@ -4811,12 +4811,12 @@ sort_and_average (struct calibration_format* format, uint8_t* data) set_double ((sort_data + line*2), temp); /* store big-endian */ /* DBG (7, "ReneR to sort: %x\n", temp); */ } - + temp = bubble_sort (sort_data, format->lines); /* DBG (7, "ReneR averaged: %x\n", temp); */ set_double ((avg_data + i*2), temp); /* store big-endian */ } - + free ((void *) sort_data); return avg_data; } @@ -4828,28 +4828,28 @@ compute_dark_shading_data (Avision_Scanner* s, { uint16_t map_value = DEFAULT_DARK_SHADING; uint16_t rgb_map_value[3]; - + int elements_per_line, i; - + DBG (3, "compute_dark_shading_data:\n"); - + if (s->hw->inquiry_max_shading_target != INVALID_DARK_SHADING) map_value = s->hw->inquiry_max_shading_target << 8; - + rgb_map_value[0] = format->r_dark_shading_target; rgb_map_value[1] = format->g_dark_shading_target; rgb_map_value[2] = format->b_dark_shading_target; - + for (i = 0; i < format->channels; ++i) { if (rgb_map_value[i] == INVALID_DARK_SHADING) rgb_map_value[i] = map_value; } - + if (format->channels == 1) { /* set to green, TODO: should depend on color drop-out and true-gray -ReneR */ rgb_map_value[0] = rgb_map_value[1] = rgb_map_value[2] = rgb_map_value[1]; } - + elements_per_line = format->pixel_per_line * format->channels; /* Check line interleave or pixel interleave. */ @@ -4874,22 +4874,22 @@ compute_white_shading_data (Avision_Scanner* s, int i; uint16_t inquiry_mst = DEFAULT_WHITE_SHADING; uint16_t mst[3]; - + int elements_per_line = format->pixel_per_line * format->channels; - + /* debug counter */ int values_invalid = 0; int values_limitted = 0; - + DBG (3, "compute_white_shading_data:\n"); - + if (s->hw->inquiry_max_shading_target != INVALID_WHITE_SHADING) inquiry_mst = s->hw->inquiry_max_shading_target << 4; - + mst[0] = format->r_shading_target; mst[1] = format->g_shading_target; mst[2] = format->b_shading_target; - + for (i = 0; i < 3; ++i) { if (mst[i] == INVALID_WHITE_SHADING) /* mst[i] > MAX_WHITE_SHADING) */ { DBG (3, "compute_white_shading_data: target %d invalid (%x) using inquiry (%x)\n", @@ -4913,7 +4913,7 @@ compute_white_shading_data (Avision_Scanner* s, else DBG (3, "compute_white_shading_data: target %d: %x\n", i, mst[0]); } - + /* some Avision example code was present here until SANE/Avision * BUILD 57. */ @@ -4921,31 +4921,31 @@ compute_white_shading_data (Avision_Scanner* s, /* set to green, TODO: should depend on color drop-out and true-gray -ReneR */ mst[0] = mst[1] = mst[2] = mst[1]; } - + /* calculate calibration data */ for (i = 0; i < elements_per_line; ++ i) { int result; /* calculate calibration value for pixel i */ uint16_t tmp_data = get_double((data + i*2)); - + if (tmp_data == INVALID_WHITE_SHADING) { tmp_data = DEFAULT_WHITE_SHADING; ++ values_invalid; } - + result = ( (int)mst[i % 3] * WHITE_MAP_RANGE / (tmp_data + 0.5)); - + /* sanity check for over-amplification, clipping */ if (result > MAX_WHITE_SHADING) { result = WHITE_MAP_RANGE; ++ values_limitted; } - + /* for visual debugging ... */ if (static_calib_list [i % 3] == SANE_TRUE) result = 0xA000; - + /* the output to the scanner will be 16 bit little endian again */ set_double_le ((data + i*2), result); } @@ -4959,20 +4959,20 @@ static SANE_Status normal_calibration (Avision_Scanner* s) { SANE_Status status; - + struct calibration_format calib_format; - + int calib_data_size, calib_bytes_per_line; uint8_t read_type; uint8_t *calib_tmp_data; - + DBG (1, "normal_calibration:\n"); - + /* get calibration format and data */ status = get_calib_format (s, &calib_format); if (status != SANE_STATUS_GOOD) return status; - + /* check if need do calibration */ if (calib_format.flags != 1) { DBG (1, "normal_calibration: Scanner claims no calibration needed -> skipped!\n"); @@ -4983,27 +4983,27 @@ normal_calibration (Avision_Scanner* s) /* size = lines * bytes_per_channel * pixels_per_line * channel */ calib_bytes_per_line = calib_format.bytes_per_channel * calib_format.pixel_per_line * calib_format.channels; - + calib_data_size = calib_format.lines * calib_bytes_per_line; - + calib_tmp_data = malloc (calib_data_size); if (!calib_tmp_data) return SANE_STATUS_NO_MEM; - + /* check if we need to do dark calibration (shading) */ if (BIT(calib_format.ability1, 3)) { DBG (1, "normal_calibration: reading dark data\n"); /* read dark calib data */ status = get_calib_data (s, 0x66, calib_tmp_data, calib_data_size); - + if (status != SANE_STATUS_GOOD) { free (calib_tmp_data); return status; } - + /* process dark data: sort and average. */ - + if (s->dark_avg_data) { free (s->dark_avg_data); s->dark_avg_data = 0; @@ -5015,7 +5015,7 @@ normal_calibration (Avision_Scanner* s) } compute_dark_shading_data (s, &calib_format, s->dark_avg_data); } - + /* do we use a color mode? */ if (calib_format.channels > 1) { DBG (3, "normal_calibration: using color calibration\n"); @@ -5025,15 +5025,15 @@ normal_calibration (Avision_Scanner* s) DBG (3, "normal_calibration: using gray calibration\n"); read_type = 0x61; /* gray calib data */ } - + /* do white calibration: read gray or color data */ status = get_calib_data (s, read_type, calib_tmp_data, calib_data_size); - + if (status != SANE_STATUS_GOOD) { free (calib_tmp_data); return status; } - + if (0) /* debug */ { FILE* f = NULL; @@ -5041,11 +5041,11 @@ normal_calibration (Avision_Scanner* s) write_pnm_header (f, AV_GRAYSCALE, calib_format.bytes_per_channel * 8, calib_format.pixel_per_line, calib_format.lines * calib_format.channels); - + fwrite (calib_tmp_data, 1, calib_data_size, f); fclose (f); } - + if (s->white_avg_data) { free (s->white_avg_data); s->white_avg_data = 0; @@ -5055,24 +5055,24 @@ normal_calibration (Avision_Scanner* s) free (calib_tmp_data); return SANE_STATUS_NO_MEM; } - + /* decrease white average data (if dark average data is present) */ if (s->dark_avg_data) { int elements_per_line = calib_format.pixel_per_line * calib_format.channels; int i; DBG (1, "normal_calibration: dark data present - decreasing white average data\n"); - + for (i = 0; i < elements_per_line; ++ i) { s->white_avg_data[i] -= s->dark_avg_data[i]; } } - + compute_white_shading_data (s, &calib_format, s->white_avg_data); - + status = set_calib_data (s, &calib_format, s->dark_avg_data, s->white_avg_data); - + free (calib_tmp_data); return status; } @@ -5080,12 +5080,12 @@ normal_calibration (Avision_Scanner* s) /* next was taken from the GIMP and is a bit modified ... ;-) * original Copyright (C) 1995 Spencer Kimball and Peter Mattis */ -static double +static double brightness_contrast_func (double brightness, double contrast, double value) { double nvalue; double power; - + /* apply brightness */ if (brightness < 0.0) value = value * (1.0 + brightness); @@ -5130,28 +5130,28 @@ send_gamma (Avision_Scanner* s) { Avision_Device* dev = s->hw; SANE_Status status = SANE_STATUS_GOOD; - + int invert_table = 0; - + size_t gamma_table_raw_size; size_t gamma_table_size; size_t gamma_values; - + struct command_send scmd; uint8_t *gamma_data; - + int color; /* current color */ size_t i; /* big table index */ size_t j; /* little table index */ size_t k; /* big table sub index */ double v1, v2; - + double brightness; double contrast; - + if (dev->inquiry_asic_type != AV_ASIC_OA980) invert_table = (s->c_mode == AV_THRESHOLDED) || (s->c_mode == AV_DITHERED); - + switch (dev->inquiry_asic_type) { case AV_ASIC_Cx: @@ -5176,37 +5176,37 @@ send_gamma (Avision_Scanner* s) gamma_table_raw_size = 512; /* SPEC claims: 256 ... ? */ gamma_table_size = 512; } - + gamma_values = gamma_table_size / 256; - + DBG (3, "send_gamma: table_raw_size: %lu, table_size: %lu\n", (u_long) gamma_table_raw_size, (u_long) gamma_table_size); DBG (3, "send_gamma: values: %lu, invert_table: %d\n", (u_long) gamma_values, invert_table); - + /* prepare for emulating contrast, brightness ... via the gamma-table */ brightness = SANE_UNFIX (s->val[OPT_BRIGHTNESS].w); brightness /= 100; contrast = SANE_UNFIX (s->val[OPT_CONTRAST].w); contrast /= 100; - + DBG (3, "send_gamma: brightness: %f, contrast: %f\n", brightness, contrast); - + gamma_data = malloc (gamma_table_raw_size); if (!gamma_data) return SANE_STATUS_NO_MEM; - + memset (&scmd, 0, sizeof (scmd) ); - + scmd.opc = AVISION_SCSI_SEND; scmd.datatypecode = 0x81; /* 0x81 for download gamma table */ set_triple (scmd.transferlen, gamma_table_raw_size); - + for (color = 0; color < 3 && status == SANE_STATUS_GOOD; ++ color) { /* color: 0=red; 1=green; 2=blue */ set_double (scmd.datatypequal, color); - + i = 0; /* big table index */ for (j = 0; j < 256; ++ j) /* little table index */ { @@ -5237,21 +5237,21 @@ send_gamma (Avision_Scanner* s) v2 = (double) s->gamma_table [0][j + 1]; } } /*end switch */ - + /* Emulate brightness and contrast (at least the Avision AV6[2,3]0 * as well as many others do not have a hardware implementation, * --$. The function was taken from the GIMP source - maybe I'll * optimize it in the future (when I have spare time). */ - + v1 /= 255; v2 /= 255; - + v1 = (brightness_contrast_func (brightness, contrast, v1) ); v2 = (brightness_contrast_func (brightness, contrast, v2) ); - + v1 *= 255; v2 *= 255; - + if (invert_table) { v1 = 255 - v1; v2 = 255 - v2; @@ -5260,7 +5260,7 @@ send_gamma (Avision_Scanner* s) if (v2 <= 0) v2 = 0; } - + for (k = 0; k < gamma_values; ++ k, ++ i) { gamma_data [i] = (uint8_t) (((v1 * (gamma_values - k)) + (v2 * k) ) / (double) gamma_values); @@ -5275,12 +5275,12 @@ send_gamma (Avision_Scanner* s) gamma_data [i] = gamma_data [t_i]; } } - + DBG (4, "send_gamma: sending %lu bytes gamma table.\n", (u_long) gamma_table_raw_size); status = avision_cmd (&s->av_con, &scmd, sizeof (scmd), gamma_data, gamma_table_raw_size, 0, 0); - + if (status != SANE_STATUS_GOOD) { DBG (1, "send_gamma: gamma table upload failed: %s\n", sane_strstatus (status)); @@ -5294,33 +5294,33 @@ static SANE_Status send_3x3_matrix (Avision_Scanner* s) { SANE_Status status; - + #define SIGN_BIT 0x1000 #define INT_PART 10 - + struct matrix_cmd { struct command_send scmd; struct matrix_3x3 matrix; } cmd; - - /* 04 00 00 00 00 00 + + /* 04 00 00 00 00 00 00 00 04 00 00 00 00 00 00 00 04 00 */ - + int i, a_i; static const double c5_matrix[] = { 1.000, 0.000, 0.000, 0.000, 1.000, 0.000, 0.000, 0.000, 1.000 }; - + double a_f, b_f; uint16_t m; - + DBG (3, "send_3x3_matrix:\n"); - + memset (&cmd, 0, sizeof (cmd)); - + for (i = 0; i < 9; i++) { m = 0; @@ -5329,18 +5329,18 @@ send_3x3_matrix (Avision_Scanner* s) m |= SIGN_BIT; a_f = -a_f; } - + a_i = (int) a_f; /* integer */ b_f = a_f - (double) a_i; /* float */ m |= ((a_i & 0x3) << INT_PART); m |= (uint16_t) (b_f * 1024); set_double (((uint8_t*)(&cmd.matrix.v[i])), m); } - + cmd.scmd.opc = AVISION_SCSI_SEND; cmd.scmd.datatypecode = 0x83; /* 0x83 for 3x3 color matrix */ set_triple (cmd.scmd.transferlen, sizeof (struct matrix_3x3)); - + if (1) { DBG (3, "send_3x3_matrix: sending matrix split into two commands\n"); status = avision_cmd (&s->av_con, &cmd.scmd, sizeof (cmd.scmd), @@ -5350,7 +5350,7 @@ send_3x3_matrix (Avision_Scanner* s) DBG (3, "send_3x3_matrix: sending matrix in one command\n"); status = avision_cmd (&s->av_con, &cmd, sizeof (cmd), 0, 0, 0, 0); } - + return status; } @@ -5358,21 +5358,21 @@ static SANE_Status get_acceleration_info (Avision_Scanner* s, struct acceleration_info* info) { SANE_Status status; - + struct command_read rcmd; uint8_t result [24]; size_t size; - + DBG (3, "get_acceleration_info:\n"); size = sizeof (result); - + memset (&rcmd, 0, sizeof (rcmd)); rcmd.opc = AVISION_SCSI_READ; rcmd.datatypecode = 0x6c; /* get acceleration information */ set_double (rcmd.datatypequal, s->hw->data_dq); set_triple (rcmd.transferlen, size); - + DBG (3, "get_acceleration_info: read_data: %lu bytes\n", (u_long) size); status = avision_cmd (&s->av_con, &rcmd, sizeof (rcmd), 0, 0, result, &size); if (status != SANE_STATUS_GOOD || size != sizeof (result) ) { @@ -5380,9 +5380,9 @@ get_acceleration_info (Avision_Scanner* s, struct acceleration_info* info) sane_strstatus (status) ); return status; } - + debug_print_accel_info (3, "get_acceleration_info", result); - + info->total_steps = get_double (&(result[0])); info->stable_steps = get_double (&(result[2])); info->table_units = get_quad (&(result[4])); @@ -5391,7 +5391,7 @@ get_acceleration_info (Avision_Scanner* s, struct acceleration_info* info) info->target_speed = get_double (&(result[14])); info->ability = result[16]; info->table_count = result[17]; - + return SANE_STATUS_GOOD; } @@ -5399,45 +5399,45 @@ static SANE_Status send_acceleration_table (Avision_Scanner* s) { SANE_Status status; - + struct command_send scmd; int table = 0; int i; struct acceleration_info accel_info = accel_info; uint8_t* table_data; - + DBG (3, "send_acceleration_table:\n"); do { status = get_acceleration_info (s, &accel_info); - + if (accel_info.table_count == 0) { DBG (3, "send_acceleration_table: device does not need tables\n"); return SANE_STATUS_GOOD; } - + if (accel_info.target_speed > accel_info.start_speed || accel_info.target_speed == 0 || accel_info.total_steps <= accel_info.stable_steps) { DBG (1, "send_acceleration_table: table does not look right.\n"); return SANE_STATUS_INVAL; } - + if (accel_info.ability != 0) { DBG (1, "send_acceleration_table: ability non-zero - insert code\n"); return SANE_STATUS_INVAL; } - + /* so far I assume we have one byte tables as used in the C6 ASIC ... */ table_data = malloc (accel_info.total_steps + 1000); - + memset (&scmd, 0x00, sizeof (scmd)); scmd.opc = AVISION_SCSI_SEND; scmd.datatypecode = 0x6c; /* send acceleration table */ - + set_double (scmd.datatypequal, table); set_triple (scmd.transferlen, accel_info.total_steps); - + /* construct the table - Warning: This code is derived from Avision sample code and is a bit scary! I have no idea why the scanner needs such a dumb table and also do not know /why/ it has to be @@ -5447,16 +5447,16 @@ send_acceleration_table (Avision_Scanner* s) float up_lim = 1.0; uint16_t accel_steps = accel_info.total_steps - accel_info.stable_steps + 1; - + /* acceleration ramp */ while ((up_lim - low_lim) > 0.0001) { float mid = (up_lim + low_lim) / 2; /* accel rate */ - + uint16_t now_count = accel_info.start_speed; - + uint16_t i = 0; - + float now_count_f = now_count; table_data [i++] = (uint8_t) accel_info.start_speed; @@ -5467,8 +5467,8 @@ send_acceleration_table (Avision_Scanner* s) now_count = (uint16_t)(now_count_f + 0.5); table_data[i++] = (uint8_t) now_count; } - - + + if (i == accel_steps) break; if (i > accel_steps) @@ -5476,23 +5476,23 @@ send_acceleration_table (Avision_Scanner* s) else up_lim = mid; } - + /* fill stable steps */ for (i = accel_steps; i < accel_info.total_steps; i++) table_data [i] = table_data [i-1]; - + debug_print_hex_raw (5, "send_acceleration_table: first pass:\n", table_data, accel_info.total_steps); - + /* maybe post fix-up */ { int add_count; - + /* count total steps in table */ int table_total = 0; for (i = 0; i < accel_info.total_steps; i++) table_total += table_data [i]; - + i = 0; if (((table_total * accel_info.table_units) % accel_info.base_units) == 0) add_count = 0; @@ -5500,7 +5500,7 @@ send_acceleration_table (Avision_Scanner* s) add_count = (accel_info.base_units - ((table_total*accel_info.table_units) % accel_info.base_units)) / accel_info.table_units; - + /* add_count should not be bigger than 255 */ if (add_count > 255) { DBG (1, "send_acceleration_table: add_count limited, was: %d\n", add_count); @@ -5510,26 +5510,26 @@ send_acceleration_table (Avision_Scanner* s) { uint16_t temp_count = 255 - table_data [i]; temp_count = temp_count > add_count ? add_count : temp_count; - + table_data [i] += (uint8_t) temp_count; add_count -= temp_count; } } } - + debug_print_hex_raw (5, "send_acceleration_table: fixed up:\n", table_data, accel_info.total_steps); - + /* decrease all by one ... */ for (i = 0; i < accel_info.total_steps; i++) { table_data[i]--; } - + DBG (1, "send_acceleration_table: sending table %d\n", table); - + debug_print_hex_raw (5, "send_acceleration_table: final:\n", table_data, accel_info.total_steps); - + status = avision_cmd (&s->av_con, &scmd, sizeof (scmd), (char*) table_data, accel_info.total_steps, 0, 0); @@ -5537,13 +5537,13 @@ send_acceleration_table (Avision_Scanner* s) DBG (3, "send_acceleration_table: send_data failed (%s)\n", sane_strstatus (status)); } - + free (table_data); table_data = 0; - + table++; } while (table < accel_info.table_count); - - + + return status; } @@ -5555,17 +5555,17 @@ set_window (Avision_Scanner* s) int base_dpi_abs, base_dpi_rel; int transferlen; int paralen; - + int bytes_per_line; int line_count; - + struct { struct command_set_window cmd; struct command_set_window_window window; } cmd; - + DBG (1, "set_window:\n"); - + /* plain old scanners, the C3 ASIC HP 53xx and the C6 ASIC HP 74xx and up do use 1200 as base - only the C5 differs */ switch (dev->inquiry_asic_type) { @@ -5582,64 +5582,64 @@ set_window (Avision_Scanner* s) base_dpi_abs = 1200; base_dpi_rel = 1200; } - + DBG (2, "set_window: base_dpi_abs: %d, base_dpi_rel: %d\n", base_dpi_abs, base_dpi_rel); - + /* wipe out anything */ memset (&cmd, 0, sizeof (cmd) ); cmd.window.descriptor.winid = AV_WINID; /* normally defined to be zero */ - + /* optional parameter length to use */ paralen = sizeof (cmd.window.avision) - sizeof (cmd.window.avision.type); - + DBG (2, "set_window: base paralen: %d\n", paralen); - + if (dev->hw->feature_type & AV_FUJITSU) paralen += sizeof (cmd.window.avision.type.fujitsu); else if (!dev->inquiry_new_protocol) paralen += sizeof (cmd.window.avision.type.old); else paralen += sizeof (cmd.window.avision.type.normal); - + DBG (2, "set_window: final paralen: %d\n", paralen); - + transferlen = sizeof (cmd.window) - sizeof (cmd.window.avision) + paralen; - + DBG (2, "set_window: transferlen: %d\n", transferlen); - + /* command setup */ cmd.cmd.opc = AVISION_SCSI_SET_WINDOW; set_triple (cmd.cmd.transferlen, transferlen); set_double (cmd.window.header.desclen, sizeof (cmd.window.descriptor) + paralen); - + /* resolution parameters */ set_double (cmd.window.descriptor.xres, s->avdimen.hw_xres); set_double (cmd.window.descriptor.yres, s->avdimen.hw_yres); - + /* upper left corner x/y as well as width/length in inch * base_dpi - avdimen are world pixels */ set_quad (cmd.window.descriptor.ulx, s->avdimen.tlx * base_dpi_abs / s->avdimen.hw_xres); set_quad (cmd.window.descriptor.uly, s->avdimen.tly * base_dpi_abs / s->avdimen.hw_yres); - + set_quad (cmd.window.descriptor.width, s->avdimen.hw_pixels_per_line * base_dpi_rel / s->avdimen.hw_xres + 1); line_count = s->avdimen.hw_lines + 2 * s->avdimen.line_difference + s->avdimen.rear_offset; set_quad (cmd.window.descriptor.length, line_count * base_dpi_rel / s->avdimen.hw_yres + 1); - + /* interlaced duplex scans are twice as long */ if (s->avdimen.interlaced_duplex && dev->scanner_type != AV_FILM) { DBG (2, "set_window: interlaced duplex scan, doubled line count\n"); line_count *= 2; } - + bytes_per_line = s->avdimen.hw_bytes_per_line; - + set_double (cmd.window.avision.line_width, bytes_per_line); set_double (cmd.window.avision.line_count, line_count); - + /* here go the most significant bits if bigger than 16 bit */ if (dev->inquiry_new_protocol && !(dev->hw->feature_type & AV_FUJITSU) ) { DBG (2, "set_window: large data-transfer support (>16bit)!\n"); @@ -5648,16 +5648,16 @@ set_window (Avision_Scanner* s) cmd.window.avision.type.normal.line_count_msb = line_count >> 16; } - + if (dev->inquiry_background_raster) cmd.window.avision.type.normal.background_lines = s->val[OPT_BACKGROUND].w; - + /* scanner should use our line-width and count */ - SET_BIT (cmd.window.avision.bitset1, 6); - + SET_BIT (cmd.window.avision.bitset1, 6); + /* set speed */ cmd.window.avision.bitset1 |= s->val[OPT_SPEED].w & 0x07; /* only 3 bit */ - + /* ADF scan? */ DBG (3, "set_window: source mode %d source mode dim %d\n", s->source_mode, s->source_mode_dim); @@ -5687,43 +5687,43 @@ set_window (Avision_Scanner* s) SET_BIT(cmd.window.avision.type.normal.bitset3, 2); /* MIRR 0x04 */ } } - + if (s->val[OPT_PAPERLEN].w != SANE_FALSE) { set_double (cmd.window.descriptor.paper_length, (int)((double)30.0*1200)); } if ( !(dev->hw->feature_type & AV_FUJITSU) ) - { + { /* quality scan option switch */ if (s->val[OPT_QSCAN].w == SANE_TRUE) { SET_BIT (cmd.window.avision.type.normal.bitset2, 4); } - + /* quality calibration option switch (inverted! if set == speed) */ if (s->val[OPT_QCALIB].w == SANE_FALSE) { SET_BIT (cmd.window.avision.type.normal.bitset2, 3); } - + /* transparency option switch */ if (s->source_mode_dim == AV_TRANSPARENT_DIM) { SET_BIT (cmd.window.avision.type.normal.bitset2, 7); } - + if (dev->scanner_type == AV_FILM) { /* TODO: wire to IR exposure option? */ cmd.window.avision.type.normal.ir_exposure_time = 100; set_double (cmd.window.avision.type.normal.r_exposure_time, s->val[OPT_EXPOSURE].w); set_double (cmd.window.avision.type.normal.g_exposure_time, s->val[OPT_EXPOSURE].w); set_double (cmd.window.avision.type.normal.b_exposure_time, s->val[OPT_EXPOSURE].w); - + if (s->val[OPT_IR].w) cmd.window.avision.type.normal.bitset3 |= (1 << 0); - + if (s->val[OPT_MULTISAMPLE].w) cmd.window.avision.type.normal.bitset3 |= (1 << 1); } } - + /* fixed values */ cmd.window.descriptor.padding_and_bitset = 3; cmd.window.descriptor.vendor_specific = 0xFF; @@ -5732,7 +5732,7 @@ set_window (Avision_Scanner* s) /* This is normally unsupported by Avision scanners, and we do this via the gamma table - which works for all devices ... */ cmd.window.descriptor.threshold = 128; - cmd.window.descriptor.brightness = 128; + cmd.window.descriptor.brightness = 128; cmd.window.descriptor.contrast = 128; cmd.window.avision.highlight = 0xFF; cmd.window.avision.shadow = 0x00; @@ -5744,17 +5744,17 @@ set_window (Avision_Scanner* s) cmd.window.descriptor.bpc = 1; cmd.window.descriptor.image_comp = 0; break; - + case AV_DITHERED: cmd.window.descriptor.bpc = 1; cmd.window.descriptor.image_comp = 1; break; - + case AV_GRAYSCALE: cmd.window.descriptor.bpc = 8; cmd.window.descriptor.image_comp = 2; break; - + case AV_GRAYSCALE12: cmd.window.descriptor.bpc = 12; cmd.window.descriptor.image_comp = 2; @@ -5764,7 +5764,7 @@ set_window (Avision_Scanner* s) cmd.window.descriptor.bpc = 16; cmd.window.descriptor.image_comp = 2; break; - + case AV_TRUECOLOR: cmd.window.descriptor.bpc = 8; cmd.window.descriptor.image_comp = 5; @@ -5779,7 +5779,7 @@ set_window (Avision_Scanner* s) cmd.window.descriptor.bpc = 16; cmd.window.descriptor.image_comp = 5; break; - + default: DBG (1, "Invalid mode. %d\n", s->c_mode); return SANE_STATUS_INVAL; @@ -5796,13 +5796,13 @@ set_window (Avision_Scanner* s) else cmd.window.avision.bitset1 |= AVISION_FILTER_NONE; } - + debug_print_window_descriptor (5, "set_window", &(cmd.window)); - + DBG (3, "set_window: sending command. Bytes: %d\n", transferlen); status = avision_cmd (&s->av_con, &cmd, sizeof (cmd.cmd), &(cmd.window), transferlen, 0, 0); - + return status; } @@ -5813,13 +5813,13 @@ get_background_raster (Avision_Scanner* s) Avision_Device* dev = s->hw; SANE_Status status; - + struct command_read rcmd; size_t size; int bytes_per_line, i; const int bpp = color_mode_is_color (s->c_mode) ? 3 : 1; const int lines = s->val[OPT_BACKGROUND].w * (s->avdimen.interlaced_duplex ? 2 : 1); - + uint8_t* background = NULL; DBG (1, "get_background_raster:\n"); @@ -5828,20 +5828,20 @@ get_background_raster (Avision_Scanner* s) DBG (1, "get_background_raster: no background requested\n"); return SANE_STATUS_GOOD; } - + /* full width, always :-(, duplex *2 for front and rear */ bytes_per_line = dev->inquiry_background_raster_pixel * s->avdimen.hw_xres / dev->inquiry_optical_res; bytes_per_line *= bpp; - + DBG (3, "get_background_raster: native raster pixels: %d, raster bytes_per_line: %d\n", dev->inquiry_background_raster_pixel, bytes_per_line); - + /* according to spec only 8-bit gray or color, TODO: test for bi-level scans */ size = bytes_per_line * lines; DBG (3, "get_background_raster: buffer size: %ld\n", (long)size); - + background = s->background_raster = realloc (s->background_raster, size); if (!background) return SANE_STATUS_NO_MEM; @@ -5850,13 +5850,13 @@ get_background_raster (Avision_Scanner* s) rcmd.opc = AVISION_SCSI_READ; rcmd.datatypecode = 0x9b; /* get background raster */ set_double (rcmd.datatypequal, s->hw->data_dq); - + /* Ok, well - this part is very messy. The AV122 and DM152 appear to contain differently buggy ASICs. The only combination I found to at least get a correct front raster out of them is to read it line by line and then every second line appears to be valid front data, ... */ - + /* read the raster data */ for (i = 0; i < lines;) { @@ -5864,7 +5864,7 @@ get_background_raster (Avision_Scanner* s) /* read stripe by stripe, or all in one chunk */ size_t this_read, read_size; int this_lines; - + if (dev->hw->feature_type & AV_2ND_LINE_INTERLACED) { if (dev->hw->feature_type & AV_BACKGROUND_QUIRK) this_lines = 1; @@ -5875,12 +5875,12 @@ get_background_raster (Avision_Scanner* s) this_lines = s->val[OPT_BACKGROUND].w; } this_read = bytes_per_line * this_lines; - + DBG (3, "get_background_raster: line: %d, lines: %d, %lu bytes\n", i, this_lines, (u_long) this_read); set_triple (rcmd.transferlen, this_read); - + read_size = this_read; status = avision_cmd (&s->av_con, &rcmd, sizeof (rcmd), 0, 0, dst_raster, &read_size); if (status != SANE_STATUS_GOOD || read_size != this_read) { @@ -5888,29 +5888,29 @@ get_background_raster (Avision_Scanner* s) sane_strstatus (status) ); return status; } - + i += this_lines; } - + /* dump raw result while debugging */ if (debug) { FILE* f = NULL; f = fopen ("background-raw.pnm", "w"); - + write_pnm_header (f, (color_mode_is_color (s->c_mode) ? AV_TRUECOLOR : AV_GRAYSCALE), 8, bytes_per_line / bpp, lines); - + fwrite (background, 1, bytes_per_line * lines, f); fclose (f); } /* line-pack - move to unified processing flow, later */ if (dev->inquiry_needs_line_pack) - { + { /* TODO: add 16bit per sample code? */ int l, p; - + uint8_t* tmp_data = malloc (bytes_per_line); for (l = 0; l < lines; ++l) { @@ -5918,47 +5918,47 @@ get_background_raster (Avision_Scanner* s) uint8_t* r_ptr = background + (bytes_per_line * l); uint8_t* g_ptr = r_ptr + bytes_per_line / bpp; uint8_t* b_ptr = g_ptr + bytes_per_line / bpp; - + for (p = 0; p < bytes_per_line;) { out_data [p++] = *(r_ptr++); out_data [p++] = *(g_ptr++); out_data [p++] = *(b_ptr++); } - + memcpy (background + (bytes_per_line * l), tmp_data, bytes_per_line); } - + free (tmp_data); } /* end line pack */ - + /* deinterlace? */ if (s->avdimen.interlaced_duplex && dev->hw->feature_type & AV_2ND_LINE_INTERLACED) { uint8_t* deinterlaced = malloc (size * 2); if (!deinterlaced) return SANE_STATUS_NO_MEM; - + for (i = 0; i < lines; ++i) { int dst_i = i / 2 + (i % 2) * (lines / 2); uint8_t* dst_raster; /* just no C99 in SANE :-( */ uint8_t* src_raster; - + /* for the quirky devices and some resolutions the interlacing differs */ if (dev->hw->feature_type & AV_BACKGROUND_QUIRK && s->avdimen.hw_xres >= 150) dst_i = i / 2 + ((i+1) % 2) * (lines / 2); - + dst_raster = deinterlaced + bytes_per_line * dst_i; src_raster = background + bytes_per_line * i; - + DBG(3, "get_background_raster: deinterlaced %d -> %d\n", i, dst_i); memcpy(dst_raster, src_raster, bytes_per_line); } - + free (background); background = s->background_raster = deinterlaced; } - + /* dump raw result while debugging */ for (i = 0; debug && i < (s->avdimen.interlaced_duplex ? 2 : 1); ++i) { @@ -5971,14 +5971,14 @@ get_background_raster (Avision_Scanner* s) f = fopen ("background-rear.pnm", "w"); raster += bytes_per_line * s->val[OPT_BACKGROUND].w; } - + write_pnm_header (f, (color_mode_is_color (s->c_mode) ? AV_TRUECOLOR : AV_GRAYSCALE), 8, bytes_per_line / bpp, s->val[OPT_BACKGROUND].w); - + fwrite (raster, 1, bytes_per_line * s->val[OPT_BACKGROUND].w, f); fclose (f); } - + /* crop from full-width scanlines to scan window */ { uint8_t *dst_ptr, *src_ptr; @@ -5991,19 +5991,19 @@ get_background_raster (Avision_Scanner* s) src_ptr += bytes_per_line; } } - + /* soft-scale - move to unified processing flow, later */ if (s->avdimen.hw_xres != s->avdimen.xres) { const uint8_t* out_data = background; uint8_t* dst = background; - + int l; for (l = 0; l < lines; ++l) { const int hwbpl = s->avdimen.hw_bytes_per_line; const int sy = l; - + int x; for (x = 0; x < s->params.pixels_per_line; ++x) { @@ -6011,24 +6011,24 @@ get_background_raster (Avision_Scanner* s) const int sx = (int)floor(bx); const int xdist = (int) ((bx - sx) * 256); const int sxx = sx + 1; - + switch (bpp) { case 1: { - uint8_t v = + uint8_t v = ( out_data [sy*hwbpl + sx ] * (256-xdist) + out_data [sy*hwbpl + sxx] * xdist ) / (256); *dst++ = v; } break; - + case 3: { int c; for (c = 0; c < 3; ++c) { - uint8_t v = + uint8_t v = ( out_data [sy*hwbpl + sx*3 + c] * (256-xdist) + out_data [sy*hwbpl + sxx*3 + c] * xdist ) / (256); @@ -6040,7 +6040,7 @@ get_background_raster (Avision_Scanner* s) } } } - + /* dump final result while debugging */ if (debug) { for (i = 0; i < (s->avdimen.interlaced_duplex ? 2 : 1); ++i) @@ -6054,15 +6054,15 @@ get_background_raster (Avision_Scanner* s) f = fopen ("background-final-rear.pnm", "w"); raster += s->params.bytes_per_line * s->val[OPT_BACKGROUND].w; } - + write_pnm_header (f, (color_mode_is_color (s->c_mode) ? AV_TRUECOLOR : AV_GRAYSCALE), 8, s->params.bytes_per_line / bpp, s->val[OPT_BACKGROUND].w); - + fwrite (raster, 1, s->params.bytes_per_line * s->val[OPT_BACKGROUND].w, f); fclose (f); } } - + return SANE_STATUS_GOOD; } @@ -6072,9 +6072,9 @@ reserve_unit (Avision_Scanner* s) char cmd[] = {AVISION_SCSI_RESERVE_UNIT, 0, 0, 0, 0, 0}; SANE_Status status; - + DBG (1, "reserve_unit:\n"); - + status = avision_cmd (&s->av_con, cmd, sizeof (cmd), 0, 0, 0, 0); return status; } @@ -6085,7 +6085,7 @@ release_unit (Avision_Scanner* s, int type) char cmd[] = {AVISION_SCSI_RELEASE_UNIT, 0, 0, 0, 0, 0}; SANE_Status status; - + DBG (1, "release unit: type: %d\n", type); cmd[5] = type; /* latest scanners also allow 1: release paper and 2: end job */ status = avision_cmd (&s->av_con, cmd, sizeof (cmd), 0, 0, 0, 0); @@ -6100,17 +6100,17 @@ media_check (Avision_Scanner* s) SANE_Status status; uint8_t result[1]; /* 4 */ size_t size = sizeof(result); - + status = avision_cmd (&s->av_con, cmd, sizeof (cmd), 0, 0, result, &size); - + debug_print_raw (5, "media_check: result\n", result, size); - + if (status == SANE_STATUS_GOOD) { if (!(result[0] & 0x1)) status = SANE_STATUS_NO_DOCS; } - + return status; } @@ -6120,7 +6120,7 @@ flush_media (Avision_Scanner* s) { Avision_Device* dev = s->hw; SANE_Status status; - + if (s->source_mode_dim == AV_ADF_DIM && dev->inquiry_batch_scan) { DBG (1, "flush_media: flushing pages out of batch scanner\n"); @@ -6133,7 +6133,7 @@ flush_media (Avision_Scanner* s) DBG (1, "flush_media: release status: %d\n", status2); } } while (status == SANE_STATUS_GOOD); - } + } return SANE_STATUS_GOOD; } #endif /* 0 - unused */ @@ -6142,15 +6142,15 @@ static SANE_Status object_position (Avision_Scanner* s, uint8_t position) { SANE_Status status; - + uint8_t cmd [10]; - + memset (cmd, 0, sizeof (cmd)); cmd[0] = AVISION_SCSI_OBJECT_POSITION; cmd[1] = position; - + DBG (1, "object_position: %d\n", position); - + status = avision_cmd (&s->av_con, cmd, sizeof(cmd), 0, 0, 0, 0); return status; } @@ -6159,11 +6159,11 @@ static SANE_Status start_scan (Avision_Scanner* s) { struct command_scan cmd; - + size_t size = sizeof (cmd); - + DBG (3, "start_scan:\n"); - + memset (&cmd, 0, sizeof (cmd)); cmd.opc = AVISION_SCSI_SCAN; cmd.transferlen = 1; @@ -6176,7 +6176,7 @@ start_scan (Avision_Scanner* s) if (s->val[OPT_QSCAN].w == SANE_TRUE) { SET_BIT(cmd.bitset1,7); } - + DBG (3, "start_scan: sending command. Bytes: %lu\n", (u_long) size); return avision_cmd (&s->av_con, &cmd, size, 0, 0, 0, 0); } @@ -6185,12 +6185,12 @@ static SANE_Status do_eof (Avision_Scanner *s) { int exit_status; - + DBG (3, "do_eof:\n"); /* we do not scan anymore */ s->prepared = s->scanning = SANE_FALSE; - + /* we can now mark the rear data as valid */ if (s->avdimen.interlaced_duplex || (s->hw->hw->feature_type & AV_ADF_FLIPPING_DUPLEX && s->source_mode == AV_ADF_DUPLEX)) { @@ -6199,12 +6199,12 @@ do_eof (Avision_Scanner *s) DBG (3, "do_eof: duplex rear data valid: %x\n", s->duplex_rear_valid); } - + if (s->read_fds >= 0) { close (s->read_fds); s->read_fds = -1; } - + /* join our processes - without a wait() you will produce zombies (defunct children) */ sanei_thread_waitpid (s->reader_pid, &exit_status); @@ -6218,15 +6218,15 @@ static SANE_Status do_cancel (Avision_Scanner* s) { DBG (3, "do_cancel:\n"); - + s->prepared = s->scanning = SANE_FALSE; s->duplex_rear_valid = SANE_FALSE; s->page = 0; s->cancelled = 1; - + if (sanei_thread_is_valid (s->reader_pid)) { int exit_status; - + /* ensure child knows it's time to stop: */ sanei_thread_kill (s->reader_pid); sanei_thread_waitpid (s->reader_pid, &exit_status); @@ -6243,16 +6243,16 @@ read_data (Avision_Scanner* s, SANE_Byte* buf, size_t* count) SANE_Status status; DBG (9, "read_data: %lu\n", (u_long) *count); - + memset (&rcmd, 0, sizeof (rcmd)); - + rcmd.opc = AVISION_SCSI_READ; rcmd.datatypecode = 0x00; /* read image data */ set_double (rcmd.datatypequal, s->hw->data_dq); set_triple (rcmd.transferlen, *count); - + status = avision_cmd (&s->av_con, &rcmd, sizeof (rcmd), 0, 0, buf, count); - + return status; } @@ -6261,9 +6261,9 @@ init_options (Avision_Scanner* s) { Avision_Device* dev = s->hw; int i; - + DBG (3, "init_options:\n"); - + memset (s->opt, 0, sizeof (s->opt)); memset (s->val, 0, sizeof (s->val)); @@ -6271,9 +6271,9 @@ init_options (Avision_Scanner* s) s->opt[i].size = sizeof (SANE_Word); s->opt[i].cap = SANE_CAP_SOFT_SELECT | SANE_CAP_SOFT_DETECT; } - + /* Init the SANE option from the scanner inquiry data */ - + switch (dev->inquiry_asic_type) { case AV_ASIC_C2: dev->dpi_range.min = 100; @@ -6294,11 +6294,11 @@ init_options (Avision_Scanner* s) dev->dpi_range.quant = 1; /* any, including 72, 144, etc. */ dev->dpi_range.max = dev->inquiry_max_res; - + dev->speed_range.min = (SANE_Int)0; dev->speed_range.max = (SANE_Int)4; dev->speed_range.quant = (SANE_Int)1; - + s->opt[OPT_NUM_OPTS].name = ""; s->opt[OPT_NUM_OPTS].title = SANE_TITLE_NUM_OPTIONS; s->opt[OPT_NUM_OPTS].desc = ""; @@ -6306,7 +6306,7 @@ init_options (Avision_Scanner* s) s->opt[OPT_NUM_OPTS].type = SANE_TYPE_INT; s->opt[OPT_NUM_OPTS].size = sizeof(SANE_TYPE_INT); s->val[OPT_NUM_OPTS].w = NUM_OPTIONS; - + /* "Mode" group: */ s->opt[OPT_MODE_GROUP].title = SANE_TITLE_SCAN_MODE; s->opt[OPT_MODE_GROUP].desc = ""; /* for groups only title and type are valid */ @@ -6314,7 +6314,7 @@ init_options (Avision_Scanner* s) s->opt[OPT_MODE_GROUP].cap = 0; s->opt[OPT_MODE_GROUP].size = 0; s->opt[OPT_MODE_GROUP].constraint_type = SANE_CONSTRAINT_NONE; - + /* color mode */ s->opt[OPT_MODE].name = SANE_NAME_SCAN_MODE; s->opt[OPT_MODE].title = SANE_TITLE_SCAN_MODE; @@ -6325,7 +6325,7 @@ init_options (Avision_Scanner* s) s->opt[OPT_MODE].constraint.string_list = dev->color_list; s->val[OPT_MODE].s = strdup (dev->color_list[dev->color_list_default]); s->c_mode = match_color_mode (dev, s->val[OPT_MODE].s); - + /* source mode */ s->opt[OPT_SOURCE].name = SANE_NAME_SCAN_SOURCE; s->opt[OPT_SOURCE].title = SANE_TITLE_SCAN_SOURCE; @@ -6366,7 +6366,7 @@ init_options (Avision_Scanner* s) s->opt[OPT_SPEED].desc = SANE_DESC_SCAN_SPEED; s->opt[OPT_SPEED].type = SANE_TYPE_INT; s->opt[OPT_SPEED].constraint_type = SANE_CONSTRAINT_RANGE; - s->opt[OPT_SPEED].constraint.range = &dev->speed_range; + s->opt[OPT_SPEED].constraint.range = &dev->speed_range; s->val[OPT_SPEED].w = 0; if (dev->scanner_type == AV_SHEETFEED) s->opt[OPT_SPEED].cap |= SANE_CAP_INACTIVE; @@ -6418,7 +6418,7 @@ init_options (Avision_Scanner* s) s->opt[OPT_BR_Y].constraint_type = SANE_CONSTRAINT_RANGE; s->opt[OPT_BR_Y].constraint.range = &dev->y_range; s->val[OPT_BR_Y].w = dev->y_range.max; - + /* overscan top */ s->opt[OPT_OVERSCAN_TOP].name = "overscan-top"; s->opt[OPT_OVERSCAN_TOP].title = "Overscan top"; @@ -6428,7 +6428,7 @@ init_options (Avision_Scanner* s) s->opt[OPT_OVERSCAN_TOP].constraint_type = SANE_CONSTRAINT_RANGE; s->opt[OPT_OVERSCAN_TOP].constraint.range = &overscan_range; s->val[OPT_OVERSCAN_TOP].w = SANE_FIX(0); - + /* overscan bottom */ s->opt[OPT_OVERSCAN_BOTTOM].name = "overscan-bottom"; s->opt[OPT_OVERSCAN_BOTTOM].title = "Overscan bottom"; @@ -6438,12 +6438,12 @@ init_options (Avision_Scanner* s) s->opt[OPT_OVERSCAN_BOTTOM].constraint_type = SANE_CONSTRAINT_RANGE; s->opt[OPT_OVERSCAN_BOTTOM].constraint.range = &overscan_range; s->val[OPT_OVERSCAN_BOTTOM].w = SANE_FIX(0); - + if (!dev->inquiry_tune_scan_length) s->opt[OPT_OVERSCAN_TOP].cap |= SANE_CAP_INACTIVE; if (!dev->inquiry_tune_scan_length) s->opt[OPT_OVERSCAN_BOTTOM].cap |= SANE_CAP_INACTIVE; - + /* background raster */ s->opt[OPT_BACKGROUND].name = "background-lines"; s->opt[OPT_BACKGROUND].title = "Background raster lines"; @@ -6453,11 +6453,11 @@ init_options (Avision_Scanner* s) s->opt[OPT_BACKGROUND].constraint_type = SANE_CONSTRAINT_RANGE; s->opt[OPT_BACKGROUND].constraint.range = &background_range; s->val[OPT_BACKGROUND].w = 0; - + if (!dev->inquiry_background_raster) { s->opt[OPT_BACKGROUND].cap |= SANE_CAP_INACTIVE; } - + /* "Enhancement" group: */ s->opt[OPT_ENHANCEMENT_GROUP].title = "Enhancement"; s->opt[OPT_ENHANCEMENT_GROUP].desc = ""; /* for groups only title and type are valid */ @@ -6553,7 +6553,7 @@ init_options (Avision_Scanner* s) s->opt[OPT_GAMMA_VECTOR_B].constraint_type = SANE_CONSTRAINT_RANGE; s->opt[OPT_GAMMA_VECTOR_B].constraint.range = &u8_range; s->val[OPT_GAMMA_VECTOR_B].wa = &s->gamma_table[3][0]; - + if (!disable_gamma_table) { if (color_mode_is_color (s->c_mode)) { @@ -6565,7 +6565,7 @@ init_options (Avision_Scanner* s) s->opt[OPT_GAMMA_VECTOR].cap &= ~SANE_CAP_INACTIVE; } } - + /* exposure */ s->opt[OPT_EXPOSURE].name = "exposure"; s->opt[OPT_EXPOSURE].title = "Exposure"; @@ -6575,7 +6575,7 @@ init_options (Avision_Scanner* s) s->opt[OPT_EXPOSURE].constraint_type = SANE_CONSTRAINT_RANGE; s->opt[OPT_EXPOSURE].constraint.range = &exposure_range; s->val[OPT_EXPOSURE].w = 100; - + if (!dev->inquiry_exposure_control) { s->opt[OPT_EXPOSURE].cap |= SANE_CAP_INACTIVE; } @@ -6587,7 +6587,7 @@ init_options (Avision_Scanner* s) s->opt[OPT_MULTISAMPLE].type = SANE_TYPE_BOOL; s->opt[OPT_MULTISAMPLE].unit = SANE_UNIT_NONE; s->val[OPT_MULTISAMPLE].w = SANE_FALSE; - + /* TODO: No idea how to detect, assume exposure control devices are new enough to support this, for now. -ReneR */ if (!dev->inquiry_exposure_control) { @@ -6601,13 +6601,13 @@ init_options (Avision_Scanner* s) s->opt[OPT_IR].type = SANE_TYPE_BOOL; s->opt[OPT_IR].unit = SANE_UNIT_NONE; s->val[OPT_IR].w = SANE_FALSE; - + /* TODO: No idea how to detect, assume exposure control devices are new enough to support this, for now. -ReneR */ if (!dev->inquiry_exposure_control) { s->opt[OPT_IR].cap |= SANE_CAP_INACTIVE; } - + /* "MISC" group: */ s->opt[OPT_MISC_GROUP].title = SANE_TITLE_SCAN_MODE; s->opt[OPT_MISC_GROUP].desc = ""; /* for groups only title and type are valid */ @@ -6615,7 +6615,7 @@ init_options (Avision_Scanner* s) s->opt[OPT_MISC_GROUP].cap = 0; s->opt[OPT_MISC_GROUP].size = 0; s->opt[OPT_MISC_GROUP].constraint_type = SANE_CONSTRAINT_NONE; - + /* film holder control */ if (dev->scanner_type != AV_FILM) s->opt[OPT_FRAME].cap |= SANE_CAP_INACTIVE; @@ -6649,7 +6649,7 @@ init_options (Avision_Scanner* s) s->opt[OPT_MESSAGE].constraint_type = SANE_CONSTRAINT_NONE; s->val[OPT_MESSAGE].s = malloc(s->opt[OPT_MESSAGE].size); s->val[OPT_MESSAGE].s[0] = 0; - + /* NVRAM */ s->opt[OPT_NVRAM].cap = SANE_CAP_SOFT_DETECT | SANE_CAP_ADVANCED; if (!dev->inquiry_nvram_read) @@ -6663,7 +6663,7 @@ init_options (Avision_Scanner* s) s->opt[OPT_NVRAM].constraint_type = SANE_CONSTRAINT_NONE; s->val[OPT_NVRAM].s = malloc(s->opt[OPT_NVRAM].size); s->val[OPT_NVRAM].s[0] = 0; - + /* paper_length */ s->opt[OPT_PAPERLEN].cap = SANE_CAP_SOFT_SELECT | SANE_CAP_SOFT_DETECT | SANE_CAP_ADVANCED; if (!dev->inquiry_paper_length) @@ -6676,7 +6676,7 @@ init_options (Avision_Scanner* s) s->opt[OPT_PAPERLEN].size = sizeof(SANE_Word); s->opt[OPT_PAPERLEN].constraint_type = SANE_CONSTRAINT_NONE; s->val[OPT_PAPERLEN].w = SANE_FALSE; - + /* ADF page flipping */ s->opt[OPT_ADF_FLIP].cap = SANE_CAP_SOFT_SELECT | SANE_CAP_SOFT_DETECT | SANE_CAP_AUTOMATIC | SANE_CAP_ADVANCED; if (!(s->hw->hw->feature_type & AV_ADF_FLIPPING_DUPLEX && s->source_mode == AV_ADF_DUPLEX)) @@ -6711,24 +6711,24 @@ reader_process (void *data) int fd = s->write_fds; Avision_Device* dev = s->hw; - + SANE_Status status; SANE_Status exit_status = SANE_STATUS_GOOD; sigset_t sigterm_set; sigset_t ignore_set; struct SIGACTION act; - + FILE* fp; FILE* rear_fp = 0; /* used to store the deinterlaced rear data */ FILE* raw_fp = 0; /* used to write the RAW image data for debugging */ - + /* the complex params */ unsigned int lines_per_stripe; unsigned int lines_per_output; unsigned int max_bytes_per_read; - + SANE_Bool gray_mode; - + /* the simple params for the data reader */ int hw_line = 0; int line = 0; @@ -6736,17 +6736,17 @@ reader_process (void *data) unsigned int stripe_size; unsigned int stripe_fill; unsigned int out_size; - + size_t total_size; size_t processed_bytes; - + enum { NONE, /* do not de-interlace at all */ STRIPE, /* every 2nd stripe */ HALF, /* the 2nd half */ LINE /* every 2nd line */ } deinterlace = NONE; - + /* the fat strip we currently puzzle together to perform software-colorpack and more */ uint8_t* stripe_data; @@ -6755,44 +6755,44 @@ reader_process (void *data) /* interpolation output data, one line */ uint8_t* ip_history = 0; uint8_t* ip_data = 0; - + DBG (3, "reader_process:\n"); - + if (sanei_thread_is_forked()) close (s->read_fds); - + sigfillset (&ignore_set); sigdelset (&ignore_set, SIGTERM); #if defined (__APPLE__) && defined (__MACH__) sigdelset (&ignore_set, SIGUSR2); #endif sigprocmask (SIG_SETMASK, &ignore_set, 0); - + memset (&act, 0, sizeof (act)); sigaction (SIGTERM, &act, 0); - + sigemptyset (&sigterm_set); sigaddset (&sigterm_set, SIGTERM); - + gray_mode = color_mode_is_shaded (s->c_mode); if (s->avdimen.interlaced_duplex) { deinterlace = STRIPE; - + if ( (dev->hw->feature_type & AV_NON_INTERLACED_DUPLEX_300) && (s->avdimen.hw_xres <= 300 && s->avdimen.hw_yres <= 300) ) deinterlace = HALF; if (dev->hw->feature_type & AV_2ND_LINE_INTERLACED) deinterlace = LINE; - + if (dev->scanner_type == AV_FILM) deinterlace = LINE; } - + fp = fdopen (fd, "w"); if (!fp) return SANE_STATUS_NO_MEM; - + /* start scan ? */ if ((deinterlace == NONE && !((dev->hw->feature_type & AV_ADF_FLIPPING_DUPLEX) && s->source_mode == AV_ADF_DUPLEX && s->duplex_rear_valid)) || (deinterlace != NONE && !s->duplex_rear_valid)) @@ -6806,7 +6806,7 @@ reader_process (void *data) sane_strstatus (status)); return status; } - + if (dev->hw->feature_type & AV_NO_START_SCAN) { DBG (1, "reader_process: start_scan skipped due to device-list!\n"); } @@ -6818,7 +6818,7 @@ reader_process (void *data) return status; } } - + if (dev->hw->feature_type & AV_ACCEL_TABLE) /* (s->hw->inquiry_asic_type == AV_ASIC_C6) */ { status = send_acceleration_table (s); @@ -6829,7 +6829,7 @@ reader_process (void *data) } } } - + /* setup file i/o for deinterlacing scans or if we are the back page with a flipping duplexer */ if (deinterlace != NONE || (dev->hw->feature_type & AV_ADF_FLIPPING_DUPLEX && s->source_mode == AV_ADF_DUPLEX && !(s->page % 2))) @@ -6851,38 +6851,38 @@ reader_process (void *data) } } } - + /* it takes quite a few lines to saturate the (USB) bus */ lines_per_stripe = dev->read_stripe_size; if (s->avdimen.line_difference) lines_per_stripe += 2 * s->avdimen.line_difference; - + stripe_size = s->avdimen.hw_bytes_per_line * lines_per_stripe; lines_per_output = lines_per_stripe - 2 * s->avdimen.line_difference; - + if (s->av_con.connection_type == AV_SCSI) /* maybe better not /2 ... */ max_bytes_per_read = dev->scsi_buffer_size / 2; - else + else /* vast buffer size to saturate the bus */ max_bytes_per_read = 0x100000; - + out_size = s->avdimen.hw_bytes_per_line * lines_per_output; - + DBG (3, "dev->scsi_buffer_size / 2: %d\n", dev->scsi_buffer_size / 2); - + DBG (3, "bytes_per_line: %d, pixels_per_line: %d\n", s->avdimen.hw_bytes_per_line, s->avdimen.hw_pixels_per_line); - + DBG (3, "lines_per_stripe: %d, lines_per_output: %d\n", lines_per_stripe, lines_per_output); - + DBG (3, "max_bytes_per_read: %d, stripe_size: %d, out_size: %d\n", max_bytes_per_read, stripe_size, out_size); - + stripe_data = malloc (stripe_size); - + /* for software scaling we need an additional interpolation line buffer */ if (s->avdimen.hw_xres != s->avdimen.xres || s->avdimen.hw_yres != s->avdimen.yres) @@ -6890,13 +6890,13 @@ reader_process (void *data) /* layout out_data so that the interpolation history is exactly in front */ ip_history = malloc (s->avdimen.hw_bytes_per_line + out_size); out_data = ip_history + s->avdimen.hw_bytes_per_line; - + ip_data = malloc (s->params.bytes_per_line); } else { out_data = malloc (out_size); } - + /* calculate params for the reading loop */ total_size = s->avdimen.hw_bytes_per_line * (s->avdimen.hw_lines + 2 * s->avdimen.line_difference + @@ -6904,7 +6904,7 @@ reader_process (void *data) if (deinterlace != NONE && !s->duplex_rear_valid) total_size *= 2; DBG (3, "reader_process: total_size: %lu\n", (u_long) total_size); - + /* write a RAW PNM file for debugging -ReneR */ if (0 /* DEBUG */ && (deinterlace == NONE || (deinterlace != NONE && !s->duplex_rear_valid)) ) @@ -6913,36 +6913,36 @@ reader_process (void *data) write_pnm_header (fp, s->c_mode, s->params.depth, s->avdimen.hw_pixels_per_line, total_size / s->avdimen.hw_bytes_per_line); } - + processed_bytes = 0; stripe_fill = 0; - + /* First, dump background raster, bypassing all the other processing. */ if (dev->inquiry_background_raster && s->val[OPT_BACKGROUND].w) { uint8_t* background = s->background_raster; if (s->duplex_rear_valid) background += s->params.bytes_per_line * s->val[OPT_BACKGROUND].w; - + DBG (5, "reader_process: dumping background raster\n"); fwrite (background, s->params.bytes_per_line, s->val[OPT_BACKGROUND].w, fp); } - + /* Data read; loop until all data has been processed. Might exit before all lines are transferred for ADF paper end. */ while (exit_status == SANE_STATUS_GOOD && processed_bytes < total_size) { unsigned int useful_bytes; - + DBG (5, "reader_process: stripe filled: %d\n", stripe_fill); - + /* fill the stripe buffer with real data */ while (!s->duplex_rear_valid && processed_bytes < total_size && stripe_fill < stripe_size && exit_status == SANE_STATUS_GOOD) { size_t this_read = stripe_size - stripe_fill; - + /* Limit reads to max_bytes_per_read and global data boundaries. Rounded to the next lower multiple of byte_per_lines, otherwise some scanners freeze. */ @@ -6962,7 +6962,7 @@ reader_process (void *data) sigprocmask (SIG_BLOCK, &sigterm_set, 0); status = read_data (s, stripe_data + stripe_fill, &this_read); sigprocmask (SIG_UNBLOCK, &sigterm_set, 0); - + /* only EOF on the second stripe, as otherwise the rear page is shorter */ if (status == SANE_STATUS_EOF && deinterlace == STRIPE) { @@ -6977,59 +6977,59 @@ reader_process (void *data) } } } - + /* write RAW data to file for debugging */ if (raw_fp && this_read > 0) fwrite (stripe_data + stripe_fill, this_read, 1, raw_fp); - + if (status == SANE_STATUS_EOF || this_read == 0) { DBG (1, "reader_process: read_data failed due to EOF\n"); exit_status = SANE_STATUS_EOF; } - + if (status != SANE_STATUS_GOOD) { DBG (1, "reader_process: read_data failed with status: %d\n", status); exit_status = status; } - + stripe_fill += this_read; processed_bytes += this_read; } - + /* fill the stripe buffer with stored, virtual data */ if (s->duplex_rear_valid) { size_t this_read = stripe_size - stripe_fill; size_t got; - + /* limit reads to max_read and global data boundaries */ if (this_read > max_bytes_per_read) this_read = max_bytes_per_read; - + if (processed_bytes + this_read > total_size) this_read = total_size - processed_bytes; - + DBG (5, "reader_process: virtual processed_bytes: %lu, total_size: %lu\n", (u_long) processed_bytes, (u_long) total_size); DBG (5, "reader_process: virtual this_read: %lu\n", (u_long) this_read); - + got = fread (stripe_data + stripe_fill, 1, this_read, rear_fp); stripe_fill += got; processed_bytes += got; if (got != this_read) exit_status = SANE_STATUS_EOF; } - + DBG (5, "reader_process: stripe filled: %d\n", stripe_fill); - + useful_bytes = stripe_fill; if (color_mode_is_color (s->c_mode)) useful_bytes -= 2 * s->avdimen.line_difference * s->avdimen.hw_bytes_per_line; - + DBG (3, "reader_process: useful_bytes %i\n", useful_bytes); - + /* Deinterlace, save the rear stripes. For some scanners (AV220) that is every 2nd stripe, the 2nd half of the transferred data ((AV83xx), or every 2nd line (AV122)). */ @@ -7078,12 +7078,12 @@ reader_process (void *data) DBG (9, "reader_process: after page flip: useful_bytes: %d, stripe_fill: %d\n", useful_bytes, stripe_fill); } else { - + /* * Perform needed data conversions (packing, ...) and/or copy the * image data. */ - + if (s->c_mode != AV_TRUECOLOR && s->c_mode != AV_TRUECOLOR16) /* simple copy */ { @@ -7098,11 +7098,11 @@ reader_process (void *data) /* TODO: add 16bit per sample code? */ unsigned int i; int c_offset = s->avdimen.line_difference * s->avdimen.hw_bytes_per_line; - + uint8_t* r_ptr = stripe_data; uint8_t* g_ptr = stripe_data + c_offset + 1; uint8_t* b_ptr = stripe_data + 2 * c_offset + 2; - + for (i = 0; i < useful_bytes;) { out_data [i++] = *r_ptr; r_ptr += 3; out_data [i++] = *g_ptr; g_ptr += 3; @@ -7110,17 +7110,17 @@ reader_process (void *data) } } /* end color pack */ else if (dev->inquiry_needs_line_pack) /* line-pack */ - { + { /* TODO: add 16bit per sample code? */ int i = 0, l, p; const int lines = useful_bytes / s->avdimen.hw_bytes_per_line; - + for (l = 0; l < lines; ++l) { uint8_t* r_ptr = stripe_data + (s->avdimen.hw_bytes_per_line * l); uint8_t* g_ptr = r_ptr + s->avdimen.hw_pixels_per_line; uint8_t* b_ptr = g_ptr + s->avdimen.hw_pixels_per_line; - + for (p = 0; p < s->avdimen.hw_pixels_per_line; ++p) { out_data [i++] = *(r_ptr++); out_data [i++] = *(g_ptr++); @@ -7129,13 +7129,13 @@ reader_process (void *data) } } /* end line pack */ else /* else no packing was required -> simple copy */ - { + { memcpy (out_data, stripe_data, useful_bytes); } } /* end if AV_TRUECOLOR* */ - + /* FURTHER POST-PROCESSING ON THE FINAL OUTPUT DATA */ - + /* maybe mirroring in ADF mode */ if (s->source_mode_dim == AV_ADF_DIM && dev->inquiry_adf_need_mirror) { @@ -7152,7 +7152,7 @@ reader_process (void *data) { uint8_t* begin_ptr = out_data + (l * s->avdimen.hw_bytes_per_line); uint8_t* end_ptr = begin_ptr + s->avdimen.hw_bytes_per_line; - + while (begin_ptr < end_ptr) { uint8_t tmp; tmp = *begin_ptr; @@ -7164,7 +7164,7 @@ reader_process (void *data) else /* non trivial mirroring */ { /* Non-trivial Mirroring with element swapping */ - + int l; int lines = useful_bytes / s->avdimen.hw_bytes_per_line; @@ -7172,25 +7172,25 @@ reader_process (void *data) { uint8_t* begin_ptr = out_data + (l * s->avdimen.hw_bytes_per_line); uint8_t* end_ptr = begin_ptr + s->avdimen.hw_bytes_per_line - 3; - + while (begin_ptr < end_ptr) { uint8_t tmp; - + /* R */ tmp = *begin_ptr; *begin_ptr++ = *end_ptr; *end_ptr++ = tmp; - + /* G */ tmp = *begin_ptr; *begin_ptr++ = *end_ptr; *end_ptr++ = tmp; - + /* B */ tmp = *begin_ptr; *begin_ptr++ = *end_ptr; *end_ptr = tmp; - + end_ptr -= 5; } } @@ -7202,13 +7202,13 @@ reader_process (void *data) s->c_mode == AV_GRAYSCALE16 || s->c_mode == AV_TRUECOLOR12 || s->c_mode == AV_TRUECOLOR16) { - + int l; int lines = useful_bytes / s->avdimen.hw_bytes_per_line; uint8_t* dark_avg_data = s->dark_avg_data; uint8_t* white_avg_data = s->white_avg_data; - + uint8_t* begin_ptr = out_data; uint8_t* end_ptr = begin_ptr + s->avdimen.hw_bytes_per_line; uint8_t* line_ptr; @@ -7216,16 +7216,16 @@ reader_process (void *data) double scale = 1.0; if (s->c_mode == AV_GRAYSCALE12 || s->c_mode == AV_TRUECOLOR12) scale = (double) (1<<4); - + while (begin_ptr < end_ptr) { uint16_t dark_avg = 0; uint16_t white_avg = WHITE_MAP_RANGE; - + if (dark_avg_data) dark_avg = get_double_le (dark_avg_data); if (white_avg_data) white_avg = get_double_le (white_avg_data); - + line_ptr = begin_ptr; for (l = 0; l < lines; ++ l) { @@ -7233,16 +7233,16 @@ reader_process (void *data) uint16_t v2; if (0) v = (v - dark_avg) * white_avg / WHITE_MAP_RANGE; - + v2 = v < 0xFFFF ? v : 0xFFFF; - + /* SANE Standard 3.2.1 "... bytes of each sample value are transmitted in the machine's native byte order." */ *line_ptr = v2; - + line_ptr += s->avdimen.hw_bytes_per_line; } - + begin_ptr += 2; if (dark_avg_data) dark_avg_data += 2; @@ -7250,9 +7250,9 @@ reader_process (void *data) white_avg_data += 2; } } - + /* SOFTWARE SCALING WITH INTERPOLATION (IF NECESSARY) */ - + if (s->avdimen.hw_xres == s->avdimen.xres && s->avdimen.hw_yres == s->avdimen.yres) /* No scaling */ { @@ -7280,22 +7280,22 @@ reader_process (void *data) int x; /* for convenience in the 16bit code path */ uint16_t* out_data16 = (uint16_t*) out_data; - + const int hw_line_end = hw_line + useful_bytes / s->avdimen.hw_bytes_per_line; - + /* on-the-fly bi-linear interpolation */ while (1) { double by = (-1.0 + s->avdimen.hw_lines) * line / (s->avdimen.hw_lines * s->avdimen.xres / s->avdimen.hw_xres + s->val[OPT_BACKGROUND].w); int sy = (int)floor(by); int ydist = (int) ((by - sy) * 256); int syy = sy + 1; - + const int hwbpl = s->avdimen.hw_bytes_per_line; - + uint8_t* dst = ip_data; uint16_t* dst16 = (uint16_t*) ip_data; unsigned int v; /* accumulator */ - + /* Break out if we do not have the hw source line - yet, or when we are past the end of wanted data (e.g. on the front page due to rear_offset). Also take the read_offset @@ -7312,35 +7312,35 @@ reader_process (void *data) syy += s->avdimen.rear_offset; } } - + if (sy >= hw_line_end || syy >= hw_line_end) { DBG (3, "reader_process: source line %d-%d not yet avail\n", sy, syy); break; } - + /* convert to offset in current stripe */ sy -= hw_line; syy -= hw_line; - + if (sy < -1) { DBG (1, "reader_process: need more history: %d???\n", sy); sy = -1; } - + DBG (8, "reader_process: out line: %d <- from: %d-%d\n", line, sy, syy); - + for (x = 0; x < s->params.pixels_per_line; ++x) { const double bx = (-1.0 + s->avdimen.hw_pixels_per_line) * x / s->params.pixels_per_line; const int sx = (int)floor(bx); const int xdist = (int) ((bx - sx) * 256); const int sxx = sx + 1; - + if (x == 0 || x == s->params.pixels_per_line - 1) DBG (8, "reader_process: x: %d <- from: %d-%d\n", x, sx, sxx); - + switch (s->c_mode) { case AV_THRESHOLDED: case AV_DITHERED: @@ -7348,13 +7348,13 @@ reader_process (void *data) /* Repeating this over and over again is not fast, but as a seldom used code-path we want it readable. x/8 is the byte, and x%8 the bit position. */ - v = + v = ( ((out_data [sy*hwbpl + sx/8 ] >> (7-sx%8 )) & 1) * (256-xdist) * (256-ydist) + ((out_data [sy*hwbpl + sxx/8] >> (7-sxx%8)) & 1) * xdist * (256-ydist) + ((out_data [syy*hwbpl + sx/8 ] >> (7-sx%8 )) & 1) * (256-xdist) * ydist + ((out_data [syy*hwbpl + sxx/8] >> (7-sxx%8)) & 1) * xdist * ydist ) / (1 + 1 * 256); - + /* Shift and or the result together and eventually jump to the next byte. */ *dst = (*dst << 1) | ((v>>7)&1); @@ -7362,10 +7362,10 @@ reader_process (void *data) ++dst; } break; - + case AV_GRAYSCALE: { - v = + v = ( out_data [sy*hwbpl + sx ] * (256-xdist) * (256-ydist) + out_data [sy*hwbpl + sxx] * xdist * (256-ydist) + out_data [syy*hwbpl + sx ] * (256-xdist) * ydist + @@ -7374,12 +7374,12 @@ reader_process (void *data) *dst++ = v; } break; - + case AV_GRAYSCALE12: case AV_GRAYSCALE16: { - /* TODO: test! */ - v = + /* TODO: test! */ + v = ( out_data16 [sy*hwbpl + sx ] * (256-xdist) * (256-ydist) + out_data16 [sy*hwbpl + sxx] * xdist * (256-ydist) + out_data16 [syy*hwbpl + sx ] * (256-xdist) * ydist + @@ -7388,13 +7388,13 @@ reader_process (void *data) *dst16++ = v; } break; - + case AV_TRUECOLOR: { int c; for (c = 0; c < 3; ++c) { - v = + v = ( out_data [sy*hwbpl + sx*3 + c] * (256-xdist) * (256-ydist) + out_data [sy*hwbpl + sxx*3 + c] * xdist * (256-ydist) + out_data [syy*hwbpl + sx*3 + c] * (256-xdist) * ydist + @@ -7404,7 +7404,7 @@ reader_process (void *data) } } break; - + case AV_TRUECOLOR12: case AV_TRUECOLOR16: { @@ -7412,7 +7412,7 @@ reader_process (void *data) int c; for (c = 0; c < 3; ++c) { - v = + v = ( out_data16 [sy*hwbpl + sx*3 + c] * (256-xdist) * (256-ydist) + out_data16 [sy*hwbpl + sxx*3 + c] * xdist * (256-ydist) + out_data16 [syy*hwbpl + sx*3 + c] * (256-xdist) * ydist + @@ -7422,7 +7422,7 @@ reader_process (void *data) } } break; - + case AV_COLOR_MODE_LAST: ; /* silence compiler warning */ } @@ -7436,29 +7436,29 @@ reader_process (void *data) s->avdimen.hw_bytes_per_line); } } - + /* save image date in stripe buffer for next next stripe */ stripe_fill -= useful_bytes; if (stripe_fill > 0) memcpy (stripe_data, stripe_data + useful_bytes, stripe_fill); - + hw_line += useful_bytes / s->avdimen.hw_bytes_per_line; - + DBG (3, "reader_process: end of iteration\n"); } /* end while not all lines or inf. mode */ - + DBG (3, "reader_process: i/o loop finished\n"); if (exit_status == SANE_STATUS_GOOD) exit_status = SANE_STATUS_EOF; - + if (raw_fp) fclose (raw_fp); - + /* maybe we need to fill in some white data */ if (exit_status == SANE_STATUS_EOF && line < s->params.lines) { DBG (3, "reader_process: padding with white data\n"); memset (out_data, gray_mode ? 0xff : 0x00, s->params.bytes_per_line); - + DBG (6, "reader_process: padding line %d - %d\n", line, s->params.lines); while (line < s->params.lines) { @@ -7466,7 +7466,7 @@ reader_process (void *data) ++line; } } - + /* Eject film holder and/or release_unit - but only for non-duplex-rear / non-virtual scans. */ if ((deinterlace != NONE && s->duplex_rear_valid) || @@ -7485,14 +7485,14 @@ reader_process (void *data) status = release_unit (s, 0); if (status != SANE_STATUS_GOOD) DBG (1, "reader_process: release_unit failed\n"); - + if (dev->inquiry_new_protocol && dev->scanner_type == AV_FILM) { status = object_position (s, AVISION_SCSI_OP_GO_HOME); if (status != SANE_STATUS_GOOD) DBG (1, "reader_process: object position go-home failed!\n"); } } - + if ((dev->hw->feature_type & AV_ADF_FLIPPING_DUPLEX) && s->source_mode == AV_ADF_DUPLEX && s->page % 2) { /* front page of flipping duplex */ if (exit_status == SANE_STATUS_EOF) { @@ -7522,15 +7522,15 @@ reader_process (void *data) } if (rear_fp) fclose (rear_fp); - + if (ip_data) free (ip_data); if (ip_history) free (ip_history); else free (out_data); /* if we have ip_history out_data is included there */ - + free (stripe_data); - + DBG (3, "reader_process: returning success\n"); return exit_status; } @@ -7550,17 +7550,17 @@ attach_one_usb (const char* dev) attach (dev, AV_USB, 0); return SANE_STATUS_GOOD; } - + static SANE_Status sane_reload_devices (void) { FILE* fp; - + char line[PATH_MAX]; const char* cp = 0; char* word; int linenumber = 0; - int model_num = 0; + int model_num = 0; sanei_usb_init (); fp = sanei_config_open (AVISION_CONFIG_FILE); @@ -7574,15 +7574,15 @@ sane_reload_devices (void) while (sanei_config_read (line, sizeof (line), fp)) { attaching_hw = 0; - + word = NULL; ++ linenumber; - + DBG (5, "sane_reload_devices: parsing config line \"%s\"\n", line); - + cp = sanei_config_get_string (line, &word); - + if (!word || cp == line) { DBG (5, "sane_reload_devices: config file line %d: ignoring empty line\n", linenumber); @@ -7592,13 +7592,13 @@ sane_reload_devices (void) } continue; } - + if (!word) { DBG (1, "sane_reload_devices: config file line %d: could not be parsed\n", linenumber); continue; } - + if (word[0] == '#') { DBG (5, "sane_reload_devices: config file line %d: ignoring comment line\n", linenumber); @@ -7606,13 +7606,13 @@ sane_reload_devices (void) word = NULL; continue; } - + if (strcmp (word, "option") == 0) { free (word); word = NULL; cp = sanei_config_get_string (cp, &word); - + if (strcmp (word, "disable-gamma-table") == 0) { DBG (3, "sane_reload_devices: config file line %d: disable-gamma-table\n", linenumber); @@ -7656,7 +7656,7 @@ sane_reload_devices (void) else if (strcmp (word, "static-blue-calib") == 0) { DBG (3, "sane_reload_devices: config file line %d: static blue calibration\n", linenumber); - static_calib_list [2] = SANE_TRUE; + static_calib_list [2] = SANE_TRUE; } else DBG (1, "sane_reload_devices: config file line %d: options unknown!\n", @@ -7671,7 +7671,7 @@ sane_reload_devices (void) else if (strcmp (word, "scsi") == 0) { DBG (2, "sane_reload_devices: config file line %d: trying to attach SCSI: %s'\n", linenumber, line); - + /* the last time I verified (2003-03-18) this function only matches SCSI devices ... */ sanei_config_attach_matching_devices (line, attach_one_scsi); @@ -7681,7 +7681,7 @@ sane_reload_devices (void) linenumber); DBG (1, "sane_reload_devices: (see man sane-avision for details): trying to attach SCSI: %s'\n", line); - + /* the last time I verified (2003-03-18) this function only matched SCSI devices ... */ sanei_config_attach_matching_devices (line, attach_one_scsi); @@ -7689,13 +7689,13 @@ sane_reload_devices (void) free (word); word = NULL; } /* end while read */ - + fclose (fp); - + if (word) free (word); } /* end if fp */ - + /* search for all supported SCSI/USB devices */ while (Avision_Device_List [model_num].scsi_mfg != NULL || Avision_Device_List [model_num].real_mfg != NULL) @@ -7707,13 +7707,13 @@ sane_reload_devices (void) attaching_hw->scsi_model, NULL, -1, -1, -1, -1, attach_one_scsi); - + if (attaching_hw->usb_vendor != 0 && attaching_hw->usb_product != 0 ) { DBG (1, "sane_reload_devices: Trying to find USB device %.4x %.4x ...\n", attaching_hw->usb_vendor, attaching_hw->usb_product); - + /* TODO: check return value */ if (sanei_usb_find_devices (attaching_hw->usb_vendor, attaching_hw->usb_product, @@ -7723,7 +7723,7 @@ sane_reload_devices (void) } ++ model_num; } /* end for all devices in supported list */ - + attaching_hw = 0; return SANE_STATUS_GOOD; } @@ -7732,16 +7732,16 @@ SANE_Status sane_init (SANE_Int* version_code, SANE_Auth_Callback authorize) { authorize = authorize; /* silence gcc */ - + DBG_INIT(); #ifdef AVISION_STATIC_DEBUG_LEVEL DBG_LEVEL = AVISION_STATIC_DEBUG_LEVEL; #endif - + DBG (3, "sane_init:(Version: %i.%i Build: %i)\n", SANE_CURRENT_MAJOR, V_MINOR, BACKEND_BUILD); - + /* must come first */ sanei_thread_init (); @@ -7812,7 +7812,7 @@ sane_open (SANE_String_Const devicename, SANE_Handle *handle) uint8_t inquiry_result[AVISION_INQUIRY_SIZE_V1]; DBG (3, "sane_open:\n"); - + if (devicename[0]) { for (dev = first_dev; dev; dev = dev->next) if (strcmp (dev->sane.name, devicename) == 0) @@ -7830,26 +7830,26 @@ sane_open (SANE_String_Const devicename, SANE_Handle *handle) if (!dev) return SANE_STATUS_INVAL; - + s = malloc (sizeof (*s)); if (!s) return SANE_STATUS_NO_MEM; - + /* initialize ... */ /* the other states (scanning, ...) rely on this memset (0) */ memset (s, 0, sizeof (*s)); - + /* initialize connection state */ s->av_con.connection_type = dev->connection.connection_type; s->av_con.usb_status = dev->connection.usb_status; s->av_con.scsi_fd = -1; s->av_con.usb_dn = -1; - + s->reader_pid = -1; s->read_fds = -1; s->hw = dev; - + /* We initialize the table to a gamma value of 2.22, since this is what papers about Colorimetry suggest. @@ -7859,17 +7859,17 @@ sane_open (SANE_String_Const devicename, SANE_Handle *handle) { const double gamma = 2.22; const double one_over_gamma = 1. / gamma; - + for (i = 0; i < 4; ++ i) for (j = 0; j < 256; ++ j) s->gamma_table[i][j] = pow( (double) j / 255, one_over_gamma) * 255; } - + /* insert newly opened handle into list of open handles: */ s->next = first_handle; first_handle = s; *handle = s; - + /* open the device */ if (! avision_is_open (&s->av_con) ) { #ifdef HAVE_SANEI_SCSI_OPEN_EXTENDED @@ -7907,16 +7907,16 @@ sane_open (SANE_String_Const devicename, SANE_Handle *handle) DBG (1, "sane_open: additional probe failed: %s\n", sane_strstatus (status)); return status; } - + /* initialize the options */ init_options (s); - + if (dev->inquiry_duplex_interlaced || dev->scanner_type == AV_FILM || dev->hw->feature_type & AV_ADF_FLIPPING_DUPLEX) { /* Might need at least *DOS (Windows flavour and OS/2) portability fix However, I was told Cygwin (et al.) takes care of it. */ strncpy(s->duplex_rear_fname, "/tmp/avision-rear-XXXXXX", PATH_MAX); - + if (! mktemp(s->duplex_rear_fname) ) { DBG (1, "sane_open: failed to generate temporary fname for duplex scans\n"); return SANE_STATUS_NO_MEM; @@ -7926,25 +7926,25 @@ sane_open (SANE_String_Const devicename, SANE_Handle *handle) s->duplex_rear_fname); } } - + /* calibrate film scanners, as this must be done without the film holder and at the full resolution */ if (dev->scanner_type == AV_FILM) { int default_res = s->val[OPT_RESOLUTION].w; s->val[OPT_RESOLUTION].w = dev->inquiry_optical_res; - + DBG (1, "sane_open: early calibration for film scanner.\n"); - + compute_parameters (s); - + status = set_window (s); if (status != SANE_STATUS_GOOD) { DBG (1, "sane_open: set scan window command failed: %s\n", sane_strstatus (status)); return status; } - + if (!(dev->hw->feature_type & AV_NO_CALIB)) { status = normal_calibration (s); @@ -7954,16 +7954,16 @@ sane_open (SANE_String_Const devicename, SANE_Handle *handle) return status; } } - + if (dev->scanner_type == AV_FILM) { status = object_position (s, AVISION_SCSI_OP_GO_HOME); if (status != SANE_STATUS_GOOD) DBG (1, "reader_open: object position go-home failed!\n"); } - + s->val[OPT_RESOLUTION].w = default_res; } - + return SANE_STATUS_GOOD; } @@ -7975,12 +7975,12 @@ sane_close (SANE_Handle handle) int i; DBG (3, "sane_close:\n"); - + /* close the device */ if (avision_is_open (&s->av_con) ) { avision_close (&s->av_con); } - + /* remove handle from list of open handles: */ prev = 0; for (s = first_handle; s; s = s->next) { @@ -8008,20 +8008,20 @@ sane_close (SANE_Handle handle) free (s->val[i].s); } } - + if (s->white_avg_data) free (s->white_avg_data); if (s->dark_avg_data) free (s->dark_avg_data); - + if (s->background_raster) free (s->background_raster); - + if (*(s->duplex_rear_fname)) { unlink (s->duplex_rear_fname); *(s->duplex_rear_fname) = 0; } - + free (handle); } @@ -8029,7 +8029,7 @@ const SANE_Option_Descriptor* sane_get_option_descriptor (SANE_Handle handle, SANE_Int option) { Avision_Scanner* s = handle; - + DBG (3, "sane_get_option_descriptor: %d\n", option); if ((unsigned) option >= NUM_OPTIONS) @@ -8045,7 +8045,7 @@ sane_control_option (SANE_Handle handle, SANE_Int option, Avision_Device* dev = s->hw; SANE_Status status; SANE_Word cap; - + DBG (3, "sane_control_option: option=%d, action=%d\n", (int)option, (int)action); @@ -8060,7 +8060,7 @@ sane_control_option (SANE_Handle handle, SANE_Int option, if (s->scanning) return SANE_STATUS_DEVICE_BUSY; - + if (option >= NUM_OPTIONS) return SANE_STATUS_INVAL; @@ -8075,7 +8075,7 @@ sane_control_option (SANE_Handle handle, SANE_Int option, { /* word options: */ case OPT_PREVIEW: - + case OPT_RESOLUTION: case OPT_SPEED: case OPT_TL_X: @@ -8086,7 +8086,7 @@ sane_control_option (SANE_Handle handle, SANE_Int option, case OPT_OVERSCAN_BOTTOM: case OPT_BACKGROUND: case OPT_NUM_OPTS: - + case OPT_BRIGHTNESS: case OPT_CONTRAST: case OPT_EXPOSURE: @@ -8098,19 +8098,19 @@ sane_control_option (SANE_Handle handle, SANE_Int option, case OPT_ADF_FLIP: *(SANE_Word*) val = s->val[option].w; return SANE_STATUS_GOOD; - + /* specially treated word options */ - + case OPT_FRAME: status = get_frame_info (s); *(SANE_Word*) val = s->val[option].w; return status; - + case OPT_POWER_SAVE_TIME: get_power_save_time (s, &(s->val[option].w)); *(SANE_Word*) val = s->val[option].w; return SANE_STATUS_GOOD; - + /* word-array options: */ case OPT_GAMMA_VECTOR: case OPT_GAMMA_VECTOR_R: @@ -8118,7 +8118,7 @@ sane_control_option (SANE_Handle handle, SANE_Int option, case OPT_GAMMA_VECTOR_B: memcpy (val, s->val[option].wa, s->opt[option].size); return SANE_STATUS_GOOD; - + /* string options: */ case OPT_MODE: case OPT_SOURCE: @@ -8129,28 +8129,28 @@ sane_control_option (SANE_Handle handle, SANE_Int option, case OPT_MESSAGE: if (dev->inquiry_button_control || dev->inquiry_buttons) status = get_button_status (s); - + strcpy (val, s->val[option].s); s->val[option].s[0] = 0; return SANE_STATUS_GOOD; case OPT_NVRAM: get_and_parse_nvram (s, s->val[option].s, 1024); - + strcpy (val, s->val[option].s); return SANE_STATUS_GOOD; - + } /* end switch option */ } /* end if GET_ACTION_GET_VALUE */ else if (action == SANE_ACTION_SET_VALUE) { if (!SANE_OPTION_IS_SETTABLE (cap)) return SANE_STATUS_INVAL; - + status = constrain_value (s, option, val, info); if (status != SANE_STATUS_GOOD) return status; - + switch (option) { /* side-effect-free word options: */ @@ -8170,7 +8170,7 @@ sane_control_option (SANE_Handle handle, SANE_Int option, case OPT_ADF_FLIP: s->val[option].w = *(SANE_Word*) val; return SANE_STATUS_GOOD; - + /* side-effect-free word-array options: */ case OPT_GAMMA_VECTOR: case OPT_GAMMA_VECTOR_R: @@ -8178,7 +8178,7 @@ sane_control_option (SANE_Handle handle, SANE_Int option, case OPT_GAMMA_VECTOR_B: memcpy (s->val[option].wa, val, s->opt[option].size); return SANE_STATUS_GOOD; - + /* options with side-effects: */ case OPT_RESOLUTION: case OPT_TL_X: @@ -8195,14 +8195,14 @@ sane_control_option (SANE_Handle handle, SANE_Int option, /* string options with side-effects: */ case OPT_SOURCE: - + if (s->val[option].s) { free(s->val[option].s); } s->val[option].s = strdup(val); s->source_mode = match_source_mode (dev, s->val[option].s); s->source_mode_dim = match_source_mode_dim (s->source_mode); - + /* set side-effects */ dev->x_range.max = SANE_FIX ( dev->inquiry_x_ranges[s->source_mode_dim]); @@ -8214,22 +8214,22 @@ sane_control_option (SANE_Handle handle, SANE_Int option, } else { s->opt[OPT_ADF_FLIP].cap |= SANE_CAP_INACTIVE; } - + if (info) *info |= SANE_INFO_RELOAD_OPTIONS | SANE_INFO_RELOAD_PARAMS; - + return SANE_STATUS_GOOD; - + case OPT_MODE: { if (s->val[option].s) free (s->val[option].s); - + s->val[option].s = strdup (val); s->c_mode = match_color_mode (dev, s->val[OPT_MODE].s); - + /* set to mode specific values */ - + /* the gamma table related */ if (!disable_gamma_table) { @@ -8246,7 +8246,7 @@ sane_control_option (SANE_Handle handle, SANE_Int option, s->opt[OPT_GAMMA_VECTOR_G].cap |= SANE_CAP_INACTIVE; s->opt[OPT_GAMMA_VECTOR_B].cap |= SANE_CAP_INACTIVE; } - } + } if (info) *info |= SANE_INFO_RELOAD_OPTIONS | SANE_INFO_RELOAD_PARAMS; return SANE_STATUS_GOOD; @@ -8254,7 +8254,7 @@ sane_control_option (SANE_Handle handle, SANE_Int option, case OPT_FRAME: { SANE_Word frame = *((SANE_Word *) val); - + status = set_frame (s, frame); if (status == SANE_STATUS_GOOD) { s->val[OPT_FRAME].w = frame; @@ -8292,9 +8292,9 @@ SANE_Status sane_get_parameters (SANE_Handle handle, SANE_Parameters* params) { Avision_Scanner* s = handle; - + DBG (3, "sane_get_parameters:\n"); - + /* During an actual scan these parameters will have been computed in sane_start(). Otherwise, the values must be computed on demand. The values cannot be changed during a scan to avoid inconsistency. */ @@ -8309,7 +8309,7 @@ sane_get_parameters (SANE_Handle handle, SANE_Parameters* params) /* add background raster lines */ params->lines += s->val[OPT_BACKGROUND].w; } - + return SANE_STATUS_GOOD; } @@ -8318,25 +8318,25 @@ sane_start (SANE_Handle handle) { Avision_Scanner* s = handle; Avision_Device* dev = s->hw; - + SANE_Status status; int fds [2]; DBG (1, "sane_start:\n"); - + /* Make sure there is no scan running!!! */ if (s->scanning) return SANE_STATUS_DEVICE_BUSY; /* Clear cancellation status */ s->cancelled = 0; - + /* Make sure we have a current parameter set. Some of the parameters will be overwritten below, but that's OK. */ status = sane_get_parameters (s, &s->params); if (status != SANE_STATUS_GOOD) { return status; } - + /* for non ADF scans (e.g. scanimage --batch-prompt on a Flatbed scanner) make sure we do not assume it's an ADF scan and optimize something away*/ @@ -8347,7 +8347,7 @@ sane_start (SANE_Handle handle) DBG (1, "sane_start: virtual duplex rear data valid.\n"); goto start_scan_end; } - + /* Check for paper during ADF scans and for sheetfed scanners. */ if (is_adf_scan (s)) { status = media_check (s); @@ -8359,7 +8359,7 @@ sane_start (SANE_Handle handle) else DBG (1, "sane_start: media_check ok\n"); } - + /* Check the light early, to return to the GUI and notify the user. */ if (s->prepared == SANE_FALSE) { if (dev->inquiry_light_control) { @@ -8397,28 +8397,28 @@ sane_start (SANE_Handle handle) { size_t size = 16; uint8_t result[16]; - + DBG (5, "sane_start: reading scanner window size\n"); - + status = simple_read (s, 0x80, 0, &size, result); - + if (status != SANE_STATUS_GOOD) { DBG (1, "sane_start: get pixel size command failed: %s\n", sane_strstatus (status)); goto stop_scanner_and_return; - } + } debug_print_raw (5, "sane_start: pixel_size:", result, size); DBG (5, "sane_start: x-pixels: %d, y-pixels: %d\n", get_quad (&(result[0])), get_quad (&(result[4]))); } #endif - + /* no calibration for ADF pages */ if (s->page > 0) { DBG (1, "sane_start: optimized calibration away.\n"); goto calib_end; } - + /* check whether the user enforces calibration */ if (force_calibration) { DBG (1, "sane_start: calibration enforced in config!\n"); @@ -8431,12 +8431,12 @@ sane_start (SANE_Handle handle) DBG (1, "sane_start: old protocol no calibration needed!\n"); goto calib_end; } - + if (!dev->inquiry_needs_calibration) { DBG (1, "sane_start: due to inquiry no calibration needed!\n"); goto calib_end; } - + /* calibration allowed for this scanner? */ if (dev->hw->feature_type & AV_NO_CALIB) { DBG (1, "sane_start: calibration disabled in device list!!\n"); @@ -8448,28 +8448,28 @@ sane_start (SANE_Handle handle) DBG (1, "sane_start: no calibration for film scanner!\n"); goto calib_end; } - + /* check whether calibration is disabled by the user */ if (disable_calibration) { DBG (1, "sane_start: calibration disabled in config - skipped!\n"); goto calib_end; } - + /* R² reminder: We must not skip the calibration for ADF scans, some scanner (HP 53xx/74xx ASIC series) rely on a calibration data read (and will hang otherwise) */ calib: status = normal_calibration (s); - + if (status != SANE_STATUS_GOOD) { DBG (1, "sane_start: perform calibration failed: %s\n", sane_strstatus (status)); goto stop_scanner_and_return; } - + calib_end: - + if (dev->inquiry_3x3_matrix && dev->inquiry_asic_type >= AV_ASIC_C6 && s->page == 0) { @@ -8478,13 +8478,13 @@ sane_start (SANE_Handle handle) return status; } } - + /* check whether gamma-table is disabled by the user? */ if (disable_gamma_table) { DBG (1, "sane_start: gamma-table disabled in config - skipped!\n"); goto gamma_end; } - + if (dev->hw->feature_type & AV_NO_GAMMA) { DBG (1, "sane_start: gamma table skipped due to device-list!!\n"); goto gamma_end; @@ -8501,9 +8501,9 @@ sane_start (SANE_Handle handle) goto stop_scanner_and_return; } } - + gamma_end: - + if (dev->inquiry_tune_scan_length && is_adf_scan (s)) { status = send_tune_scan_length (s); if (status != SANE_STATUS_GOOD) { @@ -8512,7 +8512,7 @@ sane_start (SANE_Handle handle) goto stop_scanner_and_return; } } - + /* if the device supports retrieving background raster data inquire the data no matter if the user/applications asks for it in order to use it for bottom padding */ @@ -8524,11 +8524,11 @@ sane_start (SANE_Handle handle) goto stop_scanner_and_return; } } - + /* check film holder */ if (dev->scanner_type == AV_FILM && dev->holder_type == 0xff) { DBG (1, "sane_start: no film holder or APS cassette!\n"); - + /* Normally "go_home" is executed from the reader process, but as it will not start we have to reset things here */ if (dev->inquiry_new_protocol) { @@ -8539,33 +8539,33 @@ sane_start (SANE_Handle handle) } goto stop_scanner_and_return; } - + start_scan_end: - + s->scanning = SANE_TRUE; s->page += 1; /* processing next page */ - + if (pipe (fds) < 0) { return SANE_STATUS_IO_ERROR; } - + s->read_fds = fds[0]; s->write_fds = fds[1]; /* create reader routine as new process or thread */ DBG (3, "sane_start: starting thread\n"); s->reader_pid = sanei_thread_begin (reader_process, (void *) s); - + if (sanei_thread_is_forked()) close (s->write_fds); - + return SANE_STATUS_GOOD; - + stop_scanner_and_return: - + /* cancel the scan nicely */ do_cancel (s); - + return status; } @@ -8588,7 +8588,7 @@ sane_read (SANE_Handle handle, SANE_Byte* buf, SANE_Int max_len, SANE_Int* len) if (!s->scanning) return SANE_STATUS_CANCELLED; - + if (nread < 0) { if (errno == EAGAIN) { return SANE_STATUS_GOOD; @@ -8597,9 +8597,9 @@ sane_read (SANE_Handle handle, SANE_Byte* buf, SANE_Int max_len, SANE_Int* len) return SANE_STATUS_IO_ERROR; } } - + *len = nread; - + /* if all data was passed through */ if (nread == 0) return do_eof (s); @@ -8621,16 +8621,16 @@ SANE_Status sane_set_io_mode (SANE_Handle handle, SANE_Bool non_blocking) { Avision_Scanner* s = handle; - + DBG (3, "sane_set_io_mode:\n"); if (!s->scanning) { DBG (3, "sane_set_io_mode: not yet scanning\n"); return SANE_STATUS_INVAL; } - + if (fcntl (s->read_fds, F_SETFL, non_blocking ? O_NONBLOCK : 0) < 0) return SANE_STATUS_IO_ERROR; - + return SANE_STATUS_GOOD; } @@ -8638,14 +8638,14 @@ SANE_Status sane_get_select_fd (SANE_Handle handle, SANE_Int* fd) { Avision_Scanner* s = handle; - + DBG (3, "sane_get_select_fd:\n"); - + if (!s->scanning) { DBG (3, "sane_get_select_fd: not yet scanning\n"); return SANE_STATUS_INVAL; } - + *fd = s->read_fds; return SANE_STATUS_GOOD; } diff --git a/backend/avision.h b/backend/avision.h index b26907fc9..3f42ff688 100644 --- a/backend/avision.h +++ b/backend/avision.h @@ -1,7 +1,7 @@ /******************************************************************************* * SANE - Scanner Access Now Easy. - avision.h + avision.h This file is part of the SANE package. @@ -41,7 +41,7 @@ This backend is based upon the Tamarack backend and adapted to the Avision scanners by René Rebe and Meino Cramer. - + Check the avision.c file for detailed copyright and change-log information. @@ -78,7 +78,7 @@ typedef struct Avision_Connection { AVISION_USB_INT_STATUS, /* interrupt endp. (USB 1.x device) status */ AVISION_USB_BULK_STATUS /* bulk endp. (USB 2.0 device) status */ } usb_status; - + } Avision_Connection; typedef struct Avision_HWEntry { @@ -90,33 +90,33 @@ typedef struct Avision_HWEntry { const char* real_mfg; const char* real_model; - + /* feature overwrites - as embedded CPUs have 16bit enums - this would need a change ... */ /* force no calibration */ #define AV_NO_CALIB ((uint64_t)1<<0) - + /* force all in one command calibration */ #define AV_ONE_CALIB_CMD ((uint64_t)1<<1) - + /* no gamma table */ #define AV_NO_GAMMA ((uint64_t)1<<2) - + /* light check is bogus */ #define AV_LIGHT_CHECK_BOGUS ((uint64_t)1<<3) - + /* no button though the device advertise it */ #define AV_NO_BUTTON ((uint64_t)1<<4) - + /* if the scan area needs to be forced to A3 */ #define AV_FORCE_A3 ((uint64_t)1<<5) - + /* if the scan area and resolution needs to be forced for films */ #define AV_FORCE_FILM ((uint64_t)1<<6) - + /* does not suport, or very broken background (added for AV610C2) */ #define AV_NO_BACKGROUND ((uint64_t)1<<7) - + /* is film scanner - no detection yet */ #define AV_FILMSCANNER ((uint64_t)1<<8) @@ -125,7 +125,7 @@ typedef struct Avision_HWEntry { /* gray calibration data has to be uploaded on the blue channel ... ? */ #define AV_GRAY_CALIB_BLUE ((uint64_t)1<<10) - + /* Interrupt endpoint button readout (so far AV220) */ #define AV_INT_BUTTON ((uint64_t)1<<11) @@ -161,35 +161,35 @@ typedef struct Avision_HWEntry { /* very broken background raster */ #define AV_BACKGROUND_QUIRK ((uint64_t)1<<22) - + /* though marked as GRAY only the scanner can do GRAY modes */ #define AV_GRAY_MODES ((uint64_t)1<<23) /* no seperate, single REAR scan (AV122, DM152, ...) */ #define AV_NO_REAR ((uint64_t)1<<24) - + /* only scan with some known good hardware resolutions, as the scanner fails to properly interpoloate in between (e.g. AV121, DM152 on duplex scans - but also the AV600), software scale and interpolate to all the others */ #define AV_SOFT_SCALE ((uint64_t)1<<25) - + /* does keep window though it does not advertice it - the AV122/DM152 mess up image data if window is resend between ADF pages */ #define AV_DOES_KEEP_WINDOW ((uint64_t)1<<26) - + /* does keep gamma though it does not advertice it */ #define AV_DOES_KEEP_GAMMA ((uint64_t)1<<27) - + /* does the scanner contain a Cancel button? */ #define AV_CANCEL_BUTTON ((uint64_t)1<<28) - + /* is the rear image offset? */ #define AV_REAR_OFFSET ((uint64_t)1<<29) /* some devices do not need a START_SCAN, even hang with it */ #define AV_NO_START_SCAN ((uint64_t)1<<30) - + #define AV_INT_STATUS ((uint64_t)1<<31) /* force no calibration */ @@ -203,7 +203,7 @@ typedef struct Avision_HWEntry { /* For scanners which need to have their firmware read to properly function. */ #define AV_FIRMWARE ((uint64_t)1<<35) - + /* maybe more ...*/ uint64_t feature_type; @@ -252,32 +252,32 @@ typedef enum { enum Avision_Option { OPT_NUM_OPTS = 0, /* must come first */ - + OPT_MODE_GROUP, OPT_MODE, OPT_RESOLUTION, #define OPT_RESOLUTION_DEFAULT 150 OPT_SPEED, OPT_PREVIEW, - + OPT_SOURCE, /* scan source normal, transparency, ADF */ - + OPT_GEOMETRY_GROUP, OPT_TL_X, /* top-left x */ OPT_TL_Y, /* top-left y */ OPT_BR_X, /* bottom-right x */ OPT_BR_Y, /* bottom-right y */ - + OPT_OVERSCAN_TOP, /* overscan for auto-crop/deskew, if supported */ OPT_OVERSCAN_BOTTOM, OPT_BACKGROUND, /* background raster lines to read out */ - + OPT_ENHANCEMENT_GROUP, OPT_BRIGHTNESS, OPT_CONTRAST, OPT_QSCAN, OPT_QCALIB, - + OPT_GAMMA_VECTOR, /* first must be gray */ OPT_GAMMA_VECTOR_R, /* then r g b vector */ OPT_GAMMA_VECTOR_G, @@ -286,15 +286,15 @@ enum Avision_Option OPT_EXPOSURE, /* film exposure adjustment */ OPT_IR, /* infra-red */ OPT_MULTISAMPLE, /* multi-sample */ - + OPT_MISC_GROUP, OPT_FRAME, /* Film holder control */ OPT_POWER_SAVE_TIME, /* set power save time to the scanner */ - OPT_MESSAGE, /* optional message from the scanner display */ + OPT_MESSAGE, /* optional message from the scanner display */ OPT_NVRAM, /* retrieve NVRAM values as pretty printed text */ - + OPT_PAPERLEN, /* Use paper_length field to detect double feeds */ OPT_ADF_FLIP, /* For flipping duplex, reflip the document */ @@ -306,28 +306,28 @@ typedef struct Avision_Dimensions /* in dpi */ int xres; int yres; - + /* in pixels */ long tlx; long tly; long brx; long bry; - + /* in pixels */ int line_difference; int rear_offset; /* in pixels of HW res */ /* interlaced duplex scan */ SANE_Bool interlaced_duplex; - + /* in dpi, likewise - different if software scaling required */ int hw_xres; int hw_yres; - + int hw_pixels_per_line; int hw_bytes_per_line; int hw_lines; - + } Avision_Dimensions; /* this contains our low-level info - not relevant for the SANE interface */ @@ -336,7 +336,7 @@ typedef struct Avision_Device struct Avision_Device* next; SANE_Device sane; Avision_Connection connection; - + /* structs used to store config options */ SANE_Range dpi_range; SANE_Range x_range; @@ -369,34 +369,34 @@ typedef struct Avision_Device SANE_Bool inquiry_light_detect; SANE_Bool inquiry_light_control; SANE_Bool inquiry_exposure_control; - + int inquiry_max_shading_target; SANE_Bool inquiry_button_control; unsigned int inquiry_buttons; SANE_Bool inquiry_tune_scan_length; SANE_Bool inquiry_background_raster; int inquiry_background_raster_pixel; - + enum {AV_FLATBED, AV_FILM, AV_SHEETFEED } scanner_type; - + /* the list of available color modes */ SANE_String_Const color_list[AV_COLOR_MODE_LAST + 1]; color_mode color_list_num[AV_COLOR_MODE_LAST]; color_mode color_list_default; - + /* the list of available source modes */ SANE_String_Const source_list[AV_SOURCE_MODE_LAST + 1]; source_mode source_list_num[AV_SOURCE_MODE_LAST]; - + int inquiry_optical_res; /* in dpi */ int inquiry_max_res; /* in dpi */ - + double inquiry_x_ranges [AV_SOURCE_MODE_DIM_LAST]; /* in mm */ double inquiry_y_ranges [AV_SOURCE_MODE_DIM_LAST]; /* in mm */ - + int inquiry_color_boundary; int inquiry_gray_boundary; int inquiry_dithered_boundary; @@ -406,7 +406,7 @@ typedef struct Avision_Device int inquiry_channels_per_pixel; int inquiry_bits_per_channel; int inquiry_no_gray_modes; - + int scsi_buffer_size; /* nice to have SCSI buffer size */ int read_stripe_size; /* stripes to be read at-a-time */ @@ -414,10 +414,10 @@ typedef struct Avision_Device SANE_Range frame_range; SANE_Word current_frame; SANE_Word holder_type; - + /* some versin corrections */ uint16_t data_dq; /* was ox0A0D - but hangs some new scanners */ - + Avision_HWEntry* hw; } Avision_Device; @@ -426,19 +426,19 @@ typedef struct Avision_Scanner { struct Avision_Scanner* next; Avision_Device* hw; - + SANE_Option_Descriptor opt [NUM_OPTIONS]; Option_Value val [NUM_OPTIONS]; SANE_Int gamma_table [4][256]; - + /* we now save the calib data because we might need it for 16bit software calibration :-( */ uint8_t* dark_avg_data; uint8_t* white_avg_data; - + /* background raster data, if duplex first front, then rear */ uint8_t* background_raster; - + /* Parsed option values and variables that are valid only during the actual scan: */ SANE_Bool prepared; /* first page marker */ @@ -448,22 +448,22 @@ typedef struct Avision_Scanner SANE_Parameters params; /* scan window */ Avision_Dimensions avdimen; /* scan window - detailed internals */ - + /* Internal data for duplex scans */ char duplex_rear_fname [PATH_MAX]; SANE_Bool duplex_rear_valid; - + color_mode c_mode; source_mode source_mode; source_mode_dim source_mode_dim; - + /* Avision HW Access Connection (SCSI/USB abstraction) */ Avision_Connection av_con; SANE_Pid reader_pid; /* process id of reader */ int read_fds; /* pipe reading end */ int write_fds; /* pipe writing end */ - + } Avision_Scanner; /* Some Avision driver internal defines */ @@ -549,7 +549,7 @@ typedef struct command_send uint8_t opc; uint8_t bitset1; uint8_t datatypecode; - uint8_t reserved0; + uint8_t reserved0; uint8_t datatypequal [2]; uint8_t transferlen [3]; uint8_t reserved1; @@ -602,7 +602,7 @@ typedef struct nvram_data uint8_t jam_count [4]; uint8_t reserved; - char identify_info[16]; + char identify_info[16]; char formal_name[16]; uint8_t reserved2 [10]; @@ -614,7 +614,7 @@ typedef struct command_set_window_window uint8_t reserved0 [6]; uint8_t desclen [2]; } header; - + struct { uint8_t winid; uint8_t reserved0; @@ -641,37 +641,37 @@ typedef struct command_set_window_window uint8_t vendor_specific; uint8_t paralen; /* bytes following after this byte */ } descriptor; - + struct { uint8_t bitset1; uint8_t highlight; uint8_t shadow; uint8_t line_width [2]; uint8_t line_count [2]; - + /* the tail is quite version and model specific */ union { struct { uint8_t bitset2; uint8_t reserved; } old; - + struct { uint8_t bitset2; uint8_t ir_exposure_time; - + /* optional */ uint8_t r_exposure_time [2]; uint8_t g_exposure_time [2]; uint8_t b_exposure_time [2]; - + uint8_t bitset3; /* reserved in the v2 */ uint8_t auto_focus; uint8_t line_width_msb; uint8_t line_count_msb; uint8_t background_lines; } normal; - + struct { uint8_t reserved0 [4]; uint8_t paper_size; @@ -716,7 +716,7 @@ typedef struct calibration_format uint16_t r_dark_shading_target; uint16_t g_dark_shading_target; uint16_t b_dark_shading_target; - + /* not returned but usefull in some places */ uint8_t channels; } calibration_format; @@ -726,7 +726,7 @@ typedef struct matrix_3x3 uint16_t v[9]; } matrix_3x3; -typedef struct acceleration_info +typedef struct acceleration_info { uint16_t total_steps; uint16_t stable_steps; diff --git a/backend/bh.c b/backend/bh.c index 9424bd606..08ec5d8b8 100644 --- a/backend/bh.c +++ b/backend/bh.c @@ -76,7 +76,7 @@ static SANE_Int fake_inquiry = 0; static int allblank(const char *s) { - while (s && *s) + while (s && *s) if (!isspace(*s++)) return 0; @@ -111,10 +111,10 @@ trim_spaces(char *s, size_t n) } static SANE_String_Const -print_devtype (SANE_Byte devtype) +print_devtype (SANE_Byte devtype) { static SANE_String devtypes[] = - { + { "disk", "tape", "printer", @@ -127,21 +127,21 @@ print_devtype (SANE_Byte devtype) "communicator" }; - return (devtype > 0 && devtype < NELEMS(devtypes)) ? - devtypes[devtype] : + return (devtype > 0 && devtype < NELEMS(devtypes)) ? + devtypes[devtype] : "unknown-device"; } static SANE_String_Const -print_barcodetype (SANE_Int i) +print_barcodetype (SANE_Int i) { - return (i > 0 && i < NELEMS(barcode_search_bar_list)) ? - barcode_search_bar_list[i] : + return (i > 0 && i < NELEMS(barcode_search_bar_list)) ? + barcode_search_bar_list[i] : (SANE_String_Const) "unknown"; } static SANE_String_Const -print_orientation (SANE_Int i) +print_orientation (SANE_Int i) { switch(i) { @@ -163,7 +163,7 @@ print_orientation (SANE_Int i) } static SANE_String_Const -print_read_type (SANE_Int i) +print_read_type (SANE_Int i) { static char buf[32]; SANE_Int n; @@ -249,72 +249,72 @@ print_read_type (SANE_Int i) return buf; } -static SANE_Int +static SANE_Int get_rotation_id(char *s) { SANE_Int i; - for (i = 0; rotation_list[i]; i++) - if (strcmp(s, rotation_list[i]) == 0) + for (i = 0; rotation_list[i]; i++) + if (strcmp(s, rotation_list[i]) == 0) break; /* unknown strings are treated as '0' */ return rotation_list[i] ? i : 0; } -static SANE_Int +static SANE_Int get_compression_id(char *s) { SANE_Int i; - for (i = 0; compression_list[i]; i++) - if (strcmp(s, compression_list[i]) == 0) + for (i = 0; compression_list[i]; i++) + if (strcmp(s, compression_list[i]) == 0) break; /* unknown strings are treated as 'none' */ return compression_list[i] ? i : 0; } -static SANE_Int +static SANE_Int get_barcode_id(char *s) { SANE_Int i; - for (i = 0; barcode_search_bar_list[i]; i++) - if (strcmp(s, barcode_search_bar_list[i]) == 0) + for (i = 0; barcode_search_bar_list[i]; i++) + if (strcmp(s, barcode_search_bar_list[i]) == 0) break; /* unknown strings are treated as 'none' */ return barcode_search_bar_list[i] ? i : 0; } -static SANE_Int +static SANE_Int get_scan_mode_id(char *s) { SANE_Int i; - for (i = 0; scan_mode_list[i]; i++) - if (strcmp(s, scan_mode_list[i]) == 0) + for (i = 0; scan_mode_list[i]; i++) + if (strcmp(s, scan_mode_list[i]) == 0) break; /* unknown strings are treated as 'lineart' */ return scan_mode_list[i] ? i : 0; } -static SANE_Int +static SANE_Int get_paper_id(char *s) { SANE_Int i; - for (i = 0; paper_list[i]; i++) - if (strcmp(s, paper_list[i]) == 0) + for (i = 0; paper_list[i]; i++) + if (strcmp(s, paper_list[i]) == 0) break; /* unknown strings are treated as 'custom' */ return paper_list[i] ? i : 0; } -static SANE_Int +static SANE_Int get_barcode_search_mode(char *s) { SANE_Int i; @@ -335,7 +335,7 @@ get_barcode_search_mode(char *s) { i = 9; } - else + else { /* unknown strings are treated as 'horiz-vert' */ DBG(1, "get_barcode_search_mode: unrecognized string `%s'\n", s); @@ -345,7 +345,7 @@ get_barcode_search_mode(char *s) return i; } -static void +static void appendStdList(BH_Info *sc, SANE_Int res) { /* append entry to resolution list - a SANE_WORD_LIST */ @@ -353,7 +353,7 @@ appendStdList(BH_Info *sc, SANE_Int res) sc->resStdList[0]++; } -static void +static void ScannerDump(BH_Scanner *s) { int i; @@ -370,9 +370,9 @@ ScannerDump(BH_Scanner *s) sdev->type); DBG (1, "Type: '%s' Vendor: '%s' Product: '%s' Revision: '%s'\n", - print_devtype(info->devtype), - info->vendor, - info->product, + print_devtype(info->devtype), + info->vendor, + info->product, info->revision); DBG (1, "Automatic Document Feeder:%s\n", @@ -399,8 +399,8 @@ ScannerDump(BH_Scanner *s) info->canBarCode ? " " : "", info->canIcon ? " " : "", info->canSection ? "
" : ""); - - DBG (1, "Max bytes per scan-line: %d (%d pixels)\n", + + DBG (1, "Max bytes per scan-line: %d (%d pixels)\n", info->lineMaxBytes, info->lineMaxBytes * 8); @@ -408,11 +408,11 @@ ScannerDump(BH_Scanner *s) info->resBasicX, info->resBasicY); - DBG (1, "Maximum resolution (X/Y): %d/%d\n", + DBG (1, "Maximum resolution (X/Y): %d/%d\n", info->resMaxX, info->resMaxY); - DBG (1, "Minimum resolution (X/Y): %d/%d\n", + DBG (1, "Minimum resolution (X/Y): %d/%d\n", info->resMinX, info->resMinY); @@ -421,8 +421,8 @@ ScannerDump(BH_Scanner *s) DBG (1, " %d\n", info->resStdList[i+1]); DBG (1, "Window Width/Height (in basic res) %d/%d (%.2f/%.2f inches)\n", - info->winWidth, - info->winHeight, + info->winWidth, + info->winHeight, (info->resBasicX != 0) ? ((float) info->winWidth) / info->resBasicX : 0.0, (info->resBasicY) ? ((float) info->winHeight) / info->resBasicY : 0.0); @@ -430,15 +430,15 @@ ScannerDump(BH_Scanner *s) info->canDuplex ? "Duplex Scanner" : "Simplex Scanner", info->canACE ? " (ACE capable)" : "", info->canCheckADF ? " (ADF Paper Sensor capable)" : ""); - + sprintf(inquiry_data, "Vendor: %s Product: %s Rev: %s %s%s%s\n", - info->vendor, - info->product, + info->vendor, + info->product, info->revision, info->canDuplex ? "Duplex Scanner" : "Simplex Scanner", info->canACE ? " (ACE capable)" : "", info->canCheckADF ? " (ADF Paper Sensor capable)" : ""); - + DBG (5, "autoborder_default=%d\n", info->autoborder_default); DBG (5, "batch_default=%d\n", info->batch_default); DBG (5, "deskew_default=%d\n", info->deskew_default); @@ -534,7 +534,7 @@ read_barcode_data (BH_Scanner *s, FILE *fp) l += (BH_DECODE_FUDGE * 4); /* write the decoded barcode data into the file */ - fprintf(fp, "\n
%s
\n", + fprintf(fp, "\n
%s
\n", print_read_type((int) s->readlist[s->readptr])); fprintf(fp, " %s\n %d\n", print_barcodetype((int) _2btol(buf.barcodetype)), @@ -558,7 +558,7 @@ read_barcode_data (BH_Scanner *s, FILE *fp) buf.barcodedata); } while (num_found <= BH_DECODE_TRIES); - DBG (3, "read_barcode_data: found %d barcodes, returning %s\n", + DBG (3, "read_barcode_data: found %d barcodes, returning %s\n", num_found, sane_strstatus(status)); return status; @@ -581,7 +581,7 @@ read_icon_data (BH_Scanner *s) memset (&buf, 0, sizeof(buf)); status = sanei_scsi_cmd (s->fd, &cmd, sizeof (cmd), &buf, &buf_size); - + /* set the fields in the scanner handle for later reference */ s->iconwidth = _4btol(buf.iconwidth); s->iconlength = _4btol(buf.iconlength); @@ -593,7 +593,7 @@ read_icon_data (BH_Scanner *s) _4btol(buf.iconwidth), _4btol(buf.iconlength), _4btol(buf.iconwidthbytes)); - DBG(3, "read_icon_data: bitordering:%02x, icondatalen:%lu\n", + DBG(3, "read_icon_data: bitordering:%02x, icondatalen:%lu\n", buf.bitordering, _4btol(buf.icondatalen)); @@ -611,7 +611,7 @@ read_barfile (BH_Scanner *s, void *buf, size_t *buf_size) if (s->barf != NULL) { - /* this function needs to set InvalidBytes so it looks + /* this function needs to set InvalidBytes so it looks * like a B&H scsi EOF */ if ((nread = fread(buf, 1, *buf_size, s->barf)) < *buf_size) @@ -802,7 +802,7 @@ mode_select_barcode_param1 (BH_Scanner *s) _lto2b((SANE_Int)_OPT_VAL_WORD_THOUSANDTHS(s, OPT_BARCODE_HMIN), select_cmd.mp.minbarheight); select_cmd.mp.searchcount = _OPT_VAL_WORD(s, OPT_BARCODE_SEARCH_COUNT); - select_cmd.mp.searchmode = + select_cmd.mp.searchmode = get_barcode_search_mode(_OPT_VAL_STRING(s, OPT_BARCODE_SEARCH_MODE)); _lto2b(_OPT_VAL_WORD(s, OPT_BARCODE_SEARCH_TIMEOUT), select_cmd.mp.searchtimeout); @@ -832,10 +832,10 @@ mode_select_barcode_param2 (BH_Scanner *s) select_cmd.cmd[4] = sizeof(select_cmd.mp); len = sizeof(select_cmd.mp); - status = sanei_scsi_cmd (s->fd, &select_cmd.cmd, sizeof (select_cmd.cmd), + status = sanei_scsi_cmd (s->fd, &select_cmd.cmd, sizeof (select_cmd.cmd), &select_cmd.mp, &len); - if (status == SANE_STATUS_GOOD) + if (status == SANE_STATUS_GOOD) { DBG(8, "mode_select_barcode_param2: sensed values: relmax:%d barmin:%d barmax:%d\n", (int) _2btol(select_cmd.mp.relmax), @@ -906,10 +906,10 @@ mode_select_barcode_param3 (BH_Scanner *s) select_cmd.cmd[4] = sizeof(select_cmd.mp); len = sizeof(select_cmd.mp); - status = sanei_scsi_cmd (s->fd, &select_cmd.cmd, sizeof (select_cmd.cmd), + status = sanei_scsi_cmd (s->fd, &select_cmd.cmd, sizeof (select_cmd.cmd), &select_cmd.mp, &len); - if (status == SANE_STATUS_GOOD) + if (status == SANE_STATUS_GOOD) { DBG(8, "mode_select_barcode_param3: sensed values: contrast:%d patchmode:%d\n", (int) _2btol(select_cmd.mp.barcodecontrast), @@ -992,10 +992,10 @@ set_window (BH_Scanner *s, SANE_Byte batchmode) memset (&set_window_cmd, 0, sizeof (set_window_cmd)); set_window_cmd.cmd[0] = BH_SCSI_SET_WINDOW; - DBG(3, "set_window: sizeof(hdr) %d, sizeof(window): %d\n", + DBG(3, "set_window: sizeof(hdr) %d, sizeof(window): %d\n", (int)sizeof(set_window_cmd.hdr), (int)sizeof(set_window_cmd.window)); - _lto3b(sizeof(set_window_cmd.hdr) + sizeof(set_window_cmd.window), + _lto3b(sizeof(set_window_cmd.hdr) + sizeof(set_window_cmd.window), &set_window_cmd.cmd[6]); _lto2b(256, &set_window_cmd.hdr[6]); @@ -1008,9 +1008,9 @@ set_window (BH_Scanner *s, SANE_Byte batchmode) _lto4b((int) _OPT_VAL_WORD_THOUSANDTHS(s, OPT_TL_X), set_window_cmd.window.ulx); _lto4b((int) _OPT_VAL_WORD_THOUSANDTHS(s, OPT_TL_Y), set_window_cmd.window.uly); - width = (SANE_Int) (_OPT_VAL_WORD_THOUSANDTHS(s, OPT_BR_X) - + width = (SANE_Int) (_OPT_VAL_WORD_THOUSANDTHS(s, OPT_BR_X) - _OPT_VAL_WORD_THOUSANDTHS(s, OPT_TL_X)); - length = (SANE_Int) (_OPT_VAL_WORD_THOUSANDTHS(s, OPT_BR_Y) - + length = (SANE_Int) (_OPT_VAL_WORD_THOUSANDTHS(s, OPT_BR_Y) - _OPT_VAL_WORD_THOUSANDTHS(s, OPT_TL_Y)); _lto4b(width, set_window_cmd.window.windowwidth); @@ -1023,16 +1023,16 @@ set_window (BH_Scanner *s, SANE_Byte batchmode) /*!!! contrast (not used) */ /*!!! set_window_cmd.window.contrast = _OPT_VAL_WORD(s, OPT_CONTRAST); */ /* imagecomposition 0x00 lineart, 0x01 dithered/halftone, 0x02 grayscale*/ - set_window_cmd.window.imagecomposition = + set_window_cmd.window.imagecomposition = get_scan_mode_id(_OPT_VAL_STRING(s, OPT_SCAN_MODE)); - + set_window_cmd.window.bitsperpixel = 0x01; /*!!! halftone code (not used) */ /*!!! halftone id (not used) */ set_window_cmd.window.paddingtype = 0x03; /* truncate byte */ if (_OPT_VAL_WORD(s, OPT_NEGATIVE) == SANE_TRUE) { - /* reverse image format (valid when bitsperpixel=1) + /* reverse image format (valid when bitsperpixel=1) * 0x00 normal, 0x01 reversed. This is bit 7 of paddingtype. */ set_window_cmd.window.paddingtype |= 0x80; @@ -1134,7 +1134,7 @@ get_window (BH_Scanner *s, SANE_Int *w, SANE_Int *h, SANE_Bool backpage) autoborder = _OPT_VAL_WORD(s, OPT_AUTOBORDER) == 1; - while (1) + while (1) { i++; memset (&cmd, 0, sizeof (cmd)); @@ -1148,7 +1148,7 @@ get_window (BH_Scanner *s, SANE_Int *w, SANE_Int *h, SANE_Bool backpage) get_window_data.window.windowid = (backpage == SANE_TRUE) ? 1 : 0; len = sizeof(get_window_data); - status = sanei_scsi_cmd (s->fd, &cmd, sizeof (cmd), + status = sanei_scsi_cmd (s->fd, &cmd, sizeof (cmd), &get_window_data, &len); if (status == SANE_STATUS_GOOD) { @@ -1198,9 +1198,9 @@ get_parameters (SANE_Handle handle, SANE_Parameters *params) SANE_Frame format; DBG(3, "get_parameters called\n"); - + memset (&s->params, 0, sizeof (s->params)); - + res = _OPT_VAL_WORD(s, OPT_RESOLUTION); /* make best-effort guess at what parameters will look like once @@ -1242,7 +1242,7 @@ get_parameters (SANE_Handle handle, SANE_Parameters *params) /* update parameters based on the current item */ status = SANE_STATUS_GOOD; - if (itemtype == BH_SCSI_READ_TYPE_FRONT) + if (itemtype == BH_SCSI_READ_TYPE_FRONT) { DBG (3, "get_parameters: sending GET WINDOW (front)\n"); status = get_window (s, &w, &l, SANE_FALSE); @@ -1293,7 +1293,7 @@ get_parameters (SANE_Handle handle, SANE_Parameters *params) length = s->sections[sectnum - 1].length * res / 1000.0; } else if ( (itemtype >= BH_SCSI_READ_TYPE_BACK_BARCODE && - itemtype <= (BH_SCSI_READ_TYPE_BACK_BARCODE + NUM_SECTIONS)) || + itemtype <= (BH_SCSI_READ_TYPE_BACK_BARCODE + NUM_SECTIONS)) || (itemtype >= BH_SCSI_READ_TYPE_FRONT_BARCODE && itemtype <= (BH_SCSI_READ_TYPE_FRONT_BARCODE + NUM_SECTIONS)) ) { @@ -1331,7 +1331,7 @@ get_parameters (SANE_Handle handle, SANE_Parameters *params) res, width, length); return SANE_STATUS_INVAL; } - + /* we disable our compression/barcode formats in preview as well * as with the disable_optional_frames configuration option. NOTE: * we may still be delivering 'wierd' data and lying about it being _GRAY! @@ -1357,11 +1357,11 @@ get_parameters (SANE_Handle handle, SANE_Parameters *params) *params = s->params; DBG (1, "get_parameters: format=%d, pixels/line=%d, bytes/line=%d, " - "lines=%d, dpi=%d\n", - (int) s->params.format, - s->params.pixels_per_line, + "lines=%d, dpi=%d\n", + (int) s->params.format, + s->params.pixels_per_line, s->params.bytes_per_line, - s->params.lines, + s->params.lines, res); return SANE_STATUS_GOOD; @@ -1404,7 +1404,7 @@ section_parse(const char *val, BH_Section *sect, SANE_Int res, SANE_Int comp) if (y) f = strtok(NULL, seps); if (!x || !y || !w || !l) break; - mm = strtod(x, &ep); + mm = strtod(x, &ep); if (*ep != '\0' || errno == ERANGE || mm < 0.0) break; sect->left = mm * 1000.0 / MM_PER_INCH; @@ -1482,10 +1482,10 @@ section_parse(const char *val, BH_Section *sect, SANE_Int res, SANE_Int comp) DBG(3, "section_parse: converted '%s' (mm) to " "%ldx%ld+%ld+%ld (thousandths) " - "flags=%02x compression=[%d,%d] frame=%s\n", - val, + "flags=%02x compression=[%d,%d] frame=%s\n", + val, sect->width, sect->length, sect->left, sect->top, - sect->flags, + sect->flags, sect->compressiontype, sect->compressionarg, sane_strframe(sect->format)); @@ -1515,20 +1515,20 @@ setup_sections (BH_Scanner *s, const char *val) strcpy(buf, val); section = strtok(buf, ","); - while (section != NULL && sectnum < NUM_SECTIONS) + while (section != NULL && sectnum < NUM_SECTIONS) { - if (!allblank(section)) + if (!allblank(section)) { SANE_Int res = _OPT_VAL_WORD(s, OPT_RESOLUTION); - SANE_Int format = + SANE_Int format = get_compression_id(_OPT_VAL_STRING(s, OPT_COMPRESSION)); - status = section_parse(section, &s->sections[sectnum], + status = section_parse(section, &s->sections[sectnum], res, format); if (status != SANE_STATUS_GOOD) { - DBG(1, - "setup_sections: error parsing section `%s'\n", + DBG(1, + "setup_sections: error parsing section `%s'\n", section); break; } @@ -1562,12 +1562,12 @@ start_setup (BH_Scanner *s) status = setup_sections(s, _OPT_VAL_STRING(s, OPT_SECTION)); if (status != SANE_STATUS_GOOD) { - DBG(1, "start_setup: setup_sections failed: %s\n", + DBG(1, "start_setup: setup_sections failed: %s\n", sane_strstatus(status)); return status; } - /* see whether we'll be decoding barcodes and + /* see whether we'll be decoding barcodes and * set the barcodes flag appropriately */ if (s->search_bars[0] == 0) @@ -1655,10 +1655,10 @@ start_setup (BH_Scanner *s) SANE_Word flags = s->sections[i].flags; if (flags & BH_SECTION_FRONT_BAR) - s->readlist[s->readcnt++] = + s->readlist[s->readcnt++] = BH_SCSI_READ_TYPE_FRONT_BARCODE + i + 1; if (flags & BH_SECTION_BACK_BAR) - s->readlist[s->readcnt++] = + s->readlist[s->readcnt++] = BH_SCSI_READ_TYPE_BACK_BARCODE + i + 1; } } @@ -1687,10 +1687,10 @@ start_setup (BH_Scanner *s) SANE_Word flags = s->sections[i].flags; if (flags & BH_SECTION_FRONT_PATCH) - s->readlist[s->readcnt++] = + s->readlist[s->readcnt++] = BH_SCSI_READ_TYPE_FRONT_PATCHCODE + i + 1; if (flags & BH_SECTION_BACK_PATCH) - s->readlist[s->readcnt++] = + s->readlist[s->readcnt++] = BH_SCSI_READ_TYPE_BACK_PATCHCODE + i + 1; } } @@ -1707,7 +1707,7 @@ start_setup (BH_Scanner *s) if (_OPT_VAL_WORD(s, OPT_BATCH) == SANE_TRUE) { - /* if batchmode is enabled, then call set_window to + /* if batchmode is enabled, then call set_window to * abort the batch (even though there might not (and probably * isn't) a batch in progress). This avoids a batch start error * in the case where a previous batch was not aborted. @@ -1716,7 +1716,7 @@ start_setup (BH_Scanner *s) set_window(s, BH_BATCH_ABORT); batchmode = BH_BATCH_ENABLE; - } + } else { batchmode = BH_BATCH_DISABLE; @@ -1750,7 +1750,7 @@ start_setup (BH_Scanner *s) status = set_window(s, batchmode); if (status != SANE_STATUS_GOOD) { - DBG(1, "start_setup: SET WINDOW failed: %s\n", + DBG(1, "start_setup: SET WINDOW failed: %s\n", sane_strstatus(status)); return status; } @@ -1759,7 +1759,7 @@ start_setup (BH_Scanner *s) status = mode_select_timeout(s); if (status != SANE_STATUS_GOOD) { - DBG(1, "start_setup: mode_select_timeout failed: %s\n", + DBG(1, "start_setup: mode_select_timeout failed: %s\n", sane_strstatus(status)); return status; } @@ -1770,7 +1770,7 @@ start_setup (BH_Scanner *s) status = mode_select_icon(s); if (status != SANE_STATUS_GOOD) { - DBG(1, "start_setup: mode_select_icon failed: %s\n", + DBG(1, "start_setup: mode_select_icon failed: %s\n", sane_strstatus(status)); return status; } @@ -1782,7 +1782,7 @@ start_setup (BH_Scanner *s) status = mode_select_barcode_priority(s); if (status != SANE_STATUS_GOOD) { - DBG(1, "start_setup: mode_select_barcode_priority failed: %s\n", + DBG(1, "start_setup: mode_select_barcode_priority failed: %s\n", sane_strstatus(status)); return status; } @@ -1791,7 +1791,7 @@ start_setup (BH_Scanner *s) status = mode_select_barcode_param1(s); if (status != SANE_STATUS_GOOD) { - DBG(1, "start_setup: mode_select_barcode_param1 failed: %s\n", + DBG(1, "start_setup: mode_select_barcode_param1 failed: %s\n", sane_strstatus(status)); return status; } @@ -1800,7 +1800,7 @@ start_setup (BH_Scanner *s) status = mode_select_barcode_param2(s); if (status != SANE_STATUS_GOOD) { - DBG(1, "start_setup: mode_select_barcode_param2 failed: %s\n", + DBG(1, "start_setup: mode_select_barcode_param2 failed: %s\n", sane_strstatus(status)); return status; } @@ -1809,7 +1809,7 @@ start_setup (BH_Scanner *s) status = mode_select_barcode_param3(s); if (status != SANE_STATUS_GOOD) { - DBG(1, "start_setup: mode_select_barcode_param3 failed: %s\n", + DBG(1, "start_setup: mode_select_barcode_param3 failed: %s\n", sane_strstatus(status)); return status; } @@ -1829,13 +1829,13 @@ start_scan (BH_Scanner *s) /* SANE front ends will call this function between 'FRAMES'. * A single scan on the B&H may result in up to 56 different * things to read (20 are SANE image frames, 36 are non-SANE - * data - decoded bar/patch codes). + * data - decoded bar/patch codes). */ if (s->readcnt > 1 && s->scanning == SANE_TRUE) { DBG(3, "start_scan: any more items in the readlist?\n"); - /* we've been reading data from this scan, so we just + /* we've been reading data from this scan, so we just * move on to the next item in the readlist without * starting a new scan. */ @@ -1850,7 +1850,7 @@ start_scan (BH_Scanner *s) itemtype = s->readlist[s->readptr]; DBG(3, "start_scan: advance readlist(%d, %d)\n", - s->readptr, + s->readptr, (int) itemtype); /* 'dance' by the non-SANE data streams @@ -1869,12 +1869,12 @@ start_scan (BH_Scanner *s) { fprintf(fp, "\n"); - for (; - s->readptr < s->readcnt && - status == SANE_STATUS_GOOD; + for (; + s->readptr < s->readcnt && + status == SANE_STATUS_GOOD; s->readptr++) { - if (s->readlist[s->readptr] == + if (s->readlist[s->readptr] == BH_SCSI_READ_TYPE_SENDBARFILE) { break; } @@ -1888,14 +1888,14 @@ start_scan (BH_Scanner *s) fclose(fp); if ((s->barf = fopen(s->barfname, "r")) == NULL) { - DBG(1, "sane_start: error opening barfile `%s'\n", + DBG(1, "sane_start: error opening barfile `%s'\n", s->barfname); status = SANE_STATUS_IO_ERROR; } } else { - DBG(1, "sane_start: error opening barfile `%s'\n", + DBG(1, "sane_start: error opening barfile `%s'\n", s->barfname); status = SANE_STATUS_IO_ERROR; } @@ -1905,7 +1905,7 @@ start_scan (BH_Scanner *s) { /* read the icon header setting the iconwidth and iconlength * to the actual values so get_parameters will have them. - * Subsequent calls to sane_read will get pure image data + * Subsequent calls to sane_read will get pure image data * since the icon header has been consumed. */ @@ -1922,7 +1922,7 @@ start_scan (BH_Scanner *s) return status; } - /* if we reach here, we're finished with the readlist and + /* if we reach here, we're finished with the readlist and * will drop through to start a new scan */ } @@ -1990,7 +1990,7 @@ sense_handler (int scsi_fd, u_char *result, void *arg) EOM = (result[2] & 0x40) != 0; /* End Of Media */ ILI = (result[2] & 0x20) != 0; /* Invalid Length Indicator */ InvalidBytes = ValidData ? _4btol(&result[3]) : 0; - + DBG(3, "sense_handler: result=%x, sense=%x, asc=%x, ascq=%x\n", result[0], sense, asc, ascq); DBG(3, "sense_handler: ErrorCode %02x ValidData: %d " @@ -2010,8 +2010,8 @@ sense_handler (int scsi_fd, u_char *result, void *arg) return SANE_STATUS_IO_ERROR; /* error code is invalid */ } - /* handle each sense key; - * RSC supports 0x00, 0x02, 0x03, 0x04, 0x05, 0x06, 0x0B + /* handle each sense key; + * RSC supports 0x00, 0x02, 0x03, 0x04, 0x05, 0x06, 0x0B */ switch (sense) { @@ -2303,7 +2303,7 @@ sense_handler (int scsi_fd, u_char *result, void *arg) break; } - DBG(3, "sense_handler: '%s' '%s' return:%d\n", + DBG(3, "sense_handler: '%s' '%s' return:%d\n", sense_str, as_str, status); return status; @@ -2712,7 +2712,7 @@ init_options (BH_Scanner * s) s->opt[OPT_BARCODE_SEARCH_BAR].constraint.string_list = barcode_search_bar_list; s->opt[OPT_BARCODE_SEARCH_BAR].size = max_string_size (barcode_search_bar_list); s->val[OPT_BARCODE_SEARCH_BAR].s = strdup (barcode_search_bar_list[0]); - + /* Barcode search count (1-7, default 1). */ s->opt[OPT_BARCODE_SEARCH_COUNT].name = SANE_NAME_BARCODE_SEARCH_COUNT; s->opt[OPT_BARCODE_SEARCH_COUNT].title = SANE_TITLE_BARCODE_SEARCH_COUNT; @@ -2762,7 +2762,7 @@ init_options (BH_Scanner * s) s->opt[OPT_SECTION].constraint_type = SANE_CONSTRAINT_NONE; s->opt[OPT_SECTION].size = 255; s->val[OPT_SECTION].s = strdup (""); - + /* Barcode_Relmax */ s->opt[OPT_BARCODE_RELMAX].name = SANE_NAME_BARCODE_RELMAX; s->opt[OPT_BARCODE_RELMAX].title = SANE_TITLE_BARCODE_RELMAX; @@ -2907,7 +2907,7 @@ attach (const char *devnam, BH_Device ** devp) BH_INQUIRY_STANDARD_PAGE_CODE); if (status != SANE_STATUS_GOOD) { - DBG (1, "attach: inquiry (standard data) failed: %s\n", + DBG (1, "attach: inquiry (standard data) failed: %s\n", sane_strstatus (status)); sanei_scsi_close (fd); return status; @@ -2922,7 +2922,7 @@ attach (const char *devnam, BH_Device ** devp) || strncmp ((char *)ibuf.vendor, "B&H SCSI", 8) != 0 || strncmp ((char *)ibuf.product, "COPISCAN ", 9) != 0) { - DBG (1, + DBG (1, "attach: device is not a recognized Bell and Howell scanner\n"); sanei_scsi_close (fd); return SANE_STATUS_INVAL; @@ -2931,11 +2931,11 @@ attach (const char *devnam, BH_Device ** devp) DBG (3, "attach: sending INQUIRY (vpd data)\n"); memset (&vbuf, 0, sizeof (vbuf)); buf_size = sizeof(vbuf); - status = inquiry (fd, &vbuf, &buf_size, 1, + status = inquiry (fd, &vbuf, &buf_size, 1, BH_INQUIRY_VPD_PAGE_CODE); if (status != SANE_STATUS_GOOD) { - DBG (1, "attach: inquiry (vpd data) failed: %s\n", + DBG (1, "attach: inquiry (vpd data) failed: %s\n", sane_strstatus (status)); sanei_scsi_close (fd); return status; @@ -2944,7 +2944,7 @@ attach (const char *devnam, BH_Device ** devp) DBG (3, "attach: sending INQUIRY (jis data)\n"); memset (&jbuf, 0, sizeof (jbuf)); buf_size = sizeof(jbuf); - status = inquiry (fd, &jbuf, &buf_size, 1, + status = inquiry (fd, &jbuf, &buf_size, 1, BH_INQUIRY_JIS_PAGE_CODE); if (status != SANE_STATUS_GOOD) { @@ -3044,7 +3044,7 @@ attach (const char *devnam, BH_Device ** devp) if (jbuf.standardres[1] & 0x04) appendStdList(&dev->info, 600); if (jbuf.standardres[1] & 0x02) appendStdList(&dev->info, 800); if (jbuf.standardres[1] & 0x01) appendStdList(&dev->info, 1200); - if (dev->info.resStdList[0] == 0) + if (dev->info.resStdList[0] == 0) { /* make a default standard resolutions for 200 and 300dpi */ DBG(1, "attach: no standard resolutions reported\n"); @@ -3053,29 +3053,29 @@ attach (const char *devnam, BH_Device ** devp) dev->info.resStdList[2] = 300; dev->info.resBasicX = dev->info.resBasicY = 300; } - + dev->info.winWidth = _4btol(jbuf.windowwidth); dev->info.winHeight = _4btol(jbuf.windowlength); - if (dev->info.winWidth <= 0) + if (dev->info.winWidth <= 0) { dev->info.winWidth = (SANE_Int) (dev->info.resBasicX * 8.5); DBG(1, "attach: invalid window width reported, using %d\n", dev->info.winWidth); } - if (dev->info.winHeight <= 0) + if (dev->info.winHeight <= 0) { dev->info.winHeight = dev->info.resBasicY * 14; DBG(1, "attach: invalid window height reported, using %d\n", dev->info.winHeight); } - mm = (dev->info.resBasicX > 0) ? + mm = (dev->info.resBasicX > 0) ? ((double) dev->info.winWidth / (double) dev->info.resBasicX * MM_PER_INCH) : 0.0; dev->info.x_range.min = SANE_FIX(0.0); dev->info.x_range.max = SANE_FIX(mm); dev->info.x_range.quant = SANE_FIX(0.0); - mm = (dev->info.resBasicY > 0) ? + mm = (dev->info.resBasicY > 0) ? ((double) dev->info.winHeight / (double) dev->info.resBasicY * MM_PER_INCH) : 0.0; dev->info.y_range.min = SANE_FIX(0.0); @@ -3157,35 +3157,35 @@ sane_init (SANE_Int *version_code, SANE_Auth_Callback authorize) if (version_code) *version_code = SANE_VERSION_CODE (SANE_CURRENT_MAJOR, V_MINOR, BUILD); - + fp = sanei_config_open(BH_CONFIG_FILE); if (fp) { char line[PATH_MAX]; const char *lp; size_t len; - + /* read config file */ while (sanei_config_read (line, sizeof (line), fp)) { if (line[0] == '#') /* ignore line comments */ continue; len = strlen (line); - + if (!len) continue; /* ignore empty lines */ - + lp = sanei_config_skip_whitespace (line); - DBG(16, + DBG(16, "sane_init: processing config file line '%s'\n", line); - if (strncmp(lp, "option", 6) == 0 && + if (strncmp(lp, "option", 6) == 0 && (isspace (lp[6]) || lp[6] == '\0')) { lp += 6; lp = sanei_config_skip_whitespace (lp); - + if (strncmp(lp, "disable-optional-frames", 23) == 0) { DBG(1, "sane_init: configuration option " @@ -3205,15 +3205,15 @@ sane_init (SANE_Int *version_code, SANE_Auth_Callback authorize) lp); } } - else + else { - DBG(16, + DBG(16, "sane_init: found a device: line '%s'\n", lp); strncpy (devnam, lp, sizeof(devnam)); devnam[sizeof(devnam)-1] = '\0'; - - sanei_config_attach_matching_devices(devnam, + + sanei_config_attach_matching_devices(devnam, attach_one); } } @@ -3228,7 +3228,7 @@ sane_init (SANE_Int *version_code, SANE_Auth_Callback authorize) return SANE_STATUS_GOOD; } -SANE_Status +SANE_Status sane_get_devices (const SANE_Device ***device_list, SANE_Bool local) { BH_Device *dev; @@ -3259,7 +3259,7 @@ sane_open (SANE_String_Const devnam, SANE_Handle *handle) BH_Device *dev; BH_Scanner *s; DBG(3, "sane_open called\n"); - + if (devnam[0] != '\0') { for (dev = first_dev; dev; dev = dev->next) @@ -3279,7 +3279,7 @@ sane_open (SANE_String_Const devnam, SANE_Handle *handle) { dev = first_dev; } - + if (!dev) return SANE_STATUS_INVAL; @@ -3432,22 +3432,22 @@ sane_control_option (SANE_Handle handle, SANE_Int option, SANE_Action action, { case SANE_TYPE_BOOL: case SANE_TYPE_INT: - DBG(16, "sane_control_option: set_value %s [#%d] to %d\n", + DBG(16, "sane_control_option: set_value %s [#%d] to %d\n", name, option, *(SANE_Word *) val); break; - + case SANE_TYPE_FIXED: - DBG(16, "sane_control_option: set_value %s [#%d] to %f\n", + DBG(16, "sane_control_option: set_value %s [#%d] to %f\n", name, option, SANE_UNFIX(*(SANE_Word *) val)); break; - + case SANE_TYPE_STRING: - DBG(16, "sane_control_option: set_value %s [#%d] to %s\n", + DBG(16, "sane_control_option: set_value %s [#%d] to %s\n", name, option, (char *) val); break; - + default: - DBG(16, "sane_control_option: set_value %s [#%d]\n", + DBG(16, "sane_control_option: set_value %s [#%d]\n", name, option); } @@ -3504,7 +3504,7 @@ sane_control_option (SANE_Handle handle, SANE_Int option, SANE_Action action, case OPT_NUM_OPTS: s->val[option].w = *(SANE_Word *) val; return SANE_STATUS_GOOD; - + /* string options */ case OPT_BARCODE_SEARCH_BAR: /*!!! we're supporting only a single barcode type via the option */ @@ -3584,7 +3584,7 @@ sane_control_option (SANE_Handle handle, SANE_Int option, SANE_Action action, if (info) *info |= SANE_INFO_RELOAD_OPTIONS; if (get_scan_mode_id((SANE_String) val) != 0) { - /* scan mode is not lineart, disable compression + /* scan mode is not lineart, disable compression * and set compression to 'none' */ s->opt[OPT_COMPRESSION].cap |= SANE_CAP_INACTIVE; @@ -3622,9 +3622,9 @@ sane_control_option (SANE_Handle handle, SANE_Int option, SANE_Action action, x_max = SANE_UNFIX(s->hw->info.x_range.max); y_max = SANE_UNFIX(s->hw->info.y_range.max); /* a dimension of 0.0 (or less) is replaced with the max value */ - x = (paper_sizes[paper_id].width <= 0.0) ? x_max : + x = (paper_sizes[paper_id].width <= 0.0) ? x_max : paper_sizes[paper_id].width; - y = (paper_sizes[paper_id].length <= 0.0) ? y_max : + y = (paper_sizes[paper_id].length <= 0.0) ? y_max : paper_sizes[paper_id].length; if (info) *info |= SANE_INFO_RELOAD_PARAMS | SANE_INFO_RELOAD_OPTIONS; @@ -3644,8 +3644,8 @@ sane_control_option (SANE_Handle handle, SANE_Int option, SANE_Action action, left = 0.0; } - s->val[OPT_TL_X].w = SANE_FIX(left); - s->val[OPT_TL_Y].w = SANE_FIX(0.0); + s->val[OPT_TL_X].w = SANE_FIX(left); + s->val[OPT_TL_Y].w = SANE_FIX(0.0); s->val[OPT_BR_X].w = SANE_FIX(MIN(x + left, x_max)); s->val[OPT_BR_Y].w = SANE_FIX(MIN(y, y_max)); } @@ -3670,7 +3670,7 @@ sane_get_parameters (SANE_Handle handle, SANE_Parameters *params) SANE_Int status = SANE_STATUS_GOOD; DBG(3, "sane_get_parameters called\n"); - + if (params) { SANE_Int res; @@ -3686,11 +3686,11 @@ sane_get_parameters (SANE_Handle handle, SANE_Parameters *params) res = _OPT_VAL_WORD(s, OPT_RESOLUTION); DBG (1, "get_parameters: format=%d, pixels/line=%d, bytes/line=%d, " - "lines=%d, dpi=%d\n", - (int) s->params.format, - s->params.pixels_per_line, + "lines=%d, dpi=%d\n", + (int) s->params.format, + s->params.pixels_per_line, s->params.bytes_per_line, - s->params.lines, + s->params.lines, res); } @@ -3718,7 +3718,7 @@ sane_start (SANE_Handle handle) } /* Do the setup once per 'batch'. The SANE standard requires the - * frontend to call sane_cancel once all desired frames have been + * frontend to call sane_cancel once all desired frames have been * acquired. That is when scanning is set back to SANE_FALSE and * the 'batch' is considered done. */ @@ -3739,7 +3739,7 @@ sane_start (SANE_Handle handle) return status; } - return SANE_STATUS_GOOD; + return SANE_STATUS_GOOD; } SANE_Status @@ -3795,13 +3795,13 @@ sane_set_io_mode (SANE_Handle handle, SANE_Bool non_blocking) DBG(3, "sane_set_io_mode called: non_blocking=%d\n", non_blocking); #ifdef NONBLOCKSUPPORTED - if (s->fd < 0) - { - return SANE_STATUS_INVAL; + if (s->fd < 0) + { + return SANE_STATUS_INVAL; } if (fcntl (s->fd, F_SETFL, non_blocking ? O_NONBLOCK : 0) < 0) - { + { DBG(1, "sane_set_io_mode: error setting io mode\n"); return SANE_STATUS_IO_ERROR; } @@ -3823,8 +3823,8 @@ sane_get_select_fd (SANE_Handle handle, SANE_Int *fd) #ifdef NONBLOCKSUPPORTED if (s->fd < 0) - { - return SANE_STATUS_INVAL; + { + return SANE_STATUS_INVAL; } *fd = s->fd; @@ -3842,14 +3842,14 @@ sane_cancel (SANE_Handle handle) DBG(3, "sane_cancel called\n"); if (s->scanning) { - /* if batchmode is enabled, then call set_window to + /* if batchmode is enabled, then call set_window to * abort the batch */ if (_OPT_VAL_WORD(s, OPT_BATCH) == SANE_TRUE) { DBG(5, "sane_cancel: calling set_window to abort batch\n"); set_window(s, BH_BATCH_ABORT); - } + } } s->scanning = SANE_FALSE; s->cancelled = SANE_TRUE; @@ -3878,7 +3878,7 @@ sane_exit (void) next = dev->next; free (dev); } - + if (devlist) free (devlist); } diff --git a/backend/bh.h b/backend/bh.h index 545ffb122..fcd833abf 100644 --- a/backend/bh.h +++ b/backend/bh.h @@ -73,16 +73,16 @@ #define BH_SECTION_FRONT_PATCH (1 << 4) #define BH_SECTION_BACK_PATCH (1 << 5) -typedef enum -{ - BH_UNIT_INCH, - BH_UNIT_MM, +typedef enum +{ + BH_UNIT_INCH, + BH_UNIT_MM, BH_UNIT_POINT } bh_measureUnit; typedef enum { - BH_COMP_NONE, + BH_COMP_NONE, BH_COMP_G31D, BH_COMP_G32D, BH_COMP_G42D @@ -90,13 +90,13 @@ typedef enum typedef enum { - BH_ROTATION_0, + BH_ROTATION_0, BH_ROTATION_90, BH_ROTATION_180, BH_ROTATION_270 } bh_rotation; -typedef enum +typedef enum { OPT_NUM_OPTS = 0, @@ -171,30 +171,30 @@ typedef enum OPT_BARCODE_SEARCH_BAR, /* Barcode search count (1-7, default 3). */ OPT_BARCODE_SEARCH_COUNT, - /* Barcode search mode. - * (1 = horizontal,2 = vertical, 6 = v then h, 9 = h then v). + /* Barcode search mode. + * (1 = horizontal,2 = vertical, 6 = v then h, 9 = h then v). */ OPT_BARCODE_SEARCH_MODE, /* Patch code min height (def=127 (5mm)) */ - OPT_BARCODE_HMIN, - /* Barcode search timeout in ms - * (20-65535,default is disabled). + OPT_BARCODE_HMIN, + /* Barcode search timeout in ms + * (20-65535,default is disabled). */ OPT_BARCODE_SEARCH_TIMEOUT, /* Specify image sections and functions */ OPT_SECTION, - /* Specifies the maximum relation from the widest to - * the smallest bar + /* Specifies the maximum relation from the widest to + * the smallest bar */ OPT_BARCODE_RELMAX, /* Specifies the minimum number of bars in Bar/Patch code */ OPT_BARCODE_BARMIN, /* Specifies the maximum number of bars in a Bar/Patch code */ OPT_BARCODE_BARMAX, - /* Specifies the image contrast used in decoding. - * Use higher values when there are more white pixels - * in the code + /* Specifies the image contrast used in decoding. + * Use higher values when there are more white pixels + * in the code */ OPT_BARCODE_CONTRAST, /* Controls Patch Code detection. */ @@ -291,8 +291,8 @@ typedef struct _BH_Info SANE_Int resMaxY; /* maximum Y resolution */ SANE_Int resMinX; /* minimum X resolution */ SANE_Int resMinY; /* minimum Y resolution */ - SANE_Int resStdList[16+1]; /* list of available standard resolutions - * (first slot is the length) + SANE_Int resStdList[16+1]; /* list of available standard resolutions + * (first slot is the length) */ SANE_Int winWidth; /* length of window (in BasicX res DPI) */ SANE_Int winHeight; /* height of window (in BasicY res DPI) */ @@ -321,7 +321,7 @@ struct _BH_Scanner /* SCSI filedescriptor */ int fd; - + /* tempfile which is used to send decoded barcode data */ FILE *barf; char barfname[PATH_MAX+1]; @@ -337,7 +337,7 @@ struct _BH_Scanner /* SANE image parameters */ SANE_Parameters params; - + /* state information - not options */ /* Basic Measurement Unit */ @@ -394,9 +394,9 @@ static const SANE_Range barcode_search_timeout_range = static const SANE_Range barcode_hmin_range = { 1, /* minimum */ - 1660, /* maximum (when converted from mm - * to thousandths will still be less - * than 65536) + 1660, /* maximum (when converted from mm + * to thousandths will still be less + * than 65536) */ 0 /* quantization */ }; @@ -915,7 +915,7 @@ struct mode_page_03 { SANE_Byte mediumtype; SANE_Byte devicespecificparam; SANE_Byte blockdescriptorlen; - + SANE_Byte pagecode; SANE_Byte paramlen; SANE_Byte bmu; diff --git a/backend/canon-sane.c b/backend/canon-sane.c index a8efc7a6a..5d9ec9948 100644 --- a/backend/canon-sane.c +++ b/backend/canon-sane.c @@ -1126,7 +1126,7 @@ sane_start (SANE_Handle handle) if (thistmpfile != NULL) { if (mktemp(thistmpfile) == 0) - { + { DBG(1, "mktemp(thistmpfile) is failed\n"); return (SANE_STATUS_INVAL); } diff --git a/backend/canon-scsi.c b/backend/canon-scsi.c index a83e5186a..0bddf5170 100644 --- a/backend/canon-scsi.c +++ b/backend/canon-scsi.c @@ -623,7 +623,7 @@ wait_ready(int fd) while ((status = test_unit_ready (fd)) != SANE_STATUS_GOOD) { DBG(5, "wait_ready failed (%d)\n", retry); - if (retry++ > 15) + if (retry++ > 15) return SANE_STATUS_IO_ERROR; sleep(3); } diff --git a/backend/canon.c b/backend/canon.c index 168b2d6d9..047e9d9cb 100644 --- a/backend/canon.c +++ b/backend/canon.c @@ -62,7 +62,7 @@ . . - sane_get_parameters() : returns actual scan-parameters . . - sane_read() : read image-data (from pipe) . . - sane_cancel() : cancel operation, kill reader_process - + . - sane_close() : close opened scanner-device, do_cancel, free buffer and handle - sane_exit() : terminate use of backend, free devicename and device-struture */ @@ -140,7 +140,7 @@ static const SANE_String_Const mode_list[] = { SANE_VALUE_SCAN_MODE_HALFTONE, SANE_VALUE_SCAN_MODE_GRAY, SANE_VALUE_SCAN_MODE_COLOR, - 0 + 0 }; /* modification for FS2710 */ diff --git a/backend/canon630u-common.c b/backend/canon630u-common.c index a46424aca..27c34ff2d 100644 --- a/backend/canon630u-common.c +++ b/backend/canon630u-common.c @@ -35,15 +35,15 @@ 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. + If you do not wish that, delete this exception notice. */ /* Communication, calibration, and scanning with the Canon CanoScan FB630U flatbed scanner under linux. - + Reworked into SANE-compatible format. - + The usb-parallel port interface chip is GL640usb, on the far side of which is an LM9830 parallel-port scanner-on-a-chip. @@ -153,7 +153,7 @@ gl640ReadReq (int fd, GL640_Request req, byte * data) } -/* Write USB bulk data +/* Write USB bulk data setup is an apparently scanner-specific sequence: {(0=read, 1=write), 0x00, 0x00, 0x00, sizelo, sizehi, 0x00, 0x00} hp3400: setup[1] = 0x01 @@ -177,7 +177,7 @@ gl640WriteBulk (int fd, byte * setup, byte * data, size_t size) } -/* Read USB bulk data +/* Read USB bulk data setup is an apparently scanner-specific sequence: {(0=read, 1=write), 0x00, 0x00, 0x00, sizelo, sizehi, 0x00, 0x00} fb630u: setup[2] = 0x80 @@ -461,7 +461,7 @@ typedef struct CANON_Handle #define FLG_GRAY 0x01 /* grayscale */ #define FLG_FORCE_CAL 0x02 /* force calibration */ #define FLG_BUF 0x04 /* save scan to buffer instead of file */ -#define FLG_NO_INTERLEAVE 0x08 /* don't interleave r,g,b pixels; leave them +#define FLG_NO_INTERLEAVE 0x08 /* don't interleave r,g,b pixels; leave them in row format */ #define FLG_PPM_HEADER 0x10 /* include PPM header in scan file */ } @@ -501,7 +501,7 @@ init (int fd) { byte result, rv; - if (gl640WriteReq (fd, GL640_GPIO_OE, 0x71) != SANE_STATUS_GOOD) { + if (gl640WriteReq (fd, GL640_GPIO_OE, 0x71) != SANE_STATUS_GOOD) { DBG(1, "Initial write request failed.\n"); return -1; } @@ -653,7 +653,7 @@ do_scan (CANON_Handle * s) fwrite (redptr + s->width, 1, 1, fp); /* Green */ fwrite (redptr + s->width + s->width, 1, 1, fp); /* Blue */ /* for PPM ascii (P3) - fprintf(fp, "%3d %3d %3d\n", *redptr, + fprintf(fp, "%3d %3d %3d\n", *redptr, *(redptr + s->width), *(redptr + s->width + s->width)); */ @@ -869,8 +869,8 @@ plugin_cal (CANON_Handle * s) write_word (fd, LAMP_B_OFF, 0x0100); /* coming in, we've got 300dpi, data px start : 0x004b - data px end : 0x1437 for a total of 5100(13ec) 600-dpi pixels, - (8.5 inches) or 2550 300-dpi pixels (7653 bytes). + data px end : 0x1437 for a total of 5100(13ec) 600-dpi pixels, + (8.5 inches) or 2550 300-dpi pixels (7653 bytes). Interestingly, the scan head never moves, no matter how many rows are read. */ s->width = 2551; @@ -981,7 +981,7 @@ plugin_cal (CANON_Handle * s) somewhat more complicated than necessary because I don't hard-code the strip widths; I try to figure out the regions based on the scan data. Theoretically, the region-finder should work for any number of distinct - regions (but there are only 2 on this scanner.) + regions (but there are only 2 on this scanner.) This produces the CAL_FILE_OGN file, the final offset/gain table. */ static SANE_Status compute_ogn (char *calfilename) @@ -1132,7 +1132,7 @@ compute_ogn (char *calfilename) continue; } - /* Gain multiplier: + /* Gain multiplier: 255 : 1.5 times brighter 511 : 2 times brighter 1023: 3 times brighter */ @@ -1146,9 +1146,9 @@ compute_ogn (char *calfilename) offset would be bad. */ /* Enhanced offset and gain calculation by M.Reinelt - * These expressions were found by an iterative calibration process, + * These expressions were found by an iterative calibration process, * by changing gain and offset values for every pixel until the desired - * values for black and white were reached, and finding an approximation + * values for black and white were reached, and finding an approximation * formula. * Note that offset is linear, but gain isn't! */ @@ -1256,8 +1256,8 @@ scan (CANON_Handle * opt) read_byte (fd, STATUS, &result); /* wants 2f or 2d */ if (!(result & STATUS_HOME) /*0x2d */ ) return SANE_STATUS_DEVICE_BUSY; - /* or force it to return? - write_byte(fd, COMMAND, 0x02); + /* or force it to return? + write_byte(fd, COMMAND, 0x02); wait_for_return(fd); */ @@ -1439,9 +1439,9 @@ CANON_set_scan_parameters (CANON_Handle * scan, const int left, const int top, const int right, - const int bottom, - const int res, - const int gain, + const int bottom, + const int res, + const int gain, const double gamma) { DBG (2, "CANON_set_scan_parameters:\n"); @@ -1593,12 +1593,12 @@ CANON_start_scan (CANON_Handle * scanner) return SANE_STATUS_IO_ERROR; } if ((rv == 1) - || !check_ogn_file () + || !check_ogn_file () || (scanner->flags & FLG_FORCE_CAL)) { plugin_cal (scanner); wait_for_return (scanner->fd); } - + /* scan */ if ((status = scan (scanner)) != SANE_STATUS_GOOD) { diff --git a/backend/canon630u.c b/backend/canon630u.c index 5c1a71149..c413253aa 100644 --- a/backend/canon630u.c +++ b/backend/canon630u.c @@ -703,7 +703,7 @@ attach_one (const char *name) } -/* +/* Find our devices */ SANE_Status @@ -995,7 +995,7 @@ sane_start (SANE_Handle handle) MM_IN_INCH * 600, SANE_UNFIX (optionBotRightYValue) / MM_IN_INCH * 600, - optionResolutionValue, + optionResolutionValue, optionAGainValue, SANE_UNFIX (optionGammaValue)); diff --git a/backend/canon_dr-cmd.h b/backend/canon_dr-cmd.h index b969c3bab..17d8119aa 100644 --- a/backend/canon_dr-cmd.h +++ b/backend/canon_dr-cmd.h @@ -1,7 +1,7 @@ #ifndef CANON_DR_CMD_H #define CANON_DR_CMD_H -/* +/* * Part of SANE - Scanner Access Now Easy. * Please see opening comments in canon_dr.c */ @@ -571,7 +571,7 @@ putnbyte (unsigned char *pnt, unsigned int value, unsigned int nbytes) /* FIXME: more params here? */ #define set_WD_reserved2(sb, val) sb[0x2a] = val #define get_WD_reserved2(sb) sb[0x2a] - + /* ==================================================================== */ diff --git a/backend/canon_dr.c b/backend/canon_dr.c index 3c058ab25..18eb04e9c 100644 --- a/backend/canon_dr.c +++ b/backend/canon_dr.c @@ -165,7 +165,7 @@ - correct rgb padding macro - skip send_panel and ssm_df commands for DR-20xx scanners v22 2009-03-25, MAN - - add deinterlacing code for DR-2510C in duplex and color + - add deinterlacing code for DR-2510C in duplex and color v23 2009-03-27, MAN - rewrite all image data processing code - handle more image interlacing formats @@ -352,7 +352,7 @@ . . - sane_start() : start image acquisition . . - sane_get_parameters() : returns actual scan parameters . . - sane_read() : read image data (from pipe) - . . (sane_read called multiple times; after sane_read returns EOF, + . . (sane_read called multiple times; after sane_read returns EOF, . . loop may continue with sane_start which may return a 2nd page . . when doing duplex scans, or load the next page from the ADF) . . @@ -392,7 +392,7 @@ - function trace 10 - function detail 15 - get/setopt cmds 20 - - scsi/usb trace 25 + - scsi/usb trace 25 - scsi/usb writes 30 - scsi/usb reads 31 - useless noise 35 @@ -455,7 +455,7 @@ static struct scanner *scanner_devList = NULL; /* * Called by SANE initially. - * + * * From the SANE spec: * This function must be called before any other SANE function can be * called. The behavior of a SANE backend is undefined if this @@ -487,7 +487,7 @@ sane_init (SANE_Int * version_code, SANE_Auth_Callback authorize) /* * Called by SANE to find out about supported devices. - * + * * From the SANE spec: * This function can be used to query the list of devices that are * available. If the function executes successfully, it stores a @@ -500,7 +500,7 @@ sane_init (SANE_Int * version_code, SANE_Auth_Callback authorize) * returned (devices directly attached to the machine that SANE is * running on). If it is false, the device list includes all remote * devices that are accessible to the SANE library. - * + * * SANE does not require that this function is called before a * sane_open() call is performed. A device name may be specified * explicitly by a user which would make it unnecessary and @@ -544,42 +544,42 @@ sane_get_devices (const SANE_Device *** device_list, SANE_Bool local_only) CANON_DR_CONFIG_FILE); while (sanei_config_read (line, PATH_MAX, fp)) { - + lp = line; - + /* ignore comments */ if (*lp == '#') continue; - + /* skip empty lines */ if (*lp == 0) continue; - + if (!strncmp ("option", lp, 6) && isspace (lp[6])) { - + lp += 6; lp = sanei_config_skip_whitespace (lp); - + /* BUFFERSIZE: > 4K */ if (!strncmp (lp, "buffer-size", 11) && isspace (lp[11])) { - + int buf; lp += 11; lp = sanei_config_skip_whitespace (lp); buf = atoi (lp); - + if (buf < 4096) { DBG (5, "sane_get_devices: config option \"buffer-size\" " "(%d) is < 4096, ignoring!\n", buf); continue; } - + if (buf > global_buffer_size_default) { DBG (5, "sane_get_devices: config option \"buffer-size\" " "(%d) is > %d, scanning problems may result\n", buf, global_buffer_size_default); } - + DBG (15, "sane_get_devices: setting \"buffer-size\" to %d\n", buf); @@ -588,24 +588,24 @@ sane_get_devices (const SANE_Device *** device_list, SANE_Bool local_only) /* PADDED READ: we clamp to 0 or 1 */ else if (!strncmp (lp, "padded-read", 11) && isspace (lp[11])) { - + int buf; lp += 11; lp = sanei_config_skip_whitespace (lp); buf = atoi (lp); - + if (buf < 0) { DBG (5, "sane_get_devices: config option \"padded-read\" " "(%d) is < 0, ignoring!\n", buf); continue; } - + if (buf > 1) { DBG (5, "sane_get_devices: config option \"padded-read\" " "(%d) is > 1, ignoring!\n", buf); continue; } - + DBG (15, "sane_get_devices: setting \"padded-read\" to %d\n", buf); @@ -614,24 +614,24 @@ sane_get_devices (const SANE_Device *** device_list, SANE_Bool local_only) /* EXTRA STATUS: we clamp to 0 or 1 */ else if (!strncmp (lp, "extra-status", 12) && isspace (lp[12])) { - + int buf; lp += 12; lp = sanei_config_skip_whitespace (lp); buf = atoi (lp); - + if (buf < 0) { DBG (5, "sane_get_devices: config option \"extra-status\" " "(%d) is < 0, ignoring!\n", buf); continue; } - + if (buf > 1) { DBG (5, "sane_get_devices: config option \"extra-status\" " "(%d) is > 1, ignoring!\n", buf); continue; } - + DBG (15, "sane_get_devices: setting \"extra-status\" to %d\n", buf); @@ -640,18 +640,18 @@ sane_get_devices (const SANE_Device *** device_list, SANE_Bool local_only) /* DUPLEXOFFSET: < 2400 */ else if (!strncmp (lp, "duplex-offset", 13) && isspace (lp[13])) { - + int buf; lp += 13; lp = sanei_config_skip_whitespace (lp); buf = atoi (lp); - + if (buf > 2400) { DBG (5, "sane_get_devices: config option \"duplex-offset\" " "(%d) is > 2400, ignoring!\n", buf); continue; } - + if (buf < 0) { DBG (5, "sane_get_devices: config option \"duplex-offset\" " "(%d) is < 0, ignoring!\n", buf); @@ -671,7 +671,7 @@ sane_get_devices (const SANE_Device *** device_list, SANE_Bool local_only) lp = sanei_config_skip_whitespace (lp); strncpy(global_vendor_name, lp, 8); global_vendor_name[8] = 0; - + DBG (15, "sane_get_devices: setting \"vendor-name\" to %s\n", global_vendor_name); } @@ -683,7 +683,7 @@ sane_get_devices (const SANE_Device *** device_list, SANE_Bool local_only) lp = sanei_config_skip_whitespace (lp); strncpy(global_model_name, lp, 16); global_model_name[16] = 0; - + DBG (15, "sane_get_devices: setting \"model-name\" to %s\n", global_model_name); } @@ -695,7 +695,7 @@ sane_get_devices (const SANE_Device *** device_list, SANE_Bool local_only) lp = sanei_config_skip_whitespace (lp); strncpy(global_version_name, lp, 4); global_version_name[4] = 0; - + DBG (15, "sane_get_devices: setting \"version-name\" to %s\n", global_version_name); } @@ -801,8 +801,8 @@ attach_one_usb (const char *device_name) return attach_one(device_name,CONNECTION_USB); } -/* build the scanner struct and link to global list - * unless struct is already loaded, then pretend +/* build the scanner struct and link to global list + * unless struct is already loaded, then pretend */ static SANE_Status attach_one (const char *device_name, int connType) @@ -974,8 +974,8 @@ connect_fd (struct scanner *s) if(ret == SANE_STATUS_GOOD){ - /* first generation usb scanners can get flaky if not closed - * properly after last use. very first commands sent to device + /* first generation usb scanners can get flaky if not closed + * properly after last use. very first commands sent to device * must be prepared to correct this- see wait_scanner() */ ret = wait_scanner(s); if (ret != SANE_STATUS_GOOD) { @@ -1016,9 +1016,9 @@ init_inquire (struct scanner *s) set_IN_return_size (cmd, inLen); set_IN_evpd (cmd, 0); set_IN_page_code (cmd, 0); - + ret = do_cmd ( - s, 1, 0, + s, 1, 0, cmd, cmdLen, NULL, 0, in, &inLen @@ -1323,7 +1323,7 @@ init_model (struct scanner *s) s->std_res_y[DPI_400]=1; s->std_res_x[DPI_600]=1; s->std_res_y[DPI_600]=1; - + /*weirdness*/ s->has_ssm = 0; s->has_ssm2 = 1; @@ -1522,7 +1522,7 @@ init_model (struct scanner *s) s->std_res_y[DPI_400]=1; s->std_res_x[DPI_600]=1; s->std_res_y[DPI_600]=1; - + s->has_comp_JPEG = 1; s->rgb_format = 1; s->has_df_ultra = 1; @@ -1562,7 +1562,7 @@ init_model (struct scanner *s) s->std_res_y[DPI_400]=1; s->std_res_x[DPI_600]=1; s->std_res_y[DPI_600]=1; - + s->has_comp_JPEG = 1; s->rgb_format = 1; s->has_df_ultra = 1; @@ -1801,9 +1801,9 @@ init_options (struct scanner *s) s->opt[i].cap = SANE_CAP_INACTIVE; } - /* go ahead and setup the first opt, because - * frontend may call control_option on it - * before calling get_option_descriptor + /* go ahead and setup the first opt, because + * frontend may call control_option on it + * before calling get_option_descriptor */ s->opt[OPT_NUM_OPTS].name = SANE_NAME_NUM_OPTIONS; s->opt[OPT_NUM_OPTS].title = SANE_TITLE_NUM_OPTIONS; @@ -1831,7 +1831,7 @@ sane_open (SANE_String_Const name, SANE_Handle * handle) struct scanner *dev = NULL; struct scanner *s = NULL; SANE_Status ret; - + DBG (10, "sane_open: start\n"); if(scanner_devList){ @@ -1852,7 +1852,7 @@ sane_open (SANE_String_Const name, SANE_Handle * handle) } else{ DBG (15, "sane_open: device %s requested\n", name); - + for (dev = scanner_devList; dev; dev = dev->next) { if (strcmp (dev->sane.name, name) == 0 || strcmp (dev->device_name, name) == 0) { /*always allow sanei devname*/ @@ -1928,7 +1928,7 @@ sane_get_option_descriptor (SANE_Handle handle, SANE_Int option) } if(s->has_adf){ s->source_list[i++]=STRING_ADFFRONT; - + if(s->has_back){ s->source_list[i++]=STRING_ADFBACK; } @@ -1938,7 +1938,7 @@ sane_get_option_descriptor (SANE_Handle handle, SANE_Int option) } if(s->has_card){ s->source_list[i++]=STRING_CARDFRONT; - + if(s->has_back){ s->source_list[i++]=STRING_CARDBACK; } @@ -1974,7 +1974,7 @@ sane_get_option_descriptor (SANE_Handle handle, SANE_Int option) s->mode_list[i++]=STRING_COLOR; } s->mode_list[i]=NULL; - + opt->name = SANE_NAME_SCAN_MODE; opt->title = SANE_TITLE_SCAN_MODE; opt->desc = SANE_DESC_SCAN_MODE; @@ -2041,14 +2041,14 @@ sane_get_option_descriptor (SANE_Handle handle, SANE_Int option) s->res_list[++i] = 1200; } s->res_list[0] = i; - + opt->name = SANE_NAME_SCAN_RESOLUTION; opt->title = SANE_TITLE_SCAN_RESOLUTION; opt->desc = SANE_DESC_SCAN_RESOLUTION; opt->type = SANE_TYPE_INT; opt->unit = SANE_UNIT_DPI; opt->cap = SANE_CAP_SOFT_SELECT | SANE_CAP_SOFT_DETECT; - + if(s->step_y_res){ s->res_range.min = s->min_y_res; s->res_range.max = s->max_y_res; @@ -2078,7 +2078,7 @@ sane_get_option_descriptor (SANE_Handle handle, SANE_Int option) s->tl_x_range.min = SCANNER_UNIT_TO_FIXED_MM(s->min_x); s->tl_x_range.max = SCANNER_UNIT_TO_FIXED_MM(get_page_width(s)); s->tl_x_range.quant = MM_PER_UNIT_FIX; - + opt->name = SANE_NAME_SCAN_TL_X; opt->title = SANE_TITLE_SCAN_TL_X; opt->desc = SANE_DESC_SCAN_TL_X; @@ -2096,7 +2096,7 @@ sane_get_option_descriptor (SANE_Handle handle, SANE_Int option) s->tl_y_range.min = SCANNER_UNIT_TO_FIXED_MM(s->min_y); s->tl_y_range.max = SCANNER_UNIT_TO_FIXED_MM(get_page_height(s)); s->tl_y_range.quant = MM_PER_UNIT_FIX; - + opt->name = SANE_NAME_SCAN_TL_Y; opt->title = SANE_TITLE_SCAN_TL_Y; opt->desc = SANE_DESC_SCAN_TL_Y; @@ -2114,7 +2114,7 @@ sane_get_option_descriptor (SANE_Handle handle, SANE_Int option) s->br_x_range.min = SCANNER_UNIT_TO_FIXED_MM(s->min_x); s->br_x_range.max = SCANNER_UNIT_TO_FIXED_MM(get_page_width(s)); s->br_x_range.quant = MM_PER_UNIT_FIX; - + opt->name = SANE_NAME_SCAN_BR_X; opt->title = SANE_TITLE_SCAN_BR_X; opt->desc = SANE_DESC_SCAN_BR_X; @@ -2132,7 +2132,7 @@ sane_get_option_descriptor (SANE_Handle handle, SANE_Int option) s->br_y_range.min = SCANNER_UNIT_TO_FIXED_MM(s->min_y); s->br_y_range.max = SCANNER_UNIT_TO_FIXED_MM(get_page_height(s)); s->br_y_range.quant = MM_PER_UNIT_FIX; - + opt->name = SANE_NAME_SCAN_BR_Y; opt->title = SANE_TITLE_SCAN_BR_Y; opt->desc = SANE_DESC_SCAN_BR_Y; @@ -2370,7 +2370,7 @@ sane_get_option_descriptor (SANE_Handle handle, SANE_Int option) /*double feed by thickness */ if(option==OPT_DF_THICKNESS){ - + opt->name = "df-thickness"; opt->title = "DF by thickness"; opt->desc = "Detect double feeds using thickness sensor"; @@ -2482,7 +2482,7 @@ sane_get_option_descriptor (SANE_Handle handle, SANE_Int option) s->do_color_list[5] = STRING_EN_GREEN; s->do_color_list[6] = STRING_EN_BLUE; s->do_color_list[7] = NULL; - + opt->name = "dropout-front"; opt->title = "Dropout color front"; opt->desc = "One-pass scanners use only one color during gray or binary scanning, useful for colored paper or ink"; @@ -2510,7 +2510,7 @@ sane_get_option_descriptor (SANE_Handle handle, SANE_Int option) s->do_color_list[5] = STRING_EN_GREEN; s->do_color_list[6] = STRING_EN_BLUE; s->do_color_list[7] = NULL; - + opt->name = "dropout-back"; opt->title = "Dropout color back"; opt->desc = "One-pass scanners use only one color during gray or binary scanning, useful for colored paper or ink"; @@ -2671,7 +2671,7 @@ sane_get_option_descriptor (SANE_Handle handle, SANE_Int option) /** * Gets or sets an option value. - * + * * From the SANE spec: * This function is used to set or inquire the current value of option * number n of the device represented by handle h. The manner in which @@ -2682,7 +2682,7 @@ sane_get_option_descriptor (SANE_Handle handle, SANE_Int option) * area pointed to by v must be big enough to hold the entire option * value (determined by member size in the corresponding option * descriptor). - * + * * The only exception to this rule is that when setting the value of a * string option, the string pointed to by argument v may be shorter * since the backend will stop reading the option value upon @@ -2999,7 +2999,7 @@ sane_control_option (SANE_Handle handle, SANE_Int option, * below. */ switch (option) { - + /* Mode Group */ case OPT_SOURCE: if (!strcmp (val, STRING_ADFFRONT)) { @@ -3024,7 +3024,7 @@ sane_control_option (SANE_Handle handle, SANE_Int option, tmp = SOURCE_FLATBED; } - if (s->u.source == tmp) + if (s->u.source == tmp) return SANE_STATUS_GOOD; s->u.source = tmp; @@ -3056,7 +3056,7 @@ sane_control_option (SANE_Handle handle, SANE_Int option, case OPT_RES: - if (s->u.dpi_x == val_c && s->u.dpi_y == val_c) + if (s->u.dpi_x == val_c && s->u.dpi_y == val_c) return SANE_STATUS_GOOD; s->u.dpi_x = val_c; @@ -3251,25 +3251,25 @@ ssm_buffer (struct scanner *s) DBG (10, "ssm_buffer: start\n"); if(s->has_ssm){ - + unsigned char cmd[SET_SCAN_MODE_len]; size_t cmdLen = SET_SCAN_MODE_len; - + unsigned char out[SSM_PAY_len]; size_t outLen = SSM_PAY_len; - + memset(cmd,0,cmdLen); set_SCSI_opcode(cmd, SET_SCAN_MODE_code); set_SSM_pf(cmd, 1); set_SSM_pay_len(cmd, outLen); - + memset(out,0,outLen); if(s->has_ssm_pay_head_len){ set_SSM_pay_head_len(out, SSM_PAY_HEAD_len); } set_SSM_page_code(out, SM_pc_buffer); set_SSM_page_len(out, SSM_PAGE_len); - + if(s->s.source == SOURCE_ADF_DUPLEX || s->s.source == SOURCE_CARD_DUPLEX){ set_SSM_BUFF_duplex(out, 1); } @@ -3288,7 +3288,7 @@ ssm_buffer (struct scanner *s) if(0){ set_SSM_BUFF_unk(out,1); } - + ret = do_cmd ( s, 1, 0, cmd, cmdLen, @@ -3301,20 +3301,20 @@ ssm_buffer (struct scanner *s) unsigned char cmd[SET_SCAN_MODE2_len]; size_t cmdLen = SET_SCAN_MODE2_len; - + unsigned char out[SSM2_PAY_len]; size_t outLen = SSM2_PAY_len; - + memset(cmd,0,cmdLen); set_SCSI_opcode(cmd, SET_SCAN_MODE2_code); set_SSM2_page_code(cmd, SM2_pc_buffer); set_SSM2_pay_len(cmd, outLen); - + memset(out,0,outLen); set_SSM2_BUFF_unk(out, !s->buffermode); set_SSM2_BUFF_unk2(out, 0x40); set_SSM2_BUFF_sync(out, !s->buffermode); - + ret = do_cmd ( s, 1, 0, cmd, cmdLen, @@ -3338,52 +3338,52 @@ ssm_df (struct scanner *s) SANE_Status ret = SANE_STATUS_GOOD; DBG (10, "ssm_df: start\n"); - + if(!s->has_df){ DBG (10, "ssm_df: unsupported, finishing\n"); return ret; } - + if(s->has_ssm){ unsigned char cmd[SET_SCAN_MODE_len]; size_t cmdLen = SET_SCAN_MODE_len; - + unsigned char out[SSM_PAY_len]; size_t outLen = SSM_PAY_len; - + memset(cmd,0,cmdLen); set_SCSI_opcode(cmd, SET_SCAN_MODE_code); set_SSM_pf(cmd, 1); set_SSM_pay_len(cmd, outLen); - + memset(out,0,outLen); if(s->has_ssm_pay_head_len){ set_SSM_pay_head_len(out, SSM_PAY_HEAD_len); } set_SSM_page_code(out, SM_pc_df); set_SSM_page_len(out, SSM_PAGE_len); - + /* deskew by roller */ if(s->rollerdeskew){ set_SSM_DF_deskew_roll(out, 1); } - + /* staple detection */ if(s->stapledetect){ set_SSM_DF_staple(out, 1); } - + /* thickness */ if(s->df_thickness){ set_SSM_DF_thick(out, 1); } - + /* length */ if(s->df_length){ set_SSM_DF_len(out, 1); } - + ret = do_cmd ( s, 1, 0, cmd, cmdLen, @@ -3397,7 +3397,7 @@ ssm_df (struct scanner *s) unsigned char cmd[SET_SCAN_MODE2_len]; size_t cmdLen = SET_SCAN_MODE2_len; - + unsigned char out[SSM2_PAY_len]; size_t outLen = SSM2_PAY_len; @@ -3407,11 +3407,11 @@ ssm_df (struct scanner *s) set_SCSI_opcode(cmd, SET_SCAN_MODE2_code); set_SSM2_page_code(cmd, SM2_pc_ultra); set_SSM2_pay_len(cmd, outLen); - + memset(out,0,outLen); set_SSM2_ULTRA_top(out, 0); set_SSM2_ULTRA_bot(out, 0); - + ret = do_cmd ( s, 1, 0, cmd, cmdLen, @@ -3424,19 +3424,19 @@ ssm_df (struct scanner *s) set_SCSI_opcode(cmd, SET_SCAN_MODE2_code); set_SSM2_page_code(cmd, SM2_pc_df); set_SSM2_pay_len(cmd, outLen); - + memset(out,0,outLen); - + /* thickness */ if(s->df_thickness){ set_SSM2_DF_thick(out, 1); } - + /* length */ if(s->df_length){ set_SSM2_DF_len(out, 1); } - + ret = do_cmd ( s, 1, 0, cmd, cmdLen, @@ -3466,7 +3466,7 @@ ssm_do (struct scanner *s) DBG (10, "ssm_do: unsupported, finishing\n"); return ret; } - + if(s->s.mode == MODE_COLOR){ DBG (10, "ssm_do: unneeded, finishing\n"); return ret; @@ -3476,24 +3476,24 @@ ssm_do (struct scanner *s) unsigned char cmd[SET_SCAN_MODE_len]; size_t cmdLen = SET_SCAN_MODE_len; - + unsigned char out[SSM_PAY_len]; size_t outLen = SSM_PAY_len; - + memset(cmd,0,cmdLen); set_SCSI_opcode(cmd, SET_SCAN_MODE_code); set_SSM_pf(cmd, 1); set_SSM_pay_len(cmd, outLen); - + memset(out,0,outLen); if(s->has_ssm_pay_head_len){ set_SSM_pay_head_len(out, SSM_PAY_HEAD_len); } set_SSM_page_code(out, SM_pc_dropout); set_SSM_page_len(out, SSM_PAGE_len); - + set_SSM_DO_unk1(out, 0x03); - + switch(s->dropout_color[SIDE_FRONT]){ case COLOR_RED: set_SSM_DO_unk2(out, 0x05); @@ -3520,7 +3520,7 @@ ssm_do (struct scanner *s) set_SSM_DO_f_en(out,SSM_DO_blue); break; } - + switch(s->dropout_color[SIDE_BACK]){ case COLOR_RED: set_SSM_DO_unk2(out, 0x05); @@ -3547,7 +3547,7 @@ ssm_do (struct scanner *s) set_SSM_DO_b_en(out,SSM_DO_blue); break; } - + ret = do_cmd ( s, 1, 0, cmd, cmdLen, @@ -3561,17 +3561,17 @@ ssm_do (struct scanner *s) unsigned char cmd[SET_SCAN_MODE2_len]; size_t cmdLen = SET_SCAN_MODE2_len; - + unsigned char out[SSM2_PAY_len]; size_t outLen = SSM2_PAY_len; - + memset(cmd,0,cmdLen); set_SCSI_opcode(cmd, SET_SCAN_MODE2_code); set_SSM2_page_code(cmd, SM2_pc_dropout); set_SSM2_pay_len(cmd, outLen); - + memset(out,0,outLen); - + switch(s->dropout_color[SIDE_FRONT]){ case COLOR_RED: set_SSM2_DO_do(out,SSM_DO_red); @@ -3622,7 +3622,7 @@ read_sensors(struct scanner *s,SANE_Int option) size_t inLen = R_SENSORS_len; DBG (10, "read_sensors: start %d\n", option); - + if(!s->can_read_sensors){ DBG (10, "read_sensors: unsupported, finishing\n"); return ret; @@ -3638,14 +3638,14 @@ read_sensors(struct scanner *s,SANE_Int option) set_SCSI_opcode(cmd, READ_code); set_R_datatype_code (cmd, SR_datatype_sensors); set_R_xfer_length (cmd, inLen); - + ret = do_cmd ( s, 1, 0, cmd, cmdLen, NULL, 0, in, &inLen ); - + if (ret == SANE_STATUS_GOOD || ret == SANE_STATUS_EOF) { /*set flags indicating there is data to read*/ memset(s->sensors_read,1,sizeof(s->sensors_read)); @@ -3656,12 +3656,12 @@ read_sensors(struct scanner *s,SANE_Int option) ret = SANE_STATUS_GOOD; } } - + if(option) s->sensors_read[option-OPT_ADF_LOADED] = 0; DBG (10, "read_sensors: finish\n"); - + return ret; } @@ -3677,7 +3677,7 @@ read_panel(struct scanner *s,SANE_Int option) size_t inLen = R_PANEL_len; DBG (10, "read_panel: start %d\n", option); - + if(!s->can_read_panel){ DBG (10, "read_panel: unsupported, finishing\n"); return ret; @@ -3693,14 +3693,14 @@ read_panel(struct scanner *s,SANE_Int option) set_SCSI_opcode(cmd, READ_code); set_R_datatype_code (cmd, SR_datatype_panel); set_R_xfer_length (cmd, inLen); - + ret = do_cmd ( s, 1, 0, cmd, cmdLen, NULL, 0, in, &inLen ); - + if (ret == SANE_STATUS_GOOD || ret == SANE_STATUS_EOF) { /*set flags indicating there is data to read*/ memset(s->panel_read,1,sizeof(s->panel_read)); @@ -3717,12 +3717,12 @@ read_panel(struct scanner *s,SANE_Int option) ret = SANE_STATUS_GOOD; } } - + if(option) s->panel_read[option-OPT_START] = 0; DBG (10, "read_panel: finish %d\n",s->panel_counter); - + return ret; } @@ -3752,20 +3752,20 @@ send_panel(struct scanner *s) memset(out,0,outLen); set_S_PANEL_enable_led(out,s->panel_enable_led); set_S_PANEL_counter(out,s->panel_counter); - + ret = do_cmd ( s, 1, 0, cmd, cmdLen, out, outLen, NULL, NULL ); - + if (ret == SANE_STATUS_EOF) { ret = SANE_STATUS_GOOD; } - + DBG (10, "send_panel: finish %d\n", ret); - + return ret; } @@ -3783,7 +3783,7 @@ send_panel(struct scanner *s) * completion of that request. Outside of that window, the returned * values are best-effort estimates of what the parameters will be * when sane_start() gets invoked. - * + * * Calling this function before a scan has actually started allows, * for example, to get an estimate of how big the scanned image will * be. The parameters passed to this function are the handle h of the @@ -3795,7 +3795,7 @@ sane_get_parameters (SANE_Handle handle, SANE_Parameters * params) { SANE_Status ret = SANE_STATUS_GOOD; struct scanner *s = (struct scanner *) handle; - + DBG (10, "sane_get_parameters: start\n"); if(!s->started){ @@ -3825,14 +3825,14 @@ sane_get_parameters (SANE_Handle handle, SANE_Parameters * params) DBG(15,"sane_get_parameters: area: tlx=%d, brx=%d, tly=%d, bry=%d\n", s->i.tl_x, s->i.br_x, s->i.tl_y, s->i.br_y); - DBG (15, "sane_get_parameters: params: ppl=%d, Bpl=%d, lines=%d\n", + DBG (15, "sane_get_parameters: params: ppl=%d, Bpl=%d, lines=%d\n", params->pixels_per_line, params->bytes_per_line, params->lines); - DBG (15, "sane_get_parameters: params: format=%d, depth=%d, last=%d\n", + DBG (15, "sane_get_parameters: params: format=%d, depth=%d, last=%d\n", params->format, params->depth, params->last_frame); DBG (10, "sane_get_parameters: finish\n"); - + return ret; } @@ -3840,9 +3840,9 @@ SANE_Status update_params(struct scanner *s, int calib) { SANE_Status ret = SANE_STATUS_GOOD; - + DBG (10, "update_params: start\n"); - + s->u.width = (s->u.br_x - s->u.tl_x) * s->u.dpi_x / 1200; s->u.height = (s->u.br_y - s->u.tl_y) * s->u.dpi_y / 1200; @@ -3884,7 +3884,7 @@ update_params(struct scanner *s, int calib) s->u.br_x, s->u.tl_x, s->u.dpi_x, s->u.br_y, s->u.tl_y, s->u.dpi_y); /* some scanners are limited in their valid scan params - * make a second version of the params struct, but + * make a second version of the params struct, but * override the user's values with what the scanner can actually do */ memcpy(&s->s,&s->u,sizeof(struct img_params)); @@ -3971,7 +3971,7 @@ update_params(struct scanner *s, int calib) /* round lines up to even number */ s->s.height += s->s.height % 2; - + DBG (15, "update_params: scan params: w:%d h:%d m:%d f:%d b:%d\n", s->s.width, s->s.height, s->s.mode, s->s.format, s->s.bpp); DBG (15, "update_params: scan params: B:%d vB:%d vw:%d\n", @@ -4011,12 +4011,12 @@ SANE_Status update_i_params(struct scanner *s) { SANE_Status ret = SANE_STATUS_GOOD; - + DBG (10, "update_i_params: start\n"); s->i.width = s->u.width; s->i.Bpl = s->u.Bpl; - + DBG (10, "update_i_params: finish\n"); return ret; } @@ -4169,7 +4169,7 @@ sane_start (SANE_Handle handle) DBG (5, "sane_start: ERROR: cannot load page\n"); goto errors; } - + /* wait for scanner to finish load */ ret = wait_scanner (s); if (ret != SANE_STATUS_GOOD) { @@ -4235,7 +4235,7 @@ sane_start (SANE_Handle handle) } } } - + /* small, buffering scanners check for more pages by reading counter */ else{ ret = read_panel (s, OPT_COUNTER); @@ -4261,9 +4261,9 @@ sane_start (SANE_Handle handle) DBG (15, "started=%d, side=%d, source=%d\n", s->started, s->side, s->u.source); - /* certain options require the entire image to + /* certain options require the entire image to * be collected from the scanner before we can - * tell the user the size of the image. the sane + * tell the user the size of the image. the sane * API has no way to inform the frontend of this, * so we block and buffer. yuck */ if(must_fully_buffer(s)){ @@ -4294,7 +4294,7 @@ sane_start (SANE_Handle handle) } if(s->swskip){ /* Skipping means throwing out this image. - * Pretend the user read the whole thing + * Pretend the user read the whole thing * and call sane_start again. * This assumes we are running in batch mode. */ if(buffer_isblank(s,s->side)){ @@ -4349,7 +4349,7 @@ clean_params (struct scanner *s) s->s.bytes_tot[0]=0; s->s.bytes_tot[1]=0; - /* store the number of front bytes */ + /* store the number of front bytes */ if ( s->u.source != SOURCE_ADF_BACK && s->u.source != SOURCE_CARD_BACK ) s->u.bytes_tot[SIDE_FRONT] = s->u.Bpl * s->u.height; @@ -4359,8 +4359,8 @@ clean_params (struct scanner *s) if ( s->s.source != SOURCE_ADF_BACK && s->s.source != SOURCE_CARD_BACK ) s->s.bytes_tot[SIDE_FRONT] = s->s.Bpl * s->s.height; - /* store the number of back bytes */ - if ( s->u.source == SOURCE_ADF_DUPLEX || s->u.source == SOURCE_ADF_BACK + /* store the number of back bytes */ + if ( s->u.source == SOURCE_ADF_DUPLEX || s->u.source == SOURCE_ADF_BACK || s->u.source == SOURCE_CARD_DUPLEX || s->u.source == SOURCE_CARD_BACK ) s->u.bytes_tot[SIDE_BACK] = s->u.Bpl * s->u.height; @@ -4421,14 +4421,14 @@ set_window (struct scanner *s) { SANE_Status ret = SANE_STATUS_GOOD; - /* The command specifies the number of bytes in the data phase - * the data phase has a header, followed by 1 window desc block + /* The command specifies the number of bytes in the data phase + * the data phase has a header, followed by 1 window desc block * the header specifies the number of bytes in 1 window desc block */ unsigned char cmd[SET_WINDOW_len]; size_t cmdLen = SET_WINDOW_len; - + unsigned char out[SW_header_len + SW_desc_len]; size_t outLen = SW_header_len + SW_desc_len; @@ -4484,9 +4484,9 @@ set_window (struct scanner *s) /*convert our common -127 to +127 range into HW's range *FIXME: this code assumes hardware range of 0-255 */ set_WD_brightness (desc1, s->brightness+128); - + set_WD_threshold (desc1, s->threshold); - + /*convert our common -127 to +127 range into HW's range *FIXME: this code assumes hardware range of 0-255 */ set_WD_contrast (desc1, s->contrast+128); @@ -4593,7 +4593,7 @@ object_position (struct scanner *s, int i_load) /* * Issues SCAN command. - * + * * (This doesn't actually read anything, it just tells the scanner * to start scanning.) */ @@ -4641,7 +4641,7 @@ start_scan (struct scanner *s, int type) /* * Called by SANE to read data. - * + * * From the SANE spec: * This function is used to read image data from the device * represented by handle h. Argument buf is a pointer to a memory @@ -4649,7 +4649,7 @@ start_scan (struct scanner *s, int type) * returned is stored in *len. A backend must set this to zero when * the call fails (i.e., when a status other than SANE_STATUS_GOOD is * returned). - * + * * When the call succeeds, the number of bytes returned can be * anywhere in the range from 0 to maxlen bytes. */ @@ -4698,7 +4698,7 @@ sane_read (SANE_Handle handle, SANE_Byte * buf, SANE_Int max_len, SANE_Int * len } } } - + /* simplex or non-alternating duplex */ else{ if(!s->s.eof[s->side]){ @@ -4719,7 +4719,7 @@ sane_read (SANE_Handle handle, SANE_Byte * buf, SANE_Int max_len, SANE_Int * len ret = read_from_buffer(s,buf,max_len,len,s->side); if(ret) goto errors; - + ret = check_for_cancel(s); s->reading = 0; @@ -4813,13 +4813,13 @@ read_from_scanner(struct scanner *s, int side, int exact) size_t i; for(i=0;ijpeg_stage == JPEG_STAGE_NONE && in[i] == 0xff){ s->jpeg_ff_offset=0; continue; } - + s->jpeg_ff_offset++; /* last byte was an ff, this byte is SOF */ @@ -4827,7 +4827,7 @@ read_from_scanner(struct scanner *s, int side, int exact) s->jpeg_stage = JPEG_STAGE_SOF; continue; } - + if(s->jpeg_stage == JPEG_STAGE_SOF){ /* lines in start of frame, overwrite it */ @@ -4839,7 +4839,7 @@ read_from_scanner(struct scanner *s, int side, int exact) in[i] = s->s.height & 0xff; continue; } - + /* width in start of frame, overwrite it */ if(s->jpeg_ff_offset == 7){ in[i] = (s->s.width >> 8) & 0xff; @@ -4883,7 +4883,7 @@ read_from_scanner(struct scanner *s, int side, int exact) s->s.bytes_tot[side] = s->s.bytes_sent[side]; s->i.bytes_tot[side] = s->i.bytes_sent[side]; s->u.bytes_tot[side] = s->i.bytes_sent[side]; - } + } /* this is non-jpeg data, fill remainder, change rx'd size */ else{ @@ -5025,7 +5025,7 @@ read_from_scanner_duplex(struct scanner *s,int exact) return ret; } -/* these functions copy image data from input buffer to scanner struct +/* these functions copy image data from input buffer to scanner struct * descrambling it, and putting it in the right side buffer */ /* NOTE: they assume buffer is scanline aligned */ static SANE_Status @@ -5051,7 +5051,7 @@ copy_simplex(struct scanner *s, unsigned char * buf, int len, int side) s->s.bytes_sent[side] += len; return ret; } - + DBG (15, "copy_simplex: per-line copy\n"); line = malloc(bwidth); @@ -5061,7 +5061,7 @@ copy_simplex(struct scanner *s, unsigned char * buf, int len, int side) for(i=0; is.bytes_sent[side] / bwidth; - + /*increment number of bytes rx'd from scanner*/ s->s.bytes_sent[side] += bwidth; @@ -5075,9 +5075,9 @@ copy_simplex(struct scanner *s, unsigned char * buf, int len, int side) line_next = 0; if(s->s.format == SANE_FRAME_GRAY){ - + switch (s->gray_interlace[side]) { - + /* one line has the following format: ggg...GGG * where the 'capital' letters are the beginning of the line */ case GRAY_INTERLACE_gG: @@ -5086,10 +5086,10 @@ copy_simplex(struct scanner *s, unsigned char * buf, int len, int side) line[line_next++] = buf[i+j]; } break; - + case GRAY_INTERLACE_2510: DBG (17, "copy_simplex: gray, 2510\n"); - + /* first read head (third byte of every three) */ for(j=bwidth-1;j>=0;j-=3){ line[line_next++] = buf[i+j]; @@ -5109,11 +5109,11 @@ copy_simplex(struct scanner *s, unsigned char * buf, int len, int side) break; } } - + else if (s->s.format == SANE_FRAME_RGB){ - + switch (inter) { - + /* scanner returns color data as bgrbgr... */ case COLOR_INTERLACE_BGR: DBG (17, "copy_simplex: color, BGR\n"); @@ -5123,7 +5123,7 @@ copy_simplex(struct scanner *s, unsigned char * buf, int len, int side) line[line_next++] = buf[i+j*3]; } break; - + /* scanner returns color data as gbrgbr... */ case COLOR_INTERLACE_GBR: DBG (17, "copy_simplex: color, GBR\n"); @@ -5133,7 +5133,7 @@ copy_simplex(struct scanner *s, unsigned char * buf, int len, int side) line[line_next++] = buf[i+j*3+1]; } break; - + /* scanner returns color data as brgbrg... */ case COLOR_INTERLACE_BRG: DBG (17, "copy_simplex: color, BRG\n"); @@ -5143,7 +5143,7 @@ copy_simplex(struct scanner *s, unsigned char * buf, int len, int side) line[line_next++] = buf[i+j*3]; } break; - + /* one line has the following format: RRR...rrrGGG...gggBBB...bbb */ case COLOR_INTERLACE_RRGGBB: DBG (17, "copy_simplex: color, RRGGBB\n"); @@ -5153,7 +5153,7 @@ copy_simplex(struct scanner *s, unsigned char * buf, int len, int side) line[line_next++] = buf[i+2*pwidth+j]; } break; - + /* one line has the following format: rrr...RRRggg...GGGbbb...BBB * where the 'capital' letters are the beginning of the line */ case COLOR_INTERLACE_rRgGbB: @@ -5164,10 +5164,10 @@ copy_simplex(struct scanner *s, unsigned char * buf, int len, int side) line[line_next++] = buf[i+2*pwidth+j]; } break; - + case COLOR_INTERLACE_2510: DBG (17, "copy_simplex: color, 2510\n"); - + /* first read head (third byte of every three) */ for(j=t-1;j>=0;j-=3){ line[line_next++] = buf[i+j]; @@ -5193,7 +5193,7 @@ copy_simplex(struct scanner *s, unsigned char * buf, int len, int side) break; } } - + /* nothing sent above? just copy one line of the block */ /* used by uninterlaced gray/color */ if(!line_next){ @@ -5201,14 +5201,14 @@ copy_simplex(struct scanner *s, unsigned char * buf, int len, int side) memcpy(line+line_next,buf+i,bwidth); line_next = bwidth; } - + /* invert image if scanner needs it for this mode */ if(s->reverse_by_mode[s->s.mode]){ for(j=0; jf_offset[side]){ DBG (17, "copy_simplex: apply offset\n"); @@ -5227,7 +5227,7 @@ copy_simplex(struct scanner *s, unsigned char * buf, int len, int side) line[j] = curr; } } - + /* apply brightness and contrast if hardware cannot do it */ if(s->sw_lut && (s->s.mode == MODE_COLOR || s->s.mode == MODE_GRAYSCALE)){ DBG (17, "copy_simplex: apply brightness/contrast\n"); @@ -5283,7 +5283,7 @@ copy_duplex(struct scanner *s, unsigned char * buf, int len) DBG (10, "copy_duplex: 2510\n"); for(i=0; ii.width != s->s.width){ offset = ((s->valid_x-s->i.page_x) / 2 + s->i.tl_x) * s->i.dpi_x/1200; @@ -5481,12 +5481,12 @@ copy_line(struct scanner *s, unsigned char * buff, int side) /* change mode, store line in buffer */ switch (s->i.mode) { - + case MODE_COLOR: memcpy(s->buffers[side]+s->i.bytes_sent[side], line+(offset*3), ibwidth); s->i.bytes_sent[side] += ibwidth; break; - + case MODE_GRAYSCALE: for(i=0;i remain) bytes = remain; - + *len = bytes; - + /*FIXME this needs to timeout eventually */ if(!bytes){ DBG(5,"read_from_buffer: nothing to do\n"); return SANE_STATUS_GOOD; } - + DBG(15, "read_from_buffer: si:%d to:%d tx:%d bu:%d pa:%d\n", side, s->i.bytes_tot[side], s->u.bytes_sent[side], max_len, bytes); @@ -5701,7 +5701,7 @@ calibrate_AFE (struct scanner *s) DBG (5, "calibrate_AFE: ERROR: cannot set window\n"); goto cleanup; } - + /* first pass (black offset), lamp off, no offset/gain/exposure */ DBG (15, "calibrate_AFE: offset\n"); @@ -5925,7 +5925,7 @@ calibrate_fine_buffer (struct scanner *s) DBG (5, "calibrate_fine_buffer: ERROR: cannot load offset buffers\n"); goto cleanup; } - + DBG (5, "calibrate_fine_buffer: %d %x\n", s->s.dpi_x/10, s->s.dpi_x/10); memset(cmd,0,cmdLen); @@ -5952,13 +5952,13 @@ calibrate_fine_buffer (struct scanner *s) /*color mode, expand offset across all three channels? */ if(s->s.format == SANE_FRAME_RGB){ for(j=0; js.valid_width; j++){ - - /*red*/ + + /*red*/ s->f_offset[i][j*3] = in[j*2+i]; if(s->f_offset[i][j*3] < 1) s->f_offset[i][j*3] = 1; - /*green and blue, same as red*/ + /*green and blue, same as red*/ s->f_offset[i][j*3+1] = s->f_offset[i][j*3+2] = s->f_offset[i][j*3]; } } @@ -5995,10 +5995,10 @@ calibrate_fine_buffer (struct scanner *s) int codes[] = {R_FINE_uid_red,R_FINE_uid_green,R_FINE_uid_blue}; for(k=0;k<3;k++){ - + set_R_xfer_uid (cmd, codes[k]); inLen = reqLen; - + hexdump(15, "cmd:", cmd, cmdLen); ret = do_cmd ( @@ -6009,12 +6009,12 @@ calibrate_fine_buffer (struct scanner *s) ); if (ret != SANE_STATUS_GOOD) goto cleanup; - + for(i=0;i<2;i++){ for(j=0; js.valid_width; j++){ - + s->f_gain[i][j*3+k] = in[j*2+i]*3/4; - + if(s->f_gain[i][j*3+k] < 1) s->f_gain[i][j*3+k] = 1; } @@ -6027,7 +6027,7 @@ calibrate_fine_buffer (struct scanner *s) set_R_xfer_uid (cmd, R_FINE_uid_gray); inLen = reqLen; - + hexdump(15, "cmd:", cmd, cmdLen); ret = do_cmd ( @@ -6038,12 +6038,12 @@ calibrate_fine_buffer (struct scanner *s) ); if (ret != SANE_STATUS_GOOD) goto cleanup; - + for(i=0;i<2;i++){ for(j=0; js.valid_width; j++){ - + s->f_gain[i][j] = in[j*2+i]*3/4; - + if(s->f_gain[i][j] < 1) s->f_gain[i][j] = 1; } @@ -6127,7 +6127,7 @@ calibrate_fine (struct scanner *s) DBG (5, "calibrate_fine: ERROR: cannot load buffers\n"); goto cleanup; } - + /*blast the existing fine cal data so reading code wont apply it*/ ret = offset_buffers(s,0); ret = gain_buffers(s,0); @@ -6138,14 +6138,14 @@ calibrate_fine (struct scanner *s) DBG (5, "calibrate_fine: ERROR: cannot ssm buffer\n"); goto cleanup; } - + /* set window command */ ret = set_window(s); if (ret != SANE_STATUS_GOOD) { DBG (5, "calibrate_fine: ERROR: cannot set window\n"); goto cleanup; } - + /*handle fifth pass (fine offset), lamp off*/ DBG (15, "calibrate_fine: offset\n"); ret = calibration_scan(s,0xff); @@ -6159,7 +6159,7 @@ calibrate_fine (struct scanner *s) DBG (5, "calibrate_fine: ERROR: cannot load offset buffers\n"); goto cleanup; } - + for(i=0;i<2;i++){ for(j=0; js.valid_Bpl; j++){ min = 0; @@ -6184,7 +6184,7 @@ calibrate_fine (struct scanner *s) DBG (5, "calibrate_fine: ERROR: cannot load gain buffers\n"); goto cleanup; } - + for(i=0;i<2;i++){ for(j=0; js.valid_Bpl; j++){ max = 0; @@ -6231,14 +6231,14 @@ calibration_scan (struct scanner *s, int scan) DBG (5, "calibration_scan: ERROR: cannot clean_params\n"); return ret; } - + /* start scanning */ ret = start_scan (s,scan); if (ret != SANE_STATUS_GOOD) { DBG (5, "calibration_scan: ERROR: cannot start_scan\n"); return ret; } - + while(!s->s.eof[SIDE_FRONT] && !s->s.eof[SIDE_BACK]){ ret = read_from_scanner_duplex(s,1); } @@ -6260,7 +6260,7 @@ write_AFE(struct scanner *s) size_t cmdLen = COR_CAL_len; /*use the longest payload for buffer*/ - unsigned char pay[CC3_pay_len]; + unsigned char pay[CC3_pay_len]; size_t payLen = CC3_pay_len; DBG (10, "write_AFE: start\n"); @@ -6272,7 +6272,7 @@ write_AFE(struct scanner *s) set_SCSI_opcode(cmd, COR_CAL_code); set_CC_version(cmd,CC3_pay_ver); set_CC_xferlen(cmd,payLen); - + memset(pay,0,payLen); set_CC3_gain_f_r(pay,s->c_gain[SIDE_FRONT]); @@ -6282,7 +6282,7 @@ write_AFE(struct scanner *s) set_CC3_off_f_r(pay,s->c_offset[SIDE_FRONT]); set_CC3_off_f_g(pay,s->c_offset[SIDE_FRONT]); set_CC3_off_f_b(pay,s->c_offset[SIDE_FRONT]); - + set_CC3_exp_f_r(pay,s->c_exposure[SIDE_FRONT][CHAN_RED]); set_CC3_exp_f_g(pay,s->c_exposure[SIDE_FRONT][CHAN_GREEN]); set_CC3_exp_f_b(pay,s->c_exposure[SIDE_FRONT][CHAN_BLUE]); @@ -6307,7 +6307,7 @@ write_AFE(struct scanner *s) set_SCSI_opcode(cmd, COR_CAL_code); set_CC_version(cmd,CC_pay_ver); set_CC_xferlen(cmd,payLen); - + memset(pay,0,payLen); set_CC_f_gain(pay,s->c_gain[SIDE_FRONT]); set_CC_unk1(pay,1); @@ -6319,7 +6319,7 @@ write_AFE(struct scanner *s) set_CC_exp_f_r2(pay,s->c_exposure[SIDE_FRONT][CHAN_RED]); set_CC_exp_f_g2(pay,s->c_exposure[SIDE_FRONT][CHAN_GREEN]); set_CC_exp_f_b2(pay,s->c_exposure[SIDE_FRONT][CHAN_BLUE]); - + set_CC_b_gain(pay,s->c_gain[SIDE_BACK]); set_CC_b_offset(pay,s->c_offset[SIDE_BACK]); set_CC_exp_b_r1(pay,s->c_exposure[SIDE_BACK][CHAN_RED]); @@ -6414,26 +6414,26 @@ gain_buffers (struct scanner *s, int setup) * @@ Section 6 - SANE cleanup functions */ /* - * Cancels a scan. + * Cancels a scan. * * It has been said on the mailing list that sane_cancel is a bit of a * misnomer because it is routinely called to signal the end of a * batch - quoting David Mosberger-Tang: - * + * * > In other words, the idea is to have sane_start() be called, and * > collect as many images as the frontend wants (which could in turn * > consist of multiple frames each as indicated by frame-type) and - * > when the frontend is done, it should call sane_cancel(). + * > when the frontend is done, it should call sane_cancel(). * > Sometimes it's better to think of sane_cancel() as "sane_stop()" * > but that name would have had some misleading connotations as * > well, that's why we stuck with "cancel". - * + * * The current consensus regarding duplex and ADF scans seems to be * the following call sequence: sane_start; sane_read (repeat until * EOF); sane_start; sane_read... and then call sane_cancel if the * batch is at an end. I.e. do not call sane_cancel during the run but * as soon as you get a SANE_STATUS_NO_DOCS. - * + * * From the SANE spec: * This function is used to immediately or as quickly as possible * cancel the currently pending operation of the device represented by @@ -6478,13 +6478,13 @@ check_for_cancel(struct scanner *s) if(s->started && s->cancelled){ unsigned char cmd[CANCEL_len]; size_t cmdLen = CANCEL_len; - + DBG (15, "check_for_cancel: cancelling\n"); - + /* cancel scan */ memset(cmd,0,cmdLen); set_SCSI_opcode(cmd, CANCEL_code); - + ret = do_cmd ( s, 1, 0, cmd, cmdLen, @@ -6494,7 +6494,7 @@ check_for_cancel(struct scanner *s) if(ret){ DBG (5, "check_for_cancel: ignoring bad cancel: %d\n",ret); } - + ret = object_position(s,SANE_FALSE); if(ret){ DBG (5, "check_for_cancel: ignoring bad eject: %d\n",ret); @@ -6516,7 +6516,7 @@ check_for_cancel(struct scanner *s) /* * Ends use of the scanner. - * + * * From the SANE spec: * This function terminates the association between the device handle * passed in argument h and the device it represents. If the device is @@ -6560,7 +6560,7 @@ disconnect_fd (struct scanner *s) /* * Terminates the backend. - * + * * From the SANE spec: * This function must be called to terminate use of a backend. The * function will first close all device handles that still might be @@ -6983,19 +6983,19 @@ do_usb_cmd(struct scanner *s, int runRS, int shortTime, DBG(5,"cmd: no mem\n"); return SANE_STATUS_NO_MEM; } - + /* build a USB packet around the SCSI command */ cmdBuffer[3] = cmdLength-4; cmdBuffer[5] = 1; cmdBuffer[6] = 0x90; memcpy(cmdBuffer+cmdOffset,cmdBuff,cmdLen); - + /* write the command out */ DBG(25, "cmd: writing %d bytes, timeout %d\n", (int)cmdLength, cmdTimeout); hexdump(30, "cmd: >>", cmdBuffer, cmdLength); ret = sanei_usb_write_bulk(s->fd, cmdBuffer, &cmdActual); DBG(25, "cmd: wrote %d bytes, retVal %d\n", (int)cmdActual, ret); - + if(cmdLength != cmdActual){ DBG(5,"cmd: wrong size %d/%d\n", (int)cmdLength, (int)cmdActual); free(cmdBuffer); @@ -7043,19 +7043,19 @@ do_usb_cmd(struct scanner *s, int runRS, int shortTime, DBG(5,"out: no mem\n"); return SANE_STATUS_NO_MEM; } - + /* build a USB packet around the SCSI command */ outBuffer[3] = outLength-4; outBuffer[5] = 2; outBuffer[6] = 0xb0; memcpy(outBuffer+outOffset,outBuff,outLen); - + /* write the command out */ DBG(25, "out: writing %d bytes, timeout %d\n", (int)outLength, outTimeout); hexdump(30, "out: >>", outBuffer, outLength); ret = sanei_usb_write_bulk(s->fd, outBuffer, &outActual); DBG(25, "out: wrote %d bytes, retVal %d\n", (int)outActual, ret); - + if(outLength != outActual){ DBG(5,"out: wrong size %d/%d\n", (int)outLength, (int)outActual); free(outBuffer); @@ -7102,7 +7102,7 @@ do_usb_cmd(struct scanner *s, int runRS, int shortTime, DBG(5,"in: no mem\n"); return SANE_STATUS_NO_MEM; } - + DBG(25, "in: reading %d bytes, timeout %d\n", (int)inActual, inTimeout); ret = sanei_usb_read_bulk(s->fd, inBuffer, &inActual); DBG(25, "in: read %d bytes, retval %d\n", (int)inActual, ret); @@ -7161,11 +7161,11 @@ do_usb_cmd(struct scanner *s, int runRS, int shortTime, ret = SANE_STATUS_EOF; DBG(5,"in: short read, %d/%d\n", (int)inLength,(int)inActual); } - + /* ignore the USB packet around the SCSI command */ *inLen = inActual - inOffset; memcpy(inBuff,inBuffer+inOffset,*inLen); - + free(inBuffer); } @@ -7214,12 +7214,12 @@ do_usb_status(struct scanner *s, int runRS, int shortTime, size_t * extraLength) DBG(5,"stat: no mem\n"); return SANE_STATUS_NO_MEM; } - + DBG(25, "stat: reading %d bytes, timeout %d\n", (int)statLength, statTimeout); ret = sanei_usb_read_bulk(s->fd, statBuffer, &statActual); DBG(25, "stat: read %d bytes, retval %d\n", (int)statActual, ret); hexdump(30, "stat: <<", statBuffer, statActual); - + /*weird status*/ if(ret != SANE_STATUS_GOOD){ DBG(5,"stat: clearing error '%s'\n",sane_strstatus(ret)); @@ -7286,7 +7286,7 @@ do_usb_clear(struct scanner *s, int clear, int runRS) rs_in, &rs_inLen ); DBG(25,"rs sub call <<\n"); - + if(ret2 == SANE_STATUS_EOF){ DBG(5,"rs: got EOF, returning IO_ERROR\n"); return SANE_STATUS_IO_ERROR; @@ -7309,7 +7309,7 @@ do_usb_clear(struct scanner *s, int clear, int runRS) } static SANE_Status -wait_scanner(struct scanner *s) +wait_scanner(struct scanner *s) { SANE_Status ret = SANE_STATUS_GOOD; @@ -7360,11 +7360,11 @@ wait_scanner(struct scanner *s) /* Some scanners have per-resolution * color interlacing values, but most - * don't. This helper can tell the + * don't. This helper can tell the * difference. */ static int -get_color_inter(struct scanner *s, int side, int res) +get_color_inter(struct scanner *s, int side, int res) { int i; for(i=0;iu.page_x; @@ -7408,7 +7408,7 @@ get_page_width(struct scanner *s) * due to using FB or overscan. */ static int -get_page_height(struct scanner *s) +get_page_height(struct scanner *s) { int height = s->u.page_y; @@ -7600,7 +7600,7 @@ buffer_crop(struct scanner *s, int side) /* if we will later binarize this image, make sure the width * is a multiple of 8 pixels, by adjusting the right side */ - if ( must_downsample(s) && s->u.mode < MODE_GRAYSCALE ){ + if ( must_downsample(s) && s->u.mode < MODE_GRAYSCALE ){ s->crop_vals[3] -= (s->crop_vals[3]-s->crop_vals[2]) % 8; } @@ -7618,13 +7618,13 @@ buffer_crop(struct scanner *s, int side) s->i.width = s->s_params.pixels_per_line; s->i.height = s->s_params.lines; s->i.Bpl = s->s_params.bytes_per_line; - + /* update image size counter to new, smaller size */ s->i.bytes_tot[side] = s->s_params.lines * s->s_params.bytes_per_line; s->i.bytes_sent[side] = s->i.bytes_tot[side]; s->u.bytes_sent[side] = 0; - - cleanup: + + cleanup: DBG (10, "buffer_crop: finish\n"); return ret; } @@ -7679,7 +7679,7 @@ buffer_isblank(struct scanner *s, int side) return status; } -/* certain options require the entire image to +/* certain options require the entire image to * be collected from the scanner before we can * tell the user the size of the image. */ static int @@ -7696,7 +7696,7 @@ must_fully_buffer(struct scanner *s) return 0; } -/* certain scanners require the mode of the +/* certain scanners require the mode of the * image to be changed in software. */ static int must_downsample(struct scanner *s) @@ -7714,7 +7714,7 @@ must_downsample(struct scanner *s) used by scanners to implement brightness/contrast/gamma or by backends to speed binarization/thresholding - offset and slope inputs are -127 to +127 + offset and slope inputs are -127 to +127 slope rotates line around central input/output val, 0 makes horizontal line @@ -7730,9 +7730,9 @@ must_downsample(struct scanner *s) offset moves line vertically, and clamps to output range 0 keeps the line crossing the center of the table - pos zero neg + pos zero neg . xxxxxxxx . xx . - . x . x . + . x . x . out x . x . x . . x . x ............ xx.......... xxxxxxxx.... @@ -7761,7 +7761,7 @@ load_lut (unsigned char * lut, * first [-127,127] to [-.999,.999] * then to [-PI/4,PI/4] then [0,PI/2] * then take the tangent (T.O.A) - * then multiply by the normal linear slope + * then multiply by the normal linear slope * because the table may not be square, i.e. 1024x256*/ rise = tan((double)slope/128 * M_PI_4 + M_PI_4) * max_out_val / max_in_val; diff --git a/backend/canon_dr.conf.in b/backend/canon_dr.conf.in index 29b6db1dd..2f9d4e4ce 100644 --- a/backend/canon_dr.conf.in +++ b/backend/canon_dr.conf.in @@ -1,6 +1,6 @@ ####################################################################### # NOTE: 'option' lines only apply to the devices found by -# the NEXT 'usb' or 'scsi' line. You may repeat the option line if +# the NEXT 'usb' or 'scsi' line. You may repeat the option line if # required for multiple scanners of different models/connections. ####################################################################### diff --git a/backend/canon_dr.h b/backend/canon_dr.h index d96fbba8b..5efb96910 100644 --- a/backend/canon_dr.h +++ b/backend/canon_dr.h @@ -1,12 +1,12 @@ #ifndef CANON_DR_H #define CANON_DR_H -/* +/* * Part of SANE - Scanner Access Now Easy. * Please see opening comments in canon_dr.c */ -/* ------------------------------------------------------------------------- +/* ------------------------------------------------------------------------- * This option list has to contain all options for all scanners supported by * this driver. If a certain scanner cannot handle a certain option, there's * still the possibility to say so, later. @@ -89,7 +89,7 @@ struct img_params int Bpl; /* in bytes */ int valid_width; /*some machines have black padding*/ - int valid_Bpl; + int valid_Bpl; /* done yet? */ int eof[2]; @@ -183,7 +183,7 @@ struct scanner int has_df; int has_df_ultra; int has_btc; - int has_ssm; /* older scanners use this set scan mode command */ + int has_ssm; /* older scanners use this set scan mode command */ int has_ssm2; /* newer scanners user this similar command */ int has_ssm_pay_head_len; /* newer scanners put the length twice in ssm */ int can_read_sensors; @@ -454,8 +454,8 @@ enum { #define DUPLEX_INTERLACE_2510 3 #define DUPLEX_INTERLACE_fFBb 4 -#define JPEG_INTERLACE_ALT 0 -#define JPEG_INTERLACE_NONE 1 +#define JPEG_INTERLACE_ALT 0 +#define JPEG_INTERLACE_NONE 1 #define CROP_RELATIVE 0 #define CROP_ABSOLUTE 1 diff --git a/backend/canon_pp-dev.c b/backend/canon_pp-dev.c index a357cf035..df7c4aa87 100644 --- a/backend/canon_pp-dev.c +++ b/backend/canon_pp-dev.c @@ -40,12 +40,12 @@ ----- - This file is part of the canon_pp backend, supporting Canon CanoScan - Parallel scanners and also distributed as part of the stand-alone driver. + This file is part of the canon_pp backend, supporting Canon CanoScan + Parallel scanners and also distributed as part of the stand-alone driver. canon_pp-dev.c: $Revision$ - Misc constants for Canon CanoScan Parallel scanners and high-level scan + Misc constants for Canon CanoScan Parallel scanners and high-level scan functions. Simon Krix @@ -105,7 +105,7 @@ struct scanner_hardware_desc { unsigned int type; }; -static const struct scanner_hardware_desc +static const struct scanner_hardware_desc /* The known scanner types */ hw_fb320p = { "FB320P", 2, 2, 3508, 2552, 0 }, hw_fb330p = { "FB330P", 2, 2, 3508, 0, 1 }, @@ -124,7 +124,7 @@ struct scanner_id { char *id; const struct scanner_hardware_desc *hw; }; -static const struct scanner_id scanner_id_table[] = { +static const struct scanner_id scanner_id_table[] = { { "CANON IX-03055C", &hw_fb320p }, { "CANON IX-06025C", &hw_fb620p }, { "CANON IX-03075E", &hw_fb330p }, @@ -139,15 +139,15 @@ static const int fileversion = 3; /* Internal functions */ static unsigned long column_sum(image_segment *image, int x); -static int adjust_output(image_segment *image, scan_parameters *scanp, +static int adjust_output(image_segment *image, scan_parameters *scanp, scanner_parameters *scannerp); static int check8(unsigned char *p, int s); /* Converts from weird scanner format -> sequential data */ -static void convdata(unsigned char *srcbuffer, unsigned char *dstbuffer, +static void convdata(unsigned char *srcbuffer, unsigned char *dstbuffer, int width, int mode); /* Sets up the scan command. This could use a better name (and a rewrite). */ -static int scanner_setup_params(unsigned char *buf, scanner_parameters *sp, +static int scanner_setup_params(unsigned char *buf, scanner_parameters *sp, scan_parameters *scanp); /* file reading and writing helpers */ @@ -155,7 +155,7 @@ static int safe_write(int fd, const char *p, unsigned long len); static int safe_read(int fd, char *p, unsigned long len); /* Command sending loop (waiting for ready status) */ -static int send_command(struct parport *port, unsigned char *buf, int bufsize, +static int send_command(struct parport *port, unsigned char *buf, int bufsize, int delay, int timeout); /* Commands ================================================ */ @@ -219,8 +219,8 @@ static unsigned char command_14[32] = 0, 0, 0, 0, 0x12, 0xd1, 0x14, 0x82, 0, 0, 0, 0, - 0x0f, 0xff, - 0x0f, 0xff, + 0x0f, 0xff, + 0x0f, 0xff, 0x0f, 0xff, 0, 0 }; #endif @@ -229,15 +229,15 @@ static unsigned char command_14[32] = /* * safe_write(): a small wrapper which ensures all the data is written in calls - * to write(), since the POSIX call doesn't ensure it. + * to write(), since the POSIX call doesn't ensure it. */ static int safe_write(int fd, const char *p, unsigned long len) { - int diff; + int diff; unsigned long total = 0; do { diff = write(fd, p+total, len-total); - if (diff < 0) + if (diff < 0) { if (errno == EINTR) continue; return -1; @@ -249,7 +249,7 @@ static int safe_write(int fd, const char *p, unsigned long len) { } -/* same dealie for read, except in the case of read the return of 0 bytes with +/* same dealie for read, except in the case of read the return of 0 bytes with * no INTR error indicates EOF */ static int safe_read(int fd, char *p, unsigned long len) { int diff; @@ -257,7 +257,7 @@ static int safe_read(int fd, char *p, unsigned long len) { do { diff = read(fd, p+total, len-total); - if (diff <= 0) + if (diff <= 0) { if (errno == EINTR) continue; if (diff == 0) return -2; @@ -282,7 +282,7 @@ int sanei_canon_pp_init_scan(scanner_parameters *sp, scan_parameters *scanp) /* Buffer for buffer info block */ unsigned char buffer_info_block[6]; - /* The image size the scanner says we asked for + /* The image size the scanner says we asked for (based on the scanner's replies) */ int true_scanline_size, true_scanline_count; @@ -301,7 +301,7 @@ int sanei_canon_pp_init_scan(scanner_parameters *sp, scan_parameters *scanp) if (send_command(sp->port, command_b, 56, 50000, 1000000)) return -1; - + /* Ask the scanner about the buffer */ if (send_command(sp->port, cmd_buf_status, 10, 50000, 1000000)) return -1; @@ -309,7 +309,7 @@ int sanei_canon_pp_init_scan(scanner_parameters *sp, scan_parameters *scanp) /* Read buffer information block */ sanei_canon_pp_read(sp->port, 6, buffer_info_block); - if (check8(buffer_info_block, 6)) + if (check8(buffer_info_block, 6)) DBG(1, "init_scan: ** Warning: Checksum error reading buffer " "info block.\n"); @@ -321,7 +321,7 @@ int sanei_canon_pp_init_scan(scanner_parameters *sp, scan_parameters *scanp) expected_scanline_size = scanp->width * 1.25; break; case 1: /* true-colour; 30 bits per pixel */ expected_scanline_size = scanp->width * 3.75; break; - default: + default: DBG(1, "init_scan: Illegal mode %i requested in " "init_scan().\n", scanp->mode); DBG(1, "This is a bug. Please report it.\n"); @@ -329,29 +329,29 @@ int sanei_canon_pp_init_scan(scanner_parameters *sp, scan_parameters *scanp) } /* The scanner's idea of the length of each scanline in bytes */ - true_scanline_size = (buffer_info_block[0]<<8) | buffer_info_block[1]; + true_scanline_size = (buffer_info_block[0]<<8) | buffer_info_block[1]; /* The scanner's idea of the number of scanlines in total */ - true_scanline_count = (buffer_info_block[2]<<8) | buffer_info_block[3]; + true_scanline_count = (buffer_info_block[2]<<8) | buffer_info_block[3]; - if ((expected_scanline_size != true_scanline_size) + if ((expected_scanline_size != true_scanline_size) || (expected_scanline_count != true_scanline_count)) { DBG(10, "init_scan: Warning: Scanner is producing an image " "of unexpected size:\n"); - DBG(10, "expected: %i bytes wide, %i scanlines tall.\n", - expected_scanline_size, + DBG(10, "expected: %i bytes wide, %i scanlines tall.\n", + expected_scanline_size, expected_scanline_count); - DBG(10, "true: %i bytes wide, %i scanlines tall.\n", + DBG(10, "true: %i bytes wide, %i scanlines tall.\n", true_scanline_size, true_scanline_count); if (scanp->mode == 0) scanp->width = true_scanline_size / 1.25; else - scanp->width = true_scanline_size / 3.75; + scanp->width = true_scanline_size / 3.75; scanp->height = true_scanline_count; } - return 0; + return 0; } @@ -373,7 +373,7 @@ int sanei_canon_pp_initialise(scanner_parameters *sp, int mode) DBG(50, "initialise: >> scanner_init\n"); if (sanei_canon_pp_scanner_init(sp->port)) { - /* If we're using an unsupported ieee1284 mode here, this is + /* If we're using an unsupported ieee1284 mode here, this is * where it will fail, so fall back to nibble. */ sanei_canon_pp_set_ieee1284_mode(M1284_NIBBLE); if (sanei_canon_pp_scanner_init(sp->port)) @@ -416,12 +416,12 @@ int sanei_canon_pp_initialise(scanner_parameters *sp, int mode) { hw = cur_id->hw; } - else if (sp->scanheadwidth == 5104) + else if (sp->scanheadwidth == 5104) { /* Guess 600dpi scanner */ hw = &hw_alien600; } - else if (sp->scanheadwidth == 2552) + else if (sp->scanheadwidth == 2552) { /* Guess 300dpi scanner */ hw = &hw_alien300; @@ -433,24 +433,24 @@ int sanei_canon_pp_initialise(scanner_parameters *sp, int mode) } strcpy(sp->name, hw->name); - sp->natural_xresolution = hw->natural_xresolution; - sp->natural_yresolution = hw->natural_yresolution; + sp->natural_xresolution = hw->natural_xresolution; + sp->natural_yresolution = hw->natural_yresolution; sp->scanbedlength = hw->scanbedlength; if (hw->scanheadwidth) sp->scanheadwidth = hw->scanheadwidth; sp->type = hw->type; - return 0; + return 0; } /* Shut scanner down */ int sanei_canon_pp_close_scanner(scanner_parameters *sp) { - /* Put scanner in transparent mode */ + /* Put scanner in transparent mode */ sanei_canon_pp_sleep_scanner(sp->port); /* Free memory (with purchase of memory of equal or greater value) */ - if (sp->blackweight != NULL) + if (sp->blackweight != NULL) { free(sp->blackweight); sp->blackweight = NULL; @@ -471,7 +471,7 @@ int sanei_canon_pp_close_scanner(scanner_parameters *sp) sp->blueweight = NULL; } - return 0; + return 0; } /* Read the calibration information from file */ @@ -497,7 +497,7 @@ int sanei_canon_pp_load_weights(const char *filename, scanner_parameters *sp) return -2; } - /* Read and check file version (the calibrate file + /* Read and check file version (the calibrate file format changes from time to time) */ ret = safe_read(fd, (char *)&temp, sizeof(int)); @@ -512,7 +512,7 @@ int sanei_canon_pp_load_weights(const char *filename, scanner_parameters *sp) if (((sp->blueweight = malloc(cal_data_size)) == NULL) || ((sp->redweight = malloc(cal_data_size)) == NULL) || ((sp->greenweight = malloc(cal_data_size)) == NULL) - || ((sp->blackweight = malloc(cal_data_size)) == NULL)) + || ((sp->blackweight = malloc(cal_data_size)) == NULL)) return -4; /* Read width of calibration data */ @@ -555,20 +555,20 @@ int sanei_canon_pp_load_weights(const char *filename, scanner_parameters *sp) } /* Read white-balance/gamma data */ - + if (safe_read(fd, (char *)&(sp->gamma), 32) < 0) { close(fd); return -10; } - close(fd); + close(fd); return 0; } /* Mode is 0 for greyscale source data or 1 for RGB */ -static void convert_to_rgb(image_segment *dest, unsigned char *src, +static void convert_to_rgb(image_segment *dest, unsigned char *src, int width, int scanlines, int mode) { int curline; @@ -581,23 +581,23 @@ static void convert_to_rgb(image_segment *dest, unsigned char *src, if (mode == 0) /* Grey */ { - convdata(src + (curline * scanline_size), - dest->image_data + + convdata(src + (curline * scanline_size), + dest->image_data + (curline * width * 2), width, 1); } else if (mode == 1) /* Truecolour */ { /* Red */ - convdata(src + (curline * scanline_size), - dest->image_data + + convdata(src + (curline * scanline_size), + dest->image_data + (curline * width *3*2) + 4, width, 2); /* Green */ - convdata(src + (curline * scanline_size) + colour_size, - dest->image_data + + convdata(src + (curline * scanline_size) + colour_size, + dest->image_data + (curline * width *3*2) + 2, width, 2); /* Blue */ - convdata(src + (curline * scanline_size) + - (2 * colour_size), dest->image_data + + convdata(src + (curline * scanline_size) + + (2 * colour_size), dest->image_data + (curline * width *3*2), width, 2); } @@ -605,7 +605,7 @@ static void convert_to_rgb(image_segment *dest, unsigned char *src, } -int sanei_canon_pp_read_segment(image_segment **dest, scanner_parameters *sp, +int sanei_canon_pp_read_segment(image_segment **dest, scanner_parameters *sp, scan_parameters *scanp, int scanline_number, int do_adjust, int scanlines_left) { @@ -646,8 +646,8 @@ int sanei_canon_pp_read_segment(image_segment **dest, scanner_parameters *sp, /* Allocate memory for dest image segment */ - output_image->image_data = - malloc(output_image->width * output_image->height * + output_image->image_data = + malloc(output_image->width * output_image->height * (scanp->mode ? 3 : 1) * 2); if (output_image->image_data == NULL) @@ -679,17 +679,17 @@ int sanei_canon_pp_read_segment(image_segment **dest, scanner_parameters *sp, if ((packet_header[2]<<8) + packet_header[3] != read_data_size) { - DBG(1, "read_segment: Error: Expected data size: %i bytes.\n", + DBG(1, "read_segment: Error: Expected data size: %i bytes.\n", read_data_size); DBG(1, "read_segment: Expecting %i bytes times %i " "scanlines.\n", scanline_size, scanline_number); - DBG(1, "read_segment: Actual data size: %i bytes.\n", + DBG(1, "read_segment: Actual data size: %i bytes.\n", (packet_header[2] << 8) + packet_header[3]); goto error_out; } /* Read scanlines_this_packet scanlines into the input buf */ - + if (sanei_canon_pp_read(sp->port, read_data_size, input_buffer)) { DBG(1, "read_segment: Segment read incorrectly, and we don't " @@ -697,11 +697,11 @@ int sanei_canon_pp_read_segment(image_segment **dest, scanner_parameters *sp, goto error_out; } - /* This is the only place we can abort safely - + /* This is the only place we can abort safely - * between reading one segment and requesting the next one. */ if (sp->abort_now) goto error_out; - if (scanlines_left >= (scanline_number * 2)) + if (scanlines_left >= (scanline_number * 2)) { DBG(100, "read_segment: Speculatively starting more scanning " "(%d left)\n", scanlines_left); @@ -711,7 +711,7 @@ int sanei_canon_pp_read_segment(image_segment **dest, scanner_parameters *sp, DBG(100, "read_segment: Convert to RGB\n"); /* Convert data */ - convert_to_rgb(output_image, input_buffer, scanp->width, + convert_to_rgb(output_image, input_buffer, scanp->width, scanline_number, scanp->mode); /* Adjust pixel readings according to calibration data */ @@ -724,10 +724,10 @@ int sanei_canon_pp_read_segment(image_segment **dest, scanner_parameters *sp, *dest = output_image; /* finished with this now */ free(input_buffer); - return 0; + return 0; error_out: - if (output_image && output_image->image_data) + if (output_image && output_image->image_data) free(output_image->image_data); if (output_image) free(output_image); if (input_buffer) free(input_buffer); @@ -735,13 +735,13 @@ int sanei_canon_pp_read_segment(image_segment **dest, scanner_parameters *sp, return -1; } -/* +/* check8: Calculates the checksum-8 for s bytes pointed to by p. For messages from the scanner, this should normally end up returning -0, since the last byte of most packets is the value that makes the +0, since the last byte of most packets is the value that makes the total up to 0 (or 256 if you're left-handed). -Hence, usage: if (check8(buffer, size)) {DBG(10, "checksum error!\n");} +Hence, usage: if (check8(buffer, size)) {DBG(10, "checksum error!\n");} Can also be used to generate valid checksums for sending to the scanner. */ @@ -756,13 +756,13 @@ static int check8(unsigned char *p, int s) { /* Converts from scanner format -> linear width is in pixels, not bytes. */ /* This function could use a rewrite */ -static void convdata(unsigned char *srcbuffer, unsigned char *dstbuffer, +static void convdata(unsigned char *srcbuffer, unsigned char *dstbuffer, int width, int mode) -/* This is a tricky (read: crap) function (read: hack) which is why I probably - spent more time commenting it than programming it. The thing to remember +/* This is a tricky (read: crap) function (read: hack) which is why I probably + spent more time commenting it than programming it. The thing to remember here is that the scanner uses interpolated scanlines, so it's - RRRRRRRGGGGGGBBBBBB not RGBRGBRGBRGBRGB. So, the calling function just - increments the destination pointer slightly to handle green, then a bit + RRRRRRRGGGGGGBBBBBB not RGBRGBRGBRGBRGB. So, the calling function just + increments the destination pointer slightly to handle green, then a bit more for blue. If you don't understand, tough. */ { int count; @@ -770,13 +770,13 @@ static void convdata(unsigned char *srcbuffer, unsigned char *dstbuffer, for (count = 0; count < width; count++) { - /* The scanner stores data in a bizzare butchered 10-bit + /* The scanner stores data in a bizzare butchered 10-bit format. I'll try to explain it in 100 words or less: - Scanlines are made up of groups of 4 pixels. Each group of - 4 is stored inside 5 bytes. The first 4 bytes of the group - contain the lowest 8 bits of one pixel each (in the right - order). The 5th byte contains the most significant 2 bits + Scanlines are made up of groups of 4 pixels. Each group of + 4 is stored inside 5 bytes. The first 4 bytes of the group + contain the lowest 8 bits of one pixel each (in the right + order). The 5th byte contains the most significant 2 bits of each pixel in the same order. */ i = srcbuffer[count + (count >> 2)]; /* Low byte for pixel */ @@ -784,7 +784,7 @@ static void convdata(unsigned char *srcbuffer, unsigned char *dstbuffer, j = j >> ((count % 4) * 2); /* Get upper 2 bits of intensity */ j = j & 0x03; /* Can't hurt */ /* And the final 10-bit pixel value is: */ - k = (j << 8) | i; + k = (j << 8) | i; /* now we return this as a 16 bit value */ k = k << 6; @@ -797,17 +797,17 @@ static void convdata(unsigned char *srcbuffer, unsigned char *dstbuffer, else if (mode == 2) /* Scanner -> RGB */ { dstbuffer[count * 3 * 2] = HIGH_BYTE(k); - dstbuffer[(count * 3 * 2) + 1] = LOW_BYTE(k); + dstbuffer[(count * 3 * 2) + 1] = LOW_BYTE(k); } } } -static int adjust_output(image_segment *image, scan_parameters *scanp, +static int adjust_output(image_segment *image, scan_parameters *scanp, scanner_parameters *scannerp) /* Needing a good cleanup */ { - /* light and dark points for the CCD sensor in question + /* light and dark points for the CCD sensor in question * (stored in file as 0-1024, scaled to 0-65536) */ unsigned long hi, lo; /* The result of our calculations */ @@ -827,70 +827,70 @@ static int adjust_output(image_segment *image, scan_parameters *scanp, { /* Figure out CCD sensor number */ /* MAGIC FORMULA ALERT! */ - ccd = (pixelnum << (scannerp->natural_xresolution - - scanp->xresolution)) + (1 << - (scannerp->natural_xresolution + ccd = (pixelnum << (scannerp->natural_xresolution - + scanp->xresolution)) + (1 << + (scannerp->natural_xresolution - scanp->xresolution)) - 1; - scaled_xoff = scanp->xoffset << - (scannerp->natural_xresolution - + scaled_xoff = scanp->xoffset << + (scannerp->natural_xresolution - scanp->xresolution); - ccd += scaled_xoff; + ccd += scaled_xoff; for (colour = 0; colour < cols; colour++) { /* Address of pixel under scrutiny */ - pixel_address = + pixel_address = (scanline * image->width * cols * 2) + (pixelnum * cols * 2) + (colour * 2); - /* Dark value is easy + /* Dark value is easy * Range of lo is 0-18k */ lo = (scannerp->blackweight[ccd]) * 3; - /* Light value depends on the colour, + /* Light value depends on the colour, * and is an average in greyscale mode. */ if (scanp->mode == 1) /* RGB */ { switch (colour) { - case 0: hi = scannerp->redweight[ccd] * 3; + case 0: hi = scannerp->redweight[ccd] * 3; break; - case 1: hi = scannerp->greenweight[ccd] * 3; + case 1: hi = scannerp->greenweight[ccd] * 3; break; - default: hi = scannerp->blueweight[ccd] * 3; + default: hi = scannerp->blueweight[ccd] * 3; break; } } else /* Grey - scanned using green */ { - hi = scannerp->greenweight[ccd] * 3; + hi = scannerp->greenweight[ccd] * 3; } - /* Check for bad calibration data as it + /* Check for bad calibration data as it can cause a divide-by-0 error */ if (hi <= lo) { DBG(1, "adjust_output: Bad cal data!" " hi: %ld lo: %ld\n" "Recalibrate, that " - "should fix it.\n", + "should fix it.\n", hi, lo); return -1; } /* Start with the pixel value in result */ - result = MAKE_SHORT(*(image->image_data + - pixel_address), - *(image->image_data + + result = MAKE_SHORT(*(image->image_data + + pixel_address), + *(image->image_data + pixel_address + 1)); result = result >> 6; /* Range now = 0-1023 */ /* if (scanline == 10) DBG(200, "adjust_output: Initial pixel" - " value: %ld\n", + " value: %ld\n", result); */ result *= 54; /* Range now = 0-54k */ @@ -913,13 +913,13 @@ static int adjust_output(image_segment *image, scan_parameters *scanp, { DBG(200, "adjust_output: %d: base = " "%lu, result %lu (%lu " - "- %lu)\n", pixelnum, + "- %lu)\n", pixelnum, result, temp, lo, hi); - } + } */ result = temp; - /* Store the value back where it came + /* Store the value back where it came * from (always bigendian) */ *(image->image_data + pixel_address) = HIGH_BYTE(result); @@ -934,7 +934,7 @@ static int adjust_output(image_segment *image, scan_parameters *scanp, /* Calibration run. Aborting allowed at "safe" points where the scanner won't * be left in a crap state. */ -int sanei_canon_pp_calibrate(scanner_parameters *sp, char *cal_file) +int sanei_canon_pp_calibrate(scanner_parameters *sp, char *cal_file) { int count, readnum, colournum, scanlinenum; int outfile; @@ -962,11 +962,11 @@ int sanei_canon_pp_calibrate(scanner_parameters *sp, char *cal_file) if (sp->abort_now) return -1; DBG(40, "Calibrating %ix%i pixels calibration image " - "(%i bytes each scan).\n", - sp->scanheadwidth, scanline_count, + "(%i bytes each scan).\n", + sp->scanheadwidth, scanline_count, scanline_size * scanline_count); - /* Allocate memory for calibration data */ + /* Allocate memory for calibration data */ sp->blackweight = (unsigned long *) calloc(sizeof(unsigned long), sp->scanheadwidth); sp->redweight = (unsigned long *) @@ -981,7 +981,7 @@ int sanei_canon_pp_calibrate(scanner_parameters *sp, char *cal_file) databuf = malloc(scanline_size * scanline_count * calibration_reads*3); /* And allocate space for converted image data in this image_segment */ - image.image_data = malloc(scanline_count * sp->scanheadwidth * 2 * + image.image_data = malloc(scanline_count * sp->scanheadwidth * 2 * calibration_reads); image.width = sp->scanheadwidth; image.height = scanline_count * calibration_reads; @@ -996,7 +996,7 @@ int sanei_canon_pp_calibrate(scanner_parameters *sp, char *cal_file) DBG(40, "Step 1/3: Calibrating black level...\n"); for (readnum = 0; readnum < calibration_reads; readnum++) { - DBG(40, " * Black scan number %d/%d.\n", readnum + 1, + DBG(40, " * Black scan number %d/%d.\n", readnum + 1, calibration_reads); if (sp->abort_now) return -1; @@ -1007,32 +1007,32 @@ int sanei_canon_pp_calibrate(scanner_parameters *sp, char *cal_file) free (image.image_data); free(databuf); return -1; - + } /* Black reference data */ sanei_canon_pp_read(sp->port, scanline_size * scanline_count, - databuf + + databuf + (readnum * scanline_size * scanline_count)); } /* Convert scanner format to a greyscale 16bpp image */ - for (scanlinenum = 0; - scanlinenum < scanline_count * calibration_reads; + for (scanlinenum = 0; + scanlinenum < scanline_count * calibration_reads; scanlinenum++) { - convdata(databuf + (scanlinenum * scanline_size), - image.image_data + - (scanlinenum * sp->scanheadwidth*2), + convdata(databuf + (scanlinenum * scanline_size), + image.image_data + + (scanlinenum * sp->scanheadwidth*2), sp->scanheadwidth, 1); } /* Take column totals */ for (count = 0; count < sp->scanheadwidth; count++) { - /* Value is normalised as if we took 6 scanlines, even if we + /* Value is normalised as if we took 6 scanlines, even if we * didn't (620P I'm looking at you!) */ - sp->blackweight[count] = (column_sum(&image, count) * 6) + sp->blackweight[count] = (column_sum(&image, count) * 6) / scanline_count >> 6; } @@ -1057,7 +1057,7 @@ int sanei_canon_pp_calibrate(scanner_parameters *sp, char *cal_file) DBG(20, " * Snoozing for 15 seconds while the scanner calibrates..."); usleep(15000000); DBG(40, "done.\n"); - + DBG(40, " * Requesting gamma table values..."); if (send_command(sp->port, cmd_readgamma, 10, 100000, 10000000)) { @@ -1088,7 +1088,7 @@ int sanei_canon_pp_calibrate(scanner_parameters *sp, char *cal_file) command_buffer[3] = colournum; for (readnum = 0; readnum < 3; readnum++) { - DBG(10, " * %s sensors, scan number %d/%d.\n", + DBG(10, " * %s sensors, scan number %d/%d.\n", colours[colournum-1], readnum + 1, calibration_reads); @@ -1102,20 +1102,20 @@ int sanei_canon_pp_calibrate(scanner_parameters *sp, char *cal_file) return -1; } - sanei_canon_pp_read(sp->port, scanline_size * - scanline_count, databuf + - (readnum * scanline_size * + sanei_canon_pp_read(sp->port, scanline_size * + scanline_count, databuf + + (readnum * scanline_size * scanline_count)); } /* Convert colour data from scanner format to RGB data */ - for (scanlinenum = 0; scanlinenum < scanline_count * + for (scanlinenum = 0; scanlinenum < scanline_count * calibration_reads; scanlinenum++) { - convdata(databuf + (scanlinenum * scanline_size), - image.image_data + - (scanlinenum * sp->scanheadwidth * 2), + convdata(databuf + (scanlinenum * scanline_size), + image.image_data + + (scanlinenum * sp->scanheadwidth * 2), sp->scanheadwidth, 1); } @@ -1123,14 +1123,14 @@ int sanei_canon_pp_calibrate(scanner_parameters *sp, char *cal_file) for (count = 0; count < sp->scanheadwidth; count++) { if (colournum == 1) - sp->redweight[count] = - column_sum(&image, count) >> 6; + sp->redweight[count] = + column_sum(&image, count) >> 6; else if (colournum == 2) - sp->greenweight[count] = - column_sum(&image, count) >> 6; + sp->greenweight[count] = + column_sum(&image, count) >> 6; else - sp->blueweight[count] = - column_sum(&image, count) >> 6; + sp->blueweight[count] = + column_sum(&image, count) >> 6; } } @@ -1154,19 +1154,19 @@ int sanei_canon_pp_calibrate(scanner_parameters *sp, char *cal_file) DBG(10, "Write error on calibration file %s", cal_file); /* Data */ - if (safe_write(outfile, (char *)&(sp->scanheadwidth), + if (safe_write(outfile, (char *)&(sp->scanheadwidth), sizeof(sp->scanheadwidth)) < 0) DBG(10, "Write error on calibration file %s", cal_file); - if (safe_write(outfile, (char *)(sp->blackweight), + if (safe_write(outfile, (char *)(sp->blackweight), sp->scanheadwidth * sizeof(long)) < 0) DBG(10, "Write error on calibration file %s", cal_file); - if (safe_write(outfile, (char *)(sp->redweight), + if (safe_write(outfile, (char *)(sp->redweight), sp->scanheadwidth * sizeof(long)) < 0) DBG(10, "Write error on calibration file %s", cal_file); - if (safe_write(outfile, (char *)(sp->greenweight), + if (safe_write(outfile, (char *)(sp->greenweight), sp->scanheadwidth * sizeof(long)) < 0) DBG(10, "Write error on calibration file %s", cal_file); - if (safe_write(outfile, (char *)(sp->blueweight), + if (safe_write(outfile, (char *)(sp->blueweight), sp->scanheadwidth * sizeof(long)) < 0) DBG(10, "Write error on calibration file %s", cal_file); if (safe_write(outfile, (char *)(sp->gamma), 32) < 0) @@ -1198,7 +1198,7 @@ static unsigned long column_sum(image_segment *image, int x) } -static int scanner_setup_params(unsigned char *buf, scanner_parameters *sp, +static int scanner_setup_params(unsigned char *buf, scanner_parameters *sp, scan_parameters *scanp) { int scaled_width, scaled_height; @@ -1218,14 +1218,14 @@ static int scanner_setup_params(unsigned char *buf, scanner_parameters *sp, buf[3] = 0x58; } - scaled_width = scanp->width << + scaled_width = scanp->width << (sp->natural_xresolution - scanp->xresolution); /* YO! This needs fixing if we ever use yresolution! */ - scaled_height = scanp->height << + scaled_height = scanp->height << (sp->natural_xresolution - scanp->xresolution); - scaled_xoff = scanp->xoffset << + scaled_xoff = scanp->xoffset << (sp->natural_xresolution - scanp->xresolution); - scaled_yoff = scanp->yoffset << + scaled_yoff = scanp->yoffset << (sp->natural_xresolution - scanp->xresolution); /* Input resolution */ @@ -1247,7 +1247,7 @@ static int scanner_setup_params(unsigned char *buf, scanner_parameters *sp, buf[14] = (scaled_yoff & 0xff00) >> 8; buf[15] = scaled_yoff & 0xff; - /* Width of image to be scanned */ + /* Width of image to be scanned */ buf[16] = (scaled_width & 0xff000000) >> 24; buf[17] = (scaled_width & 0xff0000) >> 16; buf[18] = (scaled_width & 0xff00) >> 8; @@ -1260,7 +1260,7 @@ static int scanner_setup_params(unsigned char *buf, scanner_parameters *sp, buf[23] = scaled_height & 0xff; - /* These appear to be the only two colour mode possibilities. + /* These appear to be the only two colour mode possibilities. Pure black-and-white mode probably just uses greyscale and then gets its contrast adjusted by the driver. I forget. */ if (scanp->mode == 1) /* Truecolour */ @@ -1307,15 +1307,15 @@ int sanei_canon_pp_sleep_scanner(struct parport *port) int sanei_canon_pp_detect(struct parport *port, int mode) { /*int caps;*/ - /* This code needs to detect whether or not a scanner is present on - * the port, quickly and reliably. Fast version of - * sanei_canon_pp_initialise() + /* This code needs to detect whether or not a scanner is present on + * the port, quickly and reliably. Fast version of + * sanei_canon_pp_initialise() * - * If this detect returns true, a more comprehensive check will + * If this detect returns true, a more comprehensive check will * be conducted - * Return values: + * Return values: * 0 = scanner present - * anything else = scanner not present + * anything else = scanner not present * PRE: port is open/unclaimed * POST: port is closed/unclaimed */ @@ -1343,9 +1343,9 @@ int sanei_canon_pp_detect(struct parport *port, int mode) return 0; } -static int send_command(struct parport *port, unsigned char *buf, int bufsize, +static int send_command(struct parport *port, unsigned char *buf, int bufsize, int delay, int timeout) -/* Sends a command until the scanner says it is ready. +/* Sends a command until the scanner says it is ready. * sleeps for delay microsecs between reads * returns -1 on error, -2 on timeout */ { @@ -1359,7 +1359,7 @@ static int send_command(struct parport *port, unsigned char *buf, int bufsize, /* sleep a bit */ usleep(delay); - } while (sanei_canon_pp_check_status(port) && + } while (sanei_canon_pp_check_status(port) && retries++ < (timeout/delay)); if (retries >= (timeout/delay)) return -2; diff --git a/backend/canon_pp-dev.h b/backend/canon_pp-dev.h index e8f36a8a8..4ad2e45e1 100644 --- a/backend/canon_pp-dev.h +++ b/backend/canon_pp-dev.h @@ -42,7 +42,7 @@ canon_pp-dev.h: $Revision$ - This file is part of the canon_pp backend, supporting Canon FBX30P + This file is part of the canon_pp backend, supporting Canon FBX30P and NX40P scanners and also part of the stand-alone driver. Simon Krix @@ -105,9 +105,9 @@ typedef struct scanner_parameter_struct int max_xresolution; int max_yresolution; - /* ID String. Should only be 38(?) bytes long, so we can + /* ID String. Should only be 38(?) bytes long, so we can reduce the size later. */ - char id_string[80]; + char id_string[80]; /* Short, readable scanner name, such as "FB330P" */ char name[40]; @@ -120,7 +120,7 @@ typedef struct scanner_parameter_struct unsigned long *blueweight; /* Not understood white-balance/gain values */ - unsigned char gamma[32]; + unsigned char gamma[32]; /* Type of scanner ( 0 = *20P, 1 = [*30P|*40P] ) */ unsigned char type; @@ -154,7 +154,7 @@ typedef struct image_segment_struct /* Scan-related functions ========================= */ -/* Brings the scanner in and out of transparent mode +/* Brings the scanner in and out of transparent mode and detects model information */ int sanei_canon_pp_initialise(scanner_parameters *sp, int mode); int sanei_canon_pp_close_scanner(scanner_parameters *sp); @@ -162,7 +162,7 @@ int sanei_canon_pp_close_scanner(scanner_parameters *sp); /* Image scanning functions */ int sanei_canon_pp_init_scan(scanner_parameters *sp, scan_parameters *scanp); -int sanei_canon_pp_read_segment(image_segment **dest, scanner_parameters *sp, +int sanei_canon_pp_read_segment(image_segment **dest, scanner_parameters *sp, scan_parameters *scanp, int scanline_count, int do_adjust, int scanlines_left); diff --git a/backend/canon_pp-io.c b/backend/canon_pp-io.c index 881ac2436..97ee5265d 100644 --- a/backend/canon_pp-io.c +++ b/backend/canon_pp-io.c @@ -41,7 +41,7 @@ ----- This file is part of the canon_pp backend, supporting Canon CanoScan - Parallel scanners and also distributed as part of the stand-alone driver. + Parallel scanners and also distributed as part of the stand-alone driver. canon_pp-io.c: $Revision$ @@ -89,8 +89,8 @@ static void DBG(int level, const char *format, ...) /* 0x00 = Nibble Mode (M1284_NIBBLE) 0x10 = ECP Mode (M1284_ECP) - The scanner driver seems not to support ECP RLE mode - (which is a huge bummer because compression would be + The scanner driver seems not to support ECP RLE mode + (which is a huge bummer because compression would be ace) nor EPP mode. */ static int ieee_mode = M1284_NIBBLE; @@ -109,12 +109,12 @@ static void scanner_chessboard_control(struct parport *port); static void scanner_chessboard_data(struct parport *port, int mode); /* Used by read_data */ -static int ieee_transfer(struct parport *port, int length, +static int ieee_transfer(struct parport *port, int length, unsigned char *data); /* Low level functions */ static int readstatus(struct parport *port); -static int expect(struct parport *port, const char *step, int s, +static int expect(struct parport *port, const char *step, int s, int mask, unsigned int delay); /* Port-level functions */ @@ -124,7 +124,7 @@ static void outboth(struct parport *port, int d, int c); /************************************/ -/* +/* * IEEE 1284 defines many values for m, * but these scanners only support 2: nibble and ECP modes. * And no data compression either (argh!) @@ -144,7 +144,7 @@ int sanei_canon_pp_wake_scanner(struct parport *port, int mode) int i = 0; int tmp; int max_cycles = 3; - + tmp = readstatus(port); /* Reset only works on 30/40 models */ @@ -171,7 +171,7 @@ int sanei_canon_pp_wake_scanner(struct parport *port, int mode) scanner_chessboard_control(port); scanner_chessboard_data(port, mode); - if (expect(port, NULL, 0x03, 0x1f, 800000) && + if (expect(port, NULL, 0x03, 0x1f, 800000) && (mode == INITMODE_AUTO)) { /* 630 Style init failed, try 620 style */ @@ -187,7 +187,7 @@ int sanei_canon_pp_wake_scanner(struct parport *port, int mode) usleep(100000); } - } while ((i < max_cycles) && (!expect(port,"Scanner wakeup reply 2", + } while ((i < max_cycles) && (!expect(port,"Scanner wakeup reply 2", 0x03, 0x1f, 100000) == 0)); /* Block just after chessboarding @@ -201,7 +201,7 @@ int sanei_canon_pp_wake_scanner(struct parport *port, int mode) return -1; outboth(port, 0, NSELECTIN | NINIT | HOSTCLK); /* Clear D, C3+, C1- */ - /* If we had to try the wakeup cycle more than once, we should wait + /* If we had to try the wakeup cycle more than once, we should wait * here for 10 seconds to let the scanner pull itself together - * it can actually take longer, but I can't wait that long! */ if (i > 1) @@ -227,7 +227,7 @@ int sanei_canon_pp_write(struct parport *port, int length, unsigned char *data) DBG(10,"%02x ", data[count]); if (count % 20 == 19) DBG(10,"\n "); - } + } if (count % 20 != 19) DBG(10,"\n"); #endif @@ -238,20 +238,20 @@ int sanei_canon_pp_write(struct parport *port, int length, unsigned char *data) case M1284_BECP: case M1284_ECPRLE: case M1284_ECPSWE: - case M1284_ECP: + case M1284_ECP: ieee1284_negotiate(port, ieee_mode); - if (ieee1284_ecp_write_data(port, 0, (char *)data, + if (ieee1284_ecp_write_data(port, 0, (char *)data, length) != length) return -1; break; - case M1284_NIBBLE: - if (ieee1284_compat_write(port, 0, (char *)data, + case M1284_NIBBLE: + if (ieee1284_compat_write(port, 0, (char *)data, length) != length) return -1; break; default: DBG(0, "Invalid mode in write!\n"); - } + } DBG(100, "<< write"); @@ -265,7 +265,7 @@ int sanei_canon_pp_read(struct parport *port, int length, unsigned char *data) DBG(200, "NEW read_data (%i bytes):\n", length); ieee1284_negotiate(port, ieee_mode); - /* This is special; Nibble mode needs a little + /* This is special; Nibble mode needs a little extra help from us. */ if (ieee_mode == M1284_NIBBLE) @@ -275,7 +275,7 @@ int sanei_canon_pp_read(struct parport *port, int length, unsigned char *data) if (expect(port, "Read Data 1", 0, NDATAAVAIL, 6000000)) { DBG(10,"Error 1\n"); - ieee1284_terminate(port); + ieee1284_terminate(port); return 1; } outcont(port, HOSTBUSY, HOSTBUSY); @@ -283,7 +283,7 @@ int sanei_canon_pp_read(struct parport *port, int length, unsigned char *data) if (expect(port, "Read Data 2", NACK, NACK, 1000000)) { DBG(1,"Error 2\n"); - ieee1284_terminate(port); + ieee1284_terminate(port); return 1; } if (expect(port, "Read Data 3 (Ready?)", 0, PERROR, 1000000)) @@ -319,7 +319,7 @@ int sanei_canon_pp_read(struct parport *port, int length, unsigned char *data) /* If 0 bytes were transferred, it's a legal "No data" condition (I think). Otherwise, it may have run out of buffer.. keep reading*/ - + if (count < 0) { DBG(10, "Couldn't read enough data (need %d more " "of %d)\n", length+count,length+offset); @@ -344,14 +344,14 @@ int sanei_canon_pp_read(struct parport *port, int length, unsigned char *data) DBG(10,"%02x ", data[count]); if (count % 20 == 19) DBG(10,"\n "); - } + } if (count % 20 != 19) DBG(10,"\n"); } else { DBG(10,"Read: %i bytes\n", length); - } + } #endif if (ieee_mode == M1284_NIBBLE) @@ -367,17 +367,17 @@ static int ieee_transfer(struct parport *port, int length, unsigned char *data) DBG(100, "IEEE transfer (%i bytes)\n", length); - switch (ieee_mode) + switch (ieee_mode) { case M1284_BECP: case M1284_ECP: case M1284_ECPRLE: case M1284_ECPSWE: - result = ieee1284_ecp_read_data(port, 0, (char *)data, + result = ieee1284_ecp_read_data(port, 0, (char *)data, length); break; case M1284_NIBBLE: - result = ieee1284_nibble_read(port, 0, (char *)data, + result = ieee1284_nibble_read(port, 0, (char *)data, length); break; default: @@ -405,22 +405,22 @@ int sanei_canon_pp_check_status(struct parport *port) { case 0x0606: DBG(200, "Ready - 0x0606\n"); - return 0; + return 0; break; case 0x1414: - DBG(200, "Busy - 0x1414\n"); + DBG(200, "Busy - 0x1414\n"); return 1; break; case 0x0805: - DBG(200, "Resetting - 0x0805\n"); + DBG(200, "Resetting - 0x0805\n"); return 3; break; case 0x1515: DBG(1, "!! Invalid Command - 0x1515\n"); - return 2; + return 2; break; case 0x0000: - DBG(200, "Nothing - 0x0000"); + DBG(200, "Nothing - 0x0000"); return 4; break; @@ -451,9 +451,9 @@ static void outboth(struct parport *port, int d, int c) { ieee1284_write_data(port, d & 0xff); outcont(port, c, 0x0f); -} +} -/* readstatus(): +/* readstatus(): Returns the LOGIC value of the S register (ie: all input lines) shifted right to to make it easier to read. Note: S5 is inverted by ieee1284_read_status so we don't need to */ @@ -472,7 +472,7 @@ static void scanner_chessboard_control(struct parport *port) outcont(port, 13, 0xf); usleep(10); outcont(port, 7, 0xf); - usleep(10); + usleep(10); } static void scanner_chessboard_data(struct parport *port, int mode) @@ -490,28 +490,28 @@ static void scanner_chessboard_data(struct parport *port, int mode) outdata(port, 0x55); else outdata(port, 0x33); - outcont(port, HOSTBUSY, HOSTBUSY); + outcont(port, HOSTBUSY, HOSTBUSY); usleep(10); - outcont(port, 0, HOSTBUSY); + outcont(port, 0, HOSTBUSY); usleep(10); - outcont(port, HOSTBUSY, HOSTBUSY); + outcont(port, HOSTBUSY, HOSTBUSY); usleep(10); if (mode == INITMODE_20P) outdata(port, 0xaa); else outdata(port, 0xcc); - outcont(port, HOSTBUSY, HOSTBUSY); + outcont(port, HOSTBUSY, HOSTBUSY); usleep(10); - outcont(port, 0, HOSTBUSY); + outcont(port, 0, HOSTBUSY); usleep(10); - outcont(port, HOSTBUSY, HOSTBUSY); + outcont(port, HOSTBUSY, HOSTBUSY); usleep(10); } } /* Reset the scanner. At least, it works 50% of the time. */ -static int scanner_reset(struct parport *port) +static int scanner_reset(struct parport *port) { /* Resetting only works for the *30Ps, sorry */ @@ -545,7 +545,7 @@ static int scanner_reset(struct parport *port) outcont(port, 0x0f, 0xf); /* All lines must be 1. */ /* All lines 1 */ - if (expect(port, "Reset 2 response 2 (READY)", + if (expect(port, "Reset 2 response 2 (READY)", 0x1f, 0x1f, 500000)) return 1; @@ -556,9 +556,9 @@ static int scanner_reset(struct parport *port) return 0; } -/* A timed version of expect, which will wait for delay before erroring +/* A timed version of expect, which will wait for delay before erroring This is the one and only one we should be using */ -static int expect(struct parport *port, const char *msg, int s, +static int expect(struct parport *port, const char *msg, int s, int mask, unsigned int delay) { struct timeval tv; @@ -591,7 +591,7 @@ int sanei_canon_pp_scanner_init(struct parport *port) /* In Windows, this is always ECP (or an attempt at it) */ if (sanei_canon_pp_write(port, 10, cmd_init)) return -1; - /* Note that we don't really mind what the status was as long as it + /* Note that we don't really mind what the status was as long as it * wasn't a read error (returns -1) */ /* In fact, the 620P gives an error on that last command, but they * keep going anyway */ @@ -605,7 +605,7 @@ int sanei_canon_pp_scanner_init(struct parport *port) if (tmp < 0) return -1; DBG(10, "scanner_init: Giving the scanner a snooze...\n"); - usleep(500000); + usleep(500000); tries++; diff --git a/backend/canon_pp-io.h b/backend/canon_pp-io.h index 376af8a23..ad04180ee 100644 --- a/backend/canon_pp-io.h +++ b/backend/canon_pp-io.h @@ -42,7 +42,7 @@ canon_pp-io.h: $Revision$ - This file is part of the canon_pp backend, supporting Canon FBX30P + This file is part of the canon_pp backend, supporting Canon FBX30P and NX40P scanners and also distributed as part of the stand-alone driver. @@ -50,14 +50,14 @@ */ #ifndef CANON_PP_IO_H -#define CANON_PP_IO_H +#define CANON_PP_IO_H /* Actual Interface */ void sanei_canon_pp_set_ieee1284_mode(int m); int sanei_canon_pp_wake_scanner(struct parport *port, int mode); -int sanei_canon_pp_write(struct parport *port, int length, +int sanei_canon_pp_write(struct parport *port, int length, unsigned char *data); -int sanei_canon_pp_read(struct parport *port, int length, +int sanei_canon_pp_read(struct parport *port, int length, unsigned char *data); int sanei_canon_pp_check_status(struct parport *port); int sanei_canon_pp_scanner_init(struct parport *port); diff --git a/backend/canon_pp.c b/backend/canon_pp.c index cc7c27ee1..822eaf175 100644 --- a/backend/canon_pp.c +++ b/backend/canon_pp.c @@ -42,7 +42,7 @@ canon_pp.c: $Revision$ - This file is part of the canon_pp backend, supporting Canon FBX30P + This file is part of the canon_pp backend, supporting Canon FBX30P and NX40P scanners */ @@ -114,9 +114,9 @@ static SANE_Bool force_nibble = SANE_FALSE; /* Constants */ /* Colour Modes */ -static const SANE_String_Const cmodes[] = { - SANE_VALUE_SCAN_MODE_GRAY, - SANE_VALUE_SCAN_MODE_COLOR, +static const SANE_String_Const cmodes[] = { + SANE_VALUE_SCAN_MODE_GRAY, + SANE_VALUE_SCAN_MODE_COLOR, NULL }; /* bit depths */ @@ -139,7 +139,7 @@ static const SANE_Int res600[] = {4, 75, 150, 300, 600}; sane_init (SANE_Int *vc, SANE_Auth_Callback cb) { SANE_Status status = SANE_STATUS_GOOD; - int i, tmp; + int i, tmp; int tmp_im = INITMODE_AUTO; FILE *fp; char line[81]; /* plus 1 for a null */ @@ -150,7 +150,7 @@ sane_init (SANE_Int *vc, SANE_Auth_Callback cb) DBG_INIT(); #if defined PACKAGE && defined VERSION - DBG(2, ">> sane_init (version %s null, authorize %s null): " PACKAGE " " VERSION "\n", + DBG(2, ">> sane_init (version %s null, authorize %s null): " PACKAGE " " VERSION "\n", (vc) ? "!=" : "==", (cb) ? "!=" : "=="); #endif @@ -192,8 +192,8 @@ sane_init (SANE_Int *vc, SANE_Auth_Callback cb) /* just to be extra sure, the line will always have an end: */ line[sizeof(line)-1] = '\0'; - /* - * Read information from config file: pixel weight location and default + /* + * Read information from config file: pixel weight location and default * port. */ if((fp = sanei_config_open(CANONP_CONFIG_FILE))) @@ -208,24 +208,24 @@ sane_init (SANE_Int *vc, SANE_Auth_Callback cb) if(strncmp(line,"calibrate ", 10) == 0) { - /* warning: pointer trickyness ahead + /* warning: pointer trickyness ahead * Do not free tmp_port! */ - DBG(40, "sane_init: calibrate line, %s\n", + DBG(40, "sane_init: calibrate line, %s\n", line); tmp_wf = strdup(line+10); tmp_port = strstr(tmp_wf, " "); if ((tmp_port == tmp_wf) || (tmp_port == NULL)) { - /* They have used an old style config + /* They have used an old style config * file which does not specify scanner * Assume first port */ DBG(1, "sane_init: old config line:" "\"%s\". Please add " - "a port argument.\n", + "a port argument.\n", line); /* first_dev should never be null here - * because we found at least one + * because we found at least one * parallel port above */ first_dev->weights_file = tmp_wf; DBG(100, "sane_init: Successfully " @@ -236,7 +236,7 @@ sane_init (SANE_Int *vc, SANE_Auth_Callback cb) } - /* Now find which scanner wants + /* Now find which scanner wants * this calibration file */ s_tmp = first_dev; DBG(100, "sane_init: Finding scanner on port " @@ -247,7 +247,7 @@ sane_init (SANE_Int *vc, SANE_Auth_Callback cb) tmp_port+1)) { DBG(100, "sane_init: Found!\n"); - /* Now terminate the weight + /* Now terminate the weight * file string */ *tmp_port = '\0'; s_tmp->weights_file = tmp_wf; @@ -255,7 +255,7 @@ sane_init (SANE_Int *vc, SANE_Auth_Callback cb) "cal, for port" " '%s', weight" " file is '%s'" - ".\n", + ".\n", s_tmp->params. port->name, tmp_wf); @@ -295,7 +295,7 @@ sane_init (SANE_Int *vc, SANE_Auth_Callback cb) if(strncmp(line,"init_mode ", 10) == 0) { - /* parse what sort of initialisation mode to + /* parse what sort of initialisation mode to * use */ if (strncmp(line+10, "FB620P", 6) == 0) tmp_im = INITMODE_20P; @@ -311,7 +311,7 @@ sane_init (SANE_Int *vc, SANE_Auth_Callback cb) if (tmp_port == NULL) { /* first_dev should never be null here - * because we found at least one + * because we found at least one * parallel port above */ first_dev->init_mode = tmp_im; DBG(100, "sane_init: Parsed init-1.\n"); @@ -344,9 +344,9 @@ sane_init (SANE_Int *vc, SANE_Auth_Callback cb) } DBG(1, "sane_init: Unknown configuration command!"); - } + } fclose (fp); - } + } /* There should now be a LL of ports starting at first_dev */ @@ -355,23 +355,23 @@ sane_init (SANE_Int *vc, SANE_Auth_Callback cb) /* Assume there's no scanner present until proven otherwise */ s_tmp->scanner_present = SANE_FALSE; - /* Try to detect if there's a scanner there, and if so, + /* Try to detect if there's a scanner there, and if so, * what sort of scanner it is */ status = detect_mode(s_tmp); - if (status != SANE_STATUS_GOOD) + if (status != SANE_STATUS_GOOD) { DBG(10,"sane_init: Error detecting port mode on %s!\n", s_tmp->params.port->name); s_tmp->scanner_present = SANE_FALSE; continue; - } - + } + /* detect_mode suceeded, so the port is open. This beholdens * us to call ieee1284_close in any of the remaining error * cases in this loop. */ #if 0 - tmp = sanei_canon_pp_detect(s_tmp->params.port, + tmp = sanei_canon_pp_detect(s_tmp->params.port, s_tmp->init_mode); @@ -383,7 +383,7 @@ sane_init (SANE_Int *vc, SANE_Auth_Callback cb) s_tmp->ieee1284_mode = M1284_NIBBLE; sanei_canon_pp_set_ieee1284_mode(s_tmp->ieee1284_mode); - tmp = sanei_canon_pp_detect(s_tmp->params.port, + tmp = sanei_canon_pp_detect(s_tmp->params.port, s_tmp->init_mode); } /* still no go? */ @@ -395,7 +395,7 @@ sane_init (SANE_Int *vc, SANE_Auth_Callback cb) ieee1284_close(s_tmp->params.port); continue; } - + #endif /* all signs point to yes, try it out */ if (ieee1284_claim(s_tmp->params.port) != E1284_OK) { @@ -405,9 +405,9 @@ sane_init (SANE_Int *vc, SANE_Auth_Callback cb) ieee1284_close(s_tmp->params.port); continue; } - + DBG(2, "sane_init: >> initialise\n"); - tmp = sanei_canon_pp_initialise(&(s_tmp->params), + tmp = sanei_canon_pp_initialise(&(s_tmp->params), s_tmp->init_mode); DBG(2, "sane_init: << %d initialise\n", tmp); if (tmp) { @@ -420,13 +420,13 @@ sane_init (SANE_Int *vc, SANE_Auth_Callback cb) continue; } - /* put it back to sleep until we're ready to + /* put it back to sleep until we're ready to * open for business again - this will only work * if we actually have a scanner there! */ DBG(100, "sane_init: And back to sleep again\n"); sanei_canon_pp_sleep_scanner(s_tmp->params.port); - /* leave the port open but not claimed - this is regardless + /* leave the port open but not claimed - this is regardless * of the return value of initialise */ ieee1284_release(s_tmp->params.port); @@ -435,7 +435,7 @@ sane_init (SANE_Int *vc, SANE_Auth_Callback cb) if (fix_weights_file(s_tmp) != SANE_STATUS_GOOD) { DBG(1, "sane_init: Eeek! fix_weights_file failed for " - "scanner on port %s!\n", + "scanner on port %s!\n", s_tmp->params.port->name); /* non-fatal.. scans will look ugly as sin unless * they calibrate */ @@ -462,7 +462,7 @@ sane_init (SANE_Int *vc, SANE_Auth_Callback cb) *************************************************************************/ SANE_Status sane_get_devices (const SANE_Device ***dl, SANE_Bool local) -{ +{ static const SANE_Device **devlist; CANONP_Scanner *dev; int i; @@ -521,7 +521,7 @@ sane_open (SANE_String_Const name, SANE_Handle *h) DBG(2, ">> sane_open (h=%p, name=\"%s\")\n", (void *)h, name); - if ((h == NULL) || (name == NULL)) + if ((h == NULL) || (name == NULL)) { DBG(2,"sane_open: Null pointer received!\n"); return SANE_STATUS_INVAL; @@ -543,12 +543,12 @@ sane_open (SANE_String_Const name, SANE_Handle *h) while((cs != NULL) && strcmp(cs->params.port->name, name)) cs = cs->next; - /* if we didn't find the port they want, or there's no scanner + /* if we didn't find the port they want, or there's no scanner * there, we just want to find _any_ scanner */ if ((cs == NULL) || (cs->scanner_present != SANE_TRUE)) { cs = first_dev; - while((cs != NULL) && + while((cs != NULL) && (cs->scanner_present == SANE_FALSE)) cs = cs->next; } @@ -563,7 +563,7 @@ sane_open (SANE_String_Const name, SANE_Handle *h) } - if (cs == NULL) + if (cs == NULL) { DBG(2,"sane_open: No scanner found or requested port " "doesn't exist (%s)\n", name); @@ -575,15 +575,15 @@ sane_open (SANE_String_Const name, SANE_Handle *h) "(%s)\n", name); return SANE_STATUS_IO_ERROR; } - if (cs->opened == SANE_TRUE) + if (cs->opened == SANE_TRUE) { DBG(2,"sane_open; Oi!, That scanner's already open.\n"); return SANE_STATUS_DEVICE_BUSY; } - /* If the scanner has already been opened once, we don't have to do + /* If the scanner has already been opened once, we don't have to do * this setup again */ - if (cs->setup == SANE_TRUE) + if (cs->setup == SANE_TRUE) { cs->opened = SANE_TRUE; *h = (SANE_Handle)cs; @@ -613,11 +613,11 @@ sane_open (SANE_String_Const name, SANE_Handle *h) } if (cs->weights_file != NULL) - DBG(2, "sane_open: >> load_weights(%s, %p)\n", - cs->weights_file, + DBG(2, "sane_open: >> load_weights(%s, %p)\n", + cs->weights_file, (const void *)(&(cs->params))); else - DBG(2, "sane_open: >> load_weights(NULL, %p)\n", + DBG(2, "sane_open: >> load_weights(NULL, %p)\n", (const void *)(&(cs->params))); tmp = sanei_canon_pp_load_weights(cs->weights_file, &(cs->params)); DBG(2, "sane_open: << %d load_weights\n", tmp); @@ -638,10 +638,10 @@ sane_open (SANE_String_Const name, SANE_Handle *h) DBG(1, "sane_open: WARNING: adjust_gamma returned " "%d!\n", tmp); - DBG(10, "sane_open: after adjust_gamma Status = %i\n", + DBG(10, "sane_open: after adjust_gamma Status = %i\n", sanei_canon_pp_check_status(cs->params.port)); } - + /* Configure ranges etc */ @@ -744,11 +744,11 @@ sane_control_option (SANE_Handle h, SANE_Int opt, SANE_Action act, int i = 0, tmp, maxresi; DBG(2, ">> sane_control_option (h=%p, opt=%d, act=%d)\n", - h,opt,act); - /* Do some sanity checks on the parameters + h,opt,act); + /* Do some sanity checks on the parameters * note that val can be null for buttons */ - if ((h == NULL) || ((val == NULL) && (opt != OPT_CAL))) - /* || (info == NULL)) - Don't check this any more.. + if ((h == NULL) || ((val == NULL) && (opt != OPT_CAL))) + /* || (info == NULL)) - Don't check this any more.. * frontends seem to like passing a null */ { DBG(1,"sane_control_option: Frontend passed me a null! " @@ -757,7 +757,7 @@ sane_control_option (SANE_Handle h, SANE_Int opt, SANE_Action act, return SANE_STATUS_INVAL; } - if (((unsigned)opt) >= NUM_OPTIONS) + if (((unsigned)opt) >= NUM_OPTIONS) { DBG(1,"sane_control_option: I don't do option %d.\n", opt); return SANE_STATUS_INVAL; @@ -777,17 +777,17 @@ sane_control_option (SANE_Handle h, SANE_Int opt, SANE_Action act, return SANE_STATUS_DEVICE_BUSY; } - switch(act) + switch(act) { case SANE_ACTION_GET_VALUE: - switch (opt) + switch (opt) { case OPT_COLOUR_MODE: - strcpy((char *)val, + strcpy((char *)val, cmodes[cs->vals[opt]]); break; case OPT_DEPTH: - strcpy((char *)val, + strcpy((char *)val, depths[cs->vals[opt]]); break; case OPT_RESOLUTION: @@ -812,40 +812,40 @@ sane_control_option (SANE_Handle h, SANE_Int opt, SANE_Action act, maxresi = cs->opt[OPT_RESOLUTION]. constraint.word_list[0]; - while ((cs->vals[opt] <= maxresi) && + while ((cs->vals[opt] <= maxresi) && (res600[cs->vals[opt]] < *((int *)val))) { cs->vals[opt] += 1; } - if (res600[cs->vals[opt]] != + if (res600[cs->vals[opt]] != *((int *)val)) { - if (info != NULL) *info |= + if (info != NULL) *info |= SANE_INFO_INEXACT; } break; case OPT_COLOUR_MODE: cs->vals[opt] = 0; while ((cmodes[cs->vals[opt]] != NULL) - && strcmp(cmodes[cs->vals[opt]], + && strcmp(cmodes[cs->vals[opt]], (char *)val)) { cs->vals[opt] += 1; } - if (info != NULL) *info |= + if (info != NULL) *info |= SANE_INFO_RELOAD_PARAMS; break; case OPT_DEPTH: cs->vals[opt] = 0; while ((depths[cs->vals[opt]] != NULL) - && strcmp(depths[cs->vals[opt]], + && strcmp(depths[cs->vals[opt]], (char *)val)) { cs->vals[opt] += 1; } - if (info != NULL) *info |= + if (info != NULL) *info |= SANE_INFO_RELOAD_PARAMS; break; case OPT_TL_X: @@ -861,34 +861,34 @@ sane_control_option (SANE_Handle h, SANE_Int opt, SANE_Action act, if ((cs->weights_file==NULL) || cs->cal_readonly ) - DBG(2, ">> calibrate(x, " + DBG(2, ">> calibrate(x, " "NULL)\n"); else DBG(2, ">> calibrate(x," "%s)\n", cs->weights_file); - if (cs->cal_readonly) tmp = + if (cs->cal_readonly) tmp = sanei_canon_pp_calibrate( - &(cs->params), + &(cs->params), NULL); else tmp = sanei_canon_pp_calibrate( - &(cs->params), + &(cs->params), cs->weights_file); - DBG(2, "<< %d calibrate\n", + DBG(2, "<< %d calibrate\n", tmp); if (tmp != 0) { DBG(1, "sane_control_option: " "WARNING: " "calibrate " - "returned %d!", + "returned %d!", tmp); - cs->cal_valid = + cs->cal_valid = SANE_FALSE; return SANE_STATUS_IO_ERROR; } else { - cs->cal_valid = + cs->cal_valid = SANE_TRUE; } @@ -930,7 +930,7 @@ sane_get_parameters (SANE_Handle h, SANE_Parameters *params) { int res, max_width, max_height, max_res; CANONP_Scanner *cs = ((CANONP_Scanner *)h); - DBG(2, ">> sane_get_parameters (h=%p, params=%p)\n", (void*)h, + DBG(2, ">> sane_get_parameters (h=%p, params=%p)\n", (void*)h, (void*)params); if (h == NULL) return SANE_STATUS_INVAL; @@ -946,16 +946,16 @@ sane_get_parameters (SANE_Handle h, SANE_Parameters *params) * version, so this will always work. */ res = res600[cs->vals[OPT_RESOLUTION]]; - /* - * These don't change whether we're scanning or not + /* + * These don't change whether we're scanning or not * NOTE: Assumes options don't change after scanning commences, which * is part of the standard */ /* Copy the options stored in the vals into the scaninfo */ - params->pixels_per_line = + params->pixels_per_line = ((cs->vals[OPT_BR_X] - cs->vals[OPT_TL_X]) * res) / MM_PER_IN; - params->lines = ((cs->vals[OPT_BR_Y] - cs->vals[OPT_TL_Y]) * res) + params->lines = ((cs->vals[OPT_BR_Y] - cs->vals[OPT_TL_Y]) * res) / MM_PER_IN; /* FIXME: Magic numbers ahead! */ @@ -970,17 +970,17 @@ sane_get_parameters (SANE_Handle h, SANE_Parameters *params) max_width = cs->params.scanheadwidth / (max_res / res); - max_height = (cs->params.scanheadwidth == 2552 ? 3508 : 7016) / + max_height = (cs->params.scanheadwidth == 2552 ? 3508 : 7016) / (max_res / res); - if(params->pixels_per_line > max_width) + if(params->pixels_per_line > max_width) params->pixels_per_line = max_width; if(params->lines > max_height) params->lines = max_height; params->depth = cs->vals[OPT_DEPTH] ? 16 : 8; - switch (cs->vals[OPT_COLOUR_MODE]) + switch (cs->vals[OPT_COLOUR_MODE]) { case 0: params->format = SANE_FRAME_GRAY; @@ -997,7 +997,7 @@ sane_get_parameters (SANE_Handle h, SANE_Parameters *params) if (!(params->pixels_per_line)) { params->last_frame = SANE_TRUE; params->lines = 0; - } + } /* Always the "last frame" */ params->last_frame = SANE_TRUE; @@ -1009,7 +1009,7 @@ sane_get_parameters (SANE_Handle h, SANE_Parameters *params) "max_res=%d, res=%d, max_height=%d, br_y=%d, tl_y=%d, " "mm_per_in=%f\n", params->bytes_per_line, params->pixels_per_line, params->lines, - max_res, res, max_height, cs->vals[OPT_BR_Y], + max_res, res, max_height, cs->vals[OPT_BR_Y], cs->vals[OPT_TL_Y], MM_PER_IN); DBG(2, "<< sane_get_parameters\n"); @@ -1047,18 +1047,18 @@ sane_start (SANE_Handle h) res = res600[cs->vals[OPT_RESOLUTION]]; /* Copy the options stored in the vals into the scaninfo */ - cs->scan.width = ((cs->vals[OPT_BR_X] - cs->vals[OPT_TL_X]) * res) + cs->scan.width = ((cs->vals[OPT_BR_X] - cs->vals[OPT_TL_X]) * res) / MM_PER_IN; - cs->scan.height = ((cs->vals[OPT_BR_Y] - cs->vals[OPT_TL_Y]) * res) + cs->scan.height = ((cs->vals[OPT_BR_Y] - cs->vals[OPT_TL_Y]) * res) / MM_PER_IN; cs->scan.xoffset = (cs->vals[OPT_TL_X] * res) / MM_PER_IN; cs->scan.yoffset = (cs->vals[OPT_TL_Y] * res) / MM_PER_IN; - /* - * These values have to pass the requirements of not exceeding - * dimensions (simple clipping) and both width values have to be some - * integer multiple of 4 + /* + * These values have to pass the requirements of not exceeding + * dimensions (simple clipping) and both width values have to be some + * integer multiple of 4 */ /* FIXME: Magic numbers ahead! */ @@ -1074,11 +1074,11 @@ sane_start (SANE_Handle h) max_width = cs->params.scanheadwidth / (max_res / res); - max_height = (cs->params.scanheadwidth == 2552 ? 3508 : 7016) / + max_height = (cs->params.scanheadwidth == 2552 ? 3508 : 7016) / (max_res / res); if (cs->scan.width > max_width) cs->scan.width = max_width; - if (cs->scan.width + cs->scan.xoffset > max_width) cs->scan.xoffset = + if (cs->scan.width + cs->scan.xoffset > max_width) cs->scan.xoffset = max_width - cs->scan.width; if (cs->scan.height > max_height) cs->scan.height = max_height; @@ -1104,7 +1104,7 @@ sane_start (SANE_Handle h) cs->scan.xresolution = i; cs->scan.yresolution = i; - if (((cs->vals[OPT_BR_Y] - cs->vals[OPT_TL_Y]) <= 0) || + if (((cs->vals[OPT_BR_Y] - cs->vals[OPT_TL_Y]) <= 0) || ((cs->vals[OPT_BR_X] - cs->vals[OPT_TL_X]) <= 0)) { DBG(1,"sane_start: height = %d, Width = %d. " @@ -1156,26 +1156,26 @@ sane_read (SANE_Handle h, SANE_Byte *buf, SANE_Int maxlen, SANE_Int *lenp) static SANE_Byte *lbuf; static unsigned int bytesleft; - DBG(2, ">> sane_read (h=%p, buf=%p, maxlen=%d)\n", h, + DBG(2, ">> sane_read (h=%p, buf=%p, maxlen=%d)\n", h, (const void *)buf, maxlen); /* default to returning 0 - for errors */ *lenp = 0; - if ((h == NULL) || (buf == NULL) || (lenp == NULL)) + if ((h == NULL) || (buf == NULL) || (lenp == NULL)) { DBG(1, "sane_read: This frontend's passing me dodgy gear! " - "(h=%p, buf=%p, lenp=%p)\n", + "(h=%p, buf=%p, lenp=%p)\n", (void*)h, (void*)buf, (void*)lenp); return SANE_STATUS_INVAL; } /* Now we have to see if we have some leftover from last time */ - if (read_leftover != NULL) + if (read_leftover != NULL) { - /* feed some more data in until we've run out - don't care - * whether or not we _think_ the scanner is scanning now, + /* feed some more data in until we've run out - don't care + * whether or not we _think_ the scanner is scanning now, * because we may still have data left over to send */ DBG(200, "sane_read: didn't send it all last time\n"); @@ -1204,11 +1204,11 @@ sane_read (SANE_Handle h, SANE_Byte *buf, SANE_Int maxlen, SANE_Int *lenp) return SANE_STATUS_GOOD; } - } + } /* Has the last scan ended (other than by cancelling)? */ - if (((unsigned)cs->scan.height <= (unsigned)cs->lines_scanned) + if (((unsigned)cs->scan.height <= (unsigned)cs->lines_scanned) || (cs->sent_eof) || !(cs->scanning)) { cs->sent_eof = SANE_TRUE; @@ -1220,7 +1220,7 @@ sane_read (SANE_Handle h, SANE_Byte *buf, SANE_Int maxlen, SANE_Int *lenp) return SANE_STATUS_EOF; } - /* At this point we have to read more data from the scanner - or the + /* At this point we have to read more data from the scanner - or the * scan has been cancelled, which means we have to call read_segment * to leave the scanner consistant */ @@ -1230,17 +1230,17 @@ sane_read (SANE_Handle h, SANE_Byte *buf, SANE_Int maxlen, SANE_Int *lenp) else bpl = cs->scan.width * (cs->vals[OPT_COLOUR_MODE] ? 6 : 2); - /* New way: scan a whole scanner buffer full, and return as much as - * the frontend wants. It's faster and more reliable since the + /* New way: scan a whole scanner buffer full, and return as much as + * the frontend wants. It's faster and more reliable since the * scanners crack the shits if we ask for too many small packets */ lines = (BUF_MAX * 4 / 5) / bpl; - if (lines > (cs->scan.height - cs->lines_scanned)) + if (lines > (cs->scan.height - cs->lines_scanned)) lines = cs->scan.height - cs->lines_scanned; if (!lines) { - /* can't fit a whole line into the buffer + /* can't fit a whole line into the buffer * (should never happen!) */ lines = 1; } @@ -1268,16 +1268,16 @@ sane_read (SANE_Handle h, SANE_Byte *buf, SANE_Int maxlen, SANE_Int *lenp) DBG(10, "scan_params->: width=%d, height=%d, xoffset=%d, " "yoffset=%d\n\txresolution=%d, yresolution=%d, " "mode=%d, (lines=%d)\n", - cs->scan.width, cs->scan.height, + cs->scan.width, cs->scan.height, cs->scan.xoffset, cs->scan.yoffset, cs->scan.xresolution, cs->scan.yresolution, cs->scan.mode, lines); DBG(2, ">> read_segment(x, x, x, %d, %d, %d)\n", - lines, cs->cal_valid, + lines, cs->cal_valid, cs->scan.height - cs->lines_scanned); - tmp = sanei_canon_pp_read_segment(&is, &(cs->params), &(cs->scan), - lines, cs->cal_valid, + tmp = sanei_canon_pp_read_segment(&is, &(cs->params), &(cs->scan), + lines, cs->cal_valid, cs->scan.height - cs->lines_scanned); DBG(2, "<< %d read_segment\n", tmp); @@ -1361,7 +1361,7 @@ sane_read (SANE_Handle h, SANE_Byte *buf, SANE_Int maxlen, SANE_Int *lenp) if ((unsigned)cs->lines_scanned >= cs->scan.height) { - /* The scan is over! Don't need to call anything in the + /* The scan is over! Don't need to call anything in the * hardware, it will sort itself out */ DBG(10, "sane_read: Scan is finished.\n"); cs->scanning = SANE_FALSE; @@ -1392,7 +1392,7 @@ sane_cancel (SANE_Handle h) read_leftover = NULL; - if (!(cs->scanning)) + if (!(cs->scanning)) { DBG(2, "<< sane_cancel (not scanning)\n"); return; @@ -1431,7 +1431,7 @@ sane_close (SANE_Handle h) sanei_canon_pp_close_scanner(&(cs->params)); cs->opened = SANE_FALSE; - + /* if it was scanning, it's not any more */ cs->scanning = SANE_FALSE; cs->sent_eof = SANE_TRUE; @@ -1461,9 +1461,9 @@ sane_exit (void) next = dev->next; /* These were only created if the scanner has been init'd */ - + /* Should normally nullify pointers after freeing, but in - * this case we're about to free the whole structure so + * this case we're about to free the whole structure so * theres not a lot of point. */ /* Constraints (mostly) allocated when the scanner is opened */ @@ -1513,17 +1513,17 @@ sane_exit (void) * (Not part of the SANE API) * * Initialises a CANONP_Scanner data structure for a new device. - * NOTE: The device is not ready to scan until initialise() has been + * NOTE: The device is not ready to scan until initialise() has been * called in scan library! * *************************************************************************/ -static SANE_Status init_device(struct parport *pp) +static SANE_Status init_device(struct parport *pp) { int i; static const char *hw_vendor = "CANON"; static const char *hw_type = "flatbed scanner"; static const char *opt_names[] = { - SANE_NAME_NUM_OPTIONS, + SANE_NAME_NUM_OPTIONS, SANE_NAME_SCAN_RESOLUTION, SANE_NAME_SCAN_MODE, SANE_NAME_BIT_DEPTH, @@ -1539,7 +1539,7 @@ static SANE_Status init_device(struct parport *pp) #endif }; static const char *opt_titles[] = { - SANE_TITLE_NUM_OPTIONS, + SANE_TITLE_NUM_OPTIONS, SANE_TITLE_SCAN_RESOLUTION, SANE_TITLE_SCAN_MODE, SANE_TITLE_BIT_DEPTH, @@ -1555,7 +1555,7 @@ static SANE_Status init_device(struct parport *pp) #endif }; static const char *opt_descs[] = { - SANE_DESC_NUM_OPTIONS, + SANE_DESC_NUM_OPTIONS, SANE_DESC_SCAN_RESOLUTION, SANE_DESC_SCAN_MODE, SANE_DESC_BIT_DEPTH, @@ -1583,7 +1583,7 @@ static SANE_Status init_device(struct parport *pp) memset(cs, 0, sizeof(*cs)); #if 0 - if ((cs->params.port = malloc(sizeof(*(cs->params.port)))) == NULL) + if ((cs->params.port = malloc(sizeof(*(cs->params.port)))) == NULL) return SANE_STATUS_NO_MEM; memcpy(cs->params.port, pp, sizeof(*pp)); @@ -1637,7 +1637,7 @@ static SANE_Status init_device(struct parport *pp) cs->opt[OPT_RESOLUTION].unit = SANE_UNIT_DPI; cs->opt[OPT_RESOLUTION].constraint_type = SANE_CONSTRAINT_WORD_LIST; /* should never point at first element (wordlist size) */ - cs->vals[OPT_RESOLUTION] = 1; + cs->vals[OPT_RESOLUTION] = 1; DBG(100, "init_device: configuring opt: colour mode\n"); @@ -1689,8 +1689,8 @@ static SANE_Status init_device(struct parport *pp) /* The calibration button */ cs->opt[OPT_CAL].type = SANE_TYPE_BUTTON; cs->opt[OPT_CAL].constraint_type = SANE_CONSTRAINT_NONE; - if (cs->cal_readonly) - cs->opt[OPT_CAL].cap |= SANE_CAP_INACTIVE; + if (cs->cal_readonly) + cs->opt[OPT_CAL].cap |= SANE_CAP_INACTIVE; #if 0 /* the gamma values (once we do them) */ @@ -1700,8 +1700,8 @@ static SANE_Status init_device(struct parport *pp) #endif /* - * NOTE: Ranges and lists are actually set when scanner is opened, - * becase that's when we find out what sort of scanner it is + * NOTE: Ranges and lists are actually set when scanner is opened, + * becase that's when we find out what sort of scanner it is */ DBG(100, "init_device: done opts\n"); @@ -1720,7 +1720,7 @@ static SANE_Status init_device(struct parport *pp) /************************************************************************* * - * These two are optional ones... maybe if I get really keen? + * These two are optional ones... maybe if I get really keen? * *************************************************************************/ SANE_Status @@ -1739,7 +1739,7 @@ sane_set_io_mode (SANE_Handle h, SANE_Bool non_blocking) SANE_Status sane_get_select_fd (SANE_Handle h, SANE_Int *fdp) { - DBG(2, ">> sane_get_select_fd (%p, %p) (not supported)\n", h, + DBG(2, ">> sane_get_select_fd (%p, %p) (not supported)\n", h, (const void *)fdp); DBG(2, "<< sane_get_select_fd\n"); return SANE_STATUS_UNSUPPORTED; @@ -1762,7 +1762,7 @@ static int init_cal(char *file) if (errno == ENOENT) { /* we need to try and make ~/.sane perhaps - - * find the last / in the file path, and try + * find the last / in the file path, and try * to create it */ if ((tmp = strrchr(file, '/')) == NULL) return -1; @@ -1775,9 +1775,9 @@ static int init_cal(char *file) if ((f = open(file, O_CREAT | O_WRONLY, 0600)) < 0) return -1; } - else + else { - /* Error is something like access denied - too + /* Error is something like access denied - too * hard to fix, so i give up... */ return -1; } @@ -1789,7 +1789,7 @@ static int init_cal(char *file) /************************************************************************* * - * fix_weights_file(): Ensures that the weights_file setting for a given + * fix_weights_file(): Ensures that the weights_file setting for a given * scanner is valid * ************************************************************************/ @@ -1821,7 +1821,7 @@ static SANE_Status fix_weights_file(CANONP_Scanner *cs) /* Get the user's home dir if they used ~ */ if (cs->weights_file[0] == '~') { - if ((tmp = malloc(PATH_MAX)) == NULL) + if ((tmp = malloc(PATH_MAX)) == NULL) return SANE_STATUS_NO_MEM; if ((myhome = getenv("HOME")) == NULL) { @@ -1832,7 +1832,7 @@ static SANE_Status fix_weights_file(CANONP_Scanner *cs) return SANE_STATUS_INVAL; } strncpy(tmp, myhome, PATH_MAX); - strncpy(tmp+strlen(tmp), (cs->weights_file)+1, + strncpy(tmp+strlen(tmp), (cs->weights_file)+1, PATH_MAX-strlen(tmp)); free(cs->weights_file); @@ -1869,8 +1869,8 @@ static SANE_Status fix_weights_file(CANONP_Scanner *cs) i = open(cs->weights_file, O_RDONLY); if (i <= 0) { - /* - * Open failed (do i care why?) + /* + * Open failed (do i care why?) */ DBG(2,"fix_weights_file: error opening cal " "(%s)\n", strerror(errno)); @@ -1904,10 +1904,10 @@ static SANE_Status fix_weights_file(CANONP_Scanner *cs) * PRE: * cs->params.port is not open * POST: - * cs->params.port is left opened iff SANE_STATUS_GOOD returned. + * cs->params.port is left opened iff SANE_STATUS_GOOD returned. */ -SANE_Status detect_mode(CANONP_Scanner *cs) +SANE_Status detect_mode(CANONP_Scanner *cs) { int capabilities, tmp; @@ -1925,7 +1925,7 @@ SANE_Status detect_mode(CANONP_Scanner *cs) DBG(1, "detect_mode: Invalid port.\n"); break; case E1284_SYS: - DBG(1, "detect_mode: System error: %s\n", + DBG(1, "detect_mode: System error: %s\n", strerror(errno)); break; case E1284_INIT: @@ -1973,7 +1973,7 @@ SANE_Status detect_mode(CANONP_Scanner *cs) { cs->ieee1284_mode = M1284_ECP; DBG(10, "detect_mode: Using ECP-H Mode\n"); - } + } else if (capabilities & CAP1284_ECPSWE) { cs->ieee1284_mode = M1284_ECPSWE; @@ -1993,11 +1993,11 @@ SANE_Status detect_mode(CANONP_Scanner *cs) } /* Check to make sure ECP mode really is supported */ - /* Have disabled the hardware ECP check because it's always supported - * by libieee1284 now, and it's too prone to hitting a ppdev bug + /* Have disabled the hardware ECP check because it's always supported + * by libieee1284 now, and it's too prone to hitting a ppdev bug */ - /* Disabled check entirely.. check now in initialise when we + /* Disabled check entirely.. check now in initialise when we * actually do a read */ #if 0 if ((cs->ieee1284_mode == M1284_ECP) || @@ -2005,17 +2005,17 @@ SANE_Status detect_mode(CANONP_Scanner *cs) { DBG(1, "detect_mode: attempting a 0 byte read, if we hang " "here, it's a ppdev bug!\n"); - /* - * 29/06/02 + /* + * 29/06/02 * NOTE: - * This causes an infinite loop in ppdev on 2.4.18. - * Not checking on hardware ECP mode should work-around + * This causes an infinite loop in ppdev on 2.4.18. + * Not checking on hardware ECP mode should work-around * effectively. * - * I have sent email to twaugh about it, should be fixed in + * I have sent email to twaugh about it, should be fixed in * 2.4.19 and above. */ - if (ieee1284_ecp_read_data(cs->params.port, 0, NULL, 0) == + if (ieee1284_ecp_read_data(cs->params.port, 0, NULL, 0) == E1284_NOTIMPL) { DBG(10, "detect_mode: Your version of libieee1284 " diff --git a/backend/canon_pp.conf.in b/backend/canon_pp.conf.in index 14b311032..c12d76367 100644 --- a/backend/canon_pp.conf.in +++ b/backend/canon_pp.conf.in @@ -1,4 +1,4 @@ -# Define which port to use if one isn't specified - you should only have +# Define which port to use if one isn't specified - you should only have # one of these lines! # This is the default port to be used - others will be detected ieee1284 parport0 @@ -21,7 +21,7 @@ calibrate ~/.sane/canon_pp-calibration-pp0 parport0 # calibrate /etc/sane/my_calibration parport1 -# Enable the next line if you're having trouble with ECP mode such as I/O +# Enable the next line if you're having trouble with ECP mode such as I/O # errors. Nibble mode is slower, but more reliable. #force_nibble diff --git a/backend/canon_pp.h b/backend/canon_pp.h index 479792412..57b66f385 100644 --- a/backend/canon_pp.h +++ b/backend/canon_pp.h @@ -42,7 +42,7 @@ canon_pp.h: $Revision$ - This file is part of the canon_pp backend, supporting Canon FBX30P + This file is part of the canon_pp backend, supporting Canon FBX30P and NX40P scanners */ @@ -69,7 +69,7 @@ #define CANONP_CONFIG_FILE "canon_pp.conf" /* options: num,res,colour,depth,tl-x,tl-y,br-x,br-y,cal */ /* preview option disabled */ -#define NUM_OPTIONS 9 +#define NUM_OPTIONS 9 #define BUF_MAX 64000 /* Indexes into options array */ diff --git a/backend/cardscan.c b/backend/cardscan.c index eab650039..ec776d1c7 100644 --- a/backend/cardscan.c +++ b/backend/cardscan.c @@ -199,7 +199,7 @@ four times { . . - sane_start() : start image acquisition . . - sane_get_parameters() : returns actual scan parameters . . - sane_read() : read image data (from pipe) - . . (sane_read called multiple times; after sane_read returns EOF, + . . (sane_read called multiple times; after sane_read returns EOF, . . loop may continue with sane_start which may return a 2nd page . . when doing duplex scans, or load the next page from the ADF) . . @@ -226,14 +226,14 @@ four times { #include "cardscan.h" #define DEBUG 1 -#define BUILD 3 +#define BUILD 3 /* values for SANE_DEBUG_CARDSCAN env var: - errors 5 - function trace 10 - function detail 15 - get/setopt cmds 20 - - usb cmd trace 25 + - usb cmd trace 25 - usb cmd detail 30 - useless noise 35 */ @@ -259,7 +259,7 @@ static struct scanner *scanner_devList = NULL; /* * Called by SANE initially. - * + * * From the SANE spec: * This function must be called before any other SANE function can be * called. The behavior of a SANE backend is undefined if this @@ -274,26 +274,26 @@ SANE_Status sane_init (SANE_Int * version_code, SANE_Auth_Callback authorize) { authorize = authorize; /* get rid of compiler warning */ - + DBG_INIT (); DBG (10, "sane_init: start\n"); - + sanei_usb_init(); - + if (version_code) *version_code = SANE_VERSION_CODE (SANE_CURRENT_MAJOR, V_MINOR, BUILD); - + DBG (5, "sane_init: cardscan backend %d.%d.%d, from %s\n", SANE_CURRENT_MAJOR, V_MINOR, BUILD, PACKAGE_STRING); - + DBG (10, "sane_init: finish\n"); - + return SANE_STATUS_GOOD; } /* * Called by SANE to find out about supported devices. - * + * * From the SANE spec: * This function can be used to query the list of devices that are * available. If the function executes successfully, it stores a @@ -306,7 +306,7 @@ sane_init (SANE_Int * version_code, SANE_Auth_Callback authorize) * returned (devices directly attached to the machine that SANE is * running on). If it is false, the device list includes all remote * devices that are accessible to the SANE library. - * + * * SANE does not require that this function is called before a * sane_open() call is performed. A device name may be specified * explicitly by a user which would make it unnecessary and @@ -324,64 +324,64 @@ sane_get_devices (const SANE_Device *** device_list, SANE_Bool local_only) FILE *fp; int num_devices=0; int i=0; - + local_only = local_only; /* get rid of compiler warning */ - + DBG (10, "sane_get_devices: start\n"); - + global_has_cal_buffer = 1; global_lines_per_block = 16; fp = sanei_config_open (CONFIG_FILE); - + if (fp) { - + DBG (15, "sane_get_devices: reading config file %s\n", CONFIG_FILE); - + while (sanei_config_read (line, PATH_MAX, fp)) { - + lp = line; /* ignore comments */ if (*lp == '#') continue; - + /* skip empty lines */ if (*lp == 0) continue; - + if ((strncmp ("usb", lp, 3) == 0) && isspace (lp[3])) { DBG (15, "sane_get_devices: looking for '%s'\n", lp); sanei_usb_attach_matching_devices(lp, attach_one); } else if (!strncmp(lp, "has_cal_buffer", 14) && isspace (lp[14])) { - + int buf; lp += 14; lp = sanei_config_skip_whitespace (lp); buf = atoi (lp); - + if(buf){ global_has_cal_buffer = 1; } else{ global_has_cal_buffer = 0; } - + DBG (15, "sane_get_devices: setting \"has_cal_buffer\" to %d\n", global_has_cal_buffer); } else if (!strncmp(lp, "lines_per_block", 15) && isspace (lp[15])) { - + int buf; lp += 15; lp = sanei_config_skip_whitespace (lp); buf = atoi (lp); - + if(buf < 1 || buf > 32){ - DBG (15, + DBG (15, "sane_get_devices: \"lines_per_block\"=%d\n out of range", buf ); @@ -398,42 +398,42 @@ sane_get_devices (const SANE_Device *** device_list, SANE_Bool local_only) } fclose (fp); } - + else { DBG (5, "sane_get_devices: no config file '%s', using defaults\n", CONFIG_FILE); - + DBG (15, "sane_get_devices: looking for 'usb 0x08F0 0x0005'\n"); sanei_usb_attach_matching_devices("usb 0x08F0 0x0005", attach_one); } - + for (dev = scanner_devList; dev; dev=dev->next) { DBG (15, "sane_get_devices: found scanner %s\n",dev->device_name); num_devices++; } - + DBG (15, "sane_get_devices: found %d scanner(s)\n",num_devices); - + sane_devArray = calloc (num_devices + 1, sizeof (SANE_Device*)); if (!sane_devArray) return SANE_STATUS_NO_MEM; - + for (dev = scanner_devList; dev; dev=dev->next) { sane_devArray[i++] = (SANE_Device *)&dev->sane; } - + sane_devArray[i] = 0; - + *device_list = sane_devArray; - + DBG (10, "sane_get_devices: finish\n"); - + return SANE_STATUS_GOOD; } /* callback used by sane_get_devices - * build the scanner struct and link to global list - * unless struct is already loaded, then pretend + * build the scanner struct and link to global list + * unless struct is already loaded, then pretend */ static SANE_Status attach_one (const char *device_name) @@ -441,32 +441,32 @@ attach_one (const char *device_name) struct scanner *s; int ret, i; SANE_Word vid, pid; - + DBG (10, "attach_one: start '%s'\n", device_name); - + for (s = scanner_devList; s; s = s->next) { if (strcmp (s->sane.name, device_name) == 0) { DBG (10, "attach_one: already attached!\n"); return SANE_STATUS_GOOD; } } - + /* build a scanner struct to hold it */ DBG (15, "attach_one: init struct\n"); - + if ((s = calloc (sizeof (*s), 1)) == NULL) return SANE_STATUS_NO_MEM; - + /* copy the device name */ s->device_name = strdup (device_name); if (!s->device_name){ free (s); return SANE_STATUS_NO_MEM; } - + /* connect the fd */ DBG (15, "attach_one: connect fd\n"); - + s->fd = -1; ret = connect_fd(s); if(ret != SANE_STATUS_GOOD){ @@ -474,11 +474,11 @@ attach_one (const char *device_name) free (s); return ret; } - + /* clean up the scanner struct based on model */ /* this is the only piece of model specific code */ sanei_usb_get_vendor_product(s->fd,&vid,&pid); - + if(vid == 0x08f0){ s->vendor_name = "CardScan"; if(pid == 0x0005){ @@ -507,10 +507,10 @@ attach_one (const char *device_name) s->vendor_name = "Unknown"; s->product_name = "Unknown"; } - + DBG (15, "attach_one: Found %s scanner %s at %s\n", s->vendor_name, s->product_name, s->device_name); - + /*copy config file settings*/ s->has_cal_buffer = global_has_cal_buffer; s->lines_per_block = global_lines_per_block; @@ -520,7 +520,7 @@ attach_one (const char *device_name) /* try to get calibration */ if(s->has_cal_buffer){ DBG (15, "attach_one: scanner calibration\n"); - + ret = load_calibration(s); if (ret != SANE_STATUS_GOOD) { DBG (5, "sane_start: ERROR: cannot calibrate, incompatible?\n"); @@ -532,13 +532,13 @@ attach_one (const char *device_name) else{ DBG (15, "attach_one: skipping calibration\n"); } - + /* set SANE option 'values' to good defaults */ DBG (15, "attach_one: init options\n"); - - /* go ahead and setup the first opt, because - * frontend may call control_option on it - * before calling get_option_descriptor + + /* go ahead and setup the first opt, because + * frontend may call control_option on it + * before calling get_option_descriptor */ memset (s->opt, 0, sizeof (s->opt)); for (i = 0; i < NUM_OPTIONS; ++i) { @@ -546,29 +546,29 @@ attach_one (const char *device_name) s->opt[i].size = sizeof (SANE_Word); s->opt[i].cap = SANE_CAP_INACTIVE; } - + s->opt[OPT_NUM_OPTS].name = SANE_NAME_NUM_OPTIONS; s->opt[OPT_NUM_OPTS].title = SANE_TITLE_NUM_OPTIONS; s->opt[OPT_NUM_OPTS].desc = SANE_DESC_NUM_OPTIONS; s->opt[OPT_NUM_OPTS].type = SANE_TYPE_INT; s->opt[OPT_NUM_OPTS].cap = SANE_CAP_SOFT_DETECT; - + DBG (15, "attach_one: init settings\n"); - + /* we close the connection, so that another backend can talk to scanner */ disconnect_fd(s); - + /* load info into sane_device struct */ s->sane.name = s->device_name; s->sane.vendor = s->vendor_name; s->sane.model = s->product_name; s->sane.type = "scanner"; - + s->next = scanner_devList; scanner_devList = s; - + DBG (10, "attach_one: finish\n"); - + return SANE_STATUS_GOOD; } @@ -579,9 +579,9 @@ static SANE_Status connect_fd (struct scanner *s) { SANE_Status ret; - + DBG (10, "connect_fd: start\n"); - + if(s->fd > -1){ DBG (5, "connect_fd: already open\n"); ret = SANE_STATUS_GOOD; @@ -590,13 +590,13 @@ connect_fd (struct scanner *s) DBG (15, "connect_fd: opening USB device\n"); ret = sanei_usb_open (s->device_name, &(s->fd)); } - + if(ret != SANE_STATUS_GOOD){ DBG (5, "connect_fd: could not open device: %d\n", ret); } - + DBG (10, "connect_fd: finish\n"); - + return ret; } @@ -608,25 +608,25 @@ load_calibration(struct scanner *s) unsigned char * buf; size_t bytes = HEADER_SIZE + CAL_COLOR_SIZE*2 + CAL_GRAY_SIZE*2; int j; - + DBG (10, "load_calibration: start\n"); - + buf = malloc(bytes); if(!buf){ DBG(5, "load_calibration: not enough mem for buffer: %ld\n",(long)bytes); return SANE_STATUS_NO_MEM; } - + ret = do_cmd( s, 0, cmd, sizeof(cmd), NULL, 0, buf, &bytes ); - + if (ret == SANE_STATUS_GOOD) { DBG(15, "load_calibration: got GOOD\n"); - + /* * color cal data comes from scaner like: * bbbbbbbBBBBBBBgggggggGGGGGGGrrrrrrrRRRRRRR @@ -634,40 +634,40 @@ load_calibration(struct scanner *s) * reorder the data into two buffers * bbbbbbbgggggggrrrrrrr and BBBBBBBGGGGGGGRRRRRRR */ - + /*dark/light blue*/ memcpy(s->cal_color_b, buf+HEADER_SIZE, PIXELS_PER_LINE); memcpy(s->cal_color_w, buf+HEADER_SIZE+PIXELS_PER_LINE, PIXELS_PER_LINE); - + /*dark/light green*/ memcpy(s->cal_color_b+PIXELS_PER_LINE, buf+HEADER_SIZE+(PIXELS_PER_LINE*2), PIXELS_PER_LINE); memcpy(s->cal_color_w+PIXELS_PER_LINE, buf+HEADER_SIZE+(PIXELS_PER_LINE*3), PIXELS_PER_LINE); - + /*dark/light red*/ memcpy(s->cal_color_b+(PIXELS_PER_LINE*2), buf+HEADER_SIZE+(PIXELS_PER_LINE*4), PIXELS_PER_LINE); memcpy(s->cal_color_w+(PIXELS_PER_LINE*2), buf+HEADER_SIZE+(PIXELS_PER_LINE*5), PIXELS_PER_LINE); - + /* then slide the light data down using the dark offset */ for(j=0;jcal_color_w[j] -= s->cal_color_b[j]; } - + /*dark/light gray*/ memcpy(s->cal_gray_b, buf+HEADER_SIZE+(CAL_COLOR_SIZE*2), PIXELS_PER_LINE); memcpy(s->cal_gray_w, buf+HEADER_SIZE+(CAL_COLOR_SIZE*2)+PIXELS_PER_LINE, PIXELS_PER_LINE); - + /* then slide the light data down using the dark offset */ for(j=0;jcal_gray_w[j] -= s->cal_gray_b[j]; } - + hexdump(35, "cal_color_b:", s->cal_color_b, CAL_COLOR_SIZE); hexdump(35, "cal_color_w:", s->cal_color_w, CAL_COLOR_SIZE); hexdump(35, "cal_gray_b:", s->cal_gray_b, CAL_GRAY_SIZE); @@ -676,9 +676,9 @@ load_calibration(struct scanner *s) else { DBG(5, "load_calibration: error reading data block status = %d\n", ret); } - + DBG (10, "load_calibration: finish\n"); - + return ret; } @@ -697,9 +697,9 @@ sane_open (SANE_String_Const name, SANE_Handle * handle) struct scanner *dev = NULL; struct scanner *s = NULL; SANE_Status ret; - + DBG (10, "sane_open: start\n"); - + if(name[0] == 0){ if(scanner_devList){ DBG (15, "sane_open: no device requested, using first\n"); @@ -725,24 +725,24 @@ sane_open (SANE_String_Const name, SANE_Handle * handle) } } } - + if (!s) { DBG (5, "sane_open: no device found\n"); return SANE_STATUS_INVAL; } - + DBG (15, "sane_open: device %s found\n", s->sane.name); - + *handle = s; - + /* connect the fd so we can talk to scanner */ ret = connect_fd(s); if(ret != SANE_STATUS_GOOD){ return ret; } - + DBG (10, "sane_open: finish\n"); - + return SANE_STATUS_GOOD; } @@ -789,7 +789,7 @@ sane_get_option_descriptor (SANE_Handle handle, SANE_Int option) s->mode_list[i++]=STRING_GRAYSCALE; s->mode_list[i++]=STRING_COLOR; s->mode_list[i]=NULL; - + opt->name = SANE_NAME_SCAN_MODE; opt->title = SANE_TITLE_SCAN_MODE; opt->desc = SANE_DESC_SCAN_MODE; @@ -805,7 +805,7 @@ sane_get_option_descriptor (SANE_Handle handle, SANE_Int option) /** * Gets or sets an option value. - * + * * From the SANE spec: * This function is used to set or inquire the current value of option * number n of the device represented by handle h. The manner in which @@ -816,7 +816,7 @@ sane_get_option_descriptor (SANE_Handle handle, SANE_Int option) * area pointed to by v must be big enough to hold the entire option * value (determined by member size in the corresponding option * descriptor). - * + * * The only exception to this rule is that when setting the value of a * string option, the string pointed to by argument v may be shorter * since the backend will stop reading the option value upon @@ -902,7 +902,7 @@ sane_control_option (SANE_Handle handle, SANE_Int option, * below. */ switch (option) { - + /* Mode Group */ case OPT_MODE: if (!strcmp (val, STRING_GRAYSCALE)) { @@ -939,7 +939,7 @@ sane_control_option (SANE_Handle handle, SANE_Int option, * completion of that request. Outside of that window, the returned * values are best-effort estimates of what the parameters will be * when sane_start() gets invoked. - * + * * Calling this function before a scan has actually started allows, * for example, to get an estimate of how big the scanned image will * be. The parameters passed to this function are the handle h of the @@ -986,38 +986,38 @@ sane_start (SANE_Handle handle) { struct scanner *s = handle; SANE_Status ret; - + DBG (10, "sane_start: start\n"); - + /* first page of batch */ if(s->started){ DBG(5,"sane_start: previous transfer not finished?"); sane_cancel((SANE_Handle)s); return SANE_STATUS_CANCELLED; } - + /* set clean defaults */ s->started=1; s->bytes_rx=0; s->bytes_tx=0; s->paperless_lines=0; - - /* heat up the lamp */ + + /* heat up the lamp */ if(s->mode == MODE_COLOR){ ret = heat_lamp_color(s); } else{ ret = heat_lamp_gray(s); } - + if (ret != SANE_STATUS_GOOD) { DBG (5, "sane_start: ERROR: failed to heat lamp\n"); sane_cancel((SANE_Handle)s); return ret; } - + DBG (10, "sane_start: finish\n"); - + return SANE_STATUS_GOOD; } @@ -1031,9 +1031,9 @@ heat_lamp_gray(struct scanner *s) size_t bytes = HEADER_SIZE + 1; unsigned char * buf; int i; - + DBG (10, "heat_lamp_gray: start\n"); - + buf = malloc(bytes); if(!buf){ DBG(5, "heat_lamp_gray: not enough mem for buffer: %lu\n", @@ -1042,26 +1042,26 @@ heat_lamp_gray(struct scanner *s) } for(i=0;i<10;i++){ - + ret2 = do_cmd( s, 0, cmd, sizeof(cmd), NULL, 0, buf, &bytes ); - + if (ret2 != SANE_STATUS_GOOD) { DBG(5, "heat_lamp_gray: %d error\n",i); ret = ret2; break; } - + if(!buf[1]){ DBG(5, "heat_lamp_gray: %d got no docs\n",i); ret = SANE_STATUS_NO_DOCS; break; } - + DBG(15, "heat_lamp_gray: %d got: %d %d\n",i, buf[HEADER_SIZE],s->cal_gray_b[0]); @@ -1075,11 +1075,11 @@ heat_lamp_gray(struct scanner *s) ret = SANE_STATUS_DEVICE_BUSY; } } - + free(buf); - + DBG (10, "heat_lamp_gray: finish %d\n",ret); - + return ret; } @@ -1093,9 +1093,9 @@ heat_lamp_color(struct scanner *s) size_t bytes = HEADER_SIZE + 3; unsigned char * buf; int i; - + DBG (10, "heat_lamp_color: start\n"); - + buf = malloc(bytes); if(!buf){ DBG(5, "heat_lamp_color: not enough mem for buffer: %lu\n", @@ -1104,26 +1104,26 @@ heat_lamp_color(struct scanner *s) } for(i=0;i<10;i++){ - + ret2 = do_cmd( s, 0, cmd, sizeof(cmd), NULL, 0, buf, &bytes ); - + if (ret2 != SANE_STATUS_GOOD) { DBG(5, "heat_lamp_color: %d error\n",i); ret = ret2; break; } - + if(!buf[1]){ DBG(5, "heat_lamp_color: %d got no docs\n",i); ret = SANE_STATUS_NO_DOCS; break; } - + DBG(15, "heat_lamp_color: %d got: %d,%d,%d %d,%d,%d\n",i, buf[HEADER_SIZE],buf[HEADER_SIZE+1],buf[HEADER_SIZE+2], s->cal_color_b[0],s->cal_color_b[1],s->cal_color_b[2]); @@ -1140,17 +1140,17 @@ heat_lamp_color(struct scanner *s) ret = SANE_STATUS_DEVICE_BUSY; } } - + free(buf); - + DBG (10, "heat_lamp_color: finish %d\n",ret); - + return ret; } /* * Called by SANE to read data. - * + * * From the SANE spec: * This function is used to read image data from the device * represented by handle h. Argument buf is a pointer to a memory @@ -1158,7 +1158,7 @@ heat_lamp_color(struct scanner *s) * returned is stored in *len. A backend must set this to zero when * the call fails (i.e., when a status other than SANE_STATUS_GOOD is * returned). - * + * * When the call succeeds, the number of bytes returned can be * anywhere in the range from 0 to maxlen bytes. */ @@ -1167,55 +1167,55 @@ sane_read (SANE_Handle handle, SANE_Byte * buf, SANE_Int max_len, SANE_Int * len { struct scanner *s = (struct scanner *) handle; SANE_Status ret=SANE_STATUS_GOOD; - + DBG (10, "sane_read: start\n"); - + *len = 0; - + /* cancelled? */ if(!s->started){ DBG (5, "sane_read: call sane_start first\n"); return SANE_STATUS_CANCELLED; } - + /* have sent all of current buffer */ if(s->bytes_tx == s->bytes_rx){ - + /* at end of data, stop */ if(s->paperless_lines >= MAX_PAPERLESS_LINES){ DBG (15, "sane_read: returning eof\n"); power_down(s); return SANE_STATUS_EOF; } - + /* more to get, reset and go */ s->bytes_tx = 0; s->bytes_rx = 0; - + if(s->mode == MODE_COLOR){ ret = read_from_scanner_color(s); } else{ ret = read_from_scanner_gray(s); } - + if(ret){ DBG(5,"sane_read: returning %d\n",ret); return ret; } } - + /* data in current buffer, send some of it */ *len = s->bytes_rx - s->bytes_tx; if(*len > max_len){ *len = max_len; } - + memcpy(buf,s->buffer+s->bytes_tx,*len); s->bytes_tx += *len; - + DBG (10, "sane_read: %d,%d,%d finish\n", *len,s->bytes_rx,s->bytes_tx); - + return ret; } @@ -1229,9 +1229,9 @@ read_from_scanner_gray(struct scanner *s) size_t bytes = HEADER_SIZE + s->gray_block_size; unsigned char * buf; int i,j; - + DBG (10, "read_from_scanner_gray: start\n"); - + cmd[4] = s->lines_per_block; buf = malloc(bytes); @@ -1240,14 +1240,14 @@ read_from_scanner_gray(struct scanner *s) (long unsigned)bytes); return SANE_STATUS_NO_MEM; } - + ret = do_cmd( s, 0, cmd, sizeof(cmd), NULL, 0, buf, &bytes ); - + if (ret == SANE_STATUS_GOOD) { DBG(15, "read_from_scanner_gray: got GOOD\n"); @@ -1255,19 +1255,19 @@ read_from_scanner_gray(struct scanner *s) if(!buf[1]){ s->paperless_lines += s->lines_per_block; } - + s->bytes_rx = s->gray_block_size; - + /*memcpy(s->buffer,buf+HEADER_SIZE,s->gray_block_size);*/ - + /* reorder the gray data into the struct's buffer */ for(i=0;igray_block_size;i+=PIXELS_PER_LINE){ for(j=0;jcal_gray_b[j]; unsigned char wcal = s->cal_gray_w[j]; - + byte = (byte <= bcal)?0:(byte-bcal); byte = (byte >= wcal)?255:(byte*255/wcal); s->buffer[i+j] = byte; @@ -1277,11 +1277,11 @@ read_from_scanner_gray(struct scanner *s) else { DBG(5, "read_from_scanner_gray: error reading status = %d\n", ret); } - + free(buf); - + DBG (10, "read_from_scanner_gray: finish\n"); - + return ret; } @@ -1294,9 +1294,9 @@ read_from_scanner_color(struct scanner *s) size_t bytes = HEADER_SIZE + s->color_block_size; unsigned char * buf; int i,j,k; - + DBG (10, "read_from_scanner_color: start\n"); - + cmd[4] = s->lines_per_block; buf = malloc(bytes); @@ -1305,14 +1305,14 @@ read_from_scanner_color(struct scanner *s) (long unsigned)bytes); return SANE_STATUS_NO_MEM; } - + ret = do_cmd( s, 0, cmd, sizeof(cmd), NULL, 0, buf, &bytes ); - + if (ret == SANE_STATUS_GOOD) { DBG(15, "read_from_scanner_color: got GOOD\n"); @@ -1320,21 +1320,21 @@ read_from_scanner_color(struct scanner *s) if(!buf[1]){ s->paperless_lines += s->lines_per_block; } - + s->bytes_rx = s->color_block_size; - + /*memcpy(s->buffer,buf+HEADER_SIZE,s->color_block_size);*/ - + /* reorder the color data into the struct's buffer */ for(i=0;icolor_block_size;i+=PIXELS_PER_LINE*3){ for(j=0;jcal_color_b[offset]; unsigned char wcal = s->cal_color_w[offset]; - + byte = (byte <= bcal)?0:(byte-bcal); byte = (byte >= wcal)?255:(byte*255/wcal); s->buffer[i+j*3+k] = byte; @@ -1345,11 +1345,11 @@ read_from_scanner_color(struct scanner *s) else { DBG(5, "read_from_scanner_color: error reading status = %d\n", ret); } - + free(buf); - + DBG (10, "read_from_scanner_color: finish\n"); - + return ret; } @@ -1357,7 +1357,7 @@ read_from_scanner_color(struct scanner *s) * @@ Section 4 - SANE cleanup functions */ /* - * Cancels a scan. + * Cancels a scan. * * From the SANE spec: * This function is used to immediately or as quickly as possible @@ -1393,7 +1393,7 @@ power_down(struct scanner *s) unsigned char buf[6]; size_t bytes = sizeof(buf); int i; - + DBG (10, "power_down: start\n"); for(i=0;i<5;i++){ @@ -1413,9 +1413,9 @@ power_down(struct scanner *s) unsigned char cmd[] = {0x35, 0x01, 0x00, 0xff}; unsigned char buf[5]; size_t bytes = sizeof(buf); - + DBG (10, "power_down: start\n"); - + ret = do_cmd( s, 0, cmd, sizeof(cmd), @@ -1423,15 +1423,15 @@ power_down(struct scanner *s) buf, &bytes ); #endif - + DBG (10, "power_down: finish %d\n",ret); - + return ret; } /* * Ends use of the scanner. - * + * * From the SANE spec: * This function terminates the association between the device handle * passed in argument h and the device it represents. If the device is @@ -1467,7 +1467,7 @@ disconnect_fd (struct scanner *s) /* * Terminates the backend. - * + * * From the SANE spec: * This function must be called to terminate use of a backend. The * function will first close all device handles that still might be diff --git a/backend/cardscan.h b/backend/cardscan.h index a673dc6d9..56bd08d77 100644 --- a/backend/cardscan.h +++ b/backend/cardscan.h @@ -1,12 +1,12 @@ #ifndef CARDSCAN_H #define CARDSCAN_H -/* +/* * Part of SANE - Scanner Access Now Easy. * Please see opening comment in cardscan.c */ -/* ------------------------------------------------------------------------- +/* ------------------------------------------------------------------------- * This option list has to contain all options for all scanners supported by * this driver. If a certain scanner cannot handle a certain option, there's * still the possibility to say so, later. @@ -48,10 +48,10 @@ struct scanner /* --------------------------------------------------------------------- */ /* immutable values which are set during reading of config file. */ - int has_cal_buffer; - int lines_per_block; - int color_block_size; - int gray_block_size; + int has_cal_buffer; + int lines_per_block; + int color_block_size; + int gray_block_size; /* --------------------------------------------------------------------- */ /* changeable SANE_Option structs provide our interface to frontend. */ diff --git a/backend/coolscan-scsidef.h b/backend/coolscan-scsidef.h index 4f1a27eef..da7eaa694 100644 --- a/backend/coolscan-scsidef.h +++ b/backend/coolscan-scsidef.h @@ -179,7 +179,7 @@ static scsiblk inquiry = /* ==================================================================== */ /* static unsigned char mode_selectC[] = { - MODE_SELECT, 0x10, 0x00, 0x00, 0x00, 0x00 + MODE_SELECT, 0x10, 0x00, 0x00, 0x00, 0x00 static scsiblk mode_select = { mode_selectC,sizeof(mode_selectC) }; */ @@ -518,7 +518,7 @@ static scsiblk window_descriptor_block = -/* LS-30 has different window-descriptor ! +/* LS-30 has different window-descriptor ! */ static unsigned char window_descriptor_blockC_LS30[] = @@ -529,11 +529,11 @@ static unsigned char window_descriptor_blockC_LS30[] = 0x00, /* 0x00 */ /* Window Identifier */ #define WD_wid_0 0x00 /* Only one supported */ -#define WD_wid_1 0x01 -#define WD_wid_2 0x02 -#define WD_wid_3 0x03 -#define WD_wid_4 0x04 -#define WD_wid_9 0x09 +#define WD_wid_1 0x01 +#define WD_wid_2 0x02 +#define WD_wid_3 0x03 +#define WD_wid_4 0x04 +#define WD_wid_9 0x09 0x00, /* reserved, AUTO */ 0x00, 0x00, /* 0x02 */ @@ -784,7 +784,7 @@ static unsigned char autofocusLS30C[] = static unsigned char autofocuspos[] = { - 0x00, + 0x00, 0x00, 0x00, 0x05, 0x10, /* x-position */ 0x00, 0x00, 0x07, 0x9b, /* y-position */ }; diff --git a/backend/coolscan.c b/backend/coolscan.c index 239b54619..dd17d67de 100644 --- a/backend/coolscan.c +++ b/backend/coolscan.c @@ -35,7 +35,7 @@ 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. @@ -267,10 +267,10 @@ request_sense_parse (unsigned char *sensed_data) return ret; } -/* +/* * wait_scanner should spin until TEST_UNIT_READY returns 0 (GOOD) * returns 0 on success, - * returns -1 on error. + * returns -1 on error. */ static int wait_scanner (Coolscan_t * s) @@ -319,7 +319,7 @@ wait_scanner (Coolscan_t * s) * GOOD * RESERVE UNIT * GOOD - * + * * It is then responsible for installing appropriate signal handlers * to call emergency_give_scanner() if user aborts. */ @@ -331,7 +331,7 @@ coolscan_grab_scanner (Coolscan_t * s) DBG (10, "grabbing scanner\n"); - wait_scanner (s); /* wait for scanner ready, if not print + wait_scanner (s); /* wait for scanner ready, if not print sense and return 1 */ ret = do_scsi_cmd (s->sfd, reserve_unit.cmd, reserve_unit.size, NULL, 0); if (ret) @@ -341,15 +341,15 @@ coolscan_grab_scanner (Coolscan_t * s) return 0; } -/* +/* * Convert a size in ilu to the units expected by the scanner */ static int resDivToVal (int res_div) -{ +{ if (res_div < 1 || res_div > resolution_list[0]) - { + { DBG (1, "Invalid resolution divisor %d \n", res_div); return 2700; } @@ -379,7 +379,7 @@ resValToDiv (int res_val) return res_div; } } -/* +/* * use mode select to force a mesurement divisor of 2700 */ static unsigned char mode_select[] = @@ -414,7 +414,7 @@ coolscan_autofocus_LS30 (Coolscan_t * s) /* Trashes when used in combination with scsi-driver AM53C974.o */ do_scsi_cmd (s->sfd, command_c1.cmd, command_c1.size, NULL, 0); - + DBG (10, "\tWaiting end of Autofocus\n"); wait_scanner (s); DBG (10, "AutoFocused.\n"); @@ -662,7 +662,7 @@ coolscan_set_window_param_LS20 (Coolscan_t * s, int prescan) set_WD_shift_G (buffer_r, s->shift_G); set_WD_shift_B (buffer_r, s->shift_B); - + /* FIXME: LUT-[RGB] */ /* FIXME: stop on/off */ } @@ -738,7 +738,7 @@ coolscan_set_window_param_LS30 (Coolscan_t * s, int wid, int prescan) { set_WD_scanmode_LS30 (buffer_r, WD_Scan); - /* the coolscan LS-30 uses the upper left corner + /* the coolscan LS-30 uses the upper left corner as the origin of coordinates */ /* xmax and ymax are given in 1200 dpi */ set_WD_ULX (buffer_r, s->tlx); @@ -787,11 +787,11 @@ coolscan_set_window_param_LS30 (Coolscan_t * s, int wid, int prescan) set_WD_negative_LS30(buffer_r, s->negative); /* Negative/positive slide */ switch(wid) - { case 1: set_gain_LS30(buffer_r,(s->exposure_R*s->pretv_r)/50); + { case 1: set_gain_LS30(buffer_r,(s->exposure_R*s->pretv_r)/50); break; - case 2: set_gain_LS30(buffer_r,(s->exposure_G*s->pretv_g)/50); + case 2: set_gain_LS30(buffer_r,(s->exposure_G*s->pretv_g)/50); break; - case 3: set_gain_LS30(buffer_r,(s->exposure_B*s->pretv_b)/50); + case 3: set_gain_LS30(buffer_r,(s->exposure_B*s->pretv_b)/50); break; } @@ -837,7 +837,7 @@ coolscan_set_window_param (Coolscan_t * s, int prescan) int ret; ret=0; DBG (10, "set_window_param\n"); - + if(s->LS<2) /* distinquish between old and new scanners */ { ret=coolscan_set_window_param_LS20 (s,prescan); } @@ -847,7 +847,7 @@ coolscan_set_window_param (Coolscan_t * s, int prescan) wait_scanner (s); coolscan_set_window_param_LS30(s,1,prescan); ret=coolscan_set_window_param_LS30(s,2,prescan); - ret=coolscan_set_window_param_LS30(s,3,prescan); + ret=coolscan_set_window_param_LS30(s,3,prescan); if(s->colormode&0x08) { ret=coolscan_set_window_param_LS30(s,9,prescan); } @@ -856,9 +856,9 @@ coolscan_set_window_param (Coolscan_t * s, int prescan) } -/* +/* * The only purpose of get_window is debugging. None of the return parameters - * is currently used. + * is currently used. */ static int coolscan_get_window_param_LS30 (Coolscan_t * s, int wid,int prescanok) @@ -896,11 +896,11 @@ coolscan_get_window_param_LS30 (Coolscan_t * s, int wid,int prescanok) if(prescanok) { switch(wid) - { case 1: s->pretv_r = get_gain_LS30(buf); + { case 1: s->pretv_r = get_gain_LS30(buf); break; - case 2: s->pretv_g = get_gain_LS30(buf); + case 2: s->pretv_g = get_gain_LS30(buf); break; - case 3: s->pretv_b = get_gain_LS30(buf); + case 3: s->pretv_b = get_gain_LS30(buf); break; } } @@ -920,9 +920,9 @@ coolscan_get_window_param_LS30 (Coolscan_t * s, int wid,int prescanok) return 0; } -/* +/* * The only purpose of get_window is debugging. None of the return parameters - * is currently used. + * is currently used. */ static int coolscan_get_window_param_LS20 (Coolscan_t * s) @@ -982,9 +982,9 @@ coolscan_get_window_param_LS20 (Coolscan_t * s) return 0; } -/* +/* * The only purpose of get_window is debugging. None of the return parameters - * is currently used. + * is currently used. */ static int coolscan_get_window_param (Coolscan_t * s, int prescanok) @@ -992,12 +992,12 @@ coolscan_get_window_param (Coolscan_t * s, int prescanok) int ret; DBG (10, "get_window_param\n"); - ret=0; + ret=0; if(s->LS<2) /* distinquish between old and new scanners */ { ret=coolscan_get_window_param_LS20 (s); } else - { + { ret=coolscan_get_window_param_LS30(s,1,prescanok); ret=coolscan_get_window_param_LS30(s,2,prescanok); ret=coolscan_get_window_param_LS30(s,3,prescanok); @@ -1017,24 +1017,24 @@ coolscan_start_scanLS30 (Coolscan_t * s) memcpy (s->buffer, scan.cmd, scan.size); switch(s->colormode) { case RGB: - case GREYSCALE: + case GREYSCALE: channels=s->buffer[4]=0x03; /* window 1 */ s->buffer[6]=0x01; /* window 1 */ s->buffer[7]=0x02; /* window 2 */ - s->buffer[8]=0x03; /* window 3 */ - - break; + s->buffer[8]=0x03; /* window 3 */ + + break; case RGBI: channels=s->buffer[4]=0x04; /* window 1 */ s->buffer[6]=0x01; /* window 1 */ s->buffer[7]=0x02; /* window 2 */ - s->buffer[8]=0x03; /* window 3 */ - s->buffer[9]=0x09; /* window 3 */ - break; + s->buffer[8]=0x03; /* window 3 */ + s->buffer[9]=0x09; /* window 3 */ + break; case IRED: channels=s->buffer[4]=0x01; /* window 1 */ - s->buffer[8]=0x09; /* window 3 */ - break; + s->buffer[8]=0x09; /* window 3 */ + break; } return do_scsi_cmd (s->sfd, s->buffer, scan.size+channels, NULL, 0); @@ -1061,14 +1061,14 @@ prescan (Coolscan_t * s) { coolscan_set_window_param (s, 1); } else - { + { do_scsi_cmd (s->sfd,commande1.cmd,commande1.size,s->buffer,0x0d); wait_scanner (s); wait_scanner (s); coolscan_set_window_param_LS30 (s,1,1); coolscan_set_window_param_LS30 (s,2,1); coolscan_set_window_param_LS30 (s,3,1); - + } ret = coolscan_start_scan(s); @@ -1119,7 +1119,7 @@ do_prescan_now (Coolscan_t * scanner) return SANE_STATUS_DEVICE_BUSY; } - prescan (scanner); + prescan (scanner); if(scanner->LS<2) { get_internal_info(scanner); } @@ -1157,7 +1157,7 @@ send_one_LUT (Coolscan_t * s, SANE_Word * LUT, int reg) gamma = alloca (send.size + s->lutlength*2); memcpy (gamma, send.cmd, send.size); - if(s->LS<2) + if(s->LS<2) { gamma_p = &gamma[send.size]; for (i = 0; i < s->lutlength; i++) { @@ -1166,45 +1166,45 @@ send_one_LUT (Coolscan_t * s, SANE_Word * LUT, int reg) *gamma_p++ = (unsigned char) LUT[i]; } } - else if(s->LS==2) + else if(s->LS==2) { gamma_s = (unsigned short*)( &gamma[send.size]); for (i = 0; i < s->lutlength; i++) { if(s->negative) { - lutval=(unsigned short)(LUT[(s->lutlength-i)]); + lutval=(unsigned short)(LUT[(s->lutlength-i)]); } - else + else { - lutval=(unsigned short)(LUT[i]); - } + lutval=(unsigned short)(LUT[i]); + } if (LUT[i] >= s->max_lut_val) LUT[i] = s->max_lut_val-1; /* broken gtk */ if(s->low_byte_first) /* if on little endian machine: */ { - lutval=((lutval&0x00ff)<<8)+((lutval&0xff00)>>8); /* inverse byteorder */ + lutval=((lutval&0x00ff)<<8)+((lutval&0xff00)>>8); /* inverse byteorder */ } - *gamma_s++ = lutval; + *gamma_s++ = lutval; } } - else if(s->LS==3) + else if(s->LS==3) { gamma_s = (unsigned short*)( &gamma[send.size]); for (i = 0; i < s->lutlength; i++) { if(s->negative) { - lutval=(unsigned short)(LUT[s->lutlength-i]); + lutval=(unsigned short)(LUT[s->lutlength-i]); } - else + else { - lutval=(unsigned short)(LUT[i]); - } + lutval=(unsigned short)(LUT[i]); + } if (LUT[i] >= s->max_lut_val) LUT[i] = s->max_lut_val-1; /* broken gtk */ if(s->low_byte_first) /* if on little endian machine: */ - { lutval=((lutval&0x00ff)<<8)+((lutval&0xff00)>>8); /* inverse byteorder */ + { lutval=((lutval&0x00ff)<<8)+((lutval&0xff00)>>8); /* inverse byteorder */ } - *gamma_s++ = lutval; + *gamma_s++ = lutval; } } return do_scsi_cmd (s->sfd, gamma, send.size + s->lutlength*bytesperval, NULL, 0); @@ -1223,7 +1223,7 @@ send_LUT (Coolscan_t * s) send_one_LUT (s, s->gamma, S_DQ_Reg3); if(s->colormode&0x08) { send_one_LUT (s, s->gamma, S_DQ_Reg9); - } + } } } @@ -1234,7 +1234,7 @@ send_LUT (Coolscan_t * s) send_one_LUT (s, s->gamma_b, S_DQ_Reg3); if(s->colormode&0x08) { send_one_LUT (s, s->gamma_r, S_DQ_Reg9); - } + } } return 0; } @@ -1352,10 +1352,10 @@ pixels_per_line (Coolscan_t * s) { int pic_dot; if(s->LS<2) - { pic_dot = (s->brx - s->tlx + s->x_nres) / s->x_nres; + { pic_dot = (s->brx - s->tlx + s->x_nres) / s->x_nres; } else - { pic_dot = (s->brx - s->tlx + 1) / s->x_nres; + { pic_dot = (s->brx - s->tlx + 1) / s->x_nres; } DBG (10, "pic_dot=%d\n", pic_dot); return pic_dot; @@ -1366,10 +1366,10 @@ lines_per_scan (Coolscan_t * s) { int pic_line; if(s->LS<2) - { pic_line = (s->bry - s->tly + s->y_nres) / s->y_nres; + { pic_line = (s->bry - s->tly + s->y_nres) / s->y_nres; } else - { pic_line = (( s->bry - s->tly + 1.0 ) / s->y_nres); + { pic_line = (( s->bry - s->tly + 1.0 ) / s->y_nres); } DBG (10, "pic_line=%d\n", pic_line); return pic_line; @@ -1384,13 +1384,13 @@ scan_bytes_per_line (Coolscan_t * s) bpl=pixels_per_line (s) * 3; if(s->bits_per_color>8) bpl=bpl*2; return bpl; - break; + break; case RGBI: case IRED: bpl=pixels_per_line (s) * 4; if(s->bits_per_color>8) bpl=bpl*2; return bpl; - break; + break; } return 0; } @@ -1403,18 +1403,18 @@ write_bytes_per_line (Coolscan_t * s) bpl=pixels_per_line (s) * 3; if(s->bits_per_color>8) bpl=bpl*2; return bpl; - break; + break; case RGBI: bpl=pixels_per_line (s) * 4; if(s->bits_per_color>8) bpl=bpl*2; return bpl; - break; + break; case IRED: case GREYSCALE: bpl= pixels_per_line (s) ; if(s->bits_per_color>8) bpl=bpl*2; return bpl; - break; + break; } return 0; } @@ -1449,7 +1449,7 @@ coolscan_check_values (Coolscan_t * s) /* test_little_endian */ -static SANE_Bool +static SANE_Bool coolscan_test_little_endian(void) { SANE_Int testvalue = 255; @@ -1463,7 +1463,7 @@ coolscan_test_little_endian(void) static int get_inquiery_part_LS30 (Coolscan_t * s, unsigned char part) -{ +{ int size; /* Get length of reponse */ @@ -1473,7 +1473,7 @@ get_inquiery_part_LS30 (Coolscan_t * s, unsigned char part) set_inquiry_return_size (inquiry.cmd, size); do_scsi_cmd (s->sfd, inquiry.cmd, inquiry.size, s->buffer, size); - size=get_inquiry_length(s->buffer); + size=get_inquiry_length(s->buffer); size+=4; /* then get inquiry with actual size */ set_inquiry_return_size (inquiry.cmd, size); @@ -1498,7 +1498,7 @@ coolscan_read_var_data_block (Coolscan_t * s,int datatype) set_R_xfer_length (sread.cmd, size); r = do_scsi_cmd (s->sfd, sread.cmd, sread.size, s->buffer, size); - size=s->buffer[5]; + size=s->buffer[5]; set_R_xfer_length (sread.cmd, size); r = do_scsi_cmd (s->sfd, sread.cmd, sread.size, s->buffer, size); @@ -1507,14 +1507,14 @@ coolscan_read_var_data_block (Coolscan_t * s,int datatype) static int get_inquiery_LS30 (Coolscan_t * s) -{ +{ unsigned char part; unsigned char parts[5]; int i; /* Get vector of inquiery parts */ get_inquiery_part_LS30(s, (unsigned char) 0); - /* Get the parts of inquiery */ + /* Get the parts of inquiery */ for(i=0;i<5;i++) { parts[i]=((unsigned char *)s->buffer)[4+11+i]; } @@ -1522,7 +1522,7 @@ get_inquiery_LS30 (Coolscan_t * s) { part=parts[i]; get_inquiery_part_LS30 (s, part); switch(part) - { case 0x0c1:/* max size and resolution */ + { case 0x0c1:/* max size and resolution */ s->adbits = 8; s->outputbits = 8; s->maxres = getnbyte(s->buffer+0x12,2)-1; @@ -1537,7 +1537,7 @@ get_inquiery_LS30 (Coolscan_t * s) break; case 0x0f8: break; - } + } } /* get windows */ @@ -1556,7 +1556,7 @@ get_inquiery_LS30 (Coolscan_t * s) static int get_feeder_type_LS30 (Coolscan_t * s) -{ +{ int size; unsigned char *ptr; int ima; @@ -1668,7 +1668,7 @@ get_internal_info_LS20 (Coolscan_t * s) "\tdevice error code = 0x%x 0x%x 0x%x 0x%x 0x%x 0x%x 0x%x 0x%x\n" "\tpower-on errors = 0x%x 0x%x 0x%x 0x%x 0x%x 0x%x 0x%x 0x%x\n", s->offsetdata_r, s->offsetdata_g, s->offsetdata_b, - s->limitcondition, + s->limitcondition, s->derr[0], s->derr[1], s->derr[2], s->derr[3], s->derr[4], s->derr[5], s->derr[6], s->derr[7], s->power_on_errors[0], s->power_on_errors[1], @@ -1685,7 +1685,7 @@ get_internal_info (Coolscan_t * s) int ret; DBG (10, "get_internal_info\n"); - + if(s->LS<2) /* distinquish between old and new scanners */ { ret=get_internal_info_LS20 (s); } @@ -1734,7 +1734,7 @@ coolscan_initialize_values (Coolscan_t * s) } if(s->LS>=2) /* LS-30 */ { - get_inquiery_LS30(s); /* Info about scanner*/ + get_inquiery_LS30(s); /* Info about scanner*/ select_MUD (s); /* must be before mode_sense */ get_feeder_type_LS30(s); s->wdb_len = 117; @@ -1773,7 +1773,7 @@ coolscan_initialize_values (Coolscan_t * s) s->exposure_B = 50; s->pretv_r=40000; - s->pretv_g=40000; + s->pretv_g=40000; s->pretv_b=40000; s->shift_R = 128; @@ -1808,7 +1808,7 @@ coolscan_initialize_values (Coolscan_t * s) s->gamma_r[i] = s->gamma[i]; s->gamma_g[i] = s->gamma[i]; s->gamma_b[i] = s->gamma[i]; - } + } if (coolscan_test_little_endian() == SANE_TRUE) { @@ -1863,7 +1863,7 @@ sense_handler (int scsi_fd, unsigned char * result, void *arg) return SANE_STATUS_IO_ERROR; /* we only know about this one */ } return request_sense_parse(result); - + } @@ -1904,7 +1904,7 @@ static SANE_String_Const scan_mode_list_LS30[] = { colorStr, grayStr, -#ifdef HAS_IRED +#ifdef HAS_IRED rgbiStr, #endif /* HAS_IRED */ NULL @@ -1928,7 +1928,7 @@ static SANE_String_Const autofocus_mode_list[] = static SANE_String_Const source_list[4] = {NULL, NULL, NULL, NULL}; -static const SANE_Range gamma_range_8 = +static const SANE_Range gamma_range_8 = { 0, /* minimum */ 255, /* maximum */ @@ -1936,21 +1936,21 @@ static const SANE_Range gamma_range_8 = }; -static const SANE_Range gamma_range_9 = +static const SANE_Range gamma_range_9 = { 0, /* minimum */ 511, /* maximum */ 1 /* quantization */ }; -static const SANE_Range gamma_range_10 = +static const SANE_Range gamma_range_10 = { 0, /* minimum */ 1023, /* maximum */ 1 /* quantization */ }; -static const SANE_Range gamma_range_12 = +static const SANE_Range gamma_range_12 = { 0, /* minimum */ 4096, /* maximum */ @@ -2082,10 +2082,10 @@ attach_scanner (const char *devicename, Coolscan_t ** devp) if (NULL == (dev = malloc (sizeof (*dev)))) return SANE_STATUS_NO_MEM; - + dev->row_bufsize = (sanei_scsi_max_request_size < (64 * 1024)) ? sanei_scsi_max_request_size : 64 * 1024; - + if ((dev->buffer = malloc (dev->row_bufsize)) == NULL) /* if ((dev->buffer = malloc (sanei_scsi_max_request_size)) == NULL)*/ return SANE_STATUS_NO_MEM; @@ -2170,16 +2170,16 @@ typedef struct Color_correct_s double sumri; /* sum of red*ired pixel values*/ double sumii; /* sum of ired*ired pixel values*/ double sumrr; /* sum of ired*ired pixel values*/ - int mr; /* factor between red and ired values (*256) */ - int br; /* offset of ired values */ + int mr; /* factor between red and ired values (*256) */ + int br; /* offset of ired values */ } ColorCorrect; -/* --------------------------------------------------------------- +/* --------------------------------------------------------------- function: RGBIfix taks: Correct the infrared channel - + import: unsigned char * rgbimat - RGBI - matrix from scanner int size - number of pixels to correct int *lutr - lookup table for red correction @@ -2188,13 +2188,13 @@ typedef struct Color_correct_s int *lutr - lookup table for red correction export: unsigned char * orgbimat - RGBI - corrected matrix - + written by: Andreas RICK 19.6.1999 - + ----------------------------------------------------------------*/ static int Calc_fix_LUT(Coolscan_t * s) -{ int uselutr,uselutg,uselutb,useluti; +{ int uselutr,uselutg,uselutb,useluti; /* static int irmulr= -34*25; */ int irmulr= -64*25; int irmulg= -1*25; @@ -2207,11 +2207,11 @@ static int Calc_fix_LUT(Coolscan_t * s) irmulg=s->ired_green*(25); irmulb=s->ired_blue*(25); irmuli=25*256; - + if(s->LS==2) /* TODO: right conversion factors for 10 and 12 bit */ { div=4; } - else if(s->LS==3) + else if(s->LS==3) { div=16; } else @@ -2233,10 +2233,10 @@ static int Calc_fix_LUT(Coolscan_t * s) uselutb=s->gamma_b[i]/div; useluti=s->gamma_r[i]/div; } - s->lutr[uselutr]=(int)(irmulr*pow((double)i,(double)0.333333)); - s->lutg[uselutg]=(int)(irmulg*pow((double)i,(double)0.333333)); - s->lutb[uselutb]=(int)(irmulb*pow((double)i,(double)0.333333)); - s->luti[useluti]=(int)(irmuli*pow((double)i,(double)0.333333)); + s->lutr[uselutr]=(int)(irmulr*pow((double)i,(double)0.333333)); + s->lutg[uselutg]=(int)(irmulg*pow((double)i,(double)0.333333)); + s->lutb[uselutb]=(int)(irmulb*pow((double)i,(double)0.333333)); + s->luti[useluti]=(int)(irmuli*pow((double)i,(double)0.333333)); if(uselutr<255) { if(s->lutr[uselutr+1]==0) s->lutr[uselutr+1]=s->lutr[uselutr]; } @@ -2261,12 +2261,12 @@ static int Calc_fix_LUT(Coolscan_t * s) -/* --------------------------------------------------------------- +/* --------------------------------------------------------------- function: RGBIfix taks: Correct the infrared channel - + import: unsigned char * rgbimat - RGBI - matrix from scanner int size - number of pixels to correct int *lutr - lookup table for red correction @@ -2275,20 +2275,20 @@ static int Calc_fix_LUT(Coolscan_t * s) int *lutr - lookup table for red correction export: unsigned char * orgbimat - RGBI - corrected matrix - + written by: Andreas RICK 19.6.1999 - + ----------------------------------------------------------------*/ static int RGBIfix(Coolscan_t * scanner, unsigned char* rgbimat, - unsigned char* orgbimat, + unsigned char* orgbimat, int size, int *lutr, int *lutg, int *lutb, int *luti) - + { unsigned char *pr,*pg,*pb,*pi; unsigned char *opr,*opg,*opb,*opi; @@ -2299,42 +2299,42 @@ static int RGBIfix(Coolscan_t * scanner, for(x=0;x255*256)ii=255*256; if(scanner->negative) { - (*opi)=(unsigned char)(255-(ii>>8)); + (*opi)=(unsigned char)(255-(ii>>8)); } else { - (*opi)=(unsigned char)(ii>>8); + (*opi)=(unsigned char)(ii>>8); } } return 1; } -/* --------------------------------------------------------------- +/* --------------------------------------------------------------- function: RGBIfix16 taks: Correct the infrared channel for 16 bit images (doesn't do anything for now) - + import: unsigned char * rgbimat - RGBI - matrix from scanner int size - number of pixels to correct int *lutr - lookup table for red correction @@ -2343,21 +2343,21 @@ static int RGBIfix(Coolscan_t * scanner, int *lutr - lookup table for red correction export: unsigned char * orgbimat - RGBI - corrected matrix - + written by: Andreas RICK 19.6.1999 - + ----------------------------------------------------------------*/ static int RGBIfix16(Coolscan_t * scanner, unsigned short* rgbimat, - unsigned short* orgbimat, + unsigned short* orgbimat, int size, int *lutr, int *lutg, int *lutb, int *luti) - -{ + +{ unsigned short *pr,*pg,*pb,*pi; unsigned short *opr,*opg,*opb,*opi; int x; @@ -2367,43 +2367,43 @@ static int RGBIfix16(Coolscan_t * scanner, for(x=0;x>8); - (*opg)=(((*pg)&0x00ff)<<8)+(((*pg)&0xff00)>>8); - (*opb)=(((*pb)&0x00ff)<<8)+(((*pb)&0xff00)>>8); - (*opi)=(((*pi)&0x00ff)<<8)+(((*pi)&0xff00)>>8); + (*opr)=(((*pr)&0x00ff)<<8)+(((*pr)&0xff00)>>8); + (*opg)=(((*pg)&0x00ff)<<8)+(((*pg)&0xff00)>>8); + (*opb)=(((*pb)&0x00ff)<<8)+(((*pb)&0xff00)>>8); + (*opi)=(((*pi)&0x00ff)<<8)+(((*pi)&0xff00)>>8); } return 1; } -/* --------------------------------------------------------------- +/* --------------------------------------------------------------- function: rgb2g taks: Convert RGB data to grey - + import: unsigned char * rgbimat - RGB - matrix from scanner int size - size of input data (num pixel) export: unsigned char * gomat - Grey matrix - + written by: Andreas RICK 13.7.1999 - + ----------------------------------------------------------------*/ #define RtoG ((int)(0.27*256)) #define GtoG ((int)(0.54*256)) #define BtoG ((int)(0.19*256)) -static int rgb2g(unsigned char* rgbimat,unsigned char* gomat, +static int rgb2g(unsigned char* rgbimat,unsigned char* gomat, int size) - + { unsigned char *pr,*pg,*pb; unsigned char *opg; @@ -2412,17 +2412,17 @@ static int rgb2g(unsigned char* rgbimat,unsigned char* gomat, for(x=0;x>8); + (*opg)=(unsigned char)(g>>8); } return 1; } -/* --------------------------------------------------------------- +/* --------------------------------------------------------------- function: RGBIfix1 @@ -2433,7 +2433,7 @@ static int rgb2g(unsigned char* rgbimat,unsigned char* gomat, The infrared values is corrected by: Ir=mr*lutr(r)+luti(i) - + import: unsigned char * rgbimat - RGBI - matrix from scanner int size - number of pixels to correct ColorCorrect *cc, @@ -2441,18 +2441,18 @@ static int rgb2g(unsigned char* rgbimat,unsigned char* gomat, int *luti - lookup table for ired correction export: unsigned char * orgbimat - RGBI - corrected matrix - + written by: Andreas RICK 3.7.1999 - + ----------------------------------------------------------------*/ #if 0 -static int RGBIfix1(unsigned char* rgbimat,unsigned char* orgbimat, +static int RGBIfix1(unsigned char* rgbimat,unsigned char* orgbimat, int size, int *lutr, int *lutg, int *lutb, int *luti) - + { unsigned char *pr,*pg,*pb,*pi; unsigned char *opr,*opg,*opb,*opi; ColorCorrect cc; @@ -2468,7 +2468,7 @@ static int RGBIfix1(unsigned char* rgbimat,unsigned char* orgbimat, cc.sumr=cc.sumii=cc.sumrr=cc.sumi=cc.sumri=0.0; for(x=0;x>10)-cc.br)>>2) +128; (*opr)=(*pr); (*opg)=(*pg); - (*opb)=(*pb); + (*opb)=(*pb); if(ii<0) ii=0; if(ii>255) ii=255; - (*opi)=(unsigned char)(ii); + (*opi)=(unsigned char)(ii); } return 1; } @@ -2582,7 +2582,7 @@ reader_process (void *data ) data_left = scan_bytes_per_line (scanner) * lines_per_scan (scanner); - + /*scanner->row_bufsize = sanei_scsi_max_request_size;*/ coolscan_trim_rowbufsize (scanner); /* trim bufsize */ @@ -2612,27 +2612,27 @@ reader_process (void *data ) fclose (fp); return (-1); } - + if (scanner->LS == 1) { /* mirror image for LS-1000 */ bpl = scan_bytes_per_line(scanner); linesPerBuf = data_to_read / bpl; - - for (line = 0, lineOffset = 0; line < linesPerBuf; + + for (line = 0, lineOffset = 0; line < linesPerBuf; line++, lineOffset += bpl ) { - + if (scanner->colormode == RGB) { for (j = 0; j < bpl/2 ; j += 3) { r_data=scanner->buffer[lineOffset + j]; g_data=scanner->buffer[lineOffset + j + 1]; b_data=scanner->buffer[lineOffset + j + 2]; - - scanner->buffer[lineOffset + j] = + + scanner->buffer[lineOffset + j] = scanner->buffer[lineOffset + bpl -1 - j - 2 ]; - scanner->buffer[lineOffset + j + 1] = + scanner->buffer[lineOffset + j + 1] = scanner->buffer[lineOffset + bpl -1 - j - 1 ]; - scanner->buffer[lineOffset + j + 2] = + scanner->buffer[lineOffset + j + 2] = scanner->buffer[lineOffset + bpl -1 - j ]; - + scanner->buffer[lineOffset + bpl -1 - j - 2 ] = r_data; scanner->buffer[lineOffset + bpl -1 - j - 1] = g_data; scanner->buffer[lineOffset + bpl -1 - j] = b_data; @@ -2641,18 +2641,18 @@ reader_process (void *data ) else { for (j = 0; j < bpl/2; j++) { r_data=scanner->buffer[lineOffset + j]; - scanner->buffer[lineOffset + j] = + scanner->buffer[lineOffset + j] = scanner->buffer[lineOffset + bpl - 1 - j]; scanner->buffer[lineOffset + bpl - 1 - j] = r_data; } } - } - } - if(scanner->colormode==RGBI) + } + } + if(scanner->colormode==RGBI) { /* Correct Infrared Channel */ if(scanner->bits_per_color>8) { - RGBIfix16(scanner, (unsigned short * ) scanner->buffer, + RGBIfix16(scanner, (unsigned short * ) scanner->buffer, (unsigned short * )scanner->obuffer, data_to_read/8,scanner->lutr, scanner->lutg,scanner->lutb,scanner->luti); @@ -2672,9 +2672,9 @@ reader_process (void *data ) else { /* or just copy */ memcpy (scanner->obuffer, scanner->buffer,data_to_read); - } + } if((!scanner->low_byte_first)&&(scanner->bits_per_color>8)) - { for(i=0;iobuffer[i]; scanner->obuffer[i]=scanner->obuffer[i+1]; i++; @@ -2682,7 +2682,7 @@ reader_process (void *data ) } } fwrite (scanner->obuffer, 1, data_to_write, fp); - fflush (fp); + fflush (fp); data_left -= data_to_read; DBG (10, "reader_process: buffer of %d bytes read; %d bytes to go\n", data_to_read, data_left); @@ -2786,7 +2786,7 @@ init_options (Coolscan_t * scanner) scanner->opt[OPT_PRESCAN_NOW].constraint.string_list = 0; /* bit depth */ - + bit_depths=0; bit_depth_list[++bit_depths] = 8; if (scanner->LS==2) @@ -2886,7 +2886,7 @@ init_options (Coolscan_t * scanner) scanner->opt[OPT_GAMMA_BIND].type = SANE_TYPE_BOOL; scanner->opt[OPT_GAMMA_BIND].unit = SANE_UNIT_NONE; - + scanner->opt[OPT_ANALOG_GAMMA].name = "analog_gamma"; scanner->opt[OPT_ANALOG_GAMMA].title = "Analog Gamma"; scanner->opt[OPT_ANALOG_GAMMA].desc = "Analog Gamma"; @@ -3243,7 +3243,7 @@ sane_init (SANE_Int * version_code, SANE_Auth_Callback authorize) DBG_INIT (); sanei_thread_init (); - + DBG (10, "sane_init\n"); if (version_code) *version_code = SANE_VERSION_CODE (SANE_CURRENT_MAJOR, V_MINOR, 0); @@ -3286,7 +3286,7 @@ sane_exit (void) free (dev->obuffer); free (dev); } - + if (devlist) free (devlist); } @@ -3468,11 +3468,11 @@ sane_control_option (SANE_Handle handle, SANE_Int option, { case AF_NEVER: strcpy (val,neverStr); break; case AF_PREVIEW:strcpy (val,previewStr); - break; + break; case AF_SCAN:if(scanner->LS>=2) strcpy (val,scanStr); - break; + break; case AF_PREANDSCAN:if(scanner->LS>=2) strcpy (val,preandscanStr); - break; + break; } return SANE_STATUS_GOOD; @@ -3567,13 +3567,13 @@ sane_control_option (SANE_Handle handle, SANE_Int option, { case RGB: strcpy (val,colorStr); break; case GREYSCALE:strcpy (val,grayStr); - break; + break; case RGBI:if(scanner->LS>=2) strcpy (val,rgbiStr); else strcpy (val,colorStr); - break; - case IRED:if(scanner->LS>=2) strcpy (val,iredStr); + break; + case IRED:if(scanner->LS>=2) strcpy (val,iredStr); else strcpy (val,grayStr); - break; + break; } if (info) { @@ -3586,7 +3586,7 @@ sane_control_option (SANE_Handle handle, SANE_Int option, *(SANE_Word *) val = (scanner->prescan) ? SANE_TRUE : SANE_FALSE; return SANE_STATUS_GOOD; - case OPT_PRESCAN_NOW: + case OPT_PRESCAN_NOW: return SANE_STATUS_GOOD; case OPT_RGB_CONTROL: @@ -3598,7 +3598,7 @@ sane_control_option (SANE_Handle handle, SANE_Int option, return SANE_STATUS_GOOD; case OPT_ANALOG_GAMMA: - *(SANE_Word *) val = + *(SANE_Word *) val = (scanner->analog_gamma_r) ? SANE_TRUE : SANE_FALSE; return SANE_STATUS_GOOD; @@ -3692,7 +3692,7 @@ sane_control_option (SANE_Handle handle, SANE_Int option, return SANE_STATUS_GOOD; case OPT_PRESCAN_NOW: - do_prescan_now(scanner); + do_prescan_now(scanner); return SANE_STATUS_GOOD; case OPT_BIT_DEPTH: @@ -3811,16 +3811,16 @@ sane_control_option (SANE_Handle handle, SANE_Int option, return SANE_STATUS_GOOD; case OPT_AUTOFOCUS: - if(strcmp(val,neverStr)==0) + if(strcmp(val,neverStr)==0) { scanner->autofocus=AF_NEVER; } - if(strcmp(val,previewStr)==0) + if(strcmp(val,previewStr)==0) { scanner->autofocus=AF_PREVIEW; } - if(strcmp(val,scanStr)==0) + if(strcmp(val,scanStr)==0) { scanner->autofocus=AF_SCAN; } - if(strcmp(val,preandscanStr)==0) + if(strcmp(val,preandscanStr)==0) { scanner->autofocus=AF_PREANDSCAN;; } return SANE_STATUS_GOOD; @@ -3877,7 +3877,7 @@ sane_control_option (SANE_Handle handle, SANE_Int option, return SANE_STATUS_GOOD; case OPT_IRED_RED: - scanner->ired_red= *(SANE_Word *) val; + scanner->ired_red= *(SANE_Word *) val; return SANE_STATUS_GOOD; case OPT_SOURCE: @@ -3892,11 +3892,11 @@ sane_control_option (SANE_Handle handle, SANE_Int option, } return SANE_STATUS_GOOD; case OPT_MODE: - if(strcmp(val,colorStr)==0) + if(strcmp(val,colorStr)==0) { scanner->colormode=RGB; scanner->colormode_p=RGB; } - if(strcmp(val,grayStr)==0) + if(strcmp(val,grayStr)==0) { scanner->colormode=GREYSCALE; scanner->colormode_p=GREYSCALE; } @@ -3904,7 +3904,7 @@ sane_control_option (SANE_Handle handle, SANE_Int option, { scanner->colormode=RGBI; scanner->colormode_p=RGB; } - if(strcmp(val,iredStr)==0) + if(strcmp(val,iredStr)==0) { scanner->colormode=IRED; scanner->colormode_p=GREYSCALE; } @@ -3951,8 +3951,8 @@ sane_get_parameters (SANE_Handle handle, SANE_Parameters * params) break; #ifdef HAS_IRED case RGBI: - params->format = SANE_FRAME_RGBA; - break; + params->format = SANE_FRAME_RGBA; + break; #endif /* HAS_RGBI */ case GREYSCALE: params->format = SANE_FRAME_GRAY; @@ -4039,12 +4039,12 @@ sane_start (SANE_Handle handle) } } else - { + { if(scanner->autofocus & 0x01) { coolscan_autofocus (scanner); } if (scanner->prescan) { - prescan (scanner); + prescan (scanner); if(scanner->LS<2) { get_internal_info(scanner); } diff --git a/backend/coolscan.h b/backend/coolscan.h index d3e415441..4f40aa4a1 100644 --- a/backend/coolscan.h +++ b/backend/coolscan.h @@ -110,7 +110,7 @@ typedef struct Image_Pos { int start; /* start position of image on film strip */ int end; /* end position of image on film strip */ int offset /* always 0 */; - int height; /* image height always 2591 */ + int height; /* image height always 2591 */ } Image_Pos_t; @@ -213,19 +213,19 @@ typedef struct Coolscan int adbits; /* Number of A/D bits [8 or 12] */ int outputbits; /* Number of output image data bits [8] */ int maxres; /* Maximum resolution [2700] (dpi) */ - int xmax; /* X-axis coordinate maximum value - (basic measurement unit when measurement + int xmax; /* X-axis coordinate maximum value + (basic measurement unit when measurement unit divisor = 1200) [1151] */ - int ymax; /* Y-axis coordinate maximum value - (basic measurement unit when measurement + int ymax; /* Y-axis coordinate maximum value + (basic measurement unit when measurement unit divisor = 1200) [1727] */ - int xmaxpix; /* X-axis coordinate maximum value (pixel + int xmaxpix; /* X-axis coordinate maximum value (pixel address value) [2591] */ - int ymaxpix; /* Y-axis coordinate maximum value (pixel + int ymaxpix; /* Y-axis coordinate maximum value (pixel address value) [3887] */ - int ycurrent; /* Current stage position (Y-axis direction + int ycurrent; /* Current stage position (Y-axis direction pixel address) [0-7652] */ - int currentfocus; /* Current focus position (focus direction + int currentfocus; /* Current focus position (focus direction address) [0-200] */ int currentscanpitch; /* Current scan pitch [1-25] */ int autofeeder; /* Provision of auto feeder [Yes: 1, No: 0] */ @@ -276,7 +276,7 @@ typedef struct Coolscan int analog_gamma_g; /* analog gamma green */ int analog_gamma_b; /* analog gamma blue */ - /* Infrared correction values */ + /* Infrared correction values */ int ired_red; int ired_green; int ired_blue; diff --git a/backend/coolscan2.c b/backend/coolscan2.c index d54bf395e..6a3e0cc93 100644 --- a/backend/coolscan2.c +++ b/backend/coolscan2.c @@ -36,7 +36,7 @@ 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. diff --git a/backend/dc210.c b/backend/dc210.c index 32da7103b..85ffb2079 100644 --- a/backend/dc210.c +++ b/backend/dc210.c @@ -1,7 +1,7 @@ /*************************************************************************** * SANE - Scanner Access Now Easy. - dc210.c + dc210.c 11/11/98 @@ -43,17 +43,17 @@ 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. + If you do not wish that, delete this exception notice. *************************************************************************** This file implements a SANE backend for the Kodak DC-210 - digital camera. THIS IS EXTREMELY ALPHA CODE! USE AT YOUR OWN RISK!! + digital camera. THIS IS EXTREMELY ALPHA CODE! USE AT YOUR OWN RISK!! (feedback to: sane-dc210@interlinx.bc.ca This backend is based somewhat on the dc25 backend included in this - package by Peter Fales + package by Peter Fales ***************************************************************************/ @@ -395,7 +395,7 @@ init_dc210 (DC210 * camera) } /* send a break to get it back to a known state */ - /* Used to supply a non-zero argument to tcsendbreak(), TCSBRK, + /* Used to supply a non-zero argument to tcsendbreak(), TCSBRK, * and TCSBRKP, but that is system dependent. e.g. on irix a non-zero * value does a drain instead of a break. A zero value is universally * used to send a break. @@ -423,8 +423,8 @@ init_dc210 (DC210 * camera) if (send_pck (camera->fd, init_pck) == -1) { /* - * The camera always powers up at 9600, so we try - * that first. However, it may be already set to + * The camera always powers up at 9600, so we try + * that first. However, it may be already set to * a different speed. Try the entries in the table: */ @@ -455,7 +455,7 @@ init_dc210 (DC210 * camera) } } /* - Set speed to requested speed. + Set speed to requested speed. */ cfsetospeed (&tty_new, Camera.baud); cfsetispeed (&tty_new, Camera.baud); @@ -954,7 +954,7 @@ sane_control_option (SANE_Handle handle, SANE_Int option, if (dc210_opt_thumbnails) { - /* + /* * DC210 thumbnail are 96x72x8x3 */ parms.bytes_per_line = 96 * 3; @@ -1190,7 +1190,7 @@ sane_start (SANE_Handle handle) { /* - * Don't allow picture unless there is room in the + * Don't allow picture unless there is room in the * camera. */ if (Camera.pic_left == 0) diff --git a/backend/dc210.conf.in b/backend/dc210.conf.in index 9281043d4..82931704f 100644 --- a/backend/dc210.conf.in +++ b/backend/dc210.conf.in @@ -18,7 +18,7 @@ port=/dev/ttyS0 ## This works for most UNIX's baud=38400 # Prints some extra information during the init phase. This can be -# handy, but note that printing anything to stderr breaks the saned +# handy, but note that printing anything to stderr breaks the saned # network scanning. #dumpinquiry # How many usec (1,000,000ths of a) between writing the command and reading the diff --git a/backend/dc210.h b/backend/dc210.h index fe2b6334f..2cbbf46fd 100644 --- a/backend/dc210.h +++ b/backend/dc210.h @@ -1,7 +1,7 @@ /*************************************************************************** * SANE - Scanner Access Now Easy. - dc210.c + dc210.c 11/11/98 @@ -43,17 +43,17 @@ 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. + If you do not wish that, delete this exception notice. *************************************************************************** This file implements a SANE backend for the Kodak DC-210 - digital camera. THIS IS EXTREMELY ALPHA CODE! USE AT YOUR OWN RISK!! + digital camera. THIS IS EXTREMELY ALPHA CODE! USE AT YOUR OWN RISK!! (feedback to: sane-dc210@interlinx.bc.ca This backend is based somewhat on the dc25 backend included in this - package by Peter Fales + package by Peter Fales ***************************************************************************/ diff --git a/backend/dc240.c b/backend/dc240.c index 74ab2e036..0a534055d 100644 --- a/backend/dc240.c +++ b/backend/dc240.c @@ -1,13 +1,13 @@ /*************************************************************************** * _S_A_N_E - Scanner Access Now Easy. - dc240.c + dc240.c 03/12/01 - Peter Fales Based on the dc210 driver, (C) 1998 Brian J. Murrell (which is based on dc25 driver (C) 1998 by Peter Fales) - + This file (C) 2001 by Peter Fales This file is part of the SANE package. @@ -46,12 +46,12 @@ 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. + If you do not wish that, delete this exception notice. *************************************************************************** This file implements a SANE backend for the Kodak DC-240 - digital camera. THIS IS EXTREMELY ALPHA CODE! USE AT YOUR OWN RISK!! + digital camera. THIS IS EXTREMELY ALPHA CODE! USE AT YOUR OWN RISK!! (feedback to: dc240-devel@fales-lorenz.net) @@ -440,7 +440,7 @@ init_dc240 (DC240 * camera) } /* send a break to get it back to a known state */ - /* Used to supply a non-zero argument to tcsendbreak(), TCSBRK, + /* Used to supply a non-zero argument to tcsendbreak(), TCSBRK, * and TCSBRKP, but that is system dependent. e.g. on irix a non-zero * value does a drain instead of a break. A zero value is universally * used to send a break. @@ -465,7 +465,7 @@ init_dc240 (DC240 * camera) sleep (1); #endif - /* We seem to get some garbage following the break, so + /* We seem to get some garbage following the break, so * read anything pending */ n = read (camera->fd, buf, 5); @@ -476,8 +476,8 @@ init_dc240 (DC240 * camera) if (send_pck (camera->fd, init_pck) == -1) { /* - * The camera always powers up at 9600, so we try - * that first. However, it may be already set to + * The camera always powers up at 9600, so we try + * that first. However, it may be already set to * a different speed. Try the entries in the table: */ @@ -491,7 +491,7 @@ init_dc240 (DC240 * camera) buf[1], buf[2], buf[3], buf[4]); /* - Set speed to requested speed. + Set speed to requested speed. */ cfsetospeed (&tty_new, Camera.baud); cfsetispeed (&tty_new, Camera.baud); @@ -597,7 +597,7 @@ get_info (DC240 * camera) n = read_dir ("\\PCCARD\\DCIM\\*.*"); /* If we've already got a folder_list, free it up before starting - * the new one + * the new one */ if (folder_list != NULL) { @@ -1083,8 +1083,8 @@ sane_control_option (SANE_Handle handle, SANE_Int option, myinfo |= SANE_INFO_RELOAD_PARAMS; - /* get the image's resolution, unless the camera has no - * pictures yet + /* get the image's resolution, unless the camera has no + * pictures yet */ if (Camera.pic_taken != 0) { @@ -1367,7 +1367,7 @@ sane_start (SANE_Handle handle) if (dc240_opt_snap) { /* - * Don't allow picture unless there is room in the + * Don't allow picture unless there is room in the * camera. */ if (Camera.pic_left == 0) @@ -1719,7 +1719,7 @@ get_picture_info (PictureInfo * pic, SANE_Int p) read_info (e->name); - /* Validate picture info + /* Validate picture info * byte 0 - 1 == picture info * byte 1 - 5 == DC240 Camera * byte 2 - 3 == JFIF file @@ -1736,7 +1736,7 @@ get_picture_info (PictureInfo * pic, SANE_Int p) pic->low_res = info_buf[3] == 0 ? SANE_TRUE : SANE_FALSE; - /* + /* * byte 12 - Year MSB * byte 13 - Year LSB * byte 14 - Month @@ -1991,8 +1991,8 @@ read_info (SANE_String fname) /* - * send_data - Send a data block - assumes all data blocks to camera - * are 60 bytes long + * send_data - Send a data block - assumes all data blocks to camera + * are 60 bytes long */ static SANE_Int @@ -2090,7 +2090,7 @@ dir_insert (struct cam_dirent *entry) } /* - * dir_delete - Delete a directory entry from the linked list of file + * dir_delete - Delete a directory entry from the linked list of file * names */ static SANE_Int @@ -2123,7 +2123,7 @@ dir_delete (SANE_String fname) } /* - * set_res - set picture size depending on resolution settings + * set_res - set picture size depending on resolution settings */ static void set_res (SANE_Int lowres) diff --git a/backend/dc240.conf.in b/backend/dc240.conf.in index 9281043d4..82931704f 100644 --- a/backend/dc240.conf.in +++ b/backend/dc240.conf.in @@ -18,7 +18,7 @@ port=/dev/ttyS0 ## This works for most UNIX's baud=38400 # Prints some extra information during the init phase. This can be -# handy, but note that printing anything to stderr breaks the saned +# handy, but note that printing anything to stderr breaks the saned # network scanning. #dumpinquiry # How many usec (1,000,000ths of a) between writing the command and reading the diff --git a/backend/dc240.h b/backend/dc240.h index fae362804..27e2ee9e5 100644 --- a/backend/dc240.h +++ b/backend/dc240.h @@ -46,12 +46,12 @@ 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. + If you do not wish that, delete this exception notice. *************************************************************************** This file implements a SANE backend for the Kodak DC-240 - digital camera. THIS IS EXTREMELY ALPHA CODE! USE AT YOUR OWN RISK!! + digital camera. THIS IS EXTREMELY ALPHA CODE! USE AT YOUR OWN RISK!! (feedback to: dc240-devel@fales-lorenz.net) @@ -143,16 +143,16 @@ static SANE_Int get_info (DC240 *); * Resolution: 0x00 = low, 0x01 = high */ #define THUMBS_PCK {0x93, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x1A} -/* - * +/* + * */ #define PICS_PCK {0x9A, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1A} -/* - * +/* + * */ #define PICS_INFO_PCK {0x91, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1A} -/* - * +/* + * */ #define OPEN_CARD_PCK {0x96, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1A} #define READ_DIR_PCK {0x99, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1A} diff --git a/backend/dc25.c b/backend/dc25.c index fd7a0db42..8e74dd95b 100644 --- a/backend/dc25.c +++ b/backend/dc25.c @@ -1,7 +1,7 @@ /*************************************************************************** * SANE - Scanner Access Now Easy. - dc25.c + dc25.c $Id$ @@ -43,13 +43,13 @@ 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. + If you do not wish that, delete this exception notice. *************************************************************************** - This file implements a SANE backend for the Kodak DC-25 (and + This file implements a SANE backend for the Kodak DC-25 (and probably the DC-20) digital cameras. THIS IS EXTREMELY ALPHA CODE! - USE AT YOUR OWN RISK!! + USE AT YOUR OWN RISK!! (feedback to: dc25-devel@fales-lorenz.net) @@ -73,7 +73,7 @@ * conversion routine written by YOSHIDA Hideki * * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published + * it under the terms of the GNU General Public License as published * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * @@ -352,9 +352,9 @@ static SANE_Parameters parms = { static unsigned char init_pck[] = INIT_PCK; /* - * List of speeds to try to establish connection with the camera. + * List of speeds to try to establish connection with the camera. * Check 9600 first, as it's the speed the camera comes up in, then - * 115200, as that is the one most likely to be configured from a + * 115200, as that is the one most likely to be configured from a * previous run */ static struct pkt_speed speeds[] = { {B9600, {0x96, 0x00}}, @@ -468,8 +468,8 @@ init_dc20 (char *device, speed_t speed) if (send_pck (tfd, init_pck) == -1) { /* - * The camera always powers up at 9600, so we try - * that first. However, it may be already set to + * The camera always powers up at 9600, so we try + * that first. However, it may be already set to * a different speed. Try the entries in the table: */ @@ -594,7 +594,7 @@ get_info (int fd) { /* Not sure where the previous line came from. All the * information I have says that even on the DC20 the number of - * standard res pics left is in byte 23 and the number of high res + * standard res pics left is in byte 23 and the number of high res * pics left is in byte 21. It seems to me that the conservative * approach is to report the number of high res pics left. */ @@ -1114,7 +1114,7 @@ if (verbose) printf ("%s: determine_limits: low_i = %d, high_i = %d\n", __progna /* * The original dc20ctrl program used a default gamma of 0.35, but I thougt - * 0.45 looks better. In addition, since xscanimage seems to always force + * 0.45 looks better. In addition, since xscanimage seems to always force * a resolution of 0.1, I multiply everything by 10 and make the default * 4.5. */ @@ -1689,8 +1689,8 @@ shoot (int fd) cfsetispeed (&tty_temp, B9600); cfsetospeed (&tty_temp, B9600); - /* - * Apparently there is a bug in the DC20 where the response to + /* + * Apparently there is a bug in the DC20 where the response to * the shoot request is always at 9600. The DC25 does not have * this bug, so we skip this block. */ @@ -1728,7 +1728,7 @@ shoot (int fd) { if (CameraInfo.model == 0x25) { - /* + /* * If we don't put this in, the next read will time out * and return failure. Does the DC-20 need it too? */ @@ -1771,7 +1771,7 @@ erase (int fd) * This block may really apply to the DC20 also, but since I * don't have one, it's hard to say for sure. On the DC25, erase * takes long enought that the read may timeout without returning - * any data before the erase is complete. We let this happen + * any data before the erase is complete. We let this happen * up to 4 times, then give up. */ while (count < 4) @@ -2121,7 +2121,7 @@ sane_control_option (SANE_Handle handle, SANE_Int option, if (dc25_opt_thumbnails) { - /* + /* * DC20 thumbnail are 80x60 grayscale, DC25 * thumbnails are color. */ @@ -2200,7 +2200,7 @@ sane_control_option (SANE_Handle handle, SANE_Int option, /* * erase and erase_one are mutually exclusive. If - * this one is turned on, the other must be off + * this one is turned on, the other must be off */ if (dc25_opt_erase && dc25_opt_erase_one) { @@ -2214,7 +2214,7 @@ sane_control_option (SANE_Handle handle, SANE_Int option, /* * erase and erase_one are mutually exclusive. If - * this one is turned on, the other must be off + * this one is turned on, the other must be off */ if (dc25_opt_erase_one && dc25_opt_erase) { @@ -2350,7 +2350,7 @@ sane_start (SANE_Handle handle) { /* - * Don't allow picture unless there is room in the + * Don't allow picture unless there is room in the * camera. */ if (CameraInfo.pic_left == 0) @@ -2359,7 +2359,7 @@ sane_start (SANE_Handle handle) return SANE_STATUS_INVAL; } - /* + /* * DC-20 can only change resolution when camer is empty. * DC-25 can do it any time. */ @@ -2403,7 +2403,7 @@ sane_start (SANE_Handle handle) /* * For thumbnails, we can do things right where we - * start the download, and grab the first block + * start the download, and grab the first block * from the camera. The reamining blocks will be * fetched as necessary by sane_read(). */ @@ -2421,7 +2421,7 @@ sane_start (SANE_Handle handle) return SANE_STATUS_INVAL; } - /* + /* * DC20 thumbnail are 80x60 grayscale, DC25 * thumbnails are color. */ @@ -2439,10 +2439,10 @@ sane_start (SANE_Handle handle) { /* * We do something a little messy, and violates the SANE - * philosophy. However, since it is fairly tricky to + * philosophy. However, since it is fairly tricky to * convert the DC2x "comet" files on the fly, we read in * the entire data stream in sane_open(), and use convert_pic - * to convert it to an in-memory pixpmap. Then when + * to convert it to an in-memory pixpmap. Then when * sane_read() is called, we fill the requests from * memory. A good project for me (or some kind volunteer) * would be to rewrite this and move the actual download @@ -2450,7 +2450,7 @@ sane_start (SANE_Handle handle) * this way is that the data comes down pretty fast, and * it helps to dedicate the processor to this task. We * might get serial port overruns if we try to do other - * things at the same time. + * things at the same time. * * Also, as a side note, I was constantly getting serial * port overruns on a 90MHz pentium until I used hdparm @@ -2634,7 +2634,7 @@ sane_read (SANE_Handle __sane_unused__ handle, SANE_Byte * data, int i; int filesize = parms.bytes_per_line * parms.lines; - /* + /* * If outbytes is zero, then this is the first time * we've been called, so update the contrast table. * The formula is something I came up with that has the @@ -2642,10 +2642,10 @@ sane_read (SANE_Handle __sane_unused__ handle, SANE_Byte * data, * 1) It's a smooth curve that provides the effect I wanted * (bright pixels are made brighter, dim pixels are made * dimmer) - * 2) The contrast parameter can be adjusted to provide + * 2) The contrast parameter can be adjusted to provide * different amounts of contrast. * 3) A parameter of 1.0 can be used to pass the data - * through unchanged (but values around 1.75 look + * through unchanged (but values around 1.75 look * a lot better */ if (outbytes == 0) diff --git a/backend/dc25.conf.in b/backend/dc25.conf.in index 33cfd895a..af2cfb1b9 100644 --- a/backend/dc25.conf.in +++ b/backend/dc25.conf.in @@ -18,6 +18,6 @@ port=/dev/ttyS0 ## This works for most UNIX's baud=38400 # Prints some extra information during the init phase. This can be -# handy, but note that printing anything to stderr breaks the saned +# handy, but note that printing anything to stderr breaks the saned # network scanning. #dumpinquiry diff --git a/backend/dc25.h b/backend/dc25.h index fe12f747b..c198f20ae 100644 --- a/backend/dc25.h +++ b/backend/dc25.h @@ -43,13 +43,13 @@ 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. + If you do not wish that, delete this exception notice. *************************************************************************** - This file implements a SANE backend for the Kodak DC-25 (and + This file implements a SANE backend for the Kodak DC-25 (and probably the DC-20) digital cameras. THIS IS EXTREMELY ALPHA CODE! - USE AT YOUR OWN RISK!! + USE AT YOUR OWN RISK!! (feedback to: dc25-devel@fales-lorenz.net) @@ -73,7 +73,7 @@ * conversion routine written by YOSHIDA Hideki * * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published + * it under the terms of the GNU General Public License as published * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * @@ -97,7 +97,7 @@ #include #ifndef TRUE -#define TRUE (1==1) +#define TRUE (1==1) #endif #ifndef FALSE @@ -255,7 +255,7 @@ static int read_data (int fd, unsigned char *buf, int sz); static int end_of_data (int fd); -static int set_pixel_rgb (struct pixmap *, int, int, unsigned char, unsigned char, unsigned char); +static int set_pixel_rgb (struct pixmap *, int, int, unsigned char, unsigned char, unsigned char); static struct pixmap *alloc_pixmap (int x, int y, int d); diff --git a/backend/dell1600n_net.c b/backend/dell1600n_net.c index 3586215a1..87353e5d4 100644 --- a/backend/dell1600n_net.c +++ b/backend/dell1600n_net.c @@ -1,47 +1,47 @@ /* sane - Scanner Access Now Easy. Copyright (C) 2006 Jon Chambers - + 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. - + Dell 1600n network scan driver for SANE. - + To debug: SANE_DEBUG_DELL1600N_NET=255 scanimage --verbose 2>scan.errs 1>scan.png */ @@ -136,8 +136,8 @@ struct ScannerState unsigned int m_currentPageBytes;/* number of bytes of current page read (host byte order) */ }; -/* state data for a single page - NOTE: all ints are in host byte order +/* state data for a single page + NOTE: all ints are in host byte order */ struct PageInfo { @@ -199,7 +199,7 @@ static void FinalisePacket (struct ComBuf *pBuf); static int MessageIsComplete (unsigned char *pData, size_t size); /* process a registration broadcast response - \return DeviceRecord pointer on success (caller frees), NULL on failure + \return DeviceRecord pointer on success (caller frees), NULL on failure */ static struct DeviceRecord *ProcessFindResponse (unsigned char *pData, size_t size); @@ -638,7 +638,7 @@ sane_get_parameters (SANE_Handle handle, SANE_Parameters * params) height = pageInfo.m_height; imageSize = width * height * 3; - DBG( 5, "sane_get_parameters: bytes remaining on this page: %d, num pages: %d, size: %dx%d\n", + DBG( 5, "sane_get_parameters: bytes remaining on this page: %d, num pages: %d, size: %dx%d\n", pageInfo.m_bytesRemaining, gOpenScanners[iHandle]->m_numPages, width, @@ -781,7 +781,7 @@ sane_start (SANE_Handle handle) cleanup: FreeComBuf (&buf); - + return status; } /* sane_start */ @@ -805,7 +805,7 @@ sane_read (SANE_Handle handle, SANE_Byte * data, return SANE_STATUS_INVAL; /* check for end of data (no further pages) */ - if ( ( ! gOpenScanners[iHandle]->m_imageData.m_used ) + if ( ( ! gOpenScanners[iHandle]->m_imageData.m_used ) || ( ! gOpenScanners[iHandle]->m_numPages ) ) { /* remove empty page if there are no more cached pages */ @@ -845,7 +845,7 @@ sane_read (SANE_Handle handle, SANE_Byte * data, DBG (5, "sane_read: sending %d bytes, image total %d, %d page bytes remaining, %lu total remaining, image: %dx%d\n", dataSize, gOpenScanners[iHandle]->m_bytesRead, pageInfo.m_bytesRemaining , - (unsigned long)(gOpenScanners[iHandle]->m_imageData.m_used - dataSize), + (unsigned long)(gOpenScanners[iHandle]->m_imageData.m_used - dataSize), pageInfo.m_width, pageInfo.m_height); @@ -1037,7 +1037,7 @@ FreeComBuf (struct ComBuf *pBuf) /* add data to a ComBuf struct \return 0 on success, >0 on failure \note If pData is NULL then buffer size will be increased but no copying will take place - \note In case of failure pBuf will be released using FreeComBuf + \note In case of failure pBuf will be released using FreeComBuf */ int AppendToComBuf (struct ComBuf *pBuf, const unsigned char *pData, @@ -1178,7 +1178,7 @@ MessageIsComplete (unsigned char *pData, size_t size) /***********************************************************/ /* process a registration broadcast response - \return struct DeviceRecord pointer on success (caller frees), NULL on failure + \return struct DeviceRecord pointer on success (caller frees), NULL on failure */ struct DeviceRecord * ProcessFindResponse (unsigned char *pData, size_t size) @@ -1730,7 +1730,7 @@ ProcessTcpResponse (struct ScannerState *pState, struct ComBuf *pTcpBuf) } /* if */ } /* while */ - /* process page data if required */ + /* process page data if required */ if ( bProcessImage ) errorCheck |= ProcessPageData (pState); cleanup: @@ -1824,10 +1824,10 @@ ProcessPageData (struct ScannerState *pState) jpegCinfo.m_cinfo.src = &jpegSrcMgr; jpegCinfo.m_bytesRemaining = pState->m_buf.m_used; jpegCinfo.m_pData = pState->m_buf.m_pBuf; - + jpeg_read_header (&jpegCinfo.m_cinfo, TRUE); jpeg_start_decompress (&jpegCinfo.m_cinfo); - + /* allocate space for a single scanline */ scanLineSize = jpegCinfo.m_cinfo.output_width * jpegCinfo.m_cinfo.output_components; diff --git a/backend/dll.c b/backend/dll.c index 5eaa04656..8dc817495 100644 --- a/backend/dll.c +++ b/backend/dll.c @@ -42,7 +42,7 @@ allows managing an arbitrary number of SANE backends by using dynamic linking to load backends on demand. */ -/* Please increase version number with every change +/* Please increase version number with every change (don't forget to update dll.desc) */ #define DLL_VERSION "1.0.13" @@ -353,7 +353,7 @@ load (struct backend *be) image_id id = -1; int i, w; directory_which which[3] = { B_USER_ADDONS_DIRECTORY, B_COMMON_ADDONS_DIRECTORY, B_BEOS_ADDONS_DIRECTORY }; - + /* look for config files in SANE/conf */ for (w = 0; (w < 3) && (id < 0) && (find_directory(which[w],0,true,path,PATH_MAX) == 0); w++) { @@ -373,7 +373,7 @@ load (struct backend *be) continue; /* try next path */ } be->handle=(void *)id; - + for (i = 0; i < NUM_OPS; ++i) { void *(*op) (); @@ -492,7 +492,7 @@ load (struct backend *be) break; DBG (4, "load: couldn't open `%s' (%s)\n", libname, strerror (errno)); -#ifdef ALT_POSTFIX +#ifdef ALT_POSTFIX /* Some platforms have two ways of storing their libraries, try both postfixes */ snprintf (libname, sizeof (libname), "%s/" PREFIX "%s" ALT_POSTFIX, @@ -882,7 +882,7 @@ sane_init (SANE_Int * version_code, SANE_Auth_Callback authorize) char path[1024]; directory_which which[3] = { B_USER_ADDONS_DIRECTORY, B_COMMON_ADDONS_DIRECTORY, B_BEOS_ADDONS_DIRECTORY }; int i; -#endif +#endif DBG_INIT (); @@ -934,7 +934,7 @@ sane_init (SANE_Int * version_code, SANE_Auth_Callback authorize) } fclose (fp); -#else +#else /* no ugly config files, just get scanners from their ~/config/add-ons/SANE */ /* look for drivers */ for (i = 0; i < 3; i++) @@ -943,13 +943,13 @@ sane_init (SANE_Int * version_code, SANE_Auth_Callback authorize) continue; strcat(path,"/SANE/"); dir=opendir(path); - if(!dir) continue; + if(!dir) continue; while((dirent=readdir(dir))) { if((strcmp(dirent->d_name,".")==0) || (strcmp(dirent->d_name,"..")==0)) continue; if((strcmp(dirent->d_name,"dll")==0)) continue; - add_backend(dirent->d_name,0); + add_backend(dirent->d_name,0); } closedir(dir); } diff --git a/backend/dmc.c b/backend/dmc.c index c5c57c4f4..ddc76c317 100644 --- a/backend/dmc.c +++ b/backend/dmc.c @@ -1,6 +1,6 @@ /* sane - Scanner Access Now Easy. Copyright (C) 1998 David F. Skoll - Heavily based on "hp.c" driver for HP Scanners, by + Heavily based on "hp.c" driver for HP Scanners, by David Mosberger-Tang. This file is part of the SANE package. @@ -425,7 +425,7 @@ DMCInitOptions(DMC_Camera *c) c->opt[OPT_TL_X].constraint_type = SANE_CONSTRAINT_RANGE; c->opt[OPT_TL_X].constraint.range = &c->tl_x_range; c->val[OPT_TL_X].w = c->tl_x_range.min; - + /* top-left y */ c->opt[OPT_TL_Y].name = SANE_NAME_SCAN_TL_Y; c->opt[OPT_TL_Y].title = SANE_TITLE_SCAN_TL_Y; @@ -435,7 +435,7 @@ DMCInitOptions(DMC_Camera *c) c->opt[OPT_TL_Y].constraint_type = SANE_CONSTRAINT_RANGE; c->opt[OPT_TL_Y].constraint.range = &c->tl_y_range; c->val[OPT_TL_Y].w = c->tl_y_range.min; - + /* bottom-right x */ c->opt[OPT_BR_X].name = SANE_NAME_SCAN_BR_X; c->opt[OPT_BR_X].title = SANE_TITLE_SCAN_BR_X; @@ -445,7 +445,7 @@ DMCInitOptions(DMC_Camera *c) c->opt[OPT_BR_X].constraint_type = SANE_CONSTRAINT_RANGE; c->opt[OPT_BR_X].constraint.range = &c->br_x_range; c->val[OPT_BR_X].w = c->br_x_range.min; - + /* bottom-right y */ c->opt[OPT_BR_Y].name = SANE_NAME_SCAN_BR_Y; c->opt[OPT_BR_Y].title = SANE_TITLE_SCAN_BR_Y; @@ -485,7 +485,7 @@ DMCInitOptions(DMC_Camera *c) c->opt[OPT_SHUTTER_SPEED].constraint_type = SANE_CONSTRAINT_RANGE; c->opt[OPT_SHUTTER_SPEED].constraint.range = &c->hw->shutterSpeedRange; c->val[OPT_SHUTTER_SPEED].w = c->hw->shutterSpeed; - + c->opt[OPT_WHITE_BALANCE].name = "whitebalance"; c->opt[OPT_WHITE_BALANCE].title = "White Balance"; c->opt[OPT_WHITE_BALANCE].desc = "Selects white balance"; @@ -618,7 +618,7 @@ DMCSetASA(int fd, unsigned int asa) if (i > ASA_100+1) return SANE_STATUS_INVAL; - status = DMCRead(fd, 0x87, 0x4, exposureCalculationResults, + status = DMCRead(fd, 0x87, 0x4, exposureCalculationResults, sizeof(exposureCalculationResults), &len); if (status != SANE_STATUS_GOOD) return status; if (len < sizeof(exposureCalculationResults)) return SANE_STATUS_IO_ERROR; @@ -647,7 +647,7 @@ DMCSetWhiteBalance(int fd, int mode) size_t len; DBG(3, "DMCSetWhiteBalance: %d\n", mode); - status = DMCRead(fd, 0x82, 0x0, userInterfaceSettings, + status = DMCRead(fd, 0x82, 0x0, userInterfaceSettings, sizeof(userInterfaceSettings), &len); if (status != SANE_STATUS_GOOD) return status; if (len < sizeof(userInterfaceSettings)) return SANE_STATUS_IO_ERROR; @@ -749,7 +749,7 @@ DMCReadTwoSuperResolutionLines(DMC_Camera *c, SANE_Byte *buf, int lastLine) greenCoeff = ADVANCE_COEFF(greenCoeff); blueCoeff = ADVANCE_COEFF(blueCoeff); } - + /* Do the next super-resolution line and interpolate vertically */ if (lastLine) { memcpy(buf+BYTES_PER_RAW_LINE*3, buf, BYTES_PER_RAW_LINE*3); @@ -868,7 +868,7 @@ sane_exit(void) free(dev); dev = next; } - + if (devlist) free (devlist); } @@ -1103,7 +1103,7 @@ sane_control_option(SANE_Handle handle, SANE_Int option, if (c->val[OPT_SHUTTER_SPEED].w != * (SANE_Int *) val) { if (info) *info |= SANE_INFO_INEXACT; } - + return SANE_STATUS_GOOD; default: @@ -1328,7 +1328,7 @@ sane_read(SANE_Handle handle, SANE_Byte *buf, SANE_Int max_len, SANE_Int *len) *len = max_len; return SANE_STATUS_GOOD; } - + if (c->imageMode == IMAGE_MFI || c->imageMode == IMAGE_RAW) { /* We have to read complete rows... */ max_len = (max_len / c->params.bytes_per_line) * c->params.bytes_per_line; diff --git a/backend/epjitsu.c b/backend/epjitsu.c index ce79a200c..f2323feba 100644 --- a/backend/epjitsu.c +++ b/backend/epjitsu.c @@ -1,7 +1,7 @@ /* sane - Scanner Access Now Easy. This file implements a SANE backend for the Fujitsu fi-60F, the - ScanSnap S300/S1300, and (hopefully) other Epson-based scanners. + ScanSnap S300/S1300, and (hopefully) other Epson-based scanners. Copyright 2007-2015 by m. allan noah Copyright 2009 by Richard Goedeken @@ -174,7 +174,7 @@ . . - sane_start() : start image acquisition . . - sane_get_parameters() : returns actual scan parameters . . - sane_read() : read image data (from pipe) - . . (sane_read called multiple times; after sane_read returns EOF, + . . (sane_read called multiple times; after sane_read returns EOF, . . loop may continue with sane_start which may return a 2nd page . . when doing duplex scans, or load the next page from the ADF) . . @@ -218,7 +218,7 @@ unsigned char global_firmware_filename[PATH_MAX]; - function trace 10 - function detail 15 - get/setopt cmds 20 - - usb cmd trace 25 + - usb cmd trace 25 - usb cmd detail 30 - useless noise 35 */ @@ -253,7 +253,7 @@ static struct scanner *scanner_devList = NULL; /* * Called by SANE initially. - * + * * From the SANE spec: * This function must be called before any other SANE function can be * called. The behavior of a SANE backend is undefined if this @@ -271,21 +271,21 @@ sane_init (SANE_Int * version_code, SANE_Auth_Callback authorize) DBG_INIT (); DBG (10, "sane_init: start\n"); - + if (version_code) *version_code = SANE_VERSION_CODE (SANE_CURRENT_MAJOR, V_MINOR, BUILD); - + DBG (5, "sane_init: epjitsu backend %d.%d.%d, from %s\n", SANE_CURRENT_MAJOR, V_MINOR, BUILD, PACKAGE_STRING); DBG (10, "sane_init: finish\n"); - + return SANE_STATUS_GOOD; } /* * Called by SANE to find out about supported devices. - * + * * From the SANE spec: * This function can be used to query the list of devices that are * available. If the function executes successfully, it stores a @@ -298,7 +298,7 @@ sane_init (SANE_Int * version_code, SANE_Auth_Callback authorize) * returned (devices directly attached to the machine that SANE is * running on). If it is false, the device list includes all remote * devices that are accessible to the SANE library. - * + * * SANE does not require that this function is called before a * sane_open() call is performed. A device name may be specified * explicitly by a user which would make it unnecessary and @@ -318,36 +318,36 @@ sane_get_devices (const SANE_Device *** device_list, SANE_Bool local_only) FILE *fp; int num_devices=0; int i=0; - + local_only = local_only; /* get rid of compiler warning */ - + DBG (10, "sane_get_devices: start\n"); - + /* mark all existing scanners as missing, attach_one will remove mark */ for (s = scanner_devList; s; s = s->next) { s->missing = 1; } sanei_usb_init(); - + fp = sanei_config_open (CONFIG_FILE); - + if (fp) { - + DBG (15, "sane_get_devices: reading config file %s\n", CONFIG_FILE); - + while (sanei_config_read (line, PATH_MAX, fp)) { - + lp = line; /* ignore comments */ if (*lp == '#') continue; - + /* skip empty lines */ if (*lp == 0) continue; - + if ((strncmp ("firmware", lp, 8) == 0) && isspace (lp[8])) { lp += 8; lp = sanei_config_skip_whitespace (lp); @@ -364,7 +364,7 @@ sane_get_devices (const SANE_Device *** device_list, SANE_Bool local_only) } fclose (fp); } - + else { DBG (5, "sane_get_devices: no config file '%s'!\n", CONFIG_FILE); @@ -374,7 +374,7 @@ sane_get_devices (const SANE_Device *** device_list, SANE_Bool local_only) for (s = scanner_devList; s;) { if(s->missing){ DBG (5, "sane_get_devices: missing scanner %s\n",s->sane.name); - + /*splice s out of list by changing pointer in prev to next*/ if(prev){ prev->next = s->next; @@ -387,7 +387,7 @@ sane_get_devices (const SANE_Device *** device_list, SANE_Bool local_only) s = s->next; free(prev); prev=NULL; - + /*reset head to next s*/ scanner_devList = s; } @@ -397,21 +397,21 @@ sane_get_devices (const SANE_Device *** device_list, SANE_Bool local_only) s=prev->next; } } - + for (s = scanner_devList; s; s=s->next) { DBG (15, "sane_get_devices: found scanner %s\n",s->sane.name); num_devices++; } - + DBG (15, "sane_get_devices: found %d scanner(s)\n",num_devices); if (sane_devArray) free (sane_devArray); - + sane_devArray = calloc (num_devices + 1, sizeof (SANE_Device*)); if (!sane_devArray) return SANE_STATUS_NO_MEM; - + for (s = scanner_devList; s; s=s->next) { sane_devArray[i++] = (SANE_Device *)&s->sane; } @@ -420,24 +420,24 @@ sane_get_devices (const SANE_Device *** device_list, SANE_Bool local_only) if(device_list){ *device_list = sane_devArray; } - + DBG (10, "sane_get_devices: finish\n"); - + return ret; } /* callback used by sane_init - * build the scanner struct and link to global list - * unless struct is already loaded, then pretend + * build the scanner struct and link to global list + * unless struct is already loaded, then pretend */ static SANE_Status attach_one (const char *name) { struct scanner *s; int ret, i; - + DBG (10, "attach_one: start '%s'\n", name); - + for (s = scanner_devList; s; s = s->next) { if (strcmp (s->sane.name, name) == 0) { DBG (10, "attach_one: already attached!\n"); @@ -445,30 +445,30 @@ attach_one (const char *name) return SANE_STATUS_GOOD; } } - + /* build a scanner struct to hold it */ DBG (15, "attach_one: init struct\n"); - + if ((s = calloc (sizeof (*s), 1)) == NULL) return SANE_STATUS_NO_MEM; - + /* copy the device name */ s->sane.name = strdup (name); if (!s->sane.name){ destroy(s); return SANE_STATUS_NO_MEM; } - + /* connect the fd */ DBG (15, "attach_one: connect fd\n"); - + s->fd = -1; ret = connect_fd(s); if(ret != SANE_STATUS_GOOD){ destroy(s); return ret; } - + /* load the firmware file into scanner */ ret = load_fw(s); if (ret != SANE_STATUS_GOOD) { @@ -487,7 +487,7 @@ attach_one (const char *name) DBG (15, "attach_one: Found %s scanner %s at %s\n", s->sane.vendor, s->sane.model, s->sane.name); - + if (strstr (s->sane.model, "S1300i")){ unsigned char stat; @@ -498,7 +498,7 @@ attach_one (const char *name) DBG (5, "attach_one: on USB power?\n"); s->usb_power=1; } - + s->model = MODEL_S1300i; s->has_adf = 1; @@ -530,7 +530,7 @@ attach_one (const char *name) DBG (5, "attach_one: on USB power?\n"); s->usb_power=1; } - + s->model = MODEL_S300; s->has_adf = 1; @@ -624,13 +624,13 @@ attach_one (const char *name) else{ DBG (15, "attach_one: Found other\n"); } - + /* set SANE option 'values' to good defaults */ DBG (15, "attach_one: init options\n"); - - /* go ahead and setup the first opt, because - * frontend may call control_option on it - * before calling get_option_descriptor + + /* go ahead and setup the first opt, because + * frontend may call control_option on it + * before calling get_option_descriptor */ memset (s->opt, 0, sizeof (s->opt)); for (i = 0; i < NUM_OPTIONS; ++i) { @@ -638,23 +638,23 @@ attach_one (const char *name) s->opt[i].size = sizeof (SANE_Word); s->opt[i].cap = SANE_CAP_INACTIVE; } - + s->opt[OPT_NUM_OPTS].name = SANE_NAME_NUM_OPTIONS; s->opt[OPT_NUM_OPTS].title = SANE_TITLE_NUM_OPTIONS; s->opt[OPT_NUM_OPTS].desc = SANE_DESC_NUM_OPTIONS; s->opt[OPT_NUM_OPTS].cap = SANE_CAP_SOFT_DETECT; - + DBG (15, "attach_one: init settings\n"); ret = change_params(s); /* we close the connection, so that another backend can talk to scanner */ disconnect_fd(s); - + s->next = scanner_devList; scanner_devList = s; - + DBG (10, "attach_one: finish\n"); - + return SANE_STATUS_GOOD; } @@ -665,9 +665,9 @@ static SANE_Status connect_fd (struct scanner *s) { SANE_Status ret; - + DBG (10, "connect_fd: start\n"); - + if(s->fd > -1){ DBG (5, "connect_fd: already open\n"); ret = SANE_STATUS_GOOD; @@ -676,13 +676,13 @@ connect_fd (struct scanner *s) DBG (15, "connect_fd: opening USB device\n"); ret = sanei_usb_open (s->sane.name, &(s->fd)); } - + if(ret != SANE_STATUS_GOOD){ DBG (5, "connect_fd: could not open device: %d\n", ret); } - + DBG (10, "connect_fd: finish\n"); - + return ret; } @@ -701,7 +701,7 @@ load_fw (struct scanner *s) size_t cmdLen; unsigned char stat[2]; size_t statLen; - + DBG (10, "load_fw: start\n"); /*check status*/ @@ -712,7 +712,7 @@ load_fw (struct scanner *s) DBG (5, "load_fw: firmware already loaded?\n"); return SANE_STATUS_GOOD; } - + if(!global_firmware_filename[0]){ DBG (5, "load_fw: missing filename\n"); return SANE_STATUS_NO_DOCS; @@ -757,7 +757,7 @@ load_fw (struct scanner *s) cmd[1] = 0x06; cmdLen = 2; statLen = 1; - + ret = do_cmd( s, 0, cmd, cmdLen, @@ -774,14 +774,14 @@ load_fw (struct scanner *s) free(buf); return SANE_STATUS_IO_ERROR; } - + /*length/data*/ cmd[0] = 0x01; cmd[1] = 0x00; cmd[2] = 0x01; cmd[3] = 0x00; cmdLen = 4; - + ret = do_cmd( s, 0, cmd, cmdLen, @@ -803,7 +803,7 @@ load_fw (struct scanner *s) cmdLen = 1; statLen = 1; - + ret = do_cmd( s, 0, cmd, cmdLen, @@ -818,13 +818,13 @@ load_fw (struct scanner *s) DBG (5, "load_fw: bad stat on cmd 3\n"); return SANE_STATUS_IO_ERROR; } - + /*reinit*/ cmd[0] = 0x1b; cmd[1] = 0x16; cmdLen = 2; statLen = 1; - + ret = do_cmd( s, 0, cmd, cmdLen, @@ -843,7 +843,7 @@ load_fw (struct scanner *s) cmd[0] = 0x80; cmdLen = 1; statLen = 1; - + ret = do_cmd( s, 0, cmd, cmdLen, @@ -882,7 +882,7 @@ get_stat(struct scanner *s) size_t cmdLen; unsigned char stat[2]; size_t statLen; - + DBG (10, "get_stat: start\n"); /*check status*/ @@ -890,7 +890,7 @@ get_stat(struct scanner *s) cmd[1] = 0x03; cmdLen = 2; statLen = 2; - + ret = do_cmd( s, 0, cmd, cmdLen, @@ -928,7 +928,7 @@ get_ident(struct scanner *s) NULL, 0, in, &inLen ); - + if (ret != SANE_STATUS_GOOD){ return ret; } @@ -945,7 +945,7 @@ get_ident(struct scanner *s) s->sane.model= strndup((char *)in+8, 24); s->sane.type = "scanner"; - + DBG (10, "get_ident: finish\n"); return ret; } @@ -965,7 +965,7 @@ sane_open (SANE_String_Const name, SANE_Handle * handle) struct scanner *dev = NULL; struct scanner *s = NULL; SANE_Status ret; - + DBG (10, "sane_open: start\n"); if(scanner_devList){ @@ -973,13 +973,13 @@ sane_open (SANE_String_Const name, SANE_Handle * handle) } else{ DBG (15, "sane_open: no scanners currently attached, attaching\n"); - + ret = sane_get_devices(NULL,0); if(ret != SANE_STATUS_GOOD){ return ret; } } - + if(name[0] == 0){ DBG (15, "sane_open: no device requested, using default\n"); s = scanner_devList; @@ -994,24 +994,24 @@ sane_open (SANE_String_Const name, SANE_Handle * handle) } } } - + if (!s) { DBG (5, "sane_open: no device found\n"); return SANE_STATUS_INVAL; } - + DBG (15, "sane_open: device %s found\n", s->sane.name); - + *handle = s; - + /* connect the fd so we can talk to scanner */ ret = connect_fd(s); if(ret != SANE_STATUS_GOOD){ return ret; } - + DBG (10, "sane_open: finish\n"); - + return SANE_STATUS_GOOD; } @@ -1086,7 +1086,7 @@ sane_get_option_descriptor (SANE_Handle handle, SANE_Int option) s->mode_list[i++]=STRING_GRAYSCALE; s->mode_list[i++]=STRING_COLOR; s->mode_list[i]=NULL; - + opt->name = SANE_NAME_SCAN_MODE; opt->title = SANE_TITLE_SCAN_MODE; opt->desc = SANE_DESC_SCAN_MODE; @@ -1130,7 +1130,7 @@ sane_get_option_descriptor (SANE_Handle handle, SANE_Int option) s->tl_x_range.min = SCANNER_UNIT_TO_FIXED_MM(0); s->tl_x_range.max = SCANNER_UNIT_TO_FIXED_MM(get_page_width(s)-s->min_x); s->tl_x_range.quant = MM_PER_UNIT_FIX; - + opt->name = SANE_NAME_SCAN_TL_X; opt->title = SANE_TITLE_SCAN_TL_X; opt->desc = SANE_DESC_SCAN_TL_X; @@ -1149,7 +1149,7 @@ sane_get_option_descriptor (SANE_Handle handle, SANE_Int option) s->tl_y_range.min = SCANNER_UNIT_TO_FIXED_MM(0); s->tl_y_range.max = SCANNER_UNIT_TO_FIXED_MM(get_page_height(s)-s->min_y); s->tl_y_range.quant = MM_PER_UNIT_FIX; - + opt->name = SANE_NAME_SCAN_TL_Y; opt->title = SANE_TITLE_SCAN_TL_Y; opt->desc = SANE_DESC_SCAN_TL_Y; @@ -1167,7 +1167,7 @@ sane_get_option_descriptor (SANE_Handle handle, SANE_Int option) s->br_x_range.min = SCANNER_UNIT_TO_FIXED_MM(s->min_x); s->br_x_range.max = SCANNER_UNIT_TO_FIXED_MM(get_page_width(s)); s->br_x_range.quant = MM_PER_UNIT_FIX; - + opt->name = SANE_NAME_SCAN_BR_X; opt->title = SANE_TITLE_SCAN_BR_X; opt->desc = SANE_DESC_SCAN_BR_X; @@ -1186,7 +1186,7 @@ sane_get_option_descriptor (SANE_Handle handle, SANE_Int option) s->br_y_range.min = SCANNER_UNIT_TO_FIXED_MM(s->min_y); s->br_y_range.max = SCANNER_UNIT_TO_FIXED_MM(get_page_height(s)); s->br_y_range.quant = MM_PER_UNIT_FIX; - + opt->name = SANE_NAME_SCAN_BR_Y; opt->title = SANE_TITLE_SCAN_BR_Y; opt->desc = SANE_DESC_SCAN_BR_Y; @@ -1377,7 +1377,7 @@ sane_get_option_descriptor (SANE_Handle handle, SANE_Int option) opt->unit = SANE_UNIT_NONE; if (s->has_adf) opt->cap = SANE_CAP_SOFT_DETECT | SANE_CAP_HARD_SELECT | SANE_CAP_ADVANCED; - else + else opt->cap = SANE_CAP_INACTIVE; } @@ -1389,7 +1389,7 @@ sane_get_option_descriptor (SANE_Handle handle, SANE_Int option) opt->unit = SANE_UNIT_NONE; if (s->has_adf) opt->cap = SANE_CAP_SOFT_DETECT | SANE_CAP_HARD_SELECT | SANE_CAP_ADVANCED; - else + else opt->cap = SANE_CAP_INACTIVE; } @@ -1401,7 +1401,7 @@ sane_get_option_descriptor (SANE_Handle handle, SANE_Int option) opt->unit = SANE_UNIT_NONE; if (s->has_adf) opt->cap = SANE_CAP_SOFT_DETECT | SANE_CAP_HARD_SELECT | SANE_CAP_ADVANCED; - else + else opt->cap = SANE_CAP_INACTIVE; } @@ -1413,7 +1413,7 @@ sane_get_option_descriptor (SANE_Handle handle, SANE_Int option) opt->unit = SANE_UNIT_NONE; if (s->has_adf) opt->cap = SANE_CAP_SOFT_DETECT | SANE_CAP_HARD_SELECT | SANE_CAP_ADVANCED; - else + else opt->cap = SANE_CAP_INACTIVE; } @@ -1425,7 +1425,7 @@ sane_get_option_descriptor (SANE_Handle handle, SANE_Int option) opt->unit = SANE_UNIT_NONE; if (s->has_adf) opt->cap = SANE_CAP_SOFT_DETECT | SANE_CAP_HARD_SELECT | SANE_CAP_ADVANCED; - else + else opt->cap = SANE_CAP_INACTIVE; } @@ -1434,7 +1434,7 @@ sane_get_option_descriptor (SANE_Handle handle, SANE_Int option) /** * Gets or sets an option value. - * + * * From the SANE spec: * This function is used to set or inquire the current value of option * number n of the device represented by handle h. The manner in which @@ -1445,7 +1445,7 @@ sane_get_option_descriptor (SANE_Handle handle, SANE_Int option) * area pointed to by v must be big enough to hold the entire option * value (determined by member size in the corresponding option * descriptor). - * + * * The only exception to this rule is that when setting the value of a * string option, the string pointed to by argument v may be shorter * since the backend will stop reading the option value upon @@ -1574,22 +1574,22 @@ sane_control_option (SANE_Handle handle, SANE_Int option, get_hardware_status(s); *val_p = s->hw_scan_sw; return SANE_STATUS_GOOD; - + case OPT_HOPPER: get_hardware_status(s); *val_p = s->hw_hopper; return SANE_STATUS_GOOD; - + case OPT_TOP: get_hardware_status(s); *val_p = s->hw_top; return SANE_STATUS_GOOD; - + case OPT_ADF_OPEN: get_hardware_status(s); *val_p = s->hw_adf_open; return SANE_STATUS_GOOD; - + case OPT_SLEEP: get_hardware_status(s); *val_p = s->hw_sleep; @@ -1630,7 +1630,7 @@ sane_control_option (SANE_Handle handle, SANE_Int option, * below. */ switch (option) { - + /* Mode Group */ case OPT_SOURCE: if (!strcmp (val, STRING_ADFFRONT)) { @@ -1766,7 +1766,7 @@ static void update_transfer_totals(struct transfer * t) { if (t->image == NULL) return; - + t->total_bytes = t->line_stride * t->image->height; t->rx_bytes = 0; t->done = 0; @@ -1810,7 +1810,7 @@ static struct model_res settings[] = { /*S300 AC*/ /* model mode xres yres u mxx mnx mxy mny lin_s pln_s pln_w bh cls cps cpw */ - { MODEL_S300, MODE_COLOR, 150, 150, 0, 1296, 32, 2662, 32, 4256*3, 1480*3, 1296, 41, 8512*3, 2960*3, 2592, + { MODEL_S300, MODE_COLOR, 150, 150, 0, 1296, 32, 2662, 32, 4256*3, 1480*3, 1296, 41, 8512*3, 2960*3, 2592, setWindowCoarseCal_S300_150, setWindowFineCal_S300_150, setWindowSendCal_S300_150, sendCal1Header_S300_150, sendCal2Header_S300_150, setWindowScan_S300_150 }, @@ -2056,7 +2056,7 @@ change_params(struct scanner *s) s->page_width = s->min_x; s->tl_x = (s->max_x - s->page_width)/2; s->br_x = (s->max_x + s->page_width)/2; - + /*=============================================================*/ /* set up the calibration scan structs */ /* generally full width, short height, full resolution */ @@ -2102,7 +2102,7 @@ change_params(struct scanner *s) s->sendcal.y_res = settings[i].y_res; s->sendcal.pages = img_pages; s->sendcal.buffer = NULL; - + /*=============================================================*/ /* set up the fullscan parameters */ /* this is bookkeeping for what we actually pull from the scanner */ @@ -2230,7 +2230,7 @@ change_params(struct scanner *s) s->pages[SIDE_BACK].done = 0; DBG (10, "change_params: finish\n"); - + return ret; } @@ -2238,7 +2238,7 @@ change_params(struct scanner *s) used by scanners to implement brightness/contrast/gamma or by backends to speed binarization/thresholding - offset and slope inputs are -127 to +127 + offset and slope inputs are -127 to +127 slope rotates line around central input/output val, 0 makes horizontal line @@ -2254,9 +2254,9 @@ change_params(struct scanner *s) offset moves line vertically, and clamps to output range 0 keeps the line crossing the center of the table - high low + high low . xxxxxxxx . - . x . + . x . out x . x . . x ............ xxxxxxxx.... @@ -2285,7 +2285,7 @@ load_lut (unsigned char * lut, * first [-127,127] to [-1,1] * then multiply by PI/2 to convert to radians * then take the tangent (T.O.A) - * then multiply by the normal linear slope + * then multiply by the normal linear slope * because the table may not be square, i.e. 1024x256*/ rise = tan((double)slope/127 * M_PI/2) * max_out_val / max_in_val; @@ -2332,7 +2332,7 @@ load_lut (unsigned char * lut, * completion of that request. Outside of that window, the returned * values are best-effort estimates of what the parameters will be * when sane_start() gets invoked. - * + * * Calling this function before a scan has actually started allows, * for example, to get an estimate of how big the scanned image will * be. The parameters passed to this function are the handle h of the @@ -2389,9 +2389,9 @@ sane_start (SANE_Handle handle) struct scanner *s = handle; SANE_Status ret; int i; - + DBG (10, "sane_start: start\n"); - + /* set side marker on first page */ if(!s->started){ if(s->source == SOURCE_ADF_BACK){ @@ -2462,7 +2462,7 @@ sane_start (SANE_Handle handle) sane_cancel((SANE_Handle)s); return ret; } - + ret = finecal(s); if (ret != SANE_STATUS_GOOD) { DBG (5, "sane_start: ERROR: failed to finecal\n"); @@ -2476,14 +2476,14 @@ sane_start (SANE_Handle handle) sane_cancel((SANE_Handle)s); return ret; } - + ret = lamp(s,1); if (ret != SANE_STATUS_GOOD) { DBG (5, "sane_start: ERROR: failed to heat lamp\n"); sane_cancel((SANE_Handle)s); return ret; } - + /*should this be between each page*/ ret = set_window(s,WINDOW_SCAN); if (ret != SANE_STATUS_GOOD) { @@ -2491,7 +2491,7 @@ sane_start (SANE_Handle handle) sane_cancel((SANE_Handle)s); return ret; } - + } /* reset everything when starting any front, or just back */ @@ -2503,7 +2503,7 @@ sane_start (SANE_Handle handle) s->fullscan.done = 0; s->fullscan.rx_bytes = 0; s->fullscan.total_bytes = s->fullscan.width_bytes * s->fullscan.height; - + /* reset block */ update_transfer_totals(&s->block_xfr); @@ -2532,7 +2532,7 @@ sane_start (SANE_Handle handle) } DBG (10, "sane_start: finish\n"); - + return SANE_STATUS_GOOD; } @@ -2644,7 +2644,7 @@ coarsecal_send_cal(struct scanner *s, unsigned char *pay) unsigned char cmd[2]; unsigned char stat[1]; size_t cmdLen,statLen,payLen; - + DBG (5, "coarsecal_send_cal: start\n"); /* send coarse cal (c6) */ cmd[0] = 0x1b; @@ -2652,7 +2652,7 @@ coarsecal_send_cal(struct scanner *s, unsigned char *pay) cmdLen = 2; stat[0] = 0; statLen = 1; - + ret = do_cmd( s, 0, cmd, cmdLen, @@ -2667,7 +2667,7 @@ coarsecal_send_cal(struct scanner *s, unsigned char *pay) DBG (5, "coarsecal_send_cal: cmd bad c6 status?\n"); return SANE_STATUS_IO_ERROR; } - + /*send coarse cal payload*/ stat[0] = 0; statLen = 1; @@ -2708,7 +2708,7 @@ coarsecal_get_line(struct scanner *s, struct image *img) cmdLen = 2; stat[0] = 0; statLen = 1; - + ret = do_cmd( s, 0, cmd, cmdLen, @@ -2726,7 +2726,7 @@ coarsecal_get_line(struct scanner *s, struct image *img) s->cal_image.image = img; update_transfer_totals(&s->cal_image); - + while(!s->cal_image.done){ ret = read_from_scanner(s,&s->cal_image); if(ret){ @@ -2782,7 +2782,7 @@ coarsecal_dark(struct scanner *s, unsigned char *pay) } ret = coarsecal_send_cal(s, pay); - + DBG(15, "coarsecal_dark offset: parameter front: %i back: %i\n", param[0], param[1]); ret = coarsecal_get_line(s, &s->coarsecal); @@ -2857,7 +2857,7 @@ coarsecal_light(struct scanner *s, unsigned char *pay) return ret; } - try_count = 8; + try_count = 8; param[0] = pay[11]; param[1] = pay[13]; low_param[0] = low_param[1] = 0; @@ -2872,7 +2872,7 @@ coarsecal_light(struct scanner *s, unsigned char *pay) DBG(15, "coarsecal_light gain: parameter front: %i back: %i\n", param[0], param[1]); ret = coarsecal_get_line(s, &s->coarsecal); - + /* gather statistics: count the proportion of 255-valued pixels in each color channel */ /* count the average pixel value in each color channel */ for (i = 0; i < s->coarsecal.pages; i++) @@ -3119,7 +3119,7 @@ finecal_send_cal(struct scanner *s) /*second unknown cal block*/ cmd[1] = 0xc4; statLen = 1; - + ret = do_cmd( s, 0, cmd, cmdLen, @@ -3441,13 +3441,13 @@ lamp(struct scanner *s, unsigned char set) size_t cmdLen = 2; unsigned char stat[1]; size_t statLen = 1; - + DBG (10, "lamp: start (%d)\n", set); /*send cmd*/ cmd[0] = 0x1b; cmd[1] = 0xd0; - + ret = do_cmd( s, 0, cmd, cmdLen, @@ -3467,7 +3467,7 @@ lamp(struct scanner *s, unsigned char set) cmd[0] = set; cmdLen = 1; statLen = 1; - + ret = do_cmd( s, 0, cmd, cmdLen, @@ -3542,7 +3542,7 @@ set_window(struct scanner *s, int window) /*send payload*/ statLen = 1; - + ret = do_cmd( s, 0, payload, paylen, @@ -3565,7 +3565,7 @@ set_window(struct scanner *s, int window) /* instead of internal brightness/contrast/gamma scanners uses 12bit x 12bit LUT default is linear table of slope 1 - brightness and contrast inputs are -127 to +127 + brightness and contrast inputs are -127 to +127 contrast rotates slope of line around central input val @@ -3581,7 +3581,7 @@ set_window(struct scanner *s, int window) bright dark . xxxxxxxx . - . x . + . x . out x . x . . x ............ xxxxxxxx.... @@ -3598,12 +3598,12 @@ send_lut (struct scanner *s) size_t statLen = 1; unsigned char *out; size_t outLen; - + int i, j; double b, slope, offset; int width; int height; - + DBG (10, "send_lut: start\n"); if (s->model == MODEL_S1100){ @@ -3630,7 +3630,7 @@ send_lut (struct scanner *s) * first [-127,127] to [0,254] then to [0,1] * then multiply by PI/2 to convert to radians * then take the tangent to get slope (T.O.A) - * then multiply by the normal linear slope + * then multiply by the normal linear slope * because the table may not be square, i.e. 1024x256*/ slope = tan(((double)s->contrast+127)/254 * M_PI/2); @@ -3642,17 +3642,17 @@ send_lut (struct scanner *s) * into a scale that covers the range required * to slide the contrast curve entirely off the table */ b = ((double)s->brightness/127) * (slope*(width-1) + offset); - + DBG (15, "send_lut: %d %f %d %f %f\n", s->brightness, b, s->contrast, slope, offset); - + for(i=0;i(height-1)){ j=height-1; } @@ -3675,7 +3675,7 @@ send_lut (struct scanner *s) out[width*4 + i*2] = (j >> 8) & 0xff; out[width*4 + i*2+1] = j & 0xff; } - else { + else { /*first table, le order*/ out[i*2] = j & 0xff; out[i*2+1] = (j >> 8) & 0x0f; @@ -3745,7 +3745,7 @@ get_hardware_status (struct scanner *s) cmd[0] = 0x1b; cmd[1] = 0x33; - + ret = do_cmd( s, 0, cmd, cmdLen, @@ -3790,12 +3790,12 @@ object_position(struct scanner *s, int ingest) i = (ingest)?5:1; - while(i--){ + while(i--){ /*send paper load cmd*/ cmd[0] = 0x1b; cmd[1] = 0xd4; statLen = 1; - + ret = do_cmd( s, 0, cmd, cmdLen, @@ -3810,12 +3810,12 @@ object_position(struct scanner *s, int ingest) DBG (5, "object_position: cmd bad status? %d\n",stat[0]); continue; } - + /*send payload*/ statLen = 1; payLen = 1; pay[0] = ingest; - + ret = do_cmd( s, 0, pay, payLen, @@ -3853,7 +3853,7 @@ scan(struct scanner *s) size_t cmdLen = 2; unsigned char stat[1]; size_t statLen = 1; - + DBG (10, "scan: start\n"); if(s->model == MODEL_S300 || s->model == MODEL_S1100 || s->model == MODEL_S1300i){ @@ -3876,13 +3876,13 @@ scan(struct scanner *s) } DBG (10, "scan: finish\n"); - + return ret; } /* * Called by SANE to read data. - * + * * From the SANE spec: * This function is used to read image data from the device * represented by handle h. Argument buf is a pointer to a memory @@ -3890,7 +3890,7 @@ scan(struct scanner *s) * returned is stored in *len. A backend must set this to zero when * the call fails (i.e., when a status other than SANE_STATUS_GOOD is * returned). - * + * * When the call succeeds, the number of bytes returned can be * anywhere in the range from 0 to maxlen bytes. */ @@ -3900,7 +3900,7 @@ sane_read (SANE_Handle handle, SANE_Byte * buf, SANE_Int max_len, SANE_Int * len struct scanner *s = (struct scanner *) handle; SANE_Status ret=SANE_STATUS_GOOD; struct page * page; - + DBG (10, "sane_read: start si:%d len:%d max:%d\n",s->side,*len,max_len); *len = 0; @@ -3910,7 +3910,7 @@ sane_read (SANE_Handle handle, SANE_Byte * buf, SANE_Int max_len, SANE_Int * len DBG (5, "sane_read: call sane_start first\n"); return SANE_STATUS_CANCELLED; } - + page = &s->pages[s->side]; /* have sent all of current buffer */ @@ -3920,14 +3920,14 @@ sane_read (SANE_Handle handle, SANE_Byte * buf, SANE_Int max_len, SANE_Int * len /*S1100 needs help to turn off button*/ if(s->model == MODEL_S1100){ usleep(15000); - + /* eject paper */ ret = object_position(s,EPJITSU_PAPER_EJECT); if (ret != SANE_STATUS_GOOD && ret != SANE_STATUS_NO_DOCS) { DBG (5, "sane_read: ERROR: failed to eject\n"); return ret; } - + /* reset flashing button? */ ret = six5(s); if (ret != SANE_STATUS_GOOD) { @@ -3937,12 +3937,12 @@ sane_read (SANE_Handle handle, SANE_Byte * buf, SANE_Int max_len, SANE_Int * len } return SANE_STATUS_EOF; - } + } /* scan not finished, get more into block buffer */ if(!s->fullscan.done) { - /* block buffer currently empty, clean up */ + /* block buffer currently empty, clean up */ if(!s->block_xfr.rx_bytes) { /* block buffer bigger than remainder of scan, shrink block */ @@ -3959,9 +3959,9 @@ sane_read (SANE_Handle handle, SANE_Byte * buf, SANE_Int max_len, SANE_Int * len size_t cmdLen = 2; unsigned char stat[1]; size_t statLen = 1; - + DBG (15, "sane_read: d3\n"); - + ret = do_cmd( s, 0, cmd, cmdLen, @@ -4002,7 +4002,7 @@ sane_read (SANE_Handle handle, SANE_Byte * buf, SANE_Int max_len, SANE_Int * len size_t cmdLen = 2; unsigned char in[10]; size_t inLen = 10; - + ret = do_cmd( s, 0, cmd, cmdLen, @@ -4010,7 +4010,7 @@ sane_read (SANE_Handle handle, SANE_Byte * buf, SANE_Int max_len, SANE_Int * len in, &inLen ); hexdump(15, "cmd 43: ", in, inLen); - + if(ret){ DBG (5, "sane_read: error sending 43 cmd\n"); return ret; @@ -4076,19 +4076,19 @@ sane_read (SANE_Handle handle, SANE_Byte * buf, SANE_Int max_len, SANE_Int * len if(*len){ DBG (10, "sane_read: copy rx:%d tx:%d tot:%d len:%d\n", page->bytes_scanned, page->bytes_read, page->bytes_total,*len); - + memcpy(buf, page->image->buffer + page->bytes_read, *len); page->bytes_read += *len; - + /* sent it all, return eof on next read */ if(page->bytes_read == page->bytes_scanned && s->fullscan.done){ DBG (10, "sane_read: side done\n"); page->done = 1; } - } + } DBG (10, "sane_read: finish si:%d len:%d max:%d\n",s->side,*len,max_len); - + return ret; } @@ -4152,39 +4152,39 @@ descramble_raw(struct scanner *s, struct transfer * tp) for (j = 0; j < height; j++){ /* row (y)*/ int curr_col = 0; int r=0, g=0, b=0, ppc=0; - + for (k = 0; k <= tp->plane_width; k++){ /* column (x) */ int this_col = k*tp->image->x_res/tp->x_res; - + /* going to change output pixel, dump rgb and reset */ if(ppc && curr_col != this_col){ *p_out = r/ppc; p_out++; - + *p_out = g/ppc; p_out++; - + *p_out = b/ppc; p_out++; - + r = g = b = ppc = 0; - + curr_col = this_col; } - + if(k == tp->plane_width || this_col >= tp->image->width_pix){ break; } - + /*red is first*/ r += tp->raw_data[j*tp->line_stride + k*3 + i]; - + /*green is second*/ g += tp->raw_data[j*tp->line_stride + tp->plane_stride + k*3 + i]; - + /*blue is third*/ b += tp->raw_data[j*tp->line_stride + 2*tp->plane_stride + k*3 + i]; - + ppc++; } } @@ -4194,39 +4194,39 @@ descramble_raw(struct scanner *s, struct transfer * tp) for (j = 0; j < height; j++){ /* row (y)*/ int curr_col = 0; int r=0, g=0, b=0, ppc=0; - + for (k = 0; k <= tp->plane_width; k++){ /* column (x) */ int this_col = k*tp->image->x_res/tp->x_res; - + /* going to change output pixel, dump rgb and reset */ if(ppc && curr_col != this_col){ *p_out = r/ppc; p_out++; - + *p_out = g/ppc; p_out++; - + *p_out = b/ppc; p_out++; - + r = g = b = ppc = 0; - + curr_col = this_col; } - + if(k == tp->plane_width || this_col >= tp->image->width_pix){ break; } /*red is second*/ r += tp->raw_data[j*tp->line_stride + tp->plane_stride + k]; - + /*green is third*/ g += tp->raw_data[j*tp->line_stride + 2*tp->plane_stride + k]; - + /*blue is first*/ b += tp->raw_data[j*tp->line_stride + k]; - + ppc++; } } @@ -4238,39 +4238,39 @@ descramble_raw(struct scanner *s, struct transfer * tp) for (i = 0; i < 3; i++){ /* read head */ int r=0, g=0, b=0, ppc=0; - + for (k = 0; k <= tp->plane_width; k++){ /* column (x) within the read head */ int this_col = (k+i*tp->plane_width)*tp->image->x_res/tp->x_res; - + /* going to change output pixel, dump rgb and reset */ if(ppc && curr_col != this_col){ *p_out = r/ppc; p_out++; - + *p_out = g/ppc; p_out++; - + *p_out = b/ppc; p_out++; - + r = g = b = ppc = 0; - + curr_col = this_col; } - + if(k == tp->plane_width || this_col >= tp->image->width_pix){ break; } - + /*red is first*/ r += tp->raw_data[j*tp->line_stride + k*3 + i]; - + /*green is second*/ g += tp->raw_data[j*tp->line_stride + tp->plane_stride + k*3 + i]; - + /*blue is third*/ b += tp->raw_data[j*tp->line_stride + 2*tp->plane_stride + k*3 + i]; - + ppc++; } } @@ -4297,15 +4297,15 @@ descramble_raw_gray(struct scanner *s, struct transfer * tp) if (s->model == MODEL_FI60F || s->model == MODEL_FI65F) { for (row = 0; row < height; row++){ - + unsigned char *p_in = tp->raw_data + row * tp->line_stride; unsigned char *p_out = tp->image->buffer + row * tp->image->width_pix; - + for (col_out = 0; col_out < tp->image->width_pix; col_out++){ int col_in = col_out * tp->x_res/tp->image->x_res; int offset = col_in%tp->plane_width; int step = col_in/tp->plane_width; - + *p_out = *(p_in + offset*3 + step); p_out++; } @@ -4388,12 +4388,12 @@ read_from_scanner(struct scanner *s, struct transfer * tp) else { DBG(5, "read_from_scanner: error reading status = %d\n", ret); } - + free(buf); DBG (10, "read_from_scanner: finish rB:%lu len:%lu\n", (unsigned long)(tp->total_bytes - tp->rx_bytes + 8), (unsigned long)bytes); - + return ret; } @@ -4439,7 +4439,7 @@ copy_block_to_page(struct scanner *s,int side) int this_out_row = (this_in_row - page->image->y_skip_offset) * page->image->y_res / s->fullscan.y_res; DBG (15, "copy_block_to_page: in %d out %d lastout %d\n", this_in_row, this_out_row, last_out_row); DBG (15, "copy_block_to_page: bs %d wb %d\n", page->bytes_scanned, page->image->width_bytes); - + /* don't walk off the end of the output buffer */ if(this_out_row >= page->image->height || this_out_row < 0){ DBG (10, "copy_block_to_page: out of space? %d\n", side); @@ -4447,7 +4447,7 @@ copy_block_to_page(struct scanner *s,int side) page->bytes_scanned, page->bytes_read, page->bytes_total,page->image->width_bytes); return ret; } - + /* ok, different output row, so we do the math */ if(this_out_row > last_out_row){ @@ -4459,11 +4459,11 @@ copy_block_to_page(struct scanner *s,int side) last_out_row = this_out_row; if (block->mode == MODE_COLOR){ - + /* reverse order for back side or FI-60F scanner */ if (line_reverse) p_in += (page_width - 1) * 3; - + /* convert all of the pixels in this row */ for (j = 0; j < page_width; j++) { @@ -4492,18 +4492,18 @@ copy_block_to_page(struct scanner *s,int side) p_in += 3; } } - + /* grayscale input */ else{ unsigned char * p_in = block->image->buffer + (side * block_page_stride) + (i * block->image->width_bytes) + page->image->x_start_offset; - + /* reverse order for back side or FI-60F scanner */ if (line_reverse) p_in += (page_width - 1); - + //memcpy(p_out,p_in,page->image->width_bytes); - + for (j = 0; j < page_width; j++) { if (s->mode == MODE_GRAYSCALE) @@ -4570,7 +4570,7 @@ binarize_line(struct scanner *s, unsigned char *lineOut, int width) { int addCol = j + windowX/2; int dropCol = addCol - windowX; - + if (dropCol >= 0 && addCol < width) { sum -= s->dt.buffer[dropCol]; @@ -4584,7 +4584,7 @@ binarize_line(struct scanner *s, unsigned char *lineOut, int width) *lineOut &= ~mask; /* white */ else *lineOut |= mask; /* black */ - + if (offset == 7) lineOut++; } @@ -4596,7 +4596,7 @@ binarize_line(struct scanner *s, unsigned char *lineOut, int width) * @@ Section 4 - SANE cleanup functions */ /* - * Cancels a scan. + * Cancels a scan. * * From the SANE spec: * This function is used to immediately or as quickly as possible @@ -4626,7 +4626,7 @@ sane_cancel (SANE_Handle handle) /* * Ends use of the scanner. - * + * * From the SANE spec: * This function terminates the association between the device handle * passed in argument h and the device it represents. If the device is @@ -4684,7 +4684,7 @@ destroy(struct scanner *s) if(s->sane.model){ free((void *) s->sane.model); } - + free(s); DBG (10, "destroy: finish\n"); @@ -4758,7 +4758,7 @@ teardown_buffers(struct scanner *s) /* * Terminates the backend. - * + * * From the SANE spec: * This function must be called to terminate use of a backend. The * function will first close all device handles that still might be @@ -4828,13 +4828,13 @@ do_cmd(struct scanner *s, int shortTime, /* change timeout */ sanei_usb_set_timeout(cmdTime); - + /* write the command out */ DBG(25, "cmd: writing %ld bytes, timeout %d\n", (long)cmdLen, cmdTime); hexdump(30, "cmd: >>", cmdBuff, cmdLen); ret = sanei_usb_write_bulk(s->fd, cmdBuff, &cmdLen); DBG(25, "cmd: wrote %ld bytes, retVal %d\n", (long)cmdLen, ret); - + if(ret == SANE_STATUS_EOF){ DBG(5,"cmd: got EOF, returning IO_ERROR\n"); return SANE_STATUS_IO_ERROR; @@ -4993,7 +4993,7 @@ sane_get_select_fd (SANE_Handle h, SANE_Int *fdp) * due to using FB */ static int -get_page_width(struct scanner *s) +get_page_width(struct scanner *s) { /* scanner max for fb */ if(s->source == SOURCE_FLATBED){ @@ -5009,7 +5009,7 @@ get_page_width(struct scanner *s) * due to using FB. */ static int -get_page_height(struct scanner *s) +get_page_height(struct scanner *s) { /* scanner max for fb */ if(s->source == SOURCE_FLATBED){ diff --git a/backend/epjitsu.conf.in b/backend/epjitsu.conf.in index 3ba1c1561..aa971ae4a 100644 --- a/backend/epjitsu.conf.in +++ b/backend/epjitsu.conf.in @@ -12,7 +12,7 @@ # extracted from the Fujitsu Windows driver. Presumably the Mac versions # contain the firmware as well, but the author has no access such a machine. -# Firmware is installed in several different locations by the fujitsu software, +# Firmware is installed in several different locations by the fujitsu software, # using the windows 'search' feature to look for '*.nal' is the easiest way to # find them. They should be ~65K, and have the scanner's name as part of the # file name. They are often inside a .cab file. diff --git a/backend/epjitsu.h b/backend/epjitsu.h index 6dfaf67fc..87d6836ef 100644 --- a/backend/epjitsu.h +++ b/backend/epjitsu.h @@ -1,12 +1,12 @@ #ifndef EPJITSU_H #define EPJITSU_H -/* +/* * Part of SANE - Scanner Access Now Easy. * Please see opening comment in epjitsu.c */ -/* ------------------------------------------------------------------------- +/* ------------------------------------------------------------------------- * This option list has to contain all options for all scanners supported by * this driver. If a certain scanner cannot handle a certain option, there's * still the possibility to say so, later. @@ -197,7 +197,7 @@ struct scanner unsigned char * setWindowScan; /* sent before scan */ size_t setWindowScanLen; - + /* --------------------------------------------------------------------- */ /* values which are set by scanning functions to keep track of pages, etc */ int started; diff --git a/backend/epson.c b/backend/epson.c index 3fc264ffb..20cafc40b 100644 --- a/backend/epson.c +++ b/backend/epson.c @@ -1,4 +1,4 @@ -/* +/* epson.c - SANE library for Epson flatbed scanners. Based on Kazuhiro Sasayama previous @@ -63,7 +63,7 @@ 2006-08-21 Fix buffer overflow error (submitted by Johannes Meixner) 2006-06-11 Applied patch from Henning. Fixed a number of compiler warnings 2006-03-12 Added support for perfetion 4990 photo 4800 dpi - 2005-01-09 "flaming hack to get USB scanners working without timeouts under linux" + 2005-01-09 "flaming hack to get USB scanners working without timeouts under linux" submitted by "Steve" (in comment to bug #300830) 2004-12-18 Added USB IDs for CX-4600 and CX-3650 2004-10-16 Added USB ID for Expression 10000XL @@ -78,7 +78,7 @@ Added EPSON Kowa copyright message 2003-08-15 Added support for GT-30000, with support for the ADF in simplex mode Borrowed some code from the EPSON Kowa IScan version of the backend - Use sanei_scsi_cmd2() to send commands. This makes this backend + Use sanei_scsi_cmd2() to send commands. This makes this backend useable for SBP-2 under FreeBSD 2003-05-11 Initialize OPT_LIMIT_RESOLUTION before first call to filter_resolution_list() Fix memory problem in get_identity_information(). Both problems were @@ -88,14 +88,14 @@ 2003-02-15 Move sanei_usb_init() to sane_init(). Thanks to Ron Cemer for providing the patch. 2003-02-15 Fix problem with "usb syntax in config file - 2002-12-28 Added advanced option to display only short resolution list for + 2002-12-28 Added advanced option to display only short resolution list for displays that can not show the complete list. 2002-11-23 Fixed problem with dropout color. 2002-11-03 Full libusb support. 2002-10-05 Fixed problem with incorrect response to sane_get_parameters() in certain situations. 2002-09-01 USB scanners are now using libsane-usb funtions - 2002-08-17 Fixed typo in variable name. + 2002-08-17 Fixed typo in variable name. Fixed IEEE-1394 problem with Perfection-2450. Fixed problem with older B3 level SCSI scanners that do not support the extended status request. @@ -104,12 +104,12 @@ 2002-04-13 Check if scanner needs to be opened for the reset call. (Thanks to Thomas Wenrich for pointing this out) Added product IDs for Perfection 1650 and 2450 - 2002-01-18 Recognize GT-xxxx type scanners also when using the SCSI + 2002-01-18 Recognize GT-xxxx type scanners also when using the SCSI or IEEE-1394 interface 2002-01-06 Disable TEST_IOCTL again, which was enabled by accident. Also protect the ioctl portion with an #ifdef __linux__ 2002-01-05 Version 0.2.17 - Check for and set s->fd to -1 when device is closed. + Check for and set s->fd to -1 when device is closed. Removed black gamma table - only use RGB even for grayscale 2002-01-01 Do not call access() for OS/2 systems 2001-11-13 Version 0.2.16 @@ -126,8 +126,8 @@ 2001-06-09 Version 0.2.09 Changed debug level for sense handler from 0 to 2 2001-05-25 Version 0.2.07 - Allow more than 8 bit color depth even for preview mode - since Xsane can handle this. Some code cleanup. + Allow more than 8 bit color depth even for preview mode + since Xsane can handle this. Some code cleanup. 2001-05-24 Removed ancient code that was used to determine the resolution back when the backend still had a slider for the resolution selection. @@ -156,12 +156,12 @@ Fixed problem with bilevel scanning with Perfection610: The line count has to be an even number with this scanner. Several initialization fixes regarding bit depth selection. - This version goes back into the CVS repository, the 1.0.4 + This version goes back into the CVS repository, the 1.0.4 release is out and therefore the code freeze is over. Some general cleanup, added more comments. 2000-12-09 Version 0.2.00 Cleaned up printing of gamma table data. 16 elements - are now printed in one line without the [epson] in + are now printed in one line without the [epson] in between the values. Values are only printed for Debug levels >= 10. 2000-12-04 We've introduced the concept of inverting images @@ -175,7 +175,7 @@ 2000-12-03 added the 12/14/16 bit support again. 2000-12-03 Version 0.1.38 removed changes regarding 12/14 bit support because - of SANE feature freeze for 1.0.4. The D1 fix for + of SANE feature freeze for 1.0.4. The D1 fix for reading the values from the scanner instead of using hardcoded values and the fix for the off-by-one error in the reorder routine are still in the code base. @@ -194,13 +194,13 @@ sane/... include files. 2000-07-26 Fixed problem with Perfection610: The variable s->color_shuffle_line was never correctly initialized - 2000-06-28 When closing the scanner device the data that's + 2000-06-28 When closing the scanner device the data that's still in the scanner, waiting to be transferred is flushed. This fixes the problem with scanimage -T 2000-06-13 Invert image when scanning negative with TPU, Show film type only when TPU is selected 2000-06-13 Initialize optical_res to 0 (Dave Hill) - 2000-06-07 Fix in sane_close() - found by Henning Meier-Geinitz + 2000-06-07 Fix in sane_close() - found by Henning Meier-Geinitz 2000-06-01 Threshhold should only be active when scan depth is 1 and halftoning is off. (mjp) 2000-05-28 Turned on scanner based color correction. @@ -212,16 +212,16 @@ Help prevent extraneous option reloads. Split sane_control_option in getvalue and setvalue. Further split up setvalue into several different - routines. (mjp) - 2000-05-21 In sane_close use close_scanner instead of just the + routines. (mjp) + 2000-05-21 In sane_close use close_scanner instead of just the SCSI close function. 2000-05-20 ... finally fixed the problem with the 610 Added resolution_list to Epson_Device structure in - epson.h - this fixes a bug that caused problems when + epson.h - this fixes a bug that caused problems when more than one EPSON scanner was connected. 2000-05-13 Fixed the color problem with the Perfection 610. The few lines with "garbage" at the beginning of the scan are not - yet removed. + yet removed. 2000-05-06 Added support for multiple EPSON scanners. At this time this may not be bug free, but it's a start and it seems to work well with just one scanner. @@ -235,21 +235,21 @@ fix an OS/2 bug. It now turned out that they are not necessary. The real fix was in the repository for a long time (2000-01-25). - 2000-03-19 Fixed problem with A4 level devices - they use the - line mode instead of the block mode. The routine to - handle this was screwed up pretty bad. Now I have + 2000-03-19 Fixed problem with A4 level devices - they use the + line mode instead of the block mode. The routine to + handle this was screwed up pretty bad. Now I have a solid version that handles all variations of line mode (automatically deals with the order the color lines are sent). 2000-03-06 Fixed occasional crash after warm up when the "in warmup state" went away in between doing ESC G and getting the - extended status message. - 2000-03-02 Code cleanup, disabled ZOOM until I have time to + extended status message. + 2000-03-02 Code cleanup, disabled ZOOM until I have time to deal with all the side effects. 2000-03-01 More D1 fixes. In the future I have to come up with a more elegant solution to destinguish between different function levels. The level > n does not work anymore with - D1. + D1. Added support for "set threshold" and "set zoom". 2000-02-23 First stab at level D1 support, also added a test for valid "set halftone" command to enable OPT_HALFTONE @@ -275,11 +275,11 @@ because of hte changes to attach a few days ago. (KHK) 2000-01-29 fixed core dump with xscanimage by moving the gamma curves to the standard interface (no longer advanced) - Removed pragma pack() from source code to make it + Removed pragma pack() from source code to make it easier to compile on non-gcc compilers (KHK) 2000-01-26 fixed problem with resolution selection when using the resolution list in xsane (KHK) - 2000-01-25 moved the section where the device name is assigned + 2000-01-25 moved the section where the device name is assigned in attach. This avoids the core dump of frontend applications when no scanner is found (Dave Hill) 2000-01-24 reorganization of SCSI related "helper" functions @@ -395,7 +395,7 @@ #define EPSON_LEVEL_D7 12 #define EPSON_LEVEL_D8 13 -/* there is also a function level "A5", which I'm igoring here until somebody can +/* there is also a function level "A5", which I'm igoring here until somebody can convince me that this is still needed. The A5 level was for the GT-300, which was (is) a monochrome only scanner. So if somebody really wants to use this scanner with SANE get in touch with me and we can work something out - khk */ @@ -437,7 +437,7 @@ static EpsonCmdRec epson_cmd[] = { * | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | set bay * | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | set threshold * | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | set focus position - * | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | request focus position + * | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | request focus position * | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | */ @@ -460,7 +460,7 @@ static EpsonCmdRec epson_cmd[] = { /* - * Definition of the mode_param struct, that is used to + * Definition of the mode_param struct, that is used to * specify the valid parameters for the different scan modes. * * The depth variable gets updated when the bit depth is modified. @@ -508,10 +508,10 @@ static const SANE_String_Const adf_mode_list[] = { * of the scanner. */ -static SANE_String_Const source_list[] = { - FBF_STR, - NULL, - NULL, +static SANE_String_Const source_list[] = { + FBF_STR, + NULL, + NULL, NULL }; @@ -519,9 +519,9 @@ static SANE_String_Const source_list[] = { #define FILM_TYPE_POSITIVE (0) #define FILM_TYPE_NEGATIVE (1) -static const SANE_String_Const film_list[] = { - SANE_I18N ("Positive Film"), - SANE_I18N ("Negative Film"), +static const SANE_String_Const film_list[] = { + SANE_I18N ("Positive Film"), + SANE_I18N ("Negative Film"), NULL }; @@ -538,67 +538,67 @@ static const SANE_String_Const focus_list[] = { #define HALFTONE_NONE 0x01 #define HALFTONE_TET 0x03 -static int halftone_params[] = { - HALFTONE_NONE, - 0x00, - 0x10, - 0x20, - 0x80, - 0x90, - 0xa0, - 0xb0, +static int halftone_params[] = { + HALFTONE_NONE, + 0x00, + 0x10, + 0x20, + 0x80, + 0x90, + 0xa0, + 0xb0, HALFTONE_TET, - 0xc0, + 0xc0, 0xd0 }; -static const SANE_String_Const halftone_list[] = { - SANE_I18N ("None"), +static const SANE_String_Const halftone_list[] = { + SANE_I18N ("None"), SANE_I18N ("Halftone A (Hard Tone)"), - SANE_I18N ("Halftone B (Soft Tone)"), + SANE_I18N ("Halftone B (Soft Tone)"), SANE_I18N ("Halftone C (Net Screen)"), NULL }; -static const SANE_String_Const halftone_list_4[] = { - SANE_I18N ("None"), +static const SANE_String_Const halftone_list_4[] = { + SANE_I18N ("None"), SANE_I18N ("Halftone A (Hard Tone)"), - SANE_I18N ("Halftone B (Soft Tone)"), - SANE_I18N ("Halftone C (Net Screen)"), - SANE_I18N ("Dither A (4x4 Bayer)"), - SANE_I18N ("Dither B (4x4 Spiral)"), - SANE_I18N ("Dither C (4x4 Net Screen)"), - SANE_I18N ("Dither D (8x4 Net Screen)"), - NULL -}; - -static const SANE_String_Const halftone_list_7[] = { - SANE_I18N ("None"), - SANE_I18N ("Halftone A (Hard Tone)"), - SANE_I18N ("Halftone B (Soft Tone)"), + SANE_I18N ("Halftone B (Soft Tone)"), SANE_I18N ("Halftone C (Net Screen)"), SANE_I18N ("Dither A (4x4 Bayer)"), SANE_I18N ("Dither B (4x4 Spiral)"), SANE_I18N ("Dither C (4x4 Net Screen)"), SANE_I18N ("Dither D (8x4 Net Screen)"), - SANE_I18N ("Text Enhanced Technology"), - SANE_I18N ("Download pattern A"), - SANE_I18N ("Download pattern B"), NULL }; -static int dropout_params[] = { +static const SANE_String_Const halftone_list_7[] = { + SANE_I18N ("None"), + SANE_I18N ("Halftone A (Hard Tone)"), + SANE_I18N ("Halftone B (Soft Tone)"), + SANE_I18N ("Halftone C (Net Screen)"), + SANE_I18N ("Dither A (4x4 Bayer)"), + SANE_I18N ("Dither B (4x4 Spiral)"), + SANE_I18N ("Dither C (4x4 Net Screen)"), + SANE_I18N ("Dither D (8x4 Net Screen)"), + SANE_I18N ("Text Enhanced Technology"), + SANE_I18N ("Download pattern A"), + SANE_I18N ("Download pattern B"), + NULL +}; + +static int dropout_params[] = { 0x00, /* none */ 0x10, /* red */ 0x20, /* green */ 0x30 /* blue */ }; -static const SANE_String_Const dropout_list[] = { - SANE_I18N ("None"), - SANE_I18N ("Red"), +static const SANE_String_Const dropout_list[] = { + SANE_I18N ("None"), + SANE_I18N ("Red"), SANE_I18N ("Green"), - SANE_I18N ("Blue"), + SANE_I18N ("Blue"), NULL }; @@ -606,34 +606,34 @@ static const SANE_String_Const dropout_list[] = { * Color correction: * One array for the actual parameters that get sent to the scanner (color_params[]), * one array for the strings that get displayed in the user interface (color_list[]) - * and one array to mark the user defined color correction (dolor_userdefined[]). + * and one array to mark the user defined color correction (dolor_userdefined[]). */ -static int color_params[] = { - 0x00, - 0x01, - 0x10, - 0x20, - 0x40, +static int color_params[] = { + 0x00, + 0x01, + 0x10, + 0x20, + 0x40, 0x80 }; -static SANE_Bool color_userdefined[] = { - SANE_FALSE, - SANE_TRUE, - SANE_FALSE, - SANE_FALSE, - SANE_FALSE, +static SANE_Bool color_userdefined[] = { + SANE_FALSE, + SANE_TRUE, + SANE_FALSE, + SANE_FALSE, + SANE_FALSE, SANE_FALSE }; -static const SANE_String_Const color_list[] = { - SANE_I18N ("No Correction"), +static const SANE_String_Const color_list[] = { + SANE_I18N ("No Correction"), SANE_I18N ("User defined"), - SANE_I18N ("Impact-dot printers"), + SANE_I18N ("Impact-dot printers"), SANE_I18N ("Thermal printers"), SANE_I18N ("Ink-jet printers"), - SANE_I18N ("CRT monitors"), + SANE_I18N ("CRT monitors"), NULL }; @@ -644,20 +644,20 @@ static const SANE_String_Const color_list[] = { * the actally used params and list arrays at runtime. */ -static int gamma_params_ab[] = { - 0x01, - 0x03, - 0x00, - 0x10, +static int gamma_params_ab[] = { + 0x01, + 0x03, + 0x00, + 0x10, 0x20 }; -static const SANE_String_Const gamma_list_ab[] = { - SANE_I18N ("Default"), +static const SANE_String_Const gamma_list_ab[] = { + SANE_I18N ("Default"), SANE_I18N ("User defined"), - SANE_I18N ("High density printing"), + SANE_I18N ("High density printing"), SANE_I18N ("Low density printing"), - SANE_I18N ("High contrast printing"), + SANE_I18N ("High contrast printing"), NULL }; @@ -669,14 +669,14 @@ static SANE_Bool gamma_userdefined_ab[] = { SANE_FALSE, }; -static int gamma_params_d[] = { - 0x03, +static int gamma_params_d[] = { + 0x03, 0x04 }; -static const SANE_String_Const gamma_list_d[] = { +static const SANE_String_Const gamma_list_d[] = { SANE_I18N ("User defined (Gamma=1.0)"), - SANE_I18N ("User defined (Gamma=1.8)"), + SANE_I18N ("User defined (Gamma=1.8)"), NULL }; @@ -701,13 +701,13 @@ static unsigned int w_cmd_count = 0; * this is used for the FilmScan */ -static const SANE_String_Const bay_list[] = { - " 1 ", - " 2 ", - " 3 ", - " 4 ", - " 5 ", - " 6 ", +static const SANE_String_Const bay_list[] = { + " 1 ", + " 2 ", + " 3 ", + " 4 ", + " 5 ", + " 6 ", NULL }; @@ -744,7 +744,7 @@ struct qf_param }; /* gcc don't like to overwrite const field */ -static /*const */ struct qf_param qf_params[] = { +static /*const */ struct qf_param qf_params[] = { {0, 0, SANE_FIX (120.0), SANE_FIX (120.0)}, {0, 0, SANE_FIX (148.5), SANE_FIX (210.0)}, {0, 0, SANE_FIX (210.0), SANE_FIX (148.5)}, @@ -753,13 +753,13 @@ static /*const */ struct qf_param qf_params[] = { {0, 0, 0, 0} }; -static const SANE_String_Const qf_list[] = { - SANE_I18N ("CD"), - SANE_I18N ("A5 portrait"), +static const SANE_String_Const qf_list[] = { + SANE_I18N ("CD"), + SANE_I18N ("A5 portrait"), SANE_I18N ("A5 landscape"), - SANE_I18N ("Letter"), - SANE_I18N ("A4"), - SANE_I18N ("Max"), + SANE_I18N ("Letter"), + SANE_I18N ("A4"), + SANE_I18N ("Max"), NULL }; @@ -770,7 +770,7 @@ static SANE_Word *bitDepthList = NULL; /* * List of pointers to devices - will be dynamically allocated depending - * on the number of devices found. + * on the number of devices found. */ static const SANE_Device **devlist = 0; @@ -1199,10 +1199,10 @@ set_resolution (Epson_Scanner * s, int xres, int yres) } /* - * set_scan_area() + * set_scan_area() * - * Sends the "set scan area" command to the scanner with the currently selected - * scan area. This scan area is already corrected for "color shuffling" if + * Sends the "set scan area" command to the scanner with the currently selected + * scan area. This scan area is already corrected for "color shuffling" if * necessary. */ static SANE_Status @@ -1472,7 +1472,7 @@ DetectSize: * is reported as a warning (only visible if debug level is set to 10 or greater) - * every other condition is reported as an error. * - * This function only gets called when we are dealing with a scanner that supports the + * This function only gets called when we are dealing with a scanner that supports the * "warming up" code, so it's not a problem for B3 level scanners, that don't handle * request extended status commands. */ @@ -1650,7 +1650,7 @@ close_scanner (Epson_Scanner * s) if (s->fd == -1) return; - if (r_cmd_count % 2) + if (r_cmd_count % 2) { /* send a request_status. This toggles w_cmd_count and r_cmd_count */ u_char param[3]; @@ -1668,7 +1668,7 @@ close_scanner (Epson_Scanner * s) DBG (5, "w_cmd_count = %d\n",w_cmd_count); DBG (5, "r_cmd_count = %d\n",r_cmd_count); - if (w_cmd_count % 2) + if (w_cmd_count % 2) { int junk1,junk2; @@ -1700,8 +1700,8 @@ close_scanner (Epson_Scanner * s) /* * open_scanner() * - * Open the scanner device. Depending on the connection method, - * different open functions are called. + * Open the scanner device. Depending on the connection method, + * different open functions are called. */ static SANE_Status @@ -1798,7 +1798,7 @@ feed (Epson_Scanner * s) /* * eject() - * + * * Eject the current page from the ADF. The scanner is opened prior to * sending the command and closed afterwards. * @@ -2011,7 +2011,7 @@ attach (const char *dev_name, Epson_Device * *devp, int type) } /* check for PIO devices */ - /* can we convert the device name to an integer? This is only possible + /* can we convert the device name to an integer? This is only possible with PIO devices */ port = atoi (dev_name); if (port != 0) @@ -2088,7 +2088,7 @@ attach (const char *dev_name, Epson_Device * *devp, int type) buf[INQUIRY_BUF_SIZE] = 0; DBG (1, ">%s<\n", buf + 8); - /* + /* * For USB and PIO scanners this will be done later, once * we have communication established with the device. */ @@ -2140,7 +2140,7 @@ attach (const char *dev_name, Epson_Device * *devp, int type) status = sanei_usb_find_devices (vendor, product, attach_one_usb); } - return SANE_STATUS_INVAL; /* return - the attach_one_usb() + return SANE_STATUS_INVAL; /* return - the attach_one_usb() will take care of this */ } @@ -2179,7 +2179,7 @@ attach (const char *dev_name, Epson_Device * *devp, int type) is_valid = SANE_FALSE; i = 0; - /* check all known product IDs to verify that we know + /* check all known product IDs to verify that we know about the device */ while (i != numIds && !is_valid) { @@ -2287,7 +2287,7 @@ attach (const char *dev_name, Epson_Device * *devp, int type) /* - * Check for "request focus position" command. If this command is + * Check for "request focus position" command. If this command is * supported, then the scanner does also support the "set focus * position" command. */ @@ -2350,10 +2350,10 @@ attach (const char *dev_name, Epson_Device * *devp, int type) * this also requests the scanner device name from the scanner */ /* - * because we are also using the device name from this command, + * because we are also using the device name from this command, * we have to run this block even if the scanner does not report * an extension. The extensions are only reported if the ADF or - * the TPU are actually detected. + * the TPU are actually detected. */ if (s->hw->cmd->request_extended_status != 0) { @@ -2493,7 +2493,7 @@ attach (const char *dev_name, Epson_Device * *devp, int type) SANE_FIX ((buf[10] << 8 | buf[9]) * 25.4 / dev->dpi_range.max); dev->tpu_y_range.quant = 0; - /* + /* * Check for Perfection 4990 photo/GT-X800 scanner. * This scanner only report 3200 dpi back. * The scanner fysical supports 4800 dpi. @@ -2503,11 +2503,11 @@ attach (const char *dev_name, Epson_Device * *devp, int type) */ if (strncmp((char *) buf + 0x1A,"GT-X800",7) == 0) { - dev->tpu_x_range.max = (dev->tpu_x_range.max/32)*48; - dev->tpu_y_range.max = (dev->tpu_y_range.max/32)*48; + dev->tpu_x_range.max = (dev->tpu_x_range.max/32)*48; + dev->tpu_y_range.max = (dev->tpu_y_range.max/32)*48; DBG (5, "dpi_range.max %x \n", dev->dpi_range.max); } - + DBG (5, "tpu tlx %f tly %f brx %f bry %f [mm]\n", SANE_UNFIX (dev->tpu_x_range.min), SANE_UNFIX (dev->tpu_y_range.min), @@ -2597,8 +2597,8 @@ attach (const char *dev_name, Epson_Device * *devp, int type) close_scanner (s); - /* - * we are done with this one, prepare for the next scanner: + /* + * we are done with this one, prepare for the next scanner: */ ++num_devices; @@ -2689,7 +2689,7 @@ sane_init (SANE_Int * version_code, SANE_Auth_Callback authorize) { int numIds; - /* add the vendor and product IDs to the list of + /* add the vendor and product IDs to the list of known devices before we call the attach function */ numIds = sanei_epson_getNumberOfUSBProductIds (); if (vendor != 0x4b8) @@ -2723,7 +2723,7 @@ sane_init (SANE_Int * version_code, SANE_Auth_Callback authorize) /* * void sane_exit(void) * - * Clean up the list of attached scanners. + * Clean up the list of attached scanners. */ void @@ -2914,11 +2914,11 @@ init_options (Epson_Scanner * s) s->opt[OPT_GAMMA_CORRECTION].type = SANE_TYPE_STRING; s->opt[OPT_GAMMA_CORRECTION].constraint_type = SANE_CONSTRAINT_STRING_LIST; - /* + /* * special handling for D1 function level - at this time I'm not * testing for D1, I'm just assuming that all D level scanners will * behave the same way. This has to be confirmed with the next D-level - * scanner + * scanner */ if (s->hw->cmd->level[0] == 'D') { @@ -2944,7 +2944,7 @@ init_options (Epson_Scanner * s) /* gamma vector */ -/* +/* s->opt[ OPT_GAMMA_VECTOR].name = SANE_NAME_GAMMA_VECTOR; s->opt[ OPT_GAMMA_VECTOR].title = SANE_TITLE_GAMMA_VECTOR; s->opt[ OPT_GAMMA_VECTOR].desc = SANE_DESC_GAMMA_VECTOR; @@ -3585,7 +3585,7 @@ sane_close (SANE_Handle handle) Epson_Scanner *s, *prev; /* - * Test if there is still data pending from + * Test if there is still data pending from * the scanner. If so, then do a cancel */ @@ -3828,14 +3828,14 @@ handle_source (Epson_Scanner * s, SANE_Int optindex, char *value) Handles setting the source (flatbed, transparency adapter (TPU), or auto document feeder (ADF)). - For newer scanners it also sets the focus according to the + For newer scanners it also sets the focus according to the glass / TPU settings. */ { int force_max = SANE_FALSE; SANE_Bool dummy; - /* reset the scanner when we are changing the source setting - + /* reset the scanner when we are changing the source setting - this is necessary for the Perfection 1650 */ if (s->hw->need_reset_on_source_change) reset (s); @@ -4237,7 +4237,7 @@ sane_get_parameters (SANE_Handle handle, SANE_Parameters * params) DBG (5, "sane_get_parameters()\n"); - /* + /* * If sane_start was already called, then just retrieve the parameters * from the scanner data structure */ @@ -4275,7 +4275,7 @@ sane_get_parameters (SANE_Handle handle, SANE_Parameters * params) s->params.lines = SANE_UNFIX (s->val[OPT_BR_Y].w - s->val[OPT_TL_Y].w) / 25.4 * ndpi + 0.5; - /* + /* * Make sure that the number of lines is correct for color shuffling: * The shuffling alghorithm produces 2xline_distance lines at the * beginning and the same amount at the end of the scan that are not @@ -4302,10 +4302,10 @@ sane_get_parameters (SANE_Handle handle, SANE_Parameters * params) SANE_UNFIX (s->val[OPT_BR_Y].w)); - /* - * Calculate bytes_per_pixel and bytes_per_line for + /* + * Calculate bytes_per_pixel and bytes_per_line for * any color depths. - * + * * The default color depth is stored in mode_params.depth: */ @@ -4320,8 +4320,8 @@ sane_get_parameters (SANE_Handle handle, SANE_Parameters * params) if (s->params.depth > 8) { - s->params.depth = 16; /* - * The frontends can only handle 8 or 16 bits + s->params.depth = 16; /* + * The frontends can only handle 8 or 16 bits * for gray or color - so if it's more than 8, * it gets automatically set to 16. This works * as long as EPSON does not come out with a @@ -4366,7 +4366,7 @@ sane_get_parameters (SANE_Handle handle, SANE_Parameters * params) /* * sane_start() * - * This function is part of the SANE API and gets called from the front end to + * This function is part of the SANE API and gets called from the front end to * start the scan process. * */ @@ -4396,7 +4396,7 @@ sane_start (SANE_Handle handle) * off 0 ACK * off 1 NAK * - * It makes no sense to scan with TPU powered on and source flatbed, because + * It makes no sense to scan with TPU powered on and source flatbed, because * light will come from both sides. */ @@ -4447,7 +4447,7 @@ sane_start (SANE_Handle handle) } - /* + /* * set the focus position according to the extension used: * if the TPU is selected, then focus 2.5mm above the glass, * otherwise focus on the glass. Scanners that don't support @@ -4499,7 +4499,7 @@ sane_start (SANE_Handle handle) } /* - * The byte sequence mode was introduced in B5, for B[34] we need line sequence mode + * The byte sequence mode was introduced in B5, for B[34] we need line sequence mode */ if ((s->hw->cmd->level[0] == 'D' || @@ -4641,7 +4641,7 @@ sane_start (SANE_Handle handle) if (s->hw->cmd->level[0] == 'D') { /* - * The D1 level has only the two user defined gamma + * The D1 level has only the two user defined gamma * settings. */ val = gamma_params[s->val[OPT_GAMMA_CORRECTION].w]; @@ -4652,8 +4652,8 @@ sane_start (SANE_Handle handle) /* * If "Default" is selected then determine the actual value - * to send to the scanner: If bilevel mode, just send the - * value from the table (0x01), for grayscale or color mode + * to send to the scanner: If bilevel mode, just send the + * value from the table (0x01), for grayscale or color mode * add one and send 0x02. */ /* if( s->val[ OPT_GAMMA_CORRECTION].w <= 1) { */ @@ -4766,7 +4766,7 @@ sane_start (SANE_Handle handle) /* - * If WAIT_FOR_BUTTON is active, then do just that: Wait until the button is + * If WAIT_FOR_BUTTON is active, then do just that: Wait until the button is * pressed. If the button was already pressed, then we will get the button * Pressed event right away. */ @@ -4841,8 +4841,8 @@ sane_start (SANE_Handle handle) s->hw->color_shuffle = SANE_FALSE; } -/* - * for debugging purposes: +/* + * for debugging purposes: */ #ifdef FORCE_COLOR_SHUFFLE DBG (1, "Test mode: FORCE_COLOR_SHUFFLE = TRUE\n"); @@ -4850,7 +4850,7 @@ sane_start (SANE_Handle handle) #endif - /* + /* * Modify the scan area: If the scanner requires color shuffling, then we try to * scan more lines to compensate for the lines that will be removed from the scan * due to the color shuffling alghorithm. @@ -4872,7 +4872,7 @@ sane_start (SANE_Handle handle) s->params.lines += 4 * s->line_distance; } - /* + /* * If (top + s->params.lines) is larger than the max scan area, reset * the number of scan lines: */ @@ -4897,7 +4897,7 @@ sane_start (SANE_Handle handle) lcount = 1; /* - * The set line count commands needs to be sent for certain scanners in + * The set line count commands needs to be sent for certain scanners in * color mode. The D1 level requires it, we are however only testing for * 'D' and not for the actual numeric level. */ @@ -5167,7 +5167,7 @@ read_data_block (Epson_Scanner * s, EpsonDataRec * result) /* * Hack Alert!!! - * If the status is SANE_STATUS_DEVICE_BUSY then we need to + * If the status is SANE_STATUS_DEVICE_BUSY then we need to * re-issue the command again. We can assume that the command that * caused this problem was ESC G, so in a loop with a sleep 1 we * are testing this over and over and over again, until the lamp @@ -5319,7 +5319,7 @@ START_READ: */ - /* + /* * read the first color line - the number of bytes to read * is already known (from last call to read_data_block() * We determine where to write the line from the color information @@ -5345,7 +5345,7 @@ START_READ: if (SANE_STATUS_GOOD != status) return status; - /* + /* * send the ACK signal to the scanner in order to make * it ready for the next data block. */ @@ -5484,7 +5484,7 @@ START_READ: */ /* - * Some scaners (e.g. the Perfection 1640 and GT-2200) seem + * Some scaners (e.g. the Perfection 1640 and GT-2200) seem * to have the R and G channels swapped. * The GT-8700 is the Asian version of the Perfection1640. * If the scanner name is one of these, and the scan mode is @@ -5499,9 +5499,9 @@ START_READ: s->params.format == SANE_FRAME_RGB; /* - * Certain Perfection 1650 also need this re-ordering of the two - * color channels. These scanners are identified by the problem - * with the half vertical scanning area. When we corrected this, + * Certain Perfection 1650 also need this re-ordering of the two + * color channels. These scanners are identified by the problem + * with the half vertical scanning area. When we corrected this, * we also set the variable s->hw->need_color_reorder */ if (s->hw->need_color_reorder) @@ -5551,7 +5551,7 @@ START_READ: } } - /* + /* * Do the color_shuffle if everything else is correct - at this time * most of the stuff is hardcoded for the Perfection 610 */ @@ -5562,8 +5562,8 @@ START_READ: status = color_shuffle (s, &new_length); - /* - * If no bytes are returned, check if the scanner is already done, if so, + /* + * If no bytes are returned, check if the scanner is already done, if so, * we'll probably just return, but if there is more data to process get * the next batch. */ @@ -5584,7 +5584,7 @@ START_READ: - /* + /* * copy the image data to the data memory area */ @@ -5689,10 +5689,10 @@ color_shuffle (SANE_Handle handle, int *new_length) /* - * Initialize the variables we are going to use for the + * Initialize the variables we are going to use for the * copying of the data. data_ptr is the pointer to * the currently worked on scan line. data_end is the - * end of the data area as calculated from adding *length + * end of the data area as calculated from adding *length * to the start of data. * out_data_ptr is used when writing out the processed data * and always points to the beginning of the next line to @@ -5709,7 +5709,7 @@ color_shuffle (SANE_Handle handle, int *new_length) /* * The buffer area is supposed to have a number of full scan - * lines, let's test if this is the case. + * lines, let's test if this is the case. */ if (length % s->params.bytes_per_line != 0) @@ -5785,7 +5785,7 @@ color_shuffle (SANE_Handle handle, int *new_length) */ /* - * Strip the first and last n lines and limit to + * Strip the first and last n lines and limit to */ if ((s->current_output_line >= s->line_distance) && (s->current_output_line < s->params.lines + s->line_distance)) @@ -5800,9 +5800,9 @@ color_shuffle (SANE_Handle handle, int *new_length) /* - * Now remove the 0-entry and move all other - * lines up by one. There are 2*line_distance + 1 - * buffers, * therefore the loop has to run from 0 + * Now remove the 0-entry and move all other + * lines up by one. There are 2*line_distance + 1 + * buffers, * therefore the loop has to run from 0 * to * 2*line_distance, and because we want to * copy every n+1st entry to n the loop runs * from - to 2*line_distance-1! @@ -6008,7 +6008,7 @@ get_identity_information (SANE_Handle handle) DBG (1, "maximum scan area: x %d y %d\n", x, y); k = 5; - /* + /* * Check for Perfection 4990 photo/GT-X800 scanner. * This scanner only report 3200 dpi back. * The scanner fysical supports 4800 dpi. @@ -6031,8 +6031,8 @@ get_identity_information (SANE_Handle handle) DBG (1, "product name %x %x %x %x %x %x %x %x \n", buf[0], buf[1],buf[2],buf[3],buf[4], buf[5],buf[6], buf[7] ); if (strncmp((char *) buf,"GT-X800",7) == 0) { - int val = 0x12 << 8 | 0xC0; - + int val = 0x12 << 8 | 0xC0; + s->hw->res_list_size++; s->hw->res_list = (SANE_Int *) realloc (s->hw->res_list, @@ -6169,7 +6169,7 @@ get_identity2_information (SANE_Handle handle) /* * void sane_cancel(SANE_Handle handle) - * + * * Set the cancel flag to true. The next time the backend requests data * from the scanner the CAN message will be sent. */ @@ -6260,7 +6260,7 @@ request_focus_position (SANE_Handle handle, u_char * position) /* - * Request the push button status + * Request the push button status * returns SANE_TRUE if the button was pressed * and SANE_FALSE if the button was not pressed * it also returns SANE_TRUE in case of an error. diff --git a/backend/epson.conf.in b/backend/epson.conf.in index 2cd505fea..796541b04 100644 --- a/backend/epson.conf.in +++ b/backend/epson.conf.in @@ -16,7 +16,7 @@ scsi "EPSON SC" # There are two different methods of configuring a USB scanner: libusb and the kernel module # For any system with libusb support (which is pretty much any recent Linux distribution) the # following line is sufficient. This however assumes that the connected scanner (or to be more -# accurate, it's device ID) is known to the backend. +# accurate, it's device ID) is known to the backend. usb # For libusb support for unknown scanners use the following command # usb diff --git a/backend/epson2-commands.c b/backend/epson2-commands.c index eccd4ba91..836080a6f 100644 --- a/backend/epson2-commands.c +++ b/backend/epson2-commands.c @@ -199,7 +199,7 @@ round_cct(double org_cct[], int rnd_cct[]) mult_cct[i] = org_cct[i] * 32; rnd_cct[i] = (int) floor(mult_cct[i] + 0.5); } - + do { for (i = 0; i < 3; i++) { @@ -265,8 +265,8 @@ profile_to_colorcoeff(double *profile, unsigned char *color_coeff) for (i = 0; i < 9; i++) color_coeff[i] = int2cpt(color_table[cc_idx[i]]); } - - + + /* * Sends the "set color correction coefficients" command with the * currently selected parameters to the scanner. @@ -825,7 +825,7 @@ esci_request_command_parameter(SANE_Handle handle, unsigned char *buf) return status; } -/* ESC q - Request Focus Position +/* ESC q - Request Focus Position * -> ESC q * <- Information block * <- Focus position status (2) diff --git a/backend/epson2-ops.c b/backend/epson2-ops.c index 1ba229220..ba0d9cb3e 100644 --- a/backend/epson2-ops.c +++ b/backend/epson2-ops.c @@ -66,7 +66,7 @@ * | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | set bay * | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | set threshold * | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | set focus position - * | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | request focus position + * | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | request focus position * | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | request extended identity * | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | request scanner status * | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | @@ -160,7 +160,7 @@ e2_dev_init(Epson_Device *dev, const char *devname, int conntype) dev->need_double_vertical = SANE_FALSE; dev->cct_profile = &epson_cct_profiles[0]; /* default profile */ - + dev->cmd = &epson_cmd[EPSON_LEVEL_DEFAULT]; /* Change default level when using a network connection */ @@ -936,8 +936,8 @@ e2_set_extended_scanning_parameters(Epson_Scanner * s) } if (s->val[OPT_MODE].w == MODE_INFRARED) { - /* only infrared in TPU mode (NOT in TPU2 or flatbeth) - * XXX investigate this ... only tested on GT-X800 + /* only infrared in TPU mode (NOT in TPU2 or flatbeth) + * XXX investigate this ... only tested on GT-X800 */ if (extensionCtrl == 1) /* test for TPU */ diff --git a/backend/epson2.c b/backend/epson2.c index df84b1d13..e94c69543 100644 --- a/backend/epson2.c +++ b/backend/epson2.c @@ -241,7 +241,7 @@ enum { * therefore I define two different sets of arrays, plus one set of * variables that get set to the actally used params and list arrays at runtime. */ - + static int gamma_params_ab[] = { 0x01, 0x03, @@ -497,7 +497,7 @@ open_scanner(Epson_Scanner *s) DBG(32, "scanner locked\n"); } - + } else if (s->hw->connection == SANE_EPSON_SCSI) status = sanei_scsi_open(s->hw->sane.name, &s->fd, sanei_epson2_scsi_sense_handler, @@ -515,7 +515,7 @@ open_scanner(Epson_Scanner *s) DBG(1, "disable any conflicting driver (like usblp).\n"); } - if (status != SANE_STATUS_GOOD) + if (status != SANE_STATUS_GOOD) DBG(1, "%s open failed: %s\n", s->hw->sane.name, sane_strstatus(status)); else @@ -604,7 +604,7 @@ detect_usb(struct Epson_Scanner *s, SANE_Bool assume_valid) DBG(1, "the device cannot be verified - will continue\n"); return SANE_STATUS_GOOD; } - + /* check the vendor ID to see if we are dealing with an EPSON device */ if (vendor != SANE_EPSON_VENDOR_ID) { /* this is not a supported vendor ID */ @@ -631,11 +631,11 @@ detect_usb(struct Epson_Scanner *s, SANE_Bool assume_valid) s->hw->sane.name, product); return SANE_STATUS_INVAL; } - + DBG(1, "found valid Epson scanner: 0x%x/0x%x (vendorID/productID)\n", vendor, product); - return SANE_STATUS_GOOD; + return SANE_STATUS_GOOD; } static int num_devices; /* number of scanners attached to backend */ @@ -684,7 +684,7 @@ device_detect(const char *name, int type, SANE_Bool assume_valid, SANE_Status *s *status = SANE_STATUS_INVAL; return NULL; } - + /* alloc and clear our device structure */ dev = malloc(sizeof(*dev)); if (!dev) { @@ -797,7 +797,7 @@ attach_one_usb(const char *dev) static SANE_Status attach_one_net(const char *dev) { - char name[39+4]; + char name[39+4]; DBG(7, "%s: dev = %s\n", __func__, dev); @@ -821,7 +821,7 @@ attach_one_config(SANEI_Config __sane_unused__ *config, const char *line) int len = strlen(line); DBG(7, "%s: len = %d, line = %s\n", __func__, len, line); - + if (sscanf(line, "usb %i %i", &vendor, &product) == 2) { /* add the vendor and product IDs to the list of @@ -1248,7 +1248,7 @@ init_options(Epson_Scanner *s) /* if (!s->hw->cmd->set_color_correction) s->opt[OPT_FILM_TYPE].cap |= SANE_CAP_INACTIVE; -*/ +*/ /* mirror */ s->opt[OPT_MIRROR].name = "mirror"; @@ -1501,12 +1501,12 @@ sane_open(SANE_String_Const name, SANE_Handle *handle) if (s == NULL) return status; } else { - + /* as a last resort, check for a match * in the device list. This should handle SCSI * devices and platforms without libusb. */ - + if (first_dev == NULL) probe_devices(); @@ -1515,7 +1515,7 @@ sane_open(SANE_String_Const name, SANE_Handle *handle) DBG(1, "invalid device name: %s\n", name); return SANE_STATUS_INVAL; } - } + } } @@ -1538,7 +1538,7 @@ sane_open(SANE_String_Const name, SANE_Handle *handle) } *handle = (SANE_Handle)s; - + return SANE_STATUS_GOOD; } @@ -2132,7 +2132,7 @@ sane_start(SANE_Handle handle) return status; } - + if (s->val[OPT_COLOR_CORRECTION].w == CORR_AUTO) { /* Automatic */ DBG(1, "using built in CCT profile\n"); @@ -2142,7 +2142,7 @@ sane_start(SANE_Handle handle) if (0) { /* XXX TPU */ - + /* XXX check this */ if (s->val[OPT_FILM_TYPE].w == 0) e2_load_cct_profile(s, CCTP_COLORPOS); @@ -2153,7 +2153,7 @@ sane_start(SANE_Handle handle) e2_load_cct_profile(s, CCTP_REFLECTIVE); } } - + /* ESC m, user defined color correction */ if (s->hw->cmd->set_color_correction_coefficients && correction_userdefined[s->val[OPT_COLOR_CORRECTION].w]) { diff --git a/backend/epson2.conf.in b/backend/epson2.conf.in index 797df2d5f..0637b2ed5 100644 --- a/backend/epson2.conf.in +++ b/backend/epson2.conf.in @@ -21,7 +21,7 @@ usb # usb 0x4b8 0x110 # Network -# +# # net 192.168.1.123 net autodiscovery diff --git a/backend/epson2_net.c b/backend/epson2_net.c index 4b3e7e98b..8d0fe9ea7 100644 --- a/backend/epson2_net.c +++ b/backend/epson2_net.c @@ -124,7 +124,7 @@ sanei_epson_net_read(Epson_Scanner *s, unsigned char *buf, ssize_t wanted, if (read < 0) { return 0; } - + /* } else if (wanted < size && s->netlen == size) { */ } else { DBG(23, "%s: partial read\n", __func__); @@ -187,7 +187,7 @@ sanei_epson_net_write(Epson_Scanner *s, unsigned int cmd, const unsigned char *b DBG(24, "H1[0]: %02x %02x %02x %02x\n", h1[0], h1[1], h1[2], h1[3]); if((cmd >> 8) == 0x20) { - htobe32a(&h1[6], buf_size + 8); + htobe32a(&h1[6], buf_size + 8); htobe32a(&h2[0], buf_size); htobe32a(&h2[4], reply_len); diff --git a/backend/epson2_usb.c b/backend/epson2_usb.c index 8e29943e5..e37503732 100644 --- a/backend/epson2_usb.c +++ b/backend/epson2_usb.c @@ -171,7 +171,7 @@ SANE_Word sanei_epson_usb_product_ids[] = { 0x8ca, /* L850 Series */ 0x8cd, /* WF-R4640 Series, WF-R5690 Series */ 0x8d0, /* PX-M350F, WF-M5690 Series */ - 0 /* last entry - this is used for devices that are specified + 0 /* last entry - this is used for devices that are specified in the config file as "usb " */ }; diff --git a/backend/epson_usb.c b/backend/epson_usb.c index 520b49fb5..7fc5c9153 100644 --- a/backend/epson_usb.c +++ b/backend/epson_usb.c @@ -41,7 +41,7 @@ SANE_Word sanei_epson_usb_product_ids[] = { 0x82e, /* DX-6000 */ 0x82f, /* DX-4050 */ 0x838, /* DX-7400 */ - 0 /* last entry - this is used for devices that are specified + 0 /* last entry - this is used for devices that are specified in the config file as "usb " */ }; diff --git a/backend/fujitsu-scsi.h b/backend/fujitsu-scsi.h index 42598cb94..551ee0738 100644 --- a/backend/fujitsu-scsi.h +++ b/backend/fujitsu-scsi.h @@ -1,9 +1,9 @@ #ifndef FUJITSU_SCSI_H #define FUJITSU_SCSI_H -/* +/* * Part of SANE - Scanner Access Now Easy. - * + * * Please see to opening comments in fujitsu.c */ @@ -233,7 +233,7 @@ putnbyte (unsigned char *pnt, unsigned int value, unsigned int nbytes) #define get_IN_has_cmd_sdiag(in) getbitfield(in+0x28, 1, 2) #define get_IN_has_cmd_rdiag(in) getbitfield(in+0x28, 1, 1) #define get_IN_has_cmd_scan(in) getbitfield(in+0x28, 1, 0) - + #define get_IN_has_cmd_msen6(in) getbitfield(in+0x29, 1, 7) #define get_IN_has_cmd_copy(in) getbitfield(in+0x29, 1, 6) #define get_IN_has_cmd_rel(in) getbitfield(in+0x29, 1, 5) @@ -244,7 +244,7 @@ putnbyte (unsigned char *pnt, unsigned int value, unsigned int nbytes) #define get_IN_has_cmd_tur(in) getbitfield(in+0x29, 1, 0) /* more stuff here? (vendor commands) */ -#define get_IN_has_cmd_subwindow(in) getbitfield(in+0x2b, 1, 0) +#define get_IN_has_cmd_subwindow(in) getbitfield(in+0x2b, 1, 0) #define get_IN_has_cmd_endorser(in) getbitfield(in+0x2b, 1, 1) #define get_IN_has_cmd_hw_status(in) getbitfield(in+0x2b, 1, 2) #define get_IN_has_cmd_hw_status_2(in) getbitfield(in+0x2b, 1, 3) @@ -413,7 +413,7 @@ putnbyte (unsigned char *pnt, unsigned int value, unsigned int nbytes) #define set_MSEL_pf(sb, val) setbitfield(sb + 1, 1, 4, val) #define set_MSEL_xferlen(sb, val) sb[0x04] = (unsigned char)val -/* MS payloads are combined 4 byte header and 8 or 10 byte page +/* MS payloads are combined 4 byte header and 8 or 10 byte page * there is also 'descriptor block' & 'vendor-specific block' * but fujitsu seems not to use these */ /* 10 byte page only used by dropout? */ @@ -439,7 +439,7 @@ putnbyte (unsigned char *pnt, unsigned int value, unsigned int nbytes) #define set_MSEL_df_thickness(sb, val) setbitfield(sb + 2, 1, 4, val) #define set_MSEL_df_length(sb, val) setbitfield(sb + 2, 1, 3, val) #define set_MSEL_df_diff(sb, val) setbitfield(sb + 2, 3, 0, val) -#define MSEL_df_diff_DEFAULT 0 +#define MSEL_df_diff_DEFAULT 0 #define MSEL_df_diff_10MM 1 #define MSEL_df_diff_15MM 2 #define MSEL_df_diff_20MM 3 @@ -940,7 +940,7 @@ putnbyte (unsigned char *pnt, unsigned int value, unsigned int nbytes) #define get_WD_contrast(sb) sb[0x18] /* 0x19 - Image Composition (color mode) - * 3091 - use 0x00 for line art, 0x01 for halftone, + * 3091 - use 0x00 for line art, 0x01 for halftone, * 0x02 for grayscale, 0x05 for color. * 3096 - same but minus color. */ @@ -961,9 +961,9 @@ putnbyte (unsigned char *pnt, unsigned int value, unsigned int nbytes) #define get_WD_bitsperpixel(sb) sb[0x1a] /* 0x1b,0x1c - Halftone Pattern - * 3091 byte 1b: 00h default(=dither), 01h dither, + * 3091 byte 1b: 00h default(=dither), 01h dither, * 02h error dispersion - * 1c: 00 dark images, 01h dark text+images, + * 1c: 00 dark images, 01h dark text+images, * 02h light images, * 03h light text+images, 80h download pattern * 3096: 1b unused; 1c bit 7=1: use downloadable pattern, @@ -983,8 +983,8 @@ putnbyte (unsigned char *pnt, unsigned int value, unsigned int nbytes) /* 0x1d - Reverse image, padding type * 3091: bit 7=1: reverse black&white * bits 0-2: padding type, must be 0 - * 3096: the same; bit 7 must be set for gray and not - * set for b/w. + * 3096: the same; bit 7 must be set for gray and not + * set for b/w. */ #define set_WD_rif(sb, val) setbitfield(sb + 0x1d, 1, 7, val) #define get_WD_rif(sb) getbitfield(sb + 0x1d, 1, 7) diff --git a/backend/fujitsu.c b/backend/fujitsu.c index 433f75af4..7f0e8e65c 100644 --- a/backend/fujitsu.c +++ b/backend/fujitsu.c @@ -107,7 +107,7 @@ - removed SP15 code - sane_open actually opens the device you request v11 2003-06-11, MAN - - fixed bug in that code when a scanner is disconnected + - fixed bug in that code when a scanner is disconnected v12 2003-10-06, MAN - added code to support color modes of more recent scanners v13 2003-11-07, OS @@ -136,7 +136,7 @@ v19 2004-06-28, MAN - 4220 use model code not strcmp (stan a t saticed.me.uk) v20 2004-08-24, OS - - bugfix: 3091 did not work since 15.12.2003 + - bugfix: 3091 did not work since 15.12.2003 - M4099 supported (bw only) v21 2006-05-01, MAN - Complete rewrite, half code size @@ -264,7 +264,7 @@ - change window_gamma determination - add fi-5650C usb id and color mode v48 2007-04-16, MAN - - re-enable brightness/contrast for built-in models + - re-enable brightness/contrast for built-in models v49 2007-06-28, MAN - add fi-5750C usb id and color mode v50 2007-07-10, MAN @@ -617,7 +617,7 @@ . . - sane_start() : start image acquisition . . - sane_get_parameters() : returns actual scan parameters . . - sane_read() : read image data (from pipe) - . . (sane_read called multiple times; after sane_read returns EOF, + . . (sane_read called multiple times; after sane_read returns EOF, . . loop may continue with sane_start which may return a 2nd page . . when doing duplex scans, or load the next page from the ADF) . . @@ -656,7 +656,7 @@ - function trace 10 - function detail 15 - get/setopt cmds 20 - - scsi/usb trace 25 + - scsi/usb trace 25 - scsi/usb writes 30 - scsi/usb reads 31 - useless noise 35 @@ -736,7 +736,7 @@ static struct fujitsu *fujitsu_devList = NULL; /* * Called by SANE initially. - * + * * From the SANE spec: * This function must be called before any other SANE function can be * called. The behavior of a SANE backend is undefined if this @@ -770,7 +770,7 @@ sane_init (SANE_Int * version_code, SANE_Auth_Callback authorize) /* * Called by SANE to find out about supported devices. - * + * * From the SANE spec: * This function can be used to query the list of devices that are * available. If the function executes successfully, it stores a @@ -783,7 +783,7 @@ sane_init (SANE_Int * version_code, SANE_Auth_Callback authorize) * returned (devices directly attached to the machine that SANE is * running on). If it is false, the device list includes all remote * devices that are accessible to the SANE library. - * + * * SANE does not require that this function is called before a * sane_open() call is performed. A device name may be specified * explicitly by a user which would make it unnecessary and @@ -827,39 +827,39 @@ sane_get_devices (const SANE_Device *** device_list, SANE_Bool local_only) FUJITSU_CONFIG_FILE); while (sanei_config_read (line, PATH_MAX, fp)) { - + lp = line; - + /* ignore comments */ if (*lp == '#') continue; - + /* skip empty lines */ if (*lp == 0) continue; - + if ((strncmp ("option", lp, 6) == 0) && isspace (lp[6])) { - + lp += 6; lp = sanei_config_skip_whitespace (lp); - + /* we allow setting buffersize too big */ if ((strncmp (lp, "buffer-size", 11) == 0) && isspace (lp[11])) { - + int buf; lp += 11; lp = sanei_config_skip_whitespace (lp); buf = atoi (lp); - + if (buf < 4096) { DBG (5, "sane_get_devices: config option \"buffer-size\" (%d) is < 4096, ignoring!\n", buf); continue; } - + if (buf > 64*1024) { DBG (5, "sane_get_devices: config option \"buffer-size\" (%d) is > %d, warning!\n", buf, 64*1024); } - + DBG (15, "sane_get_devices: setting \"buffer-size\" to %d\n", buf); global_buffer_size = buf; } @@ -956,8 +956,8 @@ attach_one_usb (const char *device_name) return attach_one(device_name,CONNECTION_USB); } -/* build the scanner struct and link to global list - * unless struct is already loaded, then pretend +/* build the scanner struct and link to global list + * unless struct is already loaded, then pretend */ static SANE_Status attach_one (const char *device_name, int connType) @@ -1105,7 +1105,7 @@ connect_fd (struct fujitsu *s) } else { DBG (15, "connect_fd: opening SCSI device\n"); - ret = sanei_scsi_open_extended (s->device_name, &(s->fd), sense_handler, s, + ret = sanei_scsi_open_extended (s->device_name, &(s->fd), sense_handler, s, &s->buffer_size); if(!ret && buffer_size != s->buffer_size){ DBG (5, "connect_fd: cannot get requested buffer size (%d/%d)\n", @@ -1115,8 +1115,8 @@ connect_fd (struct fujitsu *s) if(ret == SANE_STATUS_GOOD){ - /* first generation usb scanners can get flaky if not closed - * properly after last use. very first commands sent to device + /* first generation usb scanners can get flaky if not closed + * properly after last use. very first commands sent to device * must be prepared to correct this- see wait_scanner() */ ret = wait_scanner(s); if (ret != SANE_STATUS_GOOD) { @@ -1157,9 +1157,9 @@ init_inquire (struct fujitsu *s) set_IN_return_size (cmd, inLen); set_IN_evpd (cmd, 0); set_IN_page_code (cmd, 0); - + ret = do_cmd ( - s, 1, 0, + s, 1, 0, cmd, cmdLen, NULL, 0, in, &inLen @@ -1674,7 +1674,7 @@ init_vpd (struct fujitsu *s) /*not all scanners go this far*/ if (get_IN_page_length (in) >= 0x67-5) { DBG (15, " connection type: %d\n", get_IN_connection(in)); - + DBG (15, " endorser ext: %d\n", get_IN_endorser_type_ext(in)); DBG (15, " endorser pr_b: %d\n", get_IN_endorser_pre_back(in)); DBG (15, " endorser pr_f: %d\n", get_IN_endorser_pre_front(in)); @@ -1683,7 +1683,7 @@ init_vpd (struct fujitsu *s) s->os_x_basic = get_IN_x_overscan_size(in); DBG (15, " horizontal overscan: %d\n", s->os_x_basic); - + s->os_y_basic = get_IN_y_overscan_size(in); DBG (15, " vertical overscan: %d\n", s->os_y_basic); } @@ -1778,7 +1778,7 @@ init_vpd (struct fujitsu *s) } static SANE_Status -init_ms(struct fujitsu *s) +init_ms(struct fujitsu *s) { int ret; int oldDbg=0; @@ -2543,9 +2543,9 @@ init_options (struct fujitsu *s) s->opt[i].cap = SANE_CAP_INACTIVE; } - /* go ahead and setup the first opt, because - * frontend may call control_option on it - * before calling get_option_descriptor + /* go ahead and setup the first opt, because + * frontend may call control_option on it + * before calling get_option_descriptor */ s->opt[OPT_NUM_OPTS].name = SANE_NAME_NUM_OPTIONS; s->opt[OPT_NUM_OPTS].title = SANE_TITLE_NUM_OPTIONS; @@ -2660,11 +2660,11 @@ init_serial (struct fujitsu *s) set_SCSI_opcode(cmd, SEND_DIAGNOSTIC_code); set_SD_slftst(cmd, 0); set_SD_xferlen(cmd, outLen); - + memcpy(out,SD_gdi_string,outLen); ret = do_cmd ( - s, 1, 0, + s, 1, 0, cmd, cmdLen, out, outLen, NULL, NULL @@ -2680,7 +2680,7 @@ init_serial (struct fujitsu *s) set_RD_xferlen(cmd, inLen); ret = do_cmd ( - s, 1, 0, + s, 1, 0, cmd, cmdLen, NULL, 0, in, &inLen @@ -2719,7 +2719,7 @@ sane_open (SANE_String_Const name, SANE_Handle * handle) struct fujitsu *dev = NULL; struct fujitsu *s = NULL; SANE_Status ret; - + DBG (10, "sane_open: start\n"); if(fujitsu_devList){ @@ -2740,7 +2740,7 @@ sane_open (SANE_String_Const name, SANE_Handle * handle) } else{ DBG (15, "sane_open: device %s requested\n", name); - + for (dev = fujitsu_devList; dev; dev = dev->next) { if (strcmp (dev->sane.name, name) == 0 || strcmp (dev->device_name, name) == 0) { /*always allow sanei devname*/ @@ -2816,7 +2816,7 @@ sane_get_option_descriptor (SANE_Handle handle, SANE_Int option) } if(s->has_adf){ s->source_list[i++]=STRING_ADFFRONT; - + if(s->has_back){ s->source_list[i++]=STRING_ADFBACK; } @@ -2852,7 +2852,7 @@ sane_get_option_descriptor (SANE_Handle handle, SANE_Int option) s->mode_list[i++]=STRING_COLOR; } s->mode_list[i]=NULL; - + opt->name = SANE_NAME_SCAN_MODE; opt->title = SANE_TITLE_SCAN_MODE; opt->desc = SANE_DESC_SCAN_MODE; @@ -2873,7 +2873,7 @@ sane_get_option_descriptor (SANE_Handle handle, SANE_Int option) opt->type = SANE_TYPE_INT; opt->unit = SANE_UNIT_DPI; opt->cap = SANE_CAP_SOFT_SELECT | SANE_CAP_SOFT_DETECT; - + if(s->step_x_res[s->s_mode] && s->step_y_res[s->s_mode]){ s->res_range.min = s->min_x_res; s->res_range.max = s->max_x_res; @@ -2895,7 +2895,7 @@ sane_get_option_descriptor (SANE_Handle handle, SANE_Int option) } } s->res_list[0] = i; - + opt->constraint_type = SANE_CONSTRAINT_WORD_LIST; opt->constraint.word_list = s->res_list; } @@ -2917,7 +2917,7 @@ sane_get_option_descriptor (SANE_Handle handle, SANE_Int option) s->tl_x_range.min = SCANNER_UNIT_TO_FIXED_MM(s->min_x); s->tl_x_range.max = SCANNER_UNIT_TO_FIXED_MM(get_page_width(s)); s->tl_x_range.quant = MM_PER_UNIT_FIX; - + opt->name = SANE_NAME_SCAN_TL_X; opt->title = SANE_TITLE_SCAN_TL_X; opt->desc = SANE_DESC_SCAN_TL_X; @@ -2935,7 +2935,7 @@ sane_get_option_descriptor (SANE_Handle handle, SANE_Int option) s->tl_y_range.min = SCANNER_UNIT_TO_FIXED_MM(s->min_y); s->tl_y_range.max = SCANNER_UNIT_TO_FIXED_MM(get_page_height(s)); s->tl_y_range.quant = MM_PER_UNIT_FIX; - + opt->name = SANE_NAME_SCAN_TL_Y; opt->title = SANE_TITLE_SCAN_TL_Y; opt->desc = SANE_DESC_SCAN_TL_Y; @@ -2953,7 +2953,7 @@ sane_get_option_descriptor (SANE_Handle handle, SANE_Int option) s->br_x_range.min = SCANNER_UNIT_TO_FIXED_MM(s->min_x); s->br_x_range.max = SCANNER_UNIT_TO_FIXED_MM(get_page_width(s)); s->br_x_range.quant = MM_PER_UNIT_FIX; - + opt->name = SANE_NAME_SCAN_BR_X; opt->title = SANE_TITLE_SCAN_BR_X; opt->desc = SANE_DESC_SCAN_BR_X; @@ -2971,7 +2971,7 @@ sane_get_option_descriptor (SANE_Handle handle, SANE_Int option) s->br_y_range.min = SCANNER_UNIT_TO_FIXED_MM(s->min_y); s->br_y_range.max = SCANNER_UNIT_TO_FIXED_MM(get_page_height(s)); s->br_y_range.quant = MM_PER_UNIT_FIX; - + opt->name = SANE_NAME_SCAN_BR_Y; opt->title = SANE_TITLE_SCAN_BR_Y; opt->desc = SANE_DESC_SCAN_BR_Y; @@ -3160,7 +3160,7 @@ sane_get_option_descriptor (SANE_Handle handle, SANE_Int option) s->ht_type_list[i++]=STRING_DITHER; s->ht_type_list[i++]=STRING_DIFFUSION; s->ht_type_list[i]=NULL; - + opt->name = "ht-type"; opt->title = SANE_I18N ("Halftone type"); opt->desc = SANE_I18N ("Control type of halftone filter"); @@ -3265,7 +3265,7 @@ sane_get_option_descriptor (SANE_Handle handle, SANE_Int option) s->wl_follow_list[i++]=STRING_ON; s->wl_follow_list[i++]=STRING_OFF; s->wl_follow_list[i]=NULL; - + opt->name = "wl-follow"; opt->title = SANE_I18N ("White level follower"); opt->desc = SANE_I18N ("Control white level follower"); @@ -3503,7 +3503,7 @@ sane_get_option_descriptor (SANE_Handle handle, SANE_Int option) /*automatic width detection */ if(option==OPT_AWD){ - + opt->name = "awd"; opt->title = SANE_I18N ("Auto width detection"); opt->desc = SANE_I18N ("Scanner detects paper sides. May reduce scanning speed."); @@ -3521,7 +3521,7 @@ sane_get_option_descriptor (SANE_Handle handle, SANE_Int option) /*automatic length detection */ if(option==OPT_ALD){ - + opt->name = "ald"; opt->title = SANE_I18N ("Auto length detection"); opt->desc = SANE_I18N ("Scanner detects paper lower edge. May confuse some frontends."); @@ -3600,7 +3600,7 @@ sane_get_option_descriptor (SANE_Handle handle, SANE_Int option) s->df_action_list[1] = STRING_CONTINUE; s->df_action_list[2] = STRING_STOP; s->df_action_list[3] = NULL; - + opt->name = "df-action"; opt->title = SANE_I18N ("DF action"); opt->desc = SANE_I18N ("Action following double feed error"); @@ -3617,7 +3617,7 @@ sane_get_option_descriptor (SANE_Handle handle, SANE_Int option) /*double feed by skew*/ if(option==OPT_DF_SKEW){ - + opt->name = "df-skew"; opt->title = SANE_I18N ("DF skew"); opt->desc = SANE_I18N ("Enable double feed error due to skew"); @@ -3636,7 +3636,7 @@ sane_get_option_descriptor (SANE_Handle handle, SANE_Int option) /*double feed by thickness */ if(option==OPT_DF_THICKNESS){ - + opt->name = "df-thickness"; opt->title = SANE_I18N ("DF thickness"); opt->desc = SANE_I18N ("Enable double feed error due to paper thickness"); @@ -3655,7 +3655,7 @@ sane_get_option_descriptor (SANE_Handle handle, SANE_Int option) /*double feed by length*/ if(option==OPT_DF_LENGTH){ - + opt->name = "df-length"; opt->title = SANE_I18N ("DF length"); opt->desc = SANE_I18N ("Enable double feed error due to paper length"); @@ -3679,7 +3679,7 @@ sane_get_option_descriptor (SANE_Handle handle, SANE_Int option) s->df_diff_list[2] = STRING_15MM; s->df_diff_list[3] = STRING_20MM; s->df_diff_list[4] = NULL; - + opt->name = "df-diff"; opt->title = SANE_I18N ("DF length difference"); opt->desc = SANE_I18N ("Difference in page length to trigger double feed error"); @@ -3703,7 +3703,7 @@ sane_get_option_descriptor (SANE_Handle handle, SANE_Int option) s->df_recovery_list[1] = STRING_OFF; s->df_recovery_list[2] = STRING_ON; s->df_recovery_list[3] = NULL; - + opt->name = "df-recovery"; opt->title = SANE_I18N ("DF recovery mode"); opt->desc = SANE_I18N ("Request scanner to reverse feed on paper jam"); @@ -3723,7 +3723,7 @@ sane_get_option_descriptor (SANE_Handle handle, SANE_Int option) s->paper_protect_list[1] = STRING_OFF; s->paper_protect_list[2] = STRING_ON; s->paper_protect_list[3] = NULL; - + opt->name = "paper-protect"; opt->title = SANE_I18N ("Paper protection"); opt->desc = SANE_I18N ("Request scanner to predict jams in the ADF"); @@ -3743,7 +3743,7 @@ sane_get_option_descriptor (SANE_Handle handle, SANE_Int option) s->adv_paper_prot_list[1] = STRING_OFF; s->adv_paper_prot_list[2] = STRING_ON; s->adv_paper_prot_list[3] = NULL; - + opt->name = "adv-paper-protect"; opt->title = SANE_I18N ("Advanced paper protection"); opt->desc = SANE_I18N ("Request scanner to predict jams in the ADF using improved sensors"); @@ -3763,7 +3763,7 @@ sane_get_option_descriptor (SANE_Handle handle, SANE_Int option) s->staple_detect_list[1] = STRING_OFF; s->staple_detect_list[2] = STRING_ON; s->staple_detect_list[3] = NULL; - + opt->name = "staple-detect"; opt->title = SANE_I18N ("Staple detection"); opt->desc = SANE_I18N ("Request scanner to detect jams in the ADF caused by staples"); @@ -3783,7 +3783,7 @@ sane_get_option_descriptor (SANE_Handle handle, SANE_Int option) s->bg_color_list[1] = STRING_WHITE; s->bg_color_list[2] = STRING_BLACK; s->bg_color_list[3] = NULL; - + opt->name = "bgcolor"; opt->title = SANE_I18N ("Background color"); opt->desc = SANE_I18N ("Set color of background for scans. May conflict with overscan option"); @@ -3804,7 +3804,7 @@ sane_get_option_descriptor (SANE_Handle handle, SANE_Int option) s->do_color_list[2] = STRING_GREEN; s->do_color_list[3] = STRING_BLUE; s->do_color_list[4] = NULL; - + opt->name = "dropoutcolor"; opt->title = SANE_I18N ("Dropout color"); opt->desc = SANE_I18N ("One-pass scanners use only one color during gray or binary scanning, useful for colored paper or ink"); @@ -3828,7 +3828,7 @@ sane_get_option_descriptor (SANE_Handle handle, SANE_Int option) s->buff_mode_list[1] = STRING_OFF; s->buff_mode_list[2] = STRING_ON; s->buff_mode_list[3] = NULL; - + opt->name = "buffermode"; opt->title = SANE_I18N ("Buffer mode"); opt->desc = SANE_I18N ("Request scanner to read pages quickly from ADF into internal memory"); @@ -3848,7 +3848,7 @@ sane_get_option_descriptor (SANE_Handle handle, SANE_Int option) s->prepick_list[1] = STRING_OFF; s->prepick_list[2] = STRING_ON; s->prepick_list[3] = NULL; - + opt->name = "prepick"; opt->title = SANE_I18N ("Prepick"); opt->desc = SANE_I18N ("Request scanner to grab next page from ADF"); @@ -3868,7 +3868,7 @@ sane_get_option_descriptor (SANE_Handle handle, SANE_Int option) s->overscan_list[1] = STRING_OFF; s->overscan_list[2] = STRING_ON; s->overscan_list[3] = NULL; - + opt->name = "overscan"; opt->title = SANE_I18N ("Overscan"); opt->desc = SANE_I18N ("Collect a few mm of background on top side of scan, before paper enters ADF, and increase maximum scan area beyond paper size, to allow collection on remaining sides. May conflict with bgcolor option"); @@ -3887,10 +3887,10 @@ sane_get_option_descriptor (SANE_Handle handle, SANE_Int option) s->sleep_time_range.min = 0; s->sleep_time_range.max = 60; s->sleep_time_range.quant = 1; - + opt->name = "sleeptimer"; opt->title = SANE_I18N ("Sleep timer"); - opt->desc = SANE_I18N ("Time in minutes until the internal power supply switches to sleep mode"); + opt->desc = SANE_I18N ("Time in minutes until the internal power supply switches to sleep mode"); opt->type = SANE_TYPE_INT; opt->unit = SANE_UNIT_NONE; opt->constraint_type = SANE_CONSTRAINT_RANGE; @@ -3906,10 +3906,10 @@ sane_get_option_descriptor (SANE_Handle handle, SANE_Int option) s->off_time_range.min = 0; s->off_time_range.max = 960; s->off_time_range.quant = 1; - + opt->name = "offtimer"; opt->title = SANE_I18N ("Off timer"); - opt->desc = SANE_I18N ("Time in minutes until the internal power supply switches the scanner off. Will be rounded to nearest 15 minutes. Zero means never power off."); + opt->desc = SANE_I18N ("Time in minutes until the internal power supply switches the scanner off. Will be rounded to nearest 15 minutes. Zero means never power off."); opt->type = SANE_TYPE_INT; opt->unit = SANE_UNIT_NONE; opt->constraint_type = SANE_CONSTRAINT_RANGE; @@ -3925,7 +3925,7 @@ sane_get_option_descriptor (SANE_Handle handle, SANE_Int option) s->duplex_offset_range.min = -16; s->duplex_offset_range.max = 16; s->duplex_offset_range.quant = 1; - + opt->name = "duplexoffset"; opt->title = SANE_I18N ("Duplex offset"); opt->desc = SANE_I18N ("Adjust front/back offset"); @@ -3943,7 +3943,7 @@ sane_get_option_descriptor (SANE_Handle handle, SANE_Int option) s->green_offset_range.min = -16; s->green_offset_range.max = 16; s->green_offset_range.quant = 1; - + opt->name = "greenoffset"; opt->title = SANE_I18N ("Green offset"); opt->desc = SANE_I18N ("Adjust green/red offset"); @@ -3956,12 +3956,12 @@ sane_get_option_descriptor (SANE_Handle handle, SANE_Int option) else opt->cap = SANE_CAP_INACTIVE; } - + if(option==OPT_BLUE_OFFSET){ s->blue_offset_range.min = -16; s->blue_offset_range.max = 16; s->blue_offset_range.quant = 1; - + opt->name = "blueoffset"; opt->title = SANE_I18N ("Blue offset"); opt->desc = SANE_I18N ("Adjust blue/red offset"); @@ -3974,7 +3974,7 @@ sane_get_option_descriptor (SANE_Handle handle, SANE_Int option) else opt->cap = SANE_CAP_INACTIVE; } - + if(option==OPT_LOW_MEM){ opt->name = "lowmemory"; opt->title = SANE_I18N ("Low Memory"); @@ -3985,7 +3985,7 @@ sane_get_option_descriptor (SANE_Handle handle, SANE_Int option) if (1) opt->cap= SANE_CAP_SOFT_SELECT | SANE_CAP_SOFT_DETECT | SANE_CAP_ADVANCED; - else + else opt->cap = SANE_CAP_INACTIVE; opt->constraint_type = SANE_CONSTRAINT_NONE; @@ -4112,7 +4112,7 @@ sane_get_option_descriptor (SANE_Handle handle, SANE_Int option) if (s->has_endorser_f || s->has_endorser_b) opt->cap= SANE_CAP_SOFT_SELECT | SANE_CAP_SOFT_DETECT | SANE_CAP_ADVANCED; - else + else opt->cap = SANE_CAP_INACTIVE; opt->constraint_type = SANE_CONSTRAINT_NONE; @@ -4335,7 +4335,7 @@ sane_get_option_descriptor (SANE_Handle handle, SANE_Int option) opt->unit = SANE_UNIT_NONE; if (s->has_cmd_hw_status || s->ghs_in_rs) opt->cap = SANE_CAP_SOFT_DETECT | SANE_CAP_HARD_SELECT | SANE_CAP_ADVANCED; - else + else opt->cap = SANE_CAP_INACTIVE; } @@ -4347,7 +4347,7 @@ sane_get_option_descriptor (SANE_Handle handle, SANE_Int option) opt->unit = SANE_UNIT_NONE; if (s->has_cmd_hw_status) opt->cap = SANE_CAP_SOFT_DETECT | SANE_CAP_HARD_SELECT | SANE_CAP_ADVANCED; - else + else opt->cap = SANE_CAP_INACTIVE; } @@ -4359,7 +4359,7 @@ sane_get_option_descriptor (SANE_Handle handle, SANE_Int option) opt->unit = SANE_UNIT_NONE; if (s->has_cmd_hw_status) opt->cap = SANE_CAP_SOFT_DETECT | SANE_CAP_HARD_SELECT | SANE_CAP_ADVANCED; - else + else opt->cap = SANE_CAP_INACTIVE; } @@ -4371,7 +4371,7 @@ sane_get_option_descriptor (SANE_Handle handle, SANE_Int option) opt->unit = SANE_UNIT_NONE; if (s->has_cmd_hw_status) opt->cap = SANE_CAP_SOFT_DETECT | SANE_CAP_HARD_SELECT | SANE_CAP_ADVANCED; - else + else opt->cap = SANE_CAP_INACTIVE; } @@ -4383,7 +4383,7 @@ sane_get_option_descriptor (SANE_Handle handle, SANE_Int option) opt->unit = SANE_UNIT_NONE; if (s->has_cmd_hw_status) opt->cap = SANE_CAP_SOFT_DETECT | SANE_CAP_HARD_SELECT | SANE_CAP_ADVANCED; - else + else opt->cap = SANE_CAP_INACTIVE; } @@ -4395,7 +4395,7 @@ sane_get_option_descriptor (SANE_Handle handle, SANE_Int option) opt->unit = SANE_UNIT_NONE; if (s->has_cmd_hw_status || s->ghs_in_rs) opt->cap = SANE_CAP_SOFT_DETECT | SANE_CAP_HARD_SELECT | SANE_CAP_ADVANCED; - else + else opt->cap = SANE_CAP_INACTIVE; } @@ -4407,7 +4407,7 @@ sane_get_option_descriptor (SANE_Handle handle, SANE_Int option) opt->unit = SANE_UNIT_NONE; if (s->has_cmd_hw_status) opt->cap = SANE_CAP_SOFT_DETECT | SANE_CAP_HARD_SELECT | SANE_CAP_ADVANCED; - else + else opt->cap = SANE_CAP_INACTIVE; } @@ -4419,7 +4419,7 @@ sane_get_option_descriptor (SANE_Handle handle, SANE_Int option) opt->unit = SANE_UNIT_NONE; if (s->has_cmd_hw_status || s->ghs_in_rs) opt->cap = SANE_CAP_SOFT_DETECT | SANE_CAP_HARD_SELECT | SANE_CAP_ADVANCED; - else + else opt->cap = SANE_CAP_INACTIVE; } @@ -4431,7 +4431,7 @@ sane_get_option_descriptor (SANE_Handle handle, SANE_Int option) opt->unit = SANE_UNIT_NONE; if (s->has_cmd_hw_status) opt->cap = SANE_CAP_SOFT_DETECT | SANE_CAP_HARD_SELECT | SANE_CAP_ADVANCED; - else + else opt->cap = SANE_CAP_INACTIVE; } @@ -4443,7 +4443,7 @@ sane_get_option_descriptor (SANE_Handle handle, SANE_Int option) opt->unit = SANE_UNIT_NONE; if (s->has_cmd_hw_status || s->ghs_in_rs) opt->cap = SANE_CAP_SOFT_DETECT | SANE_CAP_HARD_SELECT | SANE_CAP_ADVANCED; - else + else opt->cap = SANE_CAP_INACTIVE; } @@ -4455,7 +4455,7 @@ sane_get_option_descriptor (SANE_Handle handle, SANE_Int option) opt->unit = SANE_UNIT_NONE; if (s->has_cmd_hw_status) opt->cap = SANE_CAP_SOFT_DETECT | SANE_CAP_HARD_SELECT | SANE_CAP_ADVANCED; - else + else opt->cap = SANE_CAP_INACTIVE; } @@ -4467,7 +4467,7 @@ sane_get_option_descriptor (SANE_Handle handle, SANE_Int option) opt->unit = SANE_UNIT_NONE; if (s->has_cmd_hw_status || s->ghs_in_rs) opt->cap = SANE_CAP_SOFT_DETECT | SANE_CAP_HARD_SELECT | SANE_CAP_ADVANCED; - else + else opt->cap = SANE_CAP_INACTIVE; } @@ -4479,7 +4479,7 @@ sane_get_option_descriptor (SANE_Handle handle, SANE_Int option) opt->unit = SANE_UNIT_NONE; if (s->has_cmd_hw_status || s->ghs_in_rs) opt->cap = SANE_CAP_SOFT_DETECT | SANE_CAP_HARD_SELECT | SANE_CAP_ADVANCED; - else + else opt->cap = SANE_CAP_INACTIVE; } @@ -4491,7 +4491,7 @@ sane_get_option_descriptor (SANE_Handle handle, SANE_Int option) opt->unit = SANE_UNIT_NONE; if (s->has_cmd_hw_status && (s->has_endorser_f || s->has_endorser_b)) opt->cap = SANE_CAP_SOFT_DETECT | SANE_CAP_HARD_SELECT | SANE_CAP_ADVANCED; - else + else opt->cap = SANE_CAP_INACTIVE; } @@ -4503,7 +4503,7 @@ sane_get_option_descriptor (SANE_Handle handle, SANE_Int option) opt->unit = SANE_UNIT_NONE; if (s->has_cmd_hw_status || s->ghs_in_rs) opt->cap = SANE_CAP_SOFT_DETECT | SANE_CAP_HARD_SELECT | SANE_CAP_ADVANCED; - else + else opt->cap = SANE_CAP_INACTIVE; } @@ -4515,7 +4515,7 @@ sane_get_option_descriptor (SANE_Handle handle, SANE_Int option) opt->unit = SANE_UNIT_NONE; if (s->has_cmd_hw_status) opt->cap = SANE_CAP_SOFT_DETECT | SANE_CAP_HARD_SELECT | SANE_CAP_ADVANCED; - else + else opt->cap = SANE_CAP_INACTIVE; } @@ -4527,7 +4527,7 @@ sane_get_option_descriptor (SANE_Handle handle, SANE_Int option) opt->unit = SANE_UNIT_NONE; if (s->has_cmd_hw_status) opt->cap = SANE_CAP_SOFT_DETECT | SANE_CAP_HARD_SELECT | SANE_CAP_ADVANCED; - else + else opt->cap = SANE_CAP_INACTIVE; } @@ -4539,7 +4539,7 @@ sane_get_option_descriptor (SANE_Handle handle, SANE_Int option) opt->unit = SANE_UNIT_NONE; if (s->has_cmd_hw_status && (s->has_endorser_f || s->has_endorser_b)) opt->cap = SANE_CAP_SOFT_DETECT | SANE_CAP_HARD_SELECT | SANE_CAP_ADVANCED; - else + else opt->cap = SANE_CAP_INACTIVE; } @@ -4551,7 +4551,7 @@ sane_get_option_descriptor (SANE_Handle handle, SANE_Int option) opt->unit = SANE_UNIT_NONE; if (s->ghs_in_rs) opt->cap = SANE_CAP_SOFT_DETECT | SANE_CAP_HARD_SELECT | SANE_CAP_ADVANCED; - else + else opt->cap = SANE_CAP_INACTIVE; } @@ -4563,7 +4563,7 @@ sane_get_option_descriptor (SANE_Handle handle, SANE_Int option) opt->unit = SANE_UNIT_NONE; if (s->ghs_in_rs) opt->cap = SANE_CAP_SOFT_DETECT | SANE_CAP_HARD_SELECT | SANE_CAP_ADVANCED; - else + else opt->cap = SANE_CAP_INACTIVE; } @@ -4572,7 +4572,7 @@ sane_get_option_descriptor (SANE_Handle handle, SANE_Int option) /** * Gets or sets an option value. - * + * * From the SANE spec: * This function is used to set or inquire the current value of option * number n of the device represented by handle h. The manner in which @@ -4583,7 +4583,7 @@ sane_get_option_descriptor (SANE_Handle handle, SANE_Int option) * area pointed to by v must be big enough to hold the entire option * value (determined by member size in the corresponding option * descriptor). - * + * * The only exception to this rule is that when setting the value of a * string option, the string pointed to by argument v may be shorter * since the backend will stop reading the option value upon @@ -5056,23 +5056,23 @@ sane_control_option (SANE_Handle handle, SANE_Int option, case OPT_ENDORSER: *val_p = s->u_endorser; return SANE_STATUS_GOOD; - + case OPT_ENDORSER_BITS: *val_p = s->u_endorser_bits; return SANE_STATUS_GOOD; - + case OPT_ENDORSER_VAL: *val_p = s->u_endorser_val; return SANE_STATUS_GOOD; - + case OPT_ENDORSER_STEP: *val_p = s->u_endorser_step; return SANE_STATUS_GOOD; - + case OPT_ENDORSER_Y: *val_p = SCANNER_UNIT_TO_FIXED_MM(s->u_endorser_y); return SANE_STATUS_GOOD; - + case OPT_ENDORSER_FONT: switch (s->u_endorser_font) { case FONT_H: @@ -5092,7 +5092,7 @@ sane_control_option (SANE_Handle handle, SANE_Int option, break; } return SANE_STATUS_GOOD; - + case OPT_ENDORSER_DIR: switch (s->u_endorser_dir) { case DIR_TTB: @@ -5103,7 +5103,7 @@ sane_control_option (SANE_Handle handle, SANE_Int option, break; } return SANE_STATUS_GOOD; - + case OPT_ENDORSER_SIDE: switch (s->u_endorser_side) { case ED_front: @@ -5114,7 +5114,7 @@ sane_control_option (SANE_Handle handle, SANE_Int option, break; } return SANE_STATUS_GOOD; - + case OPT_ENDORSER_STRING: strncpy( (SANE_String)val, @@ -5128,102 +5128,102 @@ sane_control_option (SANE_Handle handle, SANE_Int option, ret = get_hardware_status(s,option); *val_p = s->hw_top; return ret; - + case OPT_A3: ret = get_hardware_status(s,option); *val_p = s->hw_A3; return ret; - + case OPT_B4: ret = get_hardware_status(s,option); *val_p = s->hw_B4; return ret; - + case OPT_A4: ret = get_hardware_status(s,option); *val_p = s->hw_A4; return ret; - + case OPT_B5: ret = get_hardware_status(s,option); *val_p = s->hw_B5; return ret; - + case OPT_HOPPER: ret = get_hardware_status(s,option); *val_p = s->hw_hopper; return ret; - + case OPT_OMR: ret = get_hardware_status(s,option); *val_p = s->hw_omr; return ret; - + case OPT_ADF_OPEN: ret = get_hardware_status(s,option); *val_p = s->hw_adf_open; return ret; - + case OPT_SLEEP: ret = get_hardware_status(s,option); *val_p = s->hw_sleep; return ret; - + case OPT_SEND_SW: ret = get_hardware_status(s,option); *val_p = s->hw_send_sw; return ret; - + case OPT_MANUAL_FEED: ret = get_hardware_status(s,option); *val_p = s->hw_manual_feed; return ret; - + case OPT_SCAN_SW: ret = get_hardware_status(s,option); *val_p = s->hw_scan_sw; return ret; - + case OPT_FUNCTION: ret = get_hardware_status(s,option); *val_p = s->hw_function; return ret; - + case OPT_INK_EMPTY: ret = get_hardware_status(s,option); *val_p = s->hw_ink_empty; return ret; - + case OPT_DOUBLE_FEED: ret = get_hardware_status(s,option); *val_p = s->hw_double_feed; return ret; - + case OPT_ERROR_CODE: ret = get_hardware_status(s,option); *val_p = s->hw_error_code; return ret; - + case OPT_SKEW_ANGLE: ret = get_hardware_status(s,option); *val_p = s->hw_skew_angle; return ret; - + case OPT_INK_REMAIN: ret = get_hardware_status(s,option); *val_p = s->hw_ink_remain; return ret; - + case OPT_DENSITY_SW: ret = get_hardware_status(s,option); *val_p = s->hw_density_sw; return ret; - + case OPT_DUPLEX_SW: ret = get_hardware_status(s,option); *val_p = s->hw_duplex_sw; return ret; - + } } else if (action == SANE_ACTION_SET_VALUE) { @@ -5260,7 +5260,7 @@ sane_control_option (SANE_Handle handle, SANE_Int option, * below. */ switch (option) { - + /* Mode Group */ case OPT_SOURCE: if (!strcmp (val, STRING_ADFFRONT)) { @@ -5276,7 +5276,7 @@ sane_control_option (SANE_Handle handle, SANE_Int option, tmp = SOURCE_FLATBED; } - if (s->source == tmp) + if (s->source == tmp) return SANE_STATUS_GOOD; s->source = tmp; @@ -5307,7 +5307,7 @@ sane_control_option (SANE_Handle handle, SANE_Int option, case OPT_RES: - if (s->resolution_x == val_c) + if (s->resolution_x == val_c) return SANE_STATUS_GOOD; s->resolution_x = val_c; @@ -5703,24 +5703,24 @@ sane_control_option (SANE_Handle handle, SANE_Int option, s->u_endorser = val_c; *info |= SANE_INFO_RELOAD_OPTIONS; return SANE_STATUS_GOOD; - + case OPT_ENDORSER_BITS: s->u_endorser_bits = val_c; return SANE_STATUS_GOOD; - + /*this val not used in send_endorser*/ case OPT_ENDORSER_VAL: s->u_endorser_val = val_c; return SANE_STATUS_GOOD; - + case OPT_ENDORSER_STEP: s->u_endorser_step = val_c; return SANE_STATUS_GOOD; - + case OPT_ENDORSER_Y: s->u_endorser_y = FIXED_MM_TO_SCANNER_UNIT(val_c); return SANE_STATUS_GOOD; - + case OPT_ENDORSER_FONT: if (!strcmp (val, STRING_HORIZONTAL)){ @@ -5739,7 +5739,7 @@ sane_control_option (SANE_Handle handle, SANE_Int option, s->u_endorser_font = FONT_VB; } return SANE_STATUS_GOOD; - + case OPT_ENDORSER_DIR: if (!strcmp (val, STRING_TOPTOBOTTOM)){ s->u_endorser_dir = DIR_TTB; @@ -5748,7 +5748,7 @@ sane_control_option (SANE_Handle handle, SANE_Int option, s->u_endorser_dir = DIR_BTT; } return SANE_STATUS_GOOD; - + /*this val not used in send_endorser*/ case OPT_ENDORSER_SIDE: if (!strcmp (val, STRING_FRONT)){ @@ -5758,7 +5758,7 @@ sane_control_option (SANE_Handle handle, SANE_Int option, s->u_endorser_side = ED_back; } return SANE_STATUS_GOOD; - + case OPT_ENDORSER_STRING: strncpy( (SANE_String)s->u_endorser_string, @@ -5773,7 +5773,7 @@ sane_control_option (SANE_Handle handle, SANE_Int option, } static SANE_Status -set_sleep_mode(struct fujitsu *s) +set_sleep_mode(struct fujitsu *s) { SANE_Status ret = SANE_STATUS_GOOD; @@ -5830,13 +5830,13 @@ set_off_mode(struct fujitsu *s) set_SCSI_opcode(cmd, SEND_DIAGNOSTIC_code); set_SD_slftst(cmd, 0); set_SD_xferlen(cmd, outLen); - + memcpy(out,SD_powoff_string,SD_powoff_stringlen); set_SD_powoff_disable(out,!s->off_time); set_SD_powoff_interval(out,s->off_time/15); ret = do_cmd ( - s, 1, 0, + s, 1, 0, cmd, cmdLen, out, outLen, NULL, NULL @@ -5880,14 +5880,14 @@ get_hardware_status (struct fujitsu *s, SANE_Int option) set_GHS_allocation_length(cmd, inLen); DBG (15, "get_hardware_status: calling ghs\n"); - + ret = do_cmd ( s, 1, 0, cmd, cmdLen, NULL, 0, in, &inLen ); - + if (ret == SANE_STATUS_GOOD || ret == SANE_STATUS_EOF) { s->hw_top = get_GHS_top(in); @@ -5895,23 +5895,23 @@ get_hardware_status (struct fujitsu *s, SANE_Int option) s->hw_B4 = get_GHS_B4(in); s->hw_A4 = get_GHS_A4(in); s->hw_B5 = get_GHS_B5(in); - + s->hw_hopper = get_GHS_hopper(in); s->hw_omr = get_GHS_omr(in); s->hw_adf_open = get_GHS_adf_open(in); - + s->hw_sleep = get_GHS_sleep(in); s->hw_send_sw = get_GHS_send_sw(in); s->hw_manual_feed = get_GHS_manual_feed(in); s->hw_scan_sw = get_GHS_scan_sw(in); - + s->hw_function = get_GHS_function(in); s->hw_ink_empty = get_GHS_ink_empty(in); s->hw_double_feed = get_GHS_double_feed(in); - + s->hw_error_code = get_GHS_error_code(in); - + s->hw_skew_angle = get_GHS_skew_angle(in); if(inLen > 9){ @@ -5942,7 +5942,7 @@ get_hardware_status (struct fujitsu *s, SANE_Int option) NULL,0, in, &inLen ); - + /* parse the rs data */ if(ret == SANE_STATUS_GOOD){ if(get_RS_sense_key(in)==0 && get_RS_ASC(in)==0x80){ @@ -5972,13 +5972,13 @@ get_hardware_status (struct fujitsu *s, SANE_Int option) } static SANE_Status -send_endorser(struct fujitsu *s) +send_endorser(struct fujitsu *s) { SANE_Status ret = SANE_STATUS_GOOD; unsigned char cmd[SEND_len]; size_t cmdLen = SEND_len; - + size_t strLen = strlen(s->u_endorser_string); unsigned char out[S_e_data_max_len]; /*we probably send less below*/ @@ -6080,7 +6080,7 @@ send_endorser(struct fujitsu *s) /* instead of internal brightness/contrast/gamma most scanners use a 256x256 or 1024x256 LUT default is linear table of slope 1 or 1/4 resp. - brightness and contrast inputs are -127 to +127 + brightness and contrast inputs are -127 to +127 contrast rotates slope of line around central input val @@ -6096,7 +6096,7 @@ send_endorser(struct fujitsu *s) bright dark . xxxxxxxx . - . x . + . x . out x . x . . x ............ xxxxxxxx.... @@ -6128,7 +6128,7 @@ send_lut (struct fujitsu *s) * first [-127,127] to [0,254] then to [0,1] * then multiply by PI/2 to convert to radians * then take the tangent to get slope (T.O.A) - * then multiply by the normal linear slope + * then multiply by the normal linear slope * because the table may not be square, i.e. 1024x256*/ slope = tan(((double)s->contrast+127)/254 * M_PI/2) * 256/bytes; @@ -6156,7 +6156,7 @@ send_lut (struct fujitsu *s) set_S_lut_order (out, S_lut_order_single); set_S_lut_ssize (out, bytes); set_S_lut_dsize (out, 256); - + for(i=0;iresolution_x); set_SD_preread_yres(out,s->resolution_y); @@ -6322,7 +6322,7 @@ diag_preread (struct fujitsu *s) set_SD_preread_composition(out, s->s_mode); ret = do_cmd ( - s, 1, 0, + s, 1, 0, cmd, cmdLen, out, outLen, NULL, NULL @@ -6374,17 +6374,17 @@ mode_select_df (struct fujitsu *s) if(s->df_action == DF_CONTINUE){ set_MSEL_df_continue (page, 1); } - + /* skew */ if(s->df_skew){ set_MSEL_df_skew (page, 1); } - + /* thickness */ if(s->df_thickness){ set_MSEL_df_thickness (page, 1); } - + /* length */ if(s->df_length){ set_MSEL_df_length (page, 1); @@ -6446,7 +6446,7 @@ mode_select_bg (struct fujitsu *s) set_MSEL_bg_fb (page, 1); } } - + ret = do_cmd ( s, 1, 0, cmd, cmdLen, @@ -6489,7 +6489,7 @@ mode_select_dropout (struct fujitsu *s) set_MSEL_dropout_front (page, s->dropout_color); set_MSEL_dropout_back (page, s->dropout_color); - + ret = do_cmd ( s, 1, 0, cmd, cmdLen, @@ -6574,7 +6574,7 @@ mode_select_prepick (struct fujitsu *s) set_MSEL_page_len(page, MSEL_data_min_len-2); set_MSEL_prepick(page, s->prepick); - + ret = do_cmd ( s, 1, 0, cmd, cmdLen, @@ -6620,7 +6620,7 @@ mode_select_auto (struct fujitsu *s) set_MSEL_awd(page, s->awd || s->hwdeskewcrop); set_MSEL_req_driv_crop(page, s->hwdeskewcrop && (s->swcrop || s->swdeskew)); set_MSEL_deskew(page, s->hwdeskewcrop); - + ret = do_cmd ( s, 1, 0, cmd, cmdLen, @@ -6648,7 +6648,7 @@ mode_select_auto (struct fujitsu *s) * completion of that request. Outside of that window, the returned * values are best-effort estimates of what the parameters will be * when sane_start() gets invoked. - * + * * Calling this function before a scan has actually started allows, * for example, to get an estimate of how big the scanned image will * be. The parameters passed to this function are the handle h of the @@ -6660,9 +6660,9 @@ sane_get_parameters (SANE_Handle handle, SANE_Parameters * params) { SANE_Status ret = SANE_STATUS_GOOD; struct fujitsu *s = (struct fujitsu *) handle; - + DBG (10, "sane_get_parameters: start\n"); - + /* not started? update param data from user settings */ if(!s->started){ ret = update_params(s); @@ -6760,10 +6760,10 @@ update_params (struct fujitsu * s) DBG(15,"update_params: area: tlx=%d, brx=%d, tly=%d, bry=%d\n", s->tl_x, s->br_x, s->tl_y, s->br_y); - DBG(15,"update_params: params: ppl=%d, Bpl=%d, lines=%d\n", + DBG(15,"update_params: params: ppl=%d, Bpl=%d, lines=%d\n", params->pixels_per_line, params->bytes_per_line, params->lines); - DBG(15,"update_params: params: format=%d, depth=%d, last=%d\n", + DBG(15,"update_params: params: format=%d, depth=%d, last=%d\n", params->format, params->depth, params->last_frame); /* second, we setup u_params to describe the image to the user */ @@ -6801,20 +6801,20 @@ update_u_params (struct fujitsu * s) params->format = SANE_FRAME_GRAY; params->bytes_per_line = params->pixels_per_line / 8; } - + DBG(15,"update_u_params: x: max=%d, page=%d, gpw=%d, res=%d\n", s->max_x, s->page_width, get_page_width(s), s->resolution_x); - + DBG(15,"update_u_params: y: max=%d, page=%d, gph=%d, res=%d\n", s->max_y, s->page_height, get_page_height(s), s->resolution_y); - + DBG(15,"update_u_params: area: tlx=%d, brx=%d, tly=%d, bry=%d\n", s->tl_x, s->br_x, s->tl_y, s->br_y); - - DBG(15,"update_u_params: params: ppl=%d, Bpl=%d, lines=%d\n", + + DBG(15,"update_u_params: params: ppl=%d, Bpl=%d, lines=%d\n", params->pixels_per_line, params->bytes_per_line, params->lines); - - DBG(15,"update_u_params: params: format=%d, depth=%d, last=%d\n", + + DBG(15,"update_u_params: params: format=%d, depth=%d, last=%d\n", params->format, params->depth, params->last_frame); } @@ -6939,14 +6939,14 @@ sane_start (SANE_Handle handle) if (ret != SANE_STATUS_GOOD) DBG (5, "sane_start: WARNING: cannot early send_lut %d\n", ret); } - + /* set window command */ ret = set_window(s); if (ret != SANE_STATUS_GOOD) { DBG (5, "sane_start: ERROR: cannot set window\n"); goto errors; } - + /* send lut if scanner has no hardware brightness/contrast, * or we are going to ask it to use a downloaded gamma table */ if (s->late_lut && (!s->brightness_steps || !s->contrast_steps || s->window_gamma & 0x80)){ @@ -6954,7 +6954,7 @@ sane_start (SANE_Handle handle) if (ret != SANE_STATUS_GOOD) DBG (5, "sane_start: WARNING: cannot late send_lut %d\n", ret); } - + /* some scanners need the q table sent, even when not scanning jpeg */ if (s->need_q_table){ ret = send_q_table(s); @@ -6968,7 +6968,7 @@ sane_start (SANE_Handle handle) DBG (5, "sane_start: ERROR: cannot start/stop endorser\n"); goto errors; } - + /* turn lamp on */ ret = scanner_control(s, SC_function_lamp_on); if (ret != SANE_STATUS_GOOD) { @@ -7043,7 +7043,7 @@ sane_start (SANE_Handle handle) goto errors; } - /* store the number of front bytes */ + /* store the number of front bytes */ if ( s->source != SOURCE_ADF_BACK ){ s->bytes_tot[SIDE_FRONT] = s->s_params.bytes_per_line * s->s_params.lines; s->buff_tot[SIDE_FRONT] = s->buffer_size; @@ -7062,7 +7062,7 @@ sane_start (SANE_Handle handle) s->buff_tot[SIDE_FRONT] = 0; } - /* store the number of back bytes */ + /* store the number of back bytes */ if ( s->source == SOURCE_ADF_DUPLEX || s->source == SOURCE_ADF_BACK ){ s->bytes_tot[SIDE_BACK] = s->s_params.bytes_per_line * s->s_params.lines; s->buff_tot[SIDE_BACK] = s->bytes_tot[SIDE_BACK]; @@ -7087,7 +7087,7 @@ sane_start (SANE_Handle handle) DBG (5, "sane_start: ERROR: cannot load buffers\n"); goto errors; } - + s->started=1; } } @@ -7102,9 +7102,9 @@ sane_start (SANE_Handle handle) DBG (15, "started=%d, side=%d, source=%d\n", s->started, s->side, s->source); - /* certain options require the entire image to + /* certain options require the entire image to * be collected from the scanner before we can - * tell the user the size of the image. the sane + * tell the user the size of the image. the sane * API has no way to inform the frontend of this, * so we block and buffer. yuck */ if( must_fully_buffer(s) ){ @@ -7142,7 +7142,7 @@ sane_start (SANE_Handle handle) } if(s->swskip){ /* Skipping means throwing out this image. - * Pretend the user read the whole thing + * Pretend the user read the whole thing * and call sane_start again. * This assumes we are running in batch mode. */ if(buffer_isblank(s,s->side)){ @@ -7166,7 +7166,7 @@ sane_start (SANE_Handle handle) errors: DBG (10, "sane_start: error %d\n", ret); - /* if we are started, but something went wrong, + /* if we are started, but something went wrong, * chances are there is image data inside scanner, * which should be discarded via cancel command */ if(s->started){ @@ -7181,7 +7181,7 @@ sane_start (SANE_Handle handle) } static SANE_Status -endorser(struct fujitsu *s) +endorser(struct fujitsu *s) { SANE_Status ret = SANE_STATUS_GOOD; @@ -7243,7 +7243,7 @@ endorser(struct fujitsu *s) } static SANE_Status -scanner_control (struct fujitsu *s, int function) +scanner_control (struct fujitsu *s, int function) { SANE_Status ret = SANE_STATUS_GOOD; int tries = 0; @@ -7283,7 +7283,7 @@ scanner_control (struct fujitsu *s, int function) } usleep(500000); - } + } if(ret == SANE_STATUS_GOOD){ DBG (15, "scanner_control: success, tries %d, ret %d\n",tries,ret); @@ -7299,7 +7299,7 @@ scanner_control (struct fujitsu *s, int function) } static SANE_Status -scanner_control_ric (struct fujitsu *s, int bytes, int side) +scanner_control_ric (struct fujitsu *s, int bytes, int side) { SANE_Status ret = SANE_STATUS_GOOD; int tries = 0; @@ -7325,7 +7325,7 @@ scanner_control_ric (struct fujitsu *s, int bytes, int side) set_SC_ric_len(cmd, bytes); DBG (15, "scanner_control_ric: %d %d\n",bytes,side); - + /* extremely long retry period */ while(tries++ < 120){ @@ -7341,7 +7341,7 @@ scanner_control_ric (struct fujitsu *s, int bytes, int side) } usleep(500000); - } + } if(ret == SANE_STATUS_GOOD){ DBG (15, "scanner_control_ric: success, tries %d, ret %d\n",tries,ret); @@ -7408,14 +7408,14 @@ set_window (struct fujitsu *s) { SANE_Status ret = SANE_STATUS_GOOD; - /* The command specifies the number of bytes in the data phase - * the data phase has a header, followed by 1 or 2 window desc blocks + /* The command specifies the number of bytes in the data phase + * the data phase has a header, followed by 1 or 2 window desc blocks * the header specifies the number of bytes in 1 window desc block */ unsigned char cmd[SET_WINDOW_len]; size_t cmdLen = SET_WINDOW_len; - + /*this is max size, we might send less below*/ unsigned char out[SW_header_len + SW_desc_len + SW_desc_len]; size_t outLen = SW_header_len + SW_desc_len + SW_desc_len; @@ -7687,7 +7687,7 @@ get_pixelsize(struct fujitsu *s, int actual) set_R_window_id (cmd, WD_wid_front); } set_R_xfer_length (cmd, inLen); - + ret = do_cmd ( s, 1, 0, cmd, cmdLen, @@ -7732,7 +7732,7 @@ get_pixelsize(struct fujitsu *s, int actual) else { s->s_params.bytes_per_line = s->s_params.pixels_per_line / 8; } - + /* some scanners can request that the driver clean img */ if(!s->has_short_pixelsize && get_PSIZE_req_driv_valid(in)){ s->req_driv_crop = get_PSIZE_req_driv_crop(in); @@ -7741,7 +7741,7 @@ get_pixelsize(struct fujitsu *s, int actual) s->req_driv_crop,s->req_driv_lut); } - DBG (15, "get_pixelsize: scan_x=%d, Bpl=%d, scan_y=%d\n", + DBG (15, "get_pixelsize: scan_x=%d, Bpl=%d, scan_y=%d\n", s->s_params.pixels_per_line, s->s_params.bytes_per_line, s->s_params.lines ); /* the user params are usually the same */ @@ -7758,7 +7758,7 @@ get_pixelsize(struct fujitsu *s, int actual) else { s->u_params.bytes_per_line = s->u_params.pixels_per_line / 8; } - + } else{ DBG (10, "get_pixelsize: got bad status %d, ignoring\n", ret); @@ -7812,7 +7812,7 @@ object_position (struct fujitsu *s, int action) /* * Issues SCAN command. - * + * * (This doesn't actually read anything, it just tells the scanner * to start scanning.) */ @@ -7897,7 +7897,7 @@ check_for_cancel(struct fujitsu *s) /* * Called by SANE to read data. - * + * * From the SANE spec: * This function is used to read image data from the device * represented by handle h. Argument buf is a pointer to a memory @@ -7905,7 +7905,7 @@ check_for_cancel(struct fujitsu *s) * returned is stored in *len. A backend must set this to zero when * the call fails (i.e., when a status other than SANE_STATUS_GOOD is * returned). - * + * * When the call succeeds, the number of bytes returned can be * anywhere in the range from 0 to maxlen bytes. */ @@ -7963,7 +7963,7 @@ sane_read (SANE_Handle handle, SANE_Byte * buf, SANE_Int max_len, SANE_Int * len /* alternating jpeg duplex interlacing */ else if(s->source == SOURCE_ADF_DUPLEX - && s->s_params.format == SANE_FRAME_JPEG + && s->s_params.format == SANE_FRAME_JPEG && s->jpeg_interlace == JPEG_INTERLACE_ALT ){ ret = read_from_JPEGduplex(s); @@ -7985,7 +7985,7 @@ sane_read (SANE_Handle handle, SANE_Byte * buf, SANE_Int max_len, SANE_Int * len DBG(5,"sane_read: front returning %d\n",ret); return ret; } - + /* buffer back side, but don't get too far ahead of the front! */ if(s->bytes_rx[SIDE_BACK] < s->bytes_rx[SIDE_FRONT] + s->buffer_size){ ret = read_from_scanner(s, SIDE_BACK); @@ -8084,9 +8084,9 @@ read_from_JPEGduplex(struct fujitsu *s) int bytes = s->buffer_size; int i = 0; - + DBG (10, "read_from_JPEGduplex: start\n"); - + if(s->eof_rx[SIDE_FRONT] && s->eof_rx[SIDE_BACK]){ DBG (10, "read_from_JPEGduplex: already have eofs, done\n"); return ret; @@ -8112,7 +8112,7 @@ read_from_JPEGduplex(struct fujitsu *s) bytes -= JFIF_APP0_LENGTH; } } - + DBG(15, "read_from_JPEGduplex: fto:%d frx:%d bto:%d brx:%d pa:%d\n", s->bytes_tot[SIDE_FRONT], s->bytes_rx[SIDE_FRONT], s->bytes_tot[SIDE_BACK], s->bytes_rx[SIDE_BACK], @@ -8123,7 +8123,7 @@ read_from_JPEGduplex(struct fujitsu *s) DBG(5, "read_from_JPEGduplex: Warning: no bytes this pass\n"); return ret; } - + /* fi-6770A gets mad if you 'read' too soon on usb, see if it is ready */ if(!s->bytes_rx[SIDE_FRONT] && s->connection == CONNECTION_USB){ DBG (15, "read: start of usb page, checking RIC\n"); @@ -8147,14 +8147,14 @@ read_from_JPEGduplex(struct fujitsu *s) /* interlaced jpeg duplex always reads from front */ set_R_window_id (cmd, WD_wid_front); set_R_xfer_length (cmd, inLen); - + ret = do_cmd ( s, 1, 0, cmd, cmdLen, NULL, 0, in, &inLen ); - + if (ret == SANE_STATUS_GOOD || ret == SANE_STATUS_EOF) { DBG(15, "read_from_JPEGduplex: got GOOD/EOF, returning GOOD\n"); } @@ -8167,7 +8167,7 @@ read_from_JPEGduplex(struct fujitsu *s) DBG(5, "read_from_JPEGduplex: error reading data status = %d\n", ret); inLen = 0; } - + for(i=0;i<(int)inLen;i++){ /* about to change stage */ @@ -8359,9 +8359,9 @@ read_from_JPEGduplex(struct fujitsu *s) s->eof_rx[SIDE_BACK] = 1; } } - + free(in); - + /* jpeg uses in-band EOI marker, so this is ususally redundant */ if(ret == SANE_STATUS_EOF){ DBG(15, "read_from_JPEGduplex: got EOF, finishing\n"); @@ -8372,7 +8372,7 @@ read_from_JPEGduplex(struct fujitsu *s) } DBG (10, "read_from_JPEGduplex: finish\n"); - + return ret; } @@ -8411,7 +8411,7 @@ read_from_3091duplex(struct fujitsu *s) if(bytes > avail) bytes = avail; } - + /* all requests must end on a line boundary */ bytes -= (bytes % s->s_params.bytes_per_line); @@ -8534,9 +8534,9 @@ read_from_scanner(struct fujitsu *s, int side) int bytes = s->buffer_size; int avail = s->buff_tot[side] - s->buff_rx[side]; int remain = s->bytes_tot[side] - s->bytes_rx[side]; - + DBG (10, "read_from_scanner: start %d\n", side); - + if(s->eof_rx[side]){ DBG (10, "read_from_scanner: already have eof, done\n"); return ret; @@ -8545,7 +8545,7 @@ read_from_scanner(struct fujitsu *s, int side) /* figure out the max amount to transfer */ if(bytes > avail) bytes = avail; - + /* all requests must end on line boundary */ bytes -= (bytes % s->s_params.bytes_per_line); @@ -8559,7 +8559,7 @@ read_from_scanner(struct fujitsu *s, int side) /* jpeg scans leave space for JFIF header at start of image */ if(s->s_params.format == SANE_FRAME_JPEG && s->bytes_rx[side] < 2) bytes -= JFIF_APP0_LENGTH; - + DBG(15, "read_from_scanner: si:%d re:%d bs:%d by:%d av:%d\n", side, remain, s->buffer_size, bytes, avail); @@ -8569,13 +8569,13 @@ read_from_scanner(struct fujitsu *s, int side) DBG(15, "read_from_scanner: buf to:%d rx:%d tx:%d\n", s->buff_tot[side], s->buff_rx[side], s->buff_tx[side]); - + /* this will happen if buffer is not drained yet */ if(bytes < 1){ DBG(5, "read_from_scanner: no bytes this pass\n"); return ret; } - + /* fi-6770A gets mad if you 'read' too soon on usb, see if it is ready */ if(!s->bytes_rx[side] && s->connection == CONNECTION_USB){ DBG (15, "read_from_scanner: start of usb page, checking RIC\n"); @@ -8592,27 +8592,27 @@ read_from_scanner(struct fujitsu *s, int side) DBG(5, "read_from_scanner: not enough mem for buffer: %d\n",(int)inLen); return SANE_STATUS_NO_MEM; } - + memset(cmd,0,cmdLen); set_SCSI_opcode(cmd, READ_code); set_R_datatype_code (cmd, R_datatype_imagedata); - + if (side == SIDE_BACK) { set_R_window_id (cmd, WD_wid_back); } else{ set_R_window_id (cmd, WD_wid_front); } - + set_R_xfer_length (cmd, inLen); - + ret = do_cmd ( s, 1, 0, cmd, cmdLen, NULL, 0, in, &inLen ); - + if (ret == SANE_STATUS_GOOD || ret == SANE_STATUS_EOF) { DBG(15, "read_from_scanner: got GOOD/EOF, returning GOOD\n"); ret = SANE_STATUS_GOOD; @@ -8626,7 +8626,7 @@ read_from_scanner(struct fujitsu *s, int side) DBG(5, "read_from_scanner: error reading data block status = %d\n",ret); inLen = 0; } - + DBG(15, "read_from_scanner: read %lu bytes\n",(unsigned long)inLen); if(inLen){ @@ -8640,7 +8640,7 @@ read_from_scanner(struct fujitsu *s, int side) copy_buffer (s, in, inLen, side); } } - + free(in); /* if this was a short read or not, log it */ @@ -8655,7 +8655,7 @@ read_from_scanner(struct fujitsu *s, int side) s->eom_rx = 1; } - /* paper ran out. lets try to set the eof flag on both sides, + /* paper ran out. lets try to set the eof flag on both sides, * but only if that side had a short read last time */ if(s->eom_rx){ int i; @@ -8668,7 +8668,7 @@ read_from_scanner(struct fujitsu *s, int side) } DBG (10, "read_from_scanner: finish\n"); - + return ret; } @@ -8682,7 +8682,7 @@ copy_3091(struct fujitsu *s, unsigned char * buf, int len, int side) /* Data is RR...GG...BB... on each line, * green is back 8 lines from red at 300 dpi - * blue is back 4 lines from red at 300 dpi. + * blue is back 4 lines from red at 300 dpi. * * Here, we get things on correct line, and * interlace to make RGBRGB. @@ -8726,12 +8726,12 @@ copy_3091(struct fujitsu *s, unsigned char * buf, int len, int side) s->lines_rx[side]++; } - /* even if we have read data, we may not have any + /* even if we have read data, we may not have any * full lines loaded yet, so we may have to lie */ i = (s->lines_rx[side]-goff) * s->s_params.bytes_per_line; if(i < 0){ i = 0; - } + } s->bytes_rx[side] = i; s->buff_rx[side] = i; @@ -8753,11 +8753,11 @@ copy_JPEG(struct fujitsu *s, unsigned char * buf, int len, int side) { SANE_Status ret=SANE_STATUS_GOOD; int i, seen = 0; - + DBG (10, "copy_JPEG: start\n"); /* A jpeg image starts with the SOI marker, FF D8. - * This is optionally followed by the JFIF APP0 + * This is optionally followed by the JFIF APP0 * marker, FF E0. If that marker is not present, * we add it, so we can insert the resolution */ @@ -8797,7 +8797,7 @@ copy_buffer(struct fujitsu *s, unsigned char * buf, int len, int side) int i, j; int bwidth = s->s_params.bytes_per_line; int pwidth = s->s_params.pixels_per_line; - + DBG (10, "copy_buffer: start\n"); /* invert image if scanner needs it for this mode */ @@ -8810,9 +8810,9 @@ copy_buffer(struct fujitsu *s, unsigned char * buf, int len, int side) /* scanners interlace colors in many different ways */ if(s->s_params.format == SANE_FRAME_RGB){ - + switch (s->color_interlace) { - + /* scanner returns pixel data as bgrbgr... */ case COLOR_INTERLACE_BGR: for(i=0; ibuffers[side]+s->buff_rx[side],buf,len); s->buff_rx[side] += len; @@ -8847,7 +8847,7 @@ copy_buffer(struct fujitsu *s, unsigned char * buf, int len, int side) memcpy(s->buffers[side]+s->buff_rx[side],buf,len); s->buff_rx[side] += len; } - + s->bytes_rx[side] += len; s->lines_rx[side] += len/s->s_params.bytes_per_line; @@ -8867,16 +8867,16 @@ read_from_buffer(struct fujitsu *s, SANE_Byte * buf, SANE_Status ret=SANE_STATUS_GOOD; int bytes = max_len; int remain = s->buff_rx[side] - s->buff_tx[side]; - + DBG (10, "read_from_buffer: start\n"); - + /* figure out the max amount to transfer */ if(bytes > remain){ bytes = remain; } - + *len = bytes; - + DBG(15, "read_from_buffer: si:%d re:%d ml:%d by:%d\n", side, remain, max_len, bytes); @@ -8885,19 +8885,19 @@ read_from_buffer(struct fujitsu *s, SANE_Byte * buf, DBG(15, "read_from_buffer: buf to:%d rx:%d tx:%d\n", s->buff_tot[side], s->buff_rx[side], s->buff_tx[side]); - + /*FIXME this needs to timeout eventually */ if(!bytes){ DBG(5,"read_from_buffer: nothing to do\n"); return SANE_STATUS_GOOD; } - + memcpy(buf,s->buffers[side]+s->buff_tx[side],bytes); s->buff_tx[side] += bytes; s->bytes_tx[side] += bytes; DBG (10, "read_from_buffer: finish\n"); - + return ret; } @@ -8911,7 +8911,7 @@ downsample_from_buffer(struct fujitsu *s, SANE_Byte * buf, SANE_Status ret=SANE_STATUS_GOOD; DBG (10, "downsample_from_buffer: start %d %d %d %d\n", s->bytes_rx[side], s->bytes_tx[side], s->buff_rx[side], s->buff_tx[side]); - + if(s->s_mode == MODE_COLOR && s->u_mode == MODE_GRAYSCALE){ while(*len < max_len && s->buff_rx[side] - s->buff_tx[side] >= 3){ @@ -8959,7 +8959,7 @@ downsample_from_buffer(struct fujitsu *s, SANE_Byte * buf, for(i=0; i<8; i++){ int gray = 0; - + switch (s->dropout_color) { case COLOR_RED: gray = *(s->buffers[side]+s->buff_tx[side]) * 3; @@ -8999,7 +8999,7 @@ downsample_from_buffer(struct fujitsu *s, SANE_Byte * buf, } DBG (10, "downsample_from_buffer: finish %d %d %d %d\n", s->bytes_rx[side], s->bytes_tx[side], s->buff_rx[side], s->buff_tx[side]); - + return ret; } @@ -9008,26 +9008,26 @@ downsample_from_buffer(struct fujitsu *s, SANE_Byte * buf, * @@ Section 5 - SANE cleanup functions */ /* - * Cancels a scan. + * Cancels a scan. * * It has been said on the mailing list that sane_cancel is a bit of a * misnomer because it is routinely called to signal the end of a * batch - quoting David Mosberger-Tang: - * + * * > In other words, the idea is to have sane_start() be called, and * > collect as many images as the frontend wants (which could in turn * > consist of multiple frames each as indicated by frame-type) and - * > when the frontend is done, it should call sane_cancel(). + * > when the frontend is done, it should call sane_cancel(). * > Sometimes it's better to think of sane_cancel() as "sane_stop()" * > but that name would have had some misleading connotations as * > well, that's why we stuck with "cancel". - * + * * The current consensus regarding duplex and ADF scans seems to be * the following call sequence: sane_start; sane_read (repeat until * EOF); sane_start; sane_read... and then call sane_cancel if the * batch is at an end. I.e. do not call sane_cancel during the run but * as soon as you get a SANE_STATUS_NO_DOCS. - * + * * From the SANE spec: * This function is used to immediately or as quickly as possible * cancel the currently pending operation of the device represented by @@ -9061,7 +9061,7 @@ sane_cancel (SANE_Handle handle) /* * Ends use of the scanner. - * + * * From the SANE spec: * This function terminates the association between the device handle * passed in argument h and the device it represents. If the device is @@ -9104,7 +9104,7 @@ disconnect_fd (struct fujitsu *s) /* * Terminates the backend. - * + * * From the SANE spec: * This function must be called to terminate use of a backend. The * function will first close all device handles that still might be @@ -9703,7 +9703,7 @@ do_usb_cmd(struct fujitsu *s, int runRS, int shortTime, rs_in, &rs_inLen ); DBG(25,"rs sub call <<\n"); - + if(ret2 == SANE_STATUS_EOF){ DBG(5,"rs: got EOF, returning IO_ERROR\n"); return SANE_STATUS_IO_ERROR; @@ -9736,7 +9736,7 @@ do_usb_cmd(struct fujitsu *s, int runRS, int shortTime, } static SANE_Status -wait_scanner(struct fujitsu *s) +wait_scanner(struct fujitsu *s) { SANE_Status ret = SANE_STATUS_GOOD; @@ -9754,7 +9754,7 @@ wait_scanner(struct fujitsu *s) NULL, 0, NULL, NULL ); - + if (ret != SANE_STATUS_GOOD) { DBG(5,"WARNING: Brain-dead scanner. Hitting with stick\n"); ret = do_cmd ( @@ -9783,7 +9783,7 @@ wait_scanner(struct fujitsu *s) return ret; } -/* certain options require the entire image to +/* certain options require the entire image to * be collected from the scanner before we can * tell the user the size of the image. */ static int @@ -9803,7 +9803,7 @@ must_fully_buffer(struct fujitsu *s) return 0; } -/* certain scanners require the mode of the +/* certain scanners require the mode of the * image to be changed in software. */ static int must_downsample(struct fujitsu *s) @@ -9823,7 +9823,7 @@ must_downsample(struct fujitsu *s) * due to using FB or overscan. */ static int -get_page_width(struct fujitsu *s) +get_page_width(struct fujitsu *s) { int width = s->page_width + 2 * (s->os_x_basic*1200/s->basic_x_res); @@ -9852,7 +9852,7 @@ get_page_width(struct fujitsu *s) * due to using FB or overscan. */ static int -get_page_height(struct fujitsu *s) +get_page_height(struct fujitsu *s) { int height = s->page_height + 2 * (s->os_y_basic*1200/s->basic_y_res); @@ -9883,7 +9883,7 @@ get_page_height(struct fujitsu *s) * and pick the right mode to match. */ static int -get_ipc_mode(struct fujitsu *s) +get_ipc_mode(struct fujitsu *s) { if ( s->bp_filter || s->smoothing @@ -9912,10 +9912,10 @@ get_ipc_mode(struct fujitsu *s) return WD_ipc_DEFAULT; } -/* s->max_y gives the maximum height of paper which can be scanned +/* s->max_y gives the maximum height of paper which can be scanned * this actually varies by resolution, so a helper to change it */ static int -set_max_y(struct fujitsu *s) +set_max_y(struct fujitsu *s) { int i; @@ -10046,7 +10046,7 @@ buffer_deskew(struct fujitsu *s, int side) s->deskew_stat = sanei_magic_findSkew( &s->s_params,s->buffers[side],s->resolution_x,s->resolution_y, &s->deskew_vals[0],&s->deskew_vals[1],&s->deskew_slope); - + if(s->deskew_stat){ DBG (5, "buffer_deskew: bad findSkew, bailing\n"); goto cleanup; @@ -10101,7 +10101,7 @@ buffer_crop(struct fujitsu *s, int side) ret = SANE_STATUS_GOOD; goto cleanup; } - + DBG (15, "buffer_crop: t:%d b:%d l:%d r:%d\n", s->crop_vals[0],s->crop_vals[1],s->crop_vals[2],s->crop_vals[3]); @@ -10127,7 +10127,7 @@ buffer_crop(struct fujitsu *s, int side) /* update image size counter to new, smaller size */ s->bytes_rx[side] = s->s_params.lines * s->s_params.bytes_per_line; s->buff_rx[side] = s->bytes_rx[side]; - + cleanup: DBG (10, "buffer_crop: finish\n"); return ret; diff --git a/backend/fujitsu.h b/backend/fujitsu.h index 916f069c3..4c2047477 100644 --- a/backend/fujitsu.h +++ b/backend/fujitsu.h @@ -1,12 +1,12 @@ #ifndef FUJITSU_H #define FUJITSU_H -/* +/* * Part of SANE - Scanner Access Now Easy. * Please see opening comment in fujitsu.c */ -/* ------------------------------------------------------------------------- +/* ------------------------------------------------------------------------- * This option list has to contain all options for all scanners supported by * this driver. If a certain scanner cannot handle a certain option, there's * still the possibility to say so, later. @@ -219,7 +219,7 @@ struct fujitsu int has_cmd_sdiag; int has_cmd_rdiag; int has_cmd_scan; - + int has_cmd_msen6; int has_cmd_copy; int has_cmd_rel; @@ -330,8 +330,8 @@ struct fujitsu int broken_diag_serial; /* some scanners are just plain borked */ int need_q_table; /* some scanners wont work without these */ - int need_diag_preread; - int late_lut; + int need_diag_preread; + int late_lut; int hopper_before_op; /* some scanners dont like OP when hopper empty */ int no_wait_after_op; /* some scanners dont like TUR after OP */ @@ -669,15 +669,15 @@ struct fujitsu #define COLOR_INTERLACE_RRGGBB 3 #define COLOR_INTERLACE_3091 4 -#define DUPLEX_INTERLACE_ALT 0 -#define DUPLEX_INTERLACE_NONE 1 -#define DUPLEX_INTERLACE_3091 2 +#define DUPLEX_INTERLACE_ALT 0 +#define DUPLEX_INTERLACE_NONE 1 +#define DUPLEX_INTERLACE_3091 2 -#define JPEG_INTERLACE_ALT 0 -#define JPEG_INTERLACE_NONE 1 +#define JPEG_INTERLACE_ALT 0 +#define JPEG_INTERLACE_NONE 1 -#define CROP_RELATIVE 0 -#define CROP_ABSOLUTE 1 +#define CROP_RELATIVE 0 +#define CROP_ABSOLUTE 1 #define DF_DEFAULT 0 #define DF_CONTINUE 1 diff --git a/backend/genesys_gl646.c b/backend/genesys_gl646.c index 58952fb5c..93d9905bc 100644 --- a/backend/genesys_gl646.c +++ b/backend/genesys_gl646.c @@ -985,7 +985,7 @@ gl646_setup_registers (Genesys_Device * dev, /* gamma enable for scans */ if (dev->model->flags & GENESYS_FLAG_14BIT_GAMMA) regs[reg_0x05].value |= REG05_GMM14BIT; - + regs[reg_0x05].value &= ~REG05_GMMENB; /* true CIS gray if needed */ diff --git a/backend/genesys_gl841.c b/backend/genesys_gl841.c index 43c01ff39..223c01d79 100644 --- a/backend/genesys_gl841.c +++ b/backend/genesys_gl841.c @@ -4746,7 +4746,7 @@ gl841_led_calibration (Genesys_Device * dev) { acceptable = SANE_FALSE; } - + /* for scanners using target value */ if(target>0) { diff --git a/backend/genesys_gl846.c b/backend/genesys_gl846.c index 0716c1754..fda4ddf26 100644 --- a/backend/genesys_gl846.c +++ b/backend/genesys_gl846.c @@ -2438,8 +2438,8 @@ gl846_init_regs_for_scan (Genesys_Device * dev) assumption: steps are expressed at maximum motor resolution we need: - SANE_Fixed y_offset; - SANE_Fixed y_size; + SANE_Fixed y_offset; + SANE_Fixed y_size; SANE_Fixed y_offset_calib; mm_to_steps()=motor dpi / 2.54 / 10=motor dpi / MM_PER_INCH */ diff --git a/backend/genesys_low.c b/backend/genesys_low.c index 4cbd75d55..a97bf893f 100644 --- a/backend/genesys_low.c +++ b/backend/genesys_low.c @@ -1334,7 +1334,7 @@ sanei_genesys_send_gamma_table (Genesys_Device * dev) /** @brief initialize device * Initialize backend and ASIC : registers, motor tables, and gamma tables * then ensure scanner's head is at home. Designed for gl846+ ASICs. - * Detects cold boot (ie first boot since device plugged) in this case + * Detects cold boot (ie first boot since device plugged) in this case * an extensice setup up is done at hardware level. * * @param dev device to initialize @@ -1510,7 +1510,7 @@ sanei_genesys_wait_for_home (Genesys_Device * dev) while (loop < max && !(val & HOMESNR) && status == SANE_STATUS_GOOD); /* if after the timeout, head is still not parked, error out */ - if(loop >= max && !(val & HOMESNR) && status == SANE_STATUS_GOOD) + if(loop >= max && !(val & HOMESNR) && status == SANE_STATUS_GOOD) { DBG (DBG_error, "%s: failed to reach park position %ds\n", __func__, max/10); return SANE_STATUS_IO_ERROR; diff --git a/backend/genesys_low.h b/backend/genesys_low.h index 56627b4ee..603849c10 100644 --- a/backend/genesys_low.h +++ b/backend/genesys_low.h @@ -710,7 +710,7 @@ typedef struct /**< value for brightness enhancement in the [-100..100] range */ int brightness; - + /**< cahe entries expiration time */ int expiration_time; } Genesys_Settings; diff --git a/backend/gphoto2.c b/backend/gphoto2.c index c8af30680..973257c51 100644 --- a/backend/gphoto2.c +++ b/backend/gphoto2.c @@ -1,28 +1,28 @@ /* Please note! Although intended to support multiple camera types * it's been tested with only cameras I have access to: the Kodak DC240 - * and the Directory Browse "camera." I'm very interested - * in learning what it would take to support more cameras. In + * and the Directory Browse "camera." I'm very interested + * in learning what it would take to support more cameras. In * particular, the current incarnation will only support cameras * that directly generate jpeg files. - * + * * Please report sucesses or failures using this backend! - * + * * However, having said that, I've already found it to be quite useful * even in its current form - one reason is that gphoto2 provides access - * to the camera via USB which is not supported by the regular DC240 + * to the camera via USB which is not supported by the regular DC240 * backend and is dramatically faster than the serial port. */ /*************************************************************************** * _S_A_N_E - Scanner Access Now Easy. - gphoto2.c + gphoto2.c 03/12/01 - Peter Fales Based on the dc210 driver, (C) 1998 Brian J. Murrell (which is based on dc25 driver (C) 1998 by Peter Fales) - + This file (C) 2001 by Peter Fales This file is part of the SANE package. @@ -61,14 +61,14 @@ 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. + If you do not wish that, delete this exception notice. *************************************************************************** - This file implements a SANE backend for digital cameras + This file implements a SANE backend for digital cameras supported by the gphoto2 libraries. - - THIS IS EXTREMELY ALPHA CODE! USE AT YOUR OWN RISK!! + + THIS IS EXTREMELY ALPHA CODE! USE AT YOUR OWN RISK!! (feedback to: gphoto2-devel@fales-lorenz.net) @@ -96,7 +96,7 @@ #include "../include/sane/sanei_backend.h" /* PSF 1/12/02 - gphoto2.h does a #include of config.h. We don't have - * config.h by that name (we call it sane/config.h), so the #undef of + * config.h by that name (we call it sane/config.h), so the #undef of * HAVE_CONFIG_H will cause it to skip that. */ #undef HAVE_CONFIG_H @@ -349,7 +349,7 @@ static const SANE_Device *devlist[] = { dev + 0, 0 }; -/* +/* * debug_func - called for gphoto2 debugging output (if enabled) */ static void @@ -397,9 +397,9 @@ init_gphoto2 (void) { /* * We get here if re-initializing the camera: either because - * the user clicked the "re-establish" button, or we need to - * recalculate the number of photos after taking a picture. - * We must release the old camera before starting over. + * the user clicked the "re-establish" button, or we need to + * recalculate the number of photos after taking a picture. + * We must release the old camera before starting over. */ CHECK_RET (gp_camera_unref (camera)); } @@ -455,14 +455,14 @@ init_gphoto2 (void) * knows that and will complain if we try to set the speed for * ports other than serial ones. Because we are paranoid here and * check every single error message returned by gphoto2, we need - * to make sure that we have a serial port. + * to make sure that we have a serial port. */ if (Cam_data.speed && !strncmp (Cam_data.port, "serial:", 7)) { - /* + /* * Not sure why we need this hack. The API keeps opening/closing * the port, and that seems to confuse the camera. Holding - * the port open seems to fix it. + * the port open seems to fix it. */ if ((hack_fd = open (Cam_data.port + 7, O_RDONLY)) < 0) { @@ -514,7 +514,7 @@ init_gphoto2 (void) } /* - * close_gphoto2() - Shutdown camera interface + * close_gphoto2() - Shutdown camera interface */ static void close_gphoto2 (void) @@ -565,7 +565,7 @@ get_info (void) } /* If we've already got a folder_list, free it up before starting - * the new one + * the new one */ if (folder_list != NULL) { @@ -613,8 +613,8 @@ get_info (void) } -/* - * erase() - erase file from camera corresponding to +/* + * erase() - erase file from camera corresponding to * current picture number. Does not update any of the other * backend data structures. */ @@ -689,7 +689,7 @@ sane_init (SANE_Int * version_code, SANE_Auth_Callback __sane_unused__ authorize /* Earlier versions why would try to keep going with compiled in * defaults if the config file is missing. But, now we have so * options and combinations of options, that success without a config - * file is unlikely. So, give and return failure + * file is unlikely. So, give and return failure */ DBG (0, "warning: %s: missing config file '%s'\n" "If you aren't using gphoto2, you should disable it in dll.conf.\n" @@ -794,7 +794,7 @@ sane_init (SANE_Int * version_code, SANE_Auth_Callback __sane_unused__ authorize /* Special case: Force port to special value for the * "Directory Browse" camera - overriding anything in * the config file - or more likely when not specified - * in the config file. + * in the config file. */ if (strcmp (Cam_data.camera_name, "Directory Browse") == 0) @@ -1086,14 +1086,14 @@ sane_control_option (SANE_Handle handle, SANE_Int option, else Cam_data.current_picture_number = Cam_data.pic_taken; - /* + /* * Setting a new image number could change image size (if * we supported that - which we hope to do someday! */ myinfo |= SANE_INFO_RELOAD_PARAMS; - /* get the image's resolution, unless the camera has no - * pictures yet + /* get the image's resolution, unless the camera has no + * pictures yet */ if (Cam_data.pic_taken != 0) { @@ -1141,7 +1141,7 @@ sane_control_option (SANE_Handle handle, SANE_Int option, if (gphoto2_opt_snap) { /* activate the resolution setting */ -/* Until we figure out how to do this +/* Until we figure out how to do this sod[GPHOTO2_OPT_LOWRES].cap &= ~SANE_CAP_INACTIVE; */ /* and de-activate the image number selector */ @@ -1151,7 +1151,7 @@ sane_control_option (SANE_Handle handle, SANE_Int option, { /* deactivate the resolution setting */ sod[GPHOTO2_OPT_LOWRES].cap |= SANE_CAP_INACTIVE; - /* and activate the image number selector, if there are + /* and activate the image number selector, if there are * pictures available */ if (Cam_data.current_picture_number) { @@ -1405,7 +1405,7 @@ sane_start (SANE_Handle handle) if (gphoto2_opt_snap) { /* - * Don't allow picture unless there is room in the + * Don't allow picture unless there is room in the * camera. */ if (Cam_data.pic_left == 0) @@ -1458,7 +1458,7 @@ sane_start (SANE_Handle handle) if ( converter_init (handle) != SANE_STATUS_GOOD ) return SANE_STATUS_INVAL; - /* Check if a linebuffer has been allocated. If we had one + /* Check if a linebuffer has been allocated. If we had one * previously, free it up and allocate one for (possibly) new * size. parms.bytes_per_line is set by converter_init() */ @@ -1588,7 +1588,7 @@ sane_get_select_fd (SANE_Handle __sane_unused__ handle, SANE_Int __sane_unused__ * get_pictures_info - load information about all pictures currently in * camera: Mainly the mapping of picture number * to picture name. We'ld like to get other - * information such as image size, but the API + * information such as image size, but the API * doesn't provide any support for that. */ static PictureInfo * @@ -1684,7 +1684,7 @@ snap_pic (void) return SANE_STATUS_INVAL; } - /* + /* * This is needed when the camera has no files and the first picture * is taken. I guess it's because a folder needs to be created and * the filesystem doesn't know about it. @@ -1699,9 +1699,9 @@ snap_pic (void) /* Can't just increment picture count, because if the camera has * zero pictures we may not know the folder name. Start over * with get_info and get_pictures_info. (We didn't have the call - * to init_gphoto2() here before, but that was causing us to not + * to init_gphoto2() here before, but that was causing us to not * see the new image - need to use a biggger hammer to get it to - * re-read the camera directory + * re-read the camera directory */ if (init_gphoto2 () != SANE_STATUS_GOOD) @@ -1772,7 +1772,7 @@ read_dir (SANE_String dir, SANE_Bool read_files) /* * read_info - read the info block from camera for the specified file - * NOT YET SUPPORTED - If it were we could use it to do things + * NOT YET SUPPORTED - If it were we could use it to do things * like update the image size parameters displayed by the GUI */ static SANE_Int @@ -1789,7 +1789,7 @@ read_info (SANE_String_Const fname) } /* - * set_res - set picture size depending on resolution settings + * set_res - set picture size depending on resolution settings */ static void set_res (SANE_Int __sane_unused__ lowres) @@ -1809,8 +1809,8 @@ set_res (SANE_Int __sane_unused__ lowres) } /* - * converter_do_scan_complete_cleanup - do everything that needs to be - * once a "scan" has been completed: Unref the file, Erase the image, + * converter_do_scan_complete_cleanup - do everything that needs to be + * once a "scan" has been completed: Unref the file, Erase the image, * and increment image number to point to next picture. */ static SANE_Status @@ -1902,17 +1902,17 @@ converter_do_scan_complete_cleanup (void) } /* - * converter_fill_buffer - Fill line buffer with next input line from image. - * Currently assumes jpeg, but this is where we would put the switch + * converter_fill_buffer - Fill line buffer with next input line from image. + * Currently assumes jpeg, but this is where we would put the switch * to handle other image types. */ static SANE_Int converter_fill_buffer (void) { -/* +/* * FIXME: Current implementation reads one scan line at a time. Part - * of the reason for this is in the original code is to give the frontend + * of the reason for this is in the original code is to give the frontend * a chance to update * the progress marker periodically. Since the gphoto2 * driver sucks in the whole image before decoding it, perhaps we could * come up with a simpler implementation. @@ -1927,8 +1927,8 @@ converter_fill_buffer (void) } /* - * converter_scan_complete - Check if all the data for the image has been read. - * Currently assumes jpeg, but this is where we would put the + * converter_scan_complete - Check if all the data for the image has been read. + * Currently assumes jpeg, but this is where we would put the * switch to handle other image types. */ static SANE_Bool @@ -1946,7 +1946,7 @@ converter_scan_complete (void) /* * converter_init - Initialize image conversion data. - * Currently assumes jpeg, but this is where we would put the + * Currently assumes jpeg, but this is where we would put the * switch to handle other image types. */ static SANE_Status diff --git a/backend/gphoto2.conf.in b/backend/gphoto2.conf.in index f5a660af8..646fa76ec 100644 --- a/backend/gphoto2.conf.in +++ b/backend/gphoto2.conf.in @@ -1,23 +1,23 @@ # Interface port where the camera is connected -# This should be one of the values returned by "gphoto2 --list-ports", +# This should be one of the values returned by "gphoto2 --list-ports", # such # as serial:/dev/ttyS6 or usb: port=serial:/dev/ttyd1 -# Port speed. This should be one of the values returned by +# Port speed. This should be one of the values returned by # "gphoto2 --abilities" speed=115200 -# Name of camera. This should be one of the values returned by +# Name of camera. This should be one of the values returned by # "gphoto2 --list-cameras" camera=Kodak DC240 -# Prints some extra information during the init phase. +# Prints some extra information during the init phase. dumpinquiry -# The resolution should be the maximum resolution supported by the +# The resolution should be the maximum resolution supported by the # camera. It's not really used for much, since the actual size will be # reported by the camera when the download starts. But it may be useful -# for the frontend to have a clue prior to the download. (e.g. it +# for the frontend to have a clue prior to the download. (e.g. it # may want to create an image window, or report the maximum file size. # Width x Height. resolution=1280x960 @@ -27,6 +27,6 @@ thumb_resolution=160x120 # top-level (fixed) folder directory in camera. Backend assumes # that there is one variable directory under this (e.g. 100DC240) -# which will be read from the camera, and all the images in the -# camera are under that. +# which will be read from the camera, and all the images in the +# camera are under that. topfolder=/DCIM diff --git a/backend/gphoto2.h b/backend/gphoto2.h index 60591cf31..b792875ae 100644 --- a/backend/gphoto2.h +++ b/backend/gphoto2.h @@ -47,12 +47,12 @@ 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. + If you do not wish that, delete this exception notice. *************************************************************************** This file implements a SANE backend for the Kodak DC-240 - digital camera. THIS IS EXTREMELY ALPHA CODE! USE AT YOUR OWN RISK!! + digital camera. THIS IS EXTREMELY ALPHA CODE! USE AT YOUR OWN RISK!! (feedback to: gphoto2-devel@fales-lorenz.net) diff --git a/backend/gt68xx.c b/backend/gt68xx.c index 13efe9101..37132cdc3 100644 --- a/backend/gt68xx.c +++ b/backend/gt68xx.c @@ -6,42 +6,42 @@ calibration code. 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. + If you do not wish that, delete this exception notice. */ /* @@ -756,7 +756,7 @@ init_options (GT68xx_Scanner * s) s->opt[OPT_SENSOR_GROUP].desc = SANE_DESC_SENSORS; s->opt[OPT_SENSOR_GROUP].type = SANE_TYPE_GROUP; s->opt[OPT_SENSOR_GROUP].constraint_type = SANE_CONSTRAINT_NONE; - + /* calibration needed */ s->opt[OPT_NEED_CALIBRATION_SW].name = "need-calibration"; s->opt[OPT_NEED_CALIBRATION_SW].title = SANE_I18N ("Need calibration"); @@ -1616,7 +1616,7 @@ sane_close (SANE_Handle handle) gt68xx_device_lamp_control (s->dev, SANE_FALSE, SANE_FALSE); dev = s->dev; - + free (s->val[OPT_MODE].s); free (s->val[OPT_GRAY_MODE_COLOR].s); free (s->val[OPT_SOURCE].s); @@ -1624,7 +1624,7 @@ sane_close (SANE_Handle handle) free ((void *)(size_t)s->opt[OPT_RESOLUTION].constraint.word_list); gt68xx_scanner_free (s); - + gt68xx_device_fix_descriptor (dev); gt68xx_device_deactivate (dev); @@ -1859,7 +1859,7 @@ sane_control_option (SANE_Handle handle, SANE_Int option, status = gt68xx_sheetfed_scanner_calibrate (s); myinfo |= SANE_INFO_RELOAD_OPTIONS; break; - + case OPT_CLEAR_CALIBRATION: gt68xx_clear_calibration (s); myinfo |= SANE_INFO_RELOAD_OPTIONS; @@ -2045,14 +2045,14 @@ sane_start (SANE_Handle handle) { /* compute scan parameters */ scan_request.calculate = SANE_TRUE; - gt68xx_device_setup_scan (s->dev, &scan_request, SA_SCAN, &scan_params); + gt68xx_device_setup_scan (s->dev, &scan_request, SA_SCAN, &scan_params); /* restore settings from calibration stored */ memcpy(s->dev->afe,&(s->afe_params), sizeof(GT68xx_AFE_Parameters)); RIE (gt68xx_assign_calibration (s, scan_params)); scan_request.calculate = SANE_FALSE; } - + /* send scan request to the scanner */ RIE (gt68xx_scanner_start_scan (s, &scan_request, &scan_params)); @@ -2331,7 +2331,7 @@ sane_cancel (SANE_Handle handle) if (s->dev->model->flags & GT68XX_FLAG_SHEET_FED) { gt68xx_device_paperfeed (s->dev); - } + } else { sanei_usb_set_timeout (SHORT_TIMEOUT); diff --git a/backend/gt68xx.conf.in b/backend/gt68xx.conf.in index 4affdcc89..f4383742c 100644 --- a/backend/gt68xx.conf.in +++ b/backend/gt68xx.conf.in @@ -6,8 +6,8 @@ # Manual configuration is necessary for some scanners. Please uncomment the # override line and optinally the vendor and product lines that apply to your -# scanner. For some scanners it's also necessary to change the name of the -# firmware file. +# scanner. For some scanners it's also necessary to change the name of the +# firmware file. ############################################################################# # For testing scanners that are not yet supported by this backend add the @@ -43,32 +43,32 @@ usb 0x05d8 0x4002 #override "mustek-scanexpress-2400-usb" # Artec Ultima 2000: -#override "artec-ultima-2000" +#override "artec-ultima-2000" #firmware "ePlus2k.usb" # Artec Ultima 2000e+: -#override "artec-ultima-2000" +#override "artec-ultima-2000" #firmware "ePlus2k.usb" #vendor "Artec" #model "Ultima 2000e+" # Boeder SmartScan Slim Edition: -#override "artec-ultima-2000" +#override "artec-ultima-2000" #vendor "Boeder" #model "SmartScan Slim Edition" # Medion/Lifetec/Tevion/Cytron MD/LT 9385: -#override "artec-ultima-2000" +#override "artec-ultima-2000" #vendor "Medion" #model "MD/LT 9385" # Medion/Lifetec/Tevion/Cytron MD 9458: -#override "artec-ultima-2000" +#override "artec-ultima-2000" #vendor "Medion" #model "MD 9458" # Trust Flat Scan USB 19200: -#override "artec-ultima-2000" +#override "artec-ultima-2000" #vendor "Trust" #model "Flat Scan USB 19200" diff --git a/backend/gt68xx.h b/backend/gt68xx.h index 20f8c6ccf..96ad41815 100644 --- a/backend/gt68xx.h +++ b/backend/gt68xx.h @@ -1,44 +1,44 @@ /* sane - Scanner Access Now Easy. Copyright (C) 2002 Sergey Vlasov - + 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. + If you do not wish that, delete this exception notice. */ #ifndef GT68XX_H diff --git a/backend/gt68xx_devices.c b/backend/gt68xx_devices.c index 1239190f8..f5735077c 100644 --- a/backend/gt68xx_devices.c +++ b/backend/gt68xx_devices.c @@ -2,44 +2,44 @@ Copyright (C) 2002 Sergey Vlasov Copyright (C) 2002 - 2007 Henning Geinitz - + 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. + If you do not wish that, delete this exception notice. */ /* Scanner-specific data */ diff --git a/backend/gt68xx_generic.c b/backend/gt68xx_generic.c index f5e5bb67a..9fd80062b 100644 --- a/backend/gt68xx_generic.c +++ b/backend/gt68xx_generic.c @@ -2,44 +2,44 @@ Copyright (C) 2002 Sergey Vlasov Copyright (C) 2005-2007 Henning Geinitz - + 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. + If you do not wish that, delete this exception notice. */ /** @file @@ -112,7 +112,7 @@ gt68xx_generic_fix_gain (SANE_Int gain) gain += 12; else if (gain > 51) gain = 63; - + return gain; } @@ -330,7 +330,7 @@ gt68xx_generic_setup_scan (GT68xx_Device * dev, request->mbs = SANE_TRUE; } } - + } else { @@ -571,7 +571,7 @@ gt68xx_generic_setup_scan (GT68xx_Device * dev, motor_mode_2 = (request->lamp ? 0 : 1) << 0; motor_mode_2 |= (line_mode ? 0 : 1) << 2; - if ((action != SA_SCAN) + if ((action != SA_SCAN) && (strcmp (dev->model->command_set->name, "mustek-gt6816") == 0)) motor_mode_2 |= 1 << 3; @@ -657,11 +657,11 @@ gt68xx_generic_move_paper (GT68xx_Device * dev, if (ydpi > model->base_ydpi) ydpi = base_ydpi; - + pixel_y0 = SANE_UNFIX ((request->y0 + model->y_offset)) * ydpi / MM_PER_INCH + 0.5; abs_y0 = pixel_y0 * base_ydpi / ydpi; - + DBG (6, "gt68xx_generic_move_paper: base_ydpi=%d\n", base_ydpi); DBG (6, "gt68xx_generic_move_paper: ydpi=%d\n", ydpi); DBG (6, "gt68xx_generic_move_paper: abs_y0=%d\n", abs_y0); diff --git a/backend/gt68xx_generic.h b/backend/gt68xx_generic.h index 01ecff96c..200897497 100644 --- a/backend/gt68xx_generic.h +++ b/backend/gt68xx_generic.h @@ -1,44 +1,44 @@ /* sane - Scanner Access Now Easy. Copyright (C) 2002 Sergey Vlasov - + 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. + If you do not wish that, delete this exception notice. */ #ifndef GT68XX_GENERIC_H diff --git a/backend/gt68xx_gt6801.c b/backend/gt68xx_gt6801.c index d61729cf6..c0a6288b6 100644 --- a/backend/gt68xx_gt6801.c +++ b/backend/gt68xx_gt6801.c @@ -3,44 +3,44 @@ Copyright (C) 2002 Sergey Vlasov GT6801 support by Andreas Nowack Copyright (C) 2002-2007 Henning Geinitz - + 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. + If you do not wish that, delete this exception notice. */ /** @file @@ -143,7 +143,7 @@ gt6801_download_firmware (GT68xx_Device * dev, * For GT6816 this was: * if (memcmp (block, check_buf, block_size) != 0) ... * Apparently the GT6801 does something different... - * + * * hmg: For my BP 1200 CU the result is 00 09 so maybe only the 0 is * relevant? */ diff --git a/backend/gt68xx_gt6801.h b/backend/gt68xx_gt6801.h index 750ce3960..d6d1ceb80 100644 --- a/backend/gt68xx_gt6801.h +++ b/backend/gt68xx_gt6801.h @@ -2,44 +2,44 @@ Copyright (C) 2002 Sergey Vlasov GT6801 support by Andreas Nowack - + 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. + If you do not wish that, delete this exception notice. */ #ifndef GT68XX_GT6801_H diff --git a/backend/gt68xx_gt6816.c b/backend/gt68xx_gt6816.c index 045194a45..a7880bdb1 100644 --- a/backend/gt68xx_gt6816.c +++ b/backend/gt68xx_gt6816.c @@ -2,44 +2,44 @@ Copyright (C) 2002 Sergey Vlasov Copyright (C) 2002-2007 Henning Geinitz - + 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. + If you do not wish that, delete this exception notice. */ /** @file diff --git a/backend/gt68xx_gt6816.h b/backend/gt68xx_gt6816.h index 7b7207196..f94181133 100644 --- a/backend/gt68xx_gt6816.h +++ b/backend/gt68xx_gt6816.h @@ -1,44 +1,44 @@ /* sane - Scanner Access Now Easy. Copyright (C) 2002 Sergey Vlasov - + 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. + If you do not wish that, delete this exception notice. */ #ifndef GT68XX_GT6816_H diff --git a/backend/gt68xx_high.c b/backend/gt68xx_high.c index 25885b058..828b977ad 100644 --- a/backend/gt68xx_high.c +++ b/backend/gt68xx_high.c @@ -7,42 +7,42 @@ calibration code. 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. + If you do not wish that, delete this exception notice. */ #include "gt68xx_high.h" @@ -560,7 +560,7 @@ gt68xx_scanner_start_scan_extended (GT68xx_Scanner * scanner, return status; } - if (scanner->dev->model->is_cis + if (scanner->dev->model->is_cis && !((scanner->dev->model->flags & GT68XX_FLAG_SHEET_FED) && scanner->calibrated == SANE_FALSE)) { status = @@ -1016,7 +1016,7 @@ struct GT68xx_Afe_Values /** Calculate average black and maximum white * * This function is used for CCD scanners. The black mark to the left ist used - * for the calculation of average black. The remaining calibration strip + * for the calculation of average black. The remaining calibration strip * is used for searching the segment whose white average is the highest. * * @param values AFE values @@ -1189,7 +1189,7 @@ finish: /* Wait for lamp to give stable brightness */ static SANE_Status -gt68xx_wait_lamp_stable (GT68xx_Scanner * scanner, +gt68xx_wait_lamp_stable (GT68xx_Scanner * scanner, GT68xx_Scan_Parameters * params, GT68xx_Scan_Request *request, unsigned int *buffer_pointers[3], @@ -2006,7 +2006,7 @@ gt68xx_calibrator_create_copy (GT68xx_Calibrator ** calibrator, return status; } - + static SANE_Status gt68xx_sheetfed_move_to_scan_area (GT68xx_Scanner * scanner, GT68xx_Scan_Request * request) @@ -2032,8 +2032,8 @@ gt68xx_sheetfed_move_to_scan_area (GT68xx_Scanner * scanner, * target (which may be a blank page). It first move to a white area then * does afe and exposure calibration. Then it scans white lines to get data * for shading correction. - * @param scanner structure describing the frontend session and the device - * @return SANE_STATUS_GOOD is everything goes right, SANE_STATUS_INVAL + * @param scanner structure describing the frontend session and the device + * @return SANE_STATUS_GOOD is everything goes right, SANE_STATUS_INVAL * otherwise. */ static SANE_Status @@ -2349,10 +2349,10 @@ gt68xx_sheetfed_scanner_calibrate (GT68xx_Scanner * scanner) /** @brief assign calibration for scan * This function creates the calibrators and set up afe for the requested - * scan. It uses calibration data that has been created by + * scan. It uses calibration data that has been created by * gt68xx_sheetfed_scanner_calibrate. - * @param scanner structure describing the frontend session and the device - * @return SANE_STATUS_GOOD is everything goes right, SANE_STATUS_INVAL + * @param scanner structure describing the frontend session and the device + * @return SANE_STATUS_GOOD is everything goes right, SANE_STATUS_INVAL * otherwise. */ static SANE_Status diff --git a/backend/gt68xx_high.h b/backend/gt68xx_high.h index d830e9654..da4ab6a69 100644 --- a/backend/gt68xx_high.h +++ b/backend/gt68xx_high.h @@ -2,44 +2,44 @@ Copyright (C) 2002 Sergey Vlasov Copyright (C) 2002-2007 Henning Geinitz - + 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. + If you do not wish that, delete this exception notice. */ #ifndef GT68XX_HIGH_H @@ -77,11 +77,11 @@ struct GT68xx_Calibrator /** Calibration data for a given resolution */ struct GT68xx_Calibration -{ +{ SANE_Int dpi; /**< optical horizontal dpi used to build the calibration data */ SANE_Int pixel_x0; /**< x start position used at calibration time */ - + GT68xx_Calibrator *gray; /**< Calibrator for grayscale data */ GT68xx_Calibrator *red; /**< Calibrator for the red channel */ GT68xx_Calibrator *green; /**< Calibrator for the green channel */ diff --git a/backend/gt68xx_low.c b/backend/gt68xx_low.c index 6060c4502..3ea459009 100644 --- a/backend/gt68xx_low.c +++ b/backend/gt68xx_low.c @@ -2,44 +2,44 @@ Copyright (C) 2002 Sergey Vlasov Copyright (C) 2002 - 2007 Henning Geinitz - + 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. + If you do not wish that, delete this exception notice. */ /** @file @@ -1023,7 +1023,7 @@ gt68xx_device_get_id (GT68xx_Device * dev) return SANE_STATUS_UNSUPPORTED; } -static void +static void gt68xx_device_fix_descriptor (GT68xx_Device * dev) { SANE_Byte data[8]; diff --git a/backend/gt68xx_low.h b/backend/gt68xx_low.h index 074323064..879bd6c04 100644 --- a/backend/gt68xx_low.h +++ b/backend/gt68xx_low.h @@ -2,44 +2,44 @@ Copyright (C) 2002 Sergey Vlasov Copyright (C) 2002 - 2007 Henning Geinitz - + 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. + If you do not wish that, delete this exception notice. */ #ifndef GT68XX_LOW_H @@ -162,7 +162,7 @@ struct GT68xx_USB_Device_Entry /** List of all supported devices. * - * This is an array of GT68xx_USB_Device_Entry structures which describe + * This is an array of GT68xx_USB_Device_Entry structures which describe * USB devices supported by this backend. The array is terminated by an * entry with model = NULL. * @@ -319,7 +319,7 @@ struct GT68xx_Command_Set SANE_Status (*lamp_control) (GT68xx_Device * dev, SANE_Bool fb_lamp, SANE_Bool ta_lamp); - /** Check whether the scanner carriage is still moving. + /** Check whether the scanner carriage is still moving. * * @param dev Device object. * @param moving Returned state of the scanner: @@ -400,7 +400,7 @@ struct GT68xx_Command_Set /** Detect if a document is inserted in the feeder * * @param dev Device object. - * @param present + * @param present */ SANE_Status (*document_present) (GT68xx_Device * dev, SANE_Bool *present); @@ -564,7 +564,7 @@ struct GT68xx_Scan_Request * * These parameters describe a low-level scan request; many such requests are * executed during calibration, and they need to have parameters separate from - * the main request (GT68xx_Scan_Request). + * the main request (GT68xx_Scan_Request). */ struct GT68xx_Scan_Parameters { @@ -883,7 +883,7 @@ static SANE_Status gt68xx_device_lamp_control (GT68xx_Device * dev, SANE_Bool fb_lamp, SANE_Bool ta_lamp); -/** Check whether the scanner carriage is still moving. +/** Check whether the scanner carriage is still moving. * * @param dev Device object. * @param moving Returned state of the scanner: @@ -1067,7 +1067,7 @@ static SANE_Status gt68xx_device_read_finish (GT68xx_Device * dev); * * @param res Result packet from the last command * @param command Command - * + * * @return * - #SANE_STATUS_GOOD - success. * - #SANE_STATUS_IO_ERROR - the command wasn't successful @@ -1076,7 +1076,7 @@ static SANE_Status gt68xx_device_check_result (GT68xx_Packet res, SANE_Byte command); -static SANE_Status +static SANE_Status gt68xx_device_get_id (GT68xx_Device * dev); /** Read the device descriptor of the scanner. @@ -1088,7 +1088,7 @@ gt68xx_device_get_id (GT68xx_Device * dev); * * @param dev device */ -static void +static void gt68xx_device_fix_descriptor (GT68xx_Device * dev); #endif /* not GT68XX_LOW_H */ diff --git a/backend/gt68xx_mid.c b/backend/gt68xx_mid.c index 130113929..0d5cbe43f 100644 --- a/backend/gt68xx_mid.c +++ b/backend/gt68xx_mid.c @@ -2,44 +2,44 @@ Copyright (C) 2002 Sergey Vlasov Copyright (C) 2002-2007 Henning Geinitz - + 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. + If you do not wish that, delete this exception notice. */ #include "gt68xx_mid.h" diff --git a/backend/gt68xx_mid.h b/backend/gt68xx_mid.h index 4ba6c4ca4..2bbaac258 100644 --- a/backend/gt68xx_mid.h +++ b/backend/gt68xx_mid.h @@ -1,44 +1,44 @@ /* sane - Scanner Access Now Easy. Copyright (C) 2002 Sergey Vlasov - + 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. + If you do not wish that, delete this exception notice. */ #ifndef GT68XX_MID_H diff --git a/backend/gt68xx_shm_channel.c b/backend/gt68xx_shm_channel.c index bca742502..496a959ba 100644 --- a/backend/gt68xx_shm_channel.c +++ b/backend/gt68xx_shm_channel.c @@ -1,44 +1,44 @@ /* sane - Scanner Access Now Easy. Copyright (C) 2002 Sergey Vlasov - + 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. + If you do not wish that, delete this exception notice. */ /** @file diff --git a/backend/gt68xx_shm_channel.h b/backend/gt68xx_shm_channel.h index c6cfdff26..54b5eca51 100644 --- a/backend/gt68xx_shm_channel.h +++ b/backend/gt68xx_shm_channel.h @@ -1,44 +1,44 @@ /* sane - Scanner Access Now Easy. Copyright (C) 2002 Sergey Vlasov - + 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. + If you do not wish that, delete this exception notice. */ #ifndef GT68XX_SHM_CHANNEL_H diff --git a/backend/hp-option.c b/backend/hp-option.c index ba799b7c3..414933f16 100644 --- a/backend/hp-option.c +++ b/backend/hp-option.c @@ -2431,7 +2431,7 @@ _program_scan_type (HpOption this, HpScsi scsi, HpOptSet optset, HpData data) sanei_hp_scl_set(scsi, SCL_TONE_MAP, -1); /* Select tone map */ } } - + return SANE_STATUS_GOOD; } diff --git a/backend/hp-scl.c b/backend/hp-scl.c index f1813c719..a7376e637 100644 --- a/backend/hp-scl.c +++ b/backend/hp-scl.c @@ -553,7 +553,7 @@ hp_scsi_close (HpScsi this, int completely) DBG(3, "scsi_close: not closing. Keep open\n"); return; } - + } assert(this->fd >= 0); diff --git a/backend/hp.README b/backend/hp.README index 756ddca2f..072722191 100644 --- a/backend/hp.README +++ b/backend/hp.README @@ -51,7 +51,7 @@ to xhp just to get a better acceptance. Test support of commands to be independant from inquired model number. - + Wed Mar 28 10:00:00 UT+1 1998 Bring it on its way to the SANE-project. Geoffrey accepted to add diff --git a/backend/hp.c b/backend/hp.c index f00b82d3f..f6a3637b1 100644 --- a/backend/hp.c +++ b/backend/hp.c @@ -73,7 +73,7 @@ static char *hp_backend_revision = "$Revision$"; Revision 1.17 2003/10/06 19:54:07 kig-guest Bug #300248: correct "Negatives" to "Negative" in option description - + V 1.04, 24-Jul-2003, PK (peter@kirchgessner.net) - Add internationalization diff --git a/backend/hp3500.c b/backend/hp3500.c index 26fe071f1..7733796a2 100644 --- a/backend/hp3500.c +++ b/backend/hp3500.c @@ -253,7 +253,7 @@ static const SANE_Device **devlist = 0; /** * Called by SANE initially. - * + * * From the SANE spec: * This function must be called before any other SANE function can be * called. The behavior of a SANE backend is undefined if this @@ -287,7 +287,7 @@ sane_init (SANE_Int * version_code, SANE_Auth_Callback authorize) /** * Called by SANE to find out about supported devices. - * + * * From the SANE spec: * This function can be used to query the list of devices that are * available. If the function executes successfully, it stores a @@ -300,7 +300,7 @@ sane_init (SANE_Int * version_code, SANE_Auth_Callback authorize) * returned (devices directly attached to the machine that SANE is * running on). If it is false, the device list includes all remote * devices that are accessible to the SANE library. - * + * * SANE does not require that this function is called before a * sane_open() call is performed. A device name may be specified * explicitly by a user which would make it unnecessary and @@ -452,7 +452,7 @@ sane_get_option_descriptor (SANE_Handle handle, SANE_Int option) /** * Gets or sets an option value. - * + * * From the SANE spec: * This function is used to set or inquire the current value of option * number n of the device represented by handle h. The manner in which @@ -463,7 +463,7 @@ sane_get_option_descriptor (SANE_Handle handle, SANE_Int option) * area pointed to by v must be big enough to hold the entire option * value (determined by member size in the corresponding option * descriptor). - * + * * The only exception to this rule is that when setting the value of a * string option, the string pointed to by argument v may be shorter * since the backend will stop reading the option value upon @@ -751,7 +751,7 @@ sane_start (SANE_Handle handle) * completion of that request. Outside of that window, the returned * values are best-effort estimates of what the parameters will be * when sane_start() gets invoked. - * + * * Calling this function before a scan has actually started allows, * for example, to get an estimate of how big the scanned image will * be. The parameters passed to this function are the handle h of the @@ -788,12 +788,12 @@ sane_get_parameters (SANE_Handle handle, SANE_Parameters * params) /** * Called by SANE to read data. - * + * * In this implementation, sane_read does nothing much besides reading * data from a pipe and handing it back. On the other end of the pipe * there's the reader process which gets data from the scanner and * stuffs it into the pipe. - * + * * From the SANE spec: * This function is used to read image data from the device * represented by handle h. Argument buf is a pointer to a memory @@ -801,7 +801,7 @@ sane_get_parameters (SANE_Handle handle, SANE_Parameters * params) * returned is stored in *len. A backend must set this to zero when * the call fails (i.e., when a status other than SANE_STATUS_GOOD is * returned). - * + * * When the call succeeds, the number of bytes returned can be * anywhere in the range from 0 to maxlen bytes. */ @@ -846,26 +846,26 @@ sane_read (SANE_Handle handle, SANE_Byte * buf, /** - * Cancels a scan. + * Cancels a scan. * * It has been said on the mailing list that sane_cancel is a bit of a * misnomer because it is routinely called to signal the end of a * batch - quoting David Mosberger-Tang: - * + * * > In other words, the idea is to have sane_start() be called, and * > collect as many images as the frontend wants (which could in turn * > consist of multiple frames each as indicated by frame-type) and - * > when the frontend is done, it should call sane_cancel(). + * > when the frontend is done, it should call sane_cancel(). * > Sometimes it's better to think of sane_cancel() as "sane_stop()" * > but that name would have had some misleading connotations as * > well, that's why we stuck with "cancel". - * + * * The current consensus regarding duplex and ADF scans seems to be * the following call sequence: sane_start; sane_read (repeat until * EOF); sane_start; sane_read... and then call sane_cancel if the * batch is at an end. I.e. do not call sane_cancel during the run but * as soon as you get a SANE_STATUS_NO_DOCS. - * + * * From the SANE spec: * This function is used to immediately or as quickly as possible * cancel the currently pending operation of the device represented by @@ -892,7 +892,7 @@ sane_cancel (SANE_Handle h) /** * Ends use of the scanner. - * + * * From the SANE spec: * This function terminates the association between the device handle * passed in argument h and the device it represents. If the device is @@ -910,7 +910,7 @@ sane_close (SANE_Handle handle) /** * Terminates the backend. - * + * * From the SANE spec: * This function must be called to terminate use of a backend. The * function will first close all device handles that still might be @@ -1149,7 +1149,7 @@ calculateDerivedValues (struct hp3500_data *scanner) DBG (12, "calculateDerivedValues\n"); - /* Convert the SANE_FIXED values for the scan area into 1/1200 inch + /* Convert the SANE_FIXED values for the scan area into 1/1200 inch * scanner units */ scanner->fullres_pixels.left = @@ -3139,7 +3139,7 @@ rts8801_fullscan (unsigned x, tg_setting = resparms[rmres].tg; rt_set_ccd_shift_clock_multiplier (regs, tg_info[tg_setting].tg_cph0p); rt_set_ccd_clock_reset_interval (regs, tg_info[tg_setting].tg_crsp); - rt_set_ccd_clamp_clock_multiplier (regs, tg_info[tg_setting].tg_cclpp); + rt_set_ccd_clamp_clock_multiplier (regs, tg_info[tg_setting].tg_cclpp); rt_set_one_register (0xc6, 0); rt_set_one_register (0xc6, 0); @@ -3386,7 +3386,7 @@ rts8801_scan (unsigned x, iCalibY = (resolution == 25) ? 1 : 2; iCalibTarget = 550; - + rt_turn_off_lamp(); for (i = 0; i < 6; ++i) @@ -3394,7 +3394,7 @@ rts8801_scan (unsigned x, aiBestOffset[i] = 0xbf; aiPassed[i] = 0; } - + do { DBG (30, "Initial calibration pass commences\n"); @@ -3405,7 +3405,7 @@ rts8801_scan (unsigned x, calib_info[i * 3] = aiBestOffset[i]; calib_info[i * 3 + 1] = aiBestOffset[i + 3]; } - + cd.buffer = calibbuf; cd.space = sizeof (calibbuf); DBG (30, "Commencing scan for initial calibration pass\n"); @@ -3453,7 +3453,7 @@ rts8801_scan (unsigned x, calib_info[i * 3 + 2] = 1; aiPassed[i] = 0; } - + do { struct dcalibdata dcdt; diff --git a/backend/hp3900_config.c b/backend/hp3900_config.c index 3c0ed77c7..830243ba4 100644 --- a/backend/hp3900_config.c +++ b/backend/hp3900_config.c @@ -243,7 +243,7 @@ enum fcsec6 CALIBOFFSET2ON, OFFSETTUNESTEP2, OFFSETBOUNDARYRATIO2, OFFSETAVGRATIO2, - + OFFSETEVEN2R, OFFSETEVEN2G, OFFSETEVEN2B, OFFSETODD2R, OFFSETODD2G, OFFSETODD2B, @@ -5622,7 +5622,7 @@ static int fitcalibrate_get(int section, int option, int defvalue) case SCANINFO: rst = fc_scaninfo_get(option, defvalue); break; } - + return rst; } diff --git a/backend/hp3900_rts8822.c b/backend/hp3900_rts8822.c index 9c8deaa2e..3e2eee7bc 100644 --- a/backend/hp3900_rts8822.c +++ b/backend/hp3900_rts8822.c @@ -13902,7 +13902,7 @@ Constrains_Check (struct st_device *dev, SANE_Int Resolution, SANE_Int scantype, struct st_coords *mycoords) { /* - Constrains: + Constrains: 100 dpi 850 x 1170 | 164 x 327 300 dpi 2550 x 3510 600 dpi 5100 x 7020 diff --git a/backend/hp4200.c b/backend/hp4200.c index 589157de0..025fbcdf9 100644 --- a/backend/hp4200.c +++ b/backend/hp4200.c @@ -5,24 +5,24 @@ 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. + Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ /* Developers: - Adrian Perez Jorge (APJ) - + Adrian Perez Jorge (APJ) - Creator of the original HP4200C backend code. adrianpj@easynews.com - - Andrew John Lewis (AJL) - + + Andrew John Lewis (AJL) - lewi0235@tc.umn.edu Arnar Mar Hrafnkelsson (AMH) - @@ -43,7 +43,7 @@ TODO: image size and the scanner-to-host bandwidth. - improve image quality. - fix problem concerning mangled images - + */ #define BUILD 2 @@ -1884,7 +1884,7 @@ prepare_for_a_scan (HP4200_Scanner * s) calculated horizontal dpi code */ hdpi_div = hdpi_mapping[hdpi_code]; - /* image_width is set to the correct number of pixels by calling + /* image_width is set to the correct number of pixels by calling fxn. This might be the reason we can't do high res full width scans though...not sure. */ /*s->user_parms.image_width /= 4; */ diff --git a/backend/hp4200.h b/backend/hp4200.h index 13c0d7fd8..154784762 100644 --- a/backend/hp4200.h +++ b/backend/hp4200.h @@ -5,15 +5,15 @@ 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. + Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef _HP4200_H diff --git a/backend/hp5400.c b/backend/hp5400.c index cfa2dc9e4..033ec1fd3 100644 --- a/backend/hp5400.c +++ b/backend/hp5400.c @@ -4,21 +4,21 @@ This file was initially copied from the hp3300 testools and adjusted to suit. Original copyright notice follows: - + Copyright (C) 2001 Bertrik Sikken (bertrik@zonnet.nl) 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. diff --git a/backend/hp5400_internal.c b/backend/hp5400_internal.c index 65a434ff3..34bf55dbd 100644 --- a/backend/hp5400_internal.c +++ b/backend/hp5400_internal.c @@ -212,10 +212,10 @@ SetCalibration (int iHandle, int numPixels, unsigned int *low_vals[3], { char cmd[8]; /* unsigned char cmd[8]; */ /* should fix the compilation warning - but I don't have a scanner right now + but I don't have a scanner right now to check that the fix does not break calibration */ - + int i, j, k; struct CalPixel { @@ -413,7 +413,7 @@ CircBufferGetLine (int iHandle, TDataPipe * p, void *pabLine) int i; int maxoff = 0; char* buftmp = (char*) (p->buffer); - + /* HP5400_DBG(DBG_MSG, "CircBufferGetLine:\n"); */ if (p->roff > maxoff) @@ -1018,7 +1018,7 @@ InitScan (enum ScanType scantype, TScanParams * pParams, struct ScanRequest req; struct ScanResponse res; int ret; - + memset(&req, 0, sizeof(req)); req.x1 = 0x08; @@ -1089,7 +1089,7 @@ InitScan2 (enum ScanType scantype, struct ScanRequest *req, req->offx = htons (0x09F8); if (htons (req->offy) > 0x0DB6) req->offy = htons (0x0DB6); - /* These tests are meaningless as htons() returns unsigned + /* These tests are meaningless as htons() returns unsigned if( htons( req->offx ) < 0 ) req->offx = 0; if( htons( req->offy ) < 0 ) req->offy = 0; */ diff --git a/backend/hp5400_sanei.c b/backend/hp5400_sanei.c index 1396cb1da..735cf0aa9 100644 --- a/backend/hp5400_sanei.c +++ b/backend/hp5400_sanei.c @@ -133,7 +133,7 @@ hp5400_open (const char *filename) sane_strstatus (status)); return -1; } - + status = sanei_usb_get_vendor_product (fd, &iVendor, &iProduct); if (status != SANE_STATUS_GOOD) { @@ -313,7 +313,7 @@ hp5400_bulk_read_block (int iHandle, int iCmd, void *cmd, int cmdlen, _UsbWriteControl (fd, iCmd, 0, cmd, cmdlen); res = len; sanei_usb_read_bulk (fd, (SANE_Byte *) buffer, &res); - HP5400_DBG (DBG_MSG, "Read block returned %lu when reading %d\n", + HP5400_DBG (DBG_MSG, "Read block returned %lu when reading %d\n", (u_long) res, len); return res; } diff --git a/backend/hp5400_xfer.h b/backend/hp5400_xfer.h index e3e823d11..b3a1cc680 100644 --- a/backend/hp5400_xfer.h +++ b/backend/hp5400_xfer.h @@ -47,7 +47,7 @@ If you do not wish that, delete this exception notice. Transport layer for communication with HP5400/5470 scanner. - + Add support for bulk transport of data - 19/02/2003 Martijn */ diff --git a/backend/hp5590.c b/backend/hp5590.c index fabf40a09..efb59f469 100644 --- a/backend/hp5590.c +++ b/backend/hp5590.c @@ -219,7 +219,7 @@ calc_image_params (struct hp5590_scanner *scanner, return SANE_STATUS_GOOD; } - + /******************************************************************************/ static SANE_Status attach_usb_device (SANE_String_Const devname, @@ -328,9 +328,9 @@ sane_init (SANE_Int * version_code, SANE_Auth_Callback __sane_unused__ authorize { SANE_Status ret; SANE_Word vendor_id, product_id; - + DBG_INIT(); - + DBG (1, "SANE backed for HP ScanJet 4500C/4570C/5500C/5550C/5590/7650 %u.%u.%u\n", SANE_CURRENT_MAJOR, V_MINOR, BUILD); DBG (1, "(c) Ilia Sotnikov \n"); @@ -456,7 +456,7 @@ sane_open (SANE_String_Const devicename, SANE_Handle * handle) ptr->br_x = ptr->info->max_size_x; ptr->br_y = ptr->info->max_size_y; ptr->dpi = res_list[1]; - ptr->depth = DEPTH_BW; + ptr->depth = DEPTH_BW; ptr->source = SOURCE_FLATBED; ptr->extend_lamp_timeout = SANE_FALSE; ptr->wait_for_button = SANE_FALSE; @@ -653,13 +653,13 @@ sane_control_option (SANE_Handle handle, SANE_Int option, SANE_Int * info) { struct hp5590_scanner *scanner = handle; - + if (!value) return SANE_STATUS_INVAL; if (!handle) return SANE_STATUS_INVAL; - + if (option >= HP5590_OPT_LAST) return SANE_STATUS_INVAL; @@ -671,10 +671,10 @@ sane_control_option (SANE_Handle handle, SANE_Int option, *((SANE_Int *) value) = HP5590_OPT_LAST; return SANE_STATUS_GOOD; } - + if (!scanner->opts) return SANE_STATUS_INVAL; - + DBG (DBG_proc, "%s: get option '%s' value\n", __func__, scanner->opts[option].name); if (option == HP5590_OPT_BR_X) @@ -770,7 +770,7 @@ sane_control_option (SANE_Handle handle, SANE_Int option, *(SANE_Bool *) value = scanner->preview; } } - + if (action == SANE_ACTION_SET_VALUE) { if (option == HP5590_OPT_NUM) @@ -914,7 +914,7 @@ sane_control_option (SANE_Handle handle, SANE_Int option, scanner->preview = *(SANE_Bool *) value; } } - + return SANE_STATUS_GOOD; } @@ -968,7 +968,7 @@ SANE_Status sane_get_parameters (SANE_Handle handle, return SANE_STATUS_INVAL; } - + DBG (DBG_proc, "format: %u, last_frame: %u, bytes_per_line: %u, " "pixels_per_line: %u, lines: %u, depth: %u\n", params->format, params->last_frame, @@ -1031,7 +1031,7 @@ sane_start (SANE_Handle handle) } } - DBG (DBG_verbose, "Init scanner\n"); + DBG (DBG_verbose, "Init scanner\n"); ret = hp5590_init_scanner (scanner->dn, scanner->proto_flags, NULL, SCANNER_NONE); if (ret != SANE_STATUS_GOOD) @@ -1047,7 +1047,7 @@ sane_start (SANE_Handle handle) scanner->extend_lamp_timeout); if (ret != SANE_STATUS_GOOD) return ret; - + ret = hp5590_set_scan_params (scanner->dn, scanner->proto_flags, scanner->info, @@ -1106,7 +1106,7 @@ sane_start (SANE_Handle handle) "(images size: %u, bytes per line: %u)\n", scanner->image_size, bytes_per_line); } - + DBG (DBG_verbose, "Final image size: %u\n", scanner->image_size); DBG (DBG_verbose, "Reverse calibration maps\n"); @@ -1201,8 +1201,8 @@ convert_to_rgb (struct hp5590_scanner *scanner, SANE_Byte *data, SANE_Int size) lines = size / bytes_per_line; bytes_per_color = bytes_per_line / 3; - - DBG (DBG_verbose, "Length : %u\n", size); + + DBG (DBG_verbose, "Length : %u\n", size); DBG (DBG_verbose, "Converting row RGB to normal RGB\n"); @@ -1242,7 +1242,7 @@ convert_to_rgb (struct hp5590_scanner *scanner, SANE_Byte *data, SANE_Int size) buf[i*6+5] = ptr[2*i+bytes_per_color*2]; } } - + /* Invert pixels in case of TMA Negatives source has been selected */ if (scanner->source == SOURCE_TMA_NEGATIVES) { @@ -1358,7 +1358,7 @@ sane_cancel (SANE_Handle handle) scanner->scanning = SANE_FALSE; if (scanner->dn < 0) - return; + return; hp5590_low_free_bulk_read_state (&scanner->bulk_read_state); diff --git a/backend/hp5590_cmds.c b/backend/hp5590_cmds.c index 06fd91a9a..000cd9860 100644 --- a/backend/hp5590_cmds.c +++ b/backend/hp5590_cmds.c @@ -179,10 +179,10 @@ struct power_resp uint16_t unk1; } __attribute__ ((packed)); -/* +/* * 215.9 mm x 297.2 mm * 8.5" x 11.72" - * + * * 50 : 425.00 x 586.00 * 75 : 637.50 x 879.50 * 100 : 850.00 x 1172.00 @@ -206,7 +206,7 @@ struct scan_params * TMA Negatives : 11 = 17 * TMA Slides : 12 = 18 * ADF : 14 = 20 - * Flatbed : 18 = 24 + * Flatbed : 18 = 24 * ADF Duplex : 54 = 84 */ @@ -263,7 +263,7 @@ struct scan_params * 50 : 06db = 1755 ; 150 * 75 : 06da = 1754 ; 150 * 100 : 06db = 1755 ; 150 - * 100 TMA : 0384 = 900 ; 150 + * 100 TMA : 0384 = 900 ; 150 * 150 : 0db6 = 3510 ; 300 * 200 : 0db6 = 3510 ; 300 * 300 : 0db6 = 3510 ; 300 @@ -321,8 +321,8 @@ struct scan_params * gray 75 : 03 50 = 848 * color 75 : 09 f0 = 2544 (3 * gray) * - * bw 100 : 00 6a = 106 - * gray 100 : 03 50 = 848 (8 * bw) + * bw 100 : 00 6a = 106 + * gray 100 : 03 50 = 848 (8 * bw) * color 100(24) : 09 f0 = 2544 (3 * gray) * color 100(48) : 13 e0 = 5088 (2 * color 24) * color 100(48) TMA : 03 f0 = 1008 @@ -428,7 +428,7 @@ hp5590_model_def (enum hp_scanner_types scanner_type, const struct hp5590_model ** model) { unsigned int i; - + hp5590_cmds_assert (model != NULL); for (i = 0; i < sizeof (hp5590_models) / sizeof (struct hp5590_model); i++) @@ -439,7 +439,7 @@ hp5590_model_def (enum hp_scanner_types scanner_type, return SANE_STATUS_GOOD; } } - + return SANE_STATUS_INVAL; } @@ -777,9 +777,9 @@ hp5590_read_max_scan_count (SANE_Int dn, } /*************************************************************************** - * + * * EEPROM contents: - * + * * 0000: 6A 11 00 00 FF FF FF FF FF FF FF FF 09 0E 0F 00 j............... * 0010: 0C 13 0F 00 00 3A 00 FF FF FF 4E 35 39 45 54 52 ..........N59ETR * 0020: 31 52 4D 00 FF FF 00 16 00 0A 00 0D 00 11 00 10 1RM............. @@ -1024,7 +1024,7 @@ hp5590_read_error_code (SANE_Int dn, SANE_Status ret; DBG (DBG_proc, "%s\n", __func__); - + hp5590_cmds_assert (sizeof (reg_03) == 3); hp5590_cmds_assert (adf_flags != NULL); @@ -1057,7 +1057,7 @@ hp5590_reset_scan_head (SANE_Int dn, SANE_Status ret; DBG (DBG_proc, "%s\n", __func__); - + ret = hp5590_turnon_lamp (dn, proto_flags, LAMP_STATE_TURNOFF); if (ret != SANE_STATUS_GOOD) return ret; @@ -2040,13 +2040,13 @@ GRAY 100 18 00 64 00 64 00 00 00 00 04 f8 06 db 00 80 00 40 08 e8 40 00 64 00 64 00 64 00 00 00 00 00 00 00 00 00 03 50 - + COLOR 100 18 00 64 00 64 00 00 00 00 04 f8 06 db 00 80 00 00 18 e8 40 00 64 00 64 00 64 00 00 00 00 00 00 00 00 00 09 f0 -COLOR 100 48bit, preview +COLOR 100 48bit, preview 18 00 64 00 64 00 00 00 00 04 f8 06 db 00 80 00 00 30 e8 40 00 64 00 64 00 64 00 00 00 00 00 00 04 00 00 13 e0 @@ -2144,7 +2144,7 @@ GRAY 400 18 02 58 02 58 00 00 00 00 13 ec 1b 6c 00 80 00 40 08 c8 40 00 64 00 64 00 64 00 00 00 00 00 00 00 00 00 13 ec - + COLOR 400 18 02 58 02 58 00 00 00 00 13 ec 1b 6c 00 80 00 00 18 c8 40 00 64 00 64 00 64 00 00 00 00 00 00 diff --git a/backend/hp5590_low.c b/backend/hp5590_low.c index 4961fd769..0c7bb8fb0 100644 --- a/backend/hp5590_low.c +++ b/backend/hp5590_low.c @@ -218,7 +218,7 @@ hp5590_get_status (SANE_Int dn, * sanei_control_msg() * bytes - pointer to data buffer * size - size of data - * core_flags - + * core_flags - * CORE_NONE - no CORE operation will be performed * CORE_DATA - operation on CORE data will be performed * CORE_BULK_IN - preparation for bulk IN transfer (not used yet) @@ -515,7 +515,7 @@ hp5590_verify_last_cmd (SANE_Int dn, * sanei_control_msg() * bytes - pointer to data buffer * size - size of data - * core_flags - + * core_flags - * CORE_NONE - no CORE operation will be performed * CORE_DATA - operation on CORE data will be performed * CORE_BULK_IN - preparation for bulk IN transfer (not used yet) @@ -751,7 +751,7 @@ hp5590_bulk_read (SANE_Int dn, } /* USB-in-USB: checking if control msg was accepted */ - ret = hp5590_get_ack (dn, proto_flags); + ret = hp5590_get_ack (dn, proto_flags); if (ret != SANE_STATUS_GOOD) return ret; } @@ -870,7 +870,7 @@ hp5590_bulk_read (SANE_Int dn, * * Returns * SANE_STATUS_GOOD - all data transferred successfully - * all other SANE_Status value - otherwise + * all other SANE_Status value - otherwise */ static SANE_Status hp5590_bulk_write (SANE_Int dn, @@ -891,7 +891,7 @@ hp5590_bulk_write (SANE_Int dn, hp5590_low_assert (bytes != NULL); - /* Prepare bulk write request */ + /* Prepare bulk write request */ memset (&bulk_size, 0, sizeof (bulk_size)); /* Counted in page size */ bulk_size.size = size / BULK_WRITE_PAGE_SIZE; diff --git a/backend/hp5590_low.h b/backend/hp5590_low.h index 5ca191de8..d1271db46 100644 --- a/backend/hp5590_low.h +++ b/backend/hp5590_low.h @@ -60,7 +60,7 @@ enum proto_flags { /* Core flags for hp5590_cmd() - they indicate so called CORE commands */ #define CORE_NONE 0 /* No CORE operation */ #define CORE_DATA 1 << 0 /* Operate on CORE data */ -#define CORE_BULK_IN 1 << 1 /* CORE bulk operation - prepare for bulk IN +#define CORE_BULK_IN 1 << 1 /* CORE bulk operation - prepare for bulk IN * transfer (not used yet) */ #define CORE_BULK_OUT 1 << 2 /* CORE bulk operation - prepare for bulk OUT diff --git a/backend/hpljm1005.c b/backend/hpljm1005.c index 9460c484f..d065044db 100644 --- a/backend/hpljm1005.c +++ b/backend/hpljm1005.c @@ -41,7 +41,7 @@ If you do not wish that, delete this exception notice. This backend is for HP LaserJet M1005 MFP - + Highly inspired from the epson backend */ @@ -177,7 +177,7 @@ static int devlist_count; /* Number of element in the list */ /* * List of pointers to devices - will be dynamically allocated depending - * on the number of devices found. + * on the number of devices found. */ static SANE_Device **devlist = NULL; @@ -193,7 +193,7 @@ update_img_size (struct device_s *dev) { int dx, dy; - /* Only update the width when not scanning, + /* Only update the width when not scanning, * otherwise the scanner give us the correct width */ if (dev->status == STATUS_SCANNING) { @@ -235,7 +235,7 @@ update_img_size (struct device_s *dev) dev->height = round2 ((dy / ((double) MAX_Y_S)) * 14025); break; } - + DBG(2,"New image size: %dx%d\n",dev->width, dev->height); } @@ -990,8 +990,8 @@ sane_start (SANE_Handle h) } -static void -do_cancel(struct device_s *dev) +static void +do_cancel(struct device_s *dev) { while (get_data (dev) == SANE_STATUS_GOOD); free (dev->buffer); @@ -1064,7 +1064,7 @@ sane_read (SANE_Handle h, SANE_Byte * buf, SANE_Int maxlen, SANE_Int * len) } /* Special case where sane_cancel is called while scanning */ - if (dev->status == STATUS_CANCELING) + if (dev->status == STATUS_CANCELING) { do_cancel(dev); return SANE_STATUS_CANCELLED; @@ -1078,7 +1078,7 @@ sane_cancel (SANE_Handle h) struct device_s *dev = (struct device_s *) h; - if (dev->status == STATUS_SCANNING) + if (dev->status == STATUS_SCANNING) { dev->status = STATUS_CANCELING; return; diff --git a/backend/hpsj5s.c b/backend/hpsj5s.c index 9c6ad7937..55218d2cb 100644 --- a/backend/hpsj5s.c +++ b/backend/hpsj5s.c @@ -1065,7 +1065,7 @@ CalibrateScanElements () SANE_Byte CurrentLowTransferBorder; SANE_Byte CurrentUpSaveBorder; SANE_Byte CurrentLowSaveBorder; - SANE_Byte CurrentSpeed1, CurrentSpeed2; + SANE_Byte CurrentSpeed1, CurrentSpeed2; SANE_Byte CorrectionValue; SANE_Byte FilteredBuffer[2570]; @@ -1174,7 +1174,7 @@ CalibrateScanElements () Temp /= 2570; if((Average == 0)||(Average > Temp)) - Average = Temp; + Average = Temp; } for(Index = 0; Index < 3; Index++) /*Three color components*/ @@ -1190,7 +1190,7 @@ CalibrateScanElements () CallFunctionWithParameter (0x92, CurrentLowTransferBorder|0x80); for(j=2999; j>0; j--) CallFunctionWithParameter (0xC6, 0); - + CurrentUpSaveBorder = arUpSaveBorders[Index]; CallFunctionWithParameter (CurrentUpSaveBorder, 0xFF); @@ -1199,9 +1199,9 @@ CalibrateScanElements () CallFunctionWithParameter (0x90,0); Calibration = 0x80; CallFunctionWithParameter (CurrentUpSaveBorder, 0x80); - + CurrentSpeed1 = CurrentSpeed2 = arSpeeds[Index]; - + for(CorrectionValue = 0x40; CorrectionValue != 0;CorrectionValue >>= 2) { CallFunctionWithParameter (0x91, CurrentSpeed2); @@ -1235,11 +1235,11 @@ CalibrateScanElements () Perhaps, we can optimize it in future.*/ WriteScannerRegister (0x91, 0); usleep(10); - + for(Temp = 0,j = 0; j < 16;j++) Temp += FilteredBuffer[509+j]; /*At this offset calcalates HP's driver.*/ Temp /= 16; - + if(Average > Temp) { Calibration += CorrectionValue; @@ -1247,7 +1247,7 @@ CalibrateScanElements () } else Calibration -= CorrectionValue; - + WriteScannerRegister (CurrentUpSaveBorder, Calibration); }/*By CorrectionValue we tune UpSaveBorder*/ diff --git a/backend/hs2p-saneopts.h b/backend/hs2p-saneopts.h index 0e712a308..938c7da7f 100644 --- a/backend/hs2p-saneopts.h +++ b/backend/hs2p-saneopts.h @@ -2,7 +2,7 @@ Copyright (C) 2007 Jeremy Johnson This file is part of a SANE backend for Ricoh IS450 and IS420 family of HS2P Scanners using the SCSI controller. - + This file is part of the SANE package. This program is free software; you can redistribute it and/or @@ -309,7 +309,7 @@ typedef enum /*OPT_CHECK_ADF, check for page in ADF before scanning */ OPT_ENHANCEMENT_GROUP, - /* OPT_ACE_FUNCTION, + /* OPT_ACE_FUNCTION, OPT_ACE_SENSITIVITY, */ OPT_BRIGHTNESS, /* Brightness */ OPT_THRESHOLD, /* Threshold */ diff --git a/backend/hs2p-scsi.c b/backend/hs2p-scsi.c index 431ba9d9e..6063acdd4 100644 --- a/backend/hs2p-scsi.c +++ b/backend/hs2p-scsi.c @@ -2,7 +2,7 @@ Copyright (C) 2007 Jeremy Johnson This file is part of a SANE backend for Ricoh IS450 and IS420 family of HS2P Scanners using the SCSI controller. - + This file is part of the SANE package. This program is free software; you can redistribute it and/or @@ -291,7 +291,7 @@ print_jis_info (struct inquiry_jis_data *jbuf) DBG (DBG_info, "[29] reserved %#02x\n", jbuf->reserved2); } -/* 1-3-1 TEST UNIT READY +/* 1-3-1 TEST UNIT READY Byte0: | 0x00 | Byte1: | 7-5 Logical Unit Number | Reserved | Byte2: | Reserved | @@ -407,8 +407,8 @@ lookup_ascq_errmsg (unsigned int code) } /* a sensible sense handler - arg is a pointer to the associated HS2P_Scanner structure - + arg is a pointer to the associated HS2P_Scanner structure + SENSE DATA FORMAT: 14 bytes bits[7-0] Byte 0: [7]:valid [6-0]:Error Code Byte 1: Segment Number @@ -488,9 +488,9 @@ sense_handler (int __sane_unused__ scsi_fd, u_char * sense_buffer, void *sd) DBG (DBG_sense, "sense_handler: ascq=(%#x,%#x): %#x '%s'\n", asc, ascq, ascq_key->codequalifier, ascq_key->description); - /* handle each sense key: Translate from HS2P message to SANE_STATUS_ message - * SANE_STATUS_GOOD, _ACCESS_DEINIED, _NO_MEM, _INVAL, _IO_ERROR, _DEVICE_BUSY, - * _EOF, _UNSUPPORTED, _CANCELLED, _JAMMED, _NO_DOCS, _COVER_OPEN + /* handle each sense key: Translate from HS2P message to SANE_STATUS_ message + * SANE_STATUS_GOOD, _ACCESS_DEINIED, _NO_MEM, _INVAL, _IO_ERROR, _DEVICE_BUSY, + * _EOF, _UNSUPPORTED, _CANCELLED, _JAMMED, _NO_DOCS, _COVER_OPEN */ switch (sense) { @@ -1436,7 +1436,7 @@ set_halftone_mask (int fd, SANE_Byte halftone_id, void *buf, cmd.dtc = DATA_TYPE_HALFTONE; _lto2b (halftone_id, cmd.dtq); - /* Each cell of an NxM dither pattern is 1 byte from the set {2,3,4,6,8,16} + /* Each cell of an NxM dither pattern is 1 byte from the set {2,3,4,6,8,16} * 0x80, 0x81 are User definable custom dither patterns */ if (halftone_id != 0x80 && halftone_id != 0x81) @@ -1547,7 +1547,7 @@ read_adf_status (int fd, SANE_Byte * adf_status_byte) /* 1-3-4 MODE SELECT */ -/* 1-3-5 Reserve Unit: 0x16 +/* 1-3-5 Reserve Unit: 0x16 * 1-3-6 Release Unit: 0x17 */ static SANE_Status @@ -1750,7 +1750,7 @@ trigger_scan (HS2P_Scanner * s) /* Transfer length is the byte length of Window List transferred * Window List is a list of Window Identifier created by SET WINDOW command * Since only 1 Window is supported by SCAN command, 0 or 1 is used for Window Identifier - * and 1 or 2 for length + * and 1 or 2 for length status = sanei_scsi_cmd (s->fd, &trigger, sizeof (trigger), &window_id_list[0], &wl_size); */ scan.cmd.len = (s->val[OPT_DUPLEX].w == SANE_TRUE) ? 2 : 1; diff --git a/backend/hs2p-scsi.h b/backend/hs2p-scsi.h index eecb60c9f..cdf227ede 100644 --- a/backend/hs2p-scsi.h +++ b/backend/hs2p-scsi.h @@ -2,7 +2,7 @@ Copyright (C) 2007 Jeremy Johnson This file is part of a SANE backend for Ricoh IS450 and IS420 family of HS2P Scanners using the SCSI controller. - + This file is part of the SANE package. This program is free software; you can redistribute it and/or @@ -56,14 +56,14 @@ /* All other status byte keys are reserved */ /* - * SCSI Command List for Command Descriptor Block + * SCSI Command List for Command Descriptor Block * All reserved bit and fields in the CDB must be zero * Values in the CDB described as "Reserved" must no be specified * The FLAG and LINK bits in the CONTROL byte must be zero * Any values in the Vendor Unique field are ignored * The Logical Unit Number in the CDB must always be zero * All Reserved bit and fields in the data fields must be zero - * Values of parameters in the data fields described as + * Values of parameters in the data fields described as * "Reserved" or "Not supported" must not be specified */ @@ -132,7 +132,7 @@ static struct sense_key sensekey_errmsg[16] = { {0x0f, "RESERVED", "Invalid"} }; -/* When Error_Code = 0x70 more detailed information is available: +/* When Error_Code = 0x70 more detailed information is available: * code, qualifier, description */ struct ASCQ @@ -219,7 +219,7 @@ static struct ASCQ ascq_errmsg[74] = { typedef struct sense_data { /* HS2P_REQUEST_SENSE_DATA */ - /* bit7:valid is 1 if information byte is valid, + /* bit7:valid is 1 if information byte is valid, bits6:0 error_code */ SANE_Byte error_code; @@ -249,10 +249,10 @@ typedef struct sense_data #define HS2P_INQUIRY_JIS_PAGE_CODE 0xF0 /* - * The EVPD and Page Code are used in pair. When the EVPD bit is 0, INQUIRY data + * The EVPD and Page Code are used in pair. When the EVPD bit is 0, INQUIRY data * in the standard format is returned to the initiator. When the EVPD bit is 1, * the EVPD information specified by each Page Code is returned in each Page Code - * data format. + * data format. * * EVPD=0x00, Page_Code=0x00 => Standard Data Format * @@ -273,7 +273,7 @@ struct inquiry_standard_data */ SANE_Byte devtype; /* must be 0x06 */ - /* bit7: repaceable media bit is set to 0 + /* bit7: repaceable media bit is set to 0 * bits6-1: reserved * bit0: EVPD */ @@ -324,21 +324,21 @@ struct inquiry_vpd_data SANE_Byte pagecode; /* Page Code => 0xC0 */ SANE_Byte byte2; /* Reserved */ SANE_Byte pagelength; /* Page Length => 12 (0x0C) */ - SANE_Byte adf_id; /* ADF Identification + SANE_Byte adf_id; /* ADF Identification * 0: No ADF is mounted * 1: Single sided ADF is mounted * 2: Double sided ADF is mounted * 3: ARDF is mounted. (Reverse double side scanning available) - * 4: Reserved + * 4: Reserved * It should be 1 or 2 with this scanner. */ - SANE_Byte end_id; /* Endorser Identification + SANE_Byte end_id; /* Endorser Identification * 0: No endorser * 1: Endorser mounted - * 2: Reserved + * 2: Reserved * It should be 0 or 1 with this scanner */ - SANE_Byte ipu_id; /* Image Processing Unit Identification + SANE_Byte ipu_id; /* Image Processing Unit Identification * bits 7:2 Reserved * bit 1 0:Extended board not mounted * 1:Extended board is mounted @@ -346,8 +346,8 @@ struct inquiry_vpd_data * 1:IPU is mounted * It should always be 0 with this scanner */ - SANE_Byte imagecomposition; /* indicates supported image data type. - * This is set to 0x37 + SANE_Byte imagecomposition; /* indicates supported image data type. + * This is set to 0x37 * bit0 => Line art supported ? 1:0 * bit1 => Dither supported ? 1:0 * bit2 => Error Diffusion supported ? 1:0 @@ -379,13 +379,13 @@ struct inquiry_vpd_data * bit0 => Marker Recognition supported ? 1:0 * bits1-7 => Reserved */ - SANE_Byte sizerecognition; /* Size Detection + SANE_Byte sizerecognition; /* Size Detection * bit0 => Size Detection Supported ? 1:0 * bits1-7 => Reserved */ SANE_Byte byte13; /* Reserved */ SANE_Byte xmaxoutputpixels[2]; /* X Maximum Output Pixel is set to 4960 (0x1360) - * indicates maximum number of pixels in the main + * indicates maximum number of pixels in the main * scanning direction that can be output by scanner */ @@ -440,8 +440,8 @@ struct inquiry_jis_data typedef struct scsi_mode_select_cmd { SANE_Byte opcode; /* 15H */ - SANE_Byte byte1; /* 7-5:LUN; 4:PF; 2:Reserved; 1:SP - * Save Page Bit must be 0 since pages cannot be saved + SANE_Byte byte1; /* 7-5:LUN; 4:PF; 2:Reserved; 1:SP + * Save Page Bit must be 0 since pages cannot be saved * Page Format Bit must be 1 */ SANE_Byte reserved[2]; SANE_Byte len; /* Parameter List Length */ @@ -538,7 +538,7 @@ typedef struct mode_page_scanning_measurement SANE_Byte len; /* Parameter Length (06H) */ SANE_Byte bmu; /* Basic Measurement Unit */ SANE_Byte reserved0; - SANE_Byte mud[2]; /* Measurement Unit Divisor + SANE_Byte mud[2]; /* Measurement Unit Divisor * produces an error if 0 * mud is fixed to 1 for millimeter or point * point is default when scanner powers on */ @@ -574,9 +574,9 @@ typedef struct mode_page_adf_control * 01H Simplex ADF * 02H Duplex ADF * 03H-FFH Reserved */ - SANE_Byte adf_mode_control; /* 7-3:Reserved; 2:Prefeed Mode Validity 1-0:Ignored + SANE_Byte adf_mode_control; /* 7-3:Reserved; 2:Prefeed Mode Validity 1-0:Ignored * Prefeed Mode "0" means invalid, "1" means valid */ - SANE_Byte medium_wait_timer; /* indicates time for scanner to wait for media. Scanner + SANE_Byte medium_wait_timer; /* indicates time for scanner to wait for media. Scanner * will send CHECK on timeout. NOT SUPPORTED */ SANE_Byte ignored[3]; } MP_ADF; /* ADF Control */ @@ -636,9 +636,9 @@ typedef struct scsi_mode_sense_cmd SANE_Byte len; /* Allocation length */ SANE_Byte control; /* 7-6:Vendor Unique; 5-2:Reserved; 1:Flag; 0:Link */ } SENSE; -/* MODE SENSE DATA FORMAT -- - * The format of Sense Data to be returned is Mode Parameter Header + Page - * see struct scsi_mode_parameter_header +/* MODE SENSE DATA FORMAT -- + * The format of Sense Data to be returned is Mode Parameter Header + Page + * see struct scsi_mode_parameter_header * struct mode_pages */ @@ -649,8 +649,8 @@ typedef struct scsi_start_scan_cmd SANE_Byte byte1; /* 7-5:LUN; 4-0:Reserved */ SANE_Byte page_code; SANE_Byte reserved; - SANE_Byte len; /* Transfer Length - * Length of Window List in bytes + SANE_Byte len; /* Transfer Length + * Length of Window List in bytes * Since scanner supports up to 2 windows, len is 1 or 2 */ SANE_Byte control; /* 7-6:Vendor Unique; 5-2:Reserved; 1:Flag; 0:Link */ @@ -847,7 +847,7 @@ struct window_section * Transfer length indicates the byte length of Window Parameters (Set Window Data Header + * Window Descriptor Bytes transferred from the initiator in the DATA OUT PHASE * The scanner supports 2 windows, so Transfer Length is 648 bytes: - * Set Window Header 8 bytes + Window Descriptor Bytes 640 (320*2) bytes). + * Set Window Header 8 bytes + Window Descriptor Bytes 640 (320*2) bytes). * If data length is longer than 648 bytes only the first 648 bytes are valid, The remainng data is ignored. * If data length is shorter than 648 only the specified byte length is valid data. * @@ -874,19 +874,19 @@ struct hs2p_window_data SANE_Byte brightness; /* 22: Brightness [0-255] dark-light 0 means default value of 128 */ SANE_Byte threshold; /* 23: Threshold [0-255] 0 means default value of 128 */ SANE_Byte contrast; /* 24: Contrast [0-255] low-high 0 means default value of 128 */ - SANE_Byte image_composition; /* 25: Image Composition + SANE_Byte image_composition; /* 25: Image Composition * 00H Lineart * 01H Dithered Halftone * 02H Gray scale */ SANE_Byte bpp; /* 26: Bits Per Pixel */ - SANE_Byte halftone_code; /* 27: Halftone Code + SANE_Byte halftone_code; /* 27: Halftone Code * 00H-01H Reserved * 02H Dither (partial Dot) * 03H Error Diffusion * 04H-07H Reserved */ - SANE_Byte halftone_id; /* 28: Halftone ID + SANE_Byte halftone_id; /* 28: Halftone ID * 00H Reserved * 01H 8x4, 45 degree * 02H 6x6, 90 degree @@ -907,7 +907,7 @@ struct hs2p_window_data * Image Composition field must be lineart or dithered halftone * RIF=0: White=0 Black=1 * RIF=1: White=1 Black=0 - * 6-3: Reserved; + * 6-3: Reserved; * 2-0: Padding Type: * 00H Reserved * 01H Pad with 0's to byte boundary @@ -940,7 +940,7 @@ struct hs2p_window_data * 100 Reserved * 110 Reserved * 111 Reserved - * 3-0: Gamma ID + * 3-0: Gamma ID * 00H Normal * 01H Soft * 02H Sharp @@ -951,7 +951,7 @@ struct hs2p_window_data */ SANE_Byte ignored3; /* 43: Ignored */ SANE_Byte ignored4; /* 44: Ignored */ - SANE_Byte binary_filtering; /* 45: Binary Filtering + SANE_Byte binary_filtering; /* 45: Binary Filtering * 0-1: Noise Removal Matrix: * 00: 3x3 * 01: 4x4 @@ -965,14 +965,14 @@ struct hs2p_window_data * Setting is ignored for reverse side because optional IPU is not valid * for reverse side scanning */ - /* + /* * The following is only available when IPU is installed: * SECTION, Automatic Separation, Automatic Binarization - * 46-319 is ignored for Window 2 + * 46-319 is ignored for Window 2 */ SANE_Byte ignored5; /* 46: Ignored */ SANE_Byte ignored6; /* 47: Ignored */ - SANE_Byte automatic_separation; /* 48: Automatic Separation + SANE_Byte automatic_separation; /* 48: Automatic Separation * 00H OFF * 01H Default * 02H-7FH Reserved @@ -980,7 +980,7 @@ struct hs2p_window_data * 91H-FFH Reserved */ SANE_Byte ignored7; /* 49: Ignored */ - SANE_Byte automatic_binarization; /* 50: Automatic Binarization + SANE_Byte automatic_binarization; /* 50: Automatic Binarization * 00H OFF * 01H Default * 02H Enhancement of light characters @@ -992,8 +992,8 @@ struct hs2p_window_data SANE_Byte ignored8[13]; /* 51-63: Ignored */ struct window_section sec[8]; /* Each window can have multiple sections, each of 32 bytes long * 53-319: = 256 bytes = 8 sections of 32 bytes - * IS450 supports up to 4 sections, - * IS420 supports up to 6 sections + * IS450 supports up to 4 sections, + * IS420 supports up to 6 sections */ }; struct set_window_cmd @@ -1031,7 +1031,7 @@ struct get_window_cmd SANE_Byte control; /* 7-6:Vendor Unique; 5-2:Reserved; 1:Flag; 0:Link */ }; /* The data format to be returned is Get Window Data header + Window Descriptor Bytes - * The format of Window Descriptor Bytes is the same as that for SET WINDOW + * The format of Window Descriptor Bytes is the same as that for SET WINDOW */ struct get_window_data_hdr { @@ -1149,9 +1149,9 @@ typedef struct maintenance_data SANE_Byte reserved2; SANE_Byte zero[2]; /* All set as 0 */ } MAINTENANCE_DATA; -/* ADF status 1byte: - * 7-3:Reserved; - * 2:Reserved; +/* ADF status 1byte: + * 7-3:Reserved; + * 2:Reserved; * 1: '0'-ADF cover closed; '1'-ADF cover open * 0: '0'-Document on ADF; '1'-No document on ADF * @@ -1164,7 +1164,7 @@ struct IPU }; struct IPU_Auto_PhotoLetter { - /* Halftone Separations for each level + /* Halftone Separations for each level * 256 steps of relative value with 0 the sharpest and 255 the softest * The relation of strength is Strength2 > Strength3 > Strength4 ... */ @@ -1173,7 +1173,7 @@ struct IPU_Auto_PhotoLetter SANE_Byte level[6]; } halftone_separation[2]; - /* 7-2:Reversed 1-0:Halftone + /* 7-2:Reversed 1-0:Halftone * 00 Default * 01 Peak Detection Soft * 10 Peak Detection Sharp @@ -1198,40 +1198,40 @@ struct IPU_Auto_PhotoLetter */ SANE_Byte byte24; - /* 7-4:Filter A; 3-0:Filter B + /* 7-4:Filter A; 3-0:Filter B * FilterA: 16 types are valid from 0000 to 1111 * FilterB: 0000 to 1110 are valid; 1111 is not valid */ SANE_Byte MTF_correction; - /* 7-4:Filter A; 3-0:Filter B + /* 7-4:Filter A; 3-0:Filter B * 0000(soft) to 0111(sharp) are valid; 1000 to 1111 are invalid */ SANE_Byte MTF_strength; - /* 7-4:Filter A; 3-0:Filter B + /* 7-4:Filter A; 3-0:Filter B * slightly adjusts the strength of the filters */ SANE_Byte MTF_adjustment; - /* 7-4:Reserved; 3-0: smoothing filter select + /* 7-4:Reserved; 3-0: smoothing filter select * 14 kinds are valid from 0000 to 1101; 1110 to 1111 are invalid */ SANE_Byte smoothing; - /* 7-2:Reversed; 1-0: Filter Select + /* 7-2:Reversed; 1-0: Filter Select * 10 MTF Correction Select * 11 Smoothing Select * from 00 to 01 are not valid and basically it is set as 10 */ SANE_Byte byte29; - /* 7-4:Reserved; 3-0: MTF Correction Filter C + /* 7-4:Reserved; 3-0: MTF Correction Filter C * 16 kinds are valid from 0000 to 1111 */ SANE_Byte MTF_correction_c; - /* 7-3:Reserved; 2-0: MTF Correction Filter strength C + /* 7-3:Reserved; 2-0: MTF Correction Filter strength C * 000(soft) to 111(sharp) are valid */ SANE_Byte MTF_strength_c; diff --git a/backend/hs2p.c b/backend/hs2p.c index de3be425e..deee3b068 100644 --- a/backend/hs2p.c +++ b/backend/hs2p.c @@ -1,6 +1,6 @@ /* sane - Scanner Access Now Easy. Copyright (C) 2007 Jeremy Johnson - This file is part of a SANE backend for Ricoh IS450 + This file is part of a SANE backend for Ricoh IS450 and IS420 family of HS2P Scanners using the SCSI controller. This file is part of the SANE package. @@ -217,8 +217,8 @@ init_options (HS2P_Scanner * s) s->val[OPT_NUM_OPTS].w = NUM_OPTIONS; - /* - * "Scan Mode" GROUP: + /* + * "Scan Mode" GROUP: */ s->opt[OPT_MODE_GROUP].name = ""; s->opt[OPT_MODE_GROUP].title = SANE_TITLE_SCAN_MODE_GROUP; @@ -311,8 +311,8 @@ init_options (HS2P_Scanner * s) - /* - * "Geometry" GROUP: + /* + * "Geometry" GROUP: */ s->opt[OPT_GEOMETRY_GROUP].name = ""; s->opt[OPT_GEOMETRY_GROUP].title = SANE_TITLE_GEOMETRY_GROUP; @@ -419,8 +419,8 @@ init_options (HS2P_Scanner * s) - /* - * "Feeder" GROUP: + /* + * "Feeder" GROUP: */ s->opt[OPT_FEEDER_GROUP].name = ""; s->opt[OPT_FEEDER_GROUP].title = SANE_TITLE_FEEDER_GROUP; @@ -493,8 +493,8 @@ init_options (HS2P_Scanner * s) /* timeout ADF */ /* timeout Manual */ - /* - * "Enhancement" GROUP: + /* + * "Enhancement" GROUP: */ s->opt[OPT_ENHANCEMENT_GROUP].name = ""; s->opt[OPT_ENHANCEMENT_GROUP].title = SANE_TITLE_ENHANCEMENT_GROUP; @@ -684,7 +684,7 @@ init_options (HS2P_Scanner * s) if (!s->hw->info.hasIPU) s->opt[OPT_AUTOBIN].cap |= SANE_CAP_INACTIVE; - /* SECTION + /* SECTION * The IS450 supports up to 4 Section; The IS420 supports up to 6 Sections * For each struct window_section[i] we need to fill in ulx,uly,width,height,etc * NOT YET IMPLEMENTED @@ -708,8 +708,8 @@ init_options (HS2P_Scanner * s) s->opt[OPT_WHITE_BALANCE].constraint_type = SANE_CONSTRAINT_NONE; s->val[OPT_WHITE_BALANCE].w = SANE_FALSE; /* F/T = Relative/Absolute White */ - /* - * "Miscellaneous" GROUP: + /* + * "Miscellaneous" GROUP: */ s->opt[OPT_MISCELLANEOUS_GROUP].name = ""; s->opt[OPT_MISCELLANEOUS_GROUP].title = SANE_TITLE_MISCELLANEOUS_GROUP; @@ -1192,7 +1192,7 @@ attach (SANE_String_Const devname, int __sane_unused__ connType, /* ipu_id: Bit0: '0'-no IPU, '1'-has IPU * Bit1: '0'-no extended board, '1'-has extended board; - * should always be 0 + * should always be 0 */ dev->info.hasIPU = (vbuf.ipu_id & 0x01) == 0x01 ? SANE_TRUE : SANE_FALSE; dev->info.hasXBD = (vbuf.ipu_id & 0x02) == 0x02 ? SANE_TRUE : SANE_FALSE; @@ -1229,8 +1229,8 @@ attach (SANE_String_Const devname, int __sane_unused__ connType, dev->sane.type = strdup (device_string); /* ACE Image Data Processing Binary Filters - * For IS450 this is set to 0x18 (0001 1000) if IPU installed, else 0x00 - * For IS420 this is set to 0x3C (0011 1100) if IPU installed, else 0x00 + * For IS450 this is set to 0x18 (0001 1000) if IPU installed, else 0x00 + * For IS420 this is set to 0x3C (0011 1100) if IPU installed, else 0x00 */ dev->info.supports_whiteframing = ((vbuf.imagedataprocessing[0] & 0x01) == 0x01) ? SANE_TRUE : SANE_FALSE; @@ -1272,16 +1272,16 @@ attach (SANE_String_Const devname, int __sane_unused__ connType, dev->info.supports_markerrecognition = ((vbuf.markerrecognition & 0x01) == 0x01) ? SANE_TRUE : SANE_FALSE; - /* Size Recognition + /* Size Recognition * For IS450 this is set to 0x01 when IPU installed; else 0x00 - * For IS420 this is set to 0x01 + * For IS420 this is set to 0x01 */ dev->info.supports_sizerecognition = ((vbuf.sizerecognition & 0x01) == 0x01) ? SANE_TRUE : SANE_FALSE; - /* X Maximum Output Pixel in main scanning direction - * For IS450 this is set to 0x1360 (4960) - * For IS420 this is set to (4880) + /* X Maximum Output Pixel in main scanning direction + * For IS450 this is set to 0x1360 (4960) + * For IS420 this is set to (4880) * [MostSignificantByte LeastSignificantByte] */ dev->info.xmaxoutputpixels = @@ -2397,7 +2397,7 @@ sane_control_option (SANE_Handle handle, SANE_Int option, return SANE_STATUS_GOOD; case OPT_SCAN_SOURCE: /* a string option */ - /* Since the scanner ejects the sheet in ADF mode + /* Since the scanner ejects the sheet in ADF mode * it is impossible to scan multiple sections in one document * In ADF mode, because of mechanical limitations: * the minimum document size is (x,y)=(69mm x 120mm) @@ -2824,7 +2824,7 @@ set_window_data (HS2P_Scanner * s, SWD * wbuf) (paddingtype[get_paddingtype_id (s->val[OPT_PADDING_TYPE].s)]. val & 0x07); - /* Bit Ordering: + /* Bit Ordering: * Manual Says DEFAULT: [1111 1111][1111 1000] * Bits15-8 reserved; * Bit7: '0'-Normal '1'-Mirroring @@ -2877,7 +2877,7 @@ set_window_data (HS2P_Scanner * s, SWD * wbuf) data->automatic_binarization = get_auto_binarization_val (s->val[OPT_AUTOBIN].s); /* fill in values for each section - for(j=0; jEOM = SANE_TRUE; - /* + /* * If status != SANE_STATUS_GOOD, then sense_handler() has already * been called and the sanei_* functions have already gotten the * sense data buffer (which apparently clears the error conditionn) @@ -3283,7 +3283,7 @@ sane_cancel (SANE_Handle handle) DBG (DBG_proc, ">> sane_cancel\n"); if (s->scanning) - { /* if batchmode is enabled, then call set_window to abort the batch + { /* if batchmode is enabled, then call set_window to abort the batch if (_OPT_VAL_WORD(s, OPT_BATCH) == SANE_TRUE) { DBG(5, "sane_cancel: calling set_window to abort batch\n"); set_window(s, BH_BATCH_ABORT); diff --git a/backend/hs2p.h b/backend/hs2p.h index 091fce201..627015401 100644 --- a/backend/hs2p.h +++ b/backend/hs2p.h @@ -2,7 +2,7 @@ Copyright (C) 2007 Jeremy Johnson This file is part of a SANE backend for Ricoh IS450 and IS420 family of HS2P Scanners using the SCSI controller. - + This file is part of the SANE package. This program is free software; you can redistribute it and/or @@ -117,8 +117,8 @@ typedef struct char inquiry_data[256]; - SANE_Byte max_win_sections; /* Number of supported window subsections - IS450 supports max of 4 sections + SANE_Byte max_win_sections; /* Number of supported window subsections + IS450 supports max of 4 sections IS420 supports max of 6 sections */ @@ -239,7 +239,7 @@ typedef struct HS2P_Device struct HS2P_Device *next; /* * struct with pointers to device/vendor/model names, and a type value - * used to inform sane frontend about the device + * used to inform sane frontend about the device */ SANE_Device sane; HS2P_Info info; diff --git a/backend/ibm-scsi.c b/backend/ibm-scsi.c index 59b42cb96..b6436bd0d 100644 --- a/backend/ibm-scsi.c +++ b/backend/ibm-scsi.c @@ -1,5 +1,5 @@ /* sane - Scanner Access Now Easy. - + This file is part of the SANE package. This program is free software; you can redistribute it and/or @@ -38,7 +38,7 @@ whether to permit this exception to apply to your modifications. If you do not wish that, delete this exception notice. */ -/* +/* */ #include @@ -62,7 +62,7 @@ /* for object_position command */ #define OBJECT_POSITION_UNLOAD 0 #define OBJECT_POSITION_LOAD 1 - + struct scsi_window_cmd { SANE_Byte opcode; SANE_Byte byte2; @@ -162,7 +162,7 @@ inquiry (int fd, void *buf, size_t * buf_size) memset (cmd, 0, sizeof (cmd)); cmd[0] = IBM_SCSI_INQUIRY; - cmd[4] = *buf_size; + cmd[4] = *buf_size; status = sanei_scsi_cmd (fd, cmd, sizeof (cmd), buf, buf_size); DBG (11, "<< inquiry\n"); @@ -266,7 +266,7 @@ set_window (int fd, struct ibm_window_data *iwd) static SANE_Status get_window (int fd, struct ibm_window_data *iwd) { - + static struct scsi_window_cmd cmd; static size_t iwd_size; SANE_Status status; @@ -343,7 +343,7 @@ get_data_status (int fd, struct scsi_status_desc *dbs) status = sanei_scsi_cmd (fd, &cmd, sizeof (cmd), &ssd, &ssd_size); memcpy (dbs, &ssd.desc, sizeof(*dbs)); - if (status == SANE_STATUS_GOOD && + if (status == SANE_STATUS_GOOD && ((unsigned int) _3btol(ssd.len) <= sizeof(*dbs) || _3btol(ssd.desc.filled) == 0)) { DBG (11, "get_data_status: busy\n"); status = SANE_STATUS_DEVICE_BUSY; diff --git a/backend/ibm.c b/backend/ibm.c index 3ab789022..e527a0400 100644 --- a/backend/ibm.c +++ b/backend/ibm.c @@ -1,5 +1,5 @@ /* sane - Scanner Access Now Easy. - + This file is part of the SANE package. This program is free software; you can redistribute it and/or @@ -157,12 +157,12 @@ attach (const char *devnam, Ibm_Device ** devp) if (!( (strncmp ((char *)ibuf.vendor, "IBM", 3) ==0 && strncmp ((char *)ibuf.product, "2456", 4) == 0) - || (strncmp ((char *)ibuf.vendor, "RICOH", 5) == 0 - && strncmp ((char *)ibuf.product, "IS420", 5) == 0) - || (strncmp ((char *)ibuf.vendor, "RICOH", 5) == 0 - && strncmp ((char *)ibuf.product, "IS410", 5) == 0) - || (strncmp ((char *)ibuf.vendor, "RICOH", 5) == 0 - && strncmp ((char *)ibuf.product, "IS430", 5) == 0) + || (strncmp ((char *)ibuf.vendor, "RICOH", 5) == 0 + && strncmp ((char *)ibuf.product, "IS420", 5) == 0) + || (strncmp ((char *)ibuf.vendor, "RICOH", 5) == 0 + && strncmp ((char *)ibuf.product, "IS410", 5) == 0) + || (strncmp ((char *)ibuf.vendor, "RICOH", 5) == 0 + && strncmp ((char *)ibuf.product, "IS430", 5) == 0) )) { DBG (1, "attach: device \"%s\" doesn't look like a scanner I know\n", @@ -213,7 +213,7 @@ attach (const char *devnam, Ibm_Device ** devp) DBG (1, "attach: MODE_SELECT failed\n"); sanei_scsi_close (fd); return (SANE_STATUS_INVAL); - } + } #endif #if 0 @@ -286,13 +286,13 @@ attach (const char *devnam, Ibm_Device ** devp) dev->info.brightness_default = wbuf.brightness; dev->info.contrast_default = wbuf.contrast; } - + /* da rivedere dev->info.adf_default = wbuf.adf_state; */ dev->info.adf_default = ADF_UNUSED; dev->info.adf_default = IBM_PAPER_USER_DEFINED; - + #if 1 dev->info.bmu = mup.bmu; dev->info.mud = _2btol(mup.mud); @@ -324,7 +324,7 @@ attach (const char *devnam, Ibm_Device ** devp) DBG (5, "brightness=%d\n", dev->info.brightness_default); DBG (5, "contrast=%d\n", dev->info.contrast_default); - + DBG (5, "adf_state=%d\n", dev->info.adf_default); DBG (5, "bmu=%d\n", dev->info.bmu); @@ -411,7 +411,7 @@ init_options (Ibm_Scanner * s) s->opt[OPT_Y_RESOLUTION].constraint_type = SANE_CONSTRAINT_RANGE; s->val[OPT_Y_RESOLUTION].w = s->hw->info.yres_default; s->opt[OPT_Y_RESOLUTION].constraint.range = &ibm2456_res_range; - + /* adf */ s->opt[OPT_ADF].name = "adf"; s->opt[OPT_ADF].title = "Use ADF"; @@ -437,7 +437,7 @@ init_options (Ibm_Scanner * s) s->opt[OPT_PAPER].constraint_type = SANE_CONSTRAINT_STRING_LIST; s->opt[OPT_PAPER].constraint.string_list = paper_list; s->val[OPT_PAPER].s = strdup (paper_list[s->hw->info.paper_default]); - + /* top-left x */ s->opt[OPT_TL_X].name = SANE_NAME_SCAN_TL_X; s->opt[OPT_TL_X].title = SANE_TITLE_SCAN_TL_X; @@ -563,7 +563,7 @@ sane_init (SANE_Int * version_code, SANE_Auth_Callback authorize) if (line[0] == '#') /* ignore line comments */ continue; len = strlen (line); - + if (!len) continue; /* ignore empty lines */ @@ -734,7 +734,7 @@ sane_control_option (SANE_Handle handle, SANE_Int option, case OPT_CONTRAST: *(SANE_Word *) val = s->val[option].w; return (SANE_STATUS_GOOD); - + /* bool options: */ case OPT_ADF: *(SANE_Bool *) val = s->val[option].b; @@ -767,7 +767,7 @@ sane_control_option (SANE_Handle handle, SANE_Int option, *info |= SANE_INFO_RELOAD_PARAMS; s->val[option].w = *(SANE_Word *) val; return (SANE_STATUS_GOOD); - + case OPT_TL_X: case OPT_TL_Y: case OPT_BR_X: @@ -785,7 +785,7 @@ sane_control_option (SANE_Handle handle, SANE_Int option, s->val[OPT_PAPER].s = strdup (paper_list[IBM_PAPER_USER_DEFINED]); } return (SANE_STATUS_GOOD); - + case OPT_NUM_OPTS: case OPT_BRIGHTNESS: case OPT_CONTRAST: @@ -799,15 +799,15 @@ sane_control_option (SANE_Handle handle, SANE_Int option, free (s->val[option].s); s->val[option].s = strdup (val); return (SANE_STATUS_GOOD); - + case OPT_ADF: s->val[option].b = *(SANE_Bool *) val; if (*(SANE_Bool *) val) s->adf_state = ADF_ARMED; - else + else s->adf_state = ADF_UNUSED; return (SANE_STATUS_GOOD); - + case OPT_PAPER: if (info && strcmp (s->val[option].s, (SANE_String) val)) *info |= SANE_INFO_RELOAD_OPTIONS | SANE_INFO_RELOAD_PARAMS; @@ -957,7 +957,7 @@ sane_start (SANE_Handle handle) s->hw->sane.name, sane_strstatus (status)); return (status); } - + mode_str = s->val[OPT_MODE].s; s->xres = s->val[OPT_X_RESOLUTION].w; s->yres = s->val[OPT_Y_RESOLUTION].w; @@ -968,7 +968,7 @@ sane_start (SANE_Handle handle) s->brightness = s->val[OPT_BRIGHTNESS].w; s->contrast = s->val[OPT_CONTRAST].w; s->bpp = s->params.depth; - if (strcmp (mode_str, SANE_VALUE_SCAN_MODE_LINEART) == 0) + if (strcmp (mode_str, SANE_VALUE_SCAN_MODE_LINEART) == 0) { s->image_composition = IBM_BINARY_MONOCHROME; } @@ -996,11 +996,11 @@ sane_start (SANE_Handle handle) wbuf.image_comp = s->image_composition; /* if you throw the MRIF bit the brighness control reverses too */ /* so I reverse the reversal in software for symmetry's sake */ - if (wbuf.image_comp == IBM_GRAYSCALE || wbuf.image_comp == IBM_DITHERED_MONOCHROME) + if (wbuf.image_comp == IBM_GRAYSCALE || wbuf.image_comp == IBM_DITHERED_MONOCHROME) { - if (wbuf.image_comp == IBM_GRAYSCALE) + if (wbuf.image_comp == IBM_GRAYSCALE) wbuf.mrif_filtering_gamma_id = (SANE_Byte) 0x80; /* it was 0x90 */ - if (wbuf.image_comp == IBM_DITHERED_MONOCHROME) + if (wbuf.image_comp == IBM_DITHERED_MONOCHROME) wbuf.mrif_filtering_gamma_id = (SANE_Byte) 0x10; wbuf.brightness = 256 - (SANE_Byte) s->brightness; /* @@ -1048,7 +1048,7 @@ sane_start (SANE_Handle handle) if (status != SANE_STATUS_GOOD) { DBG (1, "GET WINDOW failed: %s\n", sane_strstatus (status)); - return (status); + return (status); } DBG (5, "xres=%d\n", _2btol(wbuf.x_res)); DBG (5, "yres=%d\n", _2btol(wbuf.y_res)); @@ -1073,7 +1073,7 @@ sane_start (SANE_Handle handle) else mup.adf_control = 0; /* end lines by mf */ - + status = mode_select (s->fd, (struct mode_pages *) &mup); if (status != SANE_STATUS_GOOD) { @@ -1096,18 +1096,18 @@ sane_start (SANE_Handle handle) { DBG (1, "GET DATA STATUS failed: %s\n", sane_strstatus (status)); return (status); - } + } s->bytes_to_read = s->params.bytes_per_line * s->params.lines; DBG (1, "%d pixels per line, %d bytes, %d lines high, total %lu bytes, " "dpi=%d\n", s->params.pixels_per_line, s->params.bytes_per_line, s->params.lines, (u_long) s->bytes_to_read, s->val[OPT_Y_RESOLUTION].w); - + s->scanning = SANE_TRUE; - DBG (11, "<< sane_start\n"); - return (SANE_STATUS_GOOD); + DBG (11, "<< sane_start\n"); + return (SANE_STATUS_GOOD); } SANE_Status @@ -1122,7 +1122,7 @@ sane_read (SANE_Handle handle, SANE_Byte * buf, SANE_Int max_len, *len = 0; DBG (11, "sane_read: bytes left to read: %ld\n", (u_long) s->bytes_to_read); - + if (s->bytes_to_read == 0) { do_cancel (s); @@ -1132,7 +1132,7 @@ sane_read (SANE_Handle handle, SANE_Byte * buf, SANE_Int max_len, if (!s->scanning) { DBG (11, "sane_read: scanning is false!\n"); return (do_cancel (s)); - } + } nread = max_len; if (nread > s->bytes_to_read) diff --git a/backend/ibm.h b/backend/ibm.h index a10c9232a..742ebeb4d 100644 --- a/backend/ibm.h +++ b/backend/ibm.h @@ -1,5 +1,5 @@ /* sane - Scanner Access Now Easy. - + This file is part of the SANE package. This program is free software; you can redistribute it and/or @@ -154,7 +154,7 @@ static const SANE_Range default_y_range = static inline void _lto2b(SANE_Int val, SANE_Byte *bytes) - + { bytes[0] = (val >> 8) & 0xff; @@ -163,7 +163,7 @@ _lto2b(SANE_Int val, SANE_Byte *bytes) static inline void _lto3b(SANE_Int val, SANE_Byte *bytes) - + { bytes[0] = (val >> 16) & 0xff; @@ -214,7 +214,7 @@ _4btol(SANE_Byte *bytes) return (rv); } -typedef enum +typedef enum { OPT_NUM_OPTS = 0, @@ -374,7 +374,7 @@ struct measurements_units_page { }; struct mode_pages { - SANE_Byte page_code; + SANE_Byte page_code; SANE_Byte parameter_length; SANE_Byte rest[14]; /* modified by mf; it was 6; see above */ #if 0 diff --git a/backend/kodak-cmd.h b/backend/kodak-cmd.h index 9f9880e22..995d622b2 100644 --- a/backend/kodak-cmd.h +++ b/backend/kodak-cmd.h @@ -1,9 +1,9 @@ #ifndef KODAK_CMD_H #define KODAK_CMD_H -/* +/* * Part of SANE - Scanner Access Now Easy. - * + * * Please see to opening comments in kodak.c */ @@ -27,7 +27,7 @@ getnbyte (unsigned char *pnt, int nbytes) { unsigned int result = 0; int i; - + for (i = 0; i < nbytes; i++) result = (result << 8) | (pnt[i] & 0xff); return result; @@ -37,7 +37,7 @@ static void putnbyte (unsigned char *pnt, unsigned int value, unsigned int nbytes) { int i; - + for (i = nbytes - 1; i >= 0; i--) { pnt[i] = value & 0xff; value = value >> 8; @@ -398,7 +398,7 @@ putnbyte (unsigned char *pnt, unsigned int value, unsigned int nbytes) /* output */ #define set_SR_datatype_code(sb, val) sb[0x02] = val #define SR_datatype_imagedata 0x00 -#define SR_datatype_random 0x80 +#define SR_datatype_random 0x80 #define SR_datatype_imageheader 0x81 #define SR_len_imageheader 1088 @@ -416,11 +416,11 @@ putnbyte (unsigned char *pnt, unsigned int value, unsigned int nbytes) #define get_SR_ih_length(in) getnbyte(in + 23, 4) #define get_SR_ih_bpp(in) in[27] #define get_SR_ih_comp_type(in) in[28] -#define get_SR_ih_ACD(in) getbit(in + 29, 1, 5) -#define get_SR_ih_MF(in) getbit(in + 29, 1, 4) -#define get_SR_ih_RIF(in) getbit(in + 29, 1, 2) -#define get_SR_ih_ID(in) getbit(in + 29, 1, 1) -#define get_SR_ih_DE(in) getbit(in + 29, 1, 0) +#define get_SR_ih_ACD(in) getbit(in + 29, 1, 5) +#define get_SR_ih_MF(in) getbit(in + 29, 1, 4) +#define get_SR_ih_RIF(in) getbit(in + 29, 1, 2) +#define get_SR_ih_ID(in) getbit(in + 29, 1, 1) +#define get_SR_ih_DE(in) getbit(in + 29, 1, 0) #define get_SR_ih_skew_angle(in) getnbyte(in + 30, 2) #define get_SR_ih_ia_level(in) in[32] #define get_SR_ih_ia(in) getnbyte(in + 33, 60) diff --git a/backend/kodak.c b/backend/kodak.c index 73243db8e..845ad11f4 100644 --- a/backend/kodak.c +++ b/backend/kodak.c @@ -83,7 +83,7 @@ . . - sane_start() : start image acquisition . . - sane_get_parameters() : returns actual scan parameters . . - sane_read() : read image data (from pipe) - . . (sane_read called multiple times; after sane_read returns EOF, + . . (sane_read called multiple times; after sane_read returns EOF, . . loop may continue with sane_start which may return a 2nd page . . when doing duplex scans, or load the next page from the ADF) . . @@ -124,14 +124,14 @@ #include "kodak.h" #define DEBUG 1 -#define BUILD 7 +#define BUILD 7 /* values for SANE_DEBUG_KODAK env var: - errors 5 - function trace 10 - function detail 15 - get/setopt cmds 20 - - scsi cmd trace 25 + - scsi cmd trace 25 - scsi cmd detail 30 - useless noise 35 */ @@ -163,7 +163,7 @@ static struct scanner *scanner_devList = NULL; /* * Called by SANE initially. - * + * * From the SANE spec: * This function must be called before any other SANE function can be * called. The behavior of a SANE backend is undefined if this @@ -195,7 +195,7 @@ sane_init (SANE_Int * version_code, SANE_Auth_Callback authorize) /* * Called by SANE to find out about supported devices. - * + * * From the SANE spec: * This function can be used to query the list of devices that are * available. If the function executes successfully, it stores a @@ -208,7 +208,7 @@ sane_init (SANE_Int * version_code, SANE_Auth_Callback authorize) * returned (devices directly attached to the machine that SANE is * running on). If it is false, the device list includes all remote * devices that are accessible to the SANE library. - * + * * SANE does not require that this function is called before a * sane_open() call is performed. A device name may be specified * explicitly by a user which would make it unnecessary and @@ -241,41 +241,41 @@ sane_get_devices (const SANE_Device *** device_list, SANE_Bool local_only) DBG (15, "sane_get_devices: reading config file %s\n", KODAK_CONFIG_FILE); while (sanei_config_read (line, PATH_MAX, fp)) { - + lp = line; - + /* ignore comments */ if (*lp == '#') continue; - + /* skip empty lines */ if (*lp == 0) continue; - + if ((strncmp ("option", lp, 6) == 0) && isspace (lp[6])) { - + lp += 6; lp = sanei_config_skip_whitespace (lp); - + /* we allow setting buffersize too big */ if ((strncmp (lp, "buffer-size", 11) == 0) && isspace (lp[11])) { - + int buf; lp += 11; lp = sanei_config_skip_whitespace (lp); buf = atoi (lp); - + if (buf < 4096) { DBG (5, "sane_get_devices: config option \"buffer-size\" \ (%d) is < 4096, ignoring!\n", buf); continue; } - + if (buf > DEFAULT_BUFFER_SIZE) { DBG (5, "sane_get_devices: config option \"buffer-size\" \ (%d) is > %d, warning!\n", buf, DEFAULT_BUFFER_SIZE); } - + DBG (15, "sane_get_devices: setting \"buffer-size\" to %d\n", buf); global_buffer_size = buf; @@ -330,8 +330,8 @@ sane_get_devices (const SANE_Device *** device_list, SANE_Bool local_only) return SANE_STATUS_GOOD; } -/* build the scanner struct and link to global list - * unless struct is already loaded, then pretend +/* build the scanner struct and link to global list + * unless struct is already loaded, then pretend */ static SANE_Status attach_one (const char *device_name) @@ -485,9 +485,9 @@ init_inquire (struct scanner *s) set_I_evpd (cmd, 0); set_I_page_code (cmd, I_page_code_default); set_I_data_length (cmd, inLen); - + ret = do_cmd ( - s, 1, 0, + s, 1, 0, cmd, cmdLen, NULL, 0, in, &inLen @@ -648,7 +648,7 @@ init_model (struct scanner *s) s->s_mode[MODE_HALFTONE] = 1; s->s_mode[MODE_GRAYSCALE] = 1; s->s_mode[MODE_COLOR] = 1; - + /* scanner did not tell us these */ s->s_res_min[MODE_HALFTONE] = s->s_res_min[MODE_LINEART]; s->s_res_max[MODE_HALFTONE] = s->s_res_max[MODE_LINEART]; @@ -728,9 +728,9 @@ init_options (struct scanner *s) s->opt[i].cap = SANE_CAP_INACTIVE; } - /* go ahead and setup the first opt, because - * frontend may call control_option on it - * before calling get_option_descriptor + /* go ahead and setup the first opt, because + * frontend may call control_option on it + * before calling get_option_descriptor */ s->opt[OPT_NUM_OPTS].name = SANE_NAME_NUM_OPTIONS; s->opt[OPT_NUM_OPTS].title = SANE_TITLE_NUM_OPTIONS; @@ -765,7 +765,7 @@ sane_open (SANE_String_Const name, SANE_Handle * handle) time_t gmt_tt; struct tm * gmt_tm_p; struct tm * local_tm_p; - + DBG (10, "sane_open: start\n"); if(scanner_devList){ @@ -786,7 +786,7 @@ sane_open (SANE_String_Const name, SANE_Handle * handle) } else{ DBG (15, "sane_open: device %s requested\n", name); - + for (dev = scanner_devList; dev; dev = dev->next) { if (strcmp (dev->sane.name, name) == 0) { s = dev; @@ -998,7 +998,7 @@ sane_get_option_descriptor (SANE_Handle handle, SANE_Int option) s->o_mode_list[i++]=STRING_COLOR; } s->o_mode_list[i]=NULL; - + opt->name = SANE_NAME_SCAN_MODE; opt->title = SANE_TITLE_SCAN_MODE; opt->desc = SANE_DESC_SCAN_MODE; @@ -1017,13 +1017,13 @@ sane_get_option_descriptor (SANE_Handle handle, SANE_Int option) i=0; for(j=0;j<6;j++){ - if(reslist[j] >= s->s_res_min[s->u_mode] + if(reslist[j] >= s->s_res_min[s->u_mode] && reslist[j] <= s->s_res_max[s->u_mode]){ s->o_res_list[s->u_mode][++i] = reslist[j]; } } s->o_res_list[s->u_mode][0] = i; - + opt->name = SANE_NAME_SCAN_RESOLUTION; opt->title = SANE_TITLE_SCAN_RESOLUTION; opt->desc = SANE_DESC_SCAN_RESOLUTION; @@ -1049,7 +1049,7 @@ sane_get_option_descriptor (SANE_Handle handle, SANE_Int option) s->o_tl_x_range.min = SCANNER_UNIT_TO_FIXED_MM(s->s_width_min); s->o_tl_x_range.max = SCANNER_UNIT_TO_FIXED_MM(s->s_width_max); s->o_tl_x_range.quant = MM_PER_UNIT_FIX; - + opt->name = SANE_NAME_SCAN_TL_X; opt->title = SANE_TITLE_SCAN_TL_X; opt->desc = SANE_DESC_SCAN_TL_X; @@ -1067,7 +1067,7 @@ sane_get_option_descriptor (SANE_Handle handle, SANE_Int option) s->o_tl_y_range.min = SCANNER_UNIT_TO_FIXED_MM(s->s_length_min); s->o_tl_y_range.max = SCANNER_UNIT_TO_FIXED_MM(s->s_length_max); s->o_tl_y_range.quant = MM_PER_UNIT_FIX; - + opt->name = SANE_NAME_SCAN_TL_Y; opt->title = SANE_TITLE_SCAN_TL_Y; opt->desc = SANE_DESC_SCAN_TL_Y; @@ -1085,7 +1085,7 @@ sane_get_option_descriptor (SANE_Handle handle, SANE_Int option) s->o_br_x_range.min = SCANNER_UNIT_TO_FIXED_MM(s->s_width_min); s->o_br_x_range.max = SCANNER_UNIT_TO_FIXED_MM(s->s_width_max); s->o_br_x_range.quant = MM_PER_UNIT_FIX; - + opt->name = SANE_NAME_SCAN_BR_X; opt->title = SANE_TITLE_SCAN_BR_X; opt->desc = SANE_DESC_SCAN_BR_X; @@ -1103,7 +1103,7 @@ sane_get_option_descriptor (SANE_Handle handle, SANE_Int option) s->o_br_y_range.min = SCANNER_UNIT_TO_FIXED_MM(s->s_length_min); s->o_br_y_range.max = SCANNER_UNIT_TO_FIXED_MM(s->s_length_max); s->o_br_y_range.quant = MM_PER_UNIT_FIX; - + opt->name = SANE_NAME_SCAN_BR_Y; opt->title = SANE_TITLE_SCAN_BR_Y; opt->desc = SANE_DESC_SCAN_BR_Y; @@ -1236,7 +1236,7 @@ sane_get_option_descriptor (SANE_Handle handle, SANE_Int option) /** * Gets or sets an option value. - * + * * From the SANE spec: * This function is used to set or inquire the current value of option * number n of the device represented by handle h. The manner in which @@ -1247,7 +1247,7 @@ sane_get_option_descriptor (SANE_Handle handle, SANE_Int option) * area pointed to by v must be big enough to hold the entire option * value (determined by member size in the corresponding option * descriptor). - * + * * The only exception to this rule is that when setting the value of a * string option, the string pointed to by argument v may be shorter * since the backend will stop reading the option value upon @@ -1304,7 +1304,7 @@ sane_control_option (SANE_Handle handle, SANE_Int option, strcpy (val, STRING_ADFDUPLEX); } else{ - DBG(5,"missing option val for source\n"); + DBG(5,"missing option val for source\n"); } return SANE_STATUS_GOOD; @@ -1402,7 +1402,7 @@ sane_control_option (SANE_Handle handle, SANE_Int option, * below. */ switch (option) { - + /* Mode Group */ case OPT_SOURCE: if (!strcmp (val, STRING_ADFFRONT)) { @@ -1537,7 +1537,7 @@ sane_control_option (SANE_Handle handle, SANE_Int option, * completion of that request. Outside of that window, the returned * values are best-effort estimates of what the parameters will be * when sane_start() gets invoked. - * + * * Calling this function before a scan has actually started allows, * for example, to get an estimate of how big the scanned image will * be. The parameters passed to this function are the handle h of the @@ -1557,9 +1557,9 @@ sane_get_parameters (SANE_Handle handle, SANE_Parameters * params) { SANE_Status ret = SANE_STATUS_GOOD; struct scanner *s = (struct scanner *) handle; - + DBG (10, "sane_get_parameters: start\n"); - + /* started? get param data from image header */ if(s->started){ DBG (15, "sane_get_parameters: image settings:\n"); @@ -1574,7 +1574,7 @@ sane_get_parameters (SANE_Handle handle, SANE_Parameters * params) params->last_frame = 1; params->lines = s->i_length; params->pixels_per_line = s->i_width; - + /* bitonal */ if (s->i_bpp == 1) { params->format = SANE_FRAME_GRAY; @@ -1632,7 +1632,7 @@ sane_get_parameters (SANE_Handle handle, SANE_Parameters * params) DBG (15, " res=%d, user_x=%d, user_y=%d\n", s->u_res, (s->u_res * (s->u_br_x - s->u_tl_x) / 1200), (s->u_res * (s->u_br_y - s->u_tl_y) / 1200)); - + if (s->u_mode == MODE_COLOR) { params->format = SANE_FRAME_RGB; params->depth = 8; @@ -1649,7 +1649,7 @@ sane_get_parameters (SANE_Handle handle, SANE_Parameters * params) params->last_frame = 1; params->lines = s->u_res * (s->u_br_y - s->u_tl_y) / 1200; params->pixels_per_line = s->u_res * (s->u_br_x - s->u_tl_x) / 1200; - + /* bytes per line differs by mode */ if (s->u_mode == MODE_COLOR) { params->bytes_per_line = params->pixels_per_line * 3; @@ -1662,16 +1662,16 @@ sane_get_parameters (SANE_Handle handle, SANE_Parameters * params) } } - + DBG (15, "sane_get_parameters: returning:\n"); - DBG (15, " scan_x=%d, Bpl=%d, depth=%d\n", + DBG (15, " scan_x=%d, Bpl=%d, depth=%d\n", params->pixels_per_line, params->bytes_per_line, params->depth ); - - DBG (15, " scan_y=%d, frame=%d, last=%d\n", + + DBG (15, " scan_y=%d, frame=%d, last=%d\n", params->lines, params->format, params->last_frame ); DBG (10, "sane_get_parameters: finish\n"); - + return ret; } @@ -1680,7 +1680,7 @@ sane_get_parameters (SANE_Handle handle, SANE_Parameters * params) * commands: scanner control (lampon), send (lut), send (dither), * set window, object pos, and scan * - * this will be called before each image, including duplex backsides, + * this will be called before each image, including duplex backsides, * and at the start of adf batch. * hence, we spend alot of time playing with s->started, etc. */ @@ -1716,7 +1716,7 @@ sane_start (SANE_Handle handle) do_cancel(s); return ret; } - + /* read/send JQ command */ /* read/send SC command */ @@ -1726,13 +1726,13 @@ sane_start (SANE_Handle handle) do_cancel(s); return ret; } - + /* read/send CT command */ DBG (15, "sane_start: send SCAN\n"); memset(cmd, 0, SCAN_len); set_SCSI_opcode(cmd, SCAN_code); - + ret = do_cmd ( s, 1, 0, cmd, SCAN_len, @@ -1752,11 +1752,11 @@ sane_start (SANE_Handle handle) set_SR_datatype_code(cmd,SR_datatype_random); set_SR_datatype_qual(cmd,SR_qual_startstop); set_SR_xfer_length(cmd,SR_len_startstop); - + memset(pay,0,SR_len_startstop); set_SR_payload_len(pay,SR_len_startstop); set_SR_startstop_cmd(pay,1); - + ret = do_cmd ( s, 1, 0, cmd, SEND_len, @@ -1786,7 +1786,7 @@ sane_start (SANE_Handle handle) /* make large buffer to hold the images */ DBG (15, "sane_start: setup buffer\n"); - + /* free current buffer if too small */ if (s->buffer && s->bytes_buf < s->i_bytes) { DBG (15, "sane_start: free buffer.\n"); @@ -1794,7 +1794,7 @@ sane_start (SANE_Handle handle) s->buffer = NULL; s->bytes_buf = 0; } - + /* grab new buffer if dont have one */ if (!s->buffer) { DBG (15, "sane_start: calloc buffer.\n"); @@ -1827,7 +1827,7 @@ set_window (struct scanner *s) unsigned char cmd[SET_WINDOW_len]; size_t cmdLen = SET_WINDOW_len; - /* the data phase has a header, followed by a window desc block + /* the data phase has a header, followed by a window desc block * the header specifies the number of bytes in 1 window desc block */ unsigned char pay[WINDOW_HEADER_len + WINDOW_DESCRIPTOR_len]; size_t payLen = WINDOW_HEADER_len + WINDOW_DESCRIPTOR_len; @@ -2059,7 +2059,7 @@ send_sc(struct scanner *s) set_SR_datatype_code(cmd,SR_datatype_random); set_SR_datatype_qual(cmd,SR_qual_config); set_SR_xfer_length(cmd,SR_len_config); - + ret = do_cmd ( s, 1, 0, cmd, cmdLen, @@ -2077,7 +2077,7 @@ send_sc(struct scanner *s) set_SR_datatype_code(cmd,SR_datatype_random); set_SR_datatype_qual(cmd,SR_qual_config); set_SR_xfer_length(cmd,payLen); - + if(s->u_source == SOURCE_ADF_FRONT){ if(s->u_mode == MODE_COLOR || s->u_mode == MODE_GRAYSCALE){ set_SR_sc_io1(pay,SR_sc_io_front_color); @@ -2150,7 +2150,7 @@ read_imageheader (struct scanner *s) set_SR_xfer_length(cmd,SR_len_imageheader); while (pass++ < 1000){ - + DBG (15, "read_imageheader: pass %d\n", pass); payLen = SR_len_imageheader; @@ -2174,34 +2174,34 @@ read_imageheader (struct scanner *s) if (ret == SANE_STATUS_GOOD){ DBG (15, "image header:\n"); - + DBG (15, " bytes: %d\n",get_SR_ih_image_length(pay)); s->i_bytes = get_SR_ih_image_length(pay); - + DBG (15, " id: %d\n",get_SR_ih_image_id(pay)); s->i_id = get_SR_ih_image_id(pay); - + DBG (15, " dpi: %d\n",get_SR_ih_resolution(pay)); s->i_dpi = get_SR_ih_resolution(pay); - + DBG (15, " tlx: %d\n",get_SR_ih_ulx(pay)); s->i_tlx = get_SR_ih_ulx(pay); - + DBG (15, " tly: %d\n",get_SR_ih_uly(pay)); s->i_tly = get_SR_ih_uly(pay); - + DBG (15, " width: %d\n",get_SR_ih_width(pay)); s->i_width = get_SR_ih_width(pay); - + DBG (15, " length: %d\n",get_SR_ih_length(pay)); s->i_length = get_SR_ih_length(pay); - + DBG (15, " bpp: %d\n",get_SR_ih_bpp(pay)); s->i_bpp = get_SR_ih_bpp(pay); - + DBG (15, " comp: %d\n",get_SR_ih_comp_type(pay)); s->i_compr = get_SR_ih_comp_type(pay); - + /*FIXME: there are alot more of these?*/ } @@ -2212,7 +2212,7 @@ read_imageheader (struct scanner *s) /* * Called by SANE to read data. - * + * * From the SANE spec: * This function is used to read image data from the device * represented by handle h. Argument buf is a pointer to a memory @@ -2220,7 +2220,7 @@ read_imageheader (struct scanner *s) * returned is stored in *len. A backend must set this to zero when * the call fails (i.e., when a status other than SANE_STATUS_GOOD is * returned). - * + * * When the call succeeds, the number of bytes returned can be * anywhere in the range from 0 to maxlen bytes. */ @@ -2270,12 +2270,12 @@ read_from_scanner(struct scanner *s) int remain = s->i_bytes - s->bytes_rx; unsigned char * buf; size_t inLen = 0; - + unsigned char cmd[READ_len]; int cmdLen=READ_len; DBG (10, "read_from_scanner: start\n"); - + memset(cmd, 0, cmdLen); set_SCSI_opcode(cmd, READ_code); @@ -2283,32 +2283,32 @@ read_from_scanner(struct scanner *s) if(bytes > remain){ bytes = remain; } - + DBG(15, "read_from_scanner: to:%d rx:%d re:%d bu:%d pa:%d\n", s->i_bytes, s->bytes_rx, remain, s->buffer_size, bytes); - + if(ret){ return ret; } - + inLen = bytes; - + buf = malloc(bytes); if(!buf){ DBG(5, "read_from_scanner: not enough mem for buffer: %d\n",bytes); return SANE_STATUS_NO_MEM; } - + set_SR_datatype_code (cmd, SR_datatype_imagedata); set_SR_xfer_length (cmd, bytes); - + ret = do_cmd ( s, 1, 0, cmd, cmdLen, NULL, 0, buf, &inLen ); - + if (ret == SANE_STATUS_GOOD) { DBG(15, "read_from_scanner: got GOOD, returning GOOD\n"); } @@ -2324,13 +2324,13 @@ read_from_scanner(struct scanner *s) DBG(5, "read_from_scanner: error reading data block status = %d\n",ret); inLen = 0; } - + if(inLen){ copy_buffer (s, buf, inLen); } - + free(buf); - + if(ret == SANE_STATUS_EOF){ DBG (5, "read_from_scanner: unexpected EOF, shortening image\n"); s->i_bytes = s->bytes_rx; @@ -2338,7 +2338,7 @@ read_from_scanner(struct scanner *s) } DBG (10, "read_from_scanner: finish\n"); - + return ret; } @@ -2364,31 +2364,31 @@ read_from_buffer(struct scanner *s, SANE_Byte * buf, SANE_Status ret=SANE_STATUS_GOOD; int bytes = max_len; int remain = s->bytes_rx - s->bytes_tx; - + DBG (10, "read_from_buffer: start\n"); - + /* figure out the max amount to transfer */ if(bytes > remain){ bytes = remain; } - + *len = bytes; - + DBG(15, "read_from_buffer: to:%d tx:%d re:%d bu:%d pa:%d\n", s->i_bytes, s->bytes_tx, remain, max_len, bytes); - + /*FIXME this needs to timeout eventually */ if(!bytes){ DBG(5,"read_from_buffer: nothing to do\n"); return SANE_STATUS_GOOD; } - + memcpy(buf,s->buffer+s->bytes_tx,bytes); - + s->bytes_tx += *len; - + DBG (10, "read_from_buffer: finish\n"); - + return ret; } @@ -2397,26 +2397,26 @@ read_from_buffer(struct scanner *s, SANE_Byte * buf, * @@ Section 4 - SANE cleanup functions */ /* - * Cancels a scan. + * Cancels a scan. * * It has been said on the mailing list that sane_cancel is a bit of a * misnomer because it is routinely called to signal the end of a * batch - quoting David Mosberger-Tang: - * + * * > In other words, the idea is to have sane_start() be called, and * > collect as many images as the frontend wants (which could in turn * > consist of multiple frames each as indicated by frame-type) and - * > when the frontend is done, it should call sane_cancel(). + * > when the frontend is done, it should call sane_cancel(). * > Sometimes it's better to think of sane_cancel() as "sane_stop()" * > but that name would have had some misleading connotations as * > well, that's why we stuck with "cancel". - * + * * The current consensus regarding duplex and ADF scans seems to be * the following call sequence: sane_start; sane_read (repeat until * EOF); sane_start; sane_read... and then call sane_cancel if the * batch is at an end. I.e. do not call sane_cancel during the run but * as soon as you get a SANE_STATUS_NO_DOCS. - * + * * From the SANE spec: * This function is used to immediately or as quickly as possible * cancel the currently pending operation of the device represented by @@ -2459,7 +2459,7 @@ do_cancel (struct scanner *s) /* * Ends use of the scanner. - * + * * From the SANE spec: * This function terminates the association between the device handle * passed in argument h and the device it represents. If the device is @@ -2495,7 +2495,7 @@ disconnect_fd (struct scanner *s) /* * Terminates the backend. - * + * * From the SANE spec: * This function must be called to terminate use of a backend. The * function will first close all device handles that still might be @@ -2721,9 +2721,9 @@ do_rs(scanner * s) SANE_Status ret; unsigned char cmd[REQUEST_SENSE_len]; size_t cmdLen = REQUEST_SENSE_len; - + DBG (10, "do_rs: start\n"); - + memset(cmd,0,cmdLen); set_SCSI_opcode(cmd,REQUEST_SENSE_code); set_SR_datatype_code(cmd,SR_datatype_random); @@ -2792,7 +2792,7 @@ do_cmd(struct scanner *s, int runRS, int shortTime, #if 0 /* unused */ static SANE_Status -wait_scanner(struct scanner *s) +wait_scanner(struct scanner *s) { int ret; @@ -2810,7 +2810,7 @@ wait_scanner(struct scanner *s) NULL, 0, NULL, NULL ); - + if (ret != SANE_STATUS_GOOD) { DBG(5,"WARNING: Brain-dead scanner. Hitting with stick\n"); ret = do_cmd ( diff --git a/backend/kodak.h b/backend/kodak.h index ea2a3e472..31c571235 100644 --- a/backend/kodak.h +++ b/backend/kodak.h @@ -1,12 +1,12 @@ #ifndef KODAK_H #define KODAK_H -/* +/* * Part of SANE - Scanner Access Now Easy. * Please see opening comment in kodak.c */ -/* ------------------------------------------------------------------------- +/* ------------------------------------------------------------------------- * This option list has to contain all options for all scanners supported by * this driver. If a certain scanner cannot handle a certain option, there's * still the possibility to say so, later. diff --git a/backend/kodakaio.c b/backend/kodakaio.c index a9bec7b7b..c8cc9a711 100644 --- a/backend/kodakaio.c +++ b/backend/kodakaio.c @@ -3,7 +3,7 @@ * * Copyright (C) 2011-2017 Paul Newall * - * Based on the Magicolor sane backend: + * Based on the Magicolor sane backend: * Based on the epson2 sane backend: * Based on Kazuhiro Sasayama previous * work on epson.[ch] file from the SANE package. @@ -16,13 +16,13 @@ * Modified 30/12/14 to fix bug where network connection was broken after 30s of idle time. * The connection is now made in sane_start and ended in sane_cancel. - * 01/01/13 Now with adf, the scan can be padded to make up the full page length, + * 01/01/13 Now with adf, the scan can be padded to make up the full page length, * or the page can terminate at the end of the paper. This is a selectable option. * 25/11/12 Using avahi now for net autodiscovery. Use configure option --enable-avahi * 1/5/17 patched to use local pointer for avahi callback */ -/* +/* Packages to add to a clean ubuntu install libavahi-common-dev libusb-dev @@ -45,7 +45,7 @@ If you want to use the test backend, for example with sane-troubleshoot, you sho */ /* SANE-FLOW-DIAGRAM Kodakaio commands in [] brackets - + - sane_init() : initialize backend, attach scanners(devicename,0) . - sane_get_devices() : query list of scanner-devices . - sane_open() : open a particular scanner-device and attach_scanner(devicename,&dev) @@ -58,7 +58,7 @@ If you want to use the test backend, for example with sane-troubleshoot, you sho . . - sane_get_parameters() : returns actual scan-parameters . . - sane_read() : read image-data (from pipe) . . - sane_cancel() : cancel operation, kill reader_process [(F), U] - + . - sane_close() : close opened scanner-device, do_cancel, free buffer and handle - sane_exit() : terminate use of backend, free devicename and device-struture */ @@ -169,7 +169,7 @@ In terminal use: export SANE_DEBUG_KODAKAIO=40 to set the level to 40 or whateve level you want. Then you can scan with scanimage or simple-scan from terminal and see debug info -use these defines to promote certain functions that you are interested in +use these defines to promote certain functions that you are interested in define low values to make detail of a section appear when DBG level is low define a high value eg 99 to get normal behaviour. */ #define DBG_READ 99 @@ -248,7 +248,7 @@ FILE *RawScan = NULL; char RawScanPath[] = ""; /* empty path means no raw scan file is made */ /* - * Devices supported by this backend + * Devices supported by this backend */ /* kodak command strings */ @@ -286,7 +286,7 @@ The following are not used but may be in future commandtype, max depth, pointer to depth list */ -/* list of cap data the first scanner is the default +/* list of cap data the first scanner is the default */ /* KODAK AIO DEFAULT, */ { @@ -295,7 +295,7 @@ commandtype, max depth, pointer to depth list 600, {75, 600, 0}, kodakaio_resolution_list, 4, /* 600 dpi max, 4 resolutions */ 8, kodakaio_depth_list, /* color depth max 8, list above */ {0, SANE_FIX(8.5 * MM_PER_INCH), 0}, {0, SANE_FIX(11.7 * MM_PER_INCH), 0}, /* FBF x/y ranges */ - SANE_FALSE, SANE_FALSE, /* ADF, duplex */ + SANE_FALSE, SANE_FALSE, /* ADF, duplex */ {0, SANE_FIX(100), 0}, {0, SANE_FIX(100), 0} /* ADF x/y ranges (TODO!) */ }, /* KODAK ESP 5100, */ @@ -305,7 +305,7 @@ commandtype, max depth, pointer to depth list 600, {75, 600, 0}, kodakaio_resolution_list, 4, /* 600 dpi max, 4 resolutions */ 8, kodakaio_depth_list, /* color depth max 8, list above */ {0, SANE_FIX(8.5 * MM_PER_INCH), 0}, {0, SANE_FIX(11.7 * MM_PER_INCH), 0}, /* FBF x/y ranges */ - SANE_FALSE, SANE_FALSE, /* ADF, duplex */ + SANE_FALSE, SANE_FALSE, /* ADF, duplex */ {0, SANE_FIX(8.5 * MM_PER_INCH), 0}, {0, SANE_FIX(14 * MM_PER_INCH), 0} /* 14 ADF x/y ranges */ }, /* KODAK ESP 5300, */ @@ -315,7 +315,7 @@ commandtype, max depth, pointer to depth list 600, {75, 600, 0}, kodakaio_resolution_list, 4, /* 600 dpi max, 4 resolutions */ 8, kodakaio_depth_list, /* color depth max 8, list above */ {0, SANE_FIX(8.5 * MM_PER_INCH), 0}, {0, SANE_FIX(11.7 * MM_PER_INCH), 0}, /* FBF x/y ranges */ - SANE_FALSE, SANE_FALSE, /* ADF, duplex */ + SANE_FALSE, SANE_FALSE, /* ADF, duplex */ {0, SANE_FIX(8.5 * MM_PER_INCH), 0}, {0, SANE_FIX(14 * MM_PER_INCH), 0} /* 14 ADF x/y ranges */ }, /* KODAK ESP 5500, */ @@ -325,7 +325,7 @@ commandtype, max depth, pointer to depth list 600, {75, 600, 0}, kodakaio_resolution_list, 4, /* 600 dpi max, 4 resolutions */ 8, kodakaio_depth_list, /* color depth max 8, list above */ {0, SANE_FIX(8.5 * MM_PER_INCH), 0}, {0, SANE_FIX(11.7 * MM_PER_INCH), 0}, /* FBF x/y ranges */ - SANE_FALSE, SANE_FALSE, /* ADF, duplex */ + SANE_FALSE, SANE_FALSE, /* ADF, duplex */ {0, SANE_FIX(8.5 * MM_PER_INCH), 0}, {0, SANE_FIX(14 * MM_PER_INCH), 0} /* 14 ADF x/y ranges */ }, /* KODAK ESP 5000, */ @@ -335,7 +335,7 @@ commandtype, max depth, pointer to depth list 600, {75, 600, 0}, kodakaio_resolution_list, 4, /* 600 dpi max, 4 resolutions */ 8, kodakaio_depth_list, /* color depth max 8, list above */ {0, SANE_FIX(8.5 * MM_PER_INCH), 0}, {0, SANE_FIX(11.7 * MM_PER_INCH), 0}, /* FBF x/y ranges */ - SANE_FALSE, SANE_FALSE, /* ADF, duplex */ + SANE_FALSE, SANE_FALSE, /* ADF, duplex */ {0, SANE_FIX(8.5 * MM_PER_INCH), 0}, {0, SANE_FIX(14 * MM_PER_INCH), 0} /* 14 ADF x/y ranges */ }, /* KODAK ESP 3300, */ @@ -345,7 +345,7 @@ commandtype, max depth, pointer to depth list 600, {75, 600, 0}, kodakaio_resolution_list, 4, /* 600 dpi max, 4 resolutions */ 8, kodakaio_depth_list, /* color depth max 8, list above */ {0, SANE_FIX(8.5 * MM_PER_INCH), 0}, {0, SANE_FIX(11.7 * MM_PER_INCH), 0}, /* FBF x/y ranges */ - SANE_FALSE, SANE_FALSE, /* ADF, duplex */ + SANE_FALSE, SANE_FALSE, /* ADF, duplex */ {0, SANE_FIX(8.5 * MM_PER_INCH), 0}, {0, SANE_FIX(14 * MM_PER_INCH), 0} /* 14 ADF x/y ranges */ }, /* KODAK ESP5, */ @@ -355,7 +355,7 @@ commandtype, max depth, pointer to depth list 600, {75, 600, 0}, kodakaio_resolution_list, 4, /* 600 dpi max, 4 resolutions */ 8, kodakaio_depth_list, /* color depth max 8, list above */ {0, SANE_FIX(8.5 * MM_PER_INCH), 0}, {0, SANE_FIX(11.7 * MM_PER_INCH), 0}, /* FBF x/y ranges */ - SANE_FALSE, SANE_FALSE, /* ADF, duplex */ + SANE_FALSE, SANE_FALSE, /* ADF, duplex */ {0, SANE_FIX(8.5 * MM_PER_INCH), 0}, {0, SANE_FIX(14 * MM_PER_INCH), 0} /* 14 ADF x/y ranges */ }, /* KODAK ESP7, */ @@ -365,7 +365,7 @@ commandtype, max depth, pointer to depth list 600, {75, 600, 0}, kodakaio_resolution_list, 4, /* 600 dpi max, 4 resolutions */ 8, kodakaio_depth_list, /* color depth max 8, list above */ {0, SANE_FIX(8.5 * MM_PER_INCH), 0}, {0, SANE_FIX(11.7 * MM_PER_INCH), 0}, /* FBF x/y ranges */ - SANE_FALSE, SANE_FALSE, /* ADF, duplex */ + SANE_FALSE, SANE_FALSE, /* ADF, duplex */ {0, SANE_FIX(8.5 * MM_PER_INCH), 0}, {0, SANE_FIX(14 * MM_PER_INCH), 0} /* 14 ADF x/y ranges */ }, /* KODAK ESP9, */ @@ -375,7 +375,7 @@ commandtype, max depth, pointer to depth list 600, {75, 600, 0}, kodakaio_resolution_list, 4, /* 600 dpi max, 4 resolutions */ 8, kodakaio_depth_list, /* color depth max 8, list above */ {0, SANE_FIX(8.5 * MM_PER_INCH), 0}, {0, SANE_FIX(11.7 * MM_PER_INCH), 0}, /* FBF x/y ranges */ - SANE_FALSE, SANE_FALSE, /* ADF, duplex */ + SANE_FALSE, SANE_FALSE, /* ADF, duplex */ {0, SANE_FIX(8.5 * MM_PER_INCH), 0}, {0, SANE_FIX(14 * MM_PER_INCH), 0} /* 14 ADF x/y ranges */ }, /* KODAK ESP5210 or 5250, */ @@ -385,7 +385,7 @@ commandtype, max depth, pointer to depth list 600, {75, 600, 0}, kodakaio_resolution_list, 4, /* 600 dpi max, 4 resolutions */ 8, kodakaio_depth_list, /* color depth max 8, list above */ {0, SANE_FIX(8.5 * MM_PER_INCH), 0}, {0, SANE_FIX(11.7 * MM_PER_INCH), 0}, /* FBF x/y ranges */ - SANE_FALSE, SANE_FALSE, /* ADF, duplex */ + SANE_FALSE, SANE_FALSE, /* ADF, duplex */ {0, SANE_FIX(8.5 * MM_PER_INCH), 0}, {0, SANE_FIX(14 * MM_PER_INCH), 0} /* 14 ADF x/y ranges */ }, /* KODAK ESP3200 , */ @@ -395,7 +395,7 @@ commandtype, max depth, pointer to depth list 600, {75, 600, 0}, kodakaio_resolution_list, 4, /* 600 dpi max, 4 resolutions */ 8, kodakaio_depth_list, /* color depth max 8, list above */ {0, SANE_FIX(8.5 * MM_PER_INCH), 0}, {0, SANE_FIX(11.7 * MM_PER_INCH), 0}, /* FBF x/y ranges */ - SANE_FALSE, SANE_FALSE, /* ADF, duplex */ + SANE_FALSE, SANE_FALSE, /* ADF, duplex */ {0, SANE_FIX(8.5 * MM_PER_INCH), 0}, {0, SANE_FIX(14 * MM_PER_INCH), 0} /* 14 ADF x/y ranges */ }, /* KODAK ESP4100 , */ @@ -405,7 +405,7 @@ commandtype, max depth, pointer to depth list 600, {75, 600, 0}, kodakaio_resolution_list, 4, /* 600 dpi max, 4 resolutions */ 8, kodakaio_depth_list, /* color depth max 8, list above */ {0, SANE_FIX(8.5 * MM_PER_INCH), 0}, {0, SANE_FIX(11.7 * MM_PER_INCH), 0}, /* FBF x/y ranges */ - SANE_FALSE, SANE_FALSE, /* ADF, duplex */ + SANE_FALSE, SANE_FALSE, /* ADF, duplex */ {0, SANE_FIX(8.5 * MM_PER_INCH), 0}, {0, SANE_FIX(14 * MM_PER_INCH), 0} /* 14 ADF x/y ranges */ }, /* KODAK ESP6100 , */ @@ -415,7 +415,7 @@ commandtype, max depth, pointer to depth list 600, {75, 600, 0}, kodakaio_resolution_list, 4, /* 600 dpi max, 4 resolutions */ 8, kodakaio_depth_list, /* color depth max 8, list above */ {0, SANE_FIX(8.5 * MM_PER_INCH), 0}, {0, SANE_FIX(11.7 * MM_PER_INCH), 0}, /* FBF x/y ranges */ - SANE_TRUE, SANE_FALSE, /* ADF, duplex */ + SANE_TRUE, SANE_FALSE, /* ADF, duplex */ {0, SANE_FIX(8.5 * MM_PER_INCH), 0}, {0, SANE_FIX(14 * MM_PER_INCH), 0} /* 14 ADF x/y ranges */ }, /* KODAK ESP7200 , */ @@ -425,7 +425,7 @@ commandtype, max depth, pointer to depth list 600, {75, 600, 0}, kodakaio_resolution_list, 4, /* 600 dpi max, 4 resolutions */ 8, kodakaio_depth_list, /* color depth max 8, list above */ {0, SANE_FIX(8.5 * MM_PER_INCH), 0}, {0, SANE_FIX(11.7 * MM_PER_INCH), 0}, /* FBF x/y ranges */ - SANE_FALSE, SANE_FALSE, /* ADF, duplex */ + SANE_FALSE, SANE_FALSE, /* ADF, duplex */ {0, SANE_FIX(8.5 * MM_PER_INCH), 0}, {0, SANE_FIX(14 * MM_PER_INCH), 0} /* 14 ADF x/y ranges */ }, /* KODAK ESP C110 , */ @@ -435,7 +435,7 @@ commandtype, max depth, pointer to depth list 600, {75, 600, 0}, kodakaio_resolution_list, 4, /* 600 dpi max, 4 resolutions */ 8, kodakaio_depth_list, /* color depth max 8, list above */ {0, SANE_FIX(8.5 * MM_PER_INCH), 0}, {0, SANE_FIX(11.7 * MM_PER_INCH), 0}, /* FBF x/y ranges */ - SANE_FALSE, SANE_FALSE, /* ADF, duplex */ + SANE_FALSE, SANE_FALSE, /* ADF, duplex */ {0, SANE_FIX(8.5 * MM_PER_INCH), 0}, {0, SANE_FIX(14 * MM_PER_INCH), 0} /* 14 ADF x/y ranges */ }, /* KODAK ESP C115 , */ @@ -445,7 +445,7 @@ commandtype, max depth, pointer to depth list 600, {75, 600, 0}, kodakaio_resolution_list, 4, /* 600 dpi max, 4 resolutions */ 8, kodakaio_depth_list, /* color depth max 8, list above */ {0, SANE_FIX(8.5 * MM_PER_INCH), 0}, {0, SANE_FIX(11.7 * MM_PER_INCH), 0}, /* FBF x/y ranges */ - SANE_FALSE, SANE_FALSE, /* ADF, duplex */ + SANE_FALSE, SANE_FALSE, /* ADF, duplex */ {0, SANE_FIX(8.5 * MM_PER_INCH), 0}, {0, SANE_FIX(14 * MM_PER_INCH), 0} /* 14 ADF x/y ranges */ }, /* KODAK ESP 2150 , */ @@ -455,7 +455,7 @@ commandtype, max depth, pointer to depth list 600, {75, 600, 0}, kodakaio_resolution_list, 4, /* 600 dpi max, 4 resolutions */ 8, kodakaio_depth_list, /* color depth max 8, list above */ {0, SANE_FIX(8.5 * MM_PER_INCH), 0}, {0, SANE_FIX(11.7 * MM_PER_INCH), 0}, /* FBF x/y ranges */ - SANE_TRUE, SANE_FALSE, /* ADF, duplex */ + SANE_TRUE, SANE_FALSE, /* ADF, duplex */ {0, SANE_FIX(8.5 * MM_PER_INCH), 0}, {0, SANE_FIX(14 * MM_PER_INCH), 0} /* 14 ADF x/y ranges */ }, /* KODAK ESP C310 , */ @@ -465,7 +465,7 @@ commandtype, max depth, pointer to depth list 600, {75, 600, 0}, kodakaio_resolution_list, 4, /* 600 dpi max, 4 resolutions */ 8, kodakaio_depth_list, /* color depth max 8, list above */ {0, SANE_FIX(8.5 * MM_PER_INCH), 0}, {0, SANE_FIX(11.7 * MM_PER_INCH), 0}, /* FBF x/y ranges */ - SANE_FALSE, SANE_FALSE, /* ADF, duplex */ + SANE_FALSE, SANE_FALSE, /* ADF, duplex */ {0, SANE_FIX(8.5 * MM_PER_INCH), 0}, {0, SANE_FIX(14 * MM_PER_INCH), 0} /* 14 ADF x/y ranges */ }, /* KODAK ESP C315 , */ @@ -475,7 +475,7 @@ commandtype, max depth, pointer to depth list 600, {75, 600, 0}, kodakaio_resolution_list, 4, /* 600 dpi max, 4 resolutions */ 8, kodakaio_depth_list, /* color depth max 8, list above */ {0, SANE_FIX(8.5 * MM_PER_INCH), 0}, {0, SANE_FIX(11.7 * MM_PER_INCH), 0}, /* FBF x/y ranges */ - SANE_FALSE, SANE_FALSE, /* ADF, duplex */ + SANE_FALSE, SANE_FALSE, /* ADF, duplex */ {0, SANE_FIX(8.5 * MM_PER_INCH), 0}, {0, SANE_FIX(14 * MM_PER_INCH), 0} /* 14 ADF x/y ranges */ }, /* ADVENT AW10, */ @@ -525,7 +525,7 @@ commandtype, max depth, pointer to depth list 600, {75, 600, 0}, kodakaio_resolution_list, 4, /* 600 dpi max, 4 resolutions */ 8, kodakaio_depth_list, /* color depth max 8, list above */ {0, SANE_FIX(8.5 * MM_PER_INCH), 0}, {0, SANE_FIX(11.7 * MM_PER_INCH), 0}, /* FBF x/y ranges */ - SANE_TRUE, SANE_FALSE, /* ADF, duplex */ + SANE_TRUE, SANE_FALSE, /* ADF, duplex */ {0, SANE_FIX(8.5 * MM_PER_INCH), 0}, {0, SANE_FIX(14 * MM_PER_INCH), 0} /* 14 ADF x/y ranges */ }, /* KODAK ESP2170 , */ @@ -535,7 +535,7 @@ commandtype, max depth, pointer to depth list 1200, {75, 1200, 0}, kodakaio_resolution_list, 5, /* 1200 dpi optical, {from, to, 0} 5 resolutions */ 8, kodakaio_depth_list, /* color depth max 8, list above */ {0, SANE_FIX(8.5 * MM_PER_INCH), 0}, {0, SANE_FIX(11.7 * MM_PER_INCH), 0}, /* FBF x/y ranges */ - SANE_TRUE, SANE_FALSE, /* ADF, duplex */ + SANE_TRUE, SANE_FALSE, /* ADF, duplex */ {0, SANE_FIX(8.5 * MM_PER_INCH), 0}, {0, SANE_FIX(14 * MM_PER_INCH), 0} /* 14 ADF x/y ranges */ }, /* KODAK HERO 9.1, */ @@ -748,7 +748,7 @@ sanei_kodakaio_net_write_raw(struct KodakAio_Scanner *s, SANE_Status *status) { DBG(32, "net write:%x,%x,%x,%x,%x,%x,%x,%x\n",buf[0],buf[1],buf[2],buf[3],buf[4],buf[5],buf[6],buf[7]); - + sanei_tcp_write(s->fd, buf, buf_size); /* TODO: Check whether sending failed... */ @@ -863,8 +863,8 @@ static ssize_t k_recv(KodakAio_Scanner * s, void *buf, ssize_t buf_size, SANE_Status * status) { -/* requests and receives data this function makes the split between USB and NET -this function called by a number of others +/* requests and receives data this function makes the split between USB and NET +this function called by a number of others In USB mode, this function will wait until data is available for a maximum of SCANNER_READ_TIMEOUT seconds. In NET mode the timeout is in kodakaio_net_read @@ -878,7 +878,7 @@ In NET mode the timeout is in kodakaio_net_read usb_delay.tv_nsec = 300000000; /* 0.3 sec */ if (s->hw->connection == SANE_KODAKAIO_NET) { - + time(&time_start); DBG(min(16,DBG_READ), "[%ld] %s: net req size = %ld ", (long) time_start, __func__, (long) buf_size); n = kodakaio_net_read(s, buf, buf_size, status); @@ -1015,7 +1015,7 @@ and returns appropriate status s->adf_loaded = SANE_TRUE; DBG(5, "%s: News - docs in ADF\n", __func__); } - else if (rxbuf[4] != + else if (rxbuf[4] != 0x01 && s->adf_loaded == SANE_TRUE) { s->adf_loaded = SANE_FALSE; DBG(5, "%s: News - ADF is empty\n", __func__); @@ -1031,7 +1031,7 @@ and returns appropriate status } /* unused function -static ssize_t +static ssize_t kodakaio_rxflush(KodakAio_Scanner *s) Tries to get 64 byte reply @@ -1052,7 +1052,7 @@ and returns number of bytes read */ /* - * high-level communication commands + * high-level communication commands */ static SANE_Status @@ -1064,7 +1064,7 @@ k_hello (KodakAio_Scanner * s) DBG(5, "%s\n", __func__); -/* check that there is nothing already in the input buffer before starting +/* check that there is nothing already in the input buffer before starting kodakaio_rxflush(s); */ /* preset the reply, so I can see if it gets changed */ @@ -1129,12 +1129,12 @@ cmd_cancel_scan (SANE_Handle handle) unsigned char reply[8]; /* adf added 20/2/12 should it be adf? or adf with paper in? */ if (strcmp(source_list[s->val[OPT_SOURCE].w], ADF_STR) == 0) { /* adf */ - if (kodakaio_txrxack(s, KodakEsp_F, reply)!= SANE_STATUS_GOOD) + if (kodakaio_txrxack(s, KodakEsp_F, reply)!= SANE_STATUS_GOOD) { DBG(1, "%s: KodakEsp_F command failed\n", __func__); return SANE_STATUS_IO_ERROR; } - if (kodakaio_txrxack(s, KodakEsp_UnLock, reply)!= SANE_STATUS_GOOD) + if (kodakaio_txrxack(s, KodakEsp_UnLock, reply)!= SANE_STATUS_GOOD) { DBG(1, "%s: KodakEsp_UnLock command failed\n", __func__); return SANE_STATUS_IO_ERROR; @@ -1193,7 +1193,7 @@ cmd_set_color_curve(SANE_Handle handle, unsigned char col) int i; /* 7/9/14 was unsigned char and that stopped the loop that made the linear curve from going to 255 */ DBG(32, "%s: start\n", __func__); tx_col[0]=0x1b; tx_col[1]='S'; tx_col[2]='K'; tx_col[3]=col; tx_col[4]=0; tx_col[5]=0; tx_col[6]=0; tx_col[7]=0; -/* linear curve now but could send tailor made curves in future */ +/* linear curve now but could send tailor made curves in future */ for(i=0;i<=255;++i) tx_curve[i]=i; /* 7/9/14 was i<255 the missing elements caused speckles */ k_send(s, tx_col, 8, &status); @@ -1255,7 +1255,7 @@ cmd_set_scanning_parameters(SANE_Handle handle, tx_dpi[7]=0; kodakaio_txrxack(s, tx_dpi, bufread); -/* colour curves don't seem to be sent for usb preview +/* colour curves don't seem to be sent for usb preview but it seems to do no harm to send them */ cmd_set_color_curve(s, 'R'); cmd_set_color_curve(s, 'G'); @@ -1298,7 +1298,7 @@ this command needs actual DPI units*/ int cmparray (unsigned char *array1, unsigned char *array2, size_t len) { -/* compares len bytes of the arrays returns 0 if they match +/* compares len bytes of the arrays returns 0 if they match returns the first missmatch position if they don't match */ unsigned int i; for(i=0; iack and do padding if the padding option is selected @@ -1363,7 +1363,7 @@ But it seems that the scanner takes care of that, and gives you the ack as a sep /* it may be the last block from the scanner so look for Ack response in last 8 bytes */ Last8 = buf + bytecount - 8; - /* only compare 4 bytes because we sometimes get escSS02.. or escSS00.. + /* only compare 4 bytes because we sometimes get escSS02.. or escSS00.. is 4 the right number ? */ if (cmparray(Last8,KodakEsp_Ack,4) == 0) { DBG(min(10,DBG_READ), "%s: found KodakEsp_Ack at %lu bytes of %lu\n", __func__, (unsigned long) bytecount, (unsigned long) *len); @@ -1404,12 +1404,12 @@ But it seems that the scanner takes care of that, and gives you the ack as a sep if (status == SANE_STATUS_GOOD) if (s->bytes_unread <= 0) - DBG(min(2,DBG_READ), "%s: Page fully read %d blocks, %ld bytes unread\n", __func__, s->counter, (long) s->bytes_unread); + DBG(min(2,DBG_READ), "%s: Page fully read %d blocks, %ld bytes unread\n", __func__, s->counter, (long) s->bytes_unread); else DBG(min(20,DBG_READ), "%s: Image data successfully read %ld bytes, %ld bytes unread\n", __func__, (long) bytecount, (long) s->bytes_unread); else if (s->ack) /* was (status == SANE_STATUS_EOF) */ DBG(min(2,DBG_READ), "%s: scanner data read ended %d blocks %ld bytes, %ld bytes unread\n", __func__, s->counter, (long) bytecount, (long) s->bytes_unread); - else + else DBG(min(1,DBG_READ), "%s: Image data read stopped with %s after %d blocks %ld bytes, %ld bytes unread\n", __func__, sane_strstatus(status), s->counter, (long) bytecount, (long) s->bytes_unread); return status; @@ -1549,7 +1549,7 @@ k_setup_block_mode (KodakAio_Scanner *s) return SANE_STATUS_GOOD; } -/* Call the commands to set scanning parameters +/* Call the commands to set scanning parameters In the Kodak Aio the parameters are: (x1b,"S","F",0,0,0,0,0) (x1b,"S","S",1,0,0,0,0) @@ -1615,7 +1615,7 @@ k_set_scanning_parameters(KodakAio_Scanner * s) /* TODO: Any way to set PREVIEW??? */ /* Remaining bytes unused */ - status = cmd_set_scanning_parameters(s, dpi, + status = cmd_set_scanning_parameters(s, dpi, s->left * dpi / optres, s->top * dpi / optres, /* top/left start (dpi units)*/ s->params.pixels_per_line, s->params.lines, /* extent was s->width, s->height*/ source); /* source */ @@ -1696,7 +1696,7 @@ k_scan_finish(KodakAio_Scanner * s) static void k_copy_image_data(KodakAio_Scanner * s, SANE_Byte * data, SANE_Int max_length, SANE_Int * length) -/* copies the read data from s->line_buffer to the position in data pointer to by s->ptr +/* copies the read data from s->line_buffer to the position in data pointer to by s->ptr uncompressed data is RRRR...GGGG...BBBB per line */ { SANE_Int bytes_available; @@ -1724,7 +1724,7 @@ uncompressed data is RRRR...GGGG...BBBB per line */ /* We have filled as much as possible of the current line * with data from the scanner. If we have a complete line, - * copy it over. + * copy it over. line points to the current byte in the input s->line_buffer data points to the output buffer*/ if ((s->bytes_read_in_line >= s->scan_bytes_per_line) && @@ -1753,8 +1753,8 @@ uncompressed data is RRRR...GGGG...BBBB per line */ *data &= ~mask; /* white clear the bit in mask */ else *data |= mask; /* black set the bit in mask */ - - if (offset == 7 || i == s->params.pixels_per_line-1) + + if (offset == 7 || i == s->params.pixels_per_line-1) data++; /* move on a byte if the byte is full or the line is complete */ } @@ -1768,7 +1768,7 @@ uncompressed data is RRRR...GGGG...BBBB per line */ } /*debug file The same for color or grey because the scan is colour */ if (RawScan != NULL) { - for (i=0; i< s->scan_bytes_per_line; ++i) fputc(s->line_buffer[i],RawScan); + for (i=0; i< s->scan_bytes_per_line; ++i) fputc(s->line_buffer[i],RawScan); } max_length -= s->params.bytes_per_line; s->bytes_read_in_line -= s->scan_bytes_per_line; @@ -1840,7 +1840,7 @@ k_init_parametersta(KodakAio_Scanner * s) s->params.last_frame = SANE_TRUE; s->params.bytes_per_line = 3 * ceil (s->params.depth * s->params.pixels_per_line / 8.0); -/* kodak only scans in color and conversion to grey or lineart is done in the driver +/* kodak only scans in color and conversion to grey or lineart is done in the driver s->params.format = SANE_FRAME_RGB; */ DBG(20, "%s: s->val[OPT_MODE].w = %d (color is %d)\n", __func__,s->val[OPT_MODE].w, MODE_COLOR); if (s->val[OPT_MODE].w == MODE_COLOR) s->params.format = SANE_FRAME_RGB; @@ -1870,7 +1870,7 @@ k_read(struct KodakAio_Scanner *s) { unsigned char rx[8]; -/* monitors progress of blocks and calls cmd_read_data to get each block +/* monitors progress of blocks and calls cmd_read_data to get each block you don't know how many blocks there will be in advance because their size may be determined by the scanner*/ SANE_Status status = SANE_STATUS_GOOD; size_t buf_len = 0; @@ -1907,7 +1907,7 @@ you don't know how many blocks there will be in advance because their size may b if (status == SANE_STATUS_EOF) { /* page ended prematurely. */ } - } + } else { /* s->bytes_unread <=0 This is the end of a page */ s->eof = SANE_TRUE; DBG(min(10,DBG_READ), "%s: set EOF after %d blocks\n=============\n", __func__, s->counter); @@ -1932,7 +1932,7 @@ you don't know how many blocks there will be in advance because their size may b } /* - * SANE API implementation (high-level functions) + * SANE API implementation (high-level functions) */ #if WITH_AVAHI @@ -1951,12 +1951,12 @@ get_device_from_identification (const char *ident, const char *vid, const char * return NULL; } for (n = 0; n < NELEMS (kodakaio_cap); n++) { - + if (strcmp (kodakaio_cap[n].model, ident)==0) { DBG(20, "matched <%s> & <%s>\n", kodakaio_cap[n].model, ident); return &kodakaio_cap[n]; } - else + else if (kodakaio_cap[n].id == pidnum && 0x040A == vidnum) { DBG(20, "matched <%s> & <%s:%s>\n", kodakaio_cap[n].model, vid, pid); return &kodakaio_cap[n]; @@ -2124,7 +2124,7 @@ detect_usb(struct KodakAio_Scanner *s) * about the device */ while (i != numIds && !is_valid) { /* if (product == kodakaio_usb_product_ids[i]) */ - if (product == kodakaio_cap[i].id) + if (product == kodakaio_cap[i].id) is_valid = SANE_TRUE; i++; } @@ -2259,20 +2259,20 @@ device_detect(const char *name, int type, SANE_Status *status) #if WITH_AVAHI /* ProcessAvahiDevice is called to process each discovered device in turn */ -void +void ProcessAvahiDevice(const char *device_id, const char *vid, const char *pid, const char *ip_addr) { struct KodakaioCap *cap; DBG(min(10,DBG_AUTO),"device_id = <%s> vid:pid = <%s:%s>\n", device_id,vid,pid); -/* check if it is a model likely to be supported: "KODAK ESP" or "KODAK HERO" +/* check if it is a model likely to be supported: "KODAK ESP" or "KODAK HERO" DBG(min(10,DBG_AUTO),"look up model <%s>\n", device_model); */ cap = get_device_from_identification("", vid, pid); if (cap == NULL) { return; - } + } DBG(min(10,DBG_AUTO), "%s: Found autodiscovered device: %s (type 0x%x)\n", __func__, cap->model, cap->id); attach_one_net (ip_addr, cap->id); @@ -2337,12 +2337,12 @@ static void resolve_callback( else DBG(min(10,DBG_AUTO), "didn't call ProcessAvahiDevice\n"); if(vid_pair_list != NULL) { - avahi_free(vidkey); + avahi_free(vidkey); avahi_free(vidvalue); DBG(min(15,DBG_AUTO), "vidkey and vidvalue freed\n"); } if(pid_pair_list != NULL) { - avahi_free(pidkey); + avahi_free(pidkey); avahi_free(pidvalue); DBG(min(15,DBG_AUTO), "pidkey and pidvalue freed\n"); } @@ -2413,7 +2413,7 @@ static void client_callback(AvahiClient *c, AvahiClientState state, void * userd static int kodak_network_discovery(const char*host) -/* If host = NULL do autodiscovery. If host != NULL try to verify the model +/* If host = NULL do autodiscovery. If host != NULL try to verify the model First version only does autodiscovery */ { AvahiSimplePoll *simple_poll; @@ -2586,7 +2586,7 @@ attach_one_config(SANEI_Config __sane_unused__ *config, const char *line) /* Timeout for all other read requests */ DBG(50, "%s: Request timeout set to %d\n", __func__, timeout); K_Request_Timeout = timeout; - + } else { /* TODO: Warning about unparsable line! */ } @@ -2790,7 +2790,7 @@ init_options(KodakAio_Scanner *s) s->opt[OPT_BIT_DEPTH].constraint.word_list = s->hw->cap->depth_list; s->opt[OPT_BIT_DEPTH].cap |= SANE_CAP_INACTIVE; s->val[OPT_BIT_DEPTH].w = s->hw->cap->depth_list[1]; /* the first "real" element is the default */ - + DBG(20, "%s: depth list has depth_list[0] = %d entries\n", __func__, s->hw->cap->depth_list[0]); if (s->hw->cap->depth_list[0] == 1) { /* only one element in the list -> hide the option */ s->opt[OPT_BIT_DEPTH].cap |= SANE_CAP_INACTIVE; @@ -2814,7 +2814,7 @@ init_options(KodakAio_Scanner *s) s->val[OPT_RESOLUTION].w = s->hw->cap->dpi_range.min; - /* trial option for debugging + /* trial option for debugging s->opt[OPT_TRIALOPT].name = "trialoption"; s->opt[OPT_TRIALOPT].title = "trialoption"; s->opt[OPT_TRIALOPT].desc = "trialoption"; @@ -2834,7 +2834,7 @@ init_options(KodakAio_Scanner *s) for(i=0;source_list[i]!=NULL;++i) DBG(18, "source_list: %s\n",source_list[i]); - + /* source */ s->opt[OPT_SOURCE].name = SANE_NAME_SCAN_SOURCE; s->opt[OPT_SOURCE].title = SANE_TITLE_SCAN_SOURCE; @@ -2850,7 +2850,7 @@ init_options(KodakAio_Scanner *s) s->opt[OPT_SOURCE].cap |= SANE_CAP_INACTIVE; } -/* Are there any ESP scanners that are duplex? */ +/* Are there any ESP scanners that are duplex? */ s->opt[OPT_ADF_MODE].name = "adf-mode"; s->opt[OPT_ADF_MODE].title = SANE_I18N("ADF Mode"); s->opt[OPT_ADF_MODE].desc = @@ -2991,7 +2991,7 @@ sane_open(SANE_String_Const name, SANE_Handle *handle) /* s is always valid here */ DBG(10, "handle obtained\n"); - status = k_discover_capabilities(s); /* added 27/12/11 to fix source list problem + status = k_discover_capabilities(s); /* added 27/12/11 to fix source list problem maybe we should only be rebuilding the source list here? */ if (status != SANE_STATUS_GOOD) return status; @@ -3000,7 +3000,7 @@ maybe we should only be rebuilding the source list here? */ *handle = (SANE_Handle) s; -/* moving the open scanner section below to sane_start 27/12/14 +/* moving the open scanner section below to sane_start 27/12/14 status = open_scanner(s); if (status != SANE_STATUS_GOOD) { free(s); @@ -3400,8 +3400,8 @@ sane_start(SANE_Handle handle) /* set scanning parameters; also query the current image * parameters from the sanner and save - * them to s->params -Only set scanning params the first time, or after a cancel + * them to s->params +Only set scanning params the first time, or after a cancel try change 22/2/12 take lock scanner out of k_set_scanning_parameters */ /* moved open_scanner here 27/12/14 from sane_open */ diff --git a/backend/kodakaio.conf.in b/backend/kodakaio.conf.in index 2ad3ed42b..42ca42ce1 100644 --- a/backend/kodakaio.conf.in +++ b/backend/kodakaio.conf.in @@ -9,7 +9,7 @@ # snmp-timeout controls auto-detection timeout in ms (1500=1.5s). snmp-timeout 2000 -# scan-data-timeout controls the timeout for scan data +# scan-data-timeout controls the timeout for scan data # (scans may take several seconds to initialize, so we need to wait longer) scan-data-timeout 10000 diff --git a/backend/kvs1025_low.c b/backend/kvs1025_low.c index d834f61f4..98cf3be6c 100644 --- a/backend/kvs1025_low.c +++ b/backend/kvs1025_low.c @@ -988,7 +988,7 @@ buffer_deskew(PKV_DEV s, int side) &s->params[side_index],s->img_buffers[side_index], resolution,resolution, &s->deskew_vals[0],&s->deskew_vals[1],&s->deskew_slope); - + if(s->deskew_stat){ DBG (5, "buffer_despeck: bad findSkew, bailing\n"); goto cleanup; @@ -997,7 +997,7 @@ buffer_deskew(PKV_DEV s, int side) /* backside images can use a 'flipped' version of frontside data */ else{ s->deskew_slope *= -1; - s->deskew_vals[0] + s->deskew_vals[0] = s->params[side_index].pixels_per_line - s->deskew_vals[0]; } @@ -1039,7 +1039,7 @@ buffer_crop(PKV_DEV s, int side) DBG (5, "buffer_crop: bad edges, bailing\n"); goto cleanup; } - + DBG (15, "buffer_crop: t:%d b:%d l:%d r:%d\n", s->crop_vals[0],s->crop_vals[1],s->crop_vals[2],s->crop_vals[3]); @@ -1066,9 +1066,9 @@ buffer_crop(PKV_DEV s, int side) } /* update image size counter to new, smaller size */ - s->img_size[side_index] + s->img_size[side_index] = s->params[side_index].lines * s->params[side_index].bytes_per_line; - + cleanup: DBG (10, "buffer_crop: finish\n"); return ret; @@ -1143,7 +1143,7 @@ buffer_rotate(PKV_DEV s, int side) ret = sanei_magic_findTurn( &s->params[side_index],s->img_buffers[side_index], resolution,resolution,&angle); - + if(ret){ DBG (5, "buffer_rotate: error %d\n",ret); ret = SANE_STATUS_GOOD; @@ -1161,7 +1161,7 @@ buffer_rotate(PKV_DEV s, int side) ret = sanei_magic_turn( &s->params[side_index],s->img_buffers[side_index], angle); - + if(ret){ DBG (5, "buffer_rotate: error %d\n",ret); ret = SANE_STATUS_GOOD; @@ -1169,9 +1169,9 @@ buffer_rotate(PKV_DEV s, int side) } /* update image size counter to new, smaller size */ - s->img_size[side_index] + s->img_size[side_index] = s->params[side_index].lines * s->params[side_index].bytes_per_line; - + cleanup: DBG (10, "buffer_rotate: finished\n"); return ret; diff --git a/backend/kvs1025_usb.c b/backend/kvs1025_usb.c index 90ce4d040..d7a4dde7f 100644 --- a/backend/kvs1025_usb.c +++ b/backend/kvs1025_usb.c @@ -303,7 +303,7 @@ kv_usb_escape (PKV_DEV dev, size_t len = 16; ret = sanei_usb_read_bulk (dev->usb_fd, (SANE_Byte *) cmd_buff, &len); - + if (ret || len != 16) { DBG (DBG_error, "usb_bulk_read: Error reading response." diff --git a/backend/kvs20xx_opt.c b/backend/kvs20xx_opt.c index 94c41331e..fc527f339 100644 --- a/backend/kvs20xx_opt.c +++ b/backend/kvs20xx_opt.c @@ -207,7 +207,7 @@ kvs20xx_init_options (struct scanner *s) o->unit = SANE_UNIT_NONE; s->val[DUPLEX].w = SANE_FALSE; - /*FIXME + /*FIXME if (!s->support_info.support_duplex) o->cap |= SANE_CAP_INACTIVE; */ diff --git a/backend/kvs40xx_opt.c b/backend/kvs40xx_opt.c index bd9d85e11..2bf9a5cfe 100644 --- a/backend/kvs40xx_opt.c +++ b/backend/kvs40xx_opt.c @@ -356,7 +356,7 @@ kvs40xx_init_options (struct scanner *s) o->unit = SANE_UNIT_NONE; s->val[DUPLEX].w = SANE_FALSE; - /*FIXME + /*FIXME if (!s->support_info.support_duplex) o->cap |= SANE_CAP_INACTIVE; */ diff --git a/backend/leo.c b/backend/leo.c index b44a343eb..e0200dec7 100644 --- a/backend/leo.c +++ b/backend/leo.c @@ -1,44 +1,44 @@ /* sane - Scanner Access Now Easy. Copyright (C) 2002-2003 Frank Zago (sane at zago dot net) - + 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. + If you do not wish that, delete this exception notice. */ /* @@ -945,7 +945,7 @@ leo_init_options (Leo_Scanner * dev) (SANE_String_Const *) scan_mode_list[0], NULL); } -/* +/* * Wait until the scanner is ready. */ static SANE_Status @@ -1000,7 +1000,7 @@ leo_fill_image (Leo_Scanner * dev) while (dev->real_bytes_left) { - /* + /* * Try to read the maximum number of bytes. */ size = 0; @@ -1027,7 +1027,7 @@ leo_fill_image (Leo_Scanner * dev) if (size == 0) { - /* Probably reached the end of the buffer. + /* Probably reached the end of the buffer. * Check, just in case. */ assert (dev->image_end != 0); return (SANE_STATUS_GOOD); @@ -1093,7 +1093,7 @@ leo_fill_image (Leo_Scanner * dev) return (SANE_STATUS_GOOD); /* unreachable */ } -/* Copy from the raw buffer to the buffer given by the backend. +/* Copy from the raw buffer to the buffer given by the backend. * * len in input is the maximum length available in buf, and, in * output, is the length written into buf. diff --git a/backend/leo.h b/backend/leo.h index 73bb7b1d7..d9595bffb 100644 --- a/backend/leo.h +++ b/backend/leo.h @@ -38,10 +38,10 @@ 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. + If you do not wish that, delete this exception notice. */ -/* +/* $Id$ */ @@ -241,8 +241,8 @@ enum Leo_Option /*--------------------------------------------------------------------------*/ -/* - * Scanner supported by this backend. +/* + * Scanner supported by this backend. */ struct scanners_supported { @@ -338,7 +338,7 @@ Leo_Scanner; /*--------------------------------------------------------------------------*/ -/* Debug levels. +/* Debug levels. * Should be common to all backends. */ #define DBG_error0 0 diff --git a/backend/lexmark.c b/backend/lexmark.c index e0cd21fa8..647077666 100644 --- a/backend/lexmark.c +++ b/backend/lexmark.c @@ -4,7 +4,7 @@ (C) 2005 Fred Odendaal (C) 2006-2013 Stéphane Voltz (C) 2010 "Torsten Houwaart" X74 support - + This file is part of the SANE package. This program is free software; you can redistribute it and/or @@ -625,7 +625,7 @@ sane_get_devices (const SANE_Device *** device_list, SANE_Bool local_only) * Open the backend, ie return the struct handle of a detected scanner * The struct returned is choosne if it matches the name given, which is * usefull when several scanners handled by the backend have been detected. - * However, special case empty string "" and "lexmark" pick the first + * However, special case empty string "" and "lexmark" pick the first * available handle. */ SANE_Status @@ -1144,7 +1144,7 @@ sane_start (SANE_Handle handle) lexmark_device->eof = SANE_FALSE; - /* Need this cancel_ctr to determine how many times sane_cancel is called + /* Need this cancel_ctr to determine how many times sane_cancel is called since it is called more than once. */ lexmark_device->cancel_ctr = 0; @@ -1180,15 +1180,15 @@ sane_start (SANE_Handle handle) return status; } - /* At this point we're somewhere in the dot. We need to read a number of - lines greater than the diameter of the dot and determine how many lines - past the dot we've gone. We then use this information to see how far the + /* At this point we're somewhere in the dot. We need to read a number of + lines greater than the diameter of the dot and determine how many lines + past the dot we've gone. We then use this information to see how far the scan head must move before starting the scan. */ /* offset is in 600 dpi unit */ offset = sanei_lexmark_low_find_start_line (lexmark_device); DBG (7, "start line offset=%d\n", offset); - /* Set the shadow registers for scan with the options (resolution, mode, + /* Set the shadow registers for scan with the options (resolution, mode, size) set in the front end. Pass the offset so we can get the vert. start. */ sanei_lexmark_low_set_scan_regs (lexmark_device, diff --git a/backend/lexmark_low.c b/backend/lexmark_low.c index fe20e8967..cc5d96cfe 100644 --- a/backend/lexmark_low.c +++ b/backend/lexmark_low.c @@ -3,7 +3,7 @@ (C) 2005 Fred Odendaal (C) 2006-2013 Stéphane Voltz (C) 2010 "Torsten Houwaart" X74 support - + This file is part of the SANE package. This program is free software; you can redistribute it and/or @@ -180,7 +180,7 @@ rts88xx_set_scan_frequency (SANE_Byte * regs, int frequency) } /* - * read one register at given index + * read one register at given index */ static SANE_Status rts88xx_read_reg (SANE_Int devnum, SANE_Int index, SANE_Byte * reg) @@ -218,7 +218,7 @@ rts88xx_read_reg (SANE_Int devnum, SANE_Int index, SANE_Byte * reg) } /* - * write one register at given index + * write one register at given index */ static SANE_Status rts88xx_write_reg (SANE_Int devnum, SANE_Int index, SANE_Byte * reg) @@ -412,7 +412,7 @@ lexmark_low_wake_up (Lexmark_Device * dev) /** - * + * */ #ifdef DEEP_DEBUG static void @@ -1254,7 +1254,7 @@ sanei_lexmark_low_close_device (Lexmark_Device * dev) } -/* This function writes the contents of the given registers to the +/* This function writes the contents of the given registers to the scanner. */ SANE_Status low_write_all_regs (SANE_Int devnum, SANE_Byte * regs) @@ -1306,31 +1306,31 @@ SANE_Bool low_is_home_line (Lexmark_Device * dev, unsigned char *buffer) { /* - This function assumes the buffer has a size of 2500 bytes.It is + This function assumes the buffer has a size of 2500 bytes.It is destructive to the buffer. Here is what it does: - Go through the buffer finding low and high values, which are computed by - comparing to the average: + Go through the buffer finding low and high values, which are computed by + comparing to the average: average = (lowest value + highest value)/2 - High bytes are changed to 0xFF (white), lower or equal bytes are changed - to 0x00 (black),so that the buffer only contains white (0xFF) or black + High bytes are changed to 0xFF (white), lower or equal bytes are changed + to 0x00 (black),so that the buffer only contains white (0xFF) or black (0x00) values. Next, we go through the buffer. We use a tolerance of 5 bytes on each end of the buffer and check a region from bytes 5 to 2495. We start assuming we are in a white region and look for the start of a black region. We save - this index as the transition from white to black. We also save where we - change from black back to white. We continue checking for transitions - until the end of the check region. If we don't have exactly two + this index as the transition from white to black. We also save where we + change from black back to white. We continue checking for transitions + until the end of the check region. If we don't have exactly two transitions when we reach the end we return SANE_FALSE. The final check compares the transition indices to the nominal values plus or minus the tolerence. For the first transition (white to black index) the value must lie in the range 1235-30 (1205) to 1235+30 (1265). For the second transition (black to white) the value must lie in the range - 1258-30 (1228) to 1258+30 (1288). If the indices are out of range we + 1258-30 (1228) to 1258+30 (1288). If the indices are out of range we return SANE_FALSE. Otherwise, we return SANE_TRUE. */ @@ -1467,9 +1467,9 @@ sanei_lexmark_low_move_fwd (SANE_Int distance, Lexmark_Device * dev, SANE_Byte * regs) { /* - This function moves the scan head forward with the highest vertical + This function moves the scan head forward with the highest vertical resolution of 1200dpi. The distance moved is given by the distance - parameter. + parameter. As an example, given a distance parameter of 600, the scan head will move 600/1200", or 1/2" forward. @@ -1950,7 +1950,7 @@ sanei_lexmark_low_search_home_bwd (Lexmark_Device * dev) /* This function must only be called if the scan head is past the home dot. It could damage the scanner if not. - This function tells the scanner to do a grayscale scan backwards with a + This function tells the scanner to do a grayscale scan backwards with a 300dpi resolution. It reads 2500 bytes of data between horizontal co-ordinates 0x6a and 0x13f2. @@ -1959,8 +1959,8 @@ sanei_lexmark_low_search_home_bwd (Lexmark_Device * dev) before it bangs against the end. A line limit is set so that a maximum of 0x0F3C (13"*300dpi) lines can be read. - To read the scan data we create a buffer space large enough to hold 10 - lines of data. For each read we poll twice, ignoring the first poll. This + To read the scan data we create a buffer space large enough to hold 10 + lines of data. For each read we poll twice, ignoring the first poll. This is required for timing. We repeat the double poll until there is data available. The number of lines (or number of buffers in our buffer space) is calculated from the size of the data available from the scanner. The @@ -2462,10 +2462,10 @@ sanei_lexmark_low_find_start_line (Lexmark_Device * dev) This function scans forward 59 lines, reading 88 bytes per line from the middle of the horizontal line: pixel 0xa84 to pixel 0x9d4. It scans with the following parameters: - dir=fwd + dir=fwd mode=grayscale h.res=300 dpi - v.res=600 dpi + v.res=600 dpi hor. pixels = (0xa84 - 0x9d4)/2 = 0x58 = 88 vert. pixels = 0x3e - 0x03 = 0x3b = 59 data = 88x59=5192=0x1448 @@ -2479,18 +2479,18 @@ sanei_lexmark_low_find_start_line (Lexmark_Device * dev) Byte swap the order of the bytes in the buffer. - Go through the buffer finding low and high values, which are computed by - comparing to the weighted average: + Go through the buffer finding low and high values, which are computed by + comparing to the weighted average: weighted_average = (lowest value + (highest value - lowest value)/4) - Low bytes are changed to 0xFF (white), higher of equal bytes are changed - to 0x00 (black),so that the buffer only contains white (0xFF) or black + Low bytes are changed to 0xFF (white), higher of equal bytes are changed + to 0x00 (black),so that the buffer only contains white (0xFF) or black (0x00) values. Next, we go through the buffer a line (88 bytes) at a time for 59 lines to read the entire buffer. For each byte in a line we check if the byte is black. If it is we increment the black byte counter. - After each line we check the black byte counter. If it is greater than 0 + After each line we check the black byte counter. If it is greater than 0 we increment the black line count and set the white line count to 0. If there were no black bytes in the line we set the black line count to 0 and increment the white line count. @@ -2852,7 +2852,7 @@ sanei_lexmark_low_find_start_line (Lexmark_Device * dev) } /* end for buffer */ free (buffer); - /* Stop the scanner. + /* Stop the scanner. This is needed to get the right distance to the scanning area */ if (dev->model.sensor_type == X74_SENSOR) low_stop_mvmt (dev->devnum); @@ -3879,7 +3879,7 @@ sanei_lexmark_low_set_scan_regs (Lexmark_Device * dev, SANE_Int resolution, /* set motor resolution divisor */ dev->shadow_regs[0x39] = 0x03; - /* data compression + /* data compression dev->shadow_regs[0x40] = 0x90; dev->shadow_regs[0x50] = 0x20; */ /* no data compression */ @@ -4296,7 +4296,7 @@ sanei_lexmark_low_set_scan_regs (Lexmark_Device * dev, SANE_Int resolution, dev->shadow_regs[0x36] = 0x0a; dev->shadow_regs[0x38] = 0x04; - /* data compression + /* data compression dev->shadow_regs[0x40] = 0x90; dev->shadow_regs[0x50] = 0x20; */ @@ -4499,8 +4499,8 @@ sanei_lexmark_low_set_scan_regs (Lexmark_Device * dev, SANE_Int resolution, dev->shadow_regs[0x37] = 0x07; dev->shadow_regs[0x38] = 0x0b; - /* data compression - dev->shadow_regs[0x40] = 0x90; + /* data compression + dev->shadow_regs[0x40] = 0x90; dev->shadow_regs[0x50] = 0x20; */ /* no data compression */ dev->shadow_regs[0x40] = 0x80; @@ -5471,7 +5471,7 @@ read_buffer_is_empty (Read_Buffer * read_buffer) return read_buffer->empty; } -/* +/* * average a width*height rgb/monochrome area * return values in given pointers */ @@ -5882,7 +5882,7 @@ sanei_lexmark_low_shading_calibration (Lexmark_Device * dev) /* computes coefficients */ /* there are 8 lines usable for shading calibration at 150 dpi, between - bottom of "home position" dot and the start of the scanner's window + bottom of "home position" dot and the start of the scanner's window assembly, we only use 7 of them */ if (yoffset + (8 * 4) / regs[0x7a] < lines) lines = yoffset + (8 * 4) / regs[0x7a]; @@ -6003,7 +6003,7 @@ sanei_lexmark_low_calibration (Lexmark_Device * dev) return status; } - /* put the calibrated or manual settings before shading calibration + /* put the calibrated or manual settings before shading calibration which must be done with final setting values */ if (rts88xx_is_color (dev->shadow_regs)) { @@ -6049,7 +6049,7 @@ sanei_lexmark_low_assign_sensor (Lexmark_Device * dev) return SANE_STATUS_GOOD; } -/* assign model description, based on USB id, and register content when +/* assign model description, based on USB id, and register content when * available */ SANE_Status sanei_lexmark_low_assign_model (Lexmark_Device * dev, diff --git a/backend/magicolor.c b/backend/magicolor.c index d3af14292..105a5eee8 100644 --- a/backend/magicolor.c +++ b/backend/magicolor.c @@ -2050,7 +2050,7 @@ mc_network_discovery(const char*host) fd_set fdset; DBG(1, " loop=%d\n", i++); timeout.tv_sec = 0; - /* Use a 125ms timeout for select. If we get a response, + /* Use a 125ms timeout for select. If we get a response, * the loop will be entered earlier again, anyway */ timeout.tv_usec = 125000; FD_ZERO (&fdset); @@ -2193,7 +2193,7 @@ attach_one_config(SANEI_Config __sane_unused__ *config, const char *line) /* Timeout for all other read requests */ DBG(50, "%s: Request timeout set to %d\n", __func__, timeout); MC_Request_Timeout = timeout; - + } else { /* TODO: Warning about unparsable line! */ } @@ -2414,7 +2414,7 @@ init_options(Magicolor_Scanner *s) s->opt[OPT_SOURCE].constraint_type = SANE_CONSTRAINT_STRING_LIST; s->opt[OPT_SOURCE].constraint.string_list = source_list; s->val[OPT_SOURCE].w = 0; /* always use Flatbed as default */ - + s->opt[OPT_ADF_MODE].name = "adf-mode"; s->opt[OPT_ADF_MODE].title = SANE_I18N("ADF Mode"); s->opt[OPT_ADF_MODE].desc = diff --git a/backend/matsushita.c b/backend/matsushita.c index e70c60ad9..62bfb0674 100644 --- a/backend/matsushita.c +++ b/backend/matsushita.c @@ -2,49 +2,49 @@ Copyright (C) 2002, 2004 Frank Zago (sane at zago dot net) Copyright (C) 2002 Other SANE contributors - + 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. + If you do not wish that, delete this exception notice. */ /* $Id$ - Matsushita/Panasonic KV-SS25, KV-SS50, KV-SS55, KV-SS50EX, + Matsushita/Panasonic KV-SS25, KV-SS50, KV-SS55, KV-SS50EX, KV-SS55EX, KV-SS850, KV-SS855 SCSI scanners. This backend may support more Panasonic scanners. @@ -132,7 +132,7 @@ static const SANE_Word resolutions_rounds_400[8] = { /*--------------------------------------------------------------------------*/ -/* Lists of supported halftone. They are only valid with +/* Lists of supported halftone. They are only valid with * for the Black&White mode. */ static SANE_String_Const halftone_pattern_list[] = { SANE_I18N ("None"), @@ -265,7 +265,7 @@ static const int feeder_mode_val[] = { /*--------------------------------------------------------------------------*/ -/* Paper size in millimeters. +/* Paper size in millimeters. * Values from http://www.twics.com/~eds/paper/. */ static const struct paper_sizes paper_sizes[] = { {"2A0", 1189, 1682}, @@ -1317,7 +1317,7 @@ matsushita_init_options (Matsushita_Scanner * dev) /* Wait until the scanner is ready. * * The only reason I know the scanner is not ready is because it is - * moving the CCD. + * moving the CCD. */ static SANE_Status matsushita_wait_scanner (Matsushita_Scanner * dev) @@ -1524,17 +1524,17 @@ matsushita_fill_image (Matsushita_Scanner * dev) while (dev->real_bytes_left) { - /* + /* * Try to read the maximum number of bytes. * - * The windows driver reads no more than 0x8000 byte. + * The windows driver reads no more than 0x8000 byte. * * This backend operates differently than the windows * driver. The windows TWAIN driver always read 2 more bytes * at the end, so it gets a CHECK CONDITION with a short read * sense. Since the linux scsi layer seem to be buggy * regarding the resid, always read exactly the number of - * remaining bytes. + * remaining bytes. */ size = dev->real_bytes_left; @@ -1545,7 +1545,7 @@ matsushita_fill_image (Matsushita_Scanner * dev) if (size == 0) { - /* Probably reached the end of the buffer. + /* Probably reached the end of the buffer. * Check, just in case. */ assert (dev->image_end != 0); return (SANE_STATUS_GOOD); @@ -1620,7 +1620,7 @@ matsushita_fill_image (Matsushita_Scanner * dev) case 4: { - /* Adjust from a depth of 4 bits ([0..15]) to + /* Adjust from a depth of 4 bits ([0..15]) to * a depth of 8 bits ([0..255]) */ unsigned char *src = dev->buffer; @@ -1654,7 +1654,7 @@ matsushita_fill_image (Matsushita_Scanner * dev) return (SANE_STATUS_GOOD); /* unreachable */ } -/* Copy from the raw buffer to the buffer given by the backend. +/* Copy from the raw buffer to the buffer given by the backend. * * len in input is the maximum length available in buf, and, in * output, is the length written into buf. diff --git a/backend/matsushita.conf.in b/backend/matsushita.conf.in index 4d3cf244f..98eaa8860 100644 --- a/backend/matsushita.conf.in +++ b/backend/matsushita.conf.in @@ -7,7 +7,7 @@ scsi "K.M.E. " "KV-S2025C " scsi "K.M.E. " "KV-S2045C " scsi "K.M.E. " "KV-S2065L " -# These scanners are untested. +# These scanners are untested. # If you have one: # - check that the vendor/product strings are correct # - uncomment the line diff --git a/backend/matsushita.h b/backend/matsushita.h index a1528bfa5..bff7a04a2 100644 --- a/backend/matsushita.h +++ b/backend/matsushita.h @@ -37,10 +37,10 @@ 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. + If you do not wish that, delete this exception notice. */ -/* +/* $Id$ */ @@ -228,7 +228,7 @@ SANE_I18N("Automatic separation") /*--------------------------------------------------------------------------*/ -/* Differences between the scanners. +/* Differences between the scanners. * The scsi_* fields are used to lookup the correcte entry. */ struct scanners_supported { @@ -342,7 +342,7 @@ Matsushita_Scanner; /*--------------------------------------------------------------------------*/ -/* Debug levels. +/* Debug levels. * Should be common to all backends. */ #define DBG_error0 0 diff --git a/backend/microtek.c b/backend/microtek.c index ff82df412..05f8003ac 100644 --- a/backend/microtek.c +++ b/backend/microtek.c @@ -1,7 +1,7 @@ /*************************************************************************** * SANE - Scanner Access Now Easy. - microtek.c + microtek.c This file Copyright 2002 Matthew Marjanovic @@ -151,7 +151,7 @@ static SANE_Range brightness_range = {-100, 100, 1}; /*static SANE_Range exposure_range = {-18, 21, 3};*/ /*static SANE_Range contrast_range = {-42, 49, 7};*/ static SANE_Range u8_range = {0, 255, 1}; -static SANE_Range analog_gamma_range = +static SANE_Range analog_gamma_range = { SANE_FIX(0.1), SANE_FIX(4.0), SANE_FIX(0) }; @@ -235,7 +235,7 @@ ring_alloc (size_t initial_size, size_t bpl, size_t ppl) rb->green_extra = 0; rb->blue_extra = 0; rb->complete_count = 0; - + return rb; } @@ -260,7 +260,7 @@ ring_expand (ring_buffer *rb, size_t amount) DBG(23, "ring_expand: old, new, inc size: %lu, %lu, %lu\n", (u_long)oldsize, (u_long)rb->size, (u_long)amount); DBG(23, "ring_expand: old tr: %lu tg: %lu tb: %lu hc: %lu\n", - (u_long)rb->tail_red, (u_long)rb->tail_green, + (u_long)rb->tail_red, (u_long)rb->tail_green, (u_long)rb->tail_blue, (u_long)rb->head_complete); /* if necessary, move data and fix up them pointers */ /* (will break subtly if ring is filled with G or B bytes, @@ -276,20 +276,20 @@ ring_expand (ring_buffer *rb, size_t amount) oldsize - rb->head_complete); if ((rb->tail_red > rb->head_complete) || ((rb->tail_red == rb->head_complete) && - !(rb->complete_count) && !(rb->red_extra))) + !(rb->complete_count) && !(rb->red_extra))) rb->tail_red += amount; if ((rb->tail_green > rb->head_complete) || ((rb->tail_green == rb->head_complete) && - !(rb->complete_count) && !(rb->green_extra))) + !(rb->complete_count) && !(rb->green_extra))) rb->tail_green += amount; if ((rb->tail_blue > rb->head_complete) || ((rb->tail_blue == rb->head_complete) && - !(rb->complete_count) && !(rb->blue_extra))) + !(rb->complete_count) && !(rb->blue_extra))) rb->tail_blue += amount; rb->head_complete += amount; } DBG(23, "ring_expand: new tr: %lu tg: %lu tb: %lu hc: %lu\n", - (u_long)rb->tail_red, (u_long)rb->tail_green, + (u_long)rb->tail_red, (u_long)rb->tail_green, (u_long)rb->tail_blue, (u_long)rb->head_complete); return SANE_STATUS_GOOD; } @@ -320,13 +320,13 @@ ring_free (ring_buffer *rb) /* typically misinterpreted/munged by the low-level scsi driver) */ /********************************************************************/ static SANE_Status -sense_handler (int scsi_fd, u_char *sense, void *arg) +sense_handler (int scsi_fd, u_char *sense, void *arg) { int *sense_flags = (int *)arg; SANE_Status stat; DBG(10, "SENSE! fd = %d\n", scsi_fd); - DBG(10, "sense = %02x %02x %02x %02x.\n", + DBG(10, "sense = %02x %02x %02x %02x.\n", sense[0], sense[1], sense[2], sense[3]); switch(sense[0]) { case 0x00: @@ -340,7 +340,7 @@ sense_handler (int scsi_fd, u_char *sense, void *arg) DBG(10, "sense: ERR_SCSICMD\n"); stat = SANE_STATUS_IO_ERROR; } - } + } if (sense[1] & 0x02) { DBG(10, "sense: ERR_TOOMANY\n"); stat = SANE_STATUS_IO_ERROR; @@ -394,7 +394,7 @@ wait_ready(Microtek_Scanner *ms) int retry = 0; DBG(23, ".wait_ready %d...\n", ms->sfd); - while ((status = sanei_scsi_cmd(ms->sfd, comm, 6, 0, 0)) + while ((status = sanei_scsi_cmd(ms->sfd, comm, 6, 0, 0)) != SANE_STATUS_GOOD) { DBG(23, "wait_ready failed (%d)\n", retry); if (retry > 5) return SANE_STATUS_IO_ERROR; /* XXXXXXXX */ @@ -403,7 +403,7 @@ wait_ready(Microtek_Scanner *ms) } return SANE_STATUS_GOOD; } - + /********************************************************************/ /* send scan region coordinates */ @@ -432,7 +432,7 @@ scanning_frame(Microtek_Scanner *ms) ms->x1, ms->y1, ms->x2, ms->y2); DBG(23, ".scanning_frame: out- %d,%d %d,%d\n", x1, y1, x2, y2); data = comm + 6; - data[0] = + data[0] = ((ms->unit_type == MS_UNIT_PIXELS) ? 0x08 : 0 ) | ((ms->mode == MS_MODE_HALFTONE) ? 0x01 : 0 ); data[1] = x1 & 0xFF; @@ -444,7 +444,7 @@ scanning_frame(Microtek_Scanner *ms) data[7] = y2 & 0xFF; data[8] = (y2 >> 8) & 0xFF; if (DBG_LEVEL >= 192) { - int i; + int i; #if 0 fprintf(stderr, "SF: "); for (i=0;i<6+0x09;i++) fprintf(stderr, "%2x ", comm[i]); @@ -468,8 +468,8 @@ mode_select(Microtek_Scanner *ms) uint8_t *data, comm[19] = { 0x15, 0, 0, 0, 0, 0 }; DBG(23, ".mode_select %d...\n", ms->sfd); - data = comm + 6; - data[0] = + data = comm + 6; + data[0] = 0x81 | ((ms->unit_type == MS_UNIT_18INCH) ? 0 : 0x08) | ((ms->res_type == MS_RES_5PER) ? 0 : 0x02); @@ -488,8 +488,8 @@ mode_select(Microtek_Scanner *ms) comm[4] = (ms->midtone_support) ? 0x0B : 0x0A; if (DBG_LEVEL >= 192) { - int i; -#if 0 + int i; +#if 0 fprintf(stderr, "MSL: "); for (i=0;i<6+comm[4];i++) fprintf(stderr, "%2x ", comm[i]); fprintf(stderr, "\n"); @@ -518,8 +518,8 @@ mode_select_1(Microtek_Scanner *ms) data[3] = ((ms->allow_calibrate) ? 0 : 0x02); /* | 0x01; */ if (DBG_LEVEL >= 192) { - int i; -#if 0 + int i; +#if 0 fprintf(stderr, "MSL1: "); for (i=0;i<6+0x0A;i++) fprintf(stderr, "%2x ", comm[i]); fprintf(stderr, "\n"); @@ -532,7 +532,7 @@ mode_select_1(Microtek_Scanner *ms) } - + /********************************************************************/ /* record mode_sense results in the mode_sense buffer */ /* (this is to tell if something catastrophic has happened */ @@ -556,7 +556,7 @@ save_mode_sense(Microtek_Scanner *ms) for (i=0; i<10; i++) ms->mode_sense_cache[i] = data[i]; if (DBG_LEVEL >= 192) { - unsigned int i; + unsigned int i; #if 0 fprintf(stderr, "SMS: "); for (i=0;isfd, comm, 6, data, &lenp); *match = 1; - for (i=0; i<10; i++) + for (i=0; i<10; i++) *match = *match && (ms->mode_sense_cache[i] == data[i]); if (DBG_LEVEL >= 192) { - unsigned int i; + unsigned int i; #if 0 fprintf(stderr, "CMS: "); - for (i=0;imode_sense_cache[i]); fprintf(stderr, "\n"); #endif MDBG_INIT("CMS: "); - for (i=0;imode_sense_cache[i]); MDBG_FINISH(192); @@ -611,10 +611,10 @@ compare_mode_sense(Microtek_Scanner *ms, int *match) return status; } - + /********************************************************************/ /* send mode_sense_1, and upset every scsi driver known to mankind */ -/********************************************************************/ +/********************************************************************/ #if 0 static SANE_Status mode_sense_1(Microtek_Scanner *ms) @@ -628,7 +628,7 @@ mode_sense_1(Microtek_Scanner *ms) data[2] = ms->bright_g; data[3] = ms->bright_b; if (DBG_LEVEL >= 192) { - int i; + int i; fprintf(stderr, "MS1: "); for (i=0;i<6+0x1E;i++) fprintf(stderr, "%2x ", comm[i]); fprintf(stderr, "\n"); @@ -639,23 +639,23 @@ mode_sense_1(Microtek_Scanner *ms) -/********************************************************************/ +/********************************************************************/ /* send "accessory" command */ -/********************************************************************/ +/********************************************************************/ static SANE_Status accessory(Microtek_Scanner *ms) { uint8_t comm[6] = { 0x10, 0, 0, 0, 0, 0 }; DBG(23, ".accessory...\n"); - comm[4] = + comm[4] = ((ms->useADF) ? 0x41 : 0x40) | ((ms->prescan) ? 0x18 : 0x10) | ((ms->transparency) ? 0x24 : 0x20) | ((ms->allowbacktrack) ? 0x82 : 0x80); if (DBG_LEVEL >= 192) { - int i; + int i; #if 0 fprintf(stderr, "AC: "); for (i=0;i<6;i++) fprintf(stderr, "%2x ", comm[i]); @@ -670,16 +670,16 @@ accessory(Microtek_Scanner *ms) -/********************************************************************/ +/********************************************************************/ /* start the scanner a-scannin' */ -/********************************************************************/ +/********************************************************************/ static SANE_Status start_scan(Microtek_Scanner *ms) { uint8_t comm[6] = { 0x1B, 0, 0, 0, 0, 0 }; DBG(23, ".start_scan...\n"); - comm[4] = + comm[4] = 0x01 | /* "start" */ ((ms->expandedresolution) ? 0x80 : 0) | ((ms->multibit) ? 0x40 : 0) | @@ -691,7 +691,7 @@ start_scan(Microtek_Scanner *ms) ((ms->filter == MS_FILT_BLUE) ? 0x18 : 0) ; if (DBG_LEVEL >= 192) { - int i; + int i; #if 0 fprintf(stderr, "SS: "); for (i=0;i<6;i++) fprintf(stderr, "%2x ", comm[i]); @@ -706,9 +706,9 @@ start_scan(Microtek_Scanner *ms) -/********************************************************************/ +/********************************************************************/ /* stop the scanner a-scannin' */ -/********************************************************************/ +/********************************************************************/ static SANE_Status stop_scan(Microtek_Scanner *ms) { @@ -716,8 +716,8 @@ stop_scan(Microtek_Scanner *ms) DBG(23, ".stop_scan...\n"); if (DBG_LEVEL >= 192) { - int i; -#if 0 + int i; +#if 0 fprintf(stderr, "SPS:"); for (i=0;i<6;i++) fprintf(stderr, "%2x ", comm[i]); fprintf(stderr, "\n"); @@ -729,11 +729,11 @@ stop_scan(Microtek_Scanner *ms) return sanei_scsi_cmd(ms->sfd, comm, 6, 0, 0); } - -/********************************************************************/ + +/********************************************************************/ /* get scan status */ -/********************************************************************/ +/********************************************************************/ static SANE_Status get_scan_status(Microtek_Scanner *ms, SANE_Int *busy, @@ -758,8 +758,8 @@ get_scan_status(Microtek_Scanner *ms, *busy = data[0]; *bytes_per_line = (data[1]) + (data[2] << 8); *lines = (data[3]) + (data[4] << 8) + (data[5] << 16); - - DBG(20, "get_scan_status(%lu): %d, %d, %d -> #%d\n", + + DBG(20, "get_scan_status(%lu): %d, %d, %d -> #%d\n", (u_long) lenp, *busy, *bytes_per_line, *lines, retry); DBG(20, "> %2x %2x %2x %2x %2x %2x\n", data[0], data[1], data[2], data[3], data[4], data[5]); @@ -770,20 +770,20 @@ get_scan_status(Microtek_Scanner *ms, sleep(M_GSS_WAIT * retry); } } while ((*busy != 0) && (retry < 4)); - + if (*busy == 0) return status; else return SANE_STATUS_IO_ERROR; } -/********************************************************************/ +/********************************************************************/ /* get scanlines from scanner */ -/********************************************************************/ +/********************************************************************/ static SANE_Status read_scan_data(Microtek_Scanner *ms, int lines, - uint8_t *buffer, + uint8_t *buffer, size_t *bufsize) { uint8_t comm[6] = { 0x08, 0, 0, 0, 0, 0 }; @@ -792,15 +792,15 @@ read_scan_data(Microtek_Scanner *ms, comm[2] = (lines >> 16) & 0xFF; comm[3] = (lines >> 8) & 0xFF; comm[4] = (lines) & 0xFF; - + return sanei_scsi_cmd(ms->sfd, comm, 6, buffer, bufsize); } - - -/********************************************************************/ + + +/********************************************************************/ /* download color LUT to scanner (if it takes one) */ -/********************************************************************/ +/********************************************************************/ static SANE_Status download_gamma(Microtek_Scanner *ms) { @@ -824,7 +824,7 @@ download_gamma(Microtek_Scanner *ms) } max_entry = (1 << bit_depth) - 1; - + DBG(23, ".download_gamma: %d entries of %d bytes, max %d\n", ms->gamma_entries, ms->gamma_entry_size, max_entry); commsize = 10 + (ms->gamma_entries * ms->gamma_entry_size); @@ -835,7 +835,7 @@ download_gamma(Microtek_Scanner *ms) return SANE_STATUS_NO_MEM; } data = comm + 10; - + comm[0] = 0x55; comm[1] = 0; comm[2] = 0x27; @@ -873,9 +873,9 @@ download_gamma(Microtek_Scanner *ms) do { SANE_Int *pl_lut; switch (pl) { - case 1: pl_lut = ms->red_lut; break; - case 2: pl_lut = ms->green_lut; break; - case 3: pl_lut = ms->blue_lut; break; + case 1: pl_lut = ms->red_lut; break; + case 2: pl_lut = ms->green_lut; break; + case 3: pl_lut = ms->blue_lut; break; default: DBG(23, ".download_gamma: uh, exceeded pl bound!\n"); free(comm); @@ -906,7 +906,7 @@ download_gamma(Microtek_Scanner *ms) if (ms->val[OPT_GAMMA_BIND].w == SANE_TRUE) { double gamma = SANE_UNFIX(ms->val[OPT_ANALOG_GAMMA].w); for (i=0; igamma_entries; i++) { - int val = (max_entry * + int val = (max_entry * pow((double) i / ((double) ms->gamma_entries - 1.0), 1.0 / gamma)); switch (ms->gamma_entry_size) { @@ -931,7 +931,7 @@ download_gamma(Microtek_Scanner *ms) default: gamma = 1.0; break; /* should never happen */ } for (i=0; igamma_entries; i++) { - int val = (max_entry * + int val = (max_entry * pow((double) i / ((double) ms->gamma_entries - 1.0), 1.0 / gamma)); switch (ms->gamma_entry_size) { @@ -949,15 +949,15 @@ download_gamma(Microtek_Scanner *ms) pl++; } while ((pl < 4) && (status == SANE_STATUS_GOOD)); } - } else { + } else { /***** No custom Gamma *****/ DBG(23, ".download_gamma: by default\n"); for (i=0; igamma_entries; i++) { /* int val = (((double) max_entry * (double) i / ((double) ms->gamma_entries - 1.0)) + 0.5); ROUNDING????*/ - int val = + int val = (double) max_entry * (double) i / - ((double) ms->gamma_entries - 1.0); + ((double) ms->gamma_entries - 1.0); switch (ms->gamma_entry_size) { case 1: data[i] = (uint8_t) val; @@ -975,9 +975,9 @@ download_gamma(Microtek_Scanner *ms) } -/********************************************************************/ +/********************************************************************/ /* magic command to start calibration */ -/********************************************************************/ +/********************************************************************/ static SANE_Status start_calibration(Microtek_Scanner *ms) { @@ -985,7 +985,7 @@ start_calibration(Microtek_Scanner *ms) DBG(23, ".start_calibrate...\n"); if (DBG_LEVEL >= 192) { - int i; + int i; #if 0 fprintf(stderr, "STCal:"); for (i=0;i<8;i++) fprintf(stderr, "%2x ", comm[i]); @@ -995,14 +995,14 @@ start_calibration(Microtek_Scanner *ms) for (i=0;i<8;i++) MDBG_ADD("%2x ", comm[i]); MDBG_FINISH(192); } - return sanei_scsi_cmd(ms->sfd, comm, 8, 0, 0); + return sanei_scsi_cmd(ms->sfd, comm, 8, 0, 0); } - -/********************************************************************/ + +/********************************************************************/ /* magic command to download calibration values */ -/********************************************************************/ +/********************************************************************/ static SANE_Status download_calibration(Microtek_Scanner *ms, uint8_t *comm, uint8_t letter, int linewidth) @@ -1042,7 +1042,7 @@ download_calibration(Microtek_Scanner *ms, uint8_t *comm, /********************************************************************/ /* Initialize the options registry */ /********************************************************************/ -static SANE_Status +static SANE_Status init_options(Microtek_Scanner *ms) { int i; @@ -1136,7 +1136,7 @@ init_options(Microtek_Scanner *ms) sod[OPT_NEGATIVE].title = SANE_TITLE_NEGATIVE; sod[OPT_NEGATIVE].desc = SANE_DESC_NEGATIVE; sod[OPT_NEGATIVE].type = SANE_TYPE_BOOL; - sod[OPT_NEGATIVE].cap |= + sod[OPT_NEGATIVE].cap |= (ms->dev->info.modes & MI_MODES_NEGATIVE) ? 0 : SANE_CAP_INACTIVE; val[OPT_NEGATIVE].w = SANE_FALSE; @@ -1171,7 +1171,7 @@ init_options(Microtek_Scanner *ms) source_list[i] = NULL; sod[OPT_SOURCE].constraint.string_list = source_list; sod[OPT_SOURCE].size = max_string_size(source_list); - if (i < 2) + if (i < 2) sod[OPT_SOURCE].cap |= SANE_CAP_INACTIVE; val[OPT_SOURCE].s = strdup(source_list[0]); } @@ -1179,7 +1179,7 @@ init_options(Microtek_Scanner *ms) sod[OPT_PREVIEW].name = SANE_NAME_PREVIEW; sod[OPT_PREVIEW].title = SANE_TITLE_PREVIEW; sod[OPT_PREVIEW].desc = SANE_DESC_PREVIEW; - sod[OPT_PREVIEW].type = SANE_TYPE_BOOL; + sod[OPT_PREVIEW].type = SANE_TYPE_BOOL; sod[OPT_PREVIEW].unit = SANE_UNIT_NONE; sod[OPT_PREVIEW].size = sizeof(SANE_Word); val[OPT_PREVIEW].w = SANE_FALSE; @@ -1224,10 +1224,10 @@ init_options(Microtek_Scanner *ms) sod[OPT_BR_Y].unit = SANE_UNIT_MM; sod[OPT_BR_Y].size = sizeof(SANE_Word); sod[OPT_BR_Y].constraint_type = SANE_CONSTRAINT_RANGE; - - sod[OPT_TL_X].constraint.range = + + sod[OPT_TL_X].constraint.range = sod[OPT_BR_X].constraint.range = &(ms->dev->info.doc_x_range); - sod[OPT_TL_Y].constraint.range = + sod[OPT_TL_Y].constraint.range = sod[OPT_BR_Y].constraint.range = &(ms->dev->info.doc_y_range); /* set default scan region to be maximum size */ @@ -1262,7 +1262,7 @@ init_options(Microtek_Scanner *ms) sod[OPT_BRIGHTNESS].type = SANE_TYPE_INT; sod[OPT_BRIGHTNESS].unit = SANE_UNIT_PERCENT; sod[OPT_BRIGHTNESS].size = sizeof(SANE_Word); - sod[OPT_BRIGHTNESS].cap |= + sod[OPT_BRIGHTNESS].cap |= ((ms->dev->info.extra_cap & MI_EXCAP_OFF_CTL) ? 0: SANE_CAP_INACTIVE); sod[OPT_BRIGHTNESS].constraint_type = SANE_CONSTRAINT_RANGE; sod[OPT_BRIGHTNESS].constraint.range = &brightness_range; @@ -1308,8 +1308,8 @@ init_options(Microtek_Scanner *ms) } else { sod[OPT_HIGHLIGHT].cap |= SANE_CAP_INACTIVE; sod[OPT_SHADOW].cap |= SANE_CAP_INACTIVE; - } - + } + sod[OPT_MIDTONE].name = "midtone"; sod[OPT_MIDTONE].title = "Midtone Level"; sod[OPT_MIDTONE].desc = "Midtone Level"; @@ -1465,7 +1465,7 @@ init_options(Microtek_Scanner *ms) if (!(ms->do_real_calib)) { sod[OPT_CALIB_ONCE].cap |= SANE_CAP_INACTIVE; val[OPT_CALIB_ONCE].w = SANE_FALSE; - } else + } else val[OPT_CALIB_ONCE].w = SANE_TRUE; /* @@ -1499,7 +1499,7 @@ parse_inquiry(Microtek_Info *mi, unsigned char *result) 0x32,0x2e,0x33,0x30,0x53,0x43,0x53,0x49,0x20,0x46,0x2f,0x57,0x56,0x33,0x2e,0x31, 0x20,0x43,0x54,0x4c,0x35,0x33,0x38,0x30,0x03,0x4f,0x8c,0xc5,0x00,0xee,0x5b,0x43, 0x01,0x01,0x02,0x00,0x00,0x03,0x00,0x01,0x00,0x4a,0x01,0x04,0x00,0x00,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff }; #endif DBG(15, "parse_inquiry...\n"); @@ -1511,14 +1511,14 @@ parse_inquiry(Microtek_Info *mi, unsigned char *result) mi->model_name[16] = 0; mi->revision_num[4] = 0; mi->vendor_string[20] = 0; - + mi->device_type = (SANE_Byte)(result[0] & 0x1f); mi->SCSI_firmware_ver_major = (SANE_Byte)((result[1] & 0xf0) >> 4); mi->SCSI_firmware_ver_minor = (SANE_Byte)(result[1] & 0x0f); mi->scanner_firmware_ver_major = (SANE_Byte)((result[2] & 0xf0) >> 4); mi->scanner_firmware_ver_minor = (SANE_Byte)(result[2] & 0x0f); mi->response_data_format = (SANE_Byte)(result[3]); - + mi->res_step = (SANE_Byte)(result[56] & 0x03); mi->modes = (SANE_Byte)(result[57]); mi->pattern_count = (SANE_Int)(result[58] & 0x7f); @@ -1526,7 +1526,7 @@ parse_inquiry(Microtek_Info *mi, unsigned char *result) mi->feed_type = (SANE_Byte)(result[59] & 0x0F); mi->compress_type = (SANE_Byte)(result[59] & 0x30); mi->unit_type = (SANE_Byte)(result[59] & 0xC0); - + mi->doc_size_code = (SANE_Byte)result[60]; /* we'll compute the max sizes after we know base resolution... */ @@ -1536,7 +1536,7 @@ parse_inquiry(Microtek_Info *mi, unsigned char *result) mi->cont_settings = (SANE_Int)(result[72]); mi->min_contrast = -42; mi->max_contrast = (mi->cont_settings * 7) - 49; - + mi->exp_settings = (SANE_Int)(result[61] & 0x0f); if ((SANE_Int)(result[73])) mi->exp_settings = (SANE_Int)(result[73]); @@ -1548,7 +1548,7 @@ parse_inquiry(Microtek_Info *mi, unsigned char *result) mi->max_contrast = 49; if (mi->contrast_vals) mi->max_contrast = (mi->contrast_vals * 7) - 49; - + mi->exposure_vals = (SANE_Int)(result[73]); mi->min_exposure = -18; mi->max_exposure = 21; @@ -1606,7 +1606,7 @@ parse_inquiry(Microtek_Info *mi, unsigned char *result) mi->max_x = 8.5 * mi->base_resolution - 1; mi->max_y = 14.0 * mi->base_resolution - 1; break; - case 0x01: + case 0x01: mi->max_x = 8.5 * mi->base_resolution - 1; mi->max_y = 11.0 * mi->base_resolution - 1; break; @@ -1625,15 +1625,15 @@ parse_inquiry(Microtek_Info *mi, unsigned char *result) case 0x05: mi->max_x = 8.3 * mi->base_resolution - 1; mi->max_y = 14.0 * mi->base_resolution - 1; - break; + break; case 0x06: mi->max_x = 8.3 * mi->base_resolution - 1; mi->max_y = 13.5 * mi->base_resolution - 1; - break; + break; case 0x07: mi->max_x = 8.0 * mi->base_resolution - 1; mi->max_y = 14.0 * mi->base_resolution - 1; - break; + break; case 0x80: /* Slide format, size is mm */ mi->max_x = (35.0 / MM_PER_INCH) * mi->base_resolution - 1; @@ -1666,9 +1666,9 @@ parse_inquiry(Microtek_Info *mi, unsigned char *result) mi->doc_y_range.max = SANE_FIX((float)mi->max_y / base_res_dpmm); mi->doc_y_range.quant = SANE_FIX(0); } - - mi->source_options = (SANE_Byte)(result[63]); - + + mi->source_options = (SANE_Byte)(result[63]); + mi->expanded_resolution = (result[64] & 0x01); /* my E6 reports exp-res capability incorrectly */ if ((mi->model_code == 0x66) || (mi->model_code == 0x63)) { @@ -1685,27 +1685,27 @@ parse_inquiry(Microtek_Info *mi, unsigned char *result) mi->enhance_cap = (result[65] & 0x03); - /* + /* switch (result[66] & 0x0F) { case 0x00: mi->max_lookup_size = 0; break; case 0x01: mi->max_lookup_size = 256; break; case 0x03: mi->max_lookup_size = 1024; break; case 0x05: mi->max_lookup_size = 4096; break; case 0x09: mi->max_lookup_size = 65536; break; - default: + default: mi->max_lookup_size = 0; DBG(15, "parse_inquiry: Unknown gamma LUT size! 0x%x\n", result[66]); } */ - + /* This is not how the vague documentation specifies this register. We're going to take it literally here -- i.e. if the bit is set, the scanner supports the value, otherwise it doesn't. (The docs say all lower values are always supported. This is - not the case for the StudioScan IIsi, at least, which only + not the case for the StudioScan IIsi, at least, which only specifies 0x02==1024-byte table, and only supports that, too.) - + All-in-all, it doesn't matter, since we take the largest allowed LUT size anyway. */ @@ -1717,7 +1717,7 @@ parse_inquiry(Microtek_Info *mi, unsigned char *result) mi->max_lookup_size = 1024; else if (result[66] & 0x01) mi->max_lookup_size = 256; - else + else mi->max_lookup_size = 0; /* my E6 reports incorrectly */ @@ -1748,13 +1748,13 @@ parse_inquiry(Microtek_Info *mi, unsigned char *result) DBG(15, "parse_inquiry: Unknown gamma max val! 0x%x\n", result[66]); } - + mi->fast_color_preview = (SANE_Byte)(result[67] & 0x01); mi->xfer_format_select = (SANE_Byte)(result[68] & 0x01); mi->color_sequence = (SANE_Byte)(result[69] & 0x7f); mi->does_3pass = (SANE_Byte)(!(result[69] & 0x80)); mi->does_mode1 = (SANE_Byte)(result[71] & 0x01); - + mi->bit_formats = (SANE_Byte)(result[74] & 0x0F); mi->extra_cap = (SANE_Byte)(result[75] & 0x07); @@ -1780,7 +1780,7 @@ parse_inquiry(Microtek_Info *mi, unsigned char *result) /********************************************************************/ /* Dump all we know about scanner to stderr */ /********************************************************************/ -static SANE_Status +static SANE_Status dump_inquiry(Microtek_Info *mi, unsigned char *result) { int i; @@ -1802,12 +1802,12 @@ dump_inquiry(Microtek_Info *mi, unsigned char *result) mi->vendor_id, mi->model_name); DBG(1, "Vendor Specific String: '%s'\n", mi->vendor_string); DBG(1, "Firmware Rev: '%s'\n", mi->revision_num); - DBG(1, + DBG(1, "SCSI F/W version: %1d.%1d Scanner F/W version: %1d.%1d\n", mi->SCSI_firmware_ver_major, mi->SCSI_firmware_ver_minor, mi->scanner_firmware_ver_major, mi->scanner_firmware_ver_minor); DBG(1, "Response data format: 0x%02x\n", mi->response_data_format); - + DBG(1, "===== Imaging Capabilities...\n"); DBG(1, "Modes: %s%s%s%s%s%s%s\n", (mi->modes & MI_MODES_LINEART) ? "Lineart " : "", @@ -1817,7 +1817,7 @@ dump_inquiry(Microtek_Info *mi, unsigned char *result) (mi->modes & MI_MODES_TRANSMSV) ? "(X-msv) " : "", (mi->modes & MI_MODES_ONEPASS) ? "(OnePass) " : "", (mi->modes & MI_MODES_NEGATIVE) ? "(Negative) " : ""); - DBG(1, + DBG(1, "Resolution Step Sizes: %s%s Expanded Resolution Support? %s%s\n", (mi->res_step & MI_RESSTEP_1PER) ? "1% " : "", (mi->res_step & MI_RESSTEP_5PER) ? "5%" : "", @@ -1849,11 +1849,11 @@ dump_inquiry(Microtek_Info *mi, unsigned char *result) DBG(1, "Digital brightness/offset? %s\n", (mi->extra_cap & MI_EXCAP_OFF_CTL) ? "yes" : "no"); /* - fprintf(stderr, + fprintf(stderr, "Gamma Table Size: %d entries of %d bytes (max. value: %d)\n", mi->max_lookup_size, mi->gamma_size, mi->max_gamma_val); */ - DBG(1, + DBG(1, "Gamma Table Size: %d entries of %d bytes (max. depth: %d)\n", mi->max_lookup_size, mi->gamma_size, mi->max_gamma_bit_depth); @@ -1861,7 +1861,7 @@ dump_inquiry(Microtek_Info *mi, unsigned char *result) DBG(1, "Feed type: %s%s ADF support? %s\n", (mi->feed_type & MI_FEED_FLATBED) ? "flatbed " : "", (mi->feed_type & MI_FEED_EDGEFEED) ? "edge-feed " : "", - (mi->feed_type & MI_FEED_AUTOSUPP) ? "yes" : "no"); + (mi->feed_type & MI_FEED_AUTOSUPP) ? "yes" : "no"); DBG(1, "Document Feeder Support? %s Feeder Backtracking? %s\n", (mi->source_options & MI_SRC_FEED_SUPP) ? "yes" : "no ", (mi->source_options & MI_SRC_FEED_BT) ? "yes" : "no "); @@ -1882,15 +1882,15 @@ dump_inquiry(Microtek_Info *mi, unsigned char *result) (mi->xfer_format_select) ? "yes" : "no"); MDBG_INIT("Color Transfer Sequence: "); switch (mi->color_sequence) { - case MI_COLSEQ_PLANE: + case MI_COLSEQ_PLANE: MDBG_ADD("plane-by-plane (3-pass)"); break; - case MI_COLSEQ_PIXEL: + case MI_COLSEQ_PIXEL: MDBG_ADD("pixel-by-pixel RGB"); break; case MI_COLSEQ_RGB: MDBG_ADD("line-by-line, R-G-B sequence"); break; case MI_COLSEQ_NONRGB: MDBG_ADD("line-by-line, non-sequential with headers"); break; - case MI_COLSEQ_2PIXEL: + case MI_COLSEQ_2PIXEL: MDBG_ADD("2pixel-by-2pixel RRGGBB"); break; default: MDBG_ADD("UNKNOWN CODE (0x%02x)", mi->color_sequence); @@ -1905,7 +1905,7 @@ dump_inquiry(Microtek_Info *mi, unsigned char *result) (mi->extra_cap & MI_EXCAP_DIS_LNTBL) ? "yes" : "no"); DBG(1, "Can Disable Start-of-Scan Recalibration? %s\n", (mi->extra_cap & MI_EXCAP_DIS_RECAL) ? "yes" : "no"); - + DBG(1, "Internal expanded expansion? %s\n", mi->does_expansion ? "yes" : "no"); /* @@ -1922,7 +1922,7 @@ dump_inquiry(Microtek_Info *mi, unsigned char *result) /********************************************************************/ /* Dump all we know about some unknown scanner to stderr */ /********************************************************************/ -static SANE_Status +static SANE_Status dump_suspect_inquiry(unsigned char *result) { int i; @@ -1953,7 +1953,7 @@ dump_suspect_inquiry(unsigned char *result) strncpy(revision_num, (char *)&result[32], 4); vendor_id[8] = 0; model_name[16] = 0; - revision_num[5] = 0; + revision_num[5] = 0; device_type = (SANE_Byte)(result[0] & 0x1f); SCSI_firmware_ver_major = (SANE_Byte)((result[1] & 0xf0) >> 4); SCSI_firmware_ver_minor = (SANE_Byte)(result[1] & 0x0f); @@ -1969,7 +1969,7 @@ dump_suspect_inquiry(unsigned char *result) DBG(1, "Vendor Name: '%s' Model Name: '%s'\n", vendor_id, model_name); DBG(1, "Firmware Rev: '%s'\n", revision_num); - DBG(1, + DBG(1, "SCSI F/W version: %1d.%1d Scanner F/W version: %1d.%1d\n", SCSI_firmware_ver_major, SCSI_firmware_ver_minor, scanner_firmware_ver_major, scanner_firmware_ver_minor); @@ -2035,7 +2035,7 @@ id_microtek(uint8_t *result, char **model_string) case 0x5f : *model_string = "ScanMaker E3"; break; case 0x62 : - if (!(strncmp("Polaroid", (char *)&(result[8]), 8))) + if (!(strncmp("Polaroid", (char *)&(result[8]), 8))) *model_string = "Polaroid SprintScan 35/LE"; else *model_string = "ScanMaker 35t+"; @@ -2123,7 +2123,7 @@ id_microtek(uint8_t *result, char **model_string) /********************************************************************/ /* Try to attach a device as a Microtek scanner */ /********************************************************************/ -static SANE_Status +static SANE_Status attach_scanner(const char *devicename, Microtek_Device **devp) { Microtek_Device *dev; @@ -2165,7 +2165,7 @@ attach_scanner(const char *devicename, Microtek_Device **devp) if (DBG_LEVEL >= 5) dump_suspect_inquiry(result); return SANE_STATUS_INVAL; } - + dev=malloc(sizeof(*dev)); if (!dev) return SANE_STATUS_NO_MEM; memset(dev, 0, sizeof(*dev)); @@ -2217,7 +2217,7 @@ static SANE_Status end_scan(Microtek_Scanner *s, SANE_Status ostat) /* stop the scanner */ if (s->scan_started) { status = stop_scan(s); - if (status != SANE_STATUS_GOOD) + if (status != SANE_STATUS_GOOD) DBG(23, "end_scan: OY! on stop_scan\n"); s->scan_started = SANE_FALSE; } @@ -2285,7 +2285,7 @@ static void sort_values(int *result, uint8_t *scanline[], int pix) /********************************************************************/ -static void calc_calibration(uint8_t *caldata, uint8_t *scanline[], +static void calc_calibration(uint8_t *caldata, uint8_t *scanline[], int pixels) { int i,j; @@ -2303,14 +2303,14 @@ static void calc_calibration(uint8_t *caldata, uint8_t *scanline[], q3 = sorted[STRIPS * 3 / 4]; /* third quartile */ bot = q1 - 3 * (q3 - q1) / 2; /* quick'n'easy bounds */ top = q3 + 3 * (q3 - q1) / 2; - + for (j=0; j= bot) && (sorted[j] <= top)) { sum += sorted[j]; count++; } } - if (count) + if (count) caldata[i] = (sum + (count / 2)) / count; else { DBG(23, "zero: i=%d b/t=%d/%d ", i, bot, top); @@ -2343,9 +2343,9 @@ static SANE_Status do_real_calibrate(Microtek_Scanner *s) uint8_t letter; int i, spot; int nmax, ntoget, nleft; - + DBG(10, "do_real_calibrate...\n"); - + /* tell scanner to read it's little chart */ if ((status = start_calibration(s)) != SANE_STATUS_GOOD) return status; if ((status = get_scan_status(s, &busy, &linewidth, &lines)) @@ -2372,7 +2372,7 @@ static SANE_Status do_real_calibrate(Microtek_Scanner *s) buffsize = ntoget * 3 * linewidth; DBG(23, "...nleft %d toget %d size %lu spot %d input+spot %p\n", nleft, ntoget, (u_long) buffsize, spot, input+spot); - if ((statusA = read_scan_data(s, ntoget, input+spot, &buffsize)) + if ((statusA = read_scan_data(s, ntoget, input+spot, &buffsize)) != SANE_STATUS_GOOD) { DBG(23, "...read scan failed\n"); break; @@ -2409,7 +2409,7 @@ static SANE_Status do_real_calibrate(Microtek_Scanner *s) switch (letter) { case 'R': letter = 'G'; break; case 'G': letter = 'B'; break; - case 'B': + case 'B': default: letter = 'X'; break; } } @@ -2431,9 +2431,9 @@ static SANE_Status do_precalibrate(SANE_Handle handle) Microtek_Scanner *s = handle; SANE_Status status, statusA; SANE_Int busy, linewidth, lines; - + DBG(10, "do_precalibrate...\n"); - + if ((status = wait_ready(s)) != SANE_STATUS_GOOD) return status; { SANE_Int y1 = s->y1; @@ -2441,7 +2441,7 @@ static SANE_Status do_precalibrate(SANE_Handle handle) /* some small range, but large enough to cause the scanner to think it'll scan *something*... */ s->y1 = 0; - s->y2 = + s->y2 = (s->resolution > s->dev->info.base_resolution) ? 4 : 4 * s->dev->info.base_resolution / s->resolution; status = scanning_frame(s); @@ -2450,7 +2450,7 @@ static SANE_Status do_precalibrate(SANE_Handle handle) if (status != SANE_STATUS_GOOD) return status; } - if (s->dev->info.source_options & + if (s->dev->info.source_options & (MI_SRC_FEED_BT | MI_SRC_HAS_TRANS | MI_SRC_FEED_SUPP | MI_SRC_HAS_FEED)) { /* ZZZZZZZZZZZ */ if ((status = accessory(s)) != SANE_STATUS_GOOD) return status; @@ -2465,10 +2465,10 @@ static SANE_Status do_precalibrate(SANE_Handle handle) s->allow_calibrate = allow_calibrate; if (status != SANE_STATUS_GOOD) return status; } - + if ((status = wait_ready(s)) != SANE_STATUS_GOOD) return status; if ((status = start_scan(s)) != SANE_STATUS_GOOD) return status; - if ((statusA = get_scan_status(s, &busy, + if ((statusA = get_scan_status(s, &busy, &linewidth, &lines)) != SANE_STATUS_GOOD) { DBG(10, "do_precalibrate: get_scan_status fails\n"); } @@ -2492,7 +2492,7 @@ static SANE_Status finagle_precal(SANE_Handle handle) int match; /* try to check if scanner has been reset */ - /* if so, calibrate it + /* if so, calibrate it (either for real, or via a fake scan, with calibration */ /* (but only bother if you *could* disable calibration) */ DBG(23, "finagle_precal...\n"); @@ -2523,7 +2523,7 @@ static SANE_Status finagle_precal(SANE_Handle handle) } else s->precal_record = MS_PRECAL_GRAY; } else - DBG(23, "finagle_precal: no precalibrate necessary.\n"); + DBG(23, "finagle_precal: no precalibrate necessary.\n"); } return SANE_STATUS_GOOD; } @@ -2544,7 +2544,7 @@ set_pass_parameters (SANE_Handle handle) switch (s->this_pass) { case 1: s->filter = MS_FILT_RED; - s->params.format = SANE_FRAME_RED; + s->params.format = SANE_FRAME_RED; s->params.last_frame = SANE_FALSE; break; case 2: @@ -2552,7 +2552,7 @@ set_pass_parameters (SANE_Handle handle) s->params.format = SANE_FRAME_GREEN; s->params.last_frame = SANE_FALSE; break; - case 3: + case 3: s->filter = MS_FILT_BLUE; s->params.format = SANE_FRAME_BLUE; s->params.last_frame = SANE_TRUE; @@ -2588,7 +2588,7 @@ static SANE_Status pack_flat_data(Microtek_Scanner *s, size_t nlines) size_t nbytes = nlines * rb->bpl; size_t start = (rb->head_complete + rb->complete_count) % rb->size; - size_t max_xfer = + size_t max_xfer = (start < rb->head_complete) ? (rb->head_complete - start) : (rb->size - start + rb->head_complete); @@ -2616,14 +2616,14 @@ static SANE_Status pack_flat_data(Microtek_Scanner *s, size_t nlines) size_t i; double x1, x2, n1, n2; for (i = 0, x1 = 0.0, x2 = s->exp_aspect, n1 = 0.0, n2 = floor(x2); - i < rb->bpl; + i < rb->bpl; i++) { byte = 0; - for (bit=0; - bit < 8; + for (bit=0; + bit < 8; bit++, x1 = x2, n1 = n2, x2 += s->exp_aspect, n2 = floor(x2)) { /* #define getbit(byte, index) (((byte)>>(index))&1) */ - byte |= + byte |= (( (x2 == n2) ? (((sb[(int)n1 / 8])>>(7 - ((int)n1) % 8))&1) : @@ -2638,13 +2638,13 @@ static SANE_Status pack_flat_data(Microtek_Scanner *s, size_t nlines) sb += s->pixel_bpl; } } else { /* multibit scan (8 is assumed!) */ - for (line=0; lineexp_aspect, n1 = 0.0, n2 = floor(x2); - i < s->dest_ppl; + i < s->dest_ppl; i++, x1 = x2, n1 = n2, x2 += s->exp_aspect, n2 = floor(x2)) { - db[pos] = + db[pos] = (x2 == n2) ? sb[(int)n1] : (int)(((double)sb[(int)n1] * (n2 - x1) + @@ -2683,12 +2683,12 @@ pack_seqrgb_data (Microtek_Scanner *s, size_t nlines) size_t completed; size_t spot; SANE_Byte id; - + { size_t ar, ag, ab; /* allowed additions */ size_t dr, dg, db; /* additions which will occur */ SANE_Status status; - + dr = dg = db = nlines * rb->bpl; ar = rb->size - (rb->complete_count + rb->red_extra * 3); ag = rb->size - (rb->complete_count + rb->green_extra * 3); @@ -2700,7 +2700,7 @@ pack_seqrgb_data (Microtek_Scanner *s, size_t nlines) if ((dr > ar) || (dg > ag) || (db > ab)) { - size_t increase = 0; + size_t increase = 0; if (dr > ar) increase = (dr - ar); if (dg > ag) increase = MAX(increase, (dg - ag)); if (db > ab) increase = MAX(increase, (db - ab)); @@ -2725,9 +2725,9 @@ pack_seqrgb_data (Microtek_Scanner *s, size_t nlines) int i; double x1, x2, n1, n2; for (i = 0, x1 = 0.0, x2 = s->exp_aspect, n1 = 0.0, n2 = floor(x2); - i < s->dest_ppl; + i < s->dest_ppl; i++, x1 = x2, n1 = n2, x2 += s->exp_aspect, n2 = floor(x2)) { - db[spot] = + db[spot] = (x2 == n2) ? sb[(int)n1] : (int)(((double)sb[(int)n1] * (n2 - x1) + @@ -2756,9 +2756,9 @@ pack_seqrgb_data (Microtek_Scanner *s, size_t nlines) rb->red_extra -= completed; rb->green_extra -= completed; rb->blue_extra -= completed; - + DBG(18, "pack_seq: extra r: %lu g: %lu b: %lu\n", - (u_long)rb->red_extra, + (u_long)rb->red_extra, (u_long)rb->green_extra, (u_long)rb->blue_extra); DBG(18, "pack_seq: completed: %lu complete: %lu\n", @@ -2767,21 +2767,21 @@ pack_seqrgb_data (Microtek_Scanner *s, size_t nlines) return SANE_STATUS_GOOD; } - + /********************************************************************/ /* Process non-sequential R,G, and B scan-lines */ /********************************************************************/ static SANE_Status pack_goofyrgb_data(Microtek_Scanner *s, size_t nlines) { - ring_buffer *rb = s->rb; + ring_buffer *rb = s->rb; unsigned int seg; /* , i;*/ SANE_Byte *db; SANE_Byte *sb = s->scsi_buffer; size_t completed; size_t spot; SANE_Byte id; - + /* prescan to decide if ring should be expanded */ { size_t ar, ag, ab; /* allowed additions */ @@ -2790,7 +2790,7 @@ pack_goofyrgb_data(Microtek_Scanner *s, size_t nlines) SANE_Byte *pt; for (dr = dg = db = 0, seg = 0, pt = s->scsi_buffer + 1; - seg < nlines * 3; + seg < nlines * 3; seg++, pt += s->ppl + 2) { switch (*pt) { case 'R': dr += rb->bpl; break; @@ -2809,7 +2809,7 @@ pack_goofyrgb_data(Microtek_Scanner *s, size_t nlines) if ((dr > ar) || (dg > ag) || (db > ab)) { - size_t increase = 0; + size_t increase = 0; if (dr > ar) increase = (dr - ar); if (dg > ag) increase = MAX(increase, (dg - ag)); if (db > ab) increase = MAX(increase, (db - ab)); @@ -2838,9 +2838,9 @@ pack_goofyrgb_data(Microtek_Scanner *s, size_t nlines) int i; double x1, x2, n1, n2; for (i = 0, x1 = 0.0, x2 = s->exp_aspect, n1 = 0.0, n2 = floor(x2); - i < s->dest_ppl; + i < s->dest_ppl; i++, x1 = x2, n1 = n2, x2 += s->exp_aspect, n2 = floor(x2)) { - db[spot] = + db[spot] = (x2 == n2) ? sb[(int)n1] : (int)(((double)sb[(int)n1] * (n2 - x1) + @@ -2868,9 +2868,9 @@ pack_goofyrgb_data(Microtek_Scanner *s, size_t nlines) rb->red_extra -= completed; rb->green_extra -= completed; rb->blue_extra -= completed; - + DBG(18, "pack_goofy: extra r: %lu g: %lu b: %lu\n", - (u_long)rb->red_extra, + (u_long)rb->red_extra, (u_long)rb->green_extra, (u_long)rb->blue_extra); DBG(18, "pack_goofy: completed: %lu complete: %lu\n", @@ -2878,7 +2878,7 @@ pack_goofyrgb_data(Microtek_Scanner *s, size_t nlines) return SANE_STATUS_GOOD; } - + /********************************************************************/ @@ -2891,14 +2891,14 @@ pack_seq2r2g2b_data(Microtek_Scanner *s, size_t nlines) SANE_Status status; ring_buffer *rb = s->rb; size_t nbytes = nlines * rb->bpl; - + size_t start = (rb->head_complete + rb->complete_count) % rb->size; - size_t max_xfer = + size_t max_xfer = (start < rb->head_complete) ? (rb->head_complete - start) : (rb->size - start + rb->head_complete); size_t length = MIN(nbytes, max_xfer); - + if (nbytes > max_xfer) { DBG(23, "pack_2r2g2b: must expand ring, %lu + %lu\n", (u_long)rb->size, (u_long)(nbytes - max_xfer)); @@ -2908,7 +2908,7 @@ pack_seq2r2g2b_data(Microtek_Scanner *s, size_t nlines) { unsigned int line; int p; - size_t pos = start; + size_t pos = start; SANE_Byte *sb = s->scsi_buffer; SANE_Byte *db = rb->base; @@ -2968,11 +2968,11 @@ read_from_scanner (Microtek_Scanner *s, int *nlines) DBG(18, "read_from_scanner: no gss/no unscanned\n"); remaining = 0; } - + *nlines = MIN(remaining, s->max_scsi_lines); DBG(18, "sane_read: max_scsi: %d, rem: %d, nlines: %d\n", s->max_scsi_lines, remaining, *nlines); - + /* grab them bytes! (only if the scanner still has bytes to give...) */ if (*nlines > 0) { buffsize = *nlines * (s->pixel_bpl + s->header_bpl);/* == "* linewidth" */ @@ -3002,7 +3002,7 @@ pack_into_ring(Microtek_Scanner *s, int nlines) switch (s->line_format) { case MS_LNFMT_FLAT: status = pack_flat_data(s, nlines); break; - case MS_LNFMT_SEQ_RGB: + case MS_LNFMT_SEQ_RGB: status = pack_seqrgb_data(s, nlines); break; case MS_LNFMT_GOOFY_RGB: status = pack_goofyrgb_data(s, nlines); break; @@ -3081,13 +3081,13 @@ sane_init(SANE_Int *version_code, SANE_Auth_Callback authorize) DBG(23, "sane_init: config-> %s\n", dev_name); if (dev_name[0] == '#') continue; /* ignore comments */ if (!(strncmp("noprecal", dev_name, 8))) { - DBG(23, + DBG(23, "sane_init: Clever Precalibration will be forcibly disabled...\n"); inhibit_clever_precal = SANE_TRUE; continue; } if (!(strncmp("norealcal", dev_name, 9))) { - DBG(23, + DBG(23, "sane_init: Real calibration will be forcibly disabled...\n"); inhibit_real_calib = SANE_TRUE; continue; @@ -3106,7 +3106,7 @@ sane_init(SANE_Int *version_code, SANE_Auth_Callback authorize) /* sane_get_devices */ /********************************************************************/ SANE_Status -sane_get_devices(const SANE_Device ***device_list, +sane_get_devices(const SANE_Device ***device_list, SANE_Bool local_only) { Microtek_Device *dev; @@ -3168,14 +3168,14 @@ sane_open(SANE_String_Const devicename, /* initialize scanner dependent stuff */ DBG(23, "sane_open: initialize scanner dependent stuff...\n"); /* ZZZZZZZZZZZZZZ */ - scanner->unit_type = + scanner->unit_type = (dev->info.unit_type & MI_UNIT_PIXELS) ? MS_UNIT_PIXELS : MS_UNIT_18INCH; scanner->res_type = (dev->info.res_step & MI_RESSTEP_1PER) ? MS_RES_1PER : MS_RES_5PER; - scanner->midtone_support = + scanner->midtone_support = (dev->info.enhance_cap & MI_ENH_CAP_MIDTONE) ? SANE_TRUE : SANE_FALSE; - scanner->paper_length = - (scanner->unit_type == MS_UNIT_PIXELS) ? + scanner->paper_length = + (scanner->unit_type == MS_UNIT_PIXELS) ? dev->info.max_y : (SANE_Int)((double)dev->info.max_y * 8.0 / (double)dev->info.base_resolution); @@ -3202,7 +3202,7 @@ sane_open(SANE_String_Const devicename, scanner->do_clever_precal = SANE_TRUE; } else { DBG(23, "sane_open: All calibration routines disabled.\n"); - scanner->allow_calibrate = SANE_TRUE; + scanner->allow_calibrate = SANE_TRUE; scanner->do_real_calib = SANE_FALSE; scanner->do_clever_precal = SANE_FALSE; } @@ -3227,7 +3227,7 @@ sane_open(SANE_String_Const devicename, scanner->gray_lut = calloc(scanner->gamma_entries, sizeof(scanner->gray_lut[0])); - scanner->red_lut = calloc(scanner->gamma_entries, + scanner->red_lut = calloc(scanner->gamma_entries, sizeof(scanner->red_lut[0])); scanner->green_lut = calloc(scanner->gamma_entries, sizeof(scanner->green_lut[0])); @@ -3246,7 +3246,7 @@ sane_open(SANE_String_Const devicename, free(scanner->blue_lut); } for (j=0; jgamma_entries; j += scanner->gamma_entry_size) { - v = (SANE_Int) + v = (SANE_Int) ((double) j * (double) max_entry / ((double) scanner->gamma_entries - 1.0) + 0.5); scanner->gray_lut[j] = v; @@ -3278,7 +3278,7 @@ sane_open(SANE_String_Const devicename, /* clear out that clever cache, so it doesn't match anything */ { int j; - for (j=0; j<10; j++) + for (j=0; j<10; j++) scanner->mode_sense_cache[j] = 0; scanner->precal_record = MS_PRECAL_NONE; } @@ -3347,7 +3347,7 @@ sane_get_option_descriptor (SANE_Handle handle, /********************************************************************/ /* sane_control_option */ /********************************************************************/ -SANE_Status +SANE_Status sane_control_option (SANE_Handle handle, SANE_Int option, SANE_Action action, @@ -3429,12 +3429,12 @@ sane_control_option (SANE_Handle handle, return SANE_STATUS_INVAL; } break; - + case SANE_ACTION_SET_VALUE: { status = sanei_constrain_value(sod + option, value, info); if (status != SANE_STATUS_GOOD) return status; - + switch (option) { /* set word options... */ case OPT_TL_X: @@ -3457,12 +3457,12 @@ sane_control_option (SANE_Handle handle, case OPT_ANALOG_GAMMA_B: val[option].w = *(SANE_Word *)value; return SANE_STATUS_GOOD; - + case OPT_HIGHLIGHT: case OPT_SHADOW: case OPT_MIDTONE: val[option].w = *(SANE_Word *)value; - /* we need to (silently) make sure shadow <= midtone <= highlight */ + /* we need to (silently) make sure shadow <= midtone <= highlight */ if (scanner->midtone_support) { if (val[OPT_SHADOW].w > val[OPT_MIDTONE].w) { if (option == OPT_SHADOW) @@ -3514,7 +3514,7 @@ sane_control_option (SANE_Handle handle, val[option].w = *(SANE_Word *) value; } else if (option == OPT_CUSTOM_GAMMA) { if (val[option].s) { - if (strcmp(value, val[option].s)) + if (strcmp(value, val[option].s)) if (info) *info |= SANE_INFO_RELOAD_OPTIONS; free(val[option].s); } @@ -3526,7 +3526,7 @@ sane_control_option (SANE_Handle handle, sod[OPT_GAMMA_VECTOR_R].cap |= SANE_CAP_INACTIVE; sod[OPT_GAMMA_VECTOR_G].cap |= SANE_CAP_INACTIVE; sod[OPT_GAMMA_VECTOR_B].cap |= SANE_CAP_INACTIVE; - } + } if ( !(strcmp(val[OPT_CUSTOM_GAMMA].s, M_NONE)) || !(strcmp(val[OPT_CUSTOM_GAMMA].s, M_TABLE)) ) { sod[OPT_ANALOG_GAMMA].cap |= SANE_CAP_INACTIVE; @@ -3565,12 +3565,12 @@ sane_control_option (SANE_Handle handle, else if (!(strcmp(val[OPT_MODE].s, M_COLOR))) sod[OPT_GAMMA_BIND].cap &= ~SANE_CAP_INACTIVE; return SANE_STATUS_GOOD; - - case OPT_MODE: + + case OPT_MODE: if (val[option].s) { if (strcmp(val[option].s, value)) - if (info) + if (info) *info |= SANE_INFO_RELOAD_OPTIONS | SANE_INFO_RELOAD_PARAMS; free(val[option].s); } @@ -3586,7 +3586,7 @@ sane_control_option (SANE_Handle handle, { SANE_Bool Trueness = SANE_TRUE; SANE_Status status; - status = sane_control_option(handle, + status = sane_control_option(handle, OPT_GAMMA_BIND, SANE_ACTION_SET_VALUE, &Trueness, @@ -3619,7 +3619,7 @@ sane_control_option (SANE_Handle handle, } } break; - + case SANE_ACTION_SET_AUTO: return SANE_STATUS_UNSUPPORTED; /* We are DUMB. */ } @@ -3662,7 +3662,7 @@ sane_get_parameters (SANE_Handle handle, s->threepasscolor = SANE_TRUE; s->onepasscolor = SANE_FALSE; s->color_seq = s->dev->info.color_sequence; - } + } } else { /* not color! */ DBG(23, "sane_get_parameters: non-color\n"); s->threepasscolor = SANE_FALSE; @@ -3673,18 +3673,18 @@ sane_get_parameters (SANE_Handle handle, s->transparency = !(strcmp(s->val[OPT_SOURCE].s, M_TRANS)); s->useADF = !(strcmp(s->val[OPT_SOURCE].s, M_AUTOFEED)); /* disallow exp. res. during preview scan XXXXXXXXXXX */ - /*s->expandedresolution = + /*s->expandedresolution = (s->val[OPT_EXP_RES].w) && !(s->val[OPT_PREVIEW].w);*/ s->expandedresolution = (s->val[OPT_EXP_RES].w); s->doexpansion = (s->expandedresolution && !(s->dev->info.does_expansion)); if (s->res_type == MS_RES_1PER) { s->resolution = (SANE_Int)(SANE_UNFIX(s->val[OPT_RESOLUTION].w)); - s->resolution_code = - 0xFF & ((s->resolution * 100) / + s->resolution_code = + 0xFF & ((s->resolution * 100) / s->dev->info.base_resolution / (s->expandedresolution ? 2 : 1)); - DBG(23, "sane_get_parameters: res_code = %d (%2x)\n", + DBG(23, "sane_get_parameters: res_code = %d (%2x)\n", s->resolution_code, s->resolution_code); } else { DBG(23, "sane_get_parameters: 5 percent!!!\n"); @@ -3725,18 +3725,18 @@ sane_get_parameters (SANE_Handle handle, s->pattern = ((i < s->dev->info.pattern_count) ? i : 0); } else s->pattern = 0; - + { /* need to 'round' things properly! XXXXXXXX */ SANE_Int widthpix; double dots_per_mm = s->resolution / MM_PER_INCH; - double units_per_mm = - (s->unit_type == MS_UNIT_18INCH) ? + double units_per_mm = + (s->unit_type == MS_UNIT_18INCH) ? (8.0 / MM_PER_INCH) : /* 1/8 inches */ (s->dev->info.base_resolution / MM_PER_INCH); /* pixels */ - + DBG(23, "sane_get_parameters: dots_per_mm: %f\n", dots_per_mm); DBG(23, "sane_get_parameters: units_per_mm: %f\n", units_per_mm); @@ -3755,22 +3755,22 @@ sane_get_parameters (SANE_Handle handle, /* these are just an estimate... (but *should* be completely accurate) * real values come from scanner after sane_start. */ - if (s->unit_type == MS_UNIT_18INCH) { + if (s->unit_type == MS_UNIT_18INCH) { /* who *knows* what happens */ - widthpix = + widthpix = (SANE_Int)((double)(s->x2 - s->x1 + 1) / 8.0 * (double)s->resolution); - s->params.lines = + s->params.lines = (SANE_Int)((double)(s->y2 - s->y1 + 1) / 8.0 * (double)s->resolution); } else { /* calculate pixels per scanline returned by scanner... */ /* scanner (E6 at least) always seems to return an -even- number of -bytes- */ - if (s->resolution <= s->dev->info.base_resolution) + if (s->resolution <= s->dev->info.base_resolution) widthpix = (SANE_Int)((double)(s->x2 - s->x1 + 1) * - (double)(s->resolution) / + (double)(s->resolution) / (double)(s->dev->info.base_resolution)); else widthpix = (s->x2 - s->x1 + 1); @@ -3784,14 +3784,14 @@ sane_get_parameters (SANE_Handle handle, } DBG(23, "WIDTHPIX: before exp: %d\n", widthpix); /* ok, now fix up expanded-mode conversions */ - if (s->resolution > s->dev->info.base_resolution) + if (s->resolution > s->dev->info.base_resolution) widthpix = (SANE_Int) ((double)widthpix * (double)s->resolution / (double)s->dev->info.base_resolution); s->params.pixels_per_line = widthpix; - s->params.lines = + s->params.lines = (SANE_Int)((double)(s->y2 - s->y1 + 1) * - (double)(s->resolution) / + (double)(s->resolution) / (double)(s->dev->info.base_resolution)); } } @@ -3822,13 +3822,13 @@ sane_get_parameters (SANE_Handle handle, } else { /* a three-pass color scan */ s->params.depth = s->bits_per_color; /* this will be correctly set in sane_start */ - s->params.format = SANE_FRAME_RED; + s->params.format = SANE_FRAME_RED; s->params.bytes_per_line = s->params.pixels_per_line; } break; } - DBG(23, "sane_get_parameters: lines: %d ppl: %d bpl: %d\n", + DBG(23, "sane_get_parameters: lines: %d ppl: %d bpl: %d\n", s->params.lines, s->params.pixels_per_line, s->params.bytes_per_line); /* also fixed in sane_start for multi-pass scans */ @@ -3852,7 +3852,7 @@ sane_start_guts (SANE_Handle handle) Microtek_Scanner *s = handle; SANE_Status status; SANE_Int busy, linewidth; - + DBG(10, "sane_start...\n"); if (s->sfd != -1) { @@ -3863,10 +3863,10 @@ sane_start_guts (SANE_Handle handle) if ((status = sane_get_parameters(s, 0)) != SANE_STATUS_GOOD) return end_scan(s, status); set_pass_parameters(s); - + s->scanning = SANE_TRUE; s->cancel = SANE_FALSE; - + status = sanei_scsi_open(s->dev->sane.name, &(s->sfd), sense_handler, @@ -3877,50 +3877,50 @@ sane_start_guts (SANE_Handle handle) s->sfd = -1; return end_scan(s, status); } - + if ((status = wait_ready(s)) != SANE_STATUS_GOOD) return end_scan(s, status); - if ((status = finagle_precal(s)) != SANE_STATUS_GOOD) + if ((status = finagle_precal(s)) != SANE_STATUS_GOOD) return end_scan(s, status); if ((status = scanning_frame(s)) != SANE_STATUS_GOOD) return end_scan(s, status); - if (s->dev->info.source_options & + if (s->dev->info.source_options & (MI_SRC_FEED_BT | MI_SRC_HAS_TRANS | MI_SRC_FEED_SUPP | MI_SRC_HAS_FEED)) { /* ZZZZZZZZZZZ */ if ((status = accessory(s)) != SANE_STATUS_GOOD) return end_scan(s, status); /* if SWslct ???? XXXXXXXXXXXXXXX */ } - if ((status = download_gamma(s)) != SANE_STATUS_GOOD) + if ((status = download_gamma(s)) != SANE_STATUS_GOOD) return end_scan(s, status); - if ((status = mode_select(s)) != SANE_STATUS_GOOD) + if ((status = mode_select(s)) != SANE_STATUS_GOOD) return end_scan(s, status); if (s->dev->info.does_mode1) { - if ((status = mode_select_1(s)) != SANE_STATUS_GOOD) + if ((status = mode_select_1(s)) != SANE_STATUS_GOOD) return end_scan(s, status); } if ((s->do_clever_precal) || (s->do_real_calib)) { - if ((status = save_mode_sense(s)) != SANE_STATUS_GOOD) + if ((status = save_mode_sense(s)) != SANE_STATUS_GOOD) return end_scan(s, status); - } + } if ((status = wait_ready(s)) != SANE_STATUS_GOOD) return end_scan(s, status); s->scan_started = SANE_TRUE; if ((status = start_scan(s)) != SANE_STATUS_GOOD) return end_scan(s, status); - if ((status = get_scan_status(s, &busy, + if ((status = get_scan_status(s, &busy, &linewidth, &(s->unscanned_lines))) != SANE_STATUS_GOOD) { DBG(10, "sane_start: get_scan_status fails\n"); return end_scan(s, status); } /* check for a bizarre linecount */ - if ((s->unscanned_lines < 0) || - (s->unscanned_lines > + if ((s->unscanned_lines < 0) || + (s->unscanned_lines > (s->params.lines * 2 * (s->expandedresolution ? 2 : 1)))) { DBG(10, "sane_start: get_scan_status returns weird line count %d\n", s->unscanned_lines); return end_scan(s, SANE_STATUS_DEVICE_BUSY); } - - + + /* figure out image format parameters */ switch (s->mode) { case MS_MODE_LINEART: @@ -3990,16 +3990,16 @@ sane_start_guts (SANE_Handle handle) DBG(10, "sane_start: Unknown scan mode: %d\n", s->mode); return end_scan(s, SANE_STATUS_INVAL); } - + if ((s->doexpansion) && (s->resolution > s->dev->info.base_resolution)) { s->dest_ppl = (int) ((double)s->ppl * (double)s->resolution / (double)s->dev->info.base_resolution); - /*+ 0.5 XXXXXX */ + /*+ 0.5 XXXXXX */ s->exp_aspect = (double)s->ppl / (double)s->dest_ppl; s->dest_pixel_bpl = (int) ceil((double)s->pixel_bpl / s->exp_aspect); - /*s->exp_aspect = + /*s->exp_aspect = (double) s->dev->info.base_resolution / (double) s->resolution;*/ /* s->dest_pixel_bpl = s->pixel_bpl / s->exp_aspect; s->dest_ppl = s->ppl / s->exp_aspect;*/ @@ -4012,27 +4012,27 @@ sane_start_guts (SANE_Handle handle) s->dest_pixel_bpl = s->pixel_bpl; s->dest_ppl = s->ppl; } - + s->params.lines = s->unscanned_lines; - s->params.pixels_per_line = s->dest_ppl; - s->params.bytes_per_line = s->dest_pixel_bpl; - + s->params.pixels_per_line = s->dest_ppl; + s->params.bytes_per_line = s->dest_pixel_bpl; + /* calculate maximum line capacity of SCSI buffer */ s->max_scsi_lines = SCSI_BUFF_SIZE / (s->pixel_bpl + s->header_bpl); if (s->max_scsi_lines < 1) { DBG(10, "sane_start: SCSI buffer smaller that one scan line!\n"); return end_scan(s, SANE_STATUS_NO_MEM); } - + s->scsi_buffer = (uint8_t *) malloc(SCSI_BUFF_SIZE * sizeof(uint8_t)); if (s->scsi_buffer == NULL) return SANE_STATUS_NO_MEM; - + /* what's a good initial size for this? */ s->rb = ring_alloc(s->max_scsi_lines * s->dest_pixel_bpl, s->dest_pixel_bpl, s->dest_ppl); - + s->undelivered_bytes = s->unscanned_lines * s->dest_pixel_bpl; - + DBG(23, "Scan Param:\n"); DBG(23, "pix bpl: %d hdr bpl: %d ppl: %d\n", s->pixel_bpl, s->header_bpl, s->ppl); @@ -4040,7 +4040,7 @@ sane_start_guts (SANE_Handle handle) s->undelivered_bytes, s->unscanned_lines, s->planes); DBG(23, "dest bpl: %d dest ppl: %d aspect: %f\n", s->dest_pixel_bpl, s->dest_ppl, s->exp_aspect); - + return SANE_STATUS_GOOD; } @@ -4062,7 +4062,7 @@ sane_start (SANE_Handle handle) /********************************************************************/ /* sane_read */ /********************************************************************/ -static SANE_Status +static SANE_Status sane_read_guts (SANE_Handle handle, SANE_Byte *dest_buffer, SANE_Int dest_length, SANE_Int *ret_length) { @@ -4072,7 +4072,7 @@ sane_read_guts (SANE_Handle handle, SANE_Byte *dest_buffer, ring_buffer *rb = s->rb; DBG(10, "sane_read...\n"); - + *ret_length = 0; /* default: no data */ /* we have been cancelled... */ if (s->cancel) return end_scan(s, SANE_STATUS_CANCELLED); @@ -4102,7 +4102,7 @@ sane_read_guts (SANE_Handle handle, SANE_Byte *dest_buffer, } -SANE_Status +SANE_Status sane_read (SANE_Handle handle, SANE_Byte *dest_buffer, SANE_Int dest_length, SANE_Int *ret_length) { diff --git a/backend/microtek.h b/backend/microtek.h index d4c7abff7..4adac6383 100644 --- a/backend/microtek.h +++ b/backend/microtek.h @@ -1,7 +1,7 @@ /*************************************************************************** * SANE - Scanner Access Now Easy. - microtek.h + microtek.h This file Copyright 2002 Matthew Marjanovic @@ -60,13 +60,13 @@ /*******************************************************************/ -/***** enumeration of Option Descriptors *****/ +/***** enumeration of Option Descriptors *****/ /*******************************************************************/ enum Mtek_Option { OPT_NUM_OPTS = 0, - + OPT_MODE_GROUP, OPT_MODE, /* -a,b,c,g */ OPT_HALFTONE_PATTERN, /* -H */ @@ -77,13 +77,13 @@ enum Mtek_Option OPT_SOURCE, /* -t */ OPT_PREVIEW, OPT_CALIB_ONCE, - + OPT_GEOMETRY_GROUP, /* -f .... */ OPT_TL_X, /* top-left x */ OPT_TL_Y, /* top-left y */ OPT_BR_X, /* bottom-right x */ - OPT_BR_Y, /* bottom-right y */ - + OPT_BR_Y, /* bottom-right y */ + OPT_ENHANCEMENT_GROUP, OPT_EXPOSURE, OPT_BRIGHTNESS, /* -d */ @@ -91,7 +91,7 @@ enum Mtek_Option OPT_HIGHLIGHT, /* -l */ OPT_SHADOW, /* -s */ OPT_MIDTONE, /* -m */ - + OPT_GAMMA_GROUP, OPT_CUSTOM_GAMMA, OPT_ANALOG_GAMMA, @@ -106,16 +106,16 @@ enum Mtek_Option OPT_GAMMA_BIND, NUM_OPTIONS, - + OPT_BACKTRACK, /* -B */ - + /* must come last: */ RNUM_OPTIONS }; /*******************************************************************/ -/***** scanner hardware information (as discovered by INQUIRY) *****/ +/***** scanner hardware information (as discovered by INQUIRY) *****/ /*******************************************************************/ typedef struct Microtek_Info { @@ -131,7 +131,7 @@ typedef struct Microtek_Info { SANE_Byte response_data_format; #define MI_RESSTEP_1PER 0x01 #define MI_RESSTEP_5PER 0x02 - SANE_Byte res_step; + SANE_Byte res_step; #define MI_MODES_LINEART 0x01 #define MI_MODES_HALFTONE 0x02 #define MI_MODES_GRAY 0x04 /* ??????? or "MultiBit"??? XXXXX*/ @@ -139,9 +139,9 @@ typedef struct Microtek_Info { #define MI_MODES_TRANSMSV 0x20 #define MI_MODES_ONEPASS 0x40 #define MI_MODES_NEGATIVE 0x80 - SANE_Byte modes; - SANE_Int pattern_count; - SANE_Byte pattern_dwnld; + SANE_Byte modes; + SANE_Int pattern_count; + SANE_Byte pattern_dwnld; #define MI_FEED_FLATBED 0x01 #define MI_FEED_EDGEFEED 0x02 #define MI_FEED_AUTOSUPP 0x04 @@ -191,7 +191,7 @@ typedef struct Microtek_Info { #define MI_FMT_CAP_12BPP 0x04 #define MI_FMT_CAP_16BPP 0x08 SANE_Byte bit_formats; /* output bit formats capabilities */ -#define MI_EXCAP_OFF_CTL 0x01 +#define MI_EXCAP_OFF_CTL 0x01 #define MI_EXCAP_DIS_LNTBL 0x02 #define MI_EXCAP_DIS_RECAL 0x04 SANE_Byte extra_cap; @@ -240,7 +240,7 @@ typedef struct ring_buffer { size_t green_extra; /* unmatched green bytes */ size_t red_extra; /* unmatched red bytes */ - size_t complete_count; + size_t complete_count; size_t head_complete; } ring_buffer; @@ -256,7 +256,7 @@ typedef struct ring_buffer { typedef struct Microtek_Scanner { struct Microtek_Scanner *next; /* for linked list */ Microtek_Device *dev; /* raw device info */ - + SANE_Option_Descriptor sod[RNUM_OPTIONS]; /* option list for session */ Option_Value val[RNUM_OPTIONS]; /* option values for session */ @@ -295,7 +295,7 @@ typedef struct Microtek_Scanner { SANE_Int gamma_entry_size; SANE_Int gamma_bit_depth; /* SANE_Int gamma_max_entry;*/ - + SANE_Range gamma_entry_range; SANE_Range contrast_range; SANE_Range exposure_range; @@ -366,7 +366,7 @@ typedef struct Microtek_Scanner { #define MS_PRECAL_EXP_COLOR 3 SANE_Byte precal_record; /* record what precalibrations have been done */ -#define MS_SENSE_IGNORE 1 +#define MS_SENSE_IGNORE 1 int sense_flags; /* flags passed to the sense handler */ uint8_t *scsi_buffer; diff --git a/backend/microtek2.c b/backend/microtek2.c index dccd7075b..d714fff97 100644 --- a/backend/microtek2.c +++ b/backend/microtek2.c @@ -692,7 +692,7 @@ add_device_list(SANE_String_Const dev_name, Microtek2_Device **mdev) if ( (hdev = strdup(dev_name)) == NULL) - { + { DBG(5, "add_device_list: malloc() for hdev failed\n"); return SANE_STATUS_NO_MEM; } @@ -760,7 +760,7 @@ attach(Microtek2_Device *md) /* device is passed in sane_open() this function may also be called */ /* from sane_open() or sane_get_devices(). */ - SANE_String model_string; + SANE_String model_string; SANE_Status status; SANE_Byte source_info; @@ -1172,7 +1172,7 @@ check_inquiry(Microtek2_Device *md, SANE_String *model_string) md->shading_depth = 12; else if ( mi->depth & MI_HASDEPTH_10 ) md->shading_depth = 10; - else + else md->shading_depth = 8; switch (mi->model_code) @@ -1465,7 +1465,7 @@ do_authorization(char *ressource) return SANE_STATUS_ACCESS_DENIED; } } - + linep = &line[0]; device_found = 0; while ( fgets(line, MAX_LINE_LEN, fp) ) @@ -1479,7 +1479,7 @@ do_authorization(char *ressource) { DBG(2, "equal\n"); device_found = 1; - break; + break; } } } @@ -1491,9 +1491,9 @@ do_authorization(char *ressource) } fseek(fp, 0L, SEEK_SET); - + (*auth_callback) (ressource, username, password); - + status = SANE_STATUS_ACCESS_DENIED; do { @@ -1509,7 +1509,7 @@ do_authorization(char *ressource) if ( strcmp( device, ressource) != 0 ) /* not a matching entry */ continue; - linep = ++p; + linep = ++p; p = index(linep, SEPARATOR); if ( p == NULL ) continue; @@ -1616,7 +1616,7 @@ dump_area2(uint8_t *area, int len, char *info) char *outbuf; if ( ! info[0] ) - info = "No additional info available"; + info = "No additional info available"; DBG(1, "[%s]\n", info); @@ -3751,12 +3751,12 @@ get_calib_params(Microtek2_Scanner *ms) Microtek2_Device *md; Microtek2_Info *mi; - + DBG(30, "get_calib_params: handle=%p\n", (void *) ms); md = ms->dev; mi = &md->info[md->scan_source]; - + if ( md->model_flags & MD_CALIB_DIVISOR_600 ) { if ( ms->x_resolution_dpi <= 600 ) @@ -3787,7 +3787,7 @@ get_calib_params(Microtek2_Scanner *ms) ms->depth = 12; else if ( mi->depth & MI_HASDEPTH_10 ) ms->depth = 10; - else + else ms->depth = 8; ms->stay = 0; @@ -3830,7 +3830,7 @@ get_scan_parameters(Microtek2_Scanner *ms) get_scan_mode_and_depth(ms, &ms->mode, &ms->depth, &ms->bits_per_pixel_in, &ms->bits_per_pixel_out); - + /* get the scan_source */ if ( strcmp(ms->val[OPT_SOURCE].s, MD_SOURCESTRING_FLATBED) == 0 ) ms->scan_source = MS_SOURCE_FLATBED; @@ -3871,19 +3871,19 @@ get_scan_parameters(Microtek2_Scanner *ms) if ( ms->mode == MS_MODE_HALFTONE ) { i = 0; - while ( strcmp(md->halftone_mode_list[i], ms->val[OPT_HALFTONE].s) ) + while ( strcmp(md->halftone_mode_list[i], ms->val[OPT_HALFTONE].s) ) ++i; ms->internal_ht_index = i; } - /* if lineart get the value for threshold */ - if ( ms->mode == MS_MODE_LINEART || ms->mode == MS_MODE_LINEARTFAKE) + /* if lineart get the value for threshold */ + if ( ms->mode == MS_MODE_LINEART || ms->mode == MS_MODE_LINEARTFAKE) ms->threshold = (uint8_t) ms->val[OPT_THRESHOLD].w; else ms->threshold = (uint8_t) M_THRESHOLD_DEFAULT; DBG(30, "get_scan_parameters: mode=%d, depth=%d, bpp_in=%d, bpp_out=%d\n", - ms->mode, ms->depth, ms->bits_per_pixel_in, + ms->mode, ms->depth, ms->bits_per_pixel_in, ms->bits_per_pixel_out); /* calculate positions, width and height in dots */ @@ -4115,7 +4115,7 @@ get_scan_mode_and_depth(Microtek2_Scanner *ms, " bits_pp_in=%d, bits_pp_out=%d, preview=%d\n", *mode, *depth, *bits_per_pixel_in, *bits_per_pixel_out, ms->val[OPT_PREVIEW].w); - + return SANE_STATUS_GOOD; } @@ -5237,8 +5237,8 @@ scsi_test_unit_ready(Microtek2_Device *md) status = sanei_scsi_cmd(sfd, tur, sizeof(tur), NULL, 0); if ( status != SANE_STATUS_GOOD ) DBG(1, "scsi_test_unit_ready: cmd '%s'\n", sane_strstatus(status)); - - sanei_scsi_close(sfd); + + sanei_scsi_close(sfd); return status; } @@ -5319,7 +5319,7 @@ sane_start(SANE_Handle handle) goto cleanup; } } - + status = get_scan_parameters(ms); if ( status != SANE_STATUS_GOOD ) goto cleanup; @@ -5349,7 +5349,7 @@ sane_start(SANE_Handle handle) /* md->status.tlamp |= MD_TLAMP_ON;*/ /* with this line on some scanners (X6, 0x91) the Flamp goes on */ } - + if ( ms->no_backtracking ) md->status.ntrack |= MD_NTRACK_ON; else @@ -5447,8 +5447,8 @@ sane_start(SANE_Handle handle) if ( status != SANE_STATUS_GOOD ) goto cleanup; } - - if ( ms->lightlid35 ) + + if ( ms->lightlid35 ) /* hopefully this leads to a switched off flatbed lamp with lightlid */ { status = scsi_read_system_status(md, ms->sfd); @@ -5457,7 +5457,7 @@ sane_start(SANE_Handle handle) md->status.flamp &= ~MD_FLAMP_ON; md->status.tlamp &= ~MD_TLAMP_ON; - + status = scsi_send_system_status(md, ms->sfd); if ( status != SANE_STATUS_GOOD ) goto cleanup; @@ -5518,7 +5518,7 @@ prepare_buffers(Microtek2_Scanner *ms) status = SANE_STATUS_GOOD; DBG(30, "prepare_buffers: ms=0x%p\n", (void *) ms); - + md = ms->dev; mi = &md->info[md->scan_source]; @@ -5541,19 +5541,19 @@ prepare_buffers(Microtek2_Scanner *ms) } /* allocate buffers */ - ms->src_buffer_size = ms->src_max_lines * ms->bpl; + ms->src_buffer_size = ms->src_max_lines * ms->bpl; - if ( ms->mode == MS_MODE_COLOR && mi->data_format == MI_DATAFMT_LPLSEGREG ) - { + if ( ms->mode == MS_MODE_COLOR && mi->data_format == MI_DATAFMT_LPLSEGREG ) + { /* In this case the data is not neccessarily in the order RGB */ /* and there may be different numbers of read red, green and blue */ /* segments. We allocate a second buffer to read new lines in */ /* and hold undelivered pixels in the other buffer */ int extra_buf_size; - extra_buf_size = 2 * ms->bpl * mi->ccd_gap + extra_buf_size = 2 * ms->bpl * mi->ccd_gap * (int) ceil( (double) mi->max_yresolution - / (double) mi->opt_resolution); + / (double) mi->opt_resolution); for ( i = 0; i < 2; i++ ) { if ( ms->buf.src_buffer[i] ) @@ -5610,15 +5610,15 @@ prepare_buffers(Microtek2_Scanner *ms) DBG(1, "sane_start: malloc() for temporary buffer failed\n"); status = SANE_STATUS_NO_MEM; goto cleanup; - } + } } - else + else ms->temporary_buffer = NULL; /* some data formats have additional information in a scan line, which */ /* is not transferred to the frontend; real_bpl is the number of bytes */ /* per line, that is copied into the frontend's buffer */ - ms->real_bpl = (uint32_t) ceil( ((double) ms->ppl * + ms->real_bpl = (uint32_t) ceil( ((double) ms->ppl * (double) ms->bits_per_pixel_out) / 8.0 ); if ( mi->onepass && ms->mode == MS_MODE_COLOR ) ms->real_bpl *= 3; @@ -5629,7 +5629,7 @@ prepare_buffers(Microtek2_Scanner *ms) cleanup: cleanup_scanner(ms); - return status; + return status; } static void @@ -5691,7 +5691,7 @@ write_shading_buf_pnm(Microtek2_Scanner *ms, uint32_t lines) + mi->color_sequence[color] * ( ms->bpl / ms->lut_entry_size / 3 ) + pixel); - + break; case MI_DATAFMT_CHUNKY: case MI_DATAFMT_9800: @@ -7067,7 +7067,7 @@ set_exposure(Microtek2_Scanner *ms) uint8_t exposure; uint8_t exposure_rgb[3]; - + DBG(30, "set_exposure: ms=%p\n", (void *) ms); md = ms->dev; @@ -7118,7 +7118,7 @@ set_exposure(Microtek2_Scanner *ms) for ( byte = 0; byte < size; byte++ ) { val32 = (uint32_t) *((uint16_t *) from + color * size + byte); - val32 = MIN(val32 + val32 + val32 = MIN(val32 + val32 * (2 * (uint32_t) exposure_rgb[color] / 100), (uint32_t) maxval); *((uint16_t *) from + color * size + byte) = (uint16_t) val32; @@ -7162,7 +7162,7 @@ reader_process(void *data) DBG(1, "reader_process: fdopen() failed, errno=%d\n", errno); return SANE_STATUS_IO_ERROR; } - + if ( ms->auto_adjust == 1 ) { if ( temp_current == NULL ) @@ -7171,7 +7171,7 @@ reader_process(void *data) while ( ms->src_remaining_lines > 0 ) { - + ms->src_lines_to_read = MIN(ms->src_remaining_lines, ms->src_max_lines); ms->transfer_length = ms->src_lines_to_read * ms->bpl; @@ -7182,13 +7182,13 @@ reader_process(void *data) sigprocmask (SIG_BLOCK, &sigterm_set, 0); status = scsi_read_image(ms, ms->buf.src_buf, (ms->depth > 8) ? 2 : 1); sigprocmask (SIG_UNBLOCK, &sigterm_set, 0); - if ( status != SANE_STATUS_GOOD ) + if ( status != SANE_STATUS_GOOD ) return SANE_STATUS_IO_ERROR; ms->src_remaining_lines -= ms->src_lines_to_read; /* prepare data for frontend */ - switch (ms->mode) + switch (ms->mode) { case MS_MODE_COLOR: if ( ! mi->onepass ) @@ -7197,9 +7197,9 @@ reader_process(void *data) DBG(1, "reader_process: 3 pass not yet supported\n"); return SANE_STATUS_IO_ERROR; } - else + else { - switch ( mi->data_format ) + switch ( mi->data_format ) { case MI_DATAFMT_CHUNKY: case MI_DATAFMT_9800: @@ -7225,9 +7225,9 @@ reader_process(void *data) default: DBG(1, "reader_process: format %d\n", mi->data_format); return SANE_STATUS_IO_ERROR; - } + } } - break; + break; case MS_MODE_GRAY: status = gray_proc_data(ms); if ( status != SANE_STATUS_GOOD ) @@ -7260,7 +7260,7 @@ reader_process(void *data) /*---------- chunky_proc_data() ----------------------------------------------*/ -static SANE_Status +static SANE_Status chunky_proc_data(Microtek2_Scanner *ms) { SANE_Status status; @@ -7275,7 +7275,7 @@ chunky_proc_data(Microtek2_Scanner *ms) DBG(30, "chunky_proc_data: ms=%p\n", (void *) ms); - + md = ms->dev; bits_pp_in = ms->bits_per_pixel_in; bits_pp_out = ms->bits_per_pixel_out; @@ -7621,7 +7621,7 @@ segreg_copy_pixels(Microtek2_Scanner *ms) val = MAX( 0.0, val); val = MIN( maxval, val ); } - + val16 = (uint16_t) val; val8 = (uint8_t) val; @@ -7789,7 +7789,7 @@ lplconcat_copy_pixels(Microtek2_Scanner *ms, DBG(1, "lplconcat_copy_pixels: Unknown depth %d\n", ms->depth); return SANE_STATUS_IO_ERROR; } - + if ((md->model_flags & MD_READ_CONTROL_BIT) && ms->calib_backend && ( ms->condensed_shading_w != NULL )) /* apply shading by backend */ diff --git a/backend/microtek2.h b/backend/microtek2.h index 2a1f6971d..326eac874 100644 --- a/backend/microtek2.h +++ b/backend/microtek2.h @@ -1,7 +1,7 @@ /******************************************************************************* * SANE - Scanner Access Now Easy. - microtek2.h + microtek2.h This file (C) 1998, 1999 Bernd Schroeder 2000, 2001 Karsten Festag @@ -160,7 +160,7 @@ #define RG_COLOR(d,p) (d)[5] |= (((p) << 5) & 0x60) #define RG_WORD(d,p) (d)[5] |= ((p) & 0x01) #define RG_TRANSFERLENGTH(d,p) (d)[7] = (((p) >> 8) & 0xff); \ - (d)[8] = ((p) & 0xff) + (d)[8] = ((p) & 0xff) /* SEND GAMMA TABLE */ #define SG_SET_CMD(d) (d)[0] = 0x2a; (d)[1] = 0x00; (d)[2] = 0x03; \ @@ -172,7 +172,7 @@ #define SG_SET_COLOR(d,p) (d)[5] |= (((p) << 5) & 0x60) #define SG_SET_WORD(d,p) (d)[5] |= ((p) & 0x01) #define SG_SET_TRANSFERLENGTH(d,p) (d)[7] = (((p) >> 8) & 0xff); \ - (d)[8] = ((p) & 0xff) + (d)[8] = ((p) & 0xff) #define SG_DATA_P SG_CMD_L @@ -394,7 +394,7 @@ #define SW_BODY_L 61 #define SW_CMD_P 0 /* command at postion 0 */ #define SW_HEADER_P SW_CMD_L -#define SW_BODY_P(n) SW_CMD_L + SW_HEADER_L + (n) * SW_BODY_L +#define SW_BODY_P(n) SW_CMD_L + SW_HEADER_L + (n) * SW_BODY_L /* d: SW_CMD_P, SW_HEADER_P, SW_BODY_P(n) */ #define SW_PARAM_LENGTH(d,p) (d)[6] = ((p) >> 16) & 0xff; \ @@ -402,7 +402,7 @@ (d)[8] = (p) & 0xff #define SW_WNDDESCVAL SW_BODY_L #define SW_WNDDESCLEN(d,p) (d)[6] = ((p) >> 8) & 0xff; \ - (d)[7] = (p) & 0xff + (d)[7] = (p) & 0xff #define SW_WNDID(d,p) (d)[0] = (p) #define SW_XRESDPI(d,p) (d)[2] = ((p) >> 8) & 0xff; \ (d)[3] = (p) & 0xff @@ -415,15 +415,15 @@ #define SW_YPOSTL(d,p) (d)[10] = ((p) >> 24) & 0xff; \ (d)[11] = ((p) >> 16) & 0xff; \ (d)[12] = ((p) >> 8) & 0xff; \ - (d)[13] = (p) & 0xff + (d)[13] = (p) & 0xff #define SW_WNDWIDTH(d,p) (d)[14] = ((p) >> 24) & 0xff; \ (d)[15] = ((p) >> 16) & 0xff; \ (d)[16] = ((p) >> 8) & 0xff; \ - (d)[17] = (p) & 0xff + (d)[17] = (p) & 0xff #define SW_WNDHEIGHT(d,p) (d)[18] = ((p) >> 24) & 0xff; \ (d)[19] = ((p) >> 16) & 0xff; \ (d)[20] = ((p) >> 8) & 0xff; \ - (d)[21] = (p) & 0xff + (d)[21] = (p) & 0xff #define SW_BRIGHTNESS_M(d,p) (d)[22] = (p) #define SW_THRESHOLD(d,p) (d)[23] = (p) #define SW_CONTRAST_M(d,p) (d)[24] = (p) @@ -1219,7 +1219,7 @@ static SANE_Status dump_to_file(uint8_t *, int, char *, char *); #endif -static SANE_Status +static SANE_Status dump_attributes(Microtek2_Info *); static void @@ -1251,7 +1251,7 @@ gray_set_exposure(uint8_t *, uint32_t, uint8_t, uint8_t); static SANE_Status init_options(Microtek2_Scanner *, uint8_t); -static SANE_Status +static SANE_Status lineartfake_copy_pixels(Microtek2_Scanner *, uint8_t *, uint32_t, uint8_t, int, FILE *); diff --git a/backend/mustek.c b/backend/mustek.c index 8426dfe5f..c19ac113a 100644 --- a/backend/mustek.c +++ b/backend/mustek.c @@ -3,7 +3,7 @@ 1998 Andreas Bolsch for extension to ScanExpress models version 0.6, 2000-2005 Henning Meier-Geinitz, 2003 James Perry (600 EP). - + This file is part of the SANE package. This program is free software; you can redistribute it and/or @@ -1214,7 +1214,7 @@ attach (SANE_String_Const devname, Mustek_Device ** devp, SANE_Bool may_wait) /* Paragon 1-pass 14" series I */ /* I haven't seen a single report for this, but it is mentioned in - the old man page. All reported Paragon 1200SP had a model name + the old man page. All reported Paragon 1200SP had a model name "MFS-12000SP" */ else if (strncmp ((SANE_String) model_name, "MSF-12000SP", 11) == 0) { @@ -1269,7 +1269,7 @@ attach (SANE_String_Const devname, Mustek_Device ** devp, SANE_Bool may_wait) dev->y_trans_range.max = SANE_FIX (255.0); dev->dpi_range.max = SANE_FIX (600); /* Looks like at least some versions of this scanner produce black images - in gray and color mode if MUSTEK_FORCE_GAMMA is not set. At least + in gray and color mode if MUSTEK_FORCE_GAMMA is not set. At least versions 2.01, 2.02 and 2.10 are reported as having this bug. 3.12 doesn't need this workaround but it doesn't harm either. */ dev->flags |= MUSTEK_FLAG_FORCE_GAMMA; @@ -1451,12 +1451,12 @@ attach (SANE_String_Const devname, Mustek_Device ** devp, SANE_Bool may_wait) dev->y_range.min = SANE_FIX (0); dev->x_range.max = SANE_FIX (215.9); dev->y_range.max = SANE_FIX (291.2); - + dev->x_trans_range.min = SANE_FIX (0); dev->y_trans_range.min = SANE_FIX (0); dev->x_trans_range.max = SANE_FIX (150.0); dev->y_trans_range.max = SANE_FIX (175.0); - + dev->dpi_range.max = SANE_FIX (1200); dev->dpi_range.min = SANE_FIX (60); dev->flags |= MUSTEK_FLAG_SE; @@ -1476,12 +1476,12 @@ attach (SANE_String_Const devname, Mustek_Device ** devp, SANE_Bool may_wait) dev->y_range.min = SANE_FIX (0); dev->x_range.max = SANE_FIX (215.9); dev->y_range.max = SANE_FIX (291.2); - + dev->x_trans_range.min = SANE_FIX (0); dev->y_trans_range.min = SANE_FIX (0); dev->x_trans_range.max = SANE_FIX (150.0); dev->y_trans_range.max = SANE_FIX (175.0); - + dev->dpi_range.max = SANE_FIX (1200); dev->dpi_range.min = SANE_FIX (60); dev->flags |= MUSTEK_FLAG_SE; @@ -3415,7 +3415,7 @@ fix_line_distance_n_2 (Mustek_Scanner * s, SANE_Int num_lines, SANE_Int bpl, if (!s->ld.buf[0]) { /* This buffer must be big enough to hold maximum line distance - times max_bpl bytes. The maximum line distance for the + times max_bpl bytes. The maximum line distance for the Paragon 600 II N scanner is 23, so 40 should be safe. */ DBG (5, "fix_line_distance_n_2: allocating temp buffer of %d*%d bytes\n", @@ -3495,7 +3495,7 @@ fix_line_distance_n_1 (Mustek_Scanner * s, SANE_Int num_lines, SANE_Int bpl, if (!s->ld.buf[0]) { /* This buffer must be big enough to hold maximum line distance - times max_bpl bytes. The maximum line distance for the 600 II N + times max_bpl bytes. The maximum line distance for the 600 II N is 23, so 40 is safe. */ DBG (5, "fix_line_distance_n_1: allocating temp buffer of %d*%d bytes\n", @@ -3643,7 +3643,7 @@ fix_line_distance_se (Mustek_Scanner * s, SANE_Int num_lines, SANE_Int bpl, DBG (5, "fix_line_distance_se: start color: %d; %d lines \n", s->ld.color, num_lines); - /* First scan the lines read and count red, green and blue ones. + /* First scan the lines read and count red, green and blue ones. Since we will step through the lines a second time we must not alter any global variables here! */ for (color = 0; color < 3; ++color) @@ -3676,8 +3676,8 @@ fix_line_distance_se (Mustek_Scanner * s, SANE_Int num_lines, SANE_Int bpl, color = 0; } - /* Calculate how many triples of color lines we can output now. - Because the number of available red lines is always greater + /* Calculate how many triples of color lines we can output now. + Because the number of available red lines is always greater than for the other colors we may ignore the red ones here. */ num_lines = MIN (lines[1], lines[2]); @@ -3688,7 +3688,7 @@ fix_line_distance_se (Mustek_Scanner * s, SANE_Int num_lines, SANE_Int bpl, lines[0] = lines[1] = lines[2] = num_lines; - /* Output the color lines saved in previous call first. + /* Output the color lines saved in previous call first. Note that data is converted in r/g/b interleave on the fly. */ for (color = 0; color < 3; ++color) { @@ -4710,7 +4710,7 @@ output_data (Mustek_Scanner * s, FILE * fp, else { DBG (5, "output_data: write %d lpb; %d bpl\n", lines_per_buffer, bpl); - /* Scale x-resolution above 1/2 of the maximum resolution for + /* Scale x-resolution above 1/2 of the maximum resolution for SE and Pro scanners */ if ((s->hw->flags & MUSTEK_FLAG_ENLARGE_X) && (s->val[OPT_RESOLUTION].w > (s->hw->dpi_range.max / 2))) @@ -6011,7 +6011,7 @@ sane_control_option (SANE_Handle handle, SANE_Int option, { /* enable brightness/contrast for when in a binary mode */ s->opt[OPT_BRIGHTNESS].cap &= ~SANE_CAP_INACTIVE; - /* The SE and paragon models support only threshold + /* The SE and paragon models support only threshold in lineart */ if (!(s->hw->flags & MUSTEK_FLAG_SE) && !(s->hw->flags & MUSTEK_FLAG_PRO)) @@ -6548,8 +6548,8 @@ sane_start (SANE_Handle handle) s->line = 0; - /* don't call any SIGTERM or SIGCHLD handlers - this is to stop xsane and other frontends from calling + /* don't call any SIGTERM or SIGCHLD handlers + this is to stop xsane and other frontends from calling its quit handlers */ memset (&act, 0, sizeof (act)); sigaction (SIGTERM, &act, 0); diff --git a/backend/mustek.conf.in b/backend/mustek.conf.in index 3233fd899..3868d0e61 100644 --- a/backend/mustek.conf.in +++ b/backend/mustek.conf.in @@ -1,7 +1,7 @@ # See sane-mustek(5) for documentation. #--------------------------- Global options --------------------------------- -#option strip-height 1 # some SCSI adapters need this; scanning may +#option strip-height 1 # some SCSI adapters need this; scanning may # be faster without this option #option force-wait # wait for scanner to be ready (only necessary # when scanner freezes) @@ -36,6 +36,6 @@ scsi SCANNER # option linedistance-fix # only neccessary with firmware 2.x #-------------------------- 600 II EP --------------------------------------- -#parport0 - # parport0, parport1, ..., +#parport0 + # parport0, parport1, ..., # or: 0x378(=lpt1), 0x278(=lpt2), 0x3bc(=lpt3) diff --git a/backend/mustek.h b/backend/mustek.h index 5532af598..ca7aa2e1b 100644 --- a/backend/mustek.h +++ b/backend/mustek.h @@ -3,7 +3,7 @@ extension to ScanExpress models version 0.5, 2000 - 2005 Henning Meier-Geinitz. 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 @@ -38,7 +38,7 @@ 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. + If you do not wish that, delete this exception notice. This file implements a SANE backend for Mustek and some Trust flatbed scanners with SCSI or proprietary interface. */ @@ -292,7 +292,7 @@ typedef struct Mustek_Scanner /* these are used for SE, MFS and N line-distance correction: */ SANE_Byte *buf[3]; /* these are used for N line-distance correction only: */ - SANE_Int ld_line; /* line # currently processed in + SANE_Int ld_line; /* line # currently processed in ld-correction */ SANE_Int lmod3; /* line # modulo 3 */ } diff --git a/backend/mustek_pp.c b/backend/mustek_pp.c index 9c9a53379..912c3bdef 100644 --- a/backend/mustek_pp.c +++ b/backend/mustek_pp.c @@ -86,7 +86,7 @@ #include "mustek_pp_drivers.h" #define MIN(a,b) ((a) < (b) ? (a) : (b)) - + /* converts millimeter to pixels at a given resolution */ #define MM_TO_PIXEL(mm, dpi) (((float )mm * 5.0 / 127.0) * (float)dpi) /* and back */ @@ -120,27 +120,27 @@ static Mustek_pp_Handle *first_hndl = NULL; static SANE_String_Const mustek_pp_modes[4] = {SANE_VALUE_SCAN_MODE_LINEART, SANE_VALUE_SCAN_MODE_GRAY, SANE_VALUE_SCAN_MODE_COLOR, NULL}; static SANE_Word mustek_pp_modes_size = 10; - + static SANE_String_Const mustek_pp_speeds[6] = {"Slowest", "Slower", "Normal", "Faster", "Fastest", NULL}; static SANE_Word mustek_pp_speeds_size = 8; -static SANE_Word mustek_pp_depths[5] = {4, 8, 10, 12, 16}; +static SANE_Word mustek_pp_depths[5] = {4, 8, 10, 12, 16}; /* prototypes */ static void free_cfg_options(int *numoptions, Mustek_pp_config_option** options); static SANE_Status do_eof(Mustek_pp_Handle *hndl); static SANE_Status do_stop(Mustek_pp_Handle *hndl); static int reader_process (Mustek_pp_Handle * hndl, int pipe); -static SANE_Status sane_attach(SANE_String_Const port, SANE_String_Const name, +static SANE_Status sane_attach(SANE_String_Const port, SANE_String_Const name, SANE_Int driver, SANE_Int info); static void init_options(Mustek_pp_Handle *hndl); -static void attach_device(SANE_String *driver, SANE_String *name, +static void attach_device(SANE_String *driver, SANE_String *name, SANE_String *port, SANE_String *option_ta); /* - * Auxiliary function for freeing arrays of configuration options, + * Auxiliary function for freeing arrays of configuration options, */ -static void +static void free_cfg_options(int *numoptions, Mustek_pp_config_option** options) { int i; @@ -225,7 +225,7 @@ do_stop(Mustek_pp_Handle *hndl) * * EDG - Jan 14, 2004: * Make sure that the parport is released again by the child process - * under all circumstances, because otherwise the parent process may no + * under all circumstances, because otherwise the parent process may no * longer be able to claim it (they share the same file descriptor, and * the kernel doesn't release the child's claim because the file * descriptor isn't cleaned up). If that would happen, the lamp may stay @@ -267,13 +267,13 @@ reader_process (Mustek_pp_Handle * hndl, int pipe) sigemptyset (&sigterm_set); sigaddset (&sigterm_set, SIGTERM); - + if (!(buffer = malloc (hndl->params.bytes_per_line))) return SANE_STATUS_NO_MEM; - + if (!(fp = fdopen(pipe, "w"))) return SANE_STATUS_IO_ERROR; - + fd_to_release = hndl->fd; memset (&act, 0, sizeof(act)); act.sa_handler = sigterm_handler; @@ -290,11 +290,11 @@ reader_process (Mustek_pp_Handle * hndl, int pipe) sigprocmask (SIG_BLOCK, &sigterm_set, NULL); hndl->dev->func->read (hndl, buffer); - + if (getppid() == 1) { /* The parent process has died. Stop the scan (to make sure that the lamp is off and returns home). This is - a safety measure to make sure that we don't break + a safety measure to make sure that we don't break the scanner in case the frontend crashes. */ DBG (1, "reader_process: front-end died; aborting.\n"); hndl->dev->func->stop (hndl); @@ -312,7 +312,7 @@ reader_process (Mustek_pp_Handle * hndl, int pipe) return SANE_STATUS_GOOD; } - + /* sane_attach: @@ -334,7 +334,7 @@ sane_attach (SANE_String_Const port, SANE_String_Const name, SANE_Int driver, SA { Mustek_pp_Device *dev; - DBG (3, "sane_attach: attaching device ``%s'' to port %s (driver %s v%s by %s)\n", + DBG (3, "sane_attach: attaching device ``%s'' to port %s (driver %s v%s by %s)\n", name, port, Mustek_pp_Drivers[driver].driver, Mustek_pp_Drivers[driver].version, Mustek_pp_Drivers[driver].author); @@ -355,7 +355,7 @@ sane_attach (SANE_String_Const port, SANE_String_Const name, SANE_Int driver, SA dev->sane.name = dev->name = strdup (name); dev->port = strdup (port); dev->info = info; /* Modified by EDG */ - + /* Transfer the options parsed from the configuration file */ dev->numcfgoptions = numcfgoptions; dev->cfgoptions = cfgoptions; @@ -469,7 +469,7 @@ init_options(Mustek_pp_Handle *hndl) /* color dept */ hndl->opt[OPT_DEPTH].name = SANE_NAME_BIT_DEPTH; hndl->opt[OPT_DEPTH].title = SANE_TITLE_BIT_DEPTH; - hndl->opt[OPT_DEPTH].desc = + hndl->opt[OPT_DEPTH].desc = "Number of bits per sample for color scans, typical values are 8 for truecolor (24bpp)" "up to 16 for far-to-many-color (48bpp)."; hndl->opt[OPT_DEPTH].type = SANE_TYPE_INT; @@ -634,7 +634,7 @@ init_options(Mustek_pp_Handle *hndl) * this driver is called to initialize the device. */ static void -attach_device(SANE_String *driver, SANE_String *name, +attach_device(SANE_String *driver, SANE_String *name, SANE_String *port, SANE_String *option_ta) { int found = 0, driver_no, port_no; @@ -681,15 +681,15 @@ attach_device(SANE_String *driver, SANE_String *name, if (*option_ta) free (*option_ta); *name = *port = *driver = *option_ta = 0; - + /* In case of a successful initialization, the configuration options should have been transfered to the device, but this function can deal with that. */ free_cfg_options(&numcfgoptions, &cfgoptions); } - + /* sane_init: - * Reads configuration file and registers hardware driver + * Reads configuration file and registers hardware driver * * ChangeLog: * @@ -711,7 +711,7 @@ attach_device(SANE_String *driver, SANE_String *name, * * if the optional argument "option_ta" is present the driver uses special * parameters fitting for a trasparency adapter. - */ + */ SANE_Status sane_init (SANE_Int * version_code, SANE_Auth_Callback authorize) @@ -740,9 +740,9 @@ sane_init (SANE_Int * version_code, SANE_Auth_Callback authorize) char driver_name[64]; const char **devices = sanei_pa4s2_devices(); int device_no; - + DBG (2, "sane_init: could not open configuration file\n"); - + for (device_no = 0; devices[device_no] != NULL; device_no++) { DBG (3, "sane_init: trying ``%s''\n", devices[device_no]); @@ -774,14 +774,14 @@ sane_init (SANE_Int * version_code, SANE_Auth_Callback authorize) if (strncmp(config_line_ptr, "scanner", 7) == 0) { config_line_ptr += 7; - + if (name) { /* Parsing of previous scanner + options is finished. Attach the device before we parse the next section. */ attach_device(&driver, &name, &port, &option_ta); } - + config_line_ptr = sanei_config_skip_whitespace (config_line_ptr); if (!*config_line_ptr) { @@ -858,7 +858,7 @@ sane_init (SANE_Int * version_code, SANE_Auth_Callback authorize) config_line_ptr = sanei_config_get_string (config_line_ptr, &option_ta); - if ((option_ta == NULL) || (!*option_ta) || + if ((option_ta == NULL) || (!*option_ta) || (strcasecmp (option_ta, "use_ta") != 0)) { DBG (1, "sane_init: parse error in line %d after " @@ -889,12 +889,12 @@ sane_init (SANE_Int * version_code, SANE_Auth_Callback authorize) } else if (strncmp(config_line_ptr, "option", 6) == 0) { - /* Format for options: option [] - Note that the value is optional. */ + /* Format for options: option [] + Note that the value is optional. */ char *optname, *optval = 0; Mustek_pp_config_option *tmpoptions; - config_line_ptr += 6; + config_line_ptr += 6; config_line_ptr = sanei_config_skip_whitespace (config_line_ptr); if (!*config_line_ptr) { @@ -918,7 +918,7 @@ sane_init (SANE_Int * version_code, SANE_Auth_Callback authorize) { /* The option has a value. No need to check the value; that's up to the backend */ - config_line_ptr = sanei_config_get_string (config_line_ptr, + config_line_ptr = sanei_config_get_string (config_line_ptr, &optval); config_line_ptr = sanei_config_skip_whitespace (config_line_ptr); @@ -927,10 +927,10 @@ sane_init (SANE_Int * version_code, SANE_Auth_Callback authorize) if (*config_line_ptr) { DBG (1, "sane_init: parse error in line %d after " - "``option %s %s''\n", line, optname, + "``option %s %s''\n", line, optname, (optval == 0 ? "" : optval)); free (optname); - if (optval) + if (optval) free (optval); continue; } @@ -959,14 +959,14 @@ sane_init (SANE_Int * version_code, SANE_Auth_Callback authorize) DBG (1, "sane_init: parse error in line %d: unexpected " " ``option''\n", line); free (optname); - if (optval) + if (optval) free (optval); continue; } /* Extend the (global) array of options */ - tmpoptions = realloc(cfgoptions, + tmpoptions = realloc(cfgoptions, (numcfgoptions+1)*sizeof(cfgoptions[0])); if (!tmpoptions) { @@ -987,7 +987,7 @@ sane_init (SANE_Int * version_code, SANE_Auth_Callback authorize) } } - + /* If we hit the end of the file, we still may have to process the last driver */ if (name) @@ -996,7 +996,7 @@ sane_init (SANE_Int * version_code, SANE_Auth_Callback authorize) fclose(fp); return SANE_STATUS_GOOD; -} +} /* sane_exit: * Unloads all drivers and frees allocated memory @@ -1060,7 +1060,7 @@ sane_exit (void) */ /*ARGSUSED*/ SANE_Status -sane_get_devices (const SANE_Device *** device_list, +sane_get_devices (const SANE_Device *** device_list, SANE_Bool local_only __UNUSED__) { int ctr; @@ -1078,7 +1078,7 @@ sane_get_devices (const SANE_Device *** device_list, } dev = devlist; - + for (ctr=0 ; ctrsane; dev = dev->next; @@ -1142,7 +1142,7 @@ sane_open (SANE_String_Const devicename, SANE_Handle * handle) return SANE_STATUS_INVAL; } - DBG (3, "sane_open: Using device ``%s'' (driver %s v%s by %s)\n", + DBG (3, "sane_open: Using device ``%s'' (driver %s v%s by %s)\n", dev->name, dev->func->driver, dev->func->version, dev->func->author); if ((hndl = malloc (sizeof (Mustek_pp_Handle))) == NULL) { @@ -1151,7 +1151,7 @@ sane_open (SANE_String_Const devicename, SANE_Handle * handle) return SANE_STATUS_NO_MEM; } - + if ((status = dev->func->open (dev->port, dev->caps, &fd)) != SANE_STATUS_GOOD) { DBG (1, "sane_open: could not open device (%s)\n", @@ -1167,32 +1167,32 @@ sane_open (SANE_String_Const devicename, SANE_Handle * handle) hndl->pipe = -1; init_options (hndl); - + dev->func->setup (hndl); - + /* Initialize driver-specific configuration options. This must be done after calling the setup() function because only then the driver is guaranteed to be fully initialized */ for (i = 0; inumcfgoptions; ++i) { - status = dev->func->config (hndl, + status = dev->func->config (hndl, dev->cfgoptions[i].name, dev->cfgoptions[i].value); if (status != SANE_STATUS_GOOD) { DBG (1, "sane_open: could not set option %s for device (%s)\n", dev->cfgoptions[i].name, sane_strstatus (status)); - - /* Question: should the initialization be aborted when an - option cannot be handled ? - The driver should have reasonable built-in defaults, so - an illegal option value or an unknown option should not + + /* Question: should the initialization be aborted when an + option cannot be handled ? + The driver should have reasonable built-in defaults, so + an illegal option value or an unknown option should not be fatal. Therefore, it's probably ok to ignore the error. */ } } first_hndl = hndl; - + *handle = hndl; return SANE_STATUS_GOOD; @@ -1297,7 +1297,7 @@ sane_get_option_descriptor (SANE_Handle handle, SANE_Int option) * values aren't supported. * * before a value is written, some checks are performed. Depending - * on the option, that is written, other options also change + * on the option, that is written, other options also change * */ SANE_Status @@ -1487,7 +1487,7 @@ sane_control_option (SANE_Handle handle, SANE_Int option, hndl->opt[OPT_GAMMA_VECTOR_B].cap |= SANE_CAP_INACTIVE; hndl->opt[OPT_DEPTH].cap |= SANE_CAP_INACTIVE; - + if ((hndl->dev->caps & CAP_DEPTH) && (strcmp(val, SANE_VALUE_SCAN_MODE_COLOR) == 0)) hndl->opt[OPT_DEPTH].cap &= ~SANE_CAP_INACTIVE; @@ -1543,7 +1543,7 @@ sane_control_option (SANE_Handle handle, SANE_Int option, * supported) or 24bit by default * (ignored in bw/grayscale or if not * supported) - * dpi: resolution + * dpi: resolution * invert: if supported else defaults to false * gamma: if supported and selected * ta: if supported by the device @@ -1577,9 +1577,9 @@ sane_get_parameters (SANE_Handle handle, SANE_Parameters * params) hndl->depth = hndl->val[OPT_DEPTH].w; else hndl->depth = 8; - + dpi = (int) (SANE_UNFIX (hndl->val[OPT_RESOLUTION].w) + 0.5); - + hndl->res = dpi; if (hndl->dev->caps & CAP_INVERT) @@ -1603,11 +1603,11 @@ sane_get_parameters (SANE_Handle handle, SANE_Parameters * params) if (strcmp(mustek_pp_speeds[ctr], hndl->val[OPT_SPEED].s) == 0) hndl->speed = ctr; - + } else hndl->speed = SPEED_NORMAL; - + mode = hndl->val[OPT_MODE].s; if (strcmp (mode, SANE_VALUE_SCAN_MODE_LINEART) == 0) @@ -1651,7 +1651,7 @@ sane_get_parameters (SANE_Handle handle, SANE_Parameters * params) MIN ((int) (MM_TO_PIXEL (SANE_UNFIX(hndl->val[OPT_BR_Y].w), hndl->dev->maxres) + 0.5), hndl->dev->maxvsize); - + /* If necessary, swap the upper and lower boundaries to avoid negative distances. */ if (hndl->topX > hndl->bottomX) { @@ -1913,7 +1913,7 @@ sane_set_io_mode (SANE_Handle handle, SANE_Bool non_blocking) if (hndl->state != STATE_SCANNING) return SANE_STATUS_INVAL; - + if (fcntl (hndl->pipe, F_SETFL, non_blocking ? O_NONBLOCK : 0) < 0) { @@ -1943,7 +1943,7 @@ sane_get_select_fd (SANE_Handle handle, SANE_Int * fd) if (hndl->state != STATE_SCANNING) return SANE_STATUS_INVAL; - + *fd = hndl->pipe; return SANE_STATUS_GOOD; diff --git a/backend/mustek_pp.conf.in b/backend/mustek_pp.conf.in index 17f0e265e..b2abf9add 100644 --- a/backend/mustek_pp.conf.in +++ b/backend/mustek_pp.conf.in @@ -12,7 +12,7 @@ # # SANE_DEBUG_SANEI_PA4S2=128 scanimage -L # ... # hangs here -> [sanei_pa4s2] sanei_pa4s2_readbyte: read in EPP mode -# +# # Scanner definition template: # ============================ # @@ -39,20 +39,20 @@ # - cis1200+ (for Mustek 1200CP+ & OEM versions), # - ccd300 (for Mustek 600 III EPP & OEM versions) # - ... more types will be added in the future -# +# # is a name of an option, and an optional value # for the option. # Currently available options for *CIS* type scanners are: -# - top_adjust : +# - top_adjust : # Vertical adjustment of origin, in millimeter. -# Values between -5.0 and +5.0 mm are possible +# Values between -5.0 and +5.0 mm are possible # (floating point). # Default: 0.0 -# - slow_skip: +# - slow_skip: # Boolean option. Disables fast skipping to the start # of the scan region. May be necessary in case fast # skipping results in inaccuracies. -# Default: fast skipping enabled +# Default: fast skipping enabled # - bw : # Black/white discrimination value for lineart scans. # Pixel values below that value are considered black, diff --git a/backend/mustek_pp.h b/backend/mustek_pp.h index 19f17657b..09b4ceba4 100644 --- a/backend/mustek_pp.h +++ b/backend/mustek_pp.h @@ -47,13 +47,13 @@ #if defined(HAVE_SYS_TIME_H) # include #endif - + #define DEBUG_NOT_STATIC #include "../include/sane/sanei_debug.h" /* Please note: ASSERT won't go away if you define NDEBUG, it just won't * output a message when ASSERT failes. So if "cond" does anything, it will - * be executed, even if NDEBUG is defined... + * be executed, even if NDEBUG is defined... */ #define ASSERT(cond, retval) do { \ if (!(cond)) { \ @@ -112,7 +112,7 @@ typedef struct { void (*setup)(SANE_Handle hndl); /* processes a configuration option */ - SANE_Status (*config)(SANE_Handle hndl, + SANE_Status (*config)(SANE_Handle hndl, SANE_String_Const optname, SANE_String_Const optval); @@ -150,7 +150,7 @@ typedef struct Mustek_pp_config_option { SANE_String name; SANE_String value; - + } Mustek_pp_config_option; typedef struct Mustek_pp_Device { @@ -174,11 +174,11 @@ typedef struct Mustek_pp_Device { /* functions */ Mustek_pp_Functions *func; - + /* Modified by EDG: device identification is needed to initialize private device descriptor */ SANE_Int info; - + /* Array of configuration file options */ int numcfgoptions; Mustek_pp_config_option *cfgoptions; @@ -240,8 +240,8 @@ typedef struct Mustek_pp_Handle { struct Mustek_pp_Handle *next; - - + + Mustek_pp_Device *dev; int fd; @@ -250,7 +250,7 @@ typedef struct Mustek_pp_Handle { int pipe; int state; - + int topX, topY; int bottomX, bottomY; int mode; @@ -263,7 +263,7 @@ typedef struct Mustek_pp_Handle { int use_ta; int depth; int speed; - + /* current parameters */ SANE_Parameters params; @@ -271,7 +271,7 @@ typedef struct Mustek_pp_Handle { SANE_Range x_range; SANE_Range y_range; SANE_Range gamma_range; - + /* options */ SANE_Option_Descriptor opt[NUM_OPTIONS]; Option_Value val[NUM_OPTIONS]; @@ -280,7 +280,7 @@ typedef struct Mustek_pp_Handle { time_t lamp_on; void *priv; - + } Mustek_pp_Handle; #endif /* mustek_pp_h */ diff --git a/backend/mustek_pp_ccd300.c b/backend/mustek_pp_ccd300.c index 41ad0ecdb..2bf06b395 100644 --- a/backend/mustek_pp_ccd300.c +++ b/backend/mustek_pp_ccd300.c @@ -36,8 +36,8 @@ 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. - + If you do not wish that, delete this exception notice. + This file implements the hardware driver scanners using a 300dpi CCD */ #include "mustek_pp_ccd300.h" @@ -1881,7 +1881,7 @@ ccd300_start (SANE_Handle handle) priv->hwres); priv->skipimagebytes = dev->topX; - + sanei_pa4s2_enable (dev->fd, SANE_TRUE); config_ccd (dev); set_voltages (dev); diff --git a/backend/mustek_pp_ccd300.h b/backend/mustek_pp_ccd300.h index 5dfe42d80..a8cf0094b 100644 --- a/backend/mustek_pp_ccd300.h +++ b/backend/mustek_pp_ccd300.h @@ -36,8 +36,8 @@ 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. - + If you do not wish that, delete this exception notice. + This file implements the hardware driver scanners using a 300dpi CCD */ #ifndef __MUSTEK_PP_CCD300_H #define __MUSTEK_PP_CCD300_H diff --git a/backend/mustek_pp_cis.c b/backend/mustek_pp_cis.c index 96e89f1a2..e95c6cfde 100644 --- a/backend/mustek_pp_cis.c +++ b/backend/mustek_pp_cis.c @@ -44,14 +44,14 @@ /* Global picture - + Mustek_PP_handle -> Mustek_PP_dev -> priv = Mustek_PP_CIS_dev -> CIS */ - + /* * This flag determines whether the scanner uses fast skipping at high - * resolutions. It is possible that this fast skipping introduces + * resolutions. It is possible that this fast skipping introduces * inaccuracies. It if turns out to be a problem, fast skipping can * be disabled by setting this flag to 0. */ @@ -68,7 +68,7 @@ #define MUSTEK_PP_CIS_1200CP_DEFAULT_SKIP 330 /* - * Number of scan lines on which the average is taken to determine the + * Number of scan lines on which the average is taken to determine the * maximum number of color levels. */ #define MUSTEK_PP_CIS_AVERAGE_COUNT 32 @@ -110,14 +110,14 @@ *** MA1015 chipset related functionality *** ****************************************************************************** *****************************************************************************/ - + /* - These defines control some debugging functionality + These defines control some debugging functionality #define M1015_TRACE_REGS -> trace the status of the internal registers #define M1015_LOG_HL -> create a high-level log file (register-level) #define M1015_LOG_LL -> create a low-level log file (byte-level) - + By default, all logging/tracing is turned off. */ @@ -130,13 +130,13 @@ #ifdef M1015_LOG_LL static FILE* M1015_LOG_1; - + #define M1015_START_LL\ M1015_LOG_1 = fopen("cis_ll.log", "w"); - + #define M1015_STOP_LL\ fclose(M1015_LOG_1); - + #define SANEI_PA4S2_WRITEBYTE(fd, reg, val)\ do\ {\ @@ -144,10 +144,10 @@ fprintf(M1015_LOG_1, "\tsanei_pa4s2_writebyte(fd, %d, 0x%02X);\n", \ reg, val);\ } while (0) - + static const char* cis_last_rreg_name; - static int cis_read_count; - + static int cis_read_count; + #define SANEI_PA4S2_READBEGIN(fd, reg)\ do\ {\ @@ -155,14 +155,14 @@ cis_read_count = 0;\ sanei_pa4s2_readbegin(fd, reg);\ } while (0) - + #define SANEI_PA4S2_READBYTE(fd, val)\ do\ {\ sanei_pa4s2_readbyte(fd, val);\ ++cis_read_count;\ } while (0) - + #define SANEI_PA4S2_READEND(fd)\ do\ {\ @@ -170,41 +170,41 @@ fprintf(M1015_LOG_1, "\tread_reg(%s, %d);\n", \ cis_last_rreg_name, cis_read_count);\ } while (0) - + #define M1015_MARK_LL(info)\ fprintf(M1015_LOG_1, "* %s\n", info); - + #else /* M1015_LOG_LL */ #define M1015_START_LL #define M1015_STOP_LL - + #define SANEI_PA4S2_WRITEBYTE(fd, reg, val)\ sanei_pa4s2_writebyte (fd, reg, val) - + #define SANEI_PA4S2_READBEGIN(fd, reg)\ sanei_pa4s2_readbegin(fd, reg) - + #define SANEI_PA4S2_READBYTE(fd, val)\ sanei_pa4s2_readbyte(fd, val) - + #define SANEI_PA4S2_READEND(fd)\ sanei_pa4s2_readend(fd) - + #define M1015_MARK_LL(info) - + #endif /* M1015_LOG_LL */ - + /****************************************************************************** * High-level logging: traces the flow of the driver in a hierarchical way * up to the level of register acccesses. - *****************************************************************************/ + *****************************************************************************/ #ifdef M1015_LOG_HL static FILE* M1015_LOG_2; static char hl_prev_line[4096], hl_next_line[4096], hl_repeat_count; - + /* * A few variables for hierarchical log message indentation. */ @@ -213,7 +213,7 @@ " "; static const char* cis_indent; static const char* cis_indent_end; - + #define M1015_START_HL\ M1015_LOG_2 = fopen("cis_hl.log", "w");\ cis_indent = cis_indent_start + strlen(cis_indent_start);\ @@ -221,7 +221,7 @@ hl_prev_line[0] = 0;\ hl_next_line[0] = 0;\ hl_repeat_count = 0; - + #define M1015_FLUSH_HL\ if (strcmp(hl_prev_line, hl_next_line))\ {\ @@ -238,7 +238,7 @@ {\ hl_repeat_count += 1;\ } - + #define M1015_MARK(info)\ sprintf(&hl_next_line[0], "%s+ %s\n", cis_indent, info);\ M1015_FLUSH_HL @@ -246,45 +246,45 @@ #define M1015_STOP_HL\ hl_next_line[0] = 0;\ M1015_FLUSH_HL\ - fclose(M1015_LOG_2); - -#else /* M1015_LOG_HL */ + fclose(M1015_LOG_2); + +#else /* M1015_LOG_HL */ #define M1015_START_HL #define M1015_STOP_HL #define M1015_MARK(info) #define M1015_FLUSH_HL - + #endif /* M1015_LOG_HL */ #ifdef M1015_TRACE_REGS #define M1015_DISPLAY_REGS(dev, msg) Mustek_PP_1015_display_regs(dev, msg) #define M1015_DISPLAY_REG(msg, val) Mustek_PP_1015_display_reg(msg, val) #else - #define M1015_DISPLAY_REGS(dev, msg) - #define M1015_DISPLAY_REG(msg, val) + #define M1015_DISPLAY_REGS(dev, msg) + #define M1015_DISPLAY_REG(msg, val) #endif - + #if defined (M1015_LOG_HL) || defined (M1015_LOG_LL) -static const char* +static const char* Mustek_PP_1015_reg_r_name(Mustek_PP_1015R_reg id) { static const char* names[4] = { "ASIC", "SCAN_VAL", "MOTOR", "BANK_COUNT" }; return names[id & 0x03]; } -static const char* +static const char* Mustek_PP_1015_bit_name(Mustek_PP_1015R_bit id) { static const char* names[4] = { "????", "MOTOR_HOME", "????", "MOTOR_BUSY" }; return names[id & 0x03]; } -static const char* +static const char* Mustek_PP_1015_reg_w_name(Mustek_PP_1015R_reg id) { - static const char* names[4][4] = + static const char* names[4][4] = { { "RED_REF", "GREEN_REF", "BLUE_REF", "DPI_CONTROL" }, { "BYTE_COUNT_HB", "BYTE_COUNT_LB", "SKIP_COUNT", "EXPOSE_TIME" }, @@ -304,9 +304,9 @@ Mustek_PP_1015_show_val(int val) /* Since we use a static temporary buffer, we must make sure that the buffer isn't altered while it is still in use (typically because - more than one value is converted in a printf statement). + more than one value is converted in a printf statement). Therefore the buffer is organized as a ring buffer. If should contain - at least 21 elements in order to be able to display all registers + at least 21 elements in order to be able to display all registers with one printf statement. */ #define Mustek_PP_1015_RING_BUFFER_SIZE 50 @@ -314,9 +314,9 @@ Mustek_PP_1015_show_val(int val) static int index = 0; int i; char* current = (char*)buf[index++]; - + if (index >= Mustek_PP_1015_RING_BUFFER_SIZE) index = 0; - + if (val < 0) { /* The register has not been initialized yet. */ @@ -345,8 +345,8 @@ Mustek_PP_1015_display_regs(Mustek_PP_CIS_dev * dev, const char* info) * Rx : read-only register no. x * ByWx : write-only register no. x of bank no. y */ - - fprintf(stderr, + + fprintf(stderr, "\n" "Register status: %s\n" "\n" @@ -403,12 +403,12 @@ Mustek_PP_1015_display_regs(Mustek_PP_CIS_dev * dev, const char* info) (dev->CIS.regs.channel == 0x40 ? "GREEN" : (dev->CIS.regs.channel == 0xC0 ? "BLUE" : "unknown"))) ); -} +} /****************************************************************************** * Displays a single register value *****************************************************************************/ -static void +static void Mustek_PP_1015_display_reg(const char* info, int val) { fprintf (stderr, "%s: %s\n", info, Mustek_PP_1015_show_val(val)); @@ -432,21 +432,21 @@ Mustek_PP_1015_read_reg(Mustek_PP_CIS_dev * dev, Mustek_PP_1015R_reg reg) { SANE_Byte tmp; assert(reg <= 3); - - SANEI_PA4S2_READBEGIN (dev->desc->fd, reg & 0x03); - SANEI_PA4S2_READBYTE (dev->desc->fd, &tmp); - SANEI_PA4S2_READEND (dev->desc->fd); - + + SANEI_PA4S2_READBEGIN (dev->desc->fd, reg & 0x03); + SANEI_PA4S2_READBYTE (dev->desc->fd, &tmp); + SANEI_PA4S2_READEND (dev->desc->fd); + #ifdef M1015_LOG_HL - sprintf(&hl_next_line[0], "%s read_reg(%s); [%s]\n", cis_indent, + sprintf(&hl_next_line[0], "%s read_reg(%s); [%s]\n", cis_indent, Mustek_PP_1015_reg_r_name(reg), Mustek_PP_1015_show_val(tmp)); M1015_FLUSH_HL; #endif - -#ifdef M1015_TRACE_REGS + +#ifdef M1015_TRACE_REGS dev->CIS.regs.in_regs[reg & 0x03] = tmp; #endif - + return tmp; } @@ -463,12 +463,12 @@ Mustek_PP_1015_wait_bit(Mustek_PP_CIS_dev * dev, Mustek_PP_1015R_reg reg, SANE_Byte tmp; SANE_Byte mask, val; int tries = 0; - + assert(reg <= 3); assert(bit <= 3); - + mask = 1 << bit; - + /* We don't want to wait forever */ while (dev->desc->state != STATE_CANCELLED) { @@ -476,26 +476,26 @@ Mustek_PP_1015_wait_bit(Mustek_PP_CIS_dev * dev, Mustek_PP_1015R_reg reg, ++tries; #endif - sanei_pa4s2_readbegin (dev->desc->fd, reg & 0x03); - sanei_pa4s2_readbyte (dev->desc->fd, &tmp); - sanei_pa4s2_readend (dev->desc->fd); - + sanei_pa4s2_readbegin (dev->desc->fd, reg & 0x03); + sanei_pa4s2_readbyte (dev->desc->fd, &tmp); + sanei_pa4s2_readend (dev->desc->fd); + #ifdef M1015_LOG_HL - sprintf(&hl_next_line[0], "%s wait_bit(%s, %s, %d): %s %s;\n", cis_indent, + sprintf(&hl_next_line[0], "%s wait_bit(%s, %s, %d): %s %s;\n", cis_indent, Mustek_PP_1015_reg_r_name(reg), Mustek_PP_1015_bit_name(bit), on?1:0, Mustek_PP_1015_show_val(mask), Mustek_PP_1015_show_val(tmp)); M1015_FLUSH_HL; #endif val = ((on == SANE_TRUE) ? tmp : ~tmp ) & mask; - + if (val != 0) break; - + if (period) usleep(period); - - if (tries > 50000) + + if (tries > 50000) { #ifdef M1015_LOG_HL - sprintf(&hl_next_line[0], "%s wait_bit(%s, %s, %d): failed;\n", cis_indent, + sprintf(&hl_next_line[0], "%s wait_bit(%s, %s, %d): failed;\n", cis_indent, Mustek_PP_1015_reg_r_name(reg), Mustek_PP_1015_bit_name(bit), on?1:0); M1015_FLUSH_HL; #endif @@ -504,9 +504,9 @@ Mustek_PP_1015_wait_bit(Mustek_PP_CIS_dev * dev, Mustek_PP_1015R_reg reg, return SANE_FALSE; } } - + #ifdef M1015_LOG_HL - sprintf(&hl_next_line[0], "%s wait_bit(%s, %s, %d);\n", cis_indent, + sprintf(&hl_next_line[0], "%s wait_bit(%s, %s, %d);\n", cis_indent, Mustek_PP_1015_reg_r_name(reg), Mustek_PP_1015_bit_name(bit), on?1:0); M1015_FLUSH_HL; #endif @@ -514,12 +514,12 @@ Mustek_PP_1015_wait_bit(Mustek_PP_CIS_dev * dev, Mustek_PP_1015R_reg reg, fprintf(M1015_LOG_1, "\tread_reg(%s, %d);\n", Mustek_PP_1015_reg_r_name(reg), tries); #endif - -#ifdef M1015_TRACE_REGS + +#ifdef M1015_TRACE_REGS dev->CIS.regs.in_regs[reg & 0x03] = tmp; #endif return dev->desc->state != STATE_CANCELLED ? SANE_TRUE : SANE_FALSE; -} +} /****************************************************************************** * @@ -540,9 +540,9 @@ Mustek_PP_1015_wait_bit(Mustek_PP_CIS_dev * dev, Mustek_PP_1015R_reg reg, * Bank 2 * 0: unknown, used to start linear sequence during calibration * 1: motor control code (forward, return home, ...) - * 2: never used + * 2: never used * 3: never used - * + * * Bank 3 * 0: reduction factor (16bit internal -> 8bit) -> target for calibration * 1: unknown -> always set to 0x05 @@ -550,27 +550,27 @@ Mustek_PP_1015_wait_bit(Mustek_PP_CIS_dev * dev, Mustek_PP_1015R_reg reg, * 3: never used * *****************************************************************************/ - + static void Mustek_PP_1015_write_reg(Mustek_PP_CIS_dev * dev, Mustek_PP_1015W_reg reg, SANE_Byte val) { - + SANE_Byte regBank = (reg & 0xF0) >> 4; SANE_Byte regNo = (reg & 0x0F); - + assert (regNo <= 3); assert (regBank <= 3); - + SANEI_PA4S2_WRITEBYTE (dev->desc->fd, 6, (1 << (4+regNo))+ regBank); SANEI_PA4S2_WRITEBYTE (dev->desc->fd, 5, val); SANEI_PA4S2_WRITEBYTE (dev->desc->fd, 6, regBank); - -#ifdef M1015_TRACE_REGS + +#ifdef M1015_TRACE_REGS dev->CIS.regs.out_regs[regBank][regNo] = val; #endif #ifdef M1015_LOG_HL - sprintf(&hl_next_line[0], "%s write_reg(%s, 0x%02X);\n", cis_indent, + sprintf(&hl_next_line[0], "%s write_reg(%s, 0x%02X);\n", cis_indent, Mustek_PP_1015_reg_w_name(reg), val); M1015_FLUSH_HL; #endif @@ -586,28 +586,28 @@ Mustek_PP_1015_write_reg(Mustek_PP_CIS_dev * dev, Mustek_PP_1015W_reg reg, SANE_ * *****************************************************************************/ static void -Mustek_PP_1015_write_reg2(Mustek_PP_CIS_dev * dev, Mustek_PP_1015W_reg reg, +Mustek_PP_1015_write_reg2(Mustek_PP_CIS_dev * dev, Mustek_PP_1015W_reg reg, SANE_Byte val1, SANE_Byte val2) { SANE_Byte regBank = (reg & 0xF0) >> 4; SANE_Byte regNo = (reg & 0x0F); - + assert (regNo <= 2); assert (regBank <= 3); - + SANEI_PA4S2_WRITEBYTE (dev->desc->fd, 6, (1 << (4+regNo))+ regBank); SANEI_PA4S2_WRITEBYTE (dev->desc->fd, 5, val1); SANEI_PA4S2_WRITEBYTE (dev->desc->fd, 6, (1 << (5+regNo))+ regBank); SANEI_PA4S2_WRITEBYTE (dev->desc->fd, 5, val2); SANEI_PA4S2_WRITEBYTE (dev->desc->fd, 6, regBank); - -#ifdef M1015_TRACE_REGS + +#ifdef M1015_TRACE_REGS dev->CIS.regs.out_regs[regBank][regNo] = val1; dev->CIS.regs.out_regs[regBank][regNo+1] = val2; #endif - + #ifdef M1015_LOG_HL - sprintf(&hl_next_line[0], "%s write_reg2(%s, 0x%02X, 0x%02X);\n", + sprintf(&hl_next_line[0], "%s write_reg2(%s, 0x%02X, 0x%02X);\n", cis_indent, Mustek_PP_1015_reg_w_name(reg), val1, val2); M1015_FLUSH_HL; #endif @@ -624,15 +624,15 @@ Mustek_PP_1015_write_reg2(Mustek_PP_CIS_dev * dev, Mustek_PP_1015W_reg reg, * *****************************************************************************/ static void -Mustek_PP_1015_write_reg3(Mustek_PP_CIS_dev * dev, Mustek_PP_1015W_reg reg, +Mustek_PP_1015_write_reg3(Mustek_PP_CIS_dev * dev, Mustek_PP_1015W_reg reg, SANE_Byte val1, SANE_Byte val2, SANE_Byte val3) { SANE_Byte regBank = (reg & 0xF0) >> 4; SANE_Byte regNo = (reg & 0x0F); - + assert (regNo <= 1); assert (regBank <= 3); - + SANEI_PA4S2_WRITEBYTE (dev->desc->fd, 6, (1 << (4+regNo))+ regBank); SANEI_PA4S2_WRITEBYTE (dev->desc->fd, 5, val1); SANEI_PA4S2_WRITEBYTE (dev->desc->fd, 6, (1 << (5+regNo))+ regBank); @@ -640,15 +640,15 @@ Mustek_PP_1015_write_reg3(Mustek_PP_CIS_dev * dev, Mustek_PP_1015W_reg reg, SANEI_PA4S2_WRITEBYTE (dev->desc->fd, 6, (1 << (6+regNo))+ regBank); SANEI_PA4S2_WRITEBYTE (dev->desc->fd, 5, val3); SANEI_PA4S2_WRITEBYTE (dev->desc->fd, 6, regBank); - -#ifdef M1015_TRACE_REGS + +#ifdef M1015_TRACE_REGS dev->CIS.regs.out_regs[regBank][regNo ] = val1; dev->CIS.regs.out_regs[regBank][regNo+1] = val2; dev->CIS.regs.out_regs[regBank][regNo+2] = val3; #endif - + #ifdef M1015_LOG_HL - sprintf(&hl_next_line[0], "%s write_reg3(%s, 0x%02X, 0x%02X, 0x%02X);\n", + sprintf(&hl_next_line[0], "%s write_reg3(%s, 0x%02X, 0x%02X, 0x%02X);\n", cis_indent, Mustek_PP_1015_reg_w_name(reg), val1, val2, val3); M1015_FLUSH_HL; #endif @@ -656,43 +656,43 @@ Mustek_PP_1015_write_reg3(Mustek_PP_CIS_dev * dev, Mustek_PP_1015W_reg reg, /****************************************************************************** * Opens a register for a (series of) write operation(s). - *****************************************************************************/ + *****************************************************************************/ static void Mustek_PP_1015_write_reg_start(Mustek_PP_CIS_dev * dev, Mustek_PP_1015W_reg reg) { SANE_Byte regBank = (reg & 0xF0) >> 4; SANE_Byte regNo = (reg & 0x0F); - + assert (regNo <= 3); assert (regBank <= 3); - + dev->CIS.regs.current_write_reg = reg; - + #ifdef M1015_LOG_HL dev->CIS.regs.write_count = 0; #endif - + SANEI_PA4S2_WRITEBYTE (dev->desc->fd, 6, (1 << (4+regNo))+ regBank); } /****************************************************************************** * Writes a value to the currently open register. - *****************************************************************************/ + *****************************************************************************/ static void Mustek_PP_1015_write_reg_val(Mustek_PP_CIS_dev * dev, SANE_Byte val) { -#ifdef M1015_TRACE_REGS +#ifdef M1015_TRACE_REGS SANE_Byte regBank = (dev->CIS.regs.current_write_reg & 0xF0) >> 4; SANE_Byte regNo = (dev->CIS.regs.current_write_reg & 0x0F); - + assert (regNo <= 3); assert (regBank <= 3); - + dev->CIS.regs.out_regs[regBank][regNo] = val; #endif - + SANEI_PA4S2_WRITEBYTE (dev->desc->fd, 5, val); - + #ifdef M1015_LOG_HL ++dev->CIS.regs.write_count; #endif @@ -700,7 +700,7 @@ Mustek_PP_1015_write_reg_val(Mustek_PP_CIS_dev * dev, SANE_Byte val) /****************************************************************************** * Closes a register after a (series of) write operation(s). - *****************************************************************************/ + *****************************************************************************/ static void Mustek_PP_1015_write_reg_stop(Mustek_PP_CIS_dev * dev) { @@ -708,16 +708,16 @@ Mustek_PP_1015_write_reg_stop(Mustek_PP_CIS_dev * dev) #ifdef M1015_LOG_HL SANE_Byte regNo = (dev->CIS.regs.current_write_reg & 0x0F); assert (regNo <= 3); - + sprintf(&hl_next_line[0], "%s write_reg_multi(%s, *%d);\n", cis_indent, - Mustek_PP_1015_reg_w_name(dev->CIS.regs.current_write_reg), + Mustek_PP_1015_reg_w_name(dev->CIS.regs.current_write_reg), dev->CIS.regs.write_count); M1015_FLUSH_HL; #endif assert (regBank <= 3); - + SANEI_PA4S2_WRITEBYTE (dev->desc->fd, 6, regBank); -} +} /****************************************************************************** * @@ -725,12 +725,12 @@ Mustek_PP_1015_write_reg_stop(Mustek_PP_CIS_dev * dev) * internal registers, ie., the 3rd bit should not be zero. * *****************************************************************************/ -static void +static void Mustek_PP_1015_send_command(Mustek_PP_CIS_dev * dev, SANE_Byte command) { assert (command & 0x04); SANEI_PA4S2_WRITEBYTE (dev->desc->fd, 6, command); - + #ifdef M1015_LOG_HL sprintf(&hl_next_line[0], "%s send_command(0x%02X);\n", cis_indent, command); M1015_FLUSH_HL; @@ -742,7 +742,7 @@ Mustek_PP_1015_send_command(Mustek_PP_CIS_dev * dev, SANE_Byte command) ## CIS driver ## ############################################################################## *****************************************************************************/ - + /****************************************************************************** * Resolution conversion functions *****************************************************************************/ @@ -810,7 +810,7 @@ cis_wait_bank_change (Mustek_PP_CIS_dev * dev, int bankcount) struct timeval start, end; unsigned long diff; int firsttime = 1; - + gettimeofday (&start, NULL); do @@ -830,14 +830,14 @@ cis_wait_bank_change (Mustek_PP_CIS_dev * dev, int bankcount) } while ((dev->bank_count != bankcount) && (diff < MUSTEK_PP_CIS_WAIT_BANK)); - + if (dev->bank_count != bankcount && dev->desc->state != STATE_CANCELLED) { u_char tmp; tmp = Mustek_PP_1015_read_reg(dev, 3); DBG(2, "cis_wait_bank_change: Missed a bank: got %d [%s], " - "wanted %d, waited %d msec\n", - dev->bank_count, Mustek_PP_1015_show_val(tmp), bankcount, + "wanted %d, waited %d msec\n", + dev->bank_count, Mustek_PP_1015_show_val(tmp), bankcount, MUSTEK_PP_CIS_WAIT_BANK); } @@ -846,10 +846,10 @@ cis_wait_bank_change (Mustek_PP_CIS_dev * dev, int bankcount) /****************************************************************************** * Configure the CIS for a given resolution. - * - * CIS scanners seem to have 2 modes: * - * low resolution (50-300 DPI) and + * CIS scanners seem to have 2 modes: + * + * low resolution (50-300 DPI) and * high resolution (300-600 DPI). * * Depending on the resolution requested by the user, the scanner is used @@ -861,7 +861,7 @@ static void cis_set_dpi_value (Mustek_PP_CIS_dev * dev) { u_char val = 0; - + if (dev->model == MUSTEK_PP_CIS1200PLUS) { /* Toshiba CIS: only 600 DPI + decimation */ @@ -887,7 +887,7 @@ cis_set_dpi_value (Mustek_PP_CIS_dev * dev) break; default: assert (0); - } + } } else { @@ -916,7 +916,7 @@ cis_set_dpi_value (Mustek_PP_CIS_dev * dev) assert (0); } } - + Mustek_PP_1015_write_reg(dev, MA1015W_DPI_CONTROL, val | 0x04); DBG (4, "cis_set_dpi_value: dpi: %d -> value 0x%02x\n", dev->CIS.hw_hres, val); @@ -928,19 +928,19 @@ cis_set_ccd_channel (Mustek_PP_CIS_dev * dev) SANE_Byte codes[] = { 0x84, 0x44, 0xC4 }; SANE_Byte chancode; - + assert (dev->CIS.channel < 3); - + chancode = codes[dev->CIS.channel]; - - /* - The TWAIN driver sets an extra bit in lineart mode. - When I do this too, I don't see any effect on the image. - Moreover, for 1 resolution, namely 400 dpi, the bank counter seems + + /* + The TWAIN driver sets an extra bit in lineart mode. + When I do this too, I don't see any effect on the image. + Moreover, for 1 resolution, namely 400 dpi, the bank counter seems to behave strangely, and the synchronization get completely lost. I guess the software conversion from gray to lineart is good enough, so I'll leave it like that. - + if (dev->CIS.setParameters) { chancode |= (dev->desc->mode == MODE_BW) ? 0x20: 0; @@ -948,7 +948,7 @@ cis_set_ccd_channel (Mustek_PP_CIS_dev * dev) */ SANEI_PA4S2_WRITEBYTE (dev->desc->fd, 6, chancode); - + #ifdef M1015_TRACE_REGS dev->CIS.regs.channel = chancode; #endif @@ -958,43 +958,43 @@ static void cis_config_ccd (Mustek_PP_CIS_dev * dev) { SANE_Int skipCount, byteCount; - + if (dev->CIS.res != 0) dev->CIS.hres_step = SANE_FIX ((float) dev->CIS.hw_hres / (float) dev->CIS.res); /* CIS: <= 300 dpi -> 0x86 - > 300 dpi -> 0x96 */ + > 300 dpi -> 0x96 */ if (dev->CIS.cisRes == 600) SANEI_PA4S2_WRITEBYTE (dev->desc->fd, 6, 0x96); else SANEI_PA4S2_WRITEBYTE (dev->desc->fd, 6, 0x86); - + cis_set_dpi_value(dev); - + if (dev->CIS.setParameters) { dev->CIS.channel = dev->desc->mode == MODE_COLOR ? MUSTEK_PP_CIS_CHANNEL_RED : MUSTEK_PP_CIS_CHANNEL_GRAY; } else - { + { dev->CIS.channel = MUSTEK_PP_CIS_CHANNEL_GRAY; } - + cis_set_ccd_channel (dev); - + Mustek_PP_1015_write_reg (dev, MA1015W_POWER_ON_DELAY, 0xAA); - Mustek_PP_1015_write_reg (dev, MA1015W_CCD_TIMING, 0x05); - Mustek_PP_1015_write_reg (dev, MA1015W_CCD_TIMING_ADJ, 0x00); + Mustek_PP_1015_write_reg (dev, MA1015W_CCD_TIMING, 0x05); + Mustek_PP_1015_write_reg (dev, MA1015W_CCD_TIMING_ADJ, 0x00); Mustek_PP_1015_send_command (dev, 0x45); /* or 0x05 for no 8kbank */ /* * Unknown sequence. * Seems to be always the same during configuration, independent of the - * mode and the resolution. + * mode and the resolution. */ CIS_CLEAR_FULLFLAG(dev); CIS_INC_READ(dev); @@ -1020,14 +1020,14 @@ cis_config_ccd (Mustek_PP_CIS_dev * dev) # > 300 DPI # # Skip = 67 + skipimage - # + # # Skip1 = Skip / 32 # Skip2 = Skip % 32 # # Bytes = Skip2*hw_hres/600 + (imagebytes * hw_hres/res) + 2 # */ - + skipCount = 67; /* Hardware parameter - fixed */ if (dev->CIS.setParameters == SANE_TRUE) @@ -1043,11 +1043,11 @@ cis_config_ccd (Mustek_PP_CIS_dev * dev) */ DBG(4, "cis_config_ccd: Skip count: %d\n", skipCount); skipCount += max2cis_hres(dev, dev->CIS.skipimagebytes); - DBG(4, "cis_config_ccd: Skip count: %d (cis res: %d)\n", skipCount, + DBG(4, "cis_config_ccd: Skip count: %d (cis res: %d)\n", skipCount, dev->CIS.cisRes); skipCount += (int)(2.0/25.4*dev->CIS.cisRes); DBG(4, "cis_config_ccd: Skip count: %d\n", skipCount); - + Mustek_PP_1015_write_reg (dev, MA1015W_SKIP_COUNT, skipCount / 32); DBG(4, "cis_config_ccd: Skip count: %d (x32)\n", skipCount / 32); } @@ -1056,12 +1056,12 @@ cis_config_ccd (Mustek_PP_CIS_dev * dev) Mustek_PP_1015_write_reg (dev, MA1015W_SKIP_COUNT, 0); DBG(4, "cis_config_ccd: Skip count: 67 (x32)\n"); } - + skipCount %= 32; skipCount = cis2max_res(dev, skipCount); /* Back to max res */ - - Mustek_PP_1015_write_reg(dev, MA1015W_EXPOSE_TIME, dev->CIS.exposeTime); - + + Mustek_PP_1015_write_reg(dev, MA1015W_EXPOSE_TIME, dev->CIS.exposeTime); + DBG(4, "cis_config_ccd: skipcount: %d imagebytes: %d\n", skipCount, dev->CIS.imagebytes); /* set_initial_skip_1015 (dev); */ if (dev->CIS.setParameters == SANE_TRUE) @@ -1071,20 +1071,20 @@ cis_config_ccd (Mustek_PP_CIS_dev * dev) /* The TWAIN drivers always sends the same value: 0x96 */ Mustek_PP_1015_write_reg3(dev, MA1015W_RED_REF, 0x96, 0x96, 0x96); dev->CIS.adjustskip = max2hw_hres(dev, skipCount); - byteCount = max2hw_hres(dev, skipCount + dev->CIS.imagebytes) + 2; + byteCount = max2hw_hres(dev, skipCount + dev->CIS.imagebytes) + 2; dev->CIS.setParameters = SANE_FALSE; } else { dev->CIS.adjustskip = 0; - byteCount = max2hw_hres(dev, skipCount); + byteCount = max2hw_hres(dev, skipCount); } - DBG(4, "cis_config_ccd: adjust skip: %d bytecount: %d\n", + DBG(4, "cis_config_ccd: adjust skip: %d bytecount: %d\n", dev->CIS.adjustskip, byteCount); - - Mustek_PP_1015_write_reg2(dev, MA1015W_BYTE_COUNT_HB, - byteCount >> 8, byteCount & 0xFF); - + + Mustek_PP_1015_write_reg2(dev, MA1015W_BYTE_COUNT_HB, + byteCount >> 8, byteCount & 0xFF); + cis_get_bank_count (dev); DBG(5, "cis_config_ccd: done\n"); } @@ -1093,8 +1093,8 @@ static SANE_Bool cis_wait_motor_stable (Mustek_PP_CIS_dev * dev) { static struct timeval timeoutVal; - SANE_Bool ret = - Mustek_PP_1015_wait_bit (dev, MA1015R_MOTOR, MA1015B_MOTOR_STABLE, + SANE_Bool ret = + Mustek_PP_1015_wait_bit (dev, MA1015R_MOTOR, MA1015B_MOTOR_STABLE, SANE_FALSE, 0); #ifdef HAVE_SYS_SELECT_H if (dev->engine_delay > 0) @@ -1111,7 +1111,7 @@ static void cis_motor_forward (Mustek_PP_CIS_dev * dev) { SANE_Byte control; - + if (dev->model == MUSTEK_PP_CIS600) { switch (dev->CIS.hw_vres) @@ -1150,11 +1150,11 @@ cis_motor_forward (Mustek_PP_CIS_dev * dev) #if MUSTEK_PP_CIS_MOTOR_REVERSE == 1 control ^= 0x10; #endif - + DBG(4, "cis_motor_forward: @%d dpi: 0x%02X.\n", dev->CIS.hw_vres, control); if (!cis_wait_motor_stable (dev)) return; - + Mustek_PP_1015_write_reg(dev, MA1015W_MOTOR_CONTROL, control); } @@ -1166,20 +1166,20 @@ cis_move_motor (Mustek_PP_CIS_dev * dev, SANE_Int steps) /* steps @ maxres */ SANE_Int fullSteps, biSteps, quadSteps; /* * During a multi-step feed, the expose time is fixed. The value depends - * on the type of the motor (600/1200 CP) + * on the type of the motor (600/1200 CP) */ SANE_Byte savedExposeTime = dev->CIS.exposeTime; dev->CIS.exposeTime = 85; - + DBG(4, "cis_move_motor: Moving motor %d steps.\n", steps); - + /* Just in case ... */ if (steps < 0) { DBG(1, "cis_move_motor: trying to move negative steps: %d\n", steps); steps = 0; /* We must go through the configuration procedure */ - } - + } + /* * Using the parameter settings for the 600 CP on a 1200 CP scanner * doesn't work: the engine doesn't move and makes a sharp noise, which @@ -1190,8 +1190,8 @@ cis_move_motor (Mustek_PP_CIS_dev * dev, SANE_Int steps) /* steps @ maxres */ dev->CIS.exposeTime <<= 1; cis_config_ccd(dev); dev->CIS.exposeTime = savedExposeTime; - - /* + + /* * This is a minor speed optimization: when we are using the high * resolution mode, long feeds (eg, to move to a scan area at the bottom * of the page) can be made almost twice as fast by using double motor @@ -1199,8 +1199,8 @@ cis_move_motor (Mustek_PP_CIS_dev * dev, SANE_Int steps) /* steps @ maxres */ * It is possible, though, that fast skipping (which is the default) is * not very accurate on some scanners. Therefore, the user can disable * this through the configuration file. - */ - + */ + fullSteps = steps & 1; biSteps = steps >> 1; if (dev->fast_skip) { @@ -1210,33 +1210,33 @@ cis_move_motor (Mustek_PP_CIS_dev * dev, SANE_Int steps) /* steps @ maxres */ else { quadSteps = 0; } - + M1015_DISPLAY_REGS(dev, "Before move"); - + #if MUSTEK_PP_CIS_MOTOR_REVERSE == 1 fullStep ^= 0x10; biStep ^= 0x10; quadStep ^= 0x10; #endif - + DBG(4, "cis_move_motor: 4x%d 2x%d 1x%d\n", quadSteps, biSteps, fullSteps); - /* Note: the TWAIN driver opens the motor control register only + /* Note: the TWAIN driver opens the motor control register only once before the loop, and closes it after the loop. I've tried this too, but it resulted in inaccurate skip distances; therefore, the motor control register is now opened and closed for each step. */ - + while (quadSteps-- > 0 && dev->desc->state != STATE_CANCELLED) { cis_wait_motor_stable (dev); Mustek_PP_1015_write_reg(dev, MA1015W_MOTOR_CONTROL, quadStep); } - + while (biSteps-- > 0 && dev->desc->state != STATE_CANCELLED) { cis_wait_motor_stable (dev); Mustek_PP_1015_write_reg(dev, MA1015W_MOTOR_CONTROL, biStep); } - + while (fullSteps-- > 0 && dev->desc->state != STATE_CANCELLED) { cis_wait_motor_stable (dev); @@ -1247,16 +1247,16 @@ cis_move_motor (Mustek_PP_CIS_dev * dev, SANE_Int steps) /* steps @ maxres */ static void cis_set_et_pd_sti (Mustek_PP_CIS_dev * dev) { - Mustek_PP_1015_write_reg(dev, MA1015W_EXPOSE_TIME, + Mustek_PP_1015_write_reg(dev, MA1015W_EXPOSE_TIME, dev->CIS.exposeTime); - Mustek_PP_1015_write_reg(dev, MA1015W_POWER_ON_DELAY, + Mustek_PP_1015_write_reg(dev, MA1015W_POWER_ON_DELAY, dev->CIS.powerOnDelay[dev->CIS.channel]); cis_set_ccd_channel (dev); cis_set_sti (dev); } /* - * Prepare the scanner for catching the next channel and, if necessary, + * Prepare the scanner for catching the next channel and, if necessary, * move the head one step further. */ static SANE_Bool @@ -1264,32 +1264,32 @@ cis_wait_next_channel (Mustek_PP_CIS_dev * dev) { int moveAtChannel = dev->desc->mode == MODE_COLOR ? MUSTEK_PP_CIS_CHANNEL_BLUE : MUSTEK_PP_CIS_CHANNEL_GRAY; - + if (!cis_wait_bank_change (dev, dev->bank_count)) { DBG(2, "cis_wait_next_channel: Could not get next bank.\n"); return SANE_FALSE; } - + moveAtChannel = (dev->desc->mode == MODE_COLOR) ? MUSTEK_PP_CIS_CHANNEL_BLUE : MUSTEK_PP_CIS_CHANNEL_GRAY; - + if (dev->CIS.channel == moveAtChannel && !dev->CIS.dontMove) { cis_motor_forward (dev); } - + cis_set_et_pd_sti (dev); - + if (dev->desc->mode == MODE_COLOR) { ++dev->CIS.channel; dev->CIS.channel %= 3; } - + return SANE_TRUE; } - + /* * Wait for the device to be ready for scanning. Cycles through the different * channels and sets the parameters (only green channel in gray/lineart). @@ -1299,10 +1299,10 @@ cis_wait_read_ready (Mustek_PP_CIS_dev * dev) { int channel; dev->CIS.dontIncRead = SANE_TRUE; - + dev->CIS.channel = dev->desc->mode == MODE_COLOR ? MUSTEK_PP_CIS_CHANNEL_RED : MUSTEK_PP_CIS_CHANNEL_GRAY; - + for (channel = 0; channel < 3; ++channel) { if (!cis_wait_next_channel(dev)) return SANE_FALSE; @@ -1313,9 +1313,9 @@ cis_wait_read_ready (Mustek_PP_CIS_dev * dev) static int delay_read (int delay) { - /* + /* * A (very) smart compiler may complete optimize the delay loop away. By - * adding some difficult data dependencies, we can try to prevent this. + * adding some difficult data dependencies, we can try to prevent this. */ static int prevent_removal, i; for (i = 0; idesc->fd, 1); while(skips-- >= 0) @@ -1384,7 +1384,7 @@ cis_read_line_low_level (Mustek_PP_CIS_dev * dev, SANE_Byte * buf, else if (dev->CIS.hw_hres > dev->CIS.res) { /* Sub-sampling */ - + int pos = 0; DBG (6, "cis_read_line_low_level: sub-sampling\n"); ctr = 0; @@ -1428,8 +1428,8 @@ cis_read_line_low_level (Mustek_PP_CIS_dev * dev, SANE_Byte * buf, int calctr = 0; SANE_Int pos = 0, nextPos = 1; /* Step: eg: 600 DPI -> 700 DPI -> hres_step = 6/7 -> step = 1/7 */ - SANE_Int step = SANE_FIX(1) - dev->CIS.hres_step; - + SANE_Int step = SANE_FIX(1) - dev->CIS.hres_step; + /* Super-sampling */ DBG (6, "cis_read_line_low_level: super-sampling\n"); do @@ -1446,11 +1446,11 @@ cis_read_line_low_level (Mustek_PP_CIS_dev * dev, SANE_Byte * buf, if (calib_hi) { hi_val = calib_hi[calctr] ; } - + if (++calctr >= dev->calib_pixels) { - /* Avoid array boundary violations due to rounding errors + /* Avoid array boundary violations due to rounding errors (due to the incremental calculation, the current position - may be inaccurate to up to two pixels, so we may need to + may be inaccurate to up to two pixels, so we may need to read a few extra bytes -> use the last calibration value) */ calctr = dev->calib_pixels - 1; DBG (3, "cis_read_line_low_level: calibration overshoot\n"); @@ -1467,19 +1467,19 @@ cis_read_line_low_level (Mustek_PP_CIS_dev * dev, SANE_Byte * buf, cval = gamma[cval]; pos += step; - + if ((pos >> SANE_FIXED_SCALE_SHIFT) >= nextPos) { nextPos++; - + /* Insert an interpolated value */ buf[bpos] = (buf[bpos-1] + cval)/2; /* Interpolate */ ++bpos; - + /* Store the plain value, but only if we still need pixels */ if (bpos < pixel) buf[bpos++] = cval; - + pos += step; /* Take interpolated value into account for pos */ } else @@ -1489,7 +1489,7 @@ cis_read_line_low_level (Mustek_PP_CIS_dev * dev, SANE_Byte * buf, } while (bpos < pixel); } - + SANEI_PA4S2_READEND (dev->desc->fd); DBG (6, "cis_read_line_low_level: done\n"); } @@ -1502,8 +1502,8 @@ cis_read_line (Mustek_PP_CIS_dev * dev, SANE_Byte* buf, SANE_Int pixel, CIS_INC_READ(dev); else dev->CIS.dontIncRead = SANE_FALSE; - - + + if (raw) { /* No color correction; raw data */ @@ -1513,12 +1513,12 @@ cis_read_line (Mustek_PP_CIS_dev * dev, SANE_Byte* buf, SANE_Int pixel, { /* Color correction */ cis_read_line_low_level (dev, buf, pixel, - dev->calib_low[dev->CIS.channel], - dev->calib_hi[dev->CIS.channel], - (dev->desc->val[OPT_CUSTOM_GAMMA].w ? + dev->calib_low[dev->CIS.channel], + dev->calib_hi[dev->CIS.channel], + (dev->desc->val[OPT_CUSTOM_GAMMA].w ? dev->desc->gamma_table[dev->CIS.channel] : NULL)); } - + return cis_wait_next_channel(dev); } @@ -1528,7 +1528,7 @@ cis_get_next_line (Mustek_PP_CIS_dev * dev, SANE_Byte * buf) SANE_Byte *dest, *tmpbuf = dev->tmpbuf; int ctr, channel, first, last, stride, step = dev->CIS.line_step; SANE_Byte gotline; - + if (dev->desc->mode == MODE_COLOR) { first = MUSTEK_PP_CIS_CHANNEL_RED; @@ -1541,7 +1541,7 @@ cis_get_next_line (Mustek_PP_CIS_dev * dev, SANE_Byte * buf) last = MUSTEK_PP_CIS_CHANNEL_GRAY; stride = 1; } - + gotline = SANE_FALSE; do { @@ -1556,8 +1556,8 @@ cis_get_next_line (Mustek_PP_CIS_dev * dev, SANE_Byte * buf) for (channel = first; channel <= last; ++channel) { - if (!cis_read_line(dev, tmpbuf, dev->desc->params.pixels_per_line, - SANE_FALSE)) + if (!cis_read_line(dev, tmpbuf, dev->desc->params.pixels_per_line, + SANE_FALSE)) return; dest = buf + channel - first; @@ -1601,7 +1601,7 @@ cis_get_color_line (Mustek_PP_CIS_dev * dev, SANE_Byte * buf) /****************************************************************************** * Saves the state of the device during reset and calibration. *****************************************************************************/ -static void +static void cis_save_state (Mustek_PP_CIS_dev * dev) { dev->Saved_CIS = dev->CIS; @@ -1610,7 +1610,7 @@ cis_save_state (Mustek_PP_CIS_dev * dev) /****************************************************************************** * Restores the state of the device after reset and calibration. *****************************************************************************/ -static void +static void cis_restore_state (Mustek_PP_CIS_dev * dev) { dev->CIS = dev->Saved_CIS; @@ -1624,10 +1624,10 @@ static int cis_check_result(SANE_Byte* buffer, int pixel) { int i, maxVal = 0; - - for (i=0;i maxVal) maxVal = buffer[i]; - + if (maxVal > 250) return CIS_TOO_BRIGHT; if (maxVal < 240) return CIS_TOO_DARK; return CIS_OK; @@ -1641,29 +1641,29 @@ cis_maximize_dynamic_range(Mustek_PP_CIS_dev * dev) SANE_Byte powerOnDelayLower[3], powerOnDelayUpper[3], exposeTime[3]; SANE_Byte buf[3][MUSTEK_PP_CIS_MAX_H_PIXEL]; SANE_Int pixels = dev->calib_pixels; - + DBG(3, "cis_maximize_dynamic_range: starting\n"); - + for (channel = 0; channel < 3; ++channel) { exposeTime[channel] = 254; dev->CIS.powerOnDelay[channel] = 170; powerOnDelayLower[channel] = 1; powerOnDelayUpper[channel] = 254; - } + } dev->CIS.setParameters = SANE_TRUE; dev->CIS.exposeTime = exposeTime[MUSTEK_PP_CIS_CHANNEL_GREEN]; cis_config_ccd(dev); - + M1015_DISPLAY_REGS(dev, "before maximizing dynamic range"); dev->CIS.dontMove = SANE_TRUE; /* Don't move while calibrating */ - + if (!cis_wait_read_ready(dev) && dev->desc->state != STATE_CANCELLED) { DBG(2, "cis_maximize_dynamic_range: DEVICE NOT READY!\n"); return SANE_FALSE; } - + if (dev->desc->mode == MODE_COLOR) { first = MUSTEK_PP_CIS_CHANNEL_RED; @@ -1674,10 +1674,10 @@ cis_maximize_dynamic_range(Mustek_PP_CIS_dev * dev) first = MUSTEK_PP_CIS_CHANNEL_GRAY; last = MUSTEK_PP_CIS_CHANNEL_GRAY; } - + dev->CIS.channel = first; - - /* Perform a kind of binary search. In the worst case, we should find + + /* Perform a kind of binary search. In the worst case, we should find the optimal power delay values after 8 iterations */ for( i=0; i<8; i++) { @@ -1686,20 +1686,20 @@ cis_maximize_dynamic_range(Mustek_PP_CIS_dev * dev) dev->CIS.powerOnDelay[channel] = (powerOnDelayLower[channel] + powerOnDelayUpper[channel]) / 2; } - Mustek_PP_1015_write_reg(dev, MA1015W_POWER_ON_DELAY, + Mustek_PP_1015_write_reg(dev, MA1015W_POWER_ON_DELAY, dev->CIS.powerOnDelay[1]); /* Green */ for (pixel = 0; pixel < pixels; ++pixel) { buf[0][pixel] = buf[1][pixel] = buf[2][pixel] = 255; } - + /* Scan 4 lines, but ignore the first 3 ones. */ for (j = 0; j < 4; ++j) { for (channel = first; channel <= last; ++channel) { - if (!cis_read_line(dev, &buf[channel][0], pixels, + if (!cis_read_line(dev, &buf[channel][0], pixels, /* raw = */ SANE_TRUE)) return SANE_FALSE; } @@ -1711,50 +1711,50 @@ cis_maximize_dynamic_range(Mustek_PP_CIS_dev * dev) { case CIS_TOO_BRIGHT: powerOnDelayLower[channel] = dev->CIS.powerOnDelay[channel]; - break; - + break; + case CIS_TOO_DARK: powerOnDelayUpper[channel] = dev->CIS.powerOnDelay[channel]; - break; - + break; + default: - break; + break; } - } - DBG (4, "cis_maximize_dynamic_range: power on delay %3d %3d %3d\n", - dev->CIS.powerOnDelay[0], dev->CIS.powerOnDelay[1], + } + DBG (4, "cis_maximize_dynamic_range: power on delay %3d %3d %3d\n", + dev->CIS.powerOnDelay[0], dev->CIS.powerOnDelay[1], dev->CIS.powerOnDelay[2]); } dev->CIS.dontMove = SANE_FALSE; - - DBG (3, "cis_maximize_dynamic_range: power on delay %3d %3d %3d\n", - dev->CIS.powerOnDelay[0], dev->CIS.powerOnDelay[1], + + DBG (3, "cis_maximize_dynamic_range: power on delay %3d %3d %3d\n", + dev->CIS.powerOnDelay[0], dev->CIS.powerOnDelay[1], dev->CIS.powerOnDelay[2]); - + minExposeTime = (dev->CIS.hw_hres <= 300) ? 170 : 253; - + for (channel = first; channel <= last; ++channel) { dev->CIS.powerOnDelay[channel] = (powerOnDelayLower[channel] + powerOnDelayUpper[channel]) / 2; exposeTime[channel] -= dev->CIS.powerOnDelay[channel] - 1; dev->CIS.powerOnDelay[channel] = 1; - + if (exposeTime[channel] < minExposeTime) { - dev->CIS.powerOnDelay[channel] += + dev->CIS.powerOnDelay[channel] += minExposeTime - exposeTime[channel]; exposeTime[channel] = minExposeTime; } - } - + } + dev->CIS.exposeTime = exposeTime[MUSTEK_PP_CIS_CHANNEL_GREEN]; - + DBG (3, "cis_maximize_dynamic_range: expose time: %3d\n", exposeTime[1]); - DBG (3, "cis_maximize_dynamic_range: power on delay %3d %3d %3d\n", - dev->CIS.powerOnDelay[0], dev->CIS.powerOnDelay[1], + DBG (3, "cis_maximize_dynamic_range: power on delay %3d %3d %3d\n", + dev->CIS.powerOnDelay[0], dev->CIS.powerOnDelay[1], dev->CIS.powerOnDelay[2]); - + /* * Short the calibration. Temporary, to find out what is wrong with * the calibration on a 600 CP. @@ -1776,29 +1776,29 @@ cis_measure_extremes(Mustek_PP_CIS_dev * dev, SANE_Byte* calib[3], SANE_Byte max[3][MUSTEK_PP_CIS_MAX_H_PIXEL]; SANE_Int sum[3][MUSTEK_PP_CIS_MAX_H_PIXEL]; int channel, cnt, p; - + memset((void*)&min, 255, 3*MUSTEK_PP_CIS_MAX_H_PIXEL*sizeof(SANE_Byte)); memset((void*)&max, 0, 3*MUSTEK_PP_CIS_MAX_H_PIXEL*sizeof(SANE_Byte)); memset((void*)&sum, 0, 3*MUSTEK_PP_CIS_MAX_H_PIXEL*sizeof(SANE_Int)); - + dev->CIS.channel = first; - + /* Purge the banks first (there's always a 3-cycle delay) */ for (channel = first; channel <= last; ++channel) { - if (!cis_read_line(dev, &buf[channel%3][0], pixels, + if (!cis_read_line(dev, &buf[channel%3][0], pixels, /* raw = */ SANE_TRUE)) return SANE_FALSE; } --dev->CIS.skipsToOrigin; - + for (cnt = 0; cnt < MUSTEK_PP_CIS_AVERAGE_COUNT + 2; ++cnt) { for (channel = first; channel <= last; ++channel) { - DBG(4, "cis_measure_extremes: Reading line %d - channel %d\n", + DBG(4, "cis_measure_extremes: Reading line %d - channel %d\n", cnt, channel); - if (!cis_read_line(dev, &buf[channel][0], pixels, + if (!cis_read_line(dev, &buf[channel][0], pixels, /* raw = */ SANE_TRUE)) return SANE_FALSE; @@ -1813,7 +1813,7 @@ cis_measure_extremes(Mustek_PP_CIS_dev * dev, SANE_Byte* calib[3], --dev->CIS.skipsToOrigin; } DBG(4, "cis_measure_extremes: Averaging\n"); - for (channel = first; channel <= last; ++channel) + for (channel = first; channel <= last; ++channel) { /* Ignore the extreme values and take the average of the others. */ for (p = 0; p < pixels; ++p) @@ -1825,7 +1825,7 @@ cis_measure_extremes(Mustek_PP_CIS_dev * dev, SANE_Byte* calib[3], } DBG(4, "cis_measure_extremes: Done\n"); return SANE_TRUE; -} +} static SANE_Bool cis_normalize_ranges(Mustek_PP_CIS_dev * dev) @@ -1834,7 +1834,7 @@ cis_normalize_ranges(Mustek_PP_CIS_dev * dev) SANE_Byte powerOnDelay[3] ; SANE_Int pixels = dev->calib_pixels; SANE_Int channel, p, first, last; - + if (dev->desc->mode == MODE_COLOR) { first = MUSTEK_PP_CIS_CHANNEL_RED; @@ -1845,7 +1845,7 @@ cis_normalize_ranges(Mustek_PP_CIS_dev * dev) first = MUSTEK_PP_CIS_CHANNEL_GRAY; last = MUSTEK_PP_CIS_CHANNEL_GRAY; } - + DBG(3, "cis_normalize_ranges: Measuring high extremes\n"); /* Measure extremes with normal lighting */ if (!cis_measure_extremes(dev, dev->calib_hi, pixels, first, last)) { @@ -1857,17 +1857,17 @@ cis_normalize_ranges(Mustek_PP_CIS_dev * dev) powerOnDelay[channel] = dev->CIS.powerOnDelay[channel]; dev->CIS.powerOnDelay[channel] = dev->CIS.exposeTime; } - + DBG(3, "cis_normalize_ranges: Measuring low extremes\n"); if (!cis_measure_extremes(dev, dev->calib_low, pixels, first, last)) { return SANE_FALSE; } - + /* Restore settings */ for (channel=first; channel<=last; ++channel) { dev->CIS.powerOnDelay[channel] = powerOnDelay[channel]; } - + /* Make sure calib_hi is greater than calib_low */ for (channel = first; channel <= last; ++channel) { for (p = 0; pCIS.adjustskip == 0); - + /* Sawtooth */ for (i=0; i<2048; ++i) { buf[0][i] = i % 255; /* Why 255 ? Seems to have no real importance */ } - + Mustek_PP_1015_write_reg_start(dev, MA1015W_SRAM_SOURCE_PC); for (i=0; i<2048; ++i) { Mustek_PP_1015_write_reg_val(dev, buf[0][i]); } Mustek_PP_1015_write_reg_stop(dev); - + /* Bank offset measurement */ dev->CIS.delay = 0; /* Initialize to zero, measure next */ - + saved_res = dev->CIS.res; dev->CIS.res = dev->CIS.hw_hres; - + /* * Note: the TWAIN driver seems to have a fast EPP mode too. That one is * tried first, and then they try the normal mode. I haven't figured out @@ -1953,7 +1953,7 @@ cis_measure_delay(Mustek_PP_CIS_dev * dev) for (d = 0; d < 75 /* 255 */ && dev->desc->state != STATE_CANCELLED; d += 5) { dev->CIS.delay = d; - + /* * We read the line 5 times to make sure that all garbage is flushed. */ @@ -1964,7 +1964,7 @@ cis_measure_delay(Mustek_PP_CIS_dev * dev) cis_read_line_low_level (dev, &buf[1][0], 2048, NULL, NULL, NULL); if (dev->desc->state == STATE_CANCELLED) return SANE_FALSE; } - + error = SANE_FALSE; /* Check 100 times whether we can read without errors. */ for (i=0; i<100 && !error; ++i) @@ -1973,24 +1973,24 @@ cis_measure_delay(Mustek_PP_CIS_dev * dev) CIS_CLEAR_READ_BANK(dev); cis_read_line_low_level (dev, &buf[1][0], 2048, NULL, NULL, NULL); if (dev->desc->state == STATE_CANCELLED) return SANE_FALSE; - + for (j=0; j<2048; ++j) { - if (buf[0][j] != buf[1][j]) + if (buf[0][j] != buf[1][j]) { error = SANE_TRUE; break; } } } - - DBG (3, "cis_measure_delay: delay %d\n", dev->CIS.delay); + + DBG (3, "cis_measure_delay: delay %d\n", dev->CIS.delay); if (!error) break; } - + dev->CIS.res = saved_res; - + if (error) { fprintf(stderr, "mustek_pp_cis: failed to measure delay.\n"); @@ -2000,10 +2000,10 @@ cis_measure_delay(Mustek_PP_CIS_dev * dev) fprintf(stderr, "%d ", buf[1][j]); } fprintf(stderr, "\n"); - dev->CIS.delay = 0; + dev->CIS.delay = 0; } - - DBG (3, "cis_measure_delay: delay %d\n", dev->CIS.delay); + + DBG (3, "cis_measure_delay: delay %d\n", dev->CIS.delay); return SANE_TRUE; } @@ -2023,11 +2023,11 @@ cis_return_home (Mustek_PP_CIS_dev * dev, SANE_Bool nowait) dev->CIS.exposeTime = 170; cis_config_ccd(dev); dev->CIS.exposeTime = savedExposeTime; - + cis_motor_control (dev, 0xEB); if (nowait == SANE_FALSE) - Mustek_PP_1015_wait_bit(dev, MA1015R_MOTOR, MA1015B_MOTOR_HOME, + Mustek_PP_1015_wait_bit(dev, MA1015R_MOTOR, MA1015B_MOTOR_HOME, SANE_TRUE, 1000); } @@ -2043,25 +2043,25 @@ cis_reset_device (Mustek_PP_CIS_dev * dev) dev->CIS.adjustskip = 0; dev->CIS.dontIncRead = SANE_TRUE; dev->CIS.dontMove = SANE_FALSE; - + cis_save_state(dev); dev->CIS.hw_hres = 300; dev->CIS.channel = MUSTEK_PP_CIS_CHANNEL_GREEN; dev->CIS.setParameters = SANE_FALSE; dev->CIS.exposeTime = 0xAA; - + cis_config_ccd (dev); - + cis_restore_state(dev); - + } static SANE_Bool cis_calibrate (Mustek_PP_CIS_dev * dev) { int i, saved_res = dev->CIS.res, saved_vres = dev->CIS.hw_vres; - + /* * Flow of operation observed from the twain driver * (it is assumed that the lamp is at the origin, and that the CIS is @@ -2078,11 +2078,11 @@ cis_calibrate (Mustek_PP_CIS_dev * dev) * doesn't seem to be any correlation with the current mode of the * scanner, so I assume that the exact number isn't really relevant. * The values that are read are the one that were sent to the bank, - * rotated by 1 byte in my case. + * rotated by 1 byte in my case. * * - * It seems that the width of the black border is being measured at - * this stage, possibly multiple times till it stabilizes. + * It seems that the width of the black border is being measured at + * this stage, possibly multiple times till it stabilizes. * I assume that the buffer is read 100 times to allow the lamp to * warm up and that the width of the black border is then being * measured till it stabilizes. That would explain the minimum number @@ -2091,38 +2091,38 @@ cis_calibrate (Mustek_PP_CIS_dev * dev) * - reset the device * * - move the motor 110 steps forward. The TWAIN driver moves 90 steps, - * and I've used 90 steps for a long time too, but occasionally, - * 90 steps is a fraction to short to reach the start of the + * and I've used 90 steps for a long time too, but occasionally, + * 90 steps is a fraction to short to reach the start of the * calibration strip (the motor movements are not very accurate; * an offset of 1 mm is not unusual). Therefore, I've increased it to * 110 steps. This gives us an additional 1.6 mm slack, which should - * prevent calibration errors. - * (Note that the MUSTEK_PP_CIS_????CP_DEFAULT_SKIP constants have to + * prevent calibration errors. + * (Note that the MUSTEK_PP_CIS_????CP_DEFAULT_SKIP constants have to * be adjusted if the number of steps is altered.) * * - configure the CIS : actual resolution + set parameters - * + * */ - - /* + + /* * We must make sure that we are in the scanning state; otherwise we may * still be in the canceled state from a previous scan (even if terminated - * normally), and the whole calibration would go wrong. - */ + * normally), and the whole calibration would go wrong. + */ dev->desc->state = STATE_SCANNING; - + cis_reset_device (dev); cis_return_home (dev, SANE_FALSE); /* Wait till it's home */ - + /* Use maximum resolution during calibration; otherwise we may calibrate past the calibration strip. */ dev->CIS.hw_vres = dev->desc->dev->maxres; /* This field remembers how many steps we still have to go @ max res */ dev->CIS.skipsToOrigin = dev->top_skip; /*max2hw_vres(dev, dev->top_skip); */ - + if (!cis_measure_delay(dev)) return SANE_FALSE; - + cis_reset_device (dev); /* Move motor 110 steps @ 300 DPI */ @@ -2140,30 +2140,30 @@ cis_calibrate (Mustek_PP_CIS_dev * dev) cis_wait_motor_stable (dev); } Mustek_PP_1015_write_reg_stop(dev); - + /* Next, we maximize the dynamic range of the scanner. During calibration we don't want to extrapolate, so we limit the resolution if necessary */ - - if (dev->CIS.hw_hres < dev->CIS.res) + + if (dev->CIS.hw_hres < dev->CIS.res) dev->CIS.res = dev->CIS.hw_hres; - + if (!cis_maximize_dynamic_range(dev)) return SANE_FALSE; - + if (!cis_normalize_ranges(dev)) return SANE_FALSE; - + dev->CIS.res = saved_res; dev->CIS.hw_vres = saved_vres; - + /* Convert steps back to max res size, which are used during skipping */ /* dev->CIS.skipsToOrigin = hw2max_vres(dev, dev->CIS.skipsToOrigin); */ - + /* Move to the origin */ - DBG(3, "cis_calibrate: remaining skips to origin @maxres: %d\n", + DBG(3, "cis_calibrate: remaining skips to origin @maxres: %d\n", dev->CIS.skipsToOrigin); cis_move_motor(dev, dev->CIS.skipsToOrigin); - + if (dev->calib_mode) { /* In calibration mode, we scan the interior of the scanner before the @@ -2172,10 +2172,10 @@ cis_calibrate (Mustek_PP_CIS_dev * dev) DBG(3, "cis_calibrate: running in calibration mode. Returning home.\n"); cis_return_home (dev, SANE_FALSE); /* Wait till it's home */ } - + return dev->desc->state != STATE_CANCELLED ? SANE_TRUE : SANE_FALSE; - -} + +} /****************************************************************************** ****************************************************************************** @@ -2189,7 +2189,7 @@ cis_calibrate (Mustek_PP_CIS_dev * dev) /* Shared initialization routine */ static SANE_Status cis_attach(SANE_String_Const port, - SANE_String_Const name, + SANE_String_Const name, SANE_Attach_Callback attach, SANE_Int driverNo, SANE_Int info) @@ -2204,19 +2204,19 @@ static SANE_Status cis_attach(SANE_String_Const port, { SANE_Status altStatus; SANE_String_Const altPort; - + DBG (2, "cis_attach: couldn't attach to `%s' (%s)\n", port, sane_strstatus (status)); - - /* Make migration to libieee1284 painless for users that used + + /* Make migration to libieee1284 painless for users that used direct io in the past */ if (strcmp(port, "0x378") == 0) altPort = "parport0"; else if (strcmp(port, "0x278") == 0) altPort = "parport1"; else if (strcmp(port, "0x3BC") == 0) altPort = "parport2"; else return status; - + DBG (2, "cis_attach: trying alternative port name: %s\n", altPort); - + altStatus = sanei_pa4s2_open (altPort, &fd); if (altStatus != SANE_STATUS_GOOD) { @@ -2225,7 +2225,7 @@ static SANE_Status cis_attach(SANE_String_Const port, return status; /* Return original status, not alternative status */ } } - + M1015_START_LL; M1015_START_HL; @@ -2237,17 +2237,17 @@ static SANE_Status cis_attach(SANE_String_Const port, sanei_pa4s2_enable (fd, SANE_FALSE); sanei_pa4s2_close (fd); - + if (asic != 0xA5) /* Identifies the MA1015 chipset */ { /* CIS driver only works for MA1015 chipset */ DBG (2, "cis_attach: asic id (0x%02x) not recognized\n", asic); - return SANE_STATUS_INVAL; + return SANE_STATUS_INVAL; } DBG (3, "cis_attach: device %s attached\n", name); DBG (3, "cis_attach: asic 0x%02x\n", asic); - + return attach(port, name, driverNo, info); } @@ -2292,7 +2292,7 @@ void cis_drv_capabilities(SANE_Int info, SANE_String *model, *caps = CAP_NOTHING; switch(info) - { + { case MUSTEK_PP_CIS600: *model = strdup("600CP"); *maxres = 600; @@ -2338,19 +2338,19 @@ SANE_Status cis_drv_open (SANE_String port, SANE_Int caps, SANE_Int *fd) { SANE_Status altStatus; SANE_String_Const altPort; - + DBG (2, "cis_attach: couldn't attach to `%s' (%s)\n", port, sane_strstatus (status)); - - /* Make migration to libieee1284 painless for users that used + + /* Make migration to libieee1284 painless for users that used direct io in the past */ if (strcmp(port, "0x378") == 0) altPort = "parport0"; else if (strcmp(port, "0x278") == 0) altPort = "parport1"; else if (strcmp(port, "0x3BC") == 0) altPort = "parport2"; else return status; - + DBG (2, "cis_attach: trying alternative port name: %s\n", altPort); - + altStatus = sanei_pa4s2_open (altPort, fd); if (altStatus != SANE_STATUS_GOOD) { @@ -2379,16 +2379,16 @@ void cis_drv_setup (SANE_Handle hndl) } memset(cisdev, 0, sizeof(Mustek_PP_CIS_dev)); DBG(3, "cis_drv_setup: cis device allocated\n"); - + dev->lamp_on = 0; dev->priv = cisdev; - + cisdev->desc = dev; cisdev->model = dev->dev->info; cisdev->CIS.hw_hres = 300; cisdev->CIS.cisRes = 300; cisdev->CIS.hw_vres = 300; - + /* Default values for configurable parameters; configuration file may override them. */ cisdev->fast_skip = SANE_TRUE; @@ -2424,7 +2424,7 @@ SANE_Status cis_drv_config(SANE_Handle hndl, SANE_String_Const optname, return SANE_STATUS_INVAL; } dvalue = atof(optval); - + /* An adjustment of +/- 5 mm should be sufficient and safe */ if (dvalue < -5.0) { @@ -2440,13 +2440,13 @@ SANE_Status cis_drv_config(SANE_Handle hndl, SANE_String_Const optname, } /* In practice, there is a lower bound on the value that can be used, but if the top_skip value is smaller than that value, the only result - will be that the driver tries to move the head a negative number + will be that the driver tries to move the head a negative number of steps after calibration. The move routine just ignores negative steps, so no harm can be done. */ cisdev->top_skip += MM_TO_PIXEL(dvalue, dev->dev->maxres); - DBG (3, "cis_drv_config: setting top skip value to %d\n", + DBG (3, "cis_drv_config: setting top skip value to %d\n", cisdev->top_skip); - + /* Just to be cautious; we don't want the head to hit the bottom */ if (cisdev->top_skip > 600) cisdev->top_skip = 600; if (cisdev->top_skip < -600) cisdev->top_skip = -600; @@ -2519,7 +2519,7 @@ void cis_drv_close (SANE_Handle hndl) Mustek_pp_Handle *dev = hndl; Mustek_PP_CIS_dev *cisdev = dev->priv; DBG (3, "cis_close: resetting device.\n"); - sanei_pa4s2_enable (dev->fd, SANE_TRUE); + sanei_pa4s2_enable (dev->fd, SANE_TRUE); cis_reset_device (cisdev); DBG (3, "cis_close: returning home.\n"); cis_return_home (cisdev, SANE_TRUE); /* Don't wait */ @@ -2541,7 +2541,7 @@ SANE_Status cis_drv_start (SANE_Handle hndl) Mustek_pp_Handle *dev = hndl; Mustek_PP_CIS_dev *cisdev = dev->priv; SANE_Int pixels = dev->params.pixels_per_line; - + if (!cisdev) { DBG (2, "cis_drv_start: not enough memory for device\n"); @@ -2629,7 +2629,7 @@ SANE_Status cis_drv_start (SANE_Handle hndl) (cisdev->model == MUSTEK_PP_CIS1200 && dev->res <= 300)) cisdev->CIS.cisRes = 300; else - cisdev->CIS.cisRes = 600; + cisdev->CIS.cisRes = 600; /* Calibration only makes sense for hardware pixels, not for interpolated pixels, so we limit the number of calibration pixels to the maximum @@ -2638,10 +2638,10 @@ SANE_Status cis_drv_start (SANE_Handle hndl) cisdev->calib_pixels = (pixels * cisdev->CIS.hw_hres) / dev->res; else cisdev->calib_pixels = pixels; - - DBG (3, "cis_drv_start: hres: %d vres: %d cisres: %d\n", + + DBG (3, "cis_drv_start: hres: %d vres: %d cisres: %d\n", cisdev->CIS.hw_hres, cisdev->CIS.hw_vres, cisdev->CIS.cisRes); - + sanei_pa4s2_enable (dev->fd, SANE_TRUE); cis_reset_device (cisdev); @@ -2653,7 +2653,7 @@ SANE_Status cis_drv_start (SANE_Handle hndl) /* * Set all registers to -1 (uninitialized) - */ + */ for (i=0; i<4; ++i) { cisdev->CIS.regs.in_regs[i] = -1; @@ -2682,12 +2682,12 @@ SANE_Status cis_drv_start (SANE_Handle hndl) dev->priv = NULL; return SANE_STATUS_NO_MEM; } - - /* Allocate memory for calibration; calibrating interpolated pixels + + /* Allocate memory for calibration; calibrating interpolated pixels makes no sense */ - if (pixels > (dev->dev->maxhsize >> 1)) + if (pixels > (dev->dev->maxhsize >> 1)) pixels = (dev->dev->maxhsize >> 1); - + cisdev->calib_low[1] = malloc (pixels); cisdev->calib_hi[1] = malloc (pixels); @@ -2751,7 +2751,7 @@ SANE_Status cis_drv_start (SANE_Handle hndl) cis_move_motor (cisdev, dev->topY); /* Measured in max resolution */ - /* It is vital to reinitialize the scanner right before we start the + /* It is vital to reinitialize the scanner right before we start the real scanning. Otherwise the bank synchronization may have gotten lost by the time we reach the top of the scan area */ @@ -2759,12 +2759,12 @@ SANE_Status cis_drv_start (SANE_Handle hndl) cis_config_ccd(cisdev); cis_wait_read_ready(cisdev); - sanei_pa4s2_enable (dev->fd, SANE_FALSE); + sanei_pa4s2_enable (dev->fd, SANE_FALSE); cisdev->CIS.line_step = SANE_FIX ((float) cisdev->CIS.hw_vres / (float) cisdev->CIS.res); - /* + /* * It is very important that line_diff is not initialized at zero ! * If it is set to zero, the motor will keep on moving forever (or better, * till the scanner breaks). @@ -2789,7 +2789,7 @@ void cis_drv_read (SANE_Handle hndl, SANE_Byte *buffer) Mustek_pp_Handle *dev = hndl; Mustek_PP_CIS_dev *cisdev = dev->priv; DBG(6, "cis_drv_read: Reading line\n"); - sanei_pa4s2_enable (dev->fd, SANE_TRUE); + sanei_pa4s2_enable (dev->fd, SANE_TRUE); switch (dev->mode) { case MODE_BW: @@ -2814,13 +2814,13 @@ void cis_drv_stop (SANE_Handle hndl) { Mustek_pp_Handle *dev = hndl; Mustek_PP_CIS_dev *cisdev = dev->priv; - + /* device is scanning: return lamp and free buffers */ DBG (3, "cis_drv_stop: stopping current scan\n"); dev->state = STATE_CANCELLED; DBG (9, "cis_drv_stop: enabling fd\n"); - sanei_pa4s2_enable (dev->fd, SANE_TRUE); + sanei_pa4s2_enable (dev->fd, SANE_TRUE); Mustek_PP_1015_write_reg(cisdev, MA1015W_MOTOR_CONTROL, 0); /* stop */ DBG (9, "cis_drv_stop: resetting device (1)\n"); cis_reset_device (cisdev); @@ -2829,7 +2829,7 @@ void cis_drv_stop (SANE_Handle hndl) DBG (9, "cis_drv_stop: resetting device (2)\n"); cis_reset_device (cisdev); DBG (9, "cis_drv_stop: disabling fd\n"); - sanei_pa4s2_enable (dev->fd, SANE_FALSE); + sanei_pa4s2_enable (dev->fd, SANE_FALSE); DBG (9, "cis_drv_stop: freeing buffers\n"); /* This is no good: canceling while the device is scanning and diff --git a/backend/mustek_pp_cis.h b/backend/mustek_pp_cis.h index 2a38d8985..fcbdfa647 100644 --- a/backend/mustek_pp_cis.h +++ b/backend/mustek_pp_cis.h @@ -50,28 +50,28 @@ /****************************************************************************** * Read register symbols. *****************************************************************************/ -typedef enum { +typedef enum { MA1015R_ASIC = 0x00, MA1015R_SCAN_VAL = 0x01, MA1015R_MOTOR = 0x02, - MA1015R_BANK_COUNT = 0x03 - } + MA1015R_BANK_COUNT = 0x03 + } Mustek_PP_1015R_reg; /****************************************************************************** * Read register bitmask symbols. *****************************************************************************/ -typedef enum { +typedef enum { MA1015B_MOTOR_HOME = 0x01, - MA1015B_MOTOR_STABLE = 0x03 + MA1015B_MOTOR_STABLE = 0x03 } Mustek_PP_1015R_bit; /****************************************************************************** * Write register symbols: (bank number << 4) + register number. *****************************************************************************/ - -typedef enum { + +typedef enum { MA1015W_RED_REF = 0x00, MA1015W_GREEN_REF = 0x01, MA1015W_BLUE_REF = 0x02, @@ -105,13 +105,13 @@ typedef struct Mustek_PP_1015_Registers SANE_Byte in_regs[4]; SANE_Byte out_regs[4][4]; SANE_Byte channel; - + Mustek_PP_1015R_reg current_read_reg; SANE_Int read_count; - + Mustek_PP_1015W_reg current_write_reg; /* always used */ SANE_Int write_count; -} +} Mustek_PP_1015_Registers; @@ -122,74 +122,74 @@ typedef struct Mustek_PP_CIS_Info { /* Expose time (= time the lamp is on ?) */ SANE_Byte exposeTime; - + /* Power-on delay (= time between lamp on and start of capturing ?) */ SANE_Byte powerOnDelay[3]; - + /* Motor step control */ SANE_Byte phaseType; - + /* Use 8K bank or 4K bank */ SANE_Bool use8KBank; - + /* High resolution (600 DPI) or not (300 DPI) */ SANE_Bool highRes; - + /* delay between pixels; reading too fast causes stability problems */ SANE_Int delay; /* Register representation */ Mustek_PP_1015_Registers regs; - + /* Current color channel */ SANE_Int channel; - + /* Blocks motor movements during calibration */ SANE_Bool dontMove; - + /* Prevents read increment the before the first read */ SANE_Bool dontIncRead; - - /* Controls whether or not calibration parameters are transmitted + + /* Controls whether or not calibration parameters are transmitted during CIS configuration */ SANE_Bool setParameters; - + /* Number of lines to skip to reach the origin (used during calibration) */ SANE_Int skipsToOrigin; - + /* Physical resolution of the CIS: either 300 or 600 DPI */ SANE_Int cisRes; - + /* CCD mode (color/grayscale/lineart) */ SANE_Int mode; - + /* how many positions to skip until scan area starts @ max res */ SANE_Int skipimagebytes; - + /* how many image bytes to scan @ max res */ SANE_Int imagebytes; - + /* total skip, adjusted to resolution */ SANE_Int adjustskip; - + /* current resolution */ SANE_Int res; - + /* current horizontal hardware resolution */ SANE_Int hw_hres; - + /* current vertical hardware resolution */ SANE_Int hw_vres; - + /* how many positions to scan for one pixel */ SANE_Int hres_step; - + /* how many lines to scan for one scanline */ SANE_Int line_step; - + /* inversion */ SANE_Bool invert; - + } Mustek_PP_CIS_Info; struct Mustek_pp_Handle; @@ -200,7 +200,7 @@ typedef struct Mustek_PP_CIS_dev /* model identification (600CP/1200CP/1200CP+) */ SANE_Int model; - + /* CIS status */ Mustek_PP_CIS_Info CIS; @@ -216,26 +216,26 @@ typedef struct Mustek_PP_CIS_dev int line_diff; int ccd_line; int lines_left; - + /* Configuration parameters that the user can calibrate */ /* Starting position at the top */ SANE_Int top_skip; /* Use fast skipping method for head movements ? (default: yes) */ SANE_Bool fast_skip; /* Discrimination value to choose between black and white */ - SANE_Byte bw_limit; + SANE_Byte bw_limit; /* Run in calibration mode ? (default: no) */ SANE_Bool calib_mode; /* Extra delay between engine commands (ms). Default: zero. */ SANE_Int engine_delay; - + /* temporary buffer for 1 line (of one color) */ SANE_Byte *tmpbuf; /* calibration buffers (low cut, high cut) */ SANE_Byte *calib_low[3]; SANE_Byte *calib_hi[3]; - + /* Number of pixels in calibration buffers (<= number of pixels to scan) */ int calib_pixels; diff --git a/backend/mustek_pp_decl.h b/backend/mustek_pp_decl.h index 3875f3d63..2ccce9565 100644 --- a/backend/mustek_pp_decl.h +++ b/backend/mustek_pp_decl.h @@ -23,25 +23,25 @@ static void debug_drv_stop (SANE_Handle hndl); /* CIS drivers for 600CP, 1200CP, and 1200CP+ Version 0.13-beta, author Eddy De Greef */ -static SANE_Status cis600_drv_init (SANE_Int options, +static SANE_Status cis600_drv_init (SANE_Int options, SANE_String_Const port, - SANE_String_Const name, + SANE_String_Const name, SANE_Attach_Callback attach); -static SANE_Status cis1200_drv_init (SANE_Int options, +static SANE_Status cis1200_drv_init (SANE_Int options, SANE_String_Const port, - SANE_String_Const name, + SANE_String_Const name, SANE_Attach_Callback attach); -static SANE_Status cis1200p_drv_init(SANE_Int options, +static SANE_Status cis1200p_drv_init(SANE_Int options, SANE_String_Const port, - SANE_String_Const name, + SANE_String_Const name, SANE_Attach_Callback attach); -static void cis_drv_capabilities(SANE_Int info, +static void cis_drv_capabilities(SANE_Int info, SANE_String *model, - SANE_String *vendor, + SANE_String *vendor, SANE_String *type, - SANE_Int *maxres, + SANE_Int *maxres, SANE_Int *minres, - SANE_Int *maxhsize, + SANE_Int *maxhsize, SANE_Int *maxvsize, SANE_Int *caps); static SANE_Status cis_drv_open (SANE_String port, SANE_Int caps, SANE_Int *fd); @@ -57,17 +57,17 @@ static void cis_drv_stop (SANE_Handle hndl); /* CCD drivers for 300 dpi models Version 0.11-devel, author Jochen Eisinger */ -static SANE_Status ccd300_init (SANE_Int options, +static SANE_Status ccd300_init (SANE_Int options, SANE_String_Const port, - SANE_String_Const name, + SANE_String_Const name, SANE_Attach_Callback attach); -static void ccd300_capabilities(SANE_Int info, +static void ccd300_capabilities(SANE_Int info, SANE_String *model, - SANE_String *vendor, + SANE_String *vendor, SANE_String *type, - SANE_Int *maxres, + SANE_Int *maxres, SANE_Int *minres, - SANE_Int *maxhsize, + SANE_Int *maxhsize, SANE_Int *maxvsize, SANE_Int *caps); static SANE_Status ccd300_open (SANE_String port, SANE_Int caps, SANE_Int *fd); diff --git a/backend/mustek_pp_null.c b/backend/mustek_pp_null.c index e1c6a35bd..06045cb83 100644 --- a/backend/mustek_pp_null.c +++ b/backend/mustek_pp_null.c @@ -39,7 +39,7 @@ If you do not wish that, delete this exception notice. This file implements a SANE backend for Mustek PP flatbed scanners. */ - + #include "../include/sane/config.h" #if defined(HAVE_STDLIB_H) @@ -62,7 +62,7 @@ #define MUSTEK_PP_NULL_DRIVER 0 -static SANE_Status +static SANE_Status debug_drv_init(SANE_Int options, SANE_String_Const port, SANE_String_Const name, SANE_Attach_Callback attach) { @@ -75,7 +75,7 @@ debug_drv_init(SANE_Int options, SANE_String_Const port, } /*ARGSUSED*/ -static void +static void debug_drv_capabilities(SANE_Int info __UNUSED__, SANE_String *model, SANE_String *vendor, SANE_String *type, SANE_Int *maxres, SANE_Int *minres, @@ -96,14 +96,14 @@ debug_drv_capabilities(SANE_Int info __UNUSED__, SANE_String *model, /*ARGSUSED*/ static SANE_Status -debug_drv_open (SANE_String port __UNUSED__, +debug_drv_open (SANE_String port __UNUSED__, SANE_Int caps __UNUSED__, SANE_Int *fd) { *fd = 1; return SANE_STATUS_GOOD; } -static void +static void debug_drv_setup (SANE_Handle hndl) { @@ -115,7 +115,7 @@ debug_drv_setup (SANE_Handle hndl) /*ARGSUSED*/ static SANE_Status -debug_drv_config(SANE_Handle hndl __UNUSED__, +debug_drv_config(SANE_Handle hndl __UNUSED__, SANE_String_Const optname, SANE_String_Const optval) { @@ -136,7 +136,7 @@ debug_drv_start (SANE_Handle hndl __UNUSED__) return SANE_STATUS_GOOD; } -static void +static void debug_drv_read (SANE_Handle hndl, SANE_Byte *buffer) { diff --git a/backend/mustek_scsi_pp.c b/backend/mustek_scsi_pp.c index 3dab544e8..304afceeb 100644 --- a/backend/mustek_scsi_pp.c +++ b/backend/mustek_scsi_pp.c @@ -793,7 +793,7 @@ mustek_scsi_pp_cmd (int fd, const void *src, size_t src_size, /* * Retry the command several times, as occasionally it doesn't - * work first time. + * work first time. */ do { diff --git a/backend/mustek_scsi_pp.h b/backend/mustek_scsi_pp.h index 5d1c90051..363f2c0f9 100644 --- a/backend/mustek_scsi_pp.h +++ b/backend/mustek_scsi_pp.h @@ -1,7 +1,7 @@ /* sane - Scanner Access Now Easy. Copyright (C) 2003 James Perry 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 @@ -36,7 +36,7 @@ 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. + If you do not wish that, delete this exception notice. This file implements the SCSI-over-parallel port protocol used in, for example, the Paragon 600 II EP @@ -113,7 +113,7 @@ static SANE_Status mustek_scsi_pp_cmd (int fd, const void *src, size_t src_size, * * @return * - SANE_STATUS_GOOD - on success - * - SANE_STATUS_IO_ERROR - if an error occured during the dialog with the + * - SANE_STATUS_IO_ERROR - if an error occured during the dialog with the * device */ static SANE_Status mustek_scsi_pp_rdata (int fd, int planes, diff --git a/backend/mustek_usb.c b/backend/mustek_usb.c index 58dcc584b..04d36c569 100644 --- a/backend/mustek_usb.c +++ b/backend/mustek_usb.c @@ -43,7 +43,7 @@ whether to permit this exception to apply to your modifications. If you do not wish that, delete this exception notice. - This file implements a SANE backend for Mustek 1200UB and similar + This file implements a SANE backend for Mustek 1200UB and similar USB flatbed scanners. */ #define BUILD 18 @@ -1533,7 +1533,7 @@ sane_read (SANE_Handle handle, SANE_Byte * buf, SANE_Int max_len, *len = MIN (max_len, (SANE_Int) s->hw->scan_buffer_len); memcpy (buf, s->hw->scan_buffer_start, *len); DBG (4, "sane_read: exit, read %d bytes from scan_buffer; " - "%ld bytes remaining\n", *len, + "%ld bytes remaining\n", *len, (long int) (s->hw->scan_buffer_len - *len)); s->hw->scan_buffer_len -= (*len); s->hw->scan_buffer_start += (*len); diff --git a/backend/mustek_usb.h b/backend/mustek_usb.h index 7e6840287..b5a751873 100644 --- a/backend/mustek_usb.h +++ b/backend/mustek_usb.h @@ -43,7 +43,7 @@ whether to permit this exception to apply to your modifications. If you do not wish that, delete this exception notice. - This file implements a SANE backend for Mustek 1200UB and similar + This file implements a SANE backend for Mustek 1200UB and similar USB flatbed scanners. */ #ifndef mustek_usb_h diff --git a/backend/mustek_usb2.c b/backend/mustek_usb2.c index 58d9e9e6e..bc112e692 100644 --- a/backend/mustek_usb2.c +++ b/backend/mustek_usb2.c @@ -43,7 +43,7 @@ whether to permit this exception to apply to your modifications. If you do not wish that, delete this exception notice. - This file implements a SANE backend for the Mustek BearPaw 2448 TA Pro + This file implements a SANE backend for the Mustek BearPaw 2448 TA Pro and similar USB2 scanners. */ #define BUILD 10 @@ -396,7 +396,7 @@ init_options (Mustek_Scanner * s) s->opt[OPT_RESOLUTION].unit = SANE_UNIT_DPI; s->opt[OPT_RESOLUTION].constraint_type = SANE_CONSTRAINT_WORD_LIST; s->opt[OPT_RESOLUTION].constraint.word_list = dpi_list; - s->val[OPT_RESOLUTION].w = 300; + s->val[OPT_RESOLUTION].w = 300; /* preview */ s->opt[OPT_PREVIEW].name = SANE_NAME_PREVIEW; @@ -528,14 +528,14 @@ static unsigned int g_dwAlreadyGetNegLines = 0; /********************************************************************** Author: Jack Date: 2005/05/13 -Routine Description: +Routine Description: Check the device connect status Parameters: none -Return value: +Return value: if the device is connected return TRUE - else + else return FALSE ***********************************************************************/ static SANE_Bool @@ -547,12 +547,12 @@ GetDeviceStatus () /********************************************************************** Author: Jack Date: 2005/05/13 -Routine Description: +Routine Description: Turn the lamp on or off Parameters: isLampOn: turn the lamp on or off isTALampOn: turn the TA lamp on or off -Return value: +Return value: if operation success return TRUE else @@ -567,11 +567,11 @@ PowerControl (SANE_Bool isLampOn, SANE_Bool isTALampOn) /********************************************************************** Author: Jack Date: 2005/05/13 -Routine Description: +Routine Description: Turn the carriage home Parameters: none -Return value: +Return value: if the operation success return TRUE else @@ -587,11 +587,11 @@ CarriageHome () #ifdef SANE_UNUSED /********************************************************************** Author: Jack Date: 2005/05/13 -Routine Description: +Routine Description: Get gamma input/output bit count Parameters: pGammaInfo: the gamma information -Return value: +Return value: if the operation success return TRUE else @@ -632,11 +632,11 @@ GetGammaInfo (LPGAMMAINFO pGammaInfo) #endif /********************************************************************** Author: Jack Date: 2005/05/13 -Routine Description: +Routine Description: set scan parameters Parameters: pSetParameters: the information of scaning -Return value: +Return value: if the operation success return TRUE else @@ -861,11 +861,11 @@ SetParameters (LPSETPARAMETERS pSetParameters) /********************************************************************** Author: Jack Date: 2005/05/13 -Routine Description: +Routine Description: get the optical dpi and scan area Parameters: pGetParameters: the information of scan -Return value: +Return value: if the operation is success return TRUE else @@ -905,7 +905,7 @@ GetParameters (LPGETPARAMETERS pGetParameters) /********************************************************************** Author: Jack Date: 2005/05/13 -Routine Description: +Routine Description: start scan image Parameters: none @@ -949,12 +949,12 @@ StartScan () /********************************************************************** Author: Jack Date: 2005/05/14 -Routine Description: +Routine Description: Read the scanner data Parameters: pImageRows: the information of the data -Return value: +Return value: if the operation is seccuss return TRUE else @@ -1090,11 +1090,11 @@ ReadScannedData (LPIMAGEROWS pImageRows) /********************************************************************** Author: Jack Date: 2005/05/14 -Routine Description: +Routine Description: Stop scan Parameters: none -Return value: +Return value: if operation is success return TRUE else @@ -1150,11 +1150,11 @@ StopScan () /********************************************************************** Author: Jack Date: 2005/05/14 -Routine Description: +Routine Description: Check the status of TA Parameters: none -Return value: +Return value: if operation is success return TRUE else @@ -1187,11 +1187,11 @@ IsTAConnected () #ifdef SANE_UNUSED /********************************************************************** Author: Jack Date: 2005/05/14 -Routine Description: +Routine Description: Get the status of the HK Parameters: pKey: the status of key -Return value: +Return value: if the operation is success return TRUE else @@ -1250,14 +1250,14 @@ GetKeyStatus (SANE_Byte * pKey) #endif /********************************************************************** Author: Jack Date: 2005/05/14 -Routine Description: - Deal with the image with auto level +Routine Description: + Deal with the image with auto level Parameters: lpSource: the data of image scanMode: the scan mode ScanLines: the rows of image BytesPerLine: the bytes of per line -Return value: +Return value: none ***********************************************************************/ static void @@ -1497,13 +1497,13 @@ AutoLevel (SANE_Byte *lpSource, SCANMODE scanMode, unsigned short ScanLines, #ifdef SANE_UNUSED /********************************************************************** Author: Jack Date: 2005/05/14 -Routine Description: +Routine Description: Deal with image with auto level Parameters: pDIB: the data of image ImageWidth: the width of image ImageHeight: the height of image -Return value: +Return value: none ***********************************************************************/ static void @@ -1792,14 +1792,14 @@ QBETDetectAutoLevel (void *pDIB, unsigned int ImageWidth, unsigned int ImageHeig #ifdef SANE_UNUSED /********************************************************************** Author: Jack Date: 2005/05/14 -Routine Description: - Change the image data and deal with auto level +Routine Description: + Change the image data and deal with auto level Parameters: lpSource: the data of image scanMode: the scan mode ScanLines: the rows of image BytesPerLine: the bytes of per line -Return value: +Return value: none ***********************************************************************/ static void diff --git a/backend/mustek_usb2.h b/backend/mustek_usb2.h index b80c51a83..9dc3a2b63 100644 --- a/backend/mustek_usb2.h +++ b/backend/mustek_usb2.h @@ -43,7 +43,7 @@ whether to permit this exception to apply to your modifications. If you do not wish that, delete this exception notice. - This file implements a SANE backend for the Mustek BearPaw 2448 TA Pro + This file implements a SANE backend for the Mustek BearPaw 2448 TA Pro and similar USB2 scanners. */ #ifndef MUSTEK_USB2_H diff --git a/backend/mustek_usb2_asic.c b/backend/mustek_usb2_asic.c index d9b1a285d..b5f3b0a41 100644 --- a/backend/mustek_usb2_asic.c +++ b/backend/mustek_usb2_asic.c @@ -42,7 +42,7 @@ whether to permit this exception to apply to your modifications. If you do not wish that, delete this exception notice. - This file implements a SANE backend for the Mustek BearPaw 2448 TA Pro + This file implements a SANE backend for the Mustek BearPaw 2448 TA Pro and similar USB2 scanners. */ #include "mustek_usb2_asic.h" @@ -1649,7 +1649,7 @@ LLFMotorMove (PAsic chip, LLF_MOTORMOVE * LLF_MotorMove) Mustek_SendData (chip, ES01_E5_MotorDecStep, LLF_MotorMove->DecStep); DBG (DBG_ASIC, "DecStep=%d\n", LLF_MotorMove->DecStep); - /*set motor uniform speed only for uniform speed + /*set motor uniform speed only for uniform speed //only used for UNIFORM_MOTOR_AND_SCAN_SPEED_ENABLE //If you use acc mode, this two reg are not used. */ Mustek_SendData (chip, ES01_FD_MotorFixedspeedLSB, @@ -4541,7 +4541,7 @@ Asic_ReadCalibrationData (PAsic chip, void * pBuffer, pCalBuffer = (SANE_Byte *) malloc (dwXferBytes); if (pCalBuffer == NULL) { - DBG (DBG_ERR, + DBG (DBG_ERR, "Asic_ReadCalibrationData: Can't malloc bCalBuffer memory\n"); return STATUS_MEM_ERROR; } diff --git a/backend/mustek_usb2_asic.h b/backend/mustek_usb2_asic.h index ffc92ffa3..1a5590351 100644 --- a/backend/mustek_usb2_asic.h +++ b/backend/mustek_usb2_asic.h @@ -42,7 +42,7 @@ whether to permit this exception to apply to your modifications. If you do not wish that, delete this exception notice. - This file implements a SANE backend for the Mustek BearPaw 2448 TA Pro + This file implements a SANE backend for the Mustek BearPaw 2448 TA Pro and similar USB2 scanners. */ #ifndef MUSTEK_USB2_ASIC_H @@ -299,8 +299,8 @@ RGBColor; /* debug levels */ #define DBG_CRIT 0 /* Critical errors thatshould be printed even - if user hasn't enabled debugging -- use - with care and only after sane_open has been + if user hasn't enabled debugging -- use + with care and only after sane_open has been called */ #define DBG_ERR 1 /* Other errors */ #define DBG_WARN 2 /* unusual conditions that may not be fatal */ diff --git a/backend/mustek_usb2_high.c b/backend/mustek_usb2_high.c index 664528ed5..b1ba65e25 100644 --- a/backend/mustek_usb2_high.c +++ b/backend/mustek_usb2_high.c @@ -42,7 +42,7 @@ whether to permit this exception to apply to your modifications. If you do not wish that, delete this exception notice. - This file implements a SANE backend for the Mustek BearPaw 2448 TA Pro + This file implements a SANE backend for the Mustek BearPaw 2448 TA Pro and similar USB2 scanners. */ #include /* HOLD */ @@ -191,10 +191,10 @@ static void ModifyLinePoint (SANE_Byte * lpImageData, /********************************************************************** Author: Jack Date: 2005/05/13 - Routine Description: + Routine Description: Parameters: none -Return value: +Return value: if initialize the scanner success return TRUE else @@ -251,14 +251,14 @@ MustScanner_Init () /********************************************************************** Author: Jack Date: 2005/05/13 -Routine Description: +Routine Description: check the scanner connect status Parameters: none -Return value: +Return value: if scanner's status is OK return TRUE - else + else return FASLE ***********************************************************************/ static SANE_Bool @@ -279,12 +279,12 @@ MustScanner_GetScannerState () /********************************************************************** Author: Jack Date: 2005/05/13 -Routine Description: +Routine Description: Turn the lamp on or off Parameters: isLampOn: turn the lamp on or off isTALampOn: turn the TA lamp on or off -Return value: +Return value: if operation success return TRUE else @@ -334,11 +334,11 @@ MustScanner_PowerControl (SANE_Bool isLampOn, SANE_Bool isTALampOn) /********************************************************************** Author: Jack Date: 2005/05/13 -Routine Description: +Routine Description: Turn the carriage home Parameters: none -Return value: +Return value: if the operation success return TRUE else @@ -377,11 +377,11 @@ MustScanner_BackHome () /********************************************************************** Author: Jack Date: 2005/05/13 -Routine Description: +Routine Description: prepare the scan image Parameters: bScanSource: the scan source -Return value: +Return value: if operation is success return TRUE else @@ -466,7 +466,7 @@ MustScanner_Prepare (SANE_Byte bScanSource) #ifdef SANE_UNUSED /********************************************************************** Author: Jack Date: 2005/05/15 -Routine Description: +Routine Description: Adjuest the offset Parameters: nTimes: Adjuest offset the times @@ -479,7 +479,7 @@ Parameters: bOffsetLowerBound: the lower bound of offset wStdMinLevel: the min level of offset wStdMaxLevel: the max level of offset -Return value: +Return value: if the operation is success return TRUE else @@ -624,7 +624,7 @@ MustScanner_AdjustOffset (int nTimes, SANE_Bool * bDirection, SANE_Byte * bOffse /********************************************************************** Author: Jack Date: 2005/05/15 -Routine Description: +Routine Description: Adjuest the offset second times Parameters: nTimes: Adjuest offset the times @@ -637,7 +637,7 @@ Parameters: bOffsetLowerBound: the lower bound of offset wStdMinLevel: the min level of offset wStdMaxLevel: the max level of offset -Return value: +Return value: if the operation is success return TRUE else @@ -745,15 +745,15 @@ MustScanner_SecondAdjustOffset (int nTimes, SANE_Bool * bDirection, SANE_Byte * /********************************************************************** Author: Jack Date: 2005/05/15 -Routine Description: +Routine Description: Filter the data Parameters: pSort: the sort data - TotalCount: the total count + TotalCount: the total count LowCount: the low count HighCount: the upper count -Return value: - the data of Filter +Return value: + the data of Filter ***********************************************************************/ static unsigned short MustScanner_FiltLower (unsigned short * pSort, unsigned short TotalCount, unsigned short LowCount, @@ -786,13 +786,13 @@ MustScanner_FiltLower (unsigned short * pSort, unsigned short TotalCount, unsign /********************************************************************** Author: Jack Date: 2005/05/15 -Routine Description: +Routine Description: Repair line when single CCD and color is 48bit Parameters: lpLine: point to image be repaired isOrderInvert: RGB or BGR wLinesCount: how many line be repaired -Return value: +Return value: if the operation is success return TRUE else @@ -982,13 +982,13 @@ MustScanner_GetRgb48BitLine (SANE_Byte * lpLine, SANE_Bool isOrderInvert, /********************************************************************** Author: Jack Date: 2005/05/15 -Routine Description: +Routine Description: Repair line when double CCD and color is 48bit Parameters: lpLine: point to image be repaired isOrderInvert: RGB or BGR wLinesCount: how many line be repaired -Return value: +Return value: if the operation is success return TRUE else @@ -1427,13 +1427,13 @@ MustScanner_GetRgb48BitLine1200DPI (SANE_Byte * lpLine, SANE_Bool isOrderInvert, /********************************************************************** Author: Jack Date: 2005/05/15 -Routine Description: +Routine Description: Repair line when single CCD and color is 24bit Parameters: lpLine: point to image be repaired isOrderInvert: RGB or BGR wLinesCount: how many line be repaired -Return value: +Return value: if the operation is success return TRUE else @@ -1680,13 +1680,13 @@ MustScanner_GetRgb24BitLine (SANE_Byte * lpLine, SANE_Bool isOrderInvert, /********************************************************************** Author: Jack Date: 2005/05/15 -Routine Description: +Routine Description: Repair line when double CCD and color is 24bit Parameters: lpLine: point to image be repaired isOrderInvert: RGB or BGR wLinesCount: how many line be repaired -Return value: +Return value: if the operation is success return TRUE else @@ -2111,13 +2111,13 @@ MustScanner_GetRgb24BitLine1200DPI (SANE_Byte * lpLine, SANE_Bool isOrderInvert, /********************************************************************** Author: Jack Date: 2005/05/15 -Routine Description: +Routine Description: Repair line when single CCD and color is 16bit Parameters: lpLine: point to image be repaired isOrderInvert: RGB or BGR wLinesCount: how many line be repaired -Return value: +Return value: if the operation is success return TRUE else @@ -2206,13 +2206,13 @@ MustScanner_GetMono16BitLine (SANE_Byte * lpLine, SANE_Bool isOrderInvert, /********************************************************************** Author: Jack Date: 2005/05/15 -Routine Description: +Routine Description: Repair line when double CCD and color is 16bit Parameters: lpLine: point to image be repaired isOrderInvert: RGB or BGR wLinesCount: how many line be repaired -Return value: +Return value: if the operation is success return TRUE else @@ -2387,13 +2387,13 @@ MustScanner_GetMono16BitLine1200DPI (SANE_Byte * lpLine, SANE_Bool isOrderInvert /********************************************************************** Author: Jack Date: 2005/05/15 -Routine Description: +Routine Description: Repair line when single CCD and color is 8bit Parameters: lpLine: point to image be repaired isOrderInvert: RGB or BGR wLinesCount: how many line be repaired -Return value: +Return value: if the operation is success return TRUE else @@ -2478,13 +2478,13 @@ MustScanner_GetMono8BitLine (SANE_Byte * lpLine, SANE_Bool isOrderInvert, /********************************************************************** Author: Jack Date: 2005/05/15 -Routine Description: +Routine Description: Repair line when double CCD and color is 8bit Parameters: lpLine: point to image be repaired isOrderInvert: RGB or BGR wLinesCount: how many line be repaired -Return value: +Return value: if the operation is success return TRUE else @@ -2641,13 +2641,13 @@ MustScanner_GetMono8BitLine1200DPI (SANE_Byte * lpLine, SANE_Bool isOrderInvert, /********************************************************************** Author: Jack Date: 2005/05/15 -Routine Description: +Routine Description: Repair line when single CCD and color is 1bit Parameters: lpLine: point to image be repaired isOrderInvert: RGB or BGR wLinesCount: how many line be repaired -Return value: +Return value: if the operation is success return TRUE else @@ -2732,13 +2732,13 @@ MustScanner_GetMono1BitLine (SANE_Byte * lpLine, SANE_Bool isOrderInvert, /********************************************************************** Author: Jack Date: 2005/05/15 -Routine Description: +Routine Description: Repair line when double CCD and color is 1bit Parameters: lpLine: point to image be repaired isOrderInvert: RGB or BGR wLinesCount: how many line be repaired -Return value: +Return value: if the operation is success return TRUE else @@ -2849,12 +2849,12 @@ MustScanner_GetMono1BitLine1200DPI (SANE_Byte * lpLine, SANE_Bool isOrderInvert, /********************************************************************** Author: Jack Date: 2005/05/21 -Routine Description: - prepare calculate Max and Min value +Routine Description: + prepare calculate Max and Min value Parameters: wResolution: the scan resolution Return value: - none + none ***********************************************************************/ static void MustScanner_PrepareCalculateMaxMin (unsigned short wResolution) @@ -2904,7 +2904,7 @@ MustScanner_PrepareCalculateMaxMin (unsigned short wResolution) /********************************************************************** Author: Jack Date: 2005/05/21 -Routine Description: +Routine Description: calculate the Max and Min value Parameters: pBuffer: the image data @@ -2912,7 +2912,7 @@ Parameters: lpMinValue: the min value wResolution: the scan resolution Return value: - none + none ***********************************************************************/ static void MustScanner_CalculateMaxMin (SANE_Byte * pBuffer, unsigned short * lpMaxValue, @@ -2981,11 +2981,11 @@ MustScanner_CalculateMaxMin (SANE_Byte * pBuffer, unsigned short * lpMaxValue, /********************************************************************** Author: Jack Date: 2005/05/15 -Routine Description: +Routine Description: Read the data from scanner Parameters: none -Return value: +Return value: if operation is success return TRUE else @@ -3075,11 +3075,11 @@ MustScanner_ReadDataFromScanner (void * dummy) /********************************************************************** Author: Jack Date: 2005/05/26 -Routine Description: +Routine Description: get the lines of scanned Parameters: none -Return value: +Return value: the lines of scanned ***********************************************************************/ static unsigned int @@ -3097,7 +3097,7 @@ GetScannedLines () /********************************************************************** Author: Jack Date: 2005/05/26 -Routine Description: +Routine Description: get lines which pass to superstratum Parameters: none @@ -3118,11 +3118,11 @@ GetReadyLines () /********************************************************************** Author: Jack Date: 2005/05/26 -Routine Description: +Routine Description: add the scanned total lines Parameters: wAddLines: add the lines -Return value: +Return value: none ***********************************************************************/ static void @@ -3137,11 +3137,11 @@ AddScannedLines (unsigned short wAddLines) /********************************************************************** Author: Jack Date: 2005/05/26 -Routine Description: +Routine Description: add the ready lines Parameters: none -Return value: +Return value: none ***********************************************************************/ static void @@ -3202,8 +3202,8 @@ ModifyLinePoint (SANE_Byte * lpImageData, /********************************************************************** Author: Jack Date: 2005/05/15 -Routine Description: - Modifiy the image data +Routine Description: + Modifiy the image data Parameters: A: the input the image data B: the input the iamge data diff --git a/backend/mustek_usb2_high.h b/backend/mustek_usb2_high.h index 33f463f22..aec79bbbe 100644 --- a/backend/mustek_usb2_high.h +++ b/backend/mustek_usb2_high.h @@ -42,7 +42,7 @@ whether to permit this exception to apply to your modifications. If you do not wish that, delete this exception notice. - This file implements a SANE backend for the Mustek BearPaw 2448 TA Pro + This file implements a SANE backend for the Mustek BearPaw 2448 TA Pro and similar USB2 scanners. */ #ifndef MUSTEK_USB2_HIGH_H diff --git a/backend/mustek_usb2_reflective.c b/backend/mustek_usb2_reflective.c index 7bf954c76..aa95e5bc6 100644 --- a/backend/mustek_usb2_reflective.c +++ b/backend/mustek_usb2_reflective.c @@ -42,7 +42,7 @@ whether to permit this exception to apply to your modifications. If you do not wish that, delete this exception notice. - This file implements a SANE backend for the Mustek BearPaw 2448 TA Pro + This file implements a SANE backend for the Mustek BearPaw 2448 TA Pro and similar USB2 scanners. */ /* forward declarations */ @@ -63,11 +63,11 @@ static SANE_Bool Reflective_PrepareScan (void); /********************************************************************** Author: Jack Date: 2005/05/13 -Routine Description: +Routine Description: reset the scanner status Parameters: none -Return value: +Return value: if operation is success return TRUE els @@ -140,12 +140,12 @@ Reflective_Reset () /********************************************************************** Author: Jack Date: 2005/05/13 -Routine Description: +Routine Description: get the suggest parameter of scaning Parameters: pTarget: the information of scaning pSuggest: suggest parameter of scaning -Return value: +Return value: if the operation is success return TRUE els @@ -341,7 +341,7 @@ Reflective_ScanSuggest (PTARGETIMAGE pTarget, PSUGGESTSETTING pSuggest) /********************************************************************** Author: Jack Date: 2005/05/13 -Routine Description: +Routine Description: setup scanning process Parameters: ColorMode: ScanMode of Scanning, CM_RGB48, CM_GRAY and so on @@ -352,7 +352,7 @@ Parameters: Y: Y start coordinate Width: Width of Scan Image Height: Height of Scan Image -Return value: +Return value: if the operation is success return TRUE else @@ -567,11 +567,11 @@ Reflective_SetupScan (COLORMODE ColorMode, /********************************************************************** Author: Jack Date: 2005/05/13 -Routine Description: +Routine Description: To adjust the value of offset gain of R/G/B Parameters: none -Return value: +Return value: if operation is success return TRUE else @@ -1102,7 +1102,7 @@ Reflective_AdjustAD () /********************************************************************** Author: Jack Date: 2005/05/14 -Routine Description: +Routine Description: Find top and left side Parameters: lpwStartX: the left side @@ -1284,11 +1284,11 @@ Reflective_FindTopLeft (unsigned short * lpwStartX, unsigned short * lpwStartY) /********************************************************************** Author: Jack Date: 2005/05/14 -Routine Description: +Routine Description: Stop scan Parameters: none -Return value: +Return value: if operation is success return TRUE else @@ -1329,11 +1329,11 @@ Reflective_StopScan () /********************************************************************** Author: Jack Date: 2005/05/15 -Routine Description: +Routine Description: Get the calibration data Parameters: none -Return value: +Return value: if the operation is success return TRUE else @@ -1749,11 +1749,11 @@ Reflective_LineCalibration16Bits () /********************************************************************** Author: Jack Date: 2005/05/14 -Routine Description: +Routine Description: Prepare scan image Parameters: none -Return value: +Return value: if operation is success return TRUE else @@ -1870,7 +1870,7 @@ Reflective_PrepareScan () /********************************************************************** Author: Jack Date: 2005/05/15 -Routine Description: +Routine Description: Get the data of image Parameters: lpBlock: the data of image diff --git a/backend/mustek_usb2_transparent.c b/backend/mustek_usb2_transparent.c index 43bda0bf2..33adcc03f 100644 --- a/backend/mustek_usb2_transparent.c +++ b/backend/mustek_usb2_transparent.c @@ -42,7 +42,7 @@ whether to permit this exception to apply to your modifications. If you do not wish that, delete this exception notice. - This file implements a SANE backend for the Mustek BearPaw 2448 TA Pro + This file implements a SANE backend for the Mustek BearPaw 2448 TA Pro and similar USB2 scanners. */ @@ -64,11 +64,11 @@ static SANE_Bool Transparent_PrepareScan (void); /********************************************************************** Author: Jack Date: 2005/05/13 -Routine Description: +Routine Description: reset the scanner Parameters: none -Return value: +Return value: if operation is success return TRUE else @@ -132,7 +132,7 @@ Transparent_Reset () /********************************************************************** Author: Jack Date: 2005/05/13 -Routine Description: +Routine Description: get suggest parameter of scaning Parameters: pTarget: the information of scaning @@ -283,7 +283,7 @@ Transparent_ScanSuggest (PTARGETIMAGE pTarget, PSUGGESTSETTING pSuggest) /********************************************************************** Author: Jack Date: 2005/05/13 -Routine Description: +Routine Description: setup scanning process Parameters: ColorMode: ScanMode of Scanning, CM_RGB48, CM_GRAY and so on @@ -294,7 +294,7 @@ Parameters: Y: Y start coordinate Width: Width of Scan Image Height: Height of Scan Image -Return value: +Return value: if the operation is success return TRUE else @@ -493,11 +493,11 @@ Transparent_SetupScan (COLORMODE ColorMode, unsigned short XDpi, unsigned short /********************************************************************** Author: Jack Date: 2005/05/14 -Routine Description: +Routine Description: Stop scan Parameters: none -Return value: +Return value: if operation is success return TRUE else @@ -534,7 +534,7 @@ Transparent_StopScan () /********************************************************************** Author: Jack Date: 2005/05/15 -Routine Description: +Routine Description: Get the data of image Parameters: lpBlock: the data of image @@ -604,11 +604,11 @@ Transparent_GetRows (SANE_Byte * lpBlock, unsigned short * Rows, SANE_Bool isOrd /********************************************************************** Author: Jack Date: 2005/05/13 -Routine Description: +Routine Description: To adjust the value of offset gain of R/G/B Parameters: none -Return value: +Return value: if operation is success return TRUE else @@ -1114,7 +1114,7 @@ Transparent_AdjustAD () /********************************************************************** Author: Jack Date: 2005/05/14 -Routine Description: +Routine Description: Find top and left side Parameters: lpwStartX: the left side @@ -1266,11 +1266,11 @@ Transparent_FindTopLeft (unsigned short * lpwStartX, unsigned short * lpwStartY) /********************************************************************** Author: Jack Date: 2005/05/15 -Routine Description: +Routine Description: Get the calibration data Parameters: none -Return value: +Return value: if the operation is success return TRUE else @@ -1650,11 +1650,11 @@ Transparent_LineCalibration16Bits (unsigned short wTAShadingMinus) /********************************************************************** Author: Jack Date: 2005/05/14 -Routine Description: +Routine Description: Prepare scan image Parameters: none -Return value: +Return value: if operation is success return TRUE else diff --git a/backend/mustek_usb_high.c b/backend/mustek_usb_high.c index f6a01255d..bf7807e70 100644 --- a/backend/mustek_usb_high.c +++ b/backend/mustek_usb_high.c @@ -43,7 +43,7 @@ whether to permit this exception to apply to your modifications. If you do not wish that, delete this exception notice. - This file implements a SANE backend for Mustek 1200UB and similar + This file implements a SANE backend for Mustek 1200UB and similar USB flatbed scanners. */ #include "mustek_usb_high.h" diff --git a/backend/mustek_usb_high.h b/backend/mustek_usb_high.h index d3f1ae4f1..916ecb751 100644 --- a/backend/mustek_usb_high.h +++ b/backend/mustek_usb_high.h @@ -43,7 +43,7 @@ whether to permit this exception to apply to your modifications. If you do not wish that, delete this exception notice. - This file implements a SANE backend for Mustek 1200UB and similar + This file implements a SANE backend for Mustek 1200UB and similar USB flatbed scanners. */ #ifndef mustek_usb_high_h @@ -333,7 +333,7 @@ typedef struct Mustek_Usb_Scanner double tl_y; double width; double height; - /* scan window in dots (at current resolution): + /* scan window in dots (at current resolution): top left x+y and width+height */ SANE_Int tl_x_dots; SANE_Int tl_y_dots; diff --git a/backend/mustek_usb_low.c b/backend/mustek_usb_low.c index e626b65dc..3e4c7600c 100644 --- a/backend/mustek_usb_low.c +++ b/backend/mustek_usb_low.c @@ -43,7 +43,7 @@ whether to permit this exception to apply to your modifications. If you do not wish that, delete this exception notice. - This file implements a SANE backend for Mustek 1200UB and similar + This file implements a SANE backend for Mustek 1200UB and similar USB flatbed scanners. */ #include @@ -170,7 +170,7 @@ usb_low_exit (ma1017 * chip) DBG (7, "usb_low_exit: freeing chip\n"); free (chip); } - DBG (5, "usb_low_exit: read %d URBs, wrote %d URBs\n", + DBG (5, "usb_low_exit: read %d URBs, wrote %d URBs\n", chip->total_read_urbs, chip->total_write_urbs); DBG (7, "usb_low_exit: exit\n"); return SANE_STATUS_GOOD; diff --git a/backend/mustek_usb_low.h b/backend/mustek_usb_low.h index e5605db56..46637e8c0 100644 --- a/backend/mustek_usb_low.h +++ b/backend/mustek_usb_low.h @@ -43,7 +43,7 @@ whether to permit this exception to apply to your modifications. If you do not wish that, delete this exception notice. - This file implements a SANE backend for Mustek 1200UB and similar + This file implements a SANE backend for Mustek 1200UB and similar USB flatbed scanners. */ #ifndef mustek_usb_low_h diff --git a/backend/mustek_usb_mid.c b/backend/mustek_usb_mid.c index 9ca51d96a..5935cb7da 100644 --- a/backend/mustek_usb_mid.c +++ b/backend/mustek_usb_mid.c @@ -43,7 +43,7 @@ whether to permit this exception to apply to your modifications. If you do not wish that, delete this exception notice. - This file implements a SANE backend for Mustek 1200UB and similar + This file implements a SANE backend for Mustek 1200UB and similar USB flatbed scanners. */ #include "mustek_usb_mid.h" diff --git a/backend/mustek_usb_mid.h b/backend/mustek_usb_mid.h index d8701a703..23e9c3281 100644 --- a/backend/mustek_usb_mid.h +++ b/backend/mustek_usb_mid.h @@ -43,7 +43,7 @@ whether to permit this exception to apply to your modifications. If you do not wish that, delete this exception notice. - This file implements a SANE backend for Mustek 1200UB and similar + This file implements a SANE backend for Mustek 1200UB and similar USB flatbed scanners. */ #ifndef mustek_usb_mid_h diff --git a/backend/nec.c b/backend/nec.c index d5179d38e..f12e9976f 100644 --- a/backend/nec.c +++ b/backend/nec.c @@ -1,6 +1,6 @@ /* sane - Scanner Access Now Easy. - Copyright (C) 2000-2001 Kazuya Fukuda, based on sharp.c, which is + Copyright (C) 2000-2001 Kazuya Fukuda, based on sharp.c, which is based on canon.c. This file is part of the SANE package. @@ -52,7 +52,7 @@ - resolution setting bug fixed(PC-IN500/4C 10dpi step) - remove resolution list Version 0.11 - - get_data_buffer_status is not called in sane_get_parameter and + - get_data_buffer_status is not called in sane_get_parameter and sane_read_direct, sane_read_shuffled. - change some #include <> to "" Version 0.10 @@ -114,12 +114,12 @@ #ifndef USE_COLOR_THRESHOLD #define USE_COLOR_THRESHOLD #endif -/* enable a short list of some standard resolutions. XSane provides +/* enable a short list of some standard resolutions. XSane provides its own resolution list; therefore its is generally not reasonable to enable this list, if you mainly using XSane. But it might be handy if you are working with xscanimage */ -/* #define USE_RESOLUTION_LIST */ +/* #define USE_RESOLUTION_LIST */ #define BACKEND_NAME nec #include "../include/sane/sanei_backend.h" @@ -202,8 +202,8 @@ static SANE_String use_simple = "Flatbed"; #define HAVE_FSU 1 #define HAVE_ADF 2 -/* The follow #defines are used in NEC_Scanner.adf_fsu_mode - and as indexes for the arrays x_ranges, y_ranges in NEC_Device +/* The follow #defines are used in NEC_Scanner.adf_fsu_mode + and as indexes for the arrays x_ranges, y_ranges in NEC_Device */ #define SCAN_SIMPLE 0 #define SCAN_WITH_FSU 1 @@ -291,19 +291,19 @@ sense_handler(int fd, u_char *sense_buffer, void *ss) { int sense_key; NEC_Sense_Data *sdat = (NEC_Sense_Data *) ss; - + fd = fd; /* silence compilation warnings */ #define add_sense_code sense_buffer[12] #define add_sense_qual sense_buffer[13] memcpy(sdat->sb, sense_buffer, 16); - + DBG(10, "sense code: %02x %02x %02x %02x %02x %02x %02x %02x " "%02x %02x %02x %02x %02x %02x %02x %02x\n", - sense_buffer[0], sense_buffer[1], sense_buffer[2], sense_buffer[3], - sense_buffer[4], sense_buffer[5], sense_buffer[6], sense_buffer[7], - sense_buffer[8], sense_buffer[9], sense_buffer[10], sense_buffer[11], + sense_buffer[0], sense_buffer[1], sense_buffer[2], sense_buffer[3], + sense_buffer[4], sense_buffer[5], sense_buffer[6], sense_buffer[7], + sense_buffer[8], sense_buffer[9], sense_buffer[10], sense_buffer[11], sense_buffer[12], sense_buffer[13], sense_buffer[14], sense_buffer[15]); sense_key = sense_buffer[1] & 0x0F; @@ -418,7 +418,7 @@ inquiry (int fd, void *inq_buf, size_t *inq_size) static SANE_Status mode_select_mud (int fd, int mud) { - static u_char cmd[6 + MODEPARAM_LEN] = + static u_char cmd[6 + MODEPARAM_LEN] = {MODE_SELECT6, 0x10, 0, 0, MODEPARAM_LEN, 0}; mode_select_param *mp; SANE_Status status; @@ -442,7 +442,7 @@ mode_select_mud (int fd, int mud) static SANE_Status mode_select_adf_fsu (int fd, int mode) { - static u_char cmd[6 + MODE_SUBDEV_LEN] = + static u_char cmd[6 + MODE_SUBDEV_LEN] = {MODE_SELECT6, 0x10, 0, 0, MODE_SUBDEV_LEN, 0}; mode_select_subdevice *mp; SANE_Status status; @@ -478,7 +478,7 @@ mode_select_adf_fsu (int fd, int mode) static SANE_Status wait_ready(int fd); static SANE_Status -mode_sense (int fd, void *modeparam_buf, size_t * modeparam_size, +mode_sense (int fd, void *modeparam_buf, size_t * modeparam_size, int page) { static u_char cmd[6] = {MODE_SENSE6, 0, 0, 0, 0, 0}; @@ -487,7 +487,7 @@ mode_sense (int fd, void *modeparam_buf, size_t * modeparam_size, cmd[0] = 0x1a; cmd[2] = page; cmd[4] = *modeparam_size; - status = sanei_scsi_cmd (fd, cmd, sizeof (cmd), modeparam_buf, + status = sanei_scsi_cmd (fd, cmd, sizeof (cmd), modeparam_buf, modeparam_size); DBG (11, ">>\n"); @@ -525,7 +525,7 @@ send_diagnostics (int fd) static SANE_Status set_window (int fd, window_param *wp, int len) { - static u_char cmd[10 + WINDOW_LEN] = + static u_char cmd[10 + WINDOW_LEN] = {SET_WINDOW, 0, 0, 0, 0, 0, 0, 0, 0, 0}; window_param *winp; SANE_Status status; @@ -560,7 +560,7 @@ get_window (int fd, void *buf, size_t * buf_size) static SANE_Status get_data_buffer_status (int fd, void *buf, size_t *buf_size) { - static u_char cmd[10] = + static u_char cmd[10] = {GET_DATA_BUFFER_STATUS, 0, 0, 0, 0, 0, 0, 0, 0, 0}; SANE_Status status; DBG (11, "<< get_data_buffer_status "); @@ -576,17 +576,17 @@ get_data_buffer_status (int fd, void *buf, size_t *buf_size) #ifdef USE_FORK /* the following four functions serve simply the purpose - to avoid "over-optimised" code when reader_process and - read_data wait for the buffer to become ready. The simple - while-loops in these functions which check the buffer - status may be optimised so that the machine code only - operates with registers instead of using the variable - values stored in memory. (This is only a workaround - + to avoid "over-optimised" code when reader_process and + read_data wait for the buffer to become ready. The simple + while-loops in these functions which check the buffer + status may be optimised so that the machine code only + operates with registers instead of using the variable + values stored in memory. (This is only a workaround - it would be better to set a compiler pragma, which ensures that the program looks into the RAM in these while loops -- but unfortunately I could not find appropriate information - about this at least for gcc, not to speak about other - compilers... + about this at least for gcc, not to speak about other + compilers... Abel) */ @@ -596,7 +596,7 @@ cancel_requested(NEC_Scanner *s) return s->rdr_ctl->cancel; } -static SANE_Status +static SANE_Status rdr_status(NEC_Scanner *s) { return s->rdr_ctl->status; @@ -633,18 +633,18 @@ reader_process(NEC_Scanner *s) DBG(11, "<< reader_process\n"); sigemptyset (&sigterm_set); - + bytes_to_queue = s->bytes_to_read; - + max_bytes_per_read = s->dev->info.bufsize / s->params.bytes_per_line; if (max_bytes_per_read) max_bytes_per_read *= s->params.bytes_per_line; else /* this is a really tiny buffer..*/ max_bytes_per_read = s->dev->info.bufsize; - + /* wait_ready(s->fd); */ - + if (s->dev->info.queued_reads <= s->dev->info.buffers) max_queue = s->dev->info.queued_reads; else @@ -664,16 +664,16 @@ reader_process(NEC_Scanner *s) #ifdef QUEUEDEBUG DBG(2, "reader: req_enter...\n"); #endif - status = sanei_scsi_req_enter (s->fd, cmd, sizeof (cmd), - bc->buffer, - &bc->used, + status = sanei_scsi_req_enter (s->fd, cmd, sizeof (cmd), + bc->buffer, + &bc->used, &bc->qid); #ifdef QUEUEDEBUG DBG(2, "reader: req_enter ok\n"); #endif if (status != SANE_STATUS_GOOD) { - DBG(1, "reader_process: read command failed: %s", + DBG(1, "reader_process: read command failed: %s", sane_strstatus(status)); #ifdef HAVE_SANEI_SCSI_OPEN_EXTENDED sanei_scsi_req_flush_all_extended(s->fd); @@ -697,9 +697,9 @@ reader_process(NEC_Scanner *s) waitindex = 0; cmdindex = i % s->dev->info.buffers; - while(s->bytes_to_read > 0) + while(s->bytes_to_read > 0) { - if (cancel_requested(s)) + if (cancel_requested(s)) { #ifdef QUEUEDEBUG DBG(2, "reader: flushing requests...\n"); @@ -720,7 +720,7 @@ reader_process(NEC_Scanner *s) } bc = &s->rdr_ctl->buf_ctl[waitindex]; - if (bc->shm_status == SHM_BUSY) + if (bc->shm_status == SHM_BUSY) { #ifdef DEBUG { @@ -745,7 +745,7 @@ reader_process(NEC_Scanner *s) #endif if (status != SANE_STATUS_GOOD) { - DBG(1, "reader_process: read command failed: %s", + DBG(1, "reader_process: read command failed: %s", sane_strstatus(status)); #ifdef HAVE_SANEI_SCSI_OPEN_EXTENDED sanei_scsi_req_flush_all_extended(s->fd); @@ -766,7 +766,7 @@ reader_process(NEC_Scanner *s) waitindex = 0; } - + if (bytes_to_queue) { /* wait until the next buffer is completely read via read_data */ @@ -801,11 +801,11 @@ reader_process(NEC_Scanner *s) cmd[6] = nread >> 16; cmd[7] = nread >> 8; cmd[8] = nread; - status = sanei_scsi_req_enter (s->fd, cmd, sizeof (cmd), + status = sanei_scsi_req_enter (s->fd, cmd, sizeof (cmd), bc->buffer, &bc->used, &bc->qid); if (status != SANE_STATUS_GOOD) { - DBG(1, "reader_process: read command failed: %s", + DBG(1, "reader_process: read command failed: %s", sane_strstatus(status)); #ifdef HAVE_SANEI_SCSI_OPEN_EXTENDED sanei_scsi_req_flush_all_extended(s->fd); @@ -819,13 +819,13 @@ reader_process(NEC_Scanner *s) bc->shm_status = SHM_BUSY; bc->nreq = nread; bytes_to_queue -= nread; - + cmdindex++; if (cmdindex == s->dev->info.buffers) cmdindex = 0; } - - if (cancel_requested(s)) + + if (cancel_requested(s)) { #ifdef HAVE_SANEI_SCSI_OPEN_EXTENDED sanei_scsi_req_flush_all_extended(s->fd); @@ -839,7 +839,7 @@ reader_process(NEC_Scanner *s) return 1; } } - + DBG(1, "buffer full conditions: %i\n", full_count); DBG(11, " reader_process>>\n"); @@ -852,7 +852,7 @@ read_data (NEC_Scanner *s, SANE_Byte *buf, size_t * buf_size) { size_t copysize, copied = 0; NEC_shmem_ctl *bc; - + DBG(11, "<< read_data "); bc = &s->rdr_ctl->buf_ctl[s->read_buff]; @@ -861,7 +861,7 @@ read_data (NEC_Scanner *s, SANE_Byte *buf, size_t * buf_size) { /* wait until the reader process delivers data or a scanner error occurs: */ while ( buf_status(bc) != SHM_FULL - && rdr_status(s) == SANE_STATUS_GOOD) + && rdr_status(s) == SANE_STATUS_GOOD) { usleep(10); /* could perhaps be longer. make this user configurable?? */ } @@ -873,10 +873,10 @@ read_data (NEC_Scanner *s, SANE_Byte *buf, size_t * buf_size) } copysize = bc->used - bc->start; - + if (copysize > *buf_size - copied ) copysize = *buf_size - copied; - + memcpy(buf, &(bc->buffer[bc->start]), copysize); copied += copysize; @@ -911,8 +911,8 @@ read_data (NEC_Scanner *s, SANE_Byte *buf, size_t * buf_size) /* sane_read_shuffled requires that read_data returns exactly *buf_size bytes, so it must be guaranteed here. - Further make sure that not more bytes are read in than - sanei_scsi_max_request_size allows, to avoid a failure + Further make sure that not more bytes are read in than + sanei_scsi_max_request_size allows, to avoid a failure of the read command */ while (remain > 0) @@ -923,7 +923,7 @@ read_data (NEC_Scanner *s, SANE_Byte *buf, size_t * buf_size) cmd[6] = nread >> 16; cmd[7] = nread >> 8; cmd[8] = nread; - status = sanei_scsi_cmd (s->fd, cmd, sizeof (cmd), + status = sanei_scsi_cmd (s->fd, cmd, sizeof (cmd), &buf[*buf_size - remain], &nread); if (status != SANE_STATUS_GOOD) { @@ -971,7 +971,7 @@ wait_ready(int fd) sleep(3); } return (status); - + } static SANE_Status @@ -1111,7 +1111,7 @@ attach (const char *devnam, NEC_Device ** devp) model_name = inquiry_data + 16; dev->sane.model = strndup ((const char *)model_name, 10); dev->sane.type = "flatbed scanner"; - + dev->sensedat.model = sensedat.model; DBG (5, "dev->sane.name = %s\n", dev->sane.name); @@ -1144,7 +1144,7 @@ attach (const char *devnam, NEC_Device ** devp) dev->info.bmu = msp.bmu; dev->info.mud = (msp.mud[0] << 8) + msp.mud[1]; - + dev->info.adf_fsu_installed = 0; if (dev->sensedat.model == PCIN500) { @@ -1173,7 +1173,7 @@ attach (const char *devnam, NEC_Device ** devp) dev->info.br_y_ranges[SCAN_SIMPLE].max = SANE_FIX(297); /* 431.8 is the real max */ } sanei_scsi_close (fd); - + dev->info.threshold_range.min = 1; dev->info.threshold_range.max = 255; dev->info.threshold_range.quant = 0; @@ -1253,12 +1253,12 @@ attach (const char *devnam, NEC_Device ** devp) } /* Enabling / disabling of gamma options. - Depends on many user settable options, so lets put it into + Depends on many user settable options, so lets put it into one function to be called by init_options and by sane_control_option */ #ifdef USE_CUSTOM_GAMMA -static void +static void set_gamma_caps(NEC_Scanner *s) { /* neither fixed nor custom gamma for line art modes */ @@ -1397,11 +1397,11 @@ clip_value (const SANE_Option_Descriptor * opt, void * value) /* make sure that enough memory is allocated for each string, so that the strcpy in sane_control_option / set value cannot - write behind the end of the allocated memory. + write behind the end of the allocated memory. */ static SANE_Status -init_string_option(NEC_Scanner *s, SANE_String_Const name, - SANE_String_Const title, SANE_String_Const desc, +init_string_option(NEC_Scanner *s, SANE_String_Const name, + SANE_String_Const title, SANE_String_Const desc, const SANE_String_Const *string_list, int option, int default_index) { int i; @@ -1486,7 +1486,7 @@ init_options (NEC_Scanner * s) if (default_source < 0) default_source = SCAN_SIMPLE; s->dev->info.scansources[i] = 0; - + init_string_option(s, SANE_NAME_SCAN_SOURCE, SANE_TITLE_SCAN_SOURCE, SANE_DESC_SCAN_SOURCE, (SANE_String_Const*)s->dev->info.scansources, OPT_SCANSOURCE, 0); @@ -1514,13 +1514,13 @@ init_options (NEC_Scanner * s) #ifdef USE_RESOLUTION_LIST /* select resolution */ if (s->dev->sensedat.model == PCIN500) - init_string_option(s, "Resolution", "Resolution", "Resolution", + init_string_option(s, "Resolution", "Resolution", "Resolution", resolution_list_pcin500, OPT_RESOLUTION_LIST, RESOLUTION_MAX_PCIN500); else - init_string_option(s, "Resolution", "Resolution", "Resolution", + init_string_option(s, "Resolution", "Resolution", "Resolution", resolution_list_pcinxxx, OPT_RESOLUTION_LIST, RESOLUTION_MAX_PCINXXX); #endif - + /* x & y resolution */ s->opt[OPT_RESOLUTION].name = SANE_NAME_SCAN_RESOLUTION; if (s->dev->sensedat.model == PCIN500) @@ -1665,7 +1665,7 @@ init_options (NEC_Scanner * s) #ifdef USE_COLOR_THRESHOLD s->opt[OPT_THRESHOLD_R].name = SANE_NAME_THRESHOLD "-red"; /* xxx the titles and decriptions are confusing: - "set white point (red)" + "set white point (red)" Any idea? maybe "threshold to get the red component on" */ s->opt[OPT_THRESHOLD_R].title = SANE_TITLE_THRESHOLD " (red)"; @@ -1710,7 +1710,7 @@ init_options (NEC_Scanner * s) s->opt[OPT_PREVIEW].type = SANE_TYPE_BOOL; s->opt[OPT_PREVIEW].cap = SANE_CAP_SOFT_DETECT | SANE_CAP_SOFT_SELECT; s->val[OPT_PREVIEW].w = SANE_FALSE; - + #ifdef USE_CUSTOM_GAMMA /* custom-gamma table */ @@ -1796,7 +1796,7 @@ do_cancel (NEC_Scanner * s) DBG(11, "stopping reader process\n"); s->rdr_ctl->cancel = 1; - while(reader_running(s) && count < 100) + while(reader_running(s) && count < 100) { usleep(100000); count++; @@ -1838,13 +1838,13 @@ do_cancel (NEC_Scanner * s) static NEC_New_Device *new_devs = 0; static NEC_New_Device *new_dev_pool = 0; -static SANE_Status +static SANE_Status attach_and_list(const char *devnam) { SANE_Status res; NEC_Device *devp; NEC_New_Device *np; - + res = attach(devnam, &devp); if (res == SANE_STATUS_GOOD) { @@ -1975,7 +1975,7 @@ sane_init (SANE_Int * version_code, SANE_Auth_Callback authorize) linecount); DBG(1, "%s\n", line); } - else + else queued_reads[opt_index] = i; } else @@ -1989,7 +1989,7 @@ sane_init (SANE_Int * version_code, SANE_Auth_Callback authorize) { while (new_devs) { - if (buffers[1] >= 2) + if (buffers[1] >= 2) new_devs->dev->info.buffers = buffers[1]; else new_devs->dev->info.buffers = 2; @@ -2021,7 +2021,7 @@ sane_init (SANE_Int * version_code, SANE_Auth_Callback authorize) while (new_devs) { - if (buffers[1] >= 2) + if (buffers[1] >= 2) new_devs->dev->info.buffers = buffers[1]; else new_devs->dev->info.buffers = 2; @@ -2139,8 +2139,8 @@ sane_open (SANE_String_Const devnam, SANE_Handle * handle) s->fd = -1; s->dev = dev; - - s->buffer = 0; + + s->buffer = 0; #ifdef USE_CUSTOM_GAMMA for (i = 0; i < 4; ++i) for (j = 0; j < 256; ++j) @@ -2308,7 +2308,7 @@ sane_control_option (SANE_Handle handle, SANE_Int option, *info |= SANE_INFO_RELOAD_PARAMS; case OPT_NUM_OPTS: case OPT_THRESHOLD: - /* xxx theoretically, we could use OPT_THRESHOLD in + /* xxx theoretically, we could use OPT_THRESHOLD in bi-level color mode to adjust all three other threshold together. But this would require to set the bit SANE_INFO_RELOAD_OPTIONS in *info, and that @@ -2385,8 +2385,8 @@ sane_control_option (SANE_Handle handle, SANE_Int option, #endif s->opt[OPT_HALFTONE].cap |= SANE_CAP_INACTIVE; } -#if 0 - if ( strcmp (val, M_LINEART) == 0 +#if 0 + if ( strcmp (val, M_LINEART) == 0 || strcmp (val, M_GRAY) == 0) { s->opt[OPT_LIGHTCOLOR].cap &= ~SANE_CAP_INACTIVE; @@ -2395,7 +2395,7 @@ sane_control_option (SANE_Handle handle, SANE_Int option, { s->opt[OPT_LIGHTCOLOR].cap |= SANE_CAP_INACTIVE; } -#endif +#endif strcpy(s->val[option].s, val); #ifdef USE_CUSTOM_GAMMA set_gamma_caps(s); @@ -2432,19 +2432,19 @@ sane_control_option (SANE_Handle handle, SANE_Int option, else range_index = SCAN_SIMPLE; - s->opt[OPT_TL_X].constraint.range + s->opt[OPT_TL_X].constraint.range = &s->dev->info.tl_x_ranges[range_index]; clip_value (&s->opt[OPT_TL_X], &s->val[OPT_TL_X].w); - s->opt[OPT_TL_Y].constraint.range + s->opt[OPT_TL_Y].constraint.range = &s->dev->info.tl_y_ranges[range_index]; clip_value (&s->opt[OPT_TL_Y], &s->val[OPT_TL_Y].w); - s->opt[OPT_BR_X].constraint.range + s->opt[OPT_BR_X].constraint.range = &s->dev->info.br_x_ranges[range_index]; clip_value (&s->opt[OPT_BR_X], &s->val[OPT_BR_X].w); - s->opt[OPT_BR_Y].constraint.range + s->opt[OPT_BR_Y].constraint.range = &s->dev->info.br_y_ranges[range_index]; clip_value (&s->opt[OPT_BR_Y], &s->val[OPT_BR_Y].w); @@ -2505,9 +2505,9 @@ sane_control_option (SANE_Handle handle, SANE_Int option, s->val[option].s = strdup (val); #endif for (i = 0; s->opt[OPT_RESOLUTION_LIST].constraint.string_list[i]; i++) { - if (strcmp (val, + if (strcmp (val, s->opt[OPT_RESOLUTION_LIST].constraint.string_list[i]) == 0){ - s->val[OPT_RESOLUTION].w + s->val[OPT_RESOLUTION].w = atoi(s->opt[OPT_RESOLUTION_LIST].constraint.string_list[i]); if (info) *info |= SANE_INFO_RELOAD_PARAMS; @@ -2560,7 +2560,7 @@ sane_get_parameters (SANE_Handle handle, SANE_Parameters * params) scanning starts. */ memset (&s->params, 0, sizeof (s->params)); - width = MM_TO_PIX( SANE_UNFIX(s->val[OPT_BR_X].w) + width = MM_TO_PIX( SANE_UNFIX(s->val[OPT_BR_X].w) - SANE_UNFIX(s->val[OPT_TL_X].w), s->dev->info.mud); length = MM_TO_PIX( SANE_UNFIX(s->val[OPT_BR_Y].w) @@ -2657,7 +2657,7 @@ sprint_gamma(Option_Value val, SANE_Byte *dst) { int i; SANE_Byte *p = dst; - + p += sprintf((char *) p, "%i", val.wa[0]); for (i = 1; i < 256; i++) p += sprintf((char *) p, ",%i", val.wa[i] > 255 ? 255 : val.wa[i]); @@ -2669,17 +2669,17 @@ send_ascii_gamma_tables (NEC_Scanner *s) { SANE_Status status; int i; - + DBG(11, "<< send_ascii_gamma_tables "); - + /* we need: 4 bytes for each gamma value (3 digits + delimiter) + 10 bytes for the command header i.e. 4 * 4 * 256 + 10 = 4106 bytes */ - + if (s->dev->info.bufsize < 4106) return SANE_STATUS_NO_MEM; - + memset(s->buffer, 0, 4106); i = sprint_gamma(s->val[OPT_GAMMA_VECTOR_R], &s->buffer[10]); @@ -2689,19 +2689,19 @@ send_ascii_gamma_tables (NEC_Scanner *s) i += sprint_gamma(s->val[OPT_GAMMA_VECTOR_B], &s->buffer[10+i]); s->buffer[10+i++] = '/'; i += sprint_gamma(s->val[OPT_GAMMA_VECTOR], &s->buffer[10+i]); - + DBG(12, "%s\n", &s->buffer[10]); s->buffer[0] = SEND; s->buffer[2] = 0x03; s->buffer[7] = i >> 8; s->buffer[8] = i & 0xff; - + wait_ready(s->fd); status = sanei_scsi_cmd (s->fd, s->buffer, i+10, 0, 0); DBG(11, ">>\n"); - + return status; } #endif @@ -2711,9 +2711,9 @@ send_binary_g_table(NEC_Scanner *s, SANE_Word *a, int dtq) { SANE_Status status; unsigned int i, j; - + dtq = dtq; /* silence compilation warnings */ - + DBG(11, "<< send_binary_g_table\n"); i = 256; @@ -2725,19 +2725,19 @@ send_binary_g_table(NEC_Scanner *s, SANE_Word *a, int dtq) s->buffer[2] = 0x03; s->buffer[7] = i >> 8; s->buffer[8] = i & 0xff; - + for (i = 0; i < 256; i++) { s->buffer[i+11] = a[i&0xff] & 0xff; } - + for (j = 0; j < 256; j += 16) { DBG(11, "%02x %02x %02x %02x %02x %02x %02x %02x " "%02x %02x %02x %02x %02x %02x %02x %02x\n", - a[j ], a[j+1], a[j+2], a[j+3], + a[j ], a[j+1], a[j+2], a[j+3], a[j+4], a[j+5], a[j+6], a[j+7], - a[j+8], a[j+9], a[j+10], a[j+11], + a[j+8], a[j+9], a[j+10], a[j+11], a[j+12], a[j+13], a[j+14], a[j+15]); } DBG(12, "transfer length = %d\n", i); @@ -2757,20 +2757,20 @@ static SANE_Status send_binary_gamma_tables (NEC_Scanner *s) { SANE_Status status; - + status = send_binary_g_table(s, s->val[OPT_GAMMA_VECTOR].wa, 0x10); if (status != SANE_STATUS_GOOD) return status; DBG(11, "send_binary_gamma_tables\n"); -#if 0 +#if 0 status = send_binary_g_table(s, s->val[OPT_GAMMA_VECTOR_R].wa, 0x11); if (status != SANE_STATUS_GOOD) return status; - + status = send_binary_g_table(s, s->val[OPT_GAMMA_VECTOR_G].wa, 0x12); if (status != SANE_STATUS_GOOD) return status; - + status = send_binary_g_table(s, s->val[OPT_GAMMA_VECTOR_B].wa, 0x13); #endif return status; @@ -2787,7 +2787,7 @@ send_gamma_tables (NEC_Scanner *s) { return send_ascii_gamma_tables(s); } - + } #endif @@ -2800,19 +2800,19 @@ send_threshold_data(NEC_Scanner *s) SANE_Status status; SANE_Byte cmd[26] = {SEND, 0, 0x82, 0, 0, 0, 0, 0, 0, 0}; int len; - + memset(cmd, 0, sizeof(cmd)); - /* maximum string length: 3 bytes for each number (they are + /* maximum string length: 3 bytes for each number (they are restricted to the range 0..255), 3 '/' and the null-byte, total: 16 bytes. */ - len = sprintf((char *) &cmd[10], "%i/%i/%i/%i", + len = sprintf((char *) &cmd[10], "%i/%i/%i/%i", s->val[OPT_THRESHOLD_R].w, s->val[OPT_THRESHOLD_G].w, s->val[OPT_THRESHOLD_B].w, s->val[OPT_THRESHOLD].w); cmd[8] = len; - + wait_ready(s->fd); status = sanei_scsi_cmd(s->fd, cmd, len + 10, 0, 0); return status; @@ -2845,7 +2845,7 @@ sane_start (SANE_Handle handle) s->dev->info.bufsize = 32 * 1024; { int bsize = s->dev->info.bufsize; - status = sanei_scsi_open_extended (s->dev->sane.name, &s->fd, + status = sanei_scsi_open_extended (s->dev->sane.name, &s->fd, &sense_handler, &s->dev->sensedat, &bsize); s->dev->info.bufsize = bsize; } @@ -2858,8 +2858,8 @@ sane_start (SANE_Handle handle) } /* make sure that we got at least 32 kB. Even then, the scan will be - awfully slow. - + awfully slow. + */ if (s->dev->info.bufsize < 32 * 1024) { @@ -2868,13 +2868,13 @@ sane_start (SANE_Handle handle) return SANE_STATUS_NO_MEM; } #else - status = sanei_scsi_open(s->dev->sane.name, &s->fd, &sense_handler, + status = sanei_scsi_open(s->dev->sane.name, &s->fd, &sense_handler, &s->dev->sensedat); if (s->dev->info.wanted_bufsize < sanei_scsi_max_request_size) s->dev->info.bufsize = s->dev->info.wanted_bufsize; else s->dev->info.bufsize = sanei_scsi_max_request_size; - + if (status != SANE_STATUS_GOOD) { DBG (1, "open of %s failed: %s\n", @@ -2932,7 +2932,7 @@ sane_start (SANE_Handle handle) DBG (5, "start: TEST_UNIT_READY\n"); status = test_unit_ready (s->fd); - + if (status != SANE_STATUS_GOOD) { DBG (1, "TEST UNIT READY failed: %s\n", sane_strstatus (status)); @@ -3046,7 +3046,7 @@ sane_start (SANE_Handle handle) else if (strcmp (edge, EDGE_BLUR) == 0) s->edge = 3; } - + s->lightcolor = 3; if (strcmp(lightcolor, LIGHT_GREEN) == 0) s->lightcolor = 0; @@ -3058,7 +3058,7 @@ sane_start (SANE_Handle handle) s->lightcolor = 3; s->adf_scan = 0; - + #ifdef USE_CUSTOM_GAMMA if (s->val[OPT_CUSTOM_GAMMA].w == SANE_FALSE) { @@ -3136,14 +3136,14 @@ sane_start (SANE_Handle handle) s->color = s->val[OPT_COLOR].w; memset (&wp, 0, sizeof (wp)); - /* every NEC scanner seems to have a different + /* every NEC scanner seems to have a different window descriptor block... */ if (s->dev->sensedat.model == PCIN500) buf_size = sizeof(WDB) + sizeof(WDBX500); else buf_size = sizeof(WDB); - + wp.wpdh.wdl[0] = buf_size >> 8; wp.wpdh.wdl[1] = buf_size; wp.wdb.x_res[0] = s->res >> 8; @@ -3372,7 +3372,7 @@ sane_start (SANE_Handle handle) #ifdef USE_FORK { size_t i; - for (i = 0; i < s->dev->info.buffers; i++) + for (i = 0; i < s->dev->info.buffers; i++) s->rdr_ctl->buf_ctl[i].shm_status = SHM_EMPTY; s->read_buff = 0; s->rdr_ctl->cancel = 0; @@ -3388,7 +3388,7 @@ sane_start (SANE_Handle handle) s->reader_pid); } #endif - if (s->reader_pid == 0) + if (s->reader_pid == 0) { sigset_t ignore_set; struct SIGACTION act; @@ -3409,9 +3409,9 @@ sane_start (SANE_Handle handle) do_cancel(s); return SANE_STATUS_NO_MEM; } - + #endif /* USE_FORK */ - + DBG (1, "%d pixels per line, %d bytes, %d lines high, total %lu bytes, " "dpi=%d\n", s->params.pixels_per_line, s->params.bytes_per_line, @@ -3421,7 +3421,7 @@ sane_start (SANE_Handle handle) s->buf_used = 0; s->buf_pos = 0; - if (s->cancel == SANE_TRUE) + if (s->cancel == SANE_TRUE) { do_cancel(s); DBG (10, ">>\n"); @@ -3447,7 +3447,7 @@ sane_read_direct (SANE_Handle handle, SANE_Byte *dst_buf, SANE_Int max_len, buffer_status bs; size_t len = sizeof (buffer_status); get_data_buffer_status (s->fd, &bs, &len); - DBG (20, "buffer_status: %i ", bs.fdb[0]*256*256 + bs.fdb[1]*256 + bs.fdb[2]); + DBG (20, "buffer_status: %i ", bs.fdb[0]*256*256 + bs.fdb[1]*256 + bs.fdb[2]); } #endif DBG (20, "remaining: %lu ", (u_long) s->bytes_to_read); @@ -3505,18 +3505,18 @@ sane_read_shuffled (SANE_Handle handle, SANE_Byte *dst_buf, SANE_Int max_len, buffer_status bs; size_t len = sizeof (buffer_status); get_data_buffer_status (s->fd, &bs, &len); - DBG (20, "buffer_status: %i ", bs.fdb[0]*256*256 + bs.fdb[1]*256 + bs.fdb[2]); + DBG (20, "buffer_status: %i ", bs.fdb[0]*256*256 + bs.fdb[1]*256 + bs.fdb[2]); } #endif *len = 0; - if (s->bytes_to_read == 0 && s->buf_pos == s->buf_used) + if (s->bytes_to_read == 0 && s->buf_pos == s->buf_used) { do_cancel (s); DBG (10, ">>\n"); return (SANE_STATUS_EOF); } - - if (!s->scanning) + + if (!s->scanning) { DBG (10, ">>\n"); return(do_cancel(s)); @@ -3527,14 +3527,14 @@ sane_read_shuffled (SANE_Handle handle, SANE_Byte *dst_buf, SANE_Int max_len, transfer = s->buf_used - s->buf_pos; if (transfer > max_len) transfer = max_len; - + memcpy(dst_buf, &(s->buffer[s->buf_pos]), transfer); s->buf_pos += transfer; max_len -= transfer; *len = transfer; } - while (max_len > 0 && s->bytes_to_read > 0) + while (max_len > 0 && s->bytes_to_read > 0) { if (eight_bit_data) { @@ -3561,7 +3561,7 @@ sane_read_shuffled (SANE_Handle handle, SANE_Byte *dst_buf, SANE_Int max_len, start_input = s->dev->info.bufsize - nread; } ntest = nread; - + #ifdef USE_FORK status = read_data (s, &(s->buffer[start_input]), &nread); #else @@ -3573,8 +3573,8 @@ sane_read_shuffled (SANE_Handle handle, SANE_Byte *dst_buf, SANE_Int max_len, DBG (10, ">>\n"); return (SANE_STATUS_IO_ERROR); } - - if (nread != ntest) + + if (nread != ntest) { /* if this happens, something is wrong in the input buffer management... @@ -3582,8 +3582,8 @@ sane_read_shuffled (SANE_Handle handle, SANE_Byte *dst_buf, SANE_Int max_len, DBG(1, "Warning: could not read an integral number of scan lines\n"); DBG(1, " image will be scrambled\n"); } - - + + s->buf_used = max_line * s->params.bytes_per_line; s->buf_pos = 0; s->bytes_to_read -= nread; @@ -3625,12 +3625,12 @@ sane_read_shuffled (SANE_Handle handle, SANE_Byte *dst_buf, SANE_Int max_len, } } } - + transfer = max_len; if (transfer > s->buf_used) transfer = s->buf_used; memcpy(&(dst_buf[*len]), s->buffer, transfer); - + max_len -= transfer; s->buf_pos += transfer; *len += transfer; @@ -3651,13 +3651,13 @@ sane_read (SANE_Handle handle, SANE_Byte *dst_buf, SANE_Int max_len, DBG (10, "<< sane_read "); s->busy = SANE_TRUE; - if (s->cancel == SANE_TRUE) + if (s->cancel == SANE_TRUE) { do_cancel(s); *len = 0; return (SANE_STATUS_CANCELLED); } - + if (s->image_composition <= 2) status = sane_read_direct(handle, dst_buf, max_len, len); else if (s->image_composition <= 4) @@ -3708,7 +3708,7 @@ sane_get_select_fd (SANE_Handle handle, SANE_Int * fd) { handle = handle; fd = fd; /* silence compilation warnings */ - + DBG (10, "<< sane_get_select_fd"); DBG (10, ">>\n"); diff --git a/backend/nec.h b/backend/nec.h index 5f0351345..d7848e4c6 100644 --- a/backend/nec.h +++ b/backend/nec.h @@ -47,21 +47,21 @@ /* default values for configurable options. Though these options are only meaningful if USE_FORK is defined, - they are + they are DEFAULT_BUFFERS: number of buffers allocated as shared memory for the data transfer from reader_process to read_data. The minimum value is 2 DEFAULT_BUFSIZE: default size of one buffer. Must be greater than zero. - DEFAULT_QUEUED_READS: number of read requests queued by + DEFAULT_QUEUED_READS: number of read requests queued by sanei_scsi_req_enter. Since queued read requests - are currently only supported for Linux and + are currently only supported for Linux and DomainOS, this value should automatically be set dependent on the target OS... For Linux, 2 is the optimum; for DomainOS, I don't have any recommendation; other OS should use the value zero. - + The value for DEFAULT_BUFSIZE is probably too Linux-oriented... */ @@ -113,7 +113,7 @@ typedef enum OPT_COLOR, OPT_PREVIEW, -#ifdef USE_CUSTOM_GAMMA +#ifdef USE_CUSTOM_GAMMA OPT_GAMMA_VECTOR, OPT_GAMMA_VECTOR_R, OPT_GAMMA_VECTOR_G, @@ -126,7 +126,7 @@ NEC_Option; #ifdef USE_FORK -/* status defines for a buffer: +/* status defines for a buffer: buffer not used / read request queued / buffer contains data */ #define SHM_EMPTY 0 @@ -153,7 +153,7 @@ typedef struct NEC_rdr_ctl NEC_rdr_ctl; #endif /* USE_FORK */ -typedef enum +typedef enum { /* PCIN500, PCINXXX are used as array indices, so the corresponding numbers should start at 0 @@ -192,14 +192,14 @@ NEC_Info; typedef struct NEC_Sense_Data { NEC_Model model; - /* flag, if conditions like "paper jam" or "cover open" + /* flag, if conditions like "paper jam" or "cover open" are considered as an error. Should be 0 for attach, else a frontend might refuse to start, if the scanner returns these errors. */ int complain_on_adf_error; /* Linux returns only 16 bytes of sense data... */ - u_char sb[16]; + u_char sb[16]; } NEC_Sense_Data; @@ -213,7 +213,7 @@ typedef struct NEC_Device } NEC_Device; -typedef struct NEC_New_Device +typedef struct NEC_New_Device { struct NEC_Device *dev; struct NEC_New_Device *next; @@ -286,7 +286,7 @@ typedef struct WPDH { u_char wpdh[6]; u_char wdl[2]; -} +} WPDH; typedef struct WDB @@ -416,7 +416,7 @@ typedef struct buffer_status SANE_Byte block; SANE_Byte window_id; SANE_Byte reserved; - SANE_Byte bsa[3]; /* buffer space available */ + SANE_Byte bsa[3]; /* buffer space available */ SANE_Byte fdb[3]; /* filled data buffer */ } buffer_status; diff --git a/backend/net.c b/backend/net.c index 57889a224..df191922b 100644 --- a/backend/net.c +++ b/backend/net.c @@ -197,22 +197,22 @@ add_device (const char *name, Net_Device ** ndp) } else { - for (resp = res; resp != NULL; resp = resp->ai_next) - { - switch (resp->ai_family) - { - case AF_INET: - sin = (struct sockaddr_in *) resp->ai_addr; - sin->sin_port = sane_port; - break; -#ifdef ENABLE_IPV6 - case AF_INET6: - sin6 = (struct sockaddr_in6 *) resp->ai_addr; - sin6->sin6_port = sane_port; - break; -#endif /* ENABLE_IPV6 */ + for (resp = res; resp != NULL; resp = resp->ai_next) + { + switch (resp->ai_family) + { + case AF_INET: + sin = (struct sockaddr_in *) resp->ai_addr; + sin->sin_port = sane_port; + break; +#ifdef ENABLE_IPV6 + case AF_INET6: + sin6 = (struct sockaddr_in6 *) resp->ai_addr; + sin6->sin6_port = sane_port; + break; +#endif /* ENABLE_IPV6 */ } - } + } } } @@ -220,7 +220,7 @@ add_device (const char *name, Net_Device ** ndp) if (!nd) { DBG (1, "add_device: not enough memory for Net_Device struct\n"); - + freeaddrinfo (res); return SANE_STATUS_NO_MEM; } @@ -233,14 +233,14 @@ add_device (const char *name, Net_Device ** ndp) free(nd); return SANE_STATUS_NO_MEM; } - + nd->addr = res; nd->ctl = -1; nd->next = first_device; first_device = nd; - + if (ndp) *ndp = nd; DBG (2, "add_device: backend %s added\n", name); @@ -347,7 +347,7 @@ connect_dev (Net_Device * dev) i, addrp->ai_family); continue; } - + dev->ctl = socket (addrp->ai_family, SOCK_STREAM, 0); if (dev->ctl < 0) { @@ -577,15 +577,15 @@ fetch_options (Net_Scanner * s) { DBG (3, "fetch_options: creating %d local option descriptors\n", s->opt.num_options); - s->local_opt.desc = + s->local_opt.desc = malloc (s->opt.num_options * sizeof (s->local_opt.desc)); if (!s->local_opt.desc) { DBG (1, "fetch_options: couldn't malloc s->local_opt.desc\n"); return SANE_STATUS_NO_MEM; } - for (option_number = 0; - option_number < s->opt.num_options; + for (option_number = 0; + option_number < s->opt.num_options; option_number++) { s->local_opt.desc[option_number] = @@ -605,15 +605,15 @@ fetch_options (Net_Scanner * s) return SANE_STATUS_INVAL; } - DBG (3, "fetch_options: copying %d option descriptors\n", + DBG (3, "fetch_options: copying %d option descriptors\n", s->opt.num_options); - + for (option_number = 0; option_number < s->opt.num_options; option_number++) { memcpy (s->local_opt.desc[option_number], s->opt.desc[option_number], sizeof (SANE_Option_Descriptor)); } - + s->options_valid = 1; DBG (3, "fetch_options: %d options fetched\n", s->opt.num_options); return SANE_STATUS_GOOD; @@ -1082,13 +1082,13 @@ sane_init (SANE_Int * version_code, SANE_Auth_Callback authorize) /* add back the ":" that got removed by the strsep() */ host[strlen (host)] = ':'; /* host now holds the IPv6 address */ - + /* skip the ':' that could be after ] (avoids a call to strsep() */ if (next[0] == ':') next++; } - /* + /* * if the IPv6 is last in the list, the strsep() call in the while() * will return a string with the first char being '\0'. Skip it. */ @@ -1162,7 +1162,7 @@ sane_exit (void) if (dev->name) free ((void *) dev->name); -#ifdef NET_USES_AF_INDEP +#ifdef NET_USES_AF_INDEP if (dev->addr) freeaddrinfo(dev->addr); #endif /* NET_USES_AF_INDEP */ @@ -1309,7 +1309,7 @@ sane_get_devices (const SANE_Device *** device_list, SANE_Bool local_only) memset (mem, 0, sizeof (*dev) + len); full_name = mem + sizeof (*dev); - + #ifdef ENABLE_IPV6 if (IPv6 == SANE_TRUE) strcat (full_name, "["); @@ -1317,7 +1317,7 @@ sane_get_devices (const SANE_Device *** device_list, SANE_Bool local_only) strcat (full_name, dev->name); -#ifdef ENABLE_IPV6 +#ifdef ENABLE_IPV6 if (IPv6 == SANE_TRUE) strcat (full_name, "]"); #endif /* ENABLE_IPV6 */ @@ -1382,7 +1382,7 @@ sane_open (SANE_String_Const full_name, SANE_Handle * meta_handle) int need_auth; DBG (3, "sane_open(\"%s\")\n", full_name); - + #ifdef ENABLE_IPV6 /* * Check whether a numerical IPv6 host was specified @@ -1405,7 +1405,7 @@ sane_open (SANE_String_Const full_name, SANE_Handle * meta_handle) dev_name = strchr (tmp_name, ':'); #else /* !ENABLE_IPV6 */ - dev_name = strchr (full_name, ':'); + dev_name = strchr (full_name, ':'); #endif /* ENABLE_IPV6 */ if (dev_name) @@ -2153,7 +2153,7 @@ sane_read (SANE_Handle handle, SANE_Byte * data, SANE_Int max_length, { DBG (3, "sane_read: left_over from previous call, return " "immediately\n"); - /* return the byte, we've currently scanned; hang_over becomes + /* return the byte, we've currently scanned; hang_over becomes left_over */ *data = (SANE_Byte) left_over; left_over = -1; @@ -2171,7 +2171,7 @@ sane_read (SANE_Handle handle, SANE_Byte * data, SANE_Int max_length, if (s->bytes_remaining == 0) { /* boy, is this painful or what? */ - + DBG (4, "sane_read: reading packet length\n"); nread = read (s->data, s->reclen_buf + s->reclen_buf_offset, 4 - s->reclen_buf_offset); @@ -2232,7 +2232,7 @@ sane_read (SANE_Handle handle, SANE_Byte * data, SANE_Int max_length, max_length = s->bytes_remaining; nread = read (s->data, data, max_length); - + if (nread < 0) { DBG (2, "sane_read: error code %s\n", strerror (errno)); @@ -2261,7 +2261,7 @@ sane_read (SANE_Handle handle, SANE_Byte * data, SANE_Int max_length, /* special case: 1 byte scanned and hang_over */ if ((nread == 1) && (hang_over > -1)) { - /* return the byte, we've currently scanned; hang_over becomes + /* return the byte, we've currently scanned; hang_over becomes left_over */ left_over = hang_over; hang_over = -1; diff --git a/backend/niash_core.c b/backend/niash_core.c index b87f4f624..951ad6784 100644 --- a/backend/niash_core.c +++ b/backend/niash_core.c @@ -973,7 +973,7 @@ CircBufferGetLine (int iHandle, TDataPipe * p, unsigned char *pabLine, } -/* try to keep the number of transfers the same, but make them all +/* try to keep the number of transfers the same, but make them all as good as possible the same size to avoid cranking in critical situations */ diff --git a/backend/niash_core.h b/backend/niash_core.h index 9bd6b9169..fc0adbda4 100644 --- a/backend/niash_core.h +++ b/backend/niash_core.h @@ -124,7 +124,7 @@ STATIC SANE_Bool CircBufferGetLine (int iHandle, TDataPipe * p, unsigned char *pabLine, SANE_Bool iReversedHead); -/* returns false, when trying to read after end of buffer +/* returns false, when trying to read after end of buffer if fReturn==SANE_TRUE, the head will return automatically on an end of scan */ STATIC SANE_Bool diff --git a/backend/p5.c b/backend/p5.c index 30ab41e62..a2fa4ad2c 100644 --- a/backend/p5.c +++ b/backend/p5.c @@ -32,7 +32,7 @@ * \section sane_api SANE API * * \subsection sane_flow sane flow - SANE FLOW + SANE FLOW - sane_init() : initialize backend, attach scanners. - sane_get_devices() : query list of scanner devices, backend must probe for new devices. @@ -60,7 +60,7 @@ /** * Import directly the low level part needed to - * operate scanner. The alternative is to prefix all public functions + * operate scanner. The alternative is to prefix all public functions * with sanei_p5_ ,and have all the functions prototyped in * p5_device.h . */ @@ -72,7 +72,7 @@ static int init_count = 0; /** - * NULL terminated list of opened frontend sessions. Sessions are + * NULL terminated list of opened frontend sessions. Sessions are * inserted here on sane_open() and removed on sane_close(). */ static P5_Session *sessions = NULL; @@ -85,7 +85,7 @@ static P5_Session *sessions = NULL; static P5_Device *devices = NULL; /** - * NULL terminated list of devices needed by sane_get_devices(), since + * NULL terminated list of devices needed by sane_get_devices(), since * the result returned must stay consistent until next call. */ static const SANE_Device **devlist = 0; @@ -155,7 +155,7 @@ static P5_Config p5cfg; /** * Called by SANE initially. - * + * * From the SANE spec: * This function must be called before any other SANE function can be * called. The behavior of a SANE backend is undefined if this @@ -195,7 +195,7 @@ sane_init (SANE_Int * version_code, SANE_Auth_Callback authorize) /** * Called by SANE to find out about supported devices. - * + * * From the SANE spec: * This function can be used to query the list of devices that are * available. If the function executes successfully, it stores a @@ -208,7 +208,7 @@ sane_init (SANE_Int * version_code, SANE_Auth_Callback authorize) * returned (devices directly attached to the machine that SANE is * running on). If it is false, the device list includes all remote * devices that are accessible to the SANE library. - * + * * SANE does not require that this function is called before a * sane_open() call is performed. A device name may be specified * explicitly by a user which would make it unnecessary and @@ -239,7 +239,7 @@ sane_get_devices (const SANE_Device *** device_list, SANE_Bool local_only) /** * Since sane_get_devices() may be called repeatedly to detect new devices, - * the device detection must be run at each call. We are handling + * the device detection must be run at each call. We are handling * hot-plugging : we probe for devices plugged since sane_init() was called. */ probe_p5_devices (); @@ -327,7 +327,7 @@ sane_get_devices (const SANE_Device *** device_list, SANE_Bool local_only) * the name of the backend as the device name, in this case the first * available device will also be used. * @param name name of the device to open - * @param handle opaque pointer where to store the pointer of + * @param handle opaque pointer where to store the pointer of * the opened P5_Session * @return SANE_STATUS_GOOD on success */ @@ -383,7 +383,7 @@ sane_open (SANE_String_Const name, SANE_Handle * handle) /* device initialization */ if (device->initialized == SANE_FALSE) { - /** + /** * call to hardware initialization function here. */ device->fd = open_pp (device->name); @@ -690,7 +690,7 @@ get_option_value (P5_Session * s, int option, void *val) /** * Gets or sets an option value. - * + * * From the SANE spec: * This function is used to set or inquire the current value of option * number n of the device represented by handle h. The manner in which @@ -701,7 +701,7 @@ get_option_value (P5_Session * s, int option, void *val) * area pointed to by v must be big enough to hold the entire option * value (determined by member size in the corresponding option * descriptor). - * + * * The only exception to this rule is that when setting the value of a * string option, the string pointed to by argument v may be shorter * since the backend will stop reading the option value upon @@ -917,8 +917,8 @@ sane_start (SANE_Handle handle) /** @brief compute scan parameters * This function computes two set of parameters. The one for the SANE's standard - * and the other for the hardware. Among these parameters are the bit depth, total - * number of lines, total number of columns, extra line to read for data reordering... + * and the other for the hardware. Among these parameters are the bit depth, total + * number of lines, total number of columns, extra line to read for data reordering... * @param session fronted session to compute final scan parameters * @return SANE_STATUS_GOOD on success */ @@ -1086,7 +1086,7 @@ compute_parameters (P5_Session * session) * completion of that request. Outside of that window, the returned * values are best-effort estimates of what the parameters will be * when sane_start() gets invoked. - * + * * Calling this function before a scan has actually started allows, * for example, to get an estimate of how big the scanned image will * be. The parameters passed to this function are the handle of the @@ -1113,7 +1113,7 @@ sane_get_parameters (SANE_Handle handle, SANE_Parameters * params) /** * Called by SANE to read data. - * + * * From the SANE spec: * This function is used to read image data from the device * represented by handle h. Argument buf is a pointer to a memory @@ -1121,7 +1121,7 @@ sane_get_parameters (SANE_Handle handle, SANE_Parameters * params) * returned is stored in *len. A backend must set this to zero when * the call fails (i.e., when a status other than SANE_STATUS_GOOD is * returned). - * + * * When the call succeeds, the number of bytes returned can be * anywhere in the range from 0 to maxlen bytes. * @@ -1343,7 +1343,7 @@ sane_read (SANE_Handle handle, SANE_Byte * buf, /** - * Cancels a scan. + * Cancels a scan. * * From the SANE spec: * This function is used to immediately or as quickly as possible @@ -1393,7 +1393,7 @@ sane_cancel (SANE_Handle handle) /** * Ends use of the session. - * + * * From the SANE spec: * This function terminates the association between the device handle * passed in argument h and the device it represents. If the device is @@ -1476,7 +1476,7 @@ sane_close (SANE_Handle handle) /** * Terminates the backend. - * + * * From the SANE spec: * This function must be called to terminate use of a backend. The * function will first close all device handles that still might be @@ -1542,7 +1542,7 @@ sane_exit (void) /** @brief probe for all supported devices - * This functions tries to probe if any of the supported devices of + * This functions tries to probe if any of the supported devices of * the backend is present. Each detected device will be added to the * 'devices' list */ @@ -1609,10 +1609,10 @@ config_attach (SANEI_Config * config, const char *devname) * using an attach function with a config parameter */ config = config; - /* the devname has been processed and is ready to be used + /* the devname has been processed and is ready to be used * directly. The config struct contains all the configuration data for * the corresponding device. Since there is no ressources common to each - * backends regarding parallel port, we can directly call the attach + * backends regarding parallel port, we can directly call the attach * function. */ attach_p5 (devname, config); @@ -1661,7 +1661,7 @@ attach_p5 (const char *devicename, SANEI_Config * config) /** * do physical probe of the device here. In case the device is recognized, - * we allocate a device struct and give it options and model. + * we allocate a device struct and give it options and model. * Else we return SANE_STATUS_UNSUPPORTED. */ model = probe (devicename); @@ -1772,7 +1772,7 @@ init_options (struct P5_Session *session) SANE_CONSTRAINT_NONE; session->options[OPT_PREVIEW].value.w = SANE_FALSE; - /** @brief build resolution list + /** @brief build resolution list * We merge xdpi and ydpi list to provide only one resolution option control. * This is the most common case for backends and fronteds and give 'square' * pixels. The SANE API allow to control x and y dpi independantly, but this is diff --git a/backend/p5.h b/backend/p5.h index 10352a383..eae62f7f1 100644 --- a/backend/p5.h +++ b/backend/p5.h @@ -1,22 +1,22 @@ /* sane - Scanner Access Now Easy. Copyright (C) 2009-2012 stef.dev@free.fr - + 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. - + */ /** @file p5.h @@ -77,7 +77,7 @@ #include "p5_device.h" -/** +/** * List of all SANE options available for the frontend. Given a specific * device, some options may be set to inactive when the scanner model is * detected. The default values and the ranges they belong maybe also model @@ -95,7 +95,7 @@ enum P5_Options OPT_RESOLUTION, /** set scan's resolution */ /* @} */ - /** @name geometry group + /** @name geometry group * geometry related options */ /* @{ */ @@ -139,9 +139,9 @@ typedef struct P5_Option Option_Value value; /** option value */ } P5_Option; -/** +/** * Frontend session. This struct holds informations usefull for - * the functions defined in SANE's standard. Informations closer + * the functions defined in SANE's standard. Informations closer * to the hardware are in the P5_Device structure. There is * as many session structure than frontends using the backend. */ @@ -175,7 +175,7 @@ typedef struct P5_Session SANE_Bool non_blocking; /** - * SANE Parameters describes what the next or current scan will be + * SANE Parameters describes what the next or current scan will be * according to the current values of the options */ SANE_Parameters params; diff --git a/backend/p5_device.c b/backend/p5_device.c index 924144e78..4a257a7a0 100644 --- a/backend/p5_device.c +++ b/backend/p5_device.c @@ -1,4 +1,4 @@ -/** +/** * Description of the Primax PagePartner model */ static P5_Model pagepartner_model = { @@ -249,7 +249,7 @@ write_reg2 (int fd, uint8_t index, uint16_t value) static int read_data (int fd, uint8_t * data, int length) -{ +{ if(fd && data && length) return -1; return -1; @@ -463,7 +463,7 @@ setadresses (int fd, uint16_t start, uint16_t end) #ifdef HAVE_LINUX_PPDEV_H /** @brief open parallel port device * opens parallel port's low level device in EPP mode - * @param devicename nam of the real device or the special value 'auto' + * @param devicename nam of the real device or the special value 'auto' * @return file descriptor in cas of successn -1 otherwise */ static int @@ -532,7 +532,7 @@ open_pp (const char *devicename) } else { - /* + /* if (mode & PARPORT_MODE_ECP) { mode = IEEE1284_MODE_ECP; @@ -557,7 +557,7 @@ open_pp (const char *devicename) } /** close low level device - * release and close low level hardware device + * release and close low level hardware device */ static void close_pp (int fd) @@ -615,7 +615,7 @@ test_document (int fd) /** * return the amount of scanned data available * @param fd file descriptor to access scanner - * @return avaible byte number + * @return avaible byte number */ static int available_bytes (int fd) @@ -710,7 +710,7 @@ build_correction (P5_Device * dev, unsigned int dpi, unsigned int mode, * @param dev device describing hardware * @param mode color, gray level or lineart. * @param dpi desired scan resolution. - * @param startx coordinate of the first pixel to scan in + * @param startx coordinate of the first pixel to scan in * scan's resolution coordinate * @param width width of the scanned area * scanner's physical scan aread. diff --git a/backend/p5_device.h b/backend/p5_device.h index 4582256be..744fe1ced 100644 --- a/backend/p5_device.h +++ b/backend/p5_device.h @@ -1,17 +1,17 @@ /* sane - Scanner Access Now Easy. Copyright (C) 2009-2012 stef.dev@free.fr - + 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, @@ -83,8 +83,8 @@ typedef struct P5_Calibration_Data uint8_t white_data[MAX_SENSOR_PIXELS * 3]; } P5_Calibration_Data; -/** - * This structure describes a particular model which is handled by the backend. +/** + * This structure describes a particular model which is handled by the backend. * Contained data is immutable and is used to initalize the P5_Device * structure. */ @@ -178,7 +178,7 @@ typedef struct P5_Device struct P5_Device *next; /** - * Points to a structure that decribes model capabilities, geometry + * Points to a structure that decribes model capabilities, geometry * and default settings. */ P5_Model *model; @@ -203,16 +203,16 @@ typedef struct P5_Device /** * Configuration options for the device read from - * configuration file at attach time. This member is filled at + * configuration file at attach time. This member is filled at * attach time. */ P5_Config *config; /** @brief scan parameters * The scan done by the hardware can be different from the one at the SANE - * frontend session. For instance: + * frontend session. For instance: * - xdpy and ydpi may be different to accomodate hardware capabilites. - * - many CCD scanners need to scan more lines to correct the 'line + * - many CCD scanners need to scan more lines to correct the 'line * distance shift' effect. * - emulated modes (lineart from gray scan, or gray scan for color one) */ diff --git a/backend/pie-scsidef.h b/backend/pie-scsidef.h index d86a0c978..f80e1da3d 100644 --- a/backend/pie-scsidef.h +++ b/backend/pie-scsidef.h @@ -363,12 +363,12 @@ static scsiblk request_sense = { request_senseC, sizeof(request_senseC) }; #define get_RS_filemark(b) getbitfield(b + 0x02, 1, 7) #define get_RS_EOM(b) getbitfield(b + 0x02, 1, 6) #define get_RS_ILI(b) getbitfield(b + 0x02, 1, 5) -#define get_RS_sense_key(b) getbitfield(b + 0x02, 0x0f, 0) -#define get_RS_information(b) getnbyte(b+0x03, 4) +#define get_RS_sense_key(b) getbitfield(b + 0x02, 0x0f, 0) +#define get_RS_information(b) getnbyte(b+0x03, 4) #define get_RS_additional_length(b) b[0x07] #define get_RS_ASC(b) b[0x0c] #define get_RS_ASCQ(b) b[0x0d] -#define get_RS_SKSV(b) getbitfield(b+0x0f,1,7) /* valid */ +#define get_RS_SKSV(b) getbitfield(b+0x0f,1,7) /* valid */ #define get_RS_CD(b) getbitfield(b+0x0f,1,6) /* 1=CDB */ #define get_RS_field_pointer(b) getnbyte(b+0x10, 2) diff --git a/backend/pixma.c b/backend/pixma.c index d50e4cafe..57f8ecf0e 100644 --- a/backend/pixma.c +++ b/backend/pixma.c @@ -291,7 +291,7 @@ update_button_state (pixma_sane_t * ss, SANE_Int * info) } if (b1 != OVAL (opt_button_1).w || b2 != OVAL (opt_button_2).w) - { + { *info |= SANE_INFO_RELOAD_OPTIONS; OVAL (opt_button_1).w = b1; OVAL (opt_button_2).w = b2; @@ -642,9 +642,9 @@ control_option (pixma_sane_t * ss, SANE_Int n, SANE_Int dummy; /* info may be null, better to set a dummy here then test everywhere */ - if (info == NULL) + if (info == NULL) info = &dummy; - + cfg = pixma_get_config (ss->s); /* PDBG (pixma_dbg (4, "*control_option***** n = %u, a = %u\n", n, a)); */ @@ -697,7 +697,7 @@ control_option (pixma_sane_t * ss, SANE_Int n, ss->button_option_is_cached[ BUTTON_GROUP_INDEX(n) ] = 0; } - /* now deal with getting and setting of options */ + /* now deal with getting and setting of options */ switch (SOD (n).type) { case SANE_TYPE_BOOL: @@ -1441,7 +1441,7 @@ sane_control_option (SANE_Handle h, SANE_Int n, if (!ss->idle && a != SANE_ACTION_GET_VALUE) { PDBG (pixma_dbg (3, "Warning: !idle && !SANE_ACTION_GET_VALUE\n")); - if (ss->sp.source != PIXMA_SOURCE_ADF && ss->sp.source != PIXMA_SOURCE_ADFDUP) + if (ss->sp.source != PIXMA_SOURCE_ADF && ss->sp.source != PIXMA_SOURCE_ADFDUP) return SANE_STATUS_INVAL; } @@ -1799,7 +1799,7 @@ type int original type int target default 0 title Target operation type - cap soft_detect advanced + cap soft_detect advanced type int scan-resolution default 0 diff --git a/backend/pixma.h b/backend/pixma.h index d60785cac..f4a4f8007 100644 --- a/backend/pixma.h +++ b/backend/pixma.h @@ -104,7 +104,7 @@ typedef uint16_t uint16_t; typedef uint32_t uint32_t; #endif /* HAVE_STDINT_H */ -#ifdef HAVE_INTTYPES_H +#ifdef HAVE_INTTYPES_H # include /* available in ISO C99 */ #endif /* HAVE_INTTYPES_H */ @@ -278,7 +278,7 @@ struct pixma_scan_param_t * line_size >= depth / 8 * channels * w
* This field will be set by pixma_check_scan_param(). */ uint64_t line_size; - + /** Size in bytes of the whole image. * image_size = line_size * h
* This field will be set by pixma_check_scan_param(). */ @@ -310,7 +310,7 @@ struct pixma_scan_param_t unsigned x, y, w, h, xs, wx; /*@} */ - /** Flag indicating whether the offset correction for TPU scans + /** Flag indicating whether the offset correction for TPU scans * was already performed (to avoid repeated corrections). * Currently only used in pixma_mp810.c sub-driver */ unsigned tpu_offset_added; diff --git a/backend/pixma_bjnp.c b/backend/pixma_bjnp.c index fc4c50101..e14a4e26e 100644 --- a/backend/pixma_bjnp.c +++ b/backend/pixma_bjnp.c @@ -69,7 +69,7 @@ #include #endif -/* +/* * networking stuff */ #ifdef HAVE_SYS_SOCKET_H @@ -104,7 +104,7 @@ #ifndef SSIZE_MAX # define SSIZE_MAX LONG_MAX -#endif +#endif /* static data */ static bjnp_device_t device[BJNP_NO_DEVICES]; @@ -198,7 +198,7 @@ static int sa_is_equal( const bjnp_sockaddr_t * sa1, const bjnp_sockaddr_t * sa2 { return 1; } - } + } #ifdef ENABLE_IPV6 else if (sa1 -> addr.sa_family == AF_INET6 ) { @@ -207,18 +207,18 @@ static int sa_is_equal( const bjnp_sockaddr_t * sa1, const bjnp_sockaddr_t * sa2 { return 1; } - } + } #endif } - return 0; + return 0; } -static int +static int sa_size( const bjnp_sockaddr_t *sa) { switch (sa -> addr.sa_family) { - case AF_INET: + case AF_INET: return (sizeof(struct sockaddr_in) ); #ifdef ENABLE_IPV6 case AF_INET6: @@ -269,7 +269,7 @@ get_address_info ( const bjnp_sockaddr_t *addr, char * addr_string, int *port) *port = ntohs (addr->ipv6.sin6_port); } #endif - else + else { /* unknown address family, should not occur */ strcpy(addr_string, "Unknown address family"); @@ -455,7 +455,7 @@ bjnp_open_tcp (int devno) * Close this socket when starting another process... */ - fcntl (sock, F_SETFD, FD_CLOEXEC); + fcntl (sock, F_SETFD, FD_CLOEXEC); if (connect (sock, &(addr->addr), sa_size(device[devno].addr) )!= 0) @@ -510,9 +510,9 @@ split_uri (const char *devname, char *method, char *host, char *port, { /* literal IPv6 address */ - char *end_of_address = strchr(start, ']'); + char *end_of_address = strchr(start, ']'); - if ( ( end_of_address == NULL) || + if ( ( end_of_address == NULL) || ( (end_of_address[1] != ':') && (end_of_address[1] != '/' ) && (end_of_address[1] != '\0' )) || ( (end_of_address - start) >= BJNP_HOST_MAX ) ) { @@ -552,8 +552,8 @@ split_uri (const char *devname, char *method, char *host, char *port, else { char *end_of_port = strchr(start, '/'); - if (end_of_port == NULL) - { + if (end_of_port == NULL) + { next = '\0'; } else @@ -669,9 +669,9 @@ static int udp_command (const int dev_no, char *command, int cmd_len, char *response, int resp_len) { - /* + /* * send udp command to given device and recieve the response` - * returns: the legth of the response or -1 + * returns: the legth of the response or -1 */ int sockfd; struct timeval timeout; @@ -681,7 +681,7 @@ udp_command (const int dev_no, char *command, int cmd_len, char *response, fd_set fdset; struct BJNP_command *resp = (struct BJNP_command *) response; struct BJNP_command *cmd = (struct BJNP_command *) command; - + if ( (sockfd = bjnp_setup_udp_socket(dev_no) ) == -1 ) { PDBG (bjnp_dbg( LOG_CRIT, "udp_command: ERROR - Can not setup socket\n") ); @@ -712,7 +712,7 @@ udp_command (const int dev_no, char *command, int cmd_len, char *response, } while (((result = select (sockfd + 1, &fdset, NULL, NULL, &timeout)) <= 0) - && (errno == EINTR) && (attempt++ < BJNP_MAX_SELECT_ATTEMPTS) + && (errno == EINTR) && (attempt++ < BJNP_MAX_SELECT_ATTEMPTS) && resp-> seq_no != cmd->seq_no); if (result <= 0) @@ -780,7 +780,7 @@ get_scanner_id (const int dev_no, char *model) id = (struct IDENTITY *) resp_buf; if (device[dev_no].protocol == PROTOCOL_BJNP) - { + { id_len = MIN(ntohl( id-> cmd.payload_len ) - sizeof(id-> payload.bjnp.id_len), BJNP_IEEE1284_MAX); strncpy(scanner_id, id->payload.bjnp.id, id_len); scanner_id[id_len] = '\0'; @@ -815,7 +815,7 @@ get_scanner_name(const bjnp_sockaddr_t *scanner_sa, char *host) struct addrinfo *result; char ip_address[BJNP_HOST_MAX]; int port; - int error; + int error; int match = 0; int level; char service[64]; @@ -832,10 +832,10 @@ get_scanner_name(const bjnp_sockaddr_t *scanner_sa, char *host) /* do reverse name lookup, if hostname can not be found return ip-address */ - if( (error = getnameinfo( &(scanner_sa -> addr) , sa_size( scanner_sa), + if( (error = getnameinfo( &(scanner_sa -> addr) , sa_size( scanner_sa), host, BJNP_HOST_MAX , NULL, 0, NI_NAMEREQD) ) != 0 ) { - PDBG (bjnp_dbg(LOG_INFO, "get_scanner_name: Name for %s not found : %s\n", + PDBG (bjnp_dbg(LOG_INFO, "get_scanner_name: Name for %s not found : %s\n", ip_address, gai_strerror(error) ) ); strcpy(host, ip_address); return level; @@ -843,19 +843,19 @@ get_scanner_name(const bjnp_sockaddr_t *scanner_sa, char *host) else { sprintf(service, "%d", port); - /* some buggy routers return rubbish if reverse lookup fails, so + /* some buggy routers return rubbish if reverse lookup fails, so * we do a forward lookup on the received name to see if the result matches */ - if (getaddrinfo(host , service, NULL, &results) == 0) + if (getaddrinfo(host , service, NULL, &results) == 0) { result = results; - while (result != NULL) + while (result != NULL) { if(sa_is_equal( scanner_sa, (bjnp_sockaddr_t *)result-> ai_addr)) { /* found match, good */ - PDBG (bjnp_dbg (LOG_INFO, + PDBG (bjnp_dbg (LOG_INFO, "get_scanner_name: Forward lookup for %s succeeded, using as hostname\n", host)); match = 1; level = BJNP_ADDRESS_HAS_FQDN; @@ -865,15 +865,15 @@ get_scanner_name(const bjnp_sockaddr_t *scanner_sa, char *host) } freeaddrinfo(results); - if (match != 1) + if (match != 1) { - PDBG (bjnp_dbg (LOG_INFO, - "get_scanner_name: Forward lookup for %s succeeded, IP-address does not match, using IP-address %s instead\n", + PDBG (bjnp_dbg (LOG_INFO, + "get_scanner_name: Forward lookup for %s succeeded, IP-address does not match, using IP-address %s instead\n", host, ip_address)); strcpy (host, ip_address); } - } - else + } + else { /* forward lookup failed, use ip-address */ PDBG ( bjnp_dbg (LOG_INFO, "get_scanner_name: Forward lookup of %s failed, using IP-address", ip_address)); @@ -956,8 +956,8 @@ static int create_broadcast_socket( const bjnp_sockaddr_t * local_addr ) return sockfd; } -static int -prepare_socket(const char *if_name, const bjnp_sockaddr_t *local_sa, +static int +prepare_socket(const char *if_name, const bjnp_sockaddr_t *local_sa, const bjnp_sockaddr_t *broadcast_sa, bjnp_sockaddr_t * dest_sa) { /* @@ -975,7 +975,7 @@ prepare_socket(const char *if_name, const bjnp_sockaddr_t *local_sa, if ( local_sa == NULL ) { - PDBG (bjnp_dbg (LOG_DEBUG, + PDBG (bjnp_dbg (LOG_DEBUG, "prepare_socket: %s is not a valid IPv4 interface, skipping...\n", if_name)); return -1; @@ -994,7 +994,7 @@ prepare_socket(const char *if_name, const bjnp_sockaddr_t *local_sa, { /* not a valid interface */ - PDBG (bjnp_dbg (LOG_DEBUG, + PDBG (bjnp_dbg (LOG_DEBUG, "prepare_socket: %s is not a valid IPv4 interface, skipping...\n", if_name)); return -1; @@ -1008,7 +1008,7 @@ prepare_socket(const char *if_name, const bjnp_sockaddr_t *local_sa, /* we fill port when we send the broadcast */ dest_sa -> ipv4.sin_port = htons(0); - if ( (socket = create_broadcast_socket( &local_sa_copy) ) != -1) + if ( (socket = create_broadcast_socket( &local_sa_copy) ) != -1) { PDBG (bjnp_dbg (LOG_INFO, "prepare_socket: %s is IPv4 capable, sending broadcast, socket = %d\n", if_name, socket)); @@ -1030,7 +1030,7 @@ prepare_socket(const char *if_name, const bjnp_sockaddr_t *local_sa, { /* not a valid interface */ - PDBG (bjnp_dbg (LOG_DEBUG, + PDBG (bjnp_dbg (LOG_DEBUG, "prepare_socket: %s is not a valid IPv6 interface, skipping...\n", if_name)); return -1; @@ -1043,7 +1043,7 @@ prepare_socket(const char *if_name, const bjnp_sockaddr_t *local_sa, dest_sa -> ipv6.sin6_port = htons(0); inet_pton(AF_INET6, "ff02::1", dest_sa -> ipv6.sin6_addr.s6_addr); - if ( (socket = create_broadcast_socket( &local_sa_copy ) ) != -1) + if ( (socket = create_broadcast_socket( &local_sa_copy ) ) != -1) { PDBG (bjnp_dbg (LOG_INFO, "prepare_socket: %s is IPv6 capable, sending broadcast, socket = %d\n", if_name, socket)); @@ -1055,7 +1055,7 @@ prepare_socket(const char *if_name, const bjnp_sockaddr_t *local_sa, return -1; } } - } + } break; #endif @@ -1084,7 +1084,7 @@ bjnp_send_broadcast (int sockfd, const bjnp_sockaddr_t * broadcast_addr, int por if( dest_addr.addr.sa_family == AF_INET6) { dest_addr.ipv6.sin6_port = htons(port); - } + } #endif if ((num_bytes = sendto (sockfd, &cmd, size, 0, @@ -1104,7 +1104,7 @@ bjnp_send_broadcast (int sockfd, const bjnp_sockaddr_t * broadcast_addr, int por static void bjnp_finish_job (int devno) { -/* +/* * Signal end of scanjob to scanner */ @@ -1138,7 +1138,7 @@ bjnp_finish_job (int devno) static int bjnp_poll_scanner (int devno, char type,char *hostname, char *user, SANE_Byte *status, int size) { -/* +/* * send details of user to the scanner */ @@ -1149,7 +1149,7 @@ bjnp_poll_scanner (int devno, char type,char *hostname, char *user, SANE_Byte *s int buf_len; /* length of the whole command buffer */ struct POLL_DETAILS *poll; struct POLL_RESPONSE *response; - char user_host[256]; + char user_host[256]; time_t t; int user_host_len; @@ -1174,27 +1174,27 @@ bjnp_poll_scanner (int devno, char type,char *hostname, char *user, SANE_Byte *s len = 80; break; case 2: - poll->extensions.type2.dialog = htonl(device[devno].dialog); - charTo2byte(poll->extensions.type2.user_host, user_host, user_host_len); + poll->extensions.type2.dialog = htonl(device[devno].dialog); + charTo2byte(poll->extensions.type2.user_host, user_host, user_host_len); poll->extensions.type2.unknown_1 = htonl(0x14); - poll->extensions.type2.unknown_2 = htonl(0x10); + poll->extensions.type2.unknown_2 = htonl(0x10); t = time (NULL); - strftime (poll->extensions.type2.ascii_date, - sizeof (poll->extensions.type2.ascii_date), + strftime (poll->extensions.type2.ascii_date, + sizeof (poll->extensions.type2.ascii_date), "%Y%m%d%H%M%S", localtime (&t)); len = 116; break; case 5: - poll->extensions.type5.dialog = htonl(device[devno].dialog); - charTo2byte(poll->extensions.type5.user_host, user_host, user_host_len); + poll->extensions.type5.dialog = htonl(device[devno].dialog); + charTo2byte(poll->extensions.type5.user_host, user_host, user_host_len); poll->extensions.type5.unknown_1 = htonl(0x14); - poll->extensions.type5.key = htonl(device[devno].status_key); + poll->extensions.type5.key = htonl(device[devno].status_key); len = 100; break; default: PDBG (bjnp_dbg (LOG_INFO, "bjnp_poll_scanner: unknown packet type: %d\n", type)); return -1; - }; + }; /* we can only now set the header as we now know the length of the payload */ set_cmd_for_dev (devno, (struct BJNP_command *) cmd_buf, CMD_UDP_POLL, len); @@ -1218,7 +1218,7 @@ bjnp_poll_scanner (int devno, char type,char *hostname, char *user, SANE_Byte *s { return BJNP_RESTART_POLL; } - if ( (response -> result[2] & 0x80) != 0) + if ( (response -> result[2] & 0x80) != 0) { memcpy( status, response->status, size); PDBG( bjnp_dbg(LOG_INFO, "bjnp_poll_scanner: received button status!\n")); @@ -1234,7 +1234,7 @@ bjnp_poll_scanner (int devno, char type,char *hostname, char *user, SANE_Byte *s static void bjnp_send_job_details (int devno, char *hostname, char *user, char *title) { -/* +/* * send details of scanjob to scanner */ @@ -1277,7 +1277,7 @@ bjnp_send_job_details (int devno, char *hostname, char *user, char *title) static int bjnp_get_scanner_mac_address ( int devno, char *mac_address ) { -/* +/* * send discover to scanner */ @@ -1297,7 +1297,7 @@ bjnp_get_scanner_mac_address ( int devno, char *mac_address ) { PDBG (bjnp_dbg (LOG_DEBUG2, "bjnp_get_scanner_mac_address: Discover response:\n")); PDBG (bjnp_hexdump (LOG_DEBUG2, resp_buf, resp_len)); - u8tohex( mac_address, resp -> mac_addr, sizeof( resp -> mac_addr ) ); + u8tohex( mac_address, resp -> mac_addr, sizeof( resp -> mac_addr ) ); return 0; } return -1; @@ -1307,7 +1307,7 @@ static int bjnp_write (int devno, const SANE_Byte * buf, size_t count) { /* - * This function writes TCP data to the scanner. + * This function writes TCP data to the scanner. * Returns: number of bytes written to the scanner */ int sent_bytes; @@ -1355,9 +1355,9 @@ static int bjnp_send_read_request (int devno) { /* - * This function reads responses from the scanner. + * This function reads responses from the scanner. * Returns: 0 on success, else -1 - * + * */ int sent_bytes; int terrno; @@ -1398,8 +1398,8 @@ bjnp_recv_header (int devno, size_t *payload_size ) /* * This function receives the response header to bjnp commands. * devno device number - * size: return value for data size returned by scanner - * Returns: + * size: return value for data size returned by scanner + * Returns: * SANE_STATUS_IO_ERROR when any IO error occurs * SANE_STATUS_GOOD in case no errors were encountered */ @@ -1443,7 +1443,7 @@ bjnp_recv_header (int devno, size_t *payload_size ) { terrno = errno; PDBG (bjnp_dbg (LOG_CRIT, - "bjnp_recv_header: ERROR - could not read response header (select timed out after %d ms)!\n", + "bjnp_recv_header: ERROR - could not read response header (select timed out after %d ms)!\n", device[devno].bjnp_timeout ) ); errno = terrno; return SANE_STATUS_IO_ERROR; @@ -1512,7 +1512,7 @@ bjnp_init_device_structure(int dn, bjnp_sockaddr_t *sa, bjnp_protocol_defs_t *pr device[dn].open = 0; #ifdef PIXMA_BJNP_USE_STATUS - device[dn].polling_status = BJNP_POLL_STOPPED; + device[dn].polling_status = BJNP_POLL_STOPPED; device[dn].dialog = 0; device[dn].status_key = 0; #endif @@ -1521,7 +1521,7 @@ bjnp_init_device_structure(int dn, bjnp_sockaddr_t *sa, bjnp_protocol_defs_t *pr device[dn].tcp_socket = -1; device[dn].addr = (bjnp_sockaddr_t *) malloc(sizeof ( bjnp_sockaddr_t) ); - memset( device[dn].addr, 0, sizeof( bjnp_sockaddr_t ) ); + memset( device[dn].addr, 0, sizeof( bjnp_sockaddr_t ) ); memcpy(device[dn].addr, sa, sa_size((bjnp_sockaddr_t *)sa) ); device[dn].address_level = get_scanner_name(sa, name); device[dn].session_id = 0; @@ -1530,7 +1530,7 @@ bjnp_init_device_structure(int dn, bjnp_sockaddr_t *sa, bjnp_protocol_defs_t *pr device[dn].bjnp_min_timeout = min_timeout; device[dn].scanner_data_left = 0; device[dn].last_cmd = 0; - device[dn].blocksize = BJNP_BLOCKSIZE_START; + device[dn].blocksize = BJNP_BLOCKSIZE_START; device[dn].last_block = 0; /* fill mac_address */ @@ -1620,7 +1620,7 @@ bjnp_recv_data (int devno, SANE_Byte * buffer, size_t start_pos, size_t * len) { terrno = errno; PDBG (bjnp_dbg (LOG_CRIT, - "bjnp_recv_data: ERROR - could not read response payload (select timed out after %d ms)!\n", + "bjnp_recv_data: ERROR - could not read response payload (select timed out after %d ms)!\n", device[devno].bjnp_timeout) ); errno = terrno; *len = 0; @@ -1646,10 +1646,10 @@ bjnp_recv_data (int devno, SANE_Byte * buffer, size_t start_pos, size_t * len) } static BJNP_Status -bjnp_allocate_device (SANE_String_Const devname, +bjnp_allocate_device (SANE_String_Const devname, SANE_Int * dn, char *resulting_host) { - char method[BJNP_METHOD_MAX]; + char method[BJNP_METHOD_MAX]; char host[BJNP_HOST_MAX]; char port[BJNP_PORT_MAX] = ""; char args[BJNP_ARGS_MAX]; @@ -1697,7 +1697,7 @@ bjnp_allocate_device (SANE_String_Const devname, { sprintf( port, "%d", protocol_defs->default_port ); } - + hints.ai_flags = 0; #ifdef ENABLE_IPV6 hints.ai_family = AF_UNSPEC; @@ -1712,7 +1712,7 @@ bjnp_allocate_device (SANE_String_Const devname, hints.ai_next = NULL; result = getaddrinfo (host, port, &hints, &res ); - if (result != 0 ) + if (result != 0 ) { PDBG (bjnp_dbg (LOG_CRIT, "bjnp_allocate_device: ERROR - Cannot resolve host: %s port %s\n", host, port)); return SANE_STATUS_INVAL; @@ -1724,7 +1724,7 @@ bjnp_allocate_device (SANE_String_Const devname, while( cur != NULL) { /* create a new device structure for this address */ - + if (bjnp_no_devices == BJNP_NO_DEVICES) { PDBG (bjnp_dbg @@ -1743,14 +1743,14 @@ bjnp_allocate_device (SANE_String_Const devname, for (i = 0; i < bjnp_no_devices; i++) { - /* Check if found the scanner before, if so we use the best address + /* Check if found the scanner before, if so we use the best address * but still make sure the scanner is listed only once. - * We check for matching addresses as wel as matching mac_addresses as + * We check for matching addresses as wel as matching mac_addresses as * an IPv6 host can have multiple adresses */ if ( strcmp( device[i].mac_address, device[bjnp_no_devices].mac_address ) == 0 ) { - if ( device[i].address_level < device[bjnp_no_devices].address_level ) + if ( device[i].address_level < device[bjnp_no_devices].address_level ) { /* use the new address instead as it is better */ free (device[i].addr); @@ -1768,7 +1768,7 @@ bjnp_allocate_device (SANE_String_Const devname, device[i].bjnp_timeout = device[bjnp_no_devices].bjnp_min_timeout; device[i].bjnp_min_timeout = device[bjnp_no_devices].bjnp_min_timeout; } - freeaddrinfo(res); + freeaddrinfo(res); *dn = i; bjnp_free_device_structure( bjnp_no_devices); return BJNP_STATUS_ALREADY_ALLOCATED; @@ -1795,8 +1795,8 @@ bjnp_allocate_device (SANE_String_Const devname, return BJNP_STATUS_GOOD; } -static void add_scanner(SANE_Int *dev_no, - const char *uri, +static void add_scanner(SANE_Int *dev_no, + const char *uri, SANE_Status (*attach_bjnp) (SANE_String_Const devname, SANE_String_Const makemodel, @@ -1816,7 +1816,7 @@ static void add_scanner(SANE_Int *dev_no, case BJNP_STATUS_GOOD: if (get_scanner_id (*dev_no, makemodel) != 0) { - PDBG (bjnp_dbg (LOG_CRIT, "add_scanner: ERROR - Cannot read scanner make & model: %s\n", + PDBG (bjnp_dbg (LOG_CRIT, "add_scanner: ERROR - Cannot read scanner make & model: %s\n", uri)); } else @@ -1889,7 +1889,7 @@ sanei_bjnp_init (void) bjnp_no_devices = 0; } -/** +/** * Find devices that implement the bjnp protocol * * The function attach is called for every device which has been found. @@ -1911,7 +1911,7 @@ sanei_bjnp_find_devices (const char **conf_devices, int numbytes = 0; struct BJNP_command cmd; unsigned char resp_buf[2048]; - struct DISCOVER_RESPONSE *disc_resp = ( struct DISCOVER_RESPONSE *) & resp_buf; + struct DISCOVER_RESPONSE *disc_resp = ( struct DISCOVER_RESPONSE *) & resp_buf; int socket_fd[BJNP_SOCK_MAX]; int no_sockets; int i; @@ -1921,19 +1921,19 @@ sanei_bjnp_find_devices (const char **conf_devices, fd_set fdset; fd_set active_fdset; struct timeval timeout; - char scanner_host[256]; + char scanner_host[256]; char uri[256]; int dev_no; int port; int timeout_default = BJNP_TIMEOUT_DEFAULT; bjnp_sockaddr_t broadcast_addr[BJNP_SOCK_MAX]; - bjnp_sockaddr_t scanner_sa; + bjnp_sockaddr_t scanner_sa; socklen_t socklen; bjnp_protocol_defs_t *protocol_defs; memset( broadcast_addr, 0, sizeof( broadcast_addr) ); memset( &scanner_sa, 0 ,sizeof( scanner_sa ) ); - PDBG (bjnp_dbg (LOG_INFO, "sanei_bjnp_find_devices, pixma backend version: %d.%d.%d\n", + PDBG (bjnp_dbg (LOG_INFO, "sanei_bjnp_find_devices, pixma backend version: %d.%d.%d\n", PIXMA_VERSION_MAJOR, PIXMA_VERSION_MINOR, PIXMA_VERSION_BUILD)); bjnp_no_devices = 0; @@ -1954,7 +1954,7 @@ sanei_bjnp_find_devices (const char **conf_devices, timeout_default = atoi(conf_devices[i] + strlen("bjnp-timeout=") ); if (timeout_default < BJNP_TIMEOUT_DEFAULT) { - timeout_default = BJNP_TIMEOUT_DEFAULT; + timeout_default = BJNP_TIMEOUT_DEFAULT; } PDBG ( bjnp_dbg (LOG_DEBUG, "Set new default timeout value: %d ms.", timeout_default)); @@ -1988,10 +1988,10 @@ sanei_bjnp_find_devices (const char **conf_devices, interface = interfaces; while ((no_sockets < BJNP_SOCK_MAX) && (interface != NULL)) { - if ( ! (interface -> ifa_flags & IFF_POINTOPOINT) && - ( (socket_fd[no_sockets] = - prepare_socket( interface -> ifa_name, - (bjnp_sockaddr_t *) interface -> ifa_addr, + if ( ! (interface -> ifa_flags & IFF_POINTOPOINT) && + ( (socket_fd[no_sockets] = + prepare_socket( interface -> ifa_name, + (bjnp_sockaddr_t *) interface -> ifa_addr, (bjnp_sockaddr_t *) interface -> ifa_broadaddr, &broadcast_addr[no_sockets] ) ) != -1 ) ) { @@ -2004,7 +2004,7 @@ sanei_bjnp_find_devices (const char **conf_devices, no_sockets++; } interface = interface->ifa_next; - } + } freeifaddrs (interfaces); } #else @@ -2022,10 +2022,10 @@ sanei_bjnp_find_devices (const char **conf_devices, bc_addr.ipv4.sin_port = htons(0); bc_addr.ipv4.sin_addr.s_addr = htonl (INADDR_BROADCAST); - socket_fd[no_sockets] = prepare_socket( "any_interface", - &local, - &bc_addr, - &broadcast_addr[no_sockets] ); + socket_fd[no_sockets] = prepare_socket( "any_interface", + &local, + &bc_addr, + &broadcast_addr[no_sockets] ); if (socket_fd[no_sockets] >= 0) { FD_SET (socket_fd[no_sockets], &fdset); @@ -2039,10 +2039,10 @@ sanei_bjnp_find_devices (const char **conf_devices, local.ipv6.sin6_family = AF_INET6; local.ipv6.sin6_addr = in6addr_any; - socket_fd[no_sockets] = prepare_socket( "any_interface", - &local, + socket_fd[no_sockets] = prepare_socket( "any_interface", + &local, NULL, - &broadcast_addr[no_sockets] ); + &broadcast_addr[no_sockets] ); if (socket_fd[no_sockets] >= 0) { FD_SET (socket_fd[no_sockets], &fdset); @@ -2052,7 +2052,7 @@ sanei_bjnp_find_devices (const char **conf_devices, } no_sockets++; } -#endif +#endif } #endif @@ -2065,7 +2065,7 @@ sanei_bjnp_find_devices (const char **conf_devices, while(bjnp_protocol_defs[j].protocol_version != PROTOCOL_NONE) { set_cmd_from_string (bjnp_protocol_defs[j].proto_string, &cmd, CMD_UDP_DISCOVER, 0); - bjnp_send_broadcast ( socket_fd[i], &broadcast_addr[i], + bjnp_send_broadcast ( socket_fd[i], &broadcast_addr[i], bjnp_protocol_defs[j].default_port, cmd, sizeof (cmd)); j++; } @@ -2092,7 +2092,7 @@ sanei_bjnp_find_devices (const char **conf_devices, { socklen = sizeof(scanner_sa); if ((numbytes = - recvfrom (socket_fd[i], resp_buf, sizeof (resp_buf), 0, + recvfrom (socket_fd[i], resp_buf, sizeof (resp_buf), 0, &(scanner_sa.addr), &socklen ) ) == -1) { PDBG (bjnp_dbg @@ -2114,7 +2114,7 @@ sanei_bjnp_find_devices (const char **conf_devices, char bjnp_id[5]; strncpy(bjnp_id, disc_resp-> response.BJNP_id, 4); bjnp_id[4] = '\0'; - PDBG (bjnp_dbg (LOG_INFO, + PDBG (bjnp_dbg (LOG_INFO, "sanei_find_devices: Invalid discover response! Length = %d, Id = %s\n", numbytes, bjnp_id ) ); break; @@ -2135,7 +2135,7 @@ sanei_bjnp_find_devices (const char **conf_devices, sprintf (uri, "%s://%s:%d/timeout=%d", protocol_defs->method_string, scanner_host, port, timeout_default); - add_scanner( &dev_no, uri, attach_bjnp, pixma_devices); + add_scanner( &dev_no, uri, attach_bjnp, pixma_devices); } } @@ -2154,9 +2154,9 @@ sanei_bjnp_find_devices (const char **conf_devices, /** Open a BJNP device. * * The device is opened by its name devname and the device number is - * returned in dn on success. + * returned in dn on success. * - * Device names consist of an URI + * Device names consist of an URI * Where: * type = bjnp * hostname = resolvable name or IP-address @@ -2182,13 +2182,13 @@ sanei_bjnp_open (SANE_String_Const devname, SANE_Int * dn) result = bjnp_allocate_device (devname, dn, NULL); if ( (result != BJNP_STATUS_GOOD) && (result != BJNP_STATUS_ALREADY_ALLOCATED ) ) { - return SANE_STATUS_INVAL; + return SANE_STATUS_INVAL; } return SANE_STATUS_GOOD; } /** Close a BJNP device. - * + * * @param dn device number */ @@ -2274,7 +2274,7 @@ sanei_bjnp_set_timeout (SANE_Int devno, SANE_Int timeout) * @param buffer buffer to store read data in * @param size size of the data * - * @return + * @return * - SANE_STATUS_GOOD - on succes * - SANE_STATUS_EOF - if zero bytes have been read * - SANE_STATUS_IO_ERROR - if an error occured during the read @@ -2288,7 +2288,7 @@ sanei_bjnp_read_bulk (SANE_Int dn, SANE_Byte * buffer, size_t * size) SANE_Status result; SANE_Status error; size_t recvd; - size_t read_size; + size_t read_size; size_t read_size_max; size_t requested; @@ -2300,7 +2300,7 @@ sanei_bjnp_read_bulk (SANE_Int dn, SANE_Byte * buffer, size_t * size) requested = *size; PDBG (bjnp_dbg - (LOG_DEBUG, "bjnp_read_bulk: 0x%lx = %ld bytes available at start\n", + (LOG_DEBUG, "bjnp_read_bulk: 0x%lx = %ld bytes available at start\n", (unsigned long) device[dn].scanner_data_left, (unsigned long) device[dn].scanner_data_left ) ); @@ -2309,7 +2309,7 @@ sanei_bjnp_read_bulk (SANE_Int dn, SANE_Byte * buffer, size_t * size) PDBG (bjnp_dbg (LOG_DEBUG, "bjnp_read_bulk: Already received 0x%lx = %ld bytes, backend requested 0x%lx = %ld bytes\n", - (unsigned long) recvd, (unsigned long) recvd, + (unsigned long) recvd, (unsigned long) recvd, (unsigned long) requested, (unsigned long)requested )); /* Check first if there is data in flight from the scanner */ @@ -2332,7 +2332,7 @@ sanei_bjnp_read_bulk (SANE_Int dn, SANE_Byte * buffer, size_t * size) *size = recvd; return SANE_STATUS_IO_ERROR; } - /* correct blocksize if applicable */ + /* correct blocksize if applicable */ device[dn].blocksize = MAX (device[dn].blocksize, device[dn].scanner_data_left); @@ -2341,7 +2341,7 @@ sanei_bjnp_read_bulk (SANE_Int dn, SANE_Byte * buffer, size_t * size) /* the scanner will not react at all to a read request, when no more data is available */ /* we now determine end of data by comparing the payload size to the maximun blocksize */ /* this block is shorter than blocksize, so after this block we are done */ - + device[dn].last_block = 1; } } @@ -2358,9 +2358,9 @@ sanei_bjnp_read_bulk (SANE_Int dn, SANE_Byte * buffer, size_t * size) PDBG (bjnp_dbg (LOG_DEBUG, "bjnp_read_bulk: Try to read 0x%lx = %ld (of max 0x%lx = %ld) bytes\n", - (unsigned long) read_size_max, (unsigned long) read_size_max, - (unsigned long) device[dn].scanner_data_left, + (unsigned long) read_size_max, + (unsigned long) device[dn].scanner_data_left, (unsigned long) device[dn].scanner_data_left) ); result = bjnp_recv_data (dn, buffer , recvd, &read_size); @@ -2369,14 +2369,14 @@ sanei_bjnp_read_bulk (SANE_Int dn, SANE_Byte * buffer, size_t * size) *size = recvd; return SANE_STATUS_IO_ERROR; } - PDBG (bjnp_dbg (LOG_DEBUG, "bjnp_read_bulk: Expected at most %ld bytes, received this time: %ld\n", + PDBG (bjnp_dbg (LOG_DEBUG, "bjnp_read_bulk: Expected at most %ld bytes, received this time: %ld\n", read_size_max, read_size) ); device[dn].scanner_data_left = device[dn].scanner_data_left - read_size; recvd = recvd + read_size; } - PDBG (bjnp_dbg (LOG_DEBUG, "bjnp_read_bulk: %s: Returning %ld bytes, backend expexts %ld\n", + PDBG (bjnp_dbg (LOG_DEBUG, "bjnp_read_bulk: %s: Returning %ld bytes, backend expexts %ld\n", (recvd == *size)? "OK": "NOTICE",recvd, *size ) ); *size = recvd; if ( *size == 0 ) @@ -2393,7 +2393,7 @@ sanei_bjnp_read_bulk (SANE_Int dn, SANE_Byte * buffer, size_t * size) * @param buffer buffer to write to device * @param size size of the data * - * @return + * @return * - SANE_STATUS_GOOD - on succes * - SANE_STATUS_IO_ERROR - if an error occured during the write * - SANE_STATUS_INVAL - on every other error @@ -2466,7 +2466,7 @@ sanei_bjnp_write_bulk (SANE_Int dn, const SANE_Byte * buffer, size_t * size) * @param buffer buffer to store read data in * @param size size of the data * - * @return + * @return * - SANE_STATUS_GOOD - on succes * - SANE_STATUS_EOF - if zero bytes have been read * - SANE_STATUS_IO_ERROR - if an error occured during the read @@ -2491,7 +2491,7 @@ sanei_bjnp_read_int (SANE_Int dn, SANE_Byte * buffer, size_t * size) int resp_len; int timeout; int seconds; - + PDBG (bjnp_dbg (LOG_INFO, "bjnp_read_int(%d, bufferptr, 0x%lx = %ld):\n", dn, (unsigned long) *size, (unsigned long) *size)); @@ -2523,7 +2523,7 @@ sanei_bjnp_read_int (SANE_Int dn, SANE_Byte * buffer, size_t * size) case BJNP_POLL_STARTED: /* we use only seonds accuracy between poll attempts */ timeout = device[dn].bjnp_timeout /1000; - + do { if ( (resp_len = bjnp_poll_scanner (dn, 2, hostname, getusername (), buffer, *size ) ) < 0 ) diff --git a/backend/pixma_bjnp.h b/backend/pixma_bjnp.h index 998c331c3..a27082c87 100644 --- a/backend/pixma_bjnp.h +++ b/backend/pixma_bjnp.h @@ -43,7 +43,7 @@ If you do not wish that, delete this exception notice. */ /** @file sanei_bjnp.h - * This file provides a generic BJNP interface. + * This file provides a generic BJNP interface. */ #ifndef sanei_bjnp_h @@ -65,7 +65,7 @@ extern void sanei_bjnp_init (void); /** Find scanners responding to a BJNP broadcast. * - * The function sanei_bjnp_attach is called for every device which has + * The function sanei_bjnp_attach is called for every device which has * been found. * Serial is the address of the scanner in human readable form of max * SERIAL_MAX characters @@ -91,9 +91,9 @@ sanei_bjnp_find_devices (const char **conf_devices, /** Open a BJNP device. * * The device is opened by its name devname and the device number is - * returned in dn on success. + * returned in dn on success. * - * Device names consist of an URI + * Device names consist of an URI * Where: * method = bjnp * hostname = resolvable name or IP-address @@ -112,7 +112,7 @@ sanei_bjnp_find_devices (const char **conf_devices, extern SANE_Status sanei_bjnp_open (SANE_String_Const devname, SANE_Int * dn); /** Close a BJNP device. - * + * * @param dn device number */ @@ -133,7 +133,7 @@ extern SANE_Status sanei_bjnp_activate (SANE_Int dn); extern SANE_Status sanei_bjnp_deactivate (SANE_Int dn); /** Set the libbjnp timeout for bulk and interrupt reads. - * + * * @param devno device number * @param timeout the new timeout in ms */ @@ -152,7 +152,7 @@ extern void sanei_bjnp_set_timeout (SANE_Int devno, SANE_Int timeout); * @param buffer buffer to store read data in * @param size size of the data * - * @return + * @return * - SANE_STATUS_GOOD - on succes * - SANE_STATUS_EOF - if zero bytes have been read * - SANE_STATUS_IO_ERROR - if an error occured during the read @@ -171,7 +171,7 @@ sanei_bjnp_read_bulk (SANE_Int dn, SANE_Byte * buffer, size_t * size); * @param buffer buffer to write to device * @param size size of the data * - * @return + * @return * - SANE_STATUS_GOOD - on succes * - SANE_STATUS_IO_ERROR - if an error occured during the write * - SANE_STATUS_INVAL - on every other error @@ -188,7 +188,7 @@ sanei_bjnp_write_bulk (SANE_Int dn, const SANE_Byte * buffer, size_t * size); * @param buffer buffer to store read data in * @param size size of the data * - * @return + * @return * - SANE_STATUS_GOOD - on succes * - SANE_STATUS_EOF - if zero bytes have been read * - SANE_STATUS_IO_ERROR - if an error occured during the read diff --git a/backend/pixma_bjnp_private.h b/backend/pixma_bjnp_private.h index 9ecc6aed5..f5e40d1f3 100644 --- a/backend/pixma_bjnp_private.h +++ b/backend/pixma_bjnp_private.h @@ -1,5 +1,5 @@ /* SANE - Scanner Access Now Easy. - + Copyright (C) 2008 by Louis Lagendijk This file is part of the SANE package. @@ -51,13 +51,13 @@ If you do not wish that, delete this exception notice. */ -/* - * BJNP definitions +/* + * BJNP definitions */ /* selection of options */ /* This works now, disable when it gives you problems */ -#define PIXMA_BJNP_USE_STATUS 1 +#define PIXMA_BJNP_USE_STATUS 1 /* sizes */ @@ -116,14 +116,14 @@ typedef enum bjnp_port_e BJNP_PORT_4 = 8614 } bjnp_port_t; -typedef enum +typedef enum { PROTOCOL_BJNP = 0, PROTOCOL_MFNP = 1, PROTOCOL_NONE =2 } bjnp_protocol_t; -typedef struct +typedef struct { bjnp_protocol_t protocol_version; int default_port; @@ -131,7 +131,7 @@ typedef struct char * method_string; } bjnp_protocol_defs_t; -bjnp_protocol_defs_t bjnp_protocol_defs[] = +bjnp_protocol_defs_t bjnp_protocol_defs[] = { {PROTOCOL_BJNP, BJNP_PORT_SCAN,"BJNP", "bjnp"}, {PROTOCOL_MFNP, MFNP_PORT_SCAN,"MFNP", "mfnp"}, @@ -194,7 +194,7 @@ struct __attribute__ ((__packed__)) DISCOVER_RESPONSE unsigned char ipv4_addr[4]; } ipv4; struct __attribute__ ((__packed__)) { - unsigned char ipv6_addr_1[16]; + unsigned char ipv6_addr_1[16]; unsigned char ipv6_addr_2[16]; } ipv6; } addresses; @@ -227,7 +227,7 @@ struct __attribute__ ((__packed__)) POLL_DETAILS char empty1[6]; /* 0 */ char user_host[64]; /* unicode user hostname */ uint64_t emtpy2; /* 0 */ - } type1; /* length = 80 */ + } type1; /* length = 80 */ struct __attribute__ ((__packed__)) { uint16_t empty_1; /* 00 00 */ @@ -256,7 +256,7 @@ struct __attribute__ ((__packed__)) POLL_DETAILS struct __attribute__ ((__packed__)) POLL_RESPONSE { struct BJNP_command cmd; /* command header */ - + unsigned char result[4]; /* unknown stuff, result[2] = 80 -> status is available*/ /* result[8] is dialog, size? */ uint32_t dialog; /* to be returned in next request */ @@ -270,7 +270,7 @@ struct __attribute__ ((__packed__)) POLL_RESPONSE struct __attribute__ ((__packed__)) IDENTITY { struct BJNP_command cmd; - union __attribute__ ((__packed__)) + union __attribute__ ((__packed__)) { struct __attribute__ ((__packed__)) payload_s { @@ -343,7 +343,7 @@ typedef enum typedef struct device_s { int open; /* connection to scanner is opened */ - + /* protocol version */ int protocol; char *protocol_string; diff --git a/backend/pixma_imageclass.c b/backend/pixma_imageclass.c index 347bfa3c6..fa48bd95f 100644 --- a/backend/pixma_imageclass.c +++ b/backend/pixma_imageclass.c @@ -351,7 +351,7 @@ read_image_block (pixma_t * s, uint8_t * data, unsigned size) iclass_t *mf = (iclass_t *) s->subdriver; int error; unsigned maxchunksize, chunksize, count = 0; - + maxchunksize = MAX_CHUNK_SIZE * ((mf->generation >= 2 || s->cfg->pid == MF4600_PID || s->cfg->pid == MF6500_PID || @@ -704,7 +704,7 @@ iclass_fill_buffer (pixma_t * s, pixma_imagebuf_t * ib) } first_block_size = 0; - error = request_image_block (s, 4, &info, &block_size, + error = request_image_block (s, 4, &info, &block_size, mf->blkptr + mf->blk_len, &first_block_size); /* add current block to remainder of previous */ mf->blk_len += first_block_size; diff --git a/backend/pixma_io.h b/backend/pixma_io.h index 9dc1afb61..29bb38d72 100644 --- a/backend/pixma_io.h +++ b/backend/pixma_io.h @@ -91,7 +91,7 @@ void pixma_io_cleanup (void); * array of pixma_config_t which is terminated by setting * pixma_config_t::name to \c NULL. * \return Number of devices found */ -unsigned pixma_collect_devices (const char ** conf_devices, +unsigned pixma_collect_devices (const char ** conf_devices, const struct pixma_config_t *const pixma_devices[]); diff --git a/backend/pixma_io_sanei.c b/backend/pixma_io_sanei.c index 8eec88365..963b8ea96 100644 --- a/backend/pixma_io_sanei.c +++ b/backend/pixma_io_sanei.c @@ -106,9 +106,9 @@ get_scanner_info (unsigned devnr) return si; } -static const struct pixma_config_t *lookup_scanner(const char *makemodel, +static const struct pixma_config_t *lookup_scanner(const char *makemodel, const struct pixma_config_t *const pixma_devices[]) -{ +{ int i; const struct pixma_config_t *cfg; char *match; @@ -120,12 +120,12 @@ static const struct pixma_config_t *lookup_scanner(const char *makemodel, { /* loop through devices in class */ if ((match = strcasestr (makemodel, cfg->model)) != NULL) - { + { /* possible match found, make sure it is not a partial match */ /* MP600 and MP600R are different models! */ /* some models contain ranges, so check for a '-' too */ - if ((match[strlen(cfg->model)] == ' ') || + if ((match[strlen(cfg->model)] == ' ') || (match[strlen(cfg->model)] == '\0') || (match[strlen(cfg->model)] == '-')) { @@ -159,8 +159,8 @@ attach (SANE_String_Const devname) static SANE_Status -attach_bjnp (SANE_String_Const devname, SANE_String_Const makemodel, - SANE_String_Const serial, +attach_bjnp (SANE_String_Const devname, SANE_String_Const makemodel, + SANE_String_Const serial, const struct pixma_config_t *const pixma_devices[]) { scanner_info_t *si; @@ -417,7 +417,7 @@ pixma_connect (unsigned devnr, pixma_io_t ** handle) error = map_error (sanei_bjnp_open (si->devname, &dev)); else error = map_error (sanei_usb_open (si->devname, &dev)); - + if (error < 0) return error; io = (pixma_io_t *) calloc (1, sizeof (*io)); @@ -425,7 +425,7 @@ pixma_connect (unsigned devnr, pixma_io_t ** handle) { if (si -> interface == INT_BJNP) sanei_bjnp_close (dev); - else + else sanei_usb_close (dev); return PIXMA_ENOMEM; } diff --git a/backend/pixma_mp150.c b/backend/pixma_mp150.c index dca0965aa..c05578924 100644 --- a/backend/pixma_mp150.c +++ b/backend/pixma_mp150.c @@ -69,7 +69,7 @@ if ((error = (x)) < 0) \ return error; \ } while(0) - + #define WAIT_INTERRUPT(x) do { \ error = handle_interrupt (s, x); \ if (s->cancel) \ @@ -441,7 +441,7 @@ static int send_cmd_start_calibrate_ccd_3 (pixma_t * s) { mp150_t *mp = (mp150_t *) s->subdriver; - + pixma_newcmd (&mp->cb, cmd_start_calibrate_ccd_3, 0, 0); mp->cb.buf[3] = 0x01; return pixma_exec (s, &mp->cb); @@ -469,7 +469,7 @@ static int has_paper (pixma_t * s) { mp150_t *mp = (mp150_t *) s->subdriver; - + if (is_scanning_from_adfdup (s)) return (mp->current_status[1] == 0 || mp->current_status[2] == 0); else @@ -512,19 +512,19 @@ select_source (pixma_t * s) data[0] = 1; data[1] = 1; break; - + case PIXMA_SOURCE_ADF: data[0] = 2; data[5] = 1; data[6] = 1; break; - + case PIXMA_SOURCE_ADFDUP: data[0] = 2; data[5] = 3; data[6] = 3; break; - + case PIXMA_SOURCE_TPU: data[0] = 4; data[1] = 2; @@ -656,7 +656,7 @@ get_cis_ccd_line_size (pixma_t * s) return ((s->param->wx ? s->param->line_size / s->param->w * s->param->wx : s->param->line_size) * ((is_ccd_grayscale (s) || is_ccd_lineart (s)) ? 3 : 1)); } - + static unsigned calc_shifting (pixma_t * s) { @@ -683,7 +683,7 @@ calc_shifting (pixma_t * s) { mp->color_shift = s->param->ydpi / ((s->param->ydpi < 1200) ? 150 : 75); - if (is_scanning_from_tpu (s)) + if (is_scanning_from_tpu (s)) mp->color_shift = s->param->ydpi / 75; /* If you're trying to decipher this color-shifting code, @@ -714,7 +714,7 @@ send_scan_param (pixma_t * s) mp150_t *mp = (mp150_t *) s->subdriver; uint8_t *data; unsigned raw_width = calc_raw_width (mp, s->param); - unsigned h = MIN (s->param->h + calc_shifting (s), + unsigned h = MIN (s->param->h + calc_shifting (s), s->cfg->height * s->param->ydpi / 75); /* TPU scan does not support lineart */ @@ -772,7 +772,7 @@ send_scan_param (pixma_t * s) pixma_set_be32 (raw_width, data + 0x14); pixma_set_be32 (h, data + 0x18); data[0x1c] = ((s->param->channels != 1) || is_ccd_grayscale (s) || is_ccd_lineart (s)) ? 0x08 : 0x04; - + #ifdef DEBUG_TPU_48 data[0x1d] = 24; #else @@ -1037,8 +1037,8 @@ wait_until_ready (pixma_t * s) WAIT_INTERRUPT (1000); if (mp->generation >= 3) RET_IF_ERR (query_status_3 (s)); - else if (s->cfg->pid == MP600_PID || - s->cfg->pid == MP600R_PID || + else if (s->cfg->pid == MP600_PID || + s->cfg->pid == MP600R_PID || s->cfg->pid == MP800R_PID) RET_IF_ERR (query_status (s)); if (--tmo == 0) @@ -1052,8 +1052,8 @@ wait_until_ready (pixma_t * s) } static uint8_t * -shift_colors (uint8_t * dptr, uint8_t * sptr, - unsigned w, unsigned dpi, unsigned pid, unsigned c, +shift_colors (uint8_t * dptr, uint8_t * sptr, + unsigned w, unsigned dpi, unsigned pid, unsigned c, int * colshft, unsigned strshft) { unsigned i, sr, sg, sb, st; @@ -1064,7 +1064,7 @@ shift_colors (uint8_t * dptr, uint8_t * sptr, { /* stripes shift for MP800, MP800R at 2400 dpi */ st = (i % 2 == 0) ? strshft : 0; - + *sptr++ = *(dptr++ + sr + st); if (c == 6) *sptr++ = *(dptr++ + sr + st); *sptr++ = *(dptr++ + sg + st); @@ -1076,7 +1076,7 @@ shift_colors (uint8_t * dptr, uint8_t * sptr, } static void -reorder_pixels (uint8_t * linebuf, uint8_t * sptr, unsigned c, unsigned n, +reorder_pixels (uint8_t * linebuf, uint8_t * sptr, unsigned c, unsigned n, unsigned m, unsigned w, unsigned line_size) { unsigned i; @@ -1095,7 +1095,7 @@ pack_48_24_bpc (uint8_t * sptr, unsigned n) unsigned i; uint8_t *cptr, lsb; static uint8_t offset = 0; - + cptr = sptr; if (n % 2 != 0) PDBG (pixma_dbg (3, "WARNING: misaligned image.\n")); @@ -1109,9 +1109,9 @@ pack_48_24_bpc (uint8_t * sptr, unsigned n) } #endif -/* This function deals both with PIXMA CCD sensors producing shifted color +/* This function deals both with PIXMA CCD sensors producing shifted color * planes images, Grayscale CCD scan and Generation >= 3 high dpi images. - * Each complete line in mp->imgbuf is processed for shifting CCD sensor + * Each complete line in mp->imgbuf is processed for shifting CCD sensor * color planes, reordering pixels above 600 dpi for Generation >= 3, and * converting to Grayscale for CCD sensors. */ static unsigned @@ -1125,15 +1125,15 @@ post_process_image_data (pixma_t * s, pixma_imagebuf_t * ib) * ((s->param->software_lineart) ? 8 : s->param->depth) / 8; cw = c * s->param->w; cx = c * s->param->xs; - + if (mp->generation >= 3) n = s->param->xdpi / 600; else /* FIXME: maybe need different values for CIS and CCD sensors */ n = s->param->xdpi / 2400; - - if (s->cfg->pid == MP600_PID || s->cfg->pid == MP600R_PID) + + if (s->cfg->pid == MP600_PID || s->cfg->pid == MP600R_PID) n = s->param->xdpi / 1200; - + m = (n > 0) ? s->param->wx / n : 1; sptr = dptr = gptr = cptr = mp->imgbuf; line_size = get_cis_ccd_line_size (s); @@ -1153,11 +1153,11 @@ post_process_image_data (pixma_t * s, pixma_imagebuf_t * ib) /*PDBG (pixma_dbg (4, "*post_process_image_data***** Processing with c=%u, n=%u, m=%u, w=%i, line_size=%u ***** \n", c, n, m, s->param->wx, line_size));*/ if (s->cfg->pid != MG5300_PID && s->cfg->pid != MG6300_PID && c >= 3) - dptr = shift_colors (dptr, sptr, + dptr = shift_colors (dptr, sptr, s->param->wx, s->param->xdpi, s->cfg->pid, c, mp->shift, mp->stripe_shift); - - /* special image format for *most* devices at high dpi. + + /* special image format for *most* devices at high dpi. * MP220, MX360, MX370, MX890, MG5300 are exceptions */ if (n > 0 && s->cfg->pid != MP220_PID @@ -1181,10 +1181,10 @@ post_process_image_data (pixma_t * s, pixma_imagebuf_t * ib) && s->cfg->pid != MG7700_PID && s->cfg->pid != MB5000_PID) reorder_pixels (mp->linebuf, sptr, c, n, m, s->param->wx, line_size); - + /* Crop line to selected borders */ memmove(cptr, sptr + cx, cw); - + /* Color / Gray to Lineart convert */ if (s->param->software_lineart) cptr = gptr = pixma_binarize_line (s->param, gptr, cptr, s->param->w, c); @@ -1240,7 +1240,7 @@ mp150_open (pixma_t * s) /* And exceptions to be added here */ if (s->cfg->pid == MP140_PID) mp->generation = 2; - + PDBG (pixma_dbg (3, "*mp150_open***** This is a generation %d scanner. *****\n", mp->generation)); /* TPU info data setup */ @@ -1253,7 +1253,7 @@ mp150_open (pixma_t * s) { query_status (s); handle_interrupt (s, 200); - if (mp->generation == 3 && has_ccd_sensor (s)) + if (mp->generation == 3 && has_ccd_sensor (s)) send_cmd_start_calibrate_ccd_3 (s); } return 0; @@ -1324,13 +1324,13 @@ mp150_check_param (pixma_t * s, pixma_scan_param_t * sp) sp->wx = calc_raw_width (mp, sp); sp->line_size = sp->w * sp->channels * (((sp->software_lineart) ? 8 : sp->depth) / 8); /* bytes per line per color after cropping */ /*PDBG (pixma_dbg (4, "*mp150_check_param***** Final scan width and line-size: %i, %i *****\n", sp->wx, sp->line_size));*/ - + /* Some exceptions here for particular devices */ /* Those devices can scan up to legal 14" with ADF, but A4 11.7" in flatbed */ /* PIXMA_CAP_ADF also works for PIXMA_CAP_ADFDUP */ if ((s->cfg->cap & PIXMA_CAP_ADF) && sp->source == PIXMA_SOURCE_FLATBED) sp->h = MIN (sp->h, 877 * sp->xdpi / 75); - + if (sp->source == PIXMA_SOURCE_TPU) { uint8_t k; @@ -1340,10 +1340,10 @@ mp150_check_param (pixma_t * s, pixma_scan_param_t * sp) k = MAX (sp->xdpi, 300) / sp->xdpi; else k = MAX (sp->xdpi, 150) / sp->xdpi; - sp->x *= k; + sp->x *= k; sp->xs *= k; sp->y *= k; - sp->w *= k; + sp->w *= k; sp->wx *= k; sp->h *= k; sp->xdpi *= k; @@ -1442,14 +1442,14 @@ mp150_scan (pixma_t * s) { case PIXMA_ECANCELED: case PIXMA_EBUSY: - PDBG (pixma_dbg (2, "cmd e920 or d520 returned %s\n", + PDBG (pixma_dbg (2, "cmd e920 or d520 returned %s\n", pixma_strerror (error))); /* fall through */ case 0: query_status (s); break; default: - PDBG (pixma_dbg (1, "WARNING:cmd e920 or d520 failed %s\n", + PDBG (pixma_dbg (1, "WARNING:cmd e920 or d520 failed %s\n", pixma_strerror (error))); return error; } @@ -1610,7 +1610,7 @@ mp150_fill_buffer (pixma_t * s, pixma_imagebuf_t * ib) #endif bytes_received = pack_48_24_bpc (mp->imgbuf + mp->data_left_len, bytes_received); #endif -#endif +#endif /* Post-process the image data */ mp->data_left_ofs = mp->imgbuf + mp->data_left_len + bytes_received; mp->data_left_len = post_process_image_data (s, ib); @@ -1638,7 +1638,7 @@ mp150_finish_scan (pixma_t * s) /* Send the get TPU info message */ if (is_scanning_from_tpu (s) && mp->tpu_datalen == 0) send_get_tpu_info_3 (s); - /* FIXME: to process several pages ADF scan, must not send + /* FIXME: to process several pages ADF scan, must not send * abort_session and start_session between pages (last_block=0x28) */ if (mp->generation <= 2 || !is_scanning_from_adf (s) || mp->last_block == 0x38) { diff --git a/backend/pixma_mp730.c b/backend/pixma_mp730.c index 6bf3f42a7..5cfc02b52 100644 --- a/backend/pixma_mp730.c +++ b/backend/pixma_mp730.c @@ -442,10 +442,10 @@ step1 (pixma_t * s) default: break; } - + activate (s, 0); error = calibrate (s); - + switch (s->cfg->pid) { case MF5730_PID: @@ -836,7 +836,7 @@ const pixma_config_t pixma_mp730_devices[] = { DEVICE ("PIXMA MP710", "MP710", MP710_PID, 1200, 637, 868, PIXMA_CAP_LINEART), DEVICE ("PIXMA MP730", "MP730", MP730_PID, 1200, 637, 868, PIXMA_CAP_ADF | PIXMA_CAP_LINEART), DEVICE ("PIXMA MP740", "MP740", MP740_PID, 1200, 637, 868, PIXMA_CAP_ADF | PIXMA_CAP_LINEART), - + DEVICE ("Canon imageCLASS MF5730", "MF5730", MF5730_PID, 1200, 636, 868, PIXMA_CAP_ADF), DEVICE ("Canon imageCLASS MF5750", "MF5750", MF5750_PID, 1200, 636, 868, PIXMA_CAP_ADF), DEVICE ("Canon imageCLASS MF5770", "MF5770", MF5770_PID, 1200, 636, 868, PIXMA_CAP_ADF), diff --git a/backend/pixma_mp750.c b/backend/pixma_mp750.c index c5ac33546..68f267ffa 100644 --- a/backend/pixma_mp750.c +++ b/backend/pixma_mp750.c @@ -229,8 +229,8 @@ is_ccd_grayscale (pixma_t * s) static unsigned get_cis_ccd_line_size (pixma_t * s) { - return (s->param->wx ? s->param->line_size / s->param->w * s->param->wx - : s->param->line_size) * ((is_ccd_grayscale (s)) ? 3 : 1); + return (s->param->wx ? s->param->line_size / s->param->w * s->param->wx + : s->param->line_size) * ((is_ccd_grayscale (s)) ? 3 : 1); } static int @@ -829,17 +829,17 @@ mp750_fill_buffer (pixma_t * s, pixma_imagebuf_t * ib) /* Color to Grayscale converion for CCD sensor */ if (is_ccd_grayscale (s)) { - shift_rgb (mp->rawimg, n, shift[0], shift[1], shift[2], mp->stripe_shift, mp->line_size, - mp->imgcol + mp->imgbuf_ofs); + shift_rgb (mp->rawimg, n, shift[0], shift[1], shift[2], mp->stripe_shift, mp->line_size, + mp->imgcol + mp->imgbuf_ofs); /* dst: img, src: imgcol */ - rgb_to_gray (mp->img, mp->imgcol, n, c); /* cropping occurs later? */ + rgb_to_gray (mp->img, mp->imgcol, n, c); /* cropping occurs later? */ PDBG (pixma_dbg (4, "*fill_buffer: did grayscale conversion \n")); } /* Color image processing */ else { - shift_rgb (mp->rawimg, n, shift[0], shift[1], shift[2], mp->stripe_shift, mp->line_size, + shift_rgb (mp->rawimg, n, shift[0], shift[1], shift[2], mp->stripe_shift, mp->line_size, mp->img + mp->imgbuf_ofs); - PDBG (pixma_dbg (4, "*fill_buffer: no grayscale conversion---keep color \n")); + PDBG (pixma_dbg (4, "*fill_buffer: no grayscale conversion---keep color \n")); } /* entering remaining unprocessed bytes after last complete pixel into mp->rawimg buffer -- no influence on mp->img */ @@ -852,7 +852,7 @@ mp750_fill_buffer (pixma_t * s, pixma_imagebuf_t * ib) } while (mp->shifted_bytes <= 0); - if ((unsigned) mp->shifted_bytes < mp->last_block_size) + if ((unsigned) mp->shifted_bytes < mp->last_block_size) { if (is_ccd_grayscale (s)) ib->rptr = mp->img + mp->last_block_size/3 - mp->shifted_bytes/3; /* testing---works OK */ @@ -864,7 +864,7 @@ mp750_fill_buffer (pixma_t * s, pixma_imagebuf_t * ib) if (is_ccd_grayscale (s)) ib->rend = mp->img + mp->last_block_size/3; /* testing---works OK */ else - ib->rend = mp->img + mp->last_block_size; + ib->rend = mp->img + mp->last_block_size; return ib->rend - ib->rptr; } diff --git a/backend/pixma_mp810.c b/backend/pixma_mp810.c index b03bebca6..6868dcb92 100644 --- a/backend/pixma_mp810.c +++ b/backend/pixma_mp810.c @@ -1531,9 +1531,9 @@ pack_48_24_bpc (uint8_t * sptr, unsigned n) } #endif -/* This function deals both with PIXMA CCD sensors producing shifted color +/* This function deals both with PIXMA CCD sensors producing shifted color * planes images, Grayscale CCD scan and Generation >= 3 high dpi images. - * Each complete line in mp->imgbuf is processed for shifting CCD sensor + * Each complete line in mp->imgbuf is processed for shifting CCD sensor * color planes, reordering pixels above 600 dpi for Generation >= 3, and * converting to Grayscale for CCD sensors. */ static unsigned post_process_image_data (pixma_t * s, pixma_imagebuf_t * ib) @@ -2251,7 +2251,7 @@ static int mp810_fill_buffer (pixma_t * s, pixma_imagebuf_t * ib) #endif bytes_received = pack_48_24_bpc (mp->imgbuf + mp->data_left_len, bytes_received); #endif -#endif +#endif /* Post-process the image data */ mp->data_left_ofs = mp->imgbuf + mp->data_left_len + bytes_received; mp->data_left_len = post_process_image_data (s, ib); @@ -2280,7 +2280,7 @@ static void mp810_finish_scan (pixma_t * s) /* Send the get TPU info message */ if (is_scanning_from_tpu (s) && mp->tpu_datalen == 0) send_get_tpu_info_3 (s); - /* FIXME: to process several pages ADF scan, must not send + /* FIXME: to process several pages ADF scan, must not send * abort_session and start_session between pages (last_block=0x28) */ if (mp->generation <= 2 || !is_scanning_from_adf (s) || mp->last_block == 0x38) diff --git a/backend/pixma_sane_options.c b/backend/pixma_sane_options.c index 2e4a0542c..ad124b52b 100644 --- a/backend/pixma_sane_options.c +++ b/backend/pixma_sane_options.c @@ -1,13 +1,13 @@ /* Automatically generated from pixma_sane.c */ -static const SANE_Range constraint_gamma_table = +static const SANE_Range constraint_gamma_table = { 0,255,0 }; -static const SANE_Range constraint_gamma = +static const SANE_Range constraint_gamma = { SANE_FIX(0.3),SANE_FIX(5),SANE_FIX(0) }; -static const SANE_Range constraint_threshold = +static const SANE_Range constraint_threshold = { 0,100,1 }; -static const SANE_Range constraint_threshold_curve = +static const SANE_Range constraint_threshold_curve = { 0,127,1 }; -static const SANE_Range constraint_adf_wait = +static const SANE_Range constraint_adf_wait = { 0,3600,1 }; diff --git a/backend/plustek-pp.h b/backend/plustek-pp.h index 3c052f2de..5a1c45330 100644 --- a/backend/plustek-pp.h +++ b/backend/plustek-pp.h @@ -566,7 +566,7 @@ typedef struct Plustek_Device SANE_Int res_list_size; /* resolution values */ ScannerCaps caps; /* caps reported by the driver */ AdjDef adj; /* for driver adjustment */ - + /* * each device we support may need other access functions... */ @@ -612,9 +612,9 @@ typedef struct Plustek_Scanner SANE_Byte *buf; /* the image buffer */ SANE_Bool scanning; /* TRUE during scan-process */ SANE_Parameters params; /* for keeping the parameter */ - + /************************** gamma tables *********************************/ - + SANE_Word gamma_table[4][4096]; SANE_Range gamma_range; int gamma_length; @@ -626,7 +626,7 @@ typedef struct Plustek_Scanner /** for collecting configuration info... */ typedef struct { - + char devName[PATH_MAX]; /* contains the stuff to adjust... */ diff --git a/backend/plustek-pp_dac.c b/backend/plustek-pp_dac.c index f89d8147a..522894aab 100644 --- a/backend/plustek-pp_dac.c +++ b/backend/plustek-pp_dac.c @@ -311,7 +311,7 @@ static void dacP98CheckLastGain( pScanData ps ) if (b[w] < *p.pb) b[w] = *p.pb; } - + if (b[w] > _GAIN_P98_HIGH) { *(pbReg [w]) -= 1; } @@ -643,7 +643,7 @@ static void dacP98WriteBackToShadingRAM( pScanData ps ) *pBuffer = Data.wValue; pBuffer++; } - + } dacP98DownloadShadingTable( ps, ps->pScanBuffer2, (5400 * 2 * 3)); } @@ -763,7 +763,7 @@ static void dacP98Adjust12BitShading( pScanData ps ) *pt.pdw += (ULong)(*pd.pw * 94 / 100 & 0x0fff); /* one line */ - if (IOReadFifoLength( ps ) <= 2500) + if (IOReadFifoLength( ps ) <= 2500) IORegisterDirectToScanner( ps, ps->RegRefreshScanState ); } @@ -782,7 +782,7 @@ static Bool dacP98WaitForShading( pScanData ps ) DBG( DBG_LOW, "dacP98WaitForShading()\n" ); - /* + /* * before getting the shading data, (re)init the ASIC */ ps->InitialSetCurrentSpeed( ps ); @@ -1079,7 +1079,7 @@ static void dacP96ReadColorShadingLine( pScanData ps ) } } else b2ndDiscard--; - + if (!b3rdDiscard) { if (b3rdReadLines) { b3rdReadLines--; @@ -1159,7 +1159,7 @@ static void dacP96SetShadingGainProc( pScanData ps, Byte bHigh, ULong dwCh ) ps->Asic96Reg.RD_ShadingCorrectCtrl &= bMask; ps->Asic96Reg.RD_ShadingCorrectCtrl |= bGain; - if (!bGain) { + if (!bGain) { /* GammaGain1 (ps) */ for (dw = ps->BufferSizePerModel; dw; dw--, pbSrce++, pbDest++) if (*pbSrce > bDark) @@ -1334,7 +1334,7 @@ static Bool dacP96003WaitForShading( pScanData ps ) dacP96SetInitialGainRAM( ps ); /* SetInitialGainRegister () ++++++++++++++++++++++++++++++++++++*/ - ps->Asic96Reg.u28.RD_RedChShadingOff = + ps->Asic96Reg.u28.RD_RedChShadingOff = ps->Asic96Reg.u29.RD_GreenChShadingOff = ps->Asic96Reg.RD_BlueChShadingOff = ps->Asic96Reg.RD_RedChDarkOff = @@ -1694,7 +1694,7 @@ static Bool dacP96001WaitForShading( pScanData ps ) /* AverageWideBank (pScanData) */ for( dwSum = 0, dw = 0; dw < 2700; dw++ ) dwSum += (ULong)ps->pPrescan16[dw]; - + dwSum /= 2700UL; if( dwSum <= 0x80 ) { @@ -1860,7 +1860,7 @@ static void dacP98003AdjustRGBGain( pScanData ps ) /* PauseColorMotorRunStates () */ memset( ps->a_nbNewAdrPointer, 0, _SCANSTATE_BYTES ); - ps->a_nbNewAdrPointer[1] = 0x77; + ps->a_nbNewAdrPointer[1] = 0x77; IOPutOnAllRegisters( ps ); @@ -2312,7 +2312,7 @@ static void dacP98003AdjustDark( pScanData ps ) /* PauseColorMotorRunStates () */ memset( ps->a_nbNewAdrPointer, 0, _SCANSTATE_BYTES ); - ps->a_nbNewAdrPointer[1] = 0x77; + ps->a_nbNewAdrPointer[1] = 0x77; IOPutOnAllRegisters( ps ); _DODELAY( 70 ); @@ -2374,7 +2374,7 @@ static Bool dacP98003WaitForShading( pScanData ps ) DBG( DBG_LOW, "dacP98003WaitForShading()\n" ); - /* + /* * before getting the shading data, (re)init the ASIC */ ps->ReInitAsic( ps, _TRUE ); @@ -2501,7 +2501,7 @@ _LOC void DacP98FillShadingDarkToShadingRegister( pScanData ps ) pValue = (pUChar)&ps->AsicReg.RD_RedDarkOff; for (bReg = ps->RegRedChDarkOffsetLow; bReg <= ps->RegBlueChDarkOffsetHigh; bReg++, pValue++) { - + IODataToRegister( ps, bReg, *pValue ); } } diff --git a/backend/plustek-pp_detect.c b/backend/plustek-pp_detect.c index 51fad694c..b7527c374 100644 --- a/backend/plustek-pp_detect.c +++ b/backend/plustek-pp_detect.c @@ -161,8 +161,8 @@ static int detectScannerConnection( pScanData ps ) _ASSERT( ps->ReadWriteTest ); /* - * here we try to detect the operation speed of our parallel - * port if we have tested all the stuff and had no success, + * here we try to detect the operation speed of our parallel + * port if we have tested all the stuff and had no success, * retval will contain the error-code */ for( ps->IO.delay = 0; ps->IO.delay < 5; ps->IO.delay++ ) { @@ -211,11 +211,11 @@ static int detectSetupBuffers( pScanData ps ) */ if ( 0 == ps->TotalBufferRequire ) { -#ifdef __KERNEL__ +#ifdef __KERNEL__ _PRINT( #else DBG( DBG_HIGH, -#endif +#endif "pt_drv: asic 0x%x probably not supported\n", ps->sCaps.AsicID); return _E_ALLOC; /* Out of memory */ @@ -419,7 +419,7 @@ _LOC int DetectScanner( pScanData ps, int mode ) DBG( DBG_HIGH, "Starting Scanner-Autodetection\n" ); - /* try to find a 48xx Scanner + /* try to find a 48xx Scanner * (or even a scanner based on the 96001/3) ASIC */ result = detectP48xx( ps ); diff --git a/backend/plustek-pp_image.c b/backend/plustek-pp_image.c index c1ef7433b..88368ed53 100644 --- a/backend/plustek-pp_image.c +++ b/backend/plustek-pp_image.c @@ -287,7 +287,7 @@ static void fnP96GrayDirect( pScanData ps, pVoid pBuf, pVoid pImg, ULong bl ) src = (pUChar)pImg; dest = (pUChar)pBuf; - + for (; bl; bl--, src++, dest++ ) *dest = ps->pbMapRed [*src]; } @@ -315,7 +315,7 @@ static void fnHalftoneDirect0( pScanData ps, pVoid pb, pVoid pImg, ULong bL ) src = (pUChar)pImg; dest = (pUChar)pb; - + pDither = &ps->a_bDitherPattern[ps->dwDitherIndex]; for( ; bL; bL--, dest++, pDither -= 8 ) { @@ -365,10 +365,10 @@ static void fnP98ColorDirect( pScanData ps, pVoid pb, pVoid pImg, ULong bL ) { pUChar src; pRGBByteDef dest; - + src = (pUChar)pImg; dest = (pRGBByteDef)pb; - + for ( bL = ps->DataInf.dwAsicPixelsPerPlane; bL; bL--, src++, dest++) { dest->Red = *src; @@ -384,7 +384,7 @@ static void fnP96ColorDirect( pScanData ps, pVoid pb, pVoid pImg, ULong bL ) src = (pUChar)pImg; dest = (pRGBByteDef)pb; - + for ( bL = ps->DataInf.dwAsicPixelsPerPlane; bL; bL--, dest++, src++) { dest->Red =ps->pbMapRed[*src]; @@ -400,13 +400,13 @@ static void fnP98Color48( pScanData ps, pVoid pb, pVoid pImg, ULong bL ) { pUShort src; pRGBUShortDef dest; - + register ULong i; _VAR_NOT_USED( bL ); src = (pUShort)pImg; dest = (pRGBUShortDef)pb; - + for ( i = ps->DataInf.dwAsicPixelsPerPlane; i; i--, src++, dest++) { dest->Red = *src; @@ -960,7 +960,7 @@ static Bool imageP96ReadOneImageLine( pScanData ps ) if ((bData - ps->bCurrentLineCount) < _SCANSTATE_BYTES) continue; } - + ps->bMoveDataOutFlag = _DataAfterRefreshState; } #endif @@ -977,7 +977,7 @@ static Bool imageP96ReadOneImageLine( pScanData ps ) (ps->RedDataReady | ps->GreenDataReady | _BLUE_DATA_READY)); ps->pCurrentColorRunTable++); -#ifdef DEBUG +#ifdef DEBUG if( ps->pCurrentColorRunTable > (ps->pColorRunTable+ps->BufferForColorRunTable)) DBG( DBG_LOW, "WARNING: pCurrentColorRunTab>pColorRunTable\n"); @@ -1290,7 +1290,7 @@ static Bool imageP98003ReadOneImageLine( pScanData ps ) } while( !MiscCheckTimer( &timer )); -#ifdef __KERNEL__ +#ifdef __KERNEL__ _PRINT( #else DBG( DBG_HIGH, @@ -1358,7 +1358,7 @@ static void imageP98003SetupScanStateVariables( pScanData ps, ULong index ) if( var.dwValue && ps->DataInf.dwAsicBytesPerPlane > var.dwValue ) { if((var.dwValue << 1) > ps->DataInf.dwAsicBytesPerPlane) - ps->Scan.dwInterval <<= 1; + ps->Scan.dwInterval <<= 1; else if((var.dwValue << 2) > ps->DataInf.dwAsicBytesPerPlane) ps->Scan.dwInterval <<= 2; @@ -1376,7 +1376,7 @@ static void imageP98003SetupScanStateVariables( pScanData ps, ULong index ) if( ps->DataInf.wPhyDataType >= COLOR_TRUE24 ) { - if( ps->DataInf.xyPhyDpi.y > 75U ) { + if( ps->DataInf.xyPhyDpi.y > 75U ) { if( ps->Device.f0_8_16 ) { ps->Scan.gd_gk.wGreenDiscard = ps->DataInf.xyPhyDpi.y / 75U; } else { @@ -1535,7 +1535,7 @@ static int imageP98003SetupScanSettings( pScanData ps, pScanInfo pInf ) ps->Scan.p48BitBuf.pb = ps->Bufs.b1.pReadBuf; } - } + } if( ps->Scan.p48BitBuf.pb ){ ps->Scan.DataRead = fnReadToDriver; diff --git a/backend/plustek-pp_io.c b/backend/plustek-pp_io.c index ba6859970..d6e99b957 100644 --- a/backend/plustek-pp_io.c +++ b/backend/plustek-pp_io.c @@ -110,7 +110,7 @@ static Byte ioDataFromSPPFast( pScanData ps ) /* read low nibble */ tmp = _INB_STATUS( ps ); - + /* combine with low nibble */ bData |= (tmp >> 4); @@ -141,7 +141,7 @@ static Byte ioDataFromSPPMiddle( pScanData ps ) /* read low nibble */ _INB_STATUS( ps ); tmp = _INB_STATUS( ps ); - + /* combine with low nibble */ bData |= (tmp >> 4); @@ -174,7 +174,7 @@ static UChar ioDataFromSPPSlow( pScanData ps ) _INB_STATUS( ps ); _INB_STATUS( ps ); tmp = _INB_STATUS( ps ); - + /* combine with low nibble */ bData |= (tmp >> 4); @@ -209,7 +209,7 @@ static UChar ioDataFromSPPSlowest( pScanData ps ) _INB_STATUS( ps ); _INB_STATUS( ps ); tmp = _INB_STATUS( ps ); - + /* combine with low nibble */ bData |= (tmp >> 4); @@ -309,9 +309,9 @@ static Bool fnBiDirRead( pScanData ps, pUChar pBuffer, ULong ulSize ) case 0: for( ; ulSize; ulSize--, pBuffer++ ) { - _OUTB_CTRL( ps, start ); + _OUTB_CTRL( ps, start ); *pBuffer = _INB_DATA( ps ); - _OUTB_CTRL( ps, end ); + _OUTB_CTRL( ps, end ); } break; @@ -327,7 +327,7 @@ static Bool fnBiDirRead( pScanData ps, pUChar pBuffer, ULong ulSize ) _DO_UDELAY( 1 ); } break; - + default: _DO_UDELAY( 2 ); for(; ulSize; ulSize--, pBuffer++ ) { @@ -466,7 +466,7 @@ static Bool ioP98OpenScanPath( pScanData ps ) #endif } else { ioP98003EstablishScannerConnection( ps, dw ); - } + } _INB_STATUS( ps ); tmp = _INB_STATUS( ps ); @@ -524,7 +524,7 @@ static void ioCloseScanPath( pScanData ps ) * (ASIC 9800x only) */ static int ioP98ReadWriteTest( pScanData ps ) -{ +{ UChar tmp; ULong ul; pUChar buffer; @@ -539,10 +539,10 @@ static int ioP98ReadWriteTest( pScanData ps ) /* prepare content */ for( ul = 0; ul < _MEMTEST_SIZE; ul++ ) - buffer[ul] = (UChar)ul; + buffer[ul] = (UChar)ul; ps->OpenScanPath(ps); - + /* avoid switching to Lamp0, when previously scanned in transp./neg mode */ tmp = ps->bLastLampStatus + _SCAN_BYTEMODE; IODataToRegister( ps, ps->RegScanControl, tmp ); @@ -595,7 +595,7 @@ static void ioSPPWrite( pScanData ps, pUChar pBuffer, ULong size ) DBG( DBG_IO , "Moving %u bytes to scanner, IODELAY = %u...\n", size, ps->IO.delay ); switch( ps->IO.delay ) { - + case 0: for (; size; size--, pBuffer++) { _OUTB_DATA( ps, *pBuffer ); @@ -603,7 +603,7 @@ static void ioSPPWrite( pScanData ps, pUChar pBuffer, ULong size ) _OUTB_CTRL( ps, _CTRL_END_DATAWRITE ); } break; - + case 1: case 2: for (; size; size--, pBuffer++) { @@ -647,7 +647,7 @@ static void ioEnterReadMode( pScanData ps ) ps->IO.bOldControlValue = _INB_CTRL( ps ); /* ask ASIC to enter read mode */ - IORegisterToScanner( ps, ps->RegReadDataMode ); + IORegisterToScanner( ps, ps->RegReadDataMode ); } /************************ exported functions *********************************/ @@ -750,7 +750,7 @@ _LOC void IODataToScanner( pScanData ps, Byte bValue ) /* notify asic there is data */ _OUTB_CTRL( ps, _CTRL_START_DATAWRITE ); _DO_UDELAY( deltime ); - + /* end write cycle */ _OUTB_CTRL( ps, _CTRL_END_DATAWRITE ); _DO_UDELAY( deltime-1 ); @@ -767,7 +767,7 @@ _LOC void IODataToRegister( pScanData ps, Byte bReg, Byte bData ) #endif /* specify register */ - IORegisterToScanner( ps, bReg ); + IORegisterToScanner( ps, bReg ); /* then write the content */ IODataToScanner( ps, bData ); diff --git a/backend/plustek-pp_map.c b/backend/plustek-pp_map.c index 8afeb3279..00b52a31d 100644 --- a/backend/plustek-pp_map.c +++ b/backend/plustek-pp_map.c @@ -164,23 +164,23 @@ static void mapInvertDitherMap( pScanData ps ) static void mapBuildLinearMap( pScanData ps ) { ULong i; - + DBG( DBG_LOW, "mapBuildLinearMap()\n" ); if( _IS_ASIC98(ps->sCaps.AsicID)) { for( i = 0; i < 4096; i++ ) { - ps->a_bMapTable[i] = (UChar)(i >> 4); - ps->a_bMapTable[4096+i] = (UChar)(i >> 4); - ps->a_bMapTable[8192+i] = (UChar)(i >> 4); + ps->a_bMapTable[i] = (UChar)(i >> 4); + ps->a_bMapTable[4096+i] = (UChar)(i >> 4); + ps->a_bMapTable[8192+i] = (UChar)(i >> 4); } } else { for( i = 0; i < 256; i++ ) { - ps->a_bMapTable[i] = (UChar)(i & 0xff); - ps->a_bMapTable[256+i] = (UChar)(i & 0xff); - ps->a_bMapTable[512+i] = (UChar)(i & 0xff); + ps->a_bMapTable[i] = (UChar)(i & 0xff); + ps->a_bMapTable[256+i] = (UChar)(i & 0xff); + ps->a_bMapTable[512+i] = (UChar)(i & 0xff); } } } @@ -221,7 +221,7 @@ _LOC void MapAdjust( pScanData ps, int which ) long b, c, tmp; DBG( DBG_LOW, "MapAdjust(%u)\n", which ); - + if( _IS_ASIC98(ps->sCaps.AsicID)) { tabLen = 4096; } else { @@ -257,7 +257,7 @@ _LOC void MapAdjust( pScanData ps, int which ) if( tmp > 255 ) tmp = 255; ps->a_bMapTable[tabLen+i] = (UChar)tmp; } - + if((_MAP_MASTER == which) || (_MAP_BLUE == which)) { tmp = ((((long)ps->a_bMapTable[tabLen*2+i] * 100) + b) * c) / 10000; if( tmp < 0 ) tmp = 0; @@ -268,33 +268,33 @@ _LOC void MapAdjust( pScanData ps, int which ) if( ps->DataInf.dwScanFlag & SCANDEF_Negative ) { DBG( DBG_LOW, "inverting...\n" ); - + if((_MAP_MASTER == which) || (_MAP_RED == which)) { - + DBG( DBG_LOW, "inverting RED map\n" ); - + pdw = (pULong)ps->a_bMapTable; - + for( dw = tabLen / 4; dw; dw--, pdw++ ) *pdw = ~(*pdw); } - + if((_MAP_MASTER == which) || (_MAP_GREEN == which)) { - + DBG( DBG_LOW, "inverting GREEN map\n" ); - + pdw = (pULong)&ps->a_bMapTable[tabLen]; - + for( dw = tabLen / 4; dw; dw--, pdw++ ) *pdw = ~(*pdw); } - + if((_MAP_MASTER == which) || (_MAP_BLUE == which)) { - + DBG( DBG_LOW, "inverting BLUE map\n" ); - + pdw = (pULong)&ps->a_bMapTable[tabLen*2]; - + for( dw = tabLen / 4; dw; dw--, pdw++ ) *pdw = ~(*pdw); } diff --git a/backend/plustek-pp_misc.c b/backend/plustek-pp_misc.c index d0c1ce73d..a0ce200aa 100644 --- a/backend/plustek-pp_misc.c +++ b/backend/plustek-pp_misc.c @@ -280,7 +280,7 @@ static int miscSetFastMode( pScanData ps ) ps->IO.lastPortMode = a; /* save it for restoring later */ /* set to Fast Centronics/bi-directional/PS2 */ - a = (a & 0x1F) | 0x20; + a = (a & 0x1F) | 0x20; _OUTB_ECTL(ps,a); /* write it back */ _DO_UDELAY(1); @@ -335,7 +335,7 @@ static int miscSetFastMode( pScanData ps ) DBG(DBG_LOW, "Port is set to PS2 bidirectional mode.\n"); ps->IO.portMode = _PORT_BIDI; return _OK; - + } else { DBG(DBG_LOW, "Port could not be set to PS2 mode. " "Using SPP mode.\n"); @@ -458,7 +458,7 @@ _LOC pScanData MiscAllocAndInitStruct( void ) } DBG( DBG_HIGH, "ScanData = 0x%08lx\n", (unsigned long)ps ); - return ps; + return ps; } /** re-initialize the memory for the scanner structure @@ -610,7 +610,7 @@ _LOC void MiscStartTimer( TimerDef *timer , unsigned long us) #ifdef __KERNEL__ _GET_TIME( &start_time ); #else - gettimeofday(&start_time, NULL); + gettimeofday(&start_time, NULL); #endif *timer = (TimerDef)start_time.tv_sec * 1000000 + (TimerDef)start_time.tv_usec + us; @@ -635,7 +635,7 @@ _LOC int MiscCheckTimer( TimerDef *timer ) if ((TimerDef)current_time.tv_sec * 1000000 + (TimerDef)current_time.tv_usec > *timer) { return _E_TIMEOUT; } else { -#ifdef __KERNEL__ +#ifdef __KERNEL__ schedule(); /*#else sched_yield(); @@ -739,7 +739,7 @@ _LOC int MiscRegisterPort( pScanData ps, int portAddr ) return _OK; } -/** unregisters the port from driver +/** unregisters the port from driver */ _LOC void MiscUnregisterPort( pScanData ps ) { diff --git a/backend/plustek-pp_models.c b/backend/plustek-pp_models.c index 55029db42..1d2968655 100644 --- a/backend/plustek-pp_models.c +++ b/backend/plustek-pp_models.c @@ -115,7 +115,7 @@ static void modelInitPageSettings( pScanData ps ) ps->sCaps.wMaxExtentY = ps->LensInf.rExtentY.wDef = ps->LensInf.rExtentY.wMax = - ps->LensInf.rExtentY.wPhyMax = _MEASURE_BASE * 11.6934; + ps->LensInf.rExtentY.wPhyMax = _MEASURE_BASE * 11.6934; break; case _SCANSIZE_A3: @@ -124,7 +124,7 @@ static void modelInitPageSettings( pScanData ps ) ps->sCaps.wMaxExtentY = ps->LensInf.rExtentY.wMax = ps->LensInf.rExtentY.wDef = - ps->LensInf.rExtentY.wPhyMax = _MEASURE_BASE * 17; + ps->LensInf.rExtentY.wPhyMax = _MEASURE_BASE * 17; /* _MEASURE_BASE * 11.69 */ ps->sCaps.wMaxExtentX = @@ -139,7 +139,7 @@ static void modelInitPageSettings( pScanData ps ) ps->sCaps.wMaxExtentY = ps->LensInf.rExtentY.wDef = ps->LensInf.rExtentY.wMax = - ps->LensInf.rExtentY.wPhyMax = _MEASURE_BASE * 11; + ps->LensInf.rExtentY.wPhyMax = _MEASURE_BASE * 11; break; case _SCANSIZE_LEGAL: @@ -148,7 +148,7 @@ static void modelInitPageSettings( pScanData ps ) ps->sCaps.wMaxExtentY = ps->LensInf.rExtentY.wDef = ps->LensInf.rExtentY.wMax = - ps->LensInf.rExtentY.wPhyMax = _MEASURE_BASE * 14; + ps->LensInf.rExtentY.wPhyMax = _MEASURE_BASE * 14; } /* diff --git a/backend/plustek-pp_motor.c b/backend/plustek-pp_motor.c index f377b7e56..e46ae802d 100644 --- a/backend/plustek-pp_motor.c +++ b/backend/plustek-pp_motor.c @@ -1875,7 +1875,7 @@ static void motorP96SetupRunTable( pScanData ps ) if ((siSum -= (Short)ps->DataInf.xyPhyDpi.y) <= 0) { siSum += (Short)wP96BaseDpi; - if((ps->sCaps.Model == MODEL_OP_12000P)|| + if((ps->sCaps.Model == MODEL_OP_12000P)|| (ps->sCaps.Model == MODEL_OP_A3I)) { *p.pb |= _COLORRUNTABLE_GREEN; } else { @@ -2083,7 +2083,7 @@ static void motorP96WaitBack( pScanData ps ) } else { dw = _P96_FORWARDMOVES; } - + memset( a_bScanStateTable, 1, dw ); memset(&a_bScanStateTable[dw], 0xff, 250 - dw ); diff --git a/backend/plustek-pp_p12.c b/backend/plustek-pp_p12.c index 6f46e5816..2dc4e45e3 100644 --- a/backend/plustek-pp_p12.c +++ b/backend/plustek-pp_p12.c @@ -121,7 +121,7 @@ static void p12InitiateComponentModel( pScanData ps ) case _SCANNER5Button: DBG( DBG_LOW, "Scanner has 5 Buttons\n" ); - ps->Device.dwModelOriginY = 64 + 20; + ps->Device.dwModelOriginY = 64 + 20; p12ButtonSetup( ps, 5 ); break; @@ -153,7 +153,7 @@ static void p12InitiateComponentModel( pScanData ps ) case _SCANNER2Button: DBG( DBG_LOW, "Scanner has 2 Buttons\n" ); DBG( DBG_LOW, "Seems we have a Genius Colorpage Vivid III V2\n" ); - ps->Device.dwModelOriginY = 64 - 33; + ps->Device.dwModelOriginY = 64 - 33; p12ButtonSetup( ps, 2 ); ps->sCaps.Model = MODEL_GEN_CPV2; break; @@ -232,7 +232,7 @@ static void p12SetupScanningCondition( pScanData ps ) ps->Scan.dwMaxReadFifo += (ps->DataInf.dwAsicBytesPerPlane / 2); - DBG( DBG_LOW, "MinReadFifo=%u, MaxReadFifo=%u\n", + DBG( DBG_LOW, "MinReadFifo=%u, MaxReadFifo=%u\n", ps->Scan.dwMinReadFifo, ps->Scan.dwMaxReadFifo ); /* ------- Set the max. read fifo to asic ------- */ @@ -260,7 +260,7 @@ static void p12SetupScanningCondition( pScanData ps ) channel = _GREEN_FULLSIZE << 16; ps->AsicReg.RD_BufFullSize = _SIZE_GREENFIFO; } - + lGreen = (ULong)(-lGreen * ps->DataInf.dwAsicBytesPerPlane); if( ps->DataInf.wPhyDataType > COLOR_TRUE24 ) @@ -434,7 +434,7 @@ static void p12ProgramCCD( pScanData ps) DBG( DBG_IO, " %u regs * %u (intermediate)\n", ps->Device.wNumCCDRegs, ps->Shade.bIntermediate ); - rp = ps->Device.pCCDRegisters + + rp = ps->Device.pCCDRegisters + (ULong)ps->Device.wNumCCDRegs * ps->Shade.bIntermediate; for( w = ps->Device.wNumCCDRegs; w--; rp++ ) { diff --git a/backend/plustek-pp_p9636.c b/backend/plustek-pp_p9636.c index 0c3fcfd3e..7fc598d51 100644 --- a/backend/plustek-pp_p9636.c +++ b/backend/plustek-pp_p9636.c @@ -244,7 +244,7 @@ static void p9636Init98001( pScanData ps, Bool shading ) ps->Device.bCCDID = bData; ps->Device.bCCDID &= _P98_CCD_TYPE_ID; DBG( DBG_HIGH, "bData = 0x%04X, PCB-ID = 0x%02X\n", bData, (bData >> 4)); - + /* encode the CCD-id into the flag parameter */ dwID = (ULong)ps->Device.bCCDID; dwID = dwID << 16; diff --git a/backend/plustek-pp_procfs.c b/backend/plustek-pp_procfs.c index ed242a8db..0cbb99930 100644 --- a/backend/plustek-pp_procfs.c +++ b/backend/plustek-pp_procfs.c @@ -62,7 +62,7 @@ #include "plustek-pp_scan.h" /* toggled by your kernel configuration */ -#ifdef CONFIG_PROC_FS +#ifdef CONFIG_PROC_FS /****************************** static vars **********************************/ @@ -197,7 +197,7 @@ static int procfsInfoReadProc( char *buf, char **start, off_t offset, MiscGetModelName(ps->sCaps.Model)); len += sprintf( buf+len, "Portaddress : 0x%X\n", ps->IO.portBase ); len += sprintf( buf+len, "Portmode : %s (%s I/O, %s)\n", - procfsGetMode(ps->IO.portMode), + procfsGetMode(ps->IO.portMode), (ps->IO.slowIO == _TRUE?"delayed":"fast"), (ps->IO.forceMode == 0?"autodetect":"forced")); len += sprintf( buf+len, "Buttons : %u\n", ps->Device.buttons); @@ -278,7 +278,7 @@ static struct proc_dir_entry *new_entry( const char *name, mode_t mode, /* position pointer of name to end of the structure*/ ent->name = ((char *) ent) + sizeof(*ent); strcpy((char *)ent->name, name ); - + ent->namelen = strlen(name); ent->mode = mode; @@ -310,7 +310,7 @@ static inline void destroy_proc_entry( struct proc_dir_entry *root, kfree(*d); #else DBG(DBG_HIGH, "pt_drv: proc del '%s' root='%s'\n", (*d)->name, root->name); - + remove_proc_entry((*d)->name, root ); #endif @@ -407,7 +407,7 @@ void ProcFsRegisterDevice( pScanData ps ) memset( &ps->procDir, 0, sizeof(ProcDirDef)); sprintf( str, "device%u", ps->devno ); - + ps->procDir.entry = new_entry( str, S_IFDIR, base ); if( NULL == ps->procDir.entry ) goto error_exit; diff --git a/backend/plustek-pp_ptdrv.c b/backend/plustek-pp_ptdrv.c index 9409e56b6..d88fba5ef 100644 --- a/backend/plustek-pp_ptdrv.c +++ b/backend/plustek-pp_ptdrv.c @@ -243,8 +243,8 @@ static CLOSETYPE pt_drv_close( struct inode *, struct file *); #else static int pt_drv_ioctl( struct inode *, struct file *, UInt, unsigned long ); #endif - - + + /* * the driver interface */ @@ -300,7 +300,7 @@ static pScanData get_pt_from_inode(struct inode *ip) /* * unit out of range */ - if (minor >= _MAX_PTDEVS ) + if (minor >= _MAX_PTDEVS ) return NULL; return( PtDrvDevices[minor] ); @@ -442,7 +442,7 @@ static void ptDrvSwitchLampOn( pScanData ps ) ps->bLastLampStatus = _SCAN_NORMALLAMP_ON; } else { - + ps->AsicReg.RD_ScanControl |= ps->bLampOn; ps->bLastLampStatus = ps->bLampOn; } @@ -484,12 +484,12 @@ static void ptdrvLampWarmup( pScanData ps ) MiscStartTimer( &timer, _SECOND * ps->warmup ); while( !MiscCheckTimer( &timer )) { - + /* on break, we setup the initial timer again... */ if( _FALSE == ps->fScanningStatus ) { MiscStartTimer( &toTimer[ps->devno], (_SECOND * ps->warmup)); - return; - } + return; + } }; } @@ -517,7 +517,7 @@ static void ptdrvLampTimerIrq( int sig_num ) pScanData ps; DBG( DBG_HIGH, "!! IRQ !! Lamp-Timer stopped.\n" ); - + #ifdef __KERNEL__ ps = (pScanData)ptr; #else @@ -539,10 +539,10 @@ static void ptdrvLampTimerIrq( int sig_num ) } else { ps->AsicReg.RD_ScanControl &= ~_SCAN_LAMP_ON; } - + /* force warmup... */ ps->bLastLampStatus = 0xFF; - + /* * claim parallel port if necessary... * if the port is busy, restart the timer @@ -847,7 +847,7 @@ static int ptdrvInit( int devno ) if( _OK == retval ) { -#ifdef __KERNEL__ +#ifdef __KERNEL__ _PRINT( "pt_drv%u: %s found on port 0x%04x\n", devno, MiscGetModelName(ps->sCaps.Model), ps->IO.pbSppDataPort ); #else @@ -1097,19 +1097,19 @@ static int ptdrvIoctl( pScanData ps, UInt cmd, pVoid arg ) if( ps->devno < _MAX_PTDEVS ) { if( adj.warmup >= 0 ) { - warmup[ps->devno] = adj.warmup; - ps->warmup = adj.warmup; - } + warmup[ps->devno] = adj.warmup; + ps->warmup = adj.warmup; + } if( adj.lampOff >= 0 ) { lampoff[ps->devno] = adj.lampOff; ps->lampoff = adj.lampOff; - } + } if( adj.lampOffOnEnd >= 0 ) { lOffonEnd[ps->devno] = adj.lampOffOnEnd; ps->lOffonEnd = adj.lampOffOnEnd; - } + } } } break; @@ -1131,13 +1131,13 @@ static int ptdrvIoctl( pScanData ps, UInt cmd, pVoid arg ) x_len = 256; if( _IS_ASIC98(ps->sCaps.AsicID)) x_len = 4096; - + /* check for 0 pointer and len */ if((NULL == map.map) || (x_len != map.len)) { DBG( DBG_LOW, "map pointer == 0, or map len invalid!!\n" ); return _E_INVALID; - } - + } + if( _MAP_MASTER == map.map_id ) { for( i = 0; i < 3; i++ ) { @@ -1159,7 +1159,7 @@ static int ptdrvIoctl( pScanData ps, UInt cmd, pVoid arg ) return _E_FAULT; } } - + /* here we adjust the maps according to * the brightness and contrast settings */ @@ -1254,7 +1254,7 @@ static int ptdrvIoctl( pScanData ps, UInt cmd, pVoid arg ) retval = _E_SEQUENCE; ps->DataInf.dwVxdFlag &= ~_VF_ENVIRONMENT_READY; - + } else { DBG( DBG_LOW, "CANCEL Mode set\n" ); } @@ -1320,7 +1320,7 @@ static int ptdrvRead( pScanData ps, pUChar buffer, int count ) if( _FALSE == ps->fScanningStatus ) return _E_ABORT; - + /* * has the environment been set ? * this should prevent the driver from causing a seg-fault @@ -1374,7 +1374,7 @@ static int ptdrvRead( pScanData ps, pUChar buffer, int count ) (unsigned long)ps->Scan.bp.pMonoBuf, ps->DataInf.dwAppPhyBytesPerLine, (unsigned long)scaleBuf ); - /* + /* * in case of a previous problem, move the sensor back home */ MotorToHomePosition( ps ); @@ -1382,8 +1382,8 @@ static int ptdrvRead( pScanData ps, pUChar buffer, int count ) if( _FALSE == ps->fScanningStatus ) { retval = _E_ABORT; goto ReadFinished; - } - + } + dwLinesRead = 0; /* @@ -1465,7 +1465,7 @@ static int ptdrvRead( pScanData ps, pUChar buffer, int count ) if( ps->Scan.dwLinesToRead > ps->DataInf.dwAppLinesPerArea ) ps->Scan.dwLinesToRead = ps->DataInf.dwAppLinesPerArea; - + ps->DataInf.dwAppLinesPerArea -= ps->Scan.dwLinesToRead; if (ps->DataInf.dwScanFlag & SCANDEF_BmpStyle) @@ -1638,7 +1638,7 @@ int init_module( void ) (S_IFCHR | S_IRUGO | S_IWUGO | S_IFCHR), &pt_drv_fops, NULL ); # else /* DEVFS_26_STYLE */ - devfs_mk_cdev(MKDEV(_PTDRV_MAJOR, devCount), + devfs_mk_cdev(MKDEV(_PTDRV_MAJOR, devCount), (S_IFCHR | S_IRUGO | S_IWUGO | S_IFCHR), "scanner/pt_drv%d", devCount); # endif @@ -1787,7 +1787,7 @@ static int pt_drv_open(struct inode *inode, struct file *file) return -EAGAIN; #else MOD_INC_USE_COUNT; -#endif +#endif ps->flags |= _PTDRV_OPEN; return _OK; @@ -1811,7 +1811,7 @@ static CLOSETYPE pt_drv_close(struct inode * inode, struct file * file) module_put(THIS_MODULE); #else MOD_DEC_USE_COUNT; -#endif +#endif CLOSERETURN(0); } else { @@ -1851,7 +1851,7 @@ static ssize_t pt_drv_read( struct file *file, */ if( _TRUE == deviceScanning ) { printk( KERN_INFO "pt_drv: device %u busy!!!\n", ps->devno ); - return(-EBUSY); + return(-EBUSY); } deviceScanning = _TRUE; @@ -1924,7 +1924,7 @@ static int PtDrvInit( const char *dev_name, UShort model_override ) port[0] = fd; mov[0] = model_override; - + result = ptdrvInit( 0 ); if( _OK == result ) { diff --git a/backend/plustek-pp_scale.c b/backend/plustek-pp_scale.c index 295a5665c..6879d6692 100644 --- a/backend/plustek-pp_scale.c +++ b/backend/plustek-pp_scale.c @@ -101,7 +101,7 @@ _LOC void ScaleX( pScanData ps, pUChar inBuf, pUChar outBuf ) ddax = 0; x = 0; if( 0 == step ) { - + /* binary scaling */ memset( outBuf, 0, ps->DataInf.dwAppBytesPerLine ); @@ -134,7 +134,7 @@ _LOC void ScaleX( pScanData ps, pUChar inBuf, pUChar outBuf ) while( ddax < 0 ) { for( j = 0; j < (ULong)step; j++ ) { - + if((x+j) < ps->DataInf.dwAppBytesPerLine ) { outBuf[x+j] = inBuf[i+j]; } diff --git a/backend/plustek-pp_scandata.h b/backend/plustek-pp_scandata.h index 1ba2c05c6..1fb987cdb 100644 --- a/backend/plustek-pp_scandata.h +++ b/backend/plustek-pp_scandata.h @@ -162,10 +162,10 @@ typedef struct scandata */ ULong devno; int lampoff; - int warmup; + int warmup; int lOffonEnd; - /* + /* * CHECK for controlling the ECP-mode (not used now) */ #if 0 @@ -188,7 +188,7 @@ typedef struct scandata UShort TimePerLine; /* --> to Device */ /* - * scanner properties + * scanner properties */ RegData AsicReg; /* here we have the 98001/3 register set */ Reg96 Asic96Reg; /* here we hold the 96001/3 specific regs */ @@ -287,7 +287,7 @@ typedef struct scandata */ DataInfo DataInf; Bool fReshaded; - ULong dwDitherIndex; + ULong dwDitherIndex; Bool fDoFilter, fFilterFirstLine; ULong dwDivFilter; ULong dwMul; @@ -606,9 +606,9 @@ typedef struct scandata Byte RegFifoFullLength1; Byte RegFifoFullLength2; - Byte RegMotorTotalStep0; + Byte RegMotorTotalStep0; Byte RegMotorTotalStep1; - Byte RegMotorFreeRunCount0; + Byte RegMotorFreeRunCount0; Byte RegMotorFreeRunCount1; Byte RegScanControl1; Byte RegMotorFreeRunTrigger; diff --git a/backend/plustek-pp_sysdep.h b/backend/plustek-pp_sysdep.h index 9e064d2b2..73d00a403 100644 --- a/backend/plustek-pp_sysdep.h +++ b/backend/plustek-pp_sysdep.h @@ -1,5 +1,5 @@ /* @file plustek-pp_sysdep.h - * @brief a trial to centralize changes between the different + * @brief a trial to centralize changes between the different * kernel-versions some stuff is maybe not relevant, but anyway... * * Copyright (C) 2000-2013 Gerhard Jaeger diff --git a/backend/plustek-pp_tpa.c b/backend/plustek-pp_tpa.c index 021bad639..f2ca1f0ce 100644 --- a/backend/plustek-pp_tpa.c +++ b/backend/plustek-pp_tpa.c @@ -104,7 +104,7 @@ static void tpaP98SubNoise( pScanData ps, pULong pdwSum, pUShort pwShading, for (dwLines = _DEF_DARKEST_SKIP; dwLines--; pw += 5400UL) dwSum += (ULong) *pw; - + *pwShading = (UShort)((*pdwSum - dwSum) / ps->Shade.dwDiv); } if (ps->dwShadingPixels != 5400UL) { @@ -247,7 +247,7 @@ static void tpaP98GetNegativeTempRamData( pScanData ps ) pNegativeTempRam[dw] = (UShort)((pdwNegativeSumTemp[dw1] + pdwNegativeSumTemp[dw1+1] + pdwNegativeSumTemp[dw1+2] + - pdwNegativeSumTemp[dw1+3]) / 128); + pdwNegativeSumTemp[dw1+3]) / 128); /* shift 6 bits */ } @@ -259,7 +259,7 @@ static void tpaP98GetNegativeTempRamData( pScanData ps ) } /* do R shading average */ - for (dw = 0; dw < 240; dw++, dw1 += 4) { + for (dw = 0; dw < 240; dw++, dw1 += 4) { pNegativeTempRam2[dw] = (UShort)( (((pUShort)ps->pScanBuffer1)[dw1] + ((pUShort)ps->pScanBuffer1)[dw1+1] + diff --git a/backend/plustek-pp_wrapper.c b/backend/plustek-pp_wrapper.c index ba635ef12..c41d340c6 100644 --- a/backend/plustek-pp_wrapper.c +++ b/backend/plustek-pp_wrapper.c @@ -56,7 +56,7 @@ /******************* wrapper functions for parport device ********************/ #ifndef _BACKEND_ENABLED - + static int PtDrvInit( char *dev_name, unsigned short model_override ) { _VAR_NOT_USED( dev_name ); @@ -124,7 +124,7 @@ static int ppDev_open( const char *dev_name, void *misc ) handle = PtDrvOpen(); else handle = open( dev_name, O_RDONLY ); - + if ( handle < 0 ) { DBG( _DBG_ERROR, "open: can't open %s as a device\n", dev_name ); return handle; @@ -134,7 +134,7 @@ static int ppDev_open( const char *dev_name, void *misc ) result = PtDrvIoctl( _PTDRV_OPEN_DEVICE, &version ); else result = ioctl( handle, _PTDRV_OPEN_DEVICE, &version ); - + if( result < 0 ) { if( -9019 == result ) { @@ -149,14 +149,14 @@ static int ppDev_open( const char *dev_name, void *misc ) result = PtDrvIoctl( _PTDRV_OPEN_DEVICE, &version ); else result = ioctl( handle, _PTDRV_OPEN_DEVICE, &version ); - + if( result < 0 ) { - + if( dev->adj.direct_io ) PtDrvClose(); else close( dev->fd ); - + DBG( _DBG_ERROR, "ioctl PT_DRV_OPEN_DEVICE failed(%d)\n", result ); @@ -294,23 +294,23 @@ static int ppDev_setMap( Plustek_Device *dev, SANE_Word *map, m.map_id = channel; m.map = (void *)map; - + DBG(_DBG_INFO,"Setting map[%u] at 0x%08lx\n", channel, (unsigned long)map); buf = (SANE_Byte*)malloc( m.len ); - + if( !buf ) return _E_ALLOC; - + for( i = 0; i < m.len; i++ ) { buf[i] = (SANE_Byte)map[i]; - + if( map[i] > 0xFF ) buf[i] = 0xFF; } - + m.map = buf; - + if( dev->adj.direct_io ) PtDrvIoctl( _PTDRV_SETMAP, &m ); else @@ -334,7 +334,7 @@ static int ppDev_stopScan( Plustek_Device *dev, short *mode ) retval = PtDrvIoctl( _PTDRV_STOP_SCAN, mode ); else retval = ioctl( dev->fd, _PTDRV_STOP_SCAN, mode ); - + /* ... and use it here */ if( 0 == tmp ) { if( dev->adj.direct_io ) diff --git a/backend/plustek-usb.c b/backend/plustek-usb.c index 6c9e67a8d..5c6fbebec 100644 --- a/backend/plustek-usb.c +++ b/backend/plustek-usb.c @@ -147,7 +147,7 @@ static SANE_Bool usb_normFileName( char *fname, char* buffer, u_long max_len ) } *dst = '\0'; - return SANE_TRUE; + return SANE_TRUE; } /** do some range checking and copy the adjustment values from the @@ -216,13 +216,13 @@ usb_initDev( Plustek_Device *dev, int idx, int handle, int vendor ) /* adjust data origin */ - dev->usbDev.Caps.Positive.DataOrigin.x -= dev->adj.tpa.x; - dev->usbDev.Caps.Positive.DataOrigin.y -= dev->adj.tpa.y; + dev->usbDev.Caps.Positive.DataOrigin.x -= dev->adj.tpa.x; + dev->usbDev.Caps.Positive.DataOrigin.y -= dev->adj.tpa.y; - dev->usbDev.Caps.Negative.DataOrigin.x -= dev->adj.neg.x; - dev->usbDev.Caps.Negative.DataOrigin.y -= dev->adj.neg.y; + dev->usbDev.Caps.Negative.DataOrigin.x -= dev->adj.neg.x; + dev->usbDev.Caps.Negative.DataOrigin.y -= dev->adj.neg.y; - dev->usbDev.Caps.Normal.DataOrigin.x -= dev->adj.pos.x; + dev->usbDev.Caps.Normal.DataOrigin.x -= dev->adj.pos.x; dev->usbDev.Caps.Normal.DataOrigin.y -= dev->adj.pos.y; /** adjust shading position @@ -297,13 +297,13 @@ usb_initDev( Plustek_Device *dev, int idx, int handle, int vendor ) sParam.Size.dwPixels = 0; /* create calibration-filename */ - sprintf( tmp_str2, "%s-%s", + sprintf( tmp_str2, "%s-%s", dev->sane.vendor, dev->usbDev.ModelStr ); if( !usb_normFileName( tmp_str2, tmp_str1, PATH_MAX )) { strcpy( tmp_str1, "plustek-default" ); } - + ptr = getenv ("HOME"); if( NULL == ptr ) { sprintf( tmp_str2, "/tmp/%s", tmp_str1 ); @@ -378,7 +378,7 @@ static int usb_CheckForPlustekDevice( int handle, Plustek_Device *dev ) /* now roam through the setting list... */ strncpy( tmp, dev->usbId, 13 ); tmp[13] = '\0'; - + sprintf( pcbStr, "-%u", pcbID ); strcat ( tmp, pcbStr ); @@ -392,7 +392,7 @@ static int usb_CheckForPlustekDevice( int handle, Plustek_Device *dev ) return handle; } } - + return -1; } @@ -416,7 +416,7 @@ static void usbDev_shutdown( Plustek_Device *dev ) DBG( _DBG_INFO, "Waiting for scanner-ready...\n" ); usb_IsScannerReady( dev ); - + if( 0 != dev->usbDev.bLampOffOnEnd ) { DBG( _DBG_INFO, "Switching lamp off...\n" ); @@ -439,7 +439,7 @@ static void usbDev_shutdown( Plustek_Device *dev ) static SANE_Bool usb_IsDeviceInList( char *usbIdStr ) { int i; - + for( i = 0; NULL != Settings[i].pIDString; i++ ) { if( 0 == strncmp( Settings[i].pIDString, usbIdStr, 13 )) @@ -516,7 +516,7 @@ usbGetList( DevList **devs ) il = SANE_TRUE; break; } - } + } if( il ) { DBG( _DBG_INFO2, "Already in list: 0x%04x-0x%04x\n", v, p ); continue; @@ -528,7 +528,7 @@ usbGetList( DevList **devs ) sanei_usb_find_devices( v, p, usb_attach ); if( getLast(*devs) != tmp ) { - + if( tmp == NULL ) tmp = *devs; else @@ -547,7 +547,7 @@ usbGetList( DevList **devs ) DBG( _DBG_INFO, "NONE.\n" ); for( tmp = *devs; tmp; tmp = tmp->next ) { - DBG( _DBG_INFO, "Device: >%s< - 0x%04xx0x%04x\n", + DBG( _DBG_INFO, "Device: >%s< - 0x%04xx0x%04x\n", tmp->dev_name, tmp->vendor_id, tmp->device_id ); } } @@ -568,7 +568,7 @@ static int usbDev_open( Plustek_Device *dev, DevList *devs, int keep_lock ) SANE_Status status; DevList *tmp; - DBG( _DBG_INFO, "usbDev_open(%s,%s) - %p\n", + DBG( _DBG_INFO, "usbDev_open(%s,%s) - %p\n", dev->name, dev->usbId, (void*)devs ); /* preset our internal usb device structure */ @@ -576,7 +576,7 @@ static int usbDev_open( Plustek_Device *dev, DevList *devs, int keep_lock ) /* devs is NULL, when called from sane_start */ if( devs ) { - + dn[0] = '\0'; if( !strcmp( dev->name, "auto" )) { @@ -618,7 +618,7 @@ static int usbDev_open( Plustek_Device *dev, DevList *devs, int keep_lock ) status = sanei_usb_open( dn, &handle ); if( SANE_STATUS_GOOD != status ) { - DBG( _DBG_ERROR, "sanei_usb_open failed: %s (%d)\n", + DBG( _DBG_ERROR, "sanei_usb_open failed: %s (%d)\n", strerror(errno), errno); sanei_access_unlock( dev->sane.name ); return -1; @@ -629,7 +629,7 @@ static int usbDev_open( Plustek_Device *dev, DevList *devs, int keep_lock ) */ free( dev->name ); dev->name = strdup(dn); - dev->sane.name = dev->name; + dev->sane.name = dev->name; } else { @@ -641,7 +641,7 @@ static int usbDev_open( Plustek_Device *dev, DevList *devs, int keep_lock ) status = sanei_usb_open( dev->name, &handle ); if( SANE_STATUS_GOOD != status ) { - DBG( _DBG_ERROR, "sanei_usb_open failed: %s (%d)\n", + DBG( _DBG_ERROR, "sanei_usb_open failed: %s (%d)\n", strerror(errno), errno); sanei_access_unlock( dev->sane.name ); return -1; @@ -659,7 +659,7 @@ static int usbDev_open( Plustek_Device *dev, DevList *devs, int keep_lock ) DBG(_DBG_INFO,"Vendor ID=0x%04X, Product ID=0x%04X\n",vendor,product); if( dev->usbId[0] != '\0' ) { - + if( 0 != strcmp( dev->usbId, devStr )) { DBG( _DBG_ERROR, "Specified Vendor and Product ID " "doesn't match with the ones\n" @@ -735,9 +735,9 @@ static int usbDev_open( Plustek_Device *dev, DevList *devs, int keep_lock ) * product ID and up to 7 different devices... */ if( 0x07B3 == vendor ) { - + handle = usb_CheckForPlustekDevice( handle, dev ); - + if( was_empty ) dev->usbId[0] = '\0'; @@ -746,7 +746,7 @@ static int usbDev_open( Plustek_Device *dev, DevList *devs, int keep_lock ) sanei_access_unlock( dev->sane.name ); return handle; } - + } else { /* now roam through the setting list... */ @@ -853,9 +853,9 @@ static int usbDev_setMap( Plustek_Device *dev, SANE_Word *map, DBG(_DBG_INFO,"Setting map[%u] at 0x%08lx\n",channel,(unsigned long)map); _VAR_NOT_USED( dev ); - + if( channel == _MAP_MASTER ) { - + for( i = 0; i < length; i++ ) { a_bMap[i] = (SANE_Byte)map[i]; a_bMap[length +i] = (SANE_Byte)map[i]; @@ -939,7 +939,7 @@ usbDev_setScanEnv( Plustek_Device *dev, ScanInfo *si ) usb_GetImageInfo ( dev, &si->ImgDef, &scan->sParam.Size ); /* mask the flags */ - scan->dwFlag = si->ImgDef.dwFlag & + scan->dwFlag = si->ImgDef.dwFlag & (SCANFLAG_bgr | SCANFLAG_BottomUp | SCANFLAG_Calibration | SCANFLAG_DWORDBoundary | SCANFLAG_RightAlign | SCANFLAG_StillModule | SCANDEF_Adf | SCANDEF_ContinuousScan); @@ -1141,10 +1141,10 @@ usbDev_Prepare( Plustek_Device *dev, SANE_Byte *buf ) /* CIS devices need special handling... */ if( usb_IsCISDevice(dev)) { use_alt_cal = SANE_TRUE; - + } else { - if( dev->adj.altCalibrate ) + if( dev->adj.altCalibrate ) use_alt_cal = SANE_TRUE; } @@ -1350,16 +1350,16 @@ usbDev_Prepare( Plustek_Device *dev, SANE_Byte *buf ) if( !usb_ScanBegin( dev, (scan->dwFlag&SCANFLAG_StillModule) ? SANE_FALSE:SANE_TRUE)) { - + return _E_INTERNAL; } - + scan->dwFlag |= SCANFLAG_Scanning; if( scan->sParam.UserDpi.y != scan->sParam.PhyDpi.y ) { - + if( scan->sParam.UserDpi.y < scan->sParam.PhyDpi.y ) { - + scan->wSumY = scan->sParam.PhyDpi.y - scan->sParam.UserDpi.y; scan->dwFlag |= SCANFLAG_SampleY; DBG( _DBG_INFO, "SampleY Flag set (%u != %u, wSumY=%u)\n", @@ -1374,7 +1374,7 @@ usbDev_Prepare( Plustek_Device *dev, SANE_Byte *buf ) * as the SANE stuff already forked the driver to read data, I think * we should only read data by using a function... */ - scan->dwLinesUser = scan->sParam.Size.dwLines; + scan->dwLinesUser = scan->sParam.Size.dwLines; if( !scan->dwLinesUser ) return _E_BUFFER_TOO_SMALL; @@ -1388,10 +1388,10 @@ usbDev_Prepare( Plustek_Device *dev, SANE_Byte *buf ) scan->UserBuf.pb = buf; DBG(_DBG_INFO,"Reading the data now!\n" ); - DBG(_DBG_INFO,"PhyDpi.x = %u\n", scan->sParam.PhyDpi.x ); - DBG(_DBG_INFO,"PhyDpi.y = %u\n", scan->sParam.PhyDpi.y ); - DBG(_DBG_INFO,"UserDpi.x = %u\n", scan->sParam.UserDpi.x ); - DBG(_DBG_INFO,"UserDpi.y = %u\n", scan->sParam.UserDpi.y ); + DBG(_DBG_INFO,"PhyDpi.x = %u\n", scan->sParam.PhyDpi.x ); + DBG(_DBG_INFO,"PhyDpi.y = %u\n", scan->sParam.PhyDpi.y ); + DBG(_DBG_INFO,"UserDpi.x = %u\n", scan->sParam.UserDpi.x ); + DBG(_DBG_INFO,"UserDpi.y = %u\n", scan->sParam.UserDpi.y ); DBG(_DBG_INFO,"NumberOfScanBufs = %lu\n",scan->dwNumberOfScanBufs); DBG(_DBG_INFO,"LinesPerScanBufs = %lu\n",scan->dwLinesPerScanBufs); DBG(_DBG_INFO,"dwPhyBytes = %lu\n",scan->sParam.Size.dwPhyBytes); diff --git a/backend/plustek-usb.h b/backend/plustek-usb.h index 0f001c922..e686c7995 100644 --- a/backend/plustek-usb.h +++ b/backend/plustek-usb.h @@ -381,7 +381,7 @@ enum SCANFLAG SCANFLAG_BottomUp = 0x00008000, SCANFLAG_DWORDBoundary = 0x00020000, SCANFLAG_RightAlign = 0x00040000, - SCANFLAG_StillModule = 0x00080000, + SCANFLAG_StillModule = 0x00080000, SCANFLAG_Pseudo48 = 0x08000000, SCANFLAG_SampleY = 0x04000000, SCANFLAG_Calibration = 0x10000000, @@ -469,10 +469,10 @@ typedef struct HWDefault u_char bReg_0x0f_Mono [10]; /* 0x0f to 0x18 */ u_char bReg_0x0f_Color [10]; /* 0x0f to 0x18 */ - /* color mode settings */ + /* color mode settings */ u_char bReg_0x26; u_char bReg_0x27; - + /* illumination mode reg 0x29 (runtime) */ u_char bReg_0x29; @@ -484,7 +484,7 @@ typedef struct HWDefault * format, you have to pay your attention when you * write this value to register. */ - u_short StepperPhaseCorrection; + u_short StepperPhaseCorrection; /* Sensor Pixel Configuration * Actually, the wActivePixelsStart will be set to 0 for shading purpose. @@ -656,11 +656,11 @@ typedef struct ScanDef AnyPtr Green; AnyPtr Red; AnyPtr Blue; - + long lBufAdjust; /**< bytes to adjust buffer pointer */ /* after a image line processed */ u_short wSumY; /**< for line sampling */ - + u_char bLineDistance; /**< Color offset in specific dpi y */ int fGrayFromColor; /**< channel to use for gray mode */ diff --git a/backend/plustek-usbcal.c b/backend/plustek-usbcal.c index f2e760899..3b9d93ad4 100644 --- a/backend/plustek-usbcal.c +++ b/backend/plustek-usbcal.c @@ -21,7 +21,7 @@ * or can test. * * Therefore, I'm splitting out a few calibration functions I need - * to modify for the CanoScan which allows me to simplify things + * to modify for the CanoScan which allows me to simplify things * greatly for the CanoScan without worrying about breaking other * scanners, as well as reuse the vast majority of the Plustek * driver infrastructure without forking. @@ -109,7 +109,7 @@ cano_PrepareToReadWhiteCal( Plustek_Device *dev, SANE_Bool mv2shading_pos ) { SANE_Bool goto_shading_pos = SANE_TRUE; HWDef *hw = &dev->usbDev.HwSetting; - + switch (strip_state) { case 0: if( !usb_IsSheetFedDevice(dev)) { @@ -152,7 +152,7 @@ cano_PrepareToReadBlackCal( Plustek_Device *dev ) if( strip_state == 0 ) if(cano_PrepareToReadWhiteCal(dev, SANE_FALSE)) return SANE_FALSE; - + if( strip_state != 2 ) { /* * if we have a dark shading strip, there's no need to switch @@ -203,7 +203,7 @@ cano_LampOnAfterCalibration( Plustek_Device *dev ) * @param max - pointer to the max OFF point for the CIS-channel * @param off - pointer to the current OFF point of the CIS-channel * @param val - current value to check - * @return returns 0 if the value is fine, 1, if we need to adjust + * @return returns 0 if the value is fine, 1, if we need to adjust */ static int cano_adjLampSetting( u_short *min, u_short *max, u_short *off, u_short val ) @@ -249,7 +249,7 @@ cano_adjLampSetting( u_short *min, u_short *max, u_short *off, u_short val ) * coarse calibration step 0 * [Monty changes]: On the CanoScan at least, the default lamp * settings are several *hundred* percent too high and vary from - * scanner-to-scanner by 20-50%. This is only for CIS devices + * scanner-to-scanner by 20-50%. This is only for CIS devices * where the lamp_off parameter is adjustable; I'd make it more general, * but I only have the CIS hardware to test. */ @@ -305,7 +305,7 @@ cano_AdjustLightsource( Plustek_Device *dev ) min_rgb.Green = hw->green_lamp_on; min_rgb.Blue = hw->blue_lamp_on; - if((dev->adj.rlampoff != -1) && + if((dev->adj.rlampoff != -1) && (dev->adj.glampoff != -1) && (dev->adj.rlampoff != -1)) { DBG( _DBG_INFO, "- function skipped, using frontend values!\n" ); return SANE_TRUE; @@ -393,10 +393,10 @@ cano_AdjustLightsource( Plustek_Device *dev ) DBG( _DBG_INFO2, "red_lamp_off = %u/%u/%u\n", min_rgb.Red ,hw->red_lamp_off, max_rgb.Red ); } - + DBG( _DBG_INFO2, "green_lamp_off = %u/%u/%u\n", min_rgb.Green, hw->green_lamp_off, max_rgb.Green ); - + if( m_ScanParam.bDataType == SCANDATATYPE_Color ) { DBG( _DBG_INFO2, "blue_lamp_off = %u/%u/%u\n", min_rgb.Blue, hw->blue_lamp_off, max_rgb.Blue ); @@ -528,7 +528,7 @@ cano_AdjustGain( Plustek_Device *dev ) DBG( _DBG_INFO, "cano_AdjustGain()\n" ); if( !usb_InCalibrationMode(dev)) { - if((dev->adj.rgain != -1) && + if((dev->adj.rgain != -1) && (dev->adj.ggain != -1) && (dev->adj.bgain != -1)) { setAdjGain( dev->adj.rgain, &dev->usbDev.a_bRegs[0x3b] ); setAdjGain( dev->adj.ggain, &dev->usbDev.a_bRegs[0x3c] ); @@ -559,11 +559,11 @@ cano_AdjustGain( Plustek_Device *dev ) DBG( _DBG_INFO2, "Pixels = %lu\n", m_ScanParam.Size.dwPixels ); DBG( _DBG_INFO2, "Bytes = %lu\n", m_ScanParam.Size.dwBytes ); DBG( _DBG_INFO2, "Origin.X = %u\n", m_ScanParam.Origin.x ); - + while( adj ) { m_ScanParam.dMCLK = dMCLK; - + if( !usb_SetScanParameters( dev, &m_ScanParam )) return SANE_FALSE; @@ -615,7 +615,7 @@ cano_AdjustGain( Plustek_Device *dev ) dwR = dwR / dwDiv; dwG = dwG / dwDiv; dwB = dwB / dwDiv; - + if(max_rgb.Red < dwR) max_rgb.Red = dwR; if(max_rgb.Green < dwG) @@ -764,7 +764,7 @@ cano_AdjustOffset( Plustek_Device *dev ) u_long *scanbuf = dev->scanning.pScanBuffer; HWDef *hw = &dev->usbDev.HwSetting; DCapsDef *scaps = &dev->usbDev.Caps; - + if( usb_IsEscPressed()) return SANE_FALSE; @@ -977,13 +977,13 @@ cano_AdjustDarkShading( Plustek_Device *dev, u_short cal_dpi ) /* average the n lines, compute reg values */ if( scan->sParam.bDataType == SCANDATATYPE_Color ) { - + stepW = m_ScanParam.Size.dwPhyPixels; if( usb_IsCISDevice(dev)) step = m_ScanParam.Size.dwPhyPixels + 1; else step = (m_ScanParam.Size.dwPhyPixels*3) + 1; - + for( i=0; ifCalibrated = SANE_TRUE; - + DBG( _DBG_INFO, "cano_DoCalibration() done\n" ); DBG( _DBG_INFO, "-------------------------\n" ); DBG( _DBG_INFO, "Static Gain:\n" ); diff --git a/backend/plustek-usbcalfile.c b/backend/plustek-usbcalfile.c index afea3f9d5..6f5a36433 100644 --- a/backend/plustek-usbcalfile.c +++ b/backend/plustek-usbcalfile.c @@ -67,7 +67,7 @@ typedef struct { u_long blue_light_on; u_long blue_light_off; u_long green_pwm_duty; - + } LightCtrl; typedef struct { @@ -106,7 +106,7 @@ usb_ReadSpecLine( FILE *fp, char *id, char* res ) { char tmp[1024]; char *ptr; - + /* rewind file pointer */ if( 0 != fseek( fp, 0L, SEEK_SET)) { DBG( _DBG_ERROR, "fseek: %s\n", strerror(errno)); @@ -124,7 +124,7 @@ usb_ReadSpecLine( FILE *fp, char *id, char* res ) ptr = &tmp[strlen(id)]; if( '\0' == *ptr ) break; - + strcpy( res, ptr ); res[strlen(res)-1] = '\0'; return SANE_TRUE; @@ -176,7 +176,7 @@ usb_ReadOtherLines( FILE *fp, char *except ) /* we ignore the version line... */ if( 0 == strncmp( tmp, "version=", 8 )) continue; - + if( !ignore ) { if(0 != strncmp(tmp, except, strlen(except))) { @@ -225,9 +225,9 @@ usb_ReadSamples( FILE *fp, char *which, u_long *dim, u_short *buffer ) if( NULL != fgets( rb, 1024, fp )) { /* we ignore the version line... */ - if( 0 == strncmp( tmp, "version=", 8 )) + if( 0 == strncmp( tmp, "version=", 8 )) continue; - + p = tmp; if( !ignore && diml == 0) { if(0 == strncmp(tmp, which, strlen(which))) { @@ -271,7 +271,7 @@ usb_ReadSamples( FILE *fp, char *which, u_long *dim, u_short *buffer ) /* reached the end? */ if( *next == '\0' ) { - /* we probably have only parsed a part of a value + /* we probably have only parsed a part of a value * so we copy that back to the input buffer and * parse it the next time... */ @@ -372,7 +372,7 @@ usb_ReadAndSetCalData( Plustek_Device *dev ) FILE *fp; CalData cal; SANE_Bool ret; - + DBG( _DBG_INFO, "usb_ReadAndSetCalData()\n" ); if( usb_InCalibrationMode(dev)) { @@ -388,7 +388,7 @@ usb_ReadAndSetCalData( Plustek_Device *dev ) sprintf( tmp, "%s-coarse.cal", dev->calFile ); DBG( _DBG_INFO, "- Reading coarse calibration data from file\n"); DBG( _DBG_INFO, " %s\n", tmp ); - + fp = fopen( tmp, "r" ); if( NULL == fp ) { DBG( _DBG_ERROR, "File %s not found\n", tmp ); @@ -416,7 +416,7 @@ usb_ReadAndSetCalData( Plustek_Device *dev ) } usb_CreatePrefix( dev, pfx, SANE_TRUE ); - + ret = SANE_FALSE; if( usb_ReadSpecLine( fp, pfx, tmp )) { DBG( _DBG_INFO, "- Calibration data: %s\n", tmp ); @@ -445,7 +445,7 @@ usb_ReadAndSetCalData( Plustek_Device *dev ) fclose( fp ); DBG( _DBG_INFO, "usb_ReadAndSetCalData() done -> %u\n", ret ); - + return ret; } @@ -526,7 +526,7 @@ usb_SaveCalData( Plustek_Device *dev ) other_tmp = NULL; fp = fopen( fn, "r+" ); if( NULL != fp ) { - + if( usb_ReadSpecLine( fp, "version=", tmp )) { DBG( _DBG_INFO, "- Calibration file version: %s\n", tmp ); @@ -553,7 +553,7 @@ usb_SaveCalData( Plustek_Device *dev ) if( NULL == fp ) { DBG( _DBG_ERROR, "- Cannot create file %s\n", fn ); DBG( _DBG_ERROR, "- -> %s\n", strerror(errno)); - if( other_tmp ) + if( other_tmp ) free( other_tmp ); return; } @@ -603,7 +603,7 @@ usb_SaveFineCalData( Plustek_Device *dev, int dpi, other_tmp = NULL; fp = fopen( fn, "r+" ); if( NULL != fp ) { - + if( usb_ReadSpecLine( fp, "version=", tmp )) { DBG( _DBG_INFO, "- Calibration file version: %s\n", tmp ); @@ -664,7 +664,7 @@ usb_ReadFineCalData( Plustek_Device *dev, int dpi, char tmp[1024]; u_short version; FILE *fp; - + DBG( _DBG_INFO, "usb_ReadFineCalData()\n" ); if( usb_InCalibrationMode(dev)) { DBG( _DBG_INFO, "- we are in calibration mode!\n" ); diff --git a/backend/plustek-usbdevs.c b/backend/plustek-usbdevs.c index 4f53863f2..8698e5475 100644 --- a/backend/plustek-usbdevs.c +++ b/backend/plustek-usbdevs.c @@ -115,7 +115,7 @@ * If you do not wish that, delete this exception notice. *
*/ - + /* the other stuff is included by plustek.c ...*/ #include "plustek-usb.h" @@ -146,11 +146,11 @@ static DCapsDef Cap0x07B3_0x0017_0 = }, { /* Negative */ {1004 + 55, 744 + 12}, /* DataOrigin (X: 7cm + 1.5cm, Y: 8mm + 5.5cm)*/ - + /* 533 blaustichig */ 537 /* hell */ /* 543 gruenstichig */ - + /*543*/, -1, /* ShadingOriginY (Y: 8mm + 3.8cm) */ {567, 414}, /* Size (X: 4.8cm, Y: 3.5cm) */ {150, 150} /* MinDpi */ @@ -332,7 +332,7 @@ static DCapsDef Cap0x07B3_0x0013_4 = {{1004 + 20, 744 - 20}, 543, -1, { 567, 414}, {150, 150}}, {{ 0, 95}, 0, -1, {2550, 3508}, { 50, 50}}, {1200, 1200}, - DEVCAPSFLAG_Positive + DEVCAPSFLAG_Negative, + DEVCAPSFLAG_Positive + DEVCAPSFLAG_Negative, SENSORORDER_rgb, 12, 4, kNEC3778, 0x03, _WAF_NONE, _NO_MIO }; @@ -844,7 +844,7 @@ static HWDef Hw0x07B3_0x0017_0 = {2, 7, 0, 1, 0, 0, 0, 0, 4, 0}, /* bReg_0x0f_Color [10] (0x0f to 0x18) */ {5, 23, 1, 3, 0, 0, 0, 12, 10, 22}, - + _GREEN_CH, /* bReg_0x26 color mode - bits 4 and 5 */ 0, /* bReg 0x27 color mode */ @@ -1102,9 +1102,9 @@ static HWDef Hw0x07B3_0x0013_0 = 0, 0x1e, 0xa8, - 0, + 0, 0xff, - 64, + 64, 20, 0x0d, 0x22, 0x82, 0x88, 0, 0, 0, @@ -1128,15 +1128,15 @@ static HWDef Hw0x07B3_0x0013_4 = {20, 4, 13, 16, 19, 22, 0, 0, 23, 11}, _GREEN_CH, 0, - 1, + 1, /* illumination mode settings (not used for CCD devices) */ { 0, 0, 0, 0, 0, 0, 0 }, { 0, 0, 0, 0, 0, 0, 0 }, 1, 13, - 62, - 320, - 10684, + 62, + 320, + 10684, 0, 16383, 0, @@ -1164,9 +1164,9 @@ static HWDef Hw0x07B3_0x000F_4 = { 1.1, 0.9, 0.0, 12, 12, - 600, - 2048, - 8, 8, + 600, + 2048, + 8, 8, 4095, 4095, 0x06, 0x30, 0x2f, 0x2a, {2, 7, 5, 6, 6, 7, 0, 0, 0, 5}, @@ -1259,7 +1259,7 @@ static HWDef Hw0x07B3_0x0017_4 = 8, 8, 4095, 4095, 0x06, 0x20, 0x2f, 0x2a, - {2, 7, 5, 6, 6, 7, 0, 0, 0, 5}, + {2, 7, 5, 6, 6, 7, 0, 0, 0, 5}, {20, 4, 13, 16, 19, 22, 0, 0, 23, 11}, _GREEN_CH, 0, @@ -1327,7 +1327,7 @@ static HWDef Hw0x07B3_0x0017_1 = 0, 0x1e, 0xa8, - 0, + 0, 0xff, 64, 20, @@ -1414,7 +1414,7 @@ static HWDef Hw0x07B3_0x0017_2 = 0, 16383, 3, - 0, + 0, 0x1e, 0xa8, 0, @@ -1498,10 +1498,10 @@ static HWDef Hw0x03F0_0x0505 = /* bReg_0x0f_Color[10] (0x0f to 0x18) */ { 0x08, 0x17, 0x00, 0x03, 0x08, 0x0b, 0x00, 0x00, 0x0a, 0x14 }, - + _GREEN_CH, /* bReg_0x26 color mode - bits 4 and 5 */ 0, /* bReg 0x27 color mode */ - + 1, /* bReg 0x29 illumination mode */ /* illumination mode settings (not used for CCD devices) */ @@ -1520,7 +1520,7 @@ static HWDef Hw0x03F0_0x0505 = 1, /* green lamp off (reg 0x32 + 0x33) */ 16383, /* blue lamp on (reg 0x34 + 0x35) */ 1, /* blue lamp off (reg 0x36 + 0x37) */ - + /* Misc */ 0x13, /* bReg_0x45 */ 0, /* wStepsAfterPaperSensor2 (0x4c & 0x4d) */ @@ -1566,7 +1566,7 @@ static HWDef Hw0x03F0_0x0605 = /* bReg_0x0f_Color[10] (0x0f to 0x18) */ { 0x08, 0x17, 0x00, 0x03, 0x08, 0x0b, 0x00, 0x00, 0x0a, 0x14 }, - + _GREEN_CH, /* bReg_0x26 color mode - bits 4 and 5 */ 0, /* bReg 0x27 color mode */ 1, /* bReg 0x29 illumination mode */ @@ -1587,7 +1587,7 @@ static HWDef Hw0x03F0_0x0605 = 1, /* green lamp off (reg 0x32 + 0x33) */ 16383, /* blue lamp on (reg 0x34 + 0x35) */ 1, /* blue lamp off (reg 0x36 + 0x37) */ - + /* Misc */ 0x13, /* bReg_0x45 */ 0, /* wStepsAfterPaperSensor2 (0x4c & 0x4d) */ @@ -1985,7 +1985,7 @@ static HWDef Hw0x1606_0x0060 = 0, /* test mode ADC Output CODE MSB (reg 0x5c) */ 0, /* test mode ADC Output CODE LSB (reg 0x5d) */ 0, /* test mode (reg 0x5e) */ - _LM9832, + _LM9832, MODEL_UMAX, 1.0 }; @@ -2019,7 +2019,7 @@ static HWDef Hw0x1606_0x0160 = _GREEN_CH, /* bReg_0x26 color mode - bits 4 and 5 */ 0x40, /* bReg 0x27 color mode */ 1, /* bReg 0x29 illumination mode */ - + /* illumination mode settings (not used for CCD devices) */ { 0, 0, 0, 0, 0, 0, 0 }, { 0, 0, 0, 0, 0, 0, 0 }, @@ -2807,7 +2807,7 @@ static SetDef Settings[] = {"0x1606-0x0050", &Cap0x1606_0x0060, &Hw0x1606_0x0060, "3400" }, {"0x1606-0x0060", &Cap0x1606_0x0060, &Hw0x1606_0x0060, "3400" }, {"0x1606-0x0160", &Cap0x1606_0x0160, &Hw0x1606_0x0160, "5400" }, - + /* COMPAQ... */ {"0x049F-0x001A", &Cap0x1606_0x0060, &Hw0x1606_0x0060, "S4-100" }, diff --git a/backend/plustek-usbhw.c b/backend/plustek-usbhw.c index a1dae68b2..05d3cc75c 100644 --- a/backend/plustek-usbhw.c +++ b/backend/plustek-usbhw.c @@ -27,7 +27,7 @@ * - 0.45 - added function usb_AdjustLamps() to tweak CIS lamp settings * - fixed NULL pointer problem in lamp-off ISR * - added usb_AdjustCISLampSettings() - * - skipping warmup for CIS devices + * - skipping warmup for CIS devices * - 0.46 - fixed problem in usb_GetLampStatus for CIS devices, as we * read back reg[0x29] to wrong position * made it compile without itimer definitions @@ -46,7 +46,7 @@ * - 0.50 - added button support for Plustek/Genius devices * - changed behaviour of usb_IsScannerReady * - added special misc I/O setup for CIS devices (usb_ResetRegisters) - * - 0.51 - change usb_AdjustLamps() and use it now in usb_switchLamp() + * - 0.51 - change usb_AdjustLamps() and use it now in usb_switchLamp() * - added usb_Wait4ScanSample() and usb_InCalibrationMode() * - tweaked EjectPaper to work correctly with the supported sheet-fed * devices @@ -97,7 +97,7 @@ * If you do not wish that, delete this exception notice. *
*/ -#ifdef HAVE_SYS_TIME_H +#ifdef HAVE_SYS_TIME_H #include #endif @@ -228,7 +228,7 @@ static SANE_Bool usb_IsScannerReady( Plustek_Device *dev ) { u_char value; - double len; + double len; long timeout; struct timeval t; SANE_Status res; @@ -242,10 +242,10 @@ usb_IsScannerReady( Plustek_Device *dev ) if( len < 10 ) len = 10; - gettimeofday( &t, NULL); + gettimeofday( &t, NULL); timeout = t.tv_sec + len; - do { + do { res = usbio_ReadReg( dev->fd, 7, &value); if( res != SANE_STATUS_GOOD ) { sleep(1); @@ -262,14 +262,14 @@ usb_IsScannerReady( Plustek_Device *dev ) return SANE_FALSE; } else { - return SANE_TRUE; + return SANE_TRUE; } } } gettimeofday( &t, NULL); - + } while( t.tv_sec < timeout ); - + DBG( _DBG_ERROR, "Scanner not ready!!!\n" ); return SANE_FALSE; } @@ -382,10 +382,10 @@ usb_WaitPos( Plustek_Device *dev, u_long to, SANE_Bool stay ) if( maxf < 5.0 ) maxf = 5.0; DBG( _DBG_INFO2, ">>>> CURRENT MCLK_DIV = %u\n", mclk_div ); - DBG( _DBG_INFO2, ">>>> MCH = %u\n", mch ); - DBG( _DBG_INFO2, ">>>> FFS = %u\n", ffs ); - DBG( _DBG_INFO2, ">>>> HIGH-SPEED = %.3f (%.3f)\n", - speed, hw->dHighSpeed); + DBG( _DBG_INFO2, ">>>> MCH = %u\n", mch ); + DBG( _DBG_INFO2, ">>>> FFS = %u\n", ffs ); + DBG( _DBG_INFO2, ">>>> HIGH-SPEED = %.3f (%.3f)\n", + speed, hw->dHighSpeed); DBG( _DBG_INFO2, ">>>> MIN_FFS = %u (%.3f)\n", min_ffs, maxf); } @@ -407,7 +407,7 @@ usb_WaitPos( Plustek_Device *dev, u_long to, SANE_Bool stay ) break; if( min_ffs != 0xffff ) { - + fac = maxf/step; if( ffs ) { if((u_short)fac < ffs ) { @@ -432,7 +432,7 @@ usb_WaitPos( Plustek_Device *dev, u_long to, SANE_Bool stay ) if(ffs == min_ffs ) ffs = 0; } else { - + if( !stay ) { retval = SANE_TRUE; break; @@ -609,7 +609,7 @@ usb_ModuleMove( Plustek_Device *dev, u_char action, u_long dwStep ) } else { return SANE_TRUE; } - + retval = SANE_FALSE; /* start the sensor... */ @@ -633,9 +633,9 @@ usb_ModuleMove( Plustek_Device *dev, u_char action, u_long dwStep ) return SANE_TRUE; } - gettimeofday(&t2, NULL); + gettimeofday(&t2, NULL); if( t2.tv_sec > secs ) - break; + break; } } else if( action == MOVE_SkipPaperSensor ) { @@ -648,7 +648,7 @@ usb_ModuleMove( Plustek_Device *dev, u_char action, u_long dwStep ) return SANE_TRUE; } - gettimeofday(&t2, NULL); + gettimeofday(&t2, NULL); if( t2.tv_sec > secs ) break; } @@ -750,7 +750,7 @@ usb_ModuleToHome( Plustek_Device *dev, SANE_Bool fWait ) regs[0x57] = 16; } break; - + case MODEL_KaoHsiung: default: regs[0x56] = 64; @@ -822,7 +822,7 @@ usb_ModuleToHome( Plustek_Device *dev, SANE_Bool fWait ) if( hw->motorModel == MODEL_Tokyo600) { u_long dwSpeedUp = GetTickCount () + 250; - + /* while(GetTickCount () < dwSpeedUp) */ while((int)(dwSpeedUp - GetTickCount ()) > 0) { @@ -832,9 +832,9 @@ usb_ModuleToHome( Plustek_Device *dev, SANE_Bool fWait ) if (!value) return TRUE; } - wFastFeedStepSize = (WORD)(CRYSTAL_FREQ / + wFastFeedStepSize = (WORD)(CRYSTAL_FREQ / (6UL * 8UL * 1 * Device.HwSetting.dMaxMotorSpeed * 4 * - Device.HwSetting.wMotorDpi) * 60 / 78); + Device.HwSetting.wMotorDpi) * 60 / 78); regs[0x48] = (u_char)(wFastFeedStepSize >> 8); regs[0x49] = (u_char)(wFastFeedStepSize & 0xFF); WriteRegisters(0x48, ®s[0x48], 2); @@ -856,22 +856,22 @@ usb_MotorSelect( Plustek_Device *dev, SANE_Bool fADF ) if(!_IS_PLUSTEKMOTOR(hw->motorModel)) { return SANE_TRUE; } - + if( fADF ) { if( sCaps->bCCD == kNEC3778 ) { - + hw->wMotorDpi = 300; hw->dMaxMotorSpeed = 1.5; hw->dMaxMoveSpeed = 1.5; sCaps->OpticDpi.y = 600; } regs[0x5b] |= 0x80; - + } else { - + if( sCaps->bCCD == kNEC3778 ) { - + hw->wMotorDpi = 600; hw->dMaxMotorSpeed = 1.1; hw->dMaxMoveSpeed = 0.9; @@ -1131,7 +1131,7 @@ usb_GetLampStatus( Plustek_Device *dev ) } } - DBG( _DBG_INFO, "LAMP-STATUS: 0x%08x (%s)\n", + DBG( _DBG_INFO, "LAMP-STATUS: 0x%08x (%s)\n", iLampStatus, iLampStatus?"on":"off" ); return iLampStatus; } @@ -1278,7 +1278,7 @@ usb_LampOn( Plustek_Device *dev, SANE_Bool fOn, SANE_Bool fResetTimer ) if( fOn ) { if( iLampStatus != lampId ) { - + DBG( _DBG_INFO, "Switching Lamp on\n" ); /* here we might have to switch off the TPA/Main lamp before @@ -1292,7 +1292,7 @@ usb_LampOn( Plustek_Device *dev, SANE_Bool fOn, SANE_Bool fResetTimer ) } memset( ®s[0x29], 0, (0x37-0x29+1)); - + regs[0x29] = hw->bReg_0x29; if( !usb_switchLamp(dev, SANE_TRUE )) { @@ -1314,12 +1314,12 @@ usb_LampOn( Plustek_Device *dev, SANE_Bool fOn, SANE_Bool fResetTimer ) sanei_lm983x_write( dev->fd, 0x29, ®s[0x29], 0x37-0x29+1, SANE_TRUE ); if( lampId != dev->usbDev.currentLamp ) { - + dev->usbDev.currentLamp = lampId; - + if( fResetTimer ) { - - gettimeofday( &t, NULL ); + + gettimeofday( &t, NULL ); dev->usbDev.dwTicksLampOn = t.tv_sec; DBG( _DBG_INFO, "Warmup-Timer started\n" ); } @@ -1329,14 +1329,14 @@ usb_LampOn( Plustek_Device *dev, SANE_Bool fOn, SANE_Bool fResetTimer ) } else { int iStatusChange = iLampStatus & ~lampId; - + if( iStatusChange != iLampStatus ) { DBG( _DBG_INFO, "Switching Lamp off\n" ); - + memset( ®s[0x29], 0, 0x37-0x29+1 ); if( !usb_switchLamp(dev, SANE_FALSE )) { - + if( iStatusChange & DEV_LampReflection ) { regs[0x2e] = 16383 / 256; regs[0x2f] = 16383 % 256; @@ -1389,7 +1389,7 @@ usb_ResetRegisters( Plustek_Device *dev ) HWDef *hw = &dev->usbDev.HwSetting; u_char *regs = dev->usbDev.a_bRegs; - DBG( _DBG_INFO, "RESETTING REGISTERS(%i) - 0x%02x\n", + DBG( _DBG_INFO, "RESETTING REGISTERS(%i) - 0x%02x\n", dev->initialized, (int) sizeof(dev->usbDev.a_bRegs)); memset( regs, 0, sizeof(dev->usbDev.a_bRegs)); @@ -1462,7 +1462,7 @@ usb_ResetRegisters( Plustek_Device *dev ) } /** function which checks if we are already in home position or not. - * + * */ static SANE_Bool usb_SensorStatus( Plustek_Device *dev ) @@ -1486,7 +1486,7 @@ usb_SensorStatus( Plustek_Device *dev ) usbio_WriteReg( dev->fd, 0x07, 0 ); usbio_WriteReg( dev->fd, 0x07, 0x20 ); usbio_WriteReg( dev->fd, 0x07, 0 ); - + sanei_lm983x_write( dev->fd, 0x58, &hw->bReg_0x58, 0x5b-0x58+1, SANE_TRUE ); usbio_ReadReg( dev->fd, 2, &value ); @@ -1632,7 +1632,7 @@ usb_Wait4Warmup( Plustek_Device *dev ) DBG(_DBG_INFO,"Warmup: skipped for CIS devices\n" ); return SANE_TRUE; } - + if( dev->adj.warmup < 0 ) return SANE_TRUE; @@ -1699,7 +1699,7 @@ usb_HasTPA( Plustek_Device *dev ) usbio_WriteReg ( dev->fd, 0x58, dev->usbDev.HwSetting.bReg_0x58 ); usbio_WriteReg ( dev->fd, 0x5a, dev->usbDev.HwSetting.bReg_0x5a ); usbio_WriteReg ( dev->fd, 0x5b, dev->usbDev.HwSetting.bReg_0x5b ); - + usbio_ReadReg ( dev->fd, 0x02, &val ); DBG( _DBG_INFO, "REG[0x02] = 0x%02x\n", val ); @@ -1707,7 +1707,7 @@ usb_HasTPA( Plustek_Device *dev ) DBG( _DBG_INFO, "UMAX-TPA detected\n" ); dev->usbDev.ModelStr = model; return SANE_TRUE; - } else + } else DBG( _DBG_INFO, "UMAX-TPA NOT detected\n" ); if( dev->adj.enableTpa ) { @@ -1716,7 +1716,7 @@ usb_HasTPA( Plustek_Device *dev ) return SANE_TRUE; } } - } + } return SANE_FALSE; } @@ -1737,7 +1737,7 @@ usb_UpdateButtonStatus( Plustek_Scanner *s ) return SANE_FALSE; status = sanei_access_lock( dev->sane.name, 3 ); - if( SANE_STATUS_GOOD != status ) + if( SANE_STATUS_GOOD != status ) return SANE_FALSE; if( -1 == dev->fd ) { @@ -1754,7 +1754,7 @@ usb_UpdateButtonStatus( Plustek_Scanner *s ) mio[0] = dev->usbDev.HwSetting.bReg_0x59; mio[1] = dev->usbDev.HwSetting.bReg_0x5a; mio[2] = dev->usbDev.HwSetting.bReg_0x5b; - + usbio_ReadReg( dev->fd, 0x07, &val ); if( val == 0 ) { @@ -1814,7 +1814,7 @@ usb_UpdateButtonStatus( Plustek_Scanner *s ) } for( i = 0; i < 3; i++ ) { - + DBG( _DBG_INFO2, "Checking MISC IO[%u]=0x%02x\n", i, mio[i] ); mask = 0x01; @@ -1822,9 +1822,9 @@ usb_UpdateButtonStatus( Plustek_Scanner *s ) if((mio[i] & mask) == 0) { DBG( _DBG_INFO2, "* port %u configured as input," - " status: %s (%u)\n", (i*2)+j+1, + " status: %s (%u)\n", (i*2)+j+1, ((val & 1)?"PRESSED":"RELEASED"), (OPT_BUTTON_0 + bc)); - s->val[OPT_BUTTON_0 + bc].w = val & 1; + s->val[OPT_BUTTON_0 + bc].w = val & 1; bc++; } val >>= 1; diff --git a/backend/plustek-usbimg.c b/backend/plustek-usbimg.c index 41c020773..0c28491d8 100644 --- a/backend/plustek-usbimg.c +++ b/backend/plustek-usbimg.c @@ -254,7 +254,7 @@ static void usb_AverageColorWord( Plustek_Device *dev ) if((scan->sParam.bSource == SOURCE_Negative || scan->sParam.bSource == SOURCE_Transparency) && scan->sParam.PhyDpi.x > 800) { - + scan->Red.pcw[0].Colors[0] = _HILO2WORD(scan->Red.pcw[0].HiLo[0]) >> ls; scan->Green.pcw[0].Colors[0] = _HILO2WORD(scan->Green.pcw[0].HiLo[0]) >> ls; scan->Blue.pcw[0].Colors[0] = _HILO2WORD(scan->Blue.pcw[0].HiLo[0]) >> ls; @@ -334,7 +334,7 @@ static int usb_GetScaler( ScanDef *scan ) double ratio; ratio = (double)scan->sParam.UserDpi.x/ - (double)scan->sParam.PhyDpi.x; + (double)scan->sParam.PhyDpi.x; return (int)(1.0/ratio * _SCALER); } @@ -458,7 +458,7 @@ static void usb_ColorDuplicate16_2( Plustek_Device *dev ) ls = Shift; else ls = 0; - + for( dw = 0; dw < scan->sParam.Size.dwPixels; dw++, pixels += next) { if( swap ) { @@ -484,7 +484,7 @@ static void usb_ColorDuplicate16_2( Plustek_Device *dev ) */ static void usb_ColorDuplicatePseudo16( Plustek_Device *dev ) { - int next; + int next; u_short wR, wG, wB; u_long dw, pixels; ScanDef *scan = &dev->scanning; @@ -537,7 +537,7 @@ static void usb_ColorDuplicateGray( Plustek_Device *dev ) } switch(scan->fGrayFromColor) { - + case 1: for (dw = 0; dw < scan->sParam.Size.dwPixels; dw++, pixels += next) scan->UserBuf.pb[pixels] = scan->Red.pcb[dw].a_bColor[0]; @@ -761,7 +761,7 @@ static void usb_GrayDuplicate16( Plustek_Device *dev ) ls = Shift; else ls = 0; - + pwm = scan->Green.philo; for( pixels=scan->sParam.Size.dwPixels; pixels--; pwm++, dest += next ) { if( swap ) @@ -912,7 +912,7 @@ static void usb_ColorScaleGray( Plustek_Device *dev ) ScanDef *scan = &dev->scanning; usb_AverageColorByte( dev ); - + dw = scan->sParam.Size.dwPixels; if( scan->sParam.bSource == SOURCE_ADF ) { @@ -930,19 +930,19 @@ static void usb_ColorScaleGray( Plustek_Device *dev ) } izoom = usb_GetScaler( scan ); - + for( ddax = 0; dw; src++ ) { ddax -= _SCALER; while((ddax < 0) && (dw > 0)) { scan->UserBuf.pb[pixels] = src->a_bColor[0]; - + pixels += next; ddax += izoom; dw--; } - } + } } /** @@ -1189,7 +1189,7 @@ static void usb_ColorScale8( Plustek_Device *dev ) pixels = 0; } - izoom = usb_GetScaler( scan ); + izoom = usb_GetScaler( scan ); for( bitsput = 0, ddax = 0; dw; bitsput++ ) { @@ -1341,7 +1341,7 @@ static void usb_ColorScale16_2( Plustek_Device *dev ) while((ddax < 0) && (dw > 0)) { if( swap ) { - + tmp = *((HiLoDef*)&scan->Red.pw[bitsput]); scan->UserBuf.pw_rgb[pixels].Red = _HILO2WORD(tmp) >> ls; @@ -1384,7 +1384,7 @@ static void usb_ColorScalePseudo16( Plustek_Device *dev ) next = 1; pixels = 0; } - + izoom = usb_GetScaler( scan ); wR = (u_short)scan->Red.pcb[0].a_bColor[0]; @@ -1399,13 +1399,13 @@ static void usb_ColorScalePseudo16( Plustek_Device *dev ) scan->UserBuf.pw_rgb[pixels].Red = (wR + scan->Red.pcb[bitsput].a_bColor[0]) << bShift; - + scan->UserBuf.pw_rgb[pixels].Green = (wG + scan->Green.pcb[bitsput].a_bColor[0]) << bShift; - + scan->UserBuf.pw_rgb[pixels].Blue = (wB + scan->Blue.pcb[bitsput].a_bColor[0]) << bShift; - + pixels += next; ddax += izoom; dw--; @@ -1440,7 +1440,7 @@ static void usb_BWScale( Plustek_Device *dev ) } izoom = usb_GetScaler( scan ); - + memset( dest, 0, scan->dwBytesLine ); ddax = 0; dw = 0; @@ -1454,7 +1454,7 @@ static void usb_BWScale( Plustek_Device *dev ) tmp = src[(i>>3)]; if((dw>>3) < scan->sParam.Size.dwValidPixels ) { - + if( 0 != (tmp &= (1 << ((~(i & 0x7))&0x7)))) dest[dw>>3] |= (1 << ((~(dw & 0x7))&0x7)); } @@ -1495,7 +1495,7 @@ static void usb_BWScaleFromColor( Plustek_Device *dev ) d = j = 0; for( pixels = scan->sParam.Size.dwPixels; pixels; src++ ) { - + ddax -= _SCALER; while((ddax < 0) && (pixels > 0)) { @@ -1545,7 +1545,7 @@ static void usb_BWScaleFromColor_2( Plustek_Device *dev ) d = j = 0; for( pixels = scan->sParam.Size.dwPixels; pixels; src++ ) { - + ddax -= _SCALER; while((ddax < 0) && (pixels > 0)) { @@ -1583,7 +1583,7 @@ static void usb_GrayScale8( Plustek_Device *dev ) dest = scan->UserBuf.pb; next = 1; } - + izoom = usb_GetScaler( scan ); ddax = 0; @@ -1625,7 +1625,7 @@ static void usb_GrayScale16( Plustek_Device *dev ) next = 1; dest = scan->UserBuf.pw; } - + izoom = usb_GetScaler( scan ); ddax = 0; @@ -1711,7 +1711,7 @@ static void usb_GetImageProc( Plustek_Device *dev ) case SCANDATATYPE_Color: if (scan->sParam.bBitDepth > 8) { - if( usb_IsCISDevice(dev)){ + if( usb_IsCISDevice(dev)){ scan->pfnProcess = usb_ColorScale16_2; DBG( _DBG_INFO, "ImageProc is: ColorScale16_2\n" ); } else { @@ -1719,7 +1719,7 @@ static void usb_GetImageProc( Plustek_Device *dev ) DBG( _DBG_INFO, "ImageProc is: ColorScale16\n" ); } if (scan->fGrayFromColor) { - if( usb_IsCISDevice(dev)){ + if( usb_IsCISDevice(dev)){ scan->pfnProcess = usb_ColorScaleGray16_2; DBG( _DBG_INFO, "ImageProc is: ColorScaleGray16_2\n" ); } else { @@ -1730,7 +1730,7 @@ static void usb_GetImageProc( Plustek_Device *dev ) } else if (scan->dwFlag & SCANFLAG_Pseudo48) { scan->pfnProcess = usb_ColorScalePseudo16; DBG( _DBG_INFO, "ImageProc is: ColorScalePseudo16\n" ); - + } else if (scan->fGrayFromColor) { if( usb_IsCISDevice(dev)){ @@ -1752,7 +1752,7 @@ static void usb_GetImageProc( Plustek_Device *dev ) } } else { - if( usb_IsCISDevice(dev)){ + if( usb_IsCISDevice(dev)){ scan->pfnProcess = usb_ColorScale8_2; DBG( _DBG_INFO, "ImageProc is: ColorScale8_2\n" ); } else { @@ -1829,7 +1829,7 @@ static void usb_GetImageProc( Plustek_Device *dev ) } } } else { - if( usb_IsCISDevice(dev)){ + if( usb_IsCISDevice(dev)){ scan->pfnProcess = usb_ColorDuplicate8_2; DBG( _DBG_INFO, "ImageProc is: ColorDuplicate8_2\n" ); } else { @@ -1860,9 +1860,9 @@ static void usb_GetImageProc( Plustek_Device *dev ) break; } } - + if( scan->sParam.bBitDepth == 8 ) { - + if( scan->dwFlag & SCANFLAG_Pseudo48 ) { if( scan->dwFlag & SCANFLAG_RightAlign ) { bShift = 5; diff --git a/backend/plustek-usbio.c b/backend/plustek-usbio.c index cae0e0dea..967745605 100644 --- a/backend/plustek-usbio.c +++ b/backend/plustek-usbio.c @@ -23,7 +23,7 @@ * - 0.47 - no changes * - 0.48 - cleanup * - 0.49 - no changes - * - 0.50 - usbio_DetectLM983x() now returns error if register + * - 0.50 - usbio_DetectLM983x() now returns error if register * could not be red * - usbio_ResetLM983x() checks for reg7 value before writing * - 0.51 - allow dumpRegs to be called without valid fd @@ -69,7 +69,7 @@ * If you do not wish that, delete this exception notice. *
*/ - + #include "../include/sane/sanei_usb.h" #include "../include/sane/sanei_lm983x.h" @@ -256,7 +256,7 @@ static SANE_Bool usbio_WriteReg( SANE_Int handle, for( i = 0; i < 100; i++ ) { sanei_lm983x_write_byte( handle, reg, value ); - + /* Flush register 0x02 when register 0x58 is written */ if( 0x58 == reg ) { _UIO( usbio_ReadReg( handle, 2, &data )); @@ -301,7 +301,7 @@ static SANE_Status usbio_DetectLM983x( SANE_Int fd, SANE_Byte *version ) sprintf( buf, "usbio_DetectLM983x: found " ); switch((SANE_Int)value ) { - + case 4: strcat( buf, "LM9832/3" ); break; case 3: strcat( buf, "LM9831" ); break; case 2: strcat( buf, "LM9830 --> unsupported!!!" ); diff --git a/backend/plustek-usbmap.c b/backend/plustek-usbmap.c index 1e54789f0..c979345fc 100644 --- a/backend/plustek-usbmap.c +++ b/backend/plustek-usbmap.c @@ -75,7 +75,7 @@ static void usb_MapAdjust( Plustek_Device *dev ) { int i, tabLen; double b, c, tmp; - + tabLen = _MAP_SIZE; /* adjust brightness (b) and contrast (c) using the function: @@ -125,11 +125,11 @@ static SANE_Bool usb_MapDownload( Plustek_Device *dev ) int i, threshold; SANE_Byte value; SANE_Bool fInverse = 0; - + DBG( _DBG_INFO, "usb_MapDownload()\n" ); /* the maps are have been already set */ - + /* do the brightness and contrast adjustment ... */ if( scanning->sParam.bDataType != SCANDATATYPE_BW ) usb_MapAdjust( dev ); @@ -141,7 +141,7 @@ static SANE_Bool usb_MapDownload( Plustek_Device *dev ) * into trouble elsewhere on CanoScan models using gray mode */ for( color = 0; color < 3; color++) { - + /* select color */ value = (color << 2)+2; @@ -161,13 +161,13 @@ static SANE_Bool usb_MapDownload( Plustek_Device *dev ) threshold = 0; if(threshold > (int)_MAP_SIZE) threshold = _MAP_SIZE; - + DBG(_DBG_INFO, "* Threshold is at %u brightness=%i\n", threshold, scanning->sParam.brightness ); for(i = 0; i < threshold; i++) a_bMap[color*_MAP_SIZE + i] = 0; - + for(i = threshold; i < _MAP_SIZE; i++) a_bMap[color*_MAP_SIZE + i] = 255; @@ -184,23 +184,23 @@ static SANE_Bool usb_MapDownload( Plustek_Device *dev ) } if( fInverse ) { - + u_char map[_MAP_SIZE]; u_char *pMap = a_bMap+color*_MAP_SIZE; - + DBG( _DBG_INFO, "* Inverting Map\n" ); - + for( i = 0; i < _MAP_SIZE; i++, pMap++ ) map[i] = ~*pMap; - + sanei_lm983x_write( dev->fd, 0x06, map, _MAP_SIZE, SANE_FALSE ); - + } else { DBG( _DBG_INFO, "* downloading map %u...\n", color ); sanei_lm983x_write( dev->fd, 0x06, a_bMap+color*_MAP_SIZE, _MAP_SIZE, SANE_FALSE ); } - + } /* for each color */ DBG( _DBG_INFO, "usb_MapDownload() done.\n" ); diff --git a/backend/plustek-usbscan.c b/backend/plustek-usbscan.c index c8824fc6d..bafc86a36 100644 --- a/backend/plustek-usbscan.c +++ b/backend/plustek-usbscan.c @@ -595,7 +595,7 @@ usb_GetMCLKDiv( Plustek_Device *dev ) DBG( _DBG_INFO, "usb_GetMCLKDiv()\n" ); r = 8; /* line rate */ - if ((regs[0x26] & 7) == 0) + if ((regs[0x26] & 7) == 0) r = 24; /* pixel rate */ /* use high or low res min integration time */ @@ -606,7 +606,7 @@ usb_GetMCLKDiv( Plustek_Device *dev ) min_int_time /((double)1000. * r * m_wLineLength)); minmclk = _MAX(minmclk,MCLKDIV_SCALING); - maxmclk = (int)(32.5*MCLKDIV_SCALING + .5); + maxmclk = (int)(32.5*MCLKDIV_SCALING + .5); DBG(_DBG_INFO2,"- lower mclkdiv limit=%f\n",(double)minmclk/MCLKDIV_SCALING); DBG(_DBG_INFO2,"- upper mclkdiv limit=%f\n",(double)maxmclk/MCLKDIV_SCALING); @@ -622,7 +622,7 @@ usb_GetMCLKDiv( Plustek_Device *dev ) /* compute the horizontal dpi (pixels per inch) */ j = regs[0x9] & 0x7; - hdpi = ((j&1)*.5+1)*(j&2?2:1)*(j&4?4:1); + hdpi = ((j&1)*.5+1)*(j&2?2:1)*(j&4?4:1); pixelsperline = (int)((256*regs[0x24]+regs[0x25]-256*regs[0x22]-regs[0x23]) *pixelbits/(hdpi * 8)); @@ -644,7 +644,7 @@ usb_GetMCLKDiv( Plustek_Device *dev ) while (mclkdiv * hdpi < 6.*MCLKDIV_SCALING) { mclkdiv++; } - DBG( _DBG_INFO2, "- HIGHSPEED MCLK Divider = %u\n", + DBG( _DBG_INFO2, "- HIGHSPEED MCLK Divider = %u\n", mclkdiv/MCLKDIV_SCALING ); } @@ -690,7 +690,7 @@ usb_GetMCLKDivider( Plustek_Device *dev, ScanParam *pParam ) (m_dMCLKDivider * m_bCM * m_wLineLength / 6 * 9 / 10) * (1 + m_bIntTimeAdjust)) { m_bIntTimeAdjust++; - } + } if( hw->motorModel == MODEL_HuaLien && sCaps->bCCD == kNEC3799 && m_bIntTimeAdjust > bMaxITA) { @@ -730,7 +730,7 @@ usb_GetMCLKDivider( Plustek_Device *dev, ScanParam *pParam ) m_wStepSize, regs[0x46], regs[0x47] ); usb_GetDPD( dev ); } - + /* Compute maximum MCLK divider base on maximum integration time for * high lamp PWM, use equation 4 */ @@ -830,7 +830,7 @@ usb_GetLineLength( Plustek_Device *dev, ScanParam *param ) ctmode = (regs[0x0b] >> 3) & 3; /* cis tr timing mode */ - m_bLineRateColor = 1; + m_bLineRateColor = 1; if (afeop == 1 || afeop == 5) /* if 3 channel line or 1 channel mode b */ m_bLineRateColor = 3; @@ -845,7 +845,7 @@ usb_GetLineLength( Plustek_Device *dev, ScanParam *param ) b = 1; if( ctmode == 0 ) { /* CCD mode scanner*/ - + b = (ntr + 1) * ((2 * gbnd) + dur + 1); b += (1 - ntr) * en_tradj; } @@ -871,12 +871,12 @@ usb_GetLineLength( Plustek_Device *dev, ScanParam *param ) if( ctmode == 0 ) tr += m_bLineRateColor; } else { - + int le_phi, num_byteclk, num_mclkf, tr_fast_pix, extra_pix; - + /* Line color or gray mode */ if( afeop != 0 ) { - + le_phi = (tradj + 1) / 2 + 1 + 6; num_byteclk = ((le_phi + 8 * le + 8 * b + 4) / (8 * tradj)) + 1; @@ -893,7 +893,7 @@ usb_GetLineLength( Plustek_Device *dev, ScanParam *param ) tr_fast_pix = num_byteclk; extra_pix = (num_mclkf - le_phi) % (3 * 8); } - + tr = b + le + 4 + tr_fast_pix; if (extra_pix == 0) tr++; @@ -970,8 +970,8 @@ usb_GetMotorParam( Plustek_Device *dev, ScanParam *pParam ) } else if(pParam->PhyDpi.x <= 400) { - regs[0x56] = 8; - regs[0x57] = 48; + regs[0x56] = 8; + regs[0x57] = 48; } else if(pParam->PhyDpi.x <= 600) { @@ -1184,7 +1184,7 @@ usb_SetScanParameters( Plustek_Device *dev, ScanParam *pParam ) usb_GetScanRect ( dev, pParam ); usb_PresetStepSize( dev, pParam ); - + if( dev->caps.dwFlag & SFLAG_ADF ) { if( pParam->bCalibration == PARAM_Scan ) { @@ -1251,7 +1251,7 @@ usb_SetScanParameters( Plustek_Device *dev, ScanParam *pParam ) /* Compute the number of lines to scan using actual Y resolution */ usb_GetScanLinesAndSize( dev, pParam ); - + /* Pause limit should be bounded by total bytes to read * so that the chassis will not move too far. */ @@ -1316,7 +1316,7 @@ usb_SetScanParameters( Plustek_Device *dev, ScanParam *pParam ) _UIO(sanei_lm983x_write( dev->fd, 0x08, ®s[0x08], 0x7f - 0x08+1, SANE_TRUE)); usleep(100); - + if( !usbio_WriteReg( dev->fd, 0x07, 0 )) return SANE_FALSE; @@ -1363,7 +1363,7 @@ usb_ScanBegin( Plustek_Device *dev, SANE_Bool auto_park ) DBG( _DBG_INFO, "ScanBegin() - Cancel detected...\n" ); return SANE_FALSE; } - + _UIO(usbio_ReadReg( dev->fd, 0x01, &m_bOldScanData )); if( m_bOldScanData ) { @@ -1373,7 +1373,7 @@ usb_ScanBegin( Plustek_Device *dev, SANE_Bool auto_park ) DBG(_DBG_INFO,"Flushing cache - %lu bytes (bOldScanData=%u)\n", dwBytesToRead, m_bOldScanData ); - _UIO(sanei_lm983x_read( dev->fd, 0x00, pBuffer, + _UIO(sanei_lm983x_read( dev->fd, 0x00, pBuffer, dwBytesToRead, SANE_FALSE )); free( pBuffer ); @@ -1430,7 +1430,7 @@ usb_ScanEnd( Plustek_Device *dev ) usb_ModuleToHome( dev, SANE_FALSE ); } else if( SANE_TRUE == cancelRead ) { - + usb_ModuleToHome( dev, SANE_FALSE ); } return SANE_TRUE; @@ -1453,14 +1453,14 @@ usb_IsDataAvailableInDRAM( Plustek_Device *dev ) DBG( _DBG_INFO, "usb_IsDataAvailableInDRAM()\n" ); - gettimeofday( &t, NULL); + gettimeofday( &t, NULL); dwTicks = t.tv_sec + 30; for(;;) { _UIO( sanei_lm983x_read( dev->fd, 0x01, a_bBand, 3, SANE_FALSE )); - gettimeofday( &t, NULL); + gettimeofday( &t, NULL); if( t.tv_sec > dwTicks ) break; @@ -1468,7 +1468,7 @@ usb_IsDataAvailableInDRAM( Plustek_Device *dev ) DBG(_DBG_INFO,"usb_IsDataAvailableInDRAM() - Cancel detected...\n"); return SANE_FALSE; } - + /* It is not stable for read */ if((a_bBand[0] != a_bBand[1]) && (a_bBand[1] != a_bBand[2])) continue; @@ -1549,7 +1549,7 @@ usb_GetImageInfo( Plustek_Device *dev, ImgDef *pInfo, WinInfo *pSize ) case COLOR_TRUE48: pSize->dwBytes = pSize->dwPixels * 6UL; break; - + case COLOR_TRUE24: if( dev->scanning.fGrayFromColor > 7 ){ pSize->dwBytes = (pSize->dwPixels + 7UL) >> 3; @@ -1597,7 +1597,7 @@ usb_SaveImageInfo( Plustek_Device *dev, ImgDef *pInfo ) case COLOR_TRUE48: pParam->bBitDepth = 16; /* fall through... */ - + case COLOR_TRUE24: pParam->bDataType = SCANDATATYPE_Color; @@ -1638,7 +1638,7 @@ usb_SaveImageInfo( Plustek_Device *dev, ImgDef *pInfo ) * sheetfed device to avoid stripes in the resulting pictures */ if( usb_IsSheetFedDevice(dev)) { - + int step, div, org, xdpi; xdpi = usb_SetAsicDpiX( dev, pParam->UserDpi.x ); diff --git a/backend/plustek-usbshading.c b/backend/plustek-usbshading.c index 6d08dc7f3..623163637 100644 --- a/backend/plustek-usbshading.c +++ b/backend/plustek-usbshading.c @@ -282,9 +282,9 @@ static void usb_SetMCLK( Plustek_Device *dev, ScanParam *param ) HWDef *hw = &dev->usbDev.HwSetting; dMCLK = usb_GetMCLK( dev, param ); - param->dMCLK = dMCLK; + param->dMCLK = dMCLK; - DBG( _DBG_INFO, "SETMCLK[%u/%u]: %.3f\n", + DBG( _DBG_INFO, "SETMCLK[%u/%u]: %.3f\n", hw->motorModel, param->bDataType, dMCLK ); } @@ -314,14 +314,14 @@ static SANE_Bool usb_SetDarkShading( Plustek_Device *dev, u_char channel, /* Download offset coefficients */ if( SANE_STATUS_GOOD == res ) { - + res = sanei_lm983x_write( dev->fd, 0x06, (u_char*)coeff_buffer, wCount, SANE_FALSE ); if( SANE_STATUS_GOOD == res ) return SANE_TRUE; } } - + DBG( _DBG_ERROR, "usb_SetDarkShading() failed\n" ); return SANE_FALSE; } @@ -358,7 +358,7 @@ static SANE_Bool usb_SetWhiteShading( Plustek_Device *dev, u_char channel, return SANE_TRUE; } } - + DBG( _DBG_ERROR, "usb_SetWhiteShading() failed\n" ); return SANE_FALSE; } @@ -416,7 +416,7 @@ static void usb_GetSWOffsetGain( Plustek_Device *dev ) param->swGain[2] = 800; #endif break; - + case kNECSLIM: DBG( _DBG_INFO2, "kNECSLIM adjustments\n" ); if( param->PhyDpi.x <= 150 ) { @@ -651,11 +651,11 @@ static void usb_GetSWOffsetGain( Plustek_Device *dev ) param->swOffset[0] = -304; param->swOffset[1] = -304; param->swOffset[2] = -304; - param->swGain[0] = 910; - param->swGain[1] = 920; + param->swGain[0] = 910; + param->swGain[1] = 920; param->swGain[2] = 975; } - + if(param->bDataType == SCANDATATYPE_BW && param->PhyDpi.x <= 300) { param->swOffset[1] = 1000; @@ -703,7 +703,7 @@ static u_char usb_GetNewGain( Plustek_Device *dev, u_short wMax, int channel ) bGain = (u_char)dAmp + 32; } - + if( bGain > 0x3f ) { DBG( _DBG_INFO, "* GAIN Overflow!!!\n" ); bGain = 0x3f; @@ -734,7 +734,7 @@ static void setAdjGain( int gain, u_char *reg ) * @param l_off - * @return */ -static SANE_Bool adjLampSetting( Plustek_Device *dev, int channel, u_long max, +static SANE_Bool adjLampSetting( Plustek_Device *dev, int channel, u_long max, u_long ideal, u_short l_on, u_short *l_off ) { SANE_Bool adj = SANE_FALSE; @@ -796,7 +796,7 @@ static SANE_Bool usb_AdjustGain( Plustek_Device *dev, int fNegative ) DBG( _DBG_INFO, "#########################\n" ); DBG( _DBG_INFO, "usb_AdjustGain()\n" ); - if((dev->adj.rgain != -1) && + if((dev->adj.rgain != -1) && (dev->adj.ggain != -1) && (dev->adj.bgain != -1)) { setAdjGain( dev->adj.rgain, ®s[0x3b] ); setAdjGain( dev->adj.ggain, ®s[0x3c] ); @@ -871,7 +871,7 @@ TOGAIN: dumpPicInit(&m_ScanParam, tmp); dumpPic(tmp, (u_char*)scanbuf, m_ScanParam.Size.dwPhyBytes, 0); - + #ifdef SWAP_COARSE if(usb_HostSwap()) #endif @@ -913,7 +913,7 @@ TOGAIN: Gain_Hilight.Green = (u_short)(rgb.Green / 20UL); Gain_Hilight.Blue = (u_short)(rgb.Blue / 20UL); DBG(_DBG_INFO2, "MAX(R,G,B)= 0x%04x(%u), 0x%04x(%u), 0x%04x(%u)\n", - Gain_Hilight.Red, Gain_Hilight.Red, Gain_Hilight.Green, + Gain_Hilight.Red, Gain_Hilight.Red, Gain_Hilight.Green, Gain_Hilight.Green, Gain_Hilight.Blue, Gain_Hilight.Blue ); regs[0x3b] = usb_GetNewGain(dev,Gain_Hilight.Red, 0 ); @@ -945,7 +945,7 @@ TOGAIN: regs[0x3c] = regs[0x3d] = usb_GetNewGain(dev,Gain_Hilight.Green,1); } } else { - + if( m_ScanParam.bDataType == SCANDATATYPE_Color ) { RGBUShortDef max_rgb, min_rgb, tmp_rgb; @@ -1055,7 +1055,7 @@ TOGAIN: scanning->sParam.dMCLK = dMCLK = dMCLK - 0.5; regs[0x3b] = regs[0x3c] = regs[0x3d] = 1; - + adj = SANE_TRUE; } else if(((regs[0x3b] == 63) || (regs[0x3c] == 63) || @@ -1072,7 +1072,7 @@ TOGAIN: goto TOGAIN; } } - + } else { /* for MODEL KaoHsiung 1200 scanner multi-straight-line bug at @@ -1265,7 +1265,7 @@ static SANE_Bool usb_AdjustOffset( Plustek_Device *dev ) DBG( _DBG_INFO, "#########################\n" ); DBG( _DBG_INFO, "usb_AdjustOffset()\n" ); - if((dev->adj.rofs != -1) && + if((dev->adj.rofs != -1) && (dev->adj.gofs != -1) && (dev->adj.bofs != -1)) { regs[0x38] = (dev->adj.rofs & 0x3f); regs[0x39] = (dev->adj.gofs & 0x3f); @@ -1329,10 +1329,10 @@ static SANE_Bool usb_AdjustOffset( Plustek_Device *dev ) DBG( _DBG_ERROR, "usb_AdjustOffset() failed\n" ); return SANE_FALSE; } - + i = 0; - DBG( _DBG_INFO2, "S.dwPixels = %lu\n", m_ScanParam.Size.dwPixels ); + DBG( _DBG_INFO2, "S.dwPixels = %lu\n", m_ScanParam.Size.dwPixels ); DBG( _DBG_INFO2, "dwPixels = %lu\n", dwPixels ); DBG( _DBG_INFO2, "dwPhyBytes = %lu\n", m_ScanParam.Size.dwPhyBytes ); DBG( _DBG_INFO2, "dwPhyPixels = %lu\n", m_ScanParam.Size.dwPhyPixels ); @@ -1350,7 +1350,7 @@ static SANE_Bool usb_AdjustOffset( Plustek_Device *dev ) } sprintf( tmp, "coarse-off-%u.raw", i++ ); - + #ifdef SWAP_COARSE if(usb_HostSwap()) usb_Swap((u_short *)scanbuf, m_ScanParam.Size.dwPhyBytes ); @@ -1380,7 +1380,7 @@ static SANE_Bool usb_AdjustOffset( Plustek_Device *dev ) dwSum[1], dwSum[1] /dwPixels ); DBG( _DBG_INFO2, "BlueSum = %lu, ave = %lu\n", dwSum[2], dwSum[2] /dwPixels ); - + /* do averaging for each channel */ dwSum[0] /= dwPixels; dwSum[1] /= dwPixels; @@ -1422,7 +1422,7 @@ static SANE_Bool usb_AdjustOffset( Plustek_Device *dev ) regs[0x3a] = bExpect[2]; } else { - regs[0x38] = regs[0x39] = regs[0x3a] = bExpect[0]; + regs[0x38] = regs[0x39] = regs[0x3a] = bExpect[0]; } DBG( _DBG_INFO2, "REG[0x38] = %u\n", regs[0x38] ); @@ -1445,7 +1445,7 @@ static SANE_Bool usb_AdjustOffset( Plustek_Device *dev ) /** this function tries to find out some suitable values for the dark * fine calibration. If the device owns a black calibration strip - * the data is simply copied. If not, then the white strip is read + * the data is simply copied. If not, then the white strip is read * with the lamp switched off... */ static void usb_GetDarkShading( Plustek_Device *dev, u_short *pwDest, @@ -1527,7 +1527,7 @@ static void usb_GetDarkShading( Plustek_Device *dev, u_short *pwDest, for( dw = 0; dw < dwPixels; dw++ ) pwDest[dw] = (u_short)dwSum[dw & 1]; } else { - + /* Standard CCD */ /* do some averaging on the line */ @@ -1643,7 +1643,7 @@ static SANE_Bool usb_AdjustDarkShading( Plustek_Device *dev ) DBG( _DBG_ERROR, "usb_AdjustDarkShading() failed\n" ); return SANE_FALSE; } - + /* set illumination mode and switch lamp on again */ regs[0x29] = hw->bReg_0x29; @@ -1720,7 +1720,7 @@ static SANE_Bool usb_AdjustDarkShading( Plustek_Device *dev ) * @param hilight - defines the number of values to skip. * @param shading_lines - defines the overall number of shading lines. */ -static void usb_CalSortHighlight( Plustek_Device *dev, ScanParam *sp, +static void usb_CalSortHighlight( Plustek_Device *dev, ScanParam *sp, u_long hilight, u_long shading_lines ) { ScanDef *scan = &dev->scanning; @@ -1766,7 +1766,7 @@ static void usb_CalSortHighlight( Plustek_Device *dev, ScanParam *sp, /** function to remove the brightest values out of each row * @param dev - the almighty device structure. - * @param sp - is a pointer to the scanparam structure used for + * @param sp - is a pointer to the scanparam structure used for * scanning the shading lines. * @param hilight - defines the number of values to skip. * @param shading_lines - defines the overall number of shading lines. @@ -1865,13 +1865,13 @@ static SANE_Bool usb_AdjustWhiteShading( Plustek_Device *dev ) u_short hilight, shadow; int i; SANE_Bool swap = usb_HostSwap(); - + if( scaps->workaroundFlag & _WAF_SKIP_FINE ) return SANE_TRUE; DBG( _DBG_INFO, "#########################\n" ); DBG( _DBG_INFO, "usb_AdjustWhiteShading()\n" ); - + m_pAvMono = (u_short*)scan->pScanBuffer; if( usb_IsEscPressed()) @@ -1904,7 +1904,7 @@ static SANE_Bool usb_AdjustWhiteShading( Plustek_Device *dev ) if( usb_IsCISDevice(dev) && m_ScanParam.bDataType == SCANDATATYPE_Color ) m_ScanParam.Size.dwBytes *= 3; - m_dwPixels = scan->sParam.Size.dwPixels * m_ScanParam.UserDpi.x / + m_dwPixels = scan->sParam.Size.dwPixels * m_ScanParam.UserDpi.x / scan->sParam.UserDpi.x; dw = (u_long)(hw->wDRAMSize - 196 /*192 KiB*/) * 1024UL; @@ -1950,7 +1950,7 @@ static SANE_Bool usb_AdjustWhiteShading( Plustek_Device *dev ) if( 0 == dwRead ) { dumpPicInit(&m_ScanParam, tmp); } - + dumpPic(tmp, (u_char*)pBuf + dwRead, m_ScanParam.Size.dwTotalBytes, 0); if( usb_ScanEnd( dev )) { @@ -1965,7 +1965,7 @@ static SANE_Bool usb_AdjustWhiteShading( Plustek_Device *dev ) } m_pSum = (u_long*)((u_char*)pBuf + m_ScanParam.Size.dwPhyBytes * shading_lines); - + /* * do some reordering on CIS based devices: * from RRRRRRR.... GGGGGGGG.... BBBBBBBBB, create RGB RGB RGB ... @@ -2017,7 +2017,7 @@ static SANE_Bool usb_AdjustWhiteShading( Plustek_Device *dev ) #ifdef SWAP_FINE if(usb_HostSwap()) { #endif - for( dw = 0; dw < m_dwPixels * m_ScanParam.bChannels; dw++ ) + for( dw = 0; dw < m_dwPixels * m_ScanParam.bChannels; dw++ ) pwDest[dw] = _HILO2WORD(pwSrce[dw]); #ifdef SWAP_FINE } else { @@ -2077,7 +2077,7 @@ static SANE_Bool usb_AdjustWhiteShading( Plustek_Device *dev ) pValue->Mono = 65535U; else pValue->Mono = (u_short)*pdw; - + if (pValue->Mono > 16384U) pValue->Mono = (u_short)(GAIN_Target * 16384U / pValue->Mono); else @@ -2153,7 +2153,7 @@ static SANE_Bool usb_AdjustWhiteShading( Plustek_Device *dev ) if( scan->sParam.bSource != SOURCE_Negative ) { for( dw = 0; dw < m_ScanParam.Size.dwPhyPixels; dw++) { - + pdw[dw] = pdw[dw] * 1000 /((shading_lines-hilight-shadow) * scan->sParam.swGain[1]); if( pdw[dw] > 65535U ) @@ -2172,7 +2172,7 @@ static SANE_Bool usb_AdjustWhiteShading( Plustek_Device *dev ) #endif _SWAP(pValue[dw].HiLo.bHi, pValue[dw].HiLo.bLo); } - + } else{ for( dw = 0; dw < m_ScanParam.Size.dwPhyPixels; dw++ ) { @@ -2200,17 +2200,17 @@ static void usb_ResizeWhiteShading( double dAmp, u_short *pwShading, int iGain ) { u_long dw, dwAmp; u_short w; - + DBG( _DBG_INFO2, "ResizeWhiteShading: dAmp=%.3f, iGain=%i\n", dAmp, iGain ); for( dw = 0; dw < m_ScanParam.Size.dwPhyPixels; dw++ ) { - + dwAmp = (u_long)(GAIN_Target * 0x4000 / (pwShading[dw] + 1) * dAmp) * iGain / 1000; if( dwAmp <= GAIN_Target) w = (u_short)dwAmp; - else + else w = GAIN_Target; #ifndef SWAP_FINE @@ -2252,7 +2252,7 @@ usb_PrepareCalibration( Plustek_Device *dev ) m_ScanParam.bDataType = SCANDATATYPE_Gray; usb_SetMCLK( dev, &m_ScanParam ); - + /* preset these registers offset/gain */ regs[0x38] = regs[0x39] = regs[0x3a] = 0; regs[0x3b] = regs[0x3c] = regs[0x3d] = 1; @@ -2319,7 +2319,7 @@ usb_SpeedTest( Plustek_Device *dev ) DBG( 1, "#########################\n" ); DBG( 1, "usb_SpeedTest(%d,%lu)\n", dev->initialized, dev->transferRate ); if( dev->transferRate != DEFAULT_RATE ) { - DBG( 1, "* skipped, using already detected speed: %lu Bytes/s\n", + DBG( 1, "* skipped, using already detected speed: %lu Bytes/s\n", dev->transferRate ); return SANE_TRUE; } @@ -2358,7 +2358,7 @@ usb_SpeedTest( Plustek_Device *dev ) DBG( _DBG_ERROR, "usb_SpeedTest() failed\n" ); return SANE_FALSE; } - if (!usb_IsDataAvailableInDRAM( dev )) + if (!usb_IsDataAvailableInDRAM( dev )) return SANE_FALSE; m_fFirst = SANE_FALSE; @@ -2377,7 +2377,7 @@ usb_SpeedTest( Plustek_Device *dev ) tr = ((double)m_ScanParam.Size.dwPhyBytes * _TLOOPS * 1000000.0)/r; dev->transferRate = (u_long)tr; - DBG( 1, "usb_SpeedTest() done - %u loops, %.4fus --> %.4f B/s, %lu\n", + DBG( 1, "usb_SpeedTest() done - %u loops, %.4fus --> %.4f B/s, %lu\n", _TLOOPS, r, tr, dev->transferRate ); return SANE_TRUE; } @@ -2459,7 +2459,7 @@ usb_AutoWarmup( Plustek_Device *dev ) thresh = _AUTO_TPA_THRESH; } end = start + len; - DBG( _DBG_INFO2, "Start=%lu, End=%lu, Len=%lu, Thresh=%li\n", + DBG( _DBG_INFO2, "Start=%lu, End=%lu, Len=%lu, Thresh=%li\n", start, end, len, thresh ); lastR = lastG = lastB = 0; @@ -2485,7 +2485,7 @@ usb_AutoWarmup( Plustek_Device *dev ) curR = curG = curB = 0; for( dw = start; dw < end; dw++ ) { - + if( usb_IsCISDevice(dev)) { curR += ((u_short*)scanbuf)[dw]; curG += ((u_short*)scanbuf)[dw+m_ScanParam.Size.dwPhyPixels+1]; @@ -2503,7 +2503,7 @@ usb_AutoWarmup( Plustek_Device *dev ) diffR = curR - lastR; lastR = curR; diffG = curG - lastG; lastG = curG; diffB = curB - lastB; lastB = curB; - DBG( _DBG_INFO2, "%i/%i-AVE(R,G,B)= %lu(%ld), %lu(%ld), %lu(%ld)\n", + DBG( _DBG_INFO2, "%i/%i-AVE(R,G,B)= %lu(%ld), %lu(%ld), %lu(%ld)\n", i, stable_count, curR, diffR, curG, diffG, curB, diffB ); /* we consider the lamp to be stable, @@ -2523,7 +2523,7 @@ usb_AutoWarmup( Plustek_Device *dev ) } DBG( _DBG_INFO, "usb_AutoWarmup() done - %u loops\n", i+1 ); - DBG( _DBG_INFO, "* AVE(R,G,B)= %lu(%ld), %lu(%ld), %lu(%ld)\n", + DBG( _DBG_INFO, "* AVE(R,G,B)= %lu(%ld), %lu(%ld), %lu(%ld)\n", curR, diffR, curG, diffG, curB, diffB ); return SANE_TRUE; } @@ -2608,8 +2608,8 @@ usb_DoCalibration( Plustek_Device *dev ) /* HEINER: Currently not clear why Plustek didn't use the ShadingOriginY * for all modes * It should be okay to remove this and reference to the ShadingOriginY - */ -#if 0 + */ +#if 0 if( scanning->sParam.bSource == SOURCE_Negative ) { DBG( _DBG_INFO, "DataOrigin.x=%u, DataOrigin.y=%u\n", @@ -2707,7 +2707,7 @@ usb_DoCalibration( Plustek_Device *dev ) Gain_Reg.Green = regs[0x3c]; Gain_Reg.Blue = regs[0x3d]; Gain_NegHilight = Gain_Hilight; - + DBG( _DBG_INFO, "MCLK = %.3f\n", dMCLK ); DBG( _DBG_INFO, "GainRed = %u\n", regs[0x3b] ); DBG( _DBG_INFO, "GainGreen = %u\n", regs[0x3c] ); @@ -2727,7 +2727,7 @@ usb_DoCalibration( Plustek_Device *dev ) if(!usb_AdjustGain( dev, 1 )) return _E_INTERNAL; - + regs[0x3b] = regs[0x3c] = regs[0x3d] = 1; DBG( _DBG_INFO, "Settings done, so start...\n" ); @@ -2763,7 +2763,7 @@ usb_DoCalibration( Plustek_Device *dev ) m_ScanParam.Size.dwPhyPixels*2, scanning->sParam.swGain[2]); } - usb_line_statistics( "White", a_wWhiteShading, + usb_line_statistics( "White", a_wWhiteShading, m_ScanParam.Size.dwPhyPixels, SANE_TRUE); break; @@ -2904,7 +2904,7 @@ usb_DoCalibration( Plustek_Device *dev ) */ hw->wLineEnd = 5384; if(scanning->sParam.bDataType == SCANDATATYPE_Color && - ((scanning->sParam.bBitDepth == 8 && + ((scanning->sParam.bBitDepth == 8 && (scanning->sParam.PhyDpi.x == 200 ||scanning->sParam.PhyDpi.x == 300)))) hw->wLineEnd = 7000; regs[0x20] = _HIBYTE(hw->wLineEnd); @@ -3161,7 +3161,7 @@ usb_DownloadShadingData( Plustek_Device *dev, u_char what ) } if( param->bDataType == SCANDATATYPE_Color ) { - get_ptrs(dev, a_wWhiteShading, + get_ptrs(dev, a_wWhiteShading, m_ScanParam.Size.dwPhyPixels, &r, &g, &b); usb_SetWhiteShading( dev, CHANNEL_red, r, diff --git a/backend/plustek.c b/backend/plustek.c index 062df379c..20dc6b99f 100644 --- a/backend/plustek.c +++ b/backend/plustek.c @@ -129,9 +129,9 @@ /** @mainpage * @verbinclude Plustek-USB.txt */ - + #ifdef _AIX -# include "../include/lalloca.h" +# include "../include/lalloca.h" #endif #include "../include/sane/config.h" @@ -339,7 +339,7 @@ getScanMode( Plustek_Scanner *scanner ) { int mode; int scanmode; - + /* are we in TPA-mode? */ mode = scanner->val[OPT_MODE].w; if( scanner->val[OPT_EXT_MODE].w != 0 ) @@ -384,7 +384,7 @@ max_string_size (const SANE_String_Const strings[]) /** shutdown open pipes */ -static SANE_Status +static SANE_Status close_pipe( Plustek_Scanner *scanner ) { if( scanner->r_pipe >= 0 ) { @@ -550,7 +550,7 @@ reader_process( void *args ) (int)status, lerrn ); if( _E_ABORT == (int)status ) return SANE_STATUS_CANCELLED; - + if( lerrn == EBUSY ) return SANE_STATUS_DEVICE_BUSY; @@ -746,7 +746,7 @@ init_options( Plustek_Scanner *s ) else s->opt[OPT_BIT_DEPTH].constraint.word_list = bpp_lm9832_list; s->val[OPT_BIT_DEPTH].w = 8; - + if (caps->workaroundFlag & _WAF_ONLY_8BIT) _DISABLE(OPT_BIT_DEPTH); @@ -851,7 +851,7 @@ init_options( Plustek_Scanner *s ) s->val[OPT_BR_Y].w = SANE_FIX(_DEFAULT_BRY); /* "Enhancement" group: */ - s->opt[OPT_ENHANCEMENT_GROUP].title = SANE_I18N("Enhancement"); + s->opt[OPT_ENHANCEMENT_GROUP].title = SANE_I18N("Enhancement"); s->opt[OPT_ENHANCEMENT_GROUP].desc = ""; s->opt[OPT_ENHANCEMENT_GROUP].type = SANE_TYPE_GROUP; s->opt[OPT_ENHANCEMENT_GROUP].cap = 0; @@ -899,7 +899,7 @@ init_options( Plustek_Scanner *s ) s->opt[OPT_GAMMA_VECTOR_B].constraint.range = &(s->gamma_range); s->opt[OPT_GAMMA_VECTOR_B].size = s->gamma_length * sizeof(SANE_Word); - /* GAMMA stuff is disabled per default */ + /* GAMMA stuff is disabled per default */ _DISABLE(OPT_GAMMA_VECTOR); _DISABLE(OPT_GAMMA_VECTOR_R); _DISABLE(OPT_GAMMA_VECTOR_G); @@ -996,7 +996,7 @@ init_options( Plustek_Scanner *s ) s->opt[OPT_AFE_GROUP].desc = ""; s->opt[OPT_AFE_GROUP].type = SANE_TYPE_GROUP; s->opt[OPT_AFE_GROUP].cap = SANE_CAP_ADVANCED; - + s->opt[OPT_OVR_REDGAIN].name = "red-gain"; s->opt[OPT_OVR_REDGAIN].title = SANE_I18N("Red gain"); s->opt[OPT_OVR_REDGAIN].desc = SANE_I18N("Red gain value of the AFE"); @@ -1118,8 +1118,8 @@ init_options( Plustek_Scanner *s ) */ static void decodeUsbIDs( char *src, char **dest ) -{ - const char *name; +{ + const char *name; char *tmp = *dest; int len = strlen(_SECTION); @@ -1134,11 +1134,11 @@ decodeUsbIDs( char *src, char **dest ) if( '\0' == name[0] ) { DBG( _DBG_SANE_INIT, "next device uses autodetection\n" ); } else { - + u_short pi = 0, vi = 0; if( *name ) { - + name = sanei_config_get_string( name, &tmp ); if( tmp ) { vi = strtol( tmp, 0, 0 ); @@ -1208,7 +1208,7 @@ decodeVal( char *src, char *opt, int what, void *result, void *def ) free( tmp2 ); } } - free( tmp ); + free( tmp ); return SANE_TRUE; } else if( _FLOAT == what ) { @@ -1226,7 +1226,7 @@ decodeVal( char *src, char *opt, int what, void *result, void *def ) free( tmp2 ); } } - free( tmp ); + free( tmp ); return SANE_TRUE; } } @@ -1245,7 +1245,7 @@ decodeVal( char *src, char *opt, int what, void *result, void *def ) static SANE_Bool decodeDevName( char *src, char *dest ) { - char *tmp; + char *tmp; const char *name; if( 0 == strncmp( "device", src, 6 )) { @@ -1360,7 +1360,7 @@ attach( const char *dev_name, CnfDef *cnf, Plustek_Device **devp ) */ dev->res_list = (SANE_Int *) calloc((((dev->usbDev.Caps.OpticDpi.x*16)-_DEF_DPI)/25+1), - sizeof (SANE_Int)); + sizeof (SANE_Int)); if (NULL == dev->res_list) { DBG( _DBG_ERROR, "calloc failed: %s\n", strerror(errno)); @@ -1565,10 +1565,10 @@ sane_init( SANE_Int *version_code, SANE_Auth_Callback authorize ) /* re-initialize the configuration structure */ init_config_struct( &config ); - + tmp = config.usbId; decodeUsbIDs( str, &tmp ); - + DBG( _DBG_SANE_INIT, "... next device\n" ); continue; @@ -1613,7 +1613,7 @@ sane_exit( void ) if( dev->calFile ) free( dev->calFile ); - + if( dev->res_list ) free( dev->res_list ); free( dev ); @@ -1807,7 +1807,7 @@ do_calibration( void *args ) continue; } } - + dev->scanning.dwFlag |= SCANFLAG_Calibration; if (SANE_STATUS_GOOD == local_sane_start(s, modes[scanmode])) { @@ -1937,7 +1937,7 @@ sane_control_option( SANE_Handle handle, SANE_Int option, strcpy ((char *) value, s->opt[option].constraint.string_list[s->val[option].w]); break; - + /* word array options: */ case OPT_GAMMA_VECTOR: DBG( _DBG_INFO, "Reading MASTER gamma.\n" ); @@ -2000,7 +2000,7 @@ sane_control_option( SANE_Handle handle, SANE_Int option, *(SANE_Word *)value = best; if( NULL != info ) { - if( v != best ) + if( v != best ) *info |= SANE_INFO_INEXACT; *info |= SANE_INFO_RELOAD_PARAMS; } @@ -2165,10 +2165,10 @@ sane_control_option( SANE_Handle handle, SANE_Int option, ((*(SANE_Word *)value) >> SANE_FIXED_SCALE_SHIFT); break; - case OPT_MODE: + case OPT_MODE: s->val[option].w = optval - s->opt[option].constraint.string_list; scanmode = getScanMode( s ); - + _ENABLE(OPT_CONTRAST); _ENABLE(OPT_BIT_DEPTH); _ENABLE(OPT_CUSTOM_GAMMA); @@ -2447,9 +2447,9 @@ local_sane_start(Plustek_Scanner *s, int scanmode ) } /* position and extent are always relative to 300 dpi */ - dpi_x = (double)dev->usbDev.Caps.OpticDpi.x; + dpi_x = (double)dev->usbDev.Caps.OpticDpi.x; dpi_y = (double)dev->usbDev.Caps.OpticDpi.x * 2; - + left = (int)(SANE_UNFIX (s->val[OPT_TL_X].w)*dpi_x/ (MM_PER_INCH*(dpi_x/300.0))); top = (int)(SANE_UNFIX (s->val[OPT_TL_Y].w)*dpi_y/ @@ -2504,7 +2504,7 @@ local_sane_start(Plustek_Scanner *s, int scanmode ) sinfo.siContrast = s->val[OPT_CONTRAST].w; memcpy( &sinfo.ImgDef, &crop.ImgDef, sizeof(ImgDef)); - + DBG( _DBG_SANE_INIT, "brightness %i, contrast %i\n", sinfo.siBrightness, sinfo.siContrast ); @@ -2628,7 +2628,7 @@ sane_start( SANE_Handle handle ) s->reader_pid = sanei_thread_begin( reader_process, s ); cancelRead = SANE_FALSE; - + if( !sanei_thread_is_valid (s->reader_pid) ) { DBG( _DBG_ERROR, "ERROR: could not start reader task\n" ); s->scanning = SANE_FALSE; @@ -2687,7 +2687,7 @@ sane_read( SANE_Handle handle, SANE_Byte *data, } } s->hw->transferRate = ipc.transferRate; - DBG( _DBG_INFO, "IPC: Transferrate = %lu Bytes/s\n", + DBG( _DBG_INFO, "IPC: Transferrate = %lu Bytes/s\n", ipc.transferRate ); } #endif @@ -2773,7 +2773,7 @@ sane_set_io_mode( SANE_Handle handle, SANE_Bool non_blocking ) DBG( _DBG_ERROR, "ERROR: not supported !\n" ); return SANE_STATUS_UNSUPPORTED; } - + if( fcntl (s->r_pipe, F_SETFL, non_blocking ? O_NONBLOCK : 0) < 0) { DBG( _DBG_ERROR, "ERROR: could not set to non-blocking mode !\n" ); return SANE_STATUS_IO_ERROR; diff --git a/backend/plustek.conf.in b/backend/plustek.conf.in index e16823e41..3d6f94785 100644 --- a/backend/plustek.conf.in +++ b/backend/plustek.conf.in @@ -84,7 +84,7 @@ option negShadingY -1 option invertNegatives 0 # -# to disable the internal sensor speedup function, +# to disable the internal sensor speedup function, # 1 disables the feature # option disableSpeedup 0 @@ -180,5 +180,5 @@ device auto # # to define a new device, start with a new section: -# [usb] +# [usb] # diff --git a/backend/plustek.h b/backend/plustek.h index be657c159..cc38f13d2 100644 --- a/backend/plustek.h +++ b/backend/plustek.h @@ -283,7 +283,7 @@ typedef struct { int rofs; int gofs; int bofs; - + int rlampoff; /* for red lamp off setting (CIS-scanner) */ int glampoff; /* for green lamp off setting (CIS-scanner) */ int blampoff; /* for blue lamp off setting (CIS-scanner) */ @@ -408,7 +408,7 @@ typedef struct Plustek_Scanner /** for collecting configuration info... */ typedef struct { - + char devName[PATH_MAX]; char usbId[_MAX_ID_LEN]; diff --git a/backend/plustek_pp.c b/backend/plustek_pp.c index f48c3dc02..633c8c550 100644 --- a/backend/plustek_pp.c +++ b/backend/plustek_pp.c @@ -58,7 +58,7 @@ /** @mainpage * @verbinclude Plustek-PARPORT.txt */ - + #ifdef _AIX # include "../include/lalloca.h" /* MUST come first for AIX! */ #endif @@ -304,17 +304,17 @@ static pModeParam getModeList( Plustek_Scanner *scanner ) if((_ASIC_IS_98003 == scanner->hw->caps.AsicID) || (_ASIC_IS_98001 == scanner->hw->caps.AsicID)) { - mp = mode_9800x_params; + mp = mode_9800x_params; } else { - mp = mode_params; - } + mp = mode_params; + } /* * the transparency/negative mode supports only GRAY/COLOR/COLOR32/COLOR48 */ if( 0 != scanner->val[OPT_EXT_MODE].w ) { mp = &mp[_TPAModeSupportMin]; - } + } return mp; } @@ -396,7 +396,7 @@ static int reader_process( void *args ) act.sa_handler = reader_process_sigterm_handler; sigaction( SIGTERM, &act, 0 ); - + data_length = scanner->params.lines * scanner->params.bytes_per_line; DBG( _DBG_PROC, "reader_process:" @@ -407,7 +407,7 @@ static int reader_process( void *args ) DBG( _DBG_FATAL, "NULL Pointer !!!!\n" ); return SANE_STATUS_IO_ERROR; } - + /* here we read all data from the driver... */ if( scanner->hw->readImage ) { @@ -419,7 +419,7 @@ static int reader_process( void *args ) status = scanner->hw->prepare( scanner->hw, buf ); - + if( 0 == status ) { for( line = 0; line < scanner->params.lines; line++ ) { @@ -442,7 +442,7 @@ static int reader_process( void *args ) (int)status, errno ); if( -9009 == (int)status ) return SANE_STATUS_CANCELLED; - + if( errno == EBUSY ) return SANE_STATUS_DEVICE_BUSY; @@ -479,8 +479,8 @@ static SANE_Status do_cancel( Plustek_Scanner *scanner, SANE_Bool closepipe ) if( -1 != scanner->hw->fd ) { int_cnt = 1; scanner->hw->stopScan( scanner->hw, &int_cnt ); - } - + } + sigemptyset(&(act.sa_mask)); act.sa_flags = 0; @@ -494,17 +494,17 @@ static SANE_Status do_cancel( Plustek_Scanner *scanner, SANE_Bool closepipe ) alarm(10); res = sanei_thread_waitpid( scanner->reader_pid, 0 ); alarm(0); - + if( res != scanner->reader_pid ) { DBG( _DBG_PROC,"sanei_thread_waitpid() failed !\n"); - + /* do it the hard way...*/ #ifdef USE_PTHREAD sanei_thread_kill( scanner->reader_pid ); #else sanei_thread_sendsig( scanner->reader_pid, SIGKILL ); #endif - } + } scanner->reader_pid = -1; DBG( _DBG_PROC,"reader_process killed\n"); @@ -547,7 +547,7 @@ static void limitResolution( Plustek_Device *dev ) } else { dev->dpi_range.max = lens.rDpiY.wPhyMax; } - + dev->dpi_range.quant = 0; dev->x_range.min = 0; dev->x_range.max = SANE_FIX(dev->max_x); @@ -582,37 +582,37 @@ static SANE_Status initGammaSettings( Plustek_Scanner *s ) s->gamma_length = 256; } - + DBG( _DBG_INFO, "Presetting Gamma tables (len=%u)\n", s->gamma_length ); DBG( _DBG_INFO, "----------------------------------\n" ); - + /* * preset the gamma maps */ for( i = 0; i < 4; i++ ) { - + switch( i ) { case 1: gamma = s->hw->adj.rgamma; break; case 2: gamma = s->hw->adj.ggamma; break; case 3: gamma = s->hw->adj.bgamma; break; default: gamma = s->hw->adj.graygamma; break; - } - + } + for( j = 0; j < s->gamma_length; j++ ) { - + val = (s->gamma_range.max * pow((double) j / ((double)s->gamma_length - 1.0), 1.0 / gamma )); - + if( val > s->gamma_range.max ) val = s->gamma_range.max; - - s->gamma_table[i][j] = val; - } - } - + + s->gamma_table[i][j] = val; + } + } + return SANE_STATUS_GOOD; -} +} /** Check the gamma vectors we got back and limit if necessary * @param s - pointer to the scanner specific structure @@ -685,7 +685,7 @@ static SANE_Status init_options( Plustek_Scanner *s ) s->opt[OPT_EXT_MODE].constraint_type = SANE_CONSTRAINT_STRING_LIST; s->opt[OPT_EXT_MODE].constraint.string_list = ext_mode_list; s->val[OPT_EXT_MODE].w = 0; /* Normal */ - + /* halftone */ s->opt[OPT_HALFTONE].name = SANE_NAME_HALFTONE_PATTERN; s->opt[OPT_HALFTONE].title = SANE_TITLE_HALFTONE; @@ -790,14 +790,14 @@ static SANE_Status init_options( Plustek_Scanner *s ) s->val[OPT_BR_Y].w = SANE_FIX(_DEFAULT_BRY); /* "Enhancement" group: */ - s->opt[OPT_ENHANCEMENT_GROUP].title = SANE_I18N("Enhancement"); + s->opt[OPT_ENHANCEMENT_GROUP].title = SANE_I18N("Enhancement"); s->opt[OPT_ENHANCEMENT_GROUP].desc = ""; s->opt[OPT_ENHANCEMENT_GROUP].type = SANE_TYPE_GROUP; s->opt[OPT_ENHANCEMENT_GROUP].cap = 0; s->opt[OPT_ENHANCEMENT_GROUP].constraint_type = SANE_CONSTRAINT_NONE; - + initGammaSettings( s ); - + /* grayscale gamma vector */ s->opt[OPT_GAMMA_VECTOR].name = SANE_NAME_GAMMA_VECTOR; s->opt[OPT_GAMMA_VECTOR].title = SANE_TITLE_GAMMA_VECTOR; @@ -842,12 +842,12 @@ static SANE_Status init_options( Plustek_Scanner *s ) s->opt[OPT_GAMMA_VECTOR_B].constraint.range = &(s->gamma_range); s->opt[OPT_GAMMA_VECTOR_B].size = s->gamma_length * sizeof(SANE_Word); - /* GAMMA stuff is disabled per default */ + /* GAMMA stuff is disabled per default */ s->opt[OPT_GAMMA_VECTOR].cap |= SANE_CAP_INACTIVE; s->opt[OPT_GAMMA_VECTOR_R].cap |= SANE_CAP_INACTIVE; s->opt[OPT_GAMMA_VECTOR_G].cap |= SANE_CAP_INACTIVE; s->opt[OPT_GAMMA_VECTOR_B].cap |= SANE_CAP_INACTIVE; - + /* disable extended mode list for devices without TPA */ if( 0 == (s->hw->caps.dwFlag & SFLAG_TPA)) { s->opt[OPT_EXT_MODE].cap |= SANE_CAP_INACTIVE; @@ -856,7 +856,7 @@ static SANE_Status init_options( Plustek_Scanner *s ) /* disable custom gamma, if not supported by the driver... */ if( 0 == (s->hw->caps.dwFlag & SFLAG_CUSTOM_GAMMA)) { s->opt[OPT_CUSTOM_GAMMA].cap |= SANE_CAP_INACTIVE; - } + } return SANE_STATUS_GOOD; } @@ -885,18 +885,18 @@ static SANE_Bool decodeVal( char *src, char *opt, /* get the name of the option */ name = sanei_config_get_string( name, &tmp ); - if( tmp ) { + if( tmp ) { /* on success, compare wiht the given one */ if( 0 == strcmp( tmp, opt )) { - + DBG( _DBG_SANE_INIT, "Decoding option >%s<\n", opt ); if( _INT == what ) { - + /* assign the default value for this option... */ *((int*)result) = *((int*)def); - + if( *name ) { /* get the configuration value and decode it */ @@ -907,14 +907,14 @@ static SANE_Bool decodeVal( char *src, char *opt, free( tmp2 ); } } - free( tmp ); + free( tmp ); return SANE_TRUE; - + } else if( _FLOAT == what ) { - + /* assign the default value for this option... */ *((double*)result) = *((double*)def); - + if( *name ) { /* get the configuration value and decode it */ @@ -925,13 +925,13 @@ static SANE_Bool decodeVal( char *src, char *opt, free( tmp2 ); } } - free( tmp ); + free( tmp ); return SANE_TRUE; } - } + } free( tmp ); } - + return SANE_FALSE; } @@ -944,27 +944,27 @@ static SANE_Bool decodeVal( char *src, char *opt, */ static SANE_Bool decodeDevName( char *src, char *dest ) { - char *tmp; + char *tmp; const char *name; if( 0 == strncmp( "device", src, 6 )) { name = (const char*)&src[strlen("device")]; name = sanei_config_skip_whitespace( name ); - + DBG( _DBG_SANE_INIT, "Decoding device name >%s<\n", name ); - + if( *name ) { name = sanei_config_get_string( name, &tmp ); if( tmp ) { - + strcpy( dest, tmp ); free( tmp ); return SANE_TRUE; } - } + } } - + return SANE_FALSE; } @@ -1000,7 +1000,7 @@ static SANE_Status attach( const char *dev_name, pCnfDef cnf, /* assign all the stuff we need fo this device... */ memset(dev, 0, sizeof (*dev)); - + dev->fd = -1; dev->name = strdup(dev_name); /* hold it double to avoid */ dev->sane.name = dev->name; /* compiler warnings */ @@ -1067,7 +1067,7 @@ static SANE_Status attach( const char *dev_name, pCnfDef cnf, } else { dev->sane.model = ModelStr[0]; } - + DBG( _DBG_INFO, "Vendor : %s\n", dev->sane.vendor ); DBG( _DBG_INFO, "Model : %s\n", dev->sane.model ); DBG( _DBG_INFO, "Asic : 0x%02x\n", dev->caps.AsicID ); @@ -1140,7 +1140,7 @@ SANE_Status sane_init( SANE_Int *version_code, SANE_Auth_Callback authorize ) DBG_INIT(); sanei_thread_init(); - + res = sanei_pp_init(); if( SANE_STATUS_GOOD != res ) { DBG( _DBG_ERROR, "Could not initialize Parport library!\n" ); @@ -1178,20 +1178,20 @@ SANE_Status sane_init( SANE_Int *version_code, SANE_Auth_Callback authorize ) } while( sanei_config_read( str, sizeof(str), fp)) { - + DBG( _DBG_SANE_INIT, ">%s<\n", str ); if( str[0] == '#') /* ignore line comments */ continue; - + len = strlen(str); if( 0 == len ) continue; /* ignore empty lines */ /* check for options */ if( 0 == strncmp(str, "option", 6)) { - + int ival; - + ival = -1; decodeVal( str, "warmup", _INT, &config.adj.warmup, &ival); decodeVal( str, "lampOff", _INT, &config.adj.lampOff, &ival); @@ -1203,14 +1203,14 @@ SANE_Status sane_init( SANE_Int *version_code, SANE_Auth_Callback authorize ) /* check for sections: */ } else if( 0 == strncmp( str, "[direct]", 8)) { - + /* new section, try and attach previous device */ if( config.devName[0] != '\0' ) attach( config.devName, &config, 0 ); - + /* re-initialize the configuration structure */ init_config_struct( &config, SANE_TRUE ); - continue; + continue; } else if( 0 == strncmp( str, "[kernel]", 8 )) { @@ -1221,11 +1221,11 @@ SANE_Status sane_init( SANE_Int *version_code, SANE_Auth_Callback authorize ) /* re-initialize the configuration structure */ init_config_struct( &config, SANE_FALSE ); continue; - + } else if( SANE_TRUE == decodeDevName( str, config.devName )) { continue; } - + /* ignore other stuff... */ DBG( _DBG_SANE_INIT, "ignoring >%s<\n", str ); } @@ -1234,7 +1234,7 @@ SANE_Status sane_init( SANE_Int *version_code, SANE_Auth_Callback authorize ) /* try to attach the last device in the config file... */ if( config.devName[0] != '\0' ) attach( config.devName, &config, 0 ); - + return SANE_STATUS_GOOD; } @@ -1328,7 +1328,7 @@ SANE_Status sane_open( SANE_String_Const devicename, SANE_Handle* handle ) if( !dev ) { memset( &config, 0, sizeof(CnfDef)); - + /* check if a valid parport-device is meant... */ status = attach( devicename, &config, &dev ); if( SANE_STATUS_GOOD != status ) @@ -1359,7 +1359,7 @@ SANE_Status sane_open( SANE_String_Const devicename, SANE_Handle* handle ) first_handle = s; *handle = s; - + return SANE_STATUS_GOOD; } @@ -1382,7 +1382,7 @@ void sane_close (SANE_Handle handle) if (!s) { DBG( _DBG_ERROR, "close: invalid handle %p\n", handle); - return; + return; } close_pipe( s ); @@ -1463,7 +1463,7 @@ SANE_Status sane_control_option( SANE_Handle handle, SANE_Int option, strcpy ((char *) value, s->opt[option].constraint.string_list[s->val[option].w]); break; - + /* word array options: */ case OPT_GAMMA_VECTOR: case OPT_GAMMA_VECTOR_R: @@ -1471,7 +1471,7 @@ SANE_Status sane_control_option( SANE_Handle handle, SANE_Int option, case OPT_GAMMA_VECTOR_B: memcpy( value, s->val[option].wa, s->opt[option].size ); break; - + default: return SANE_STATUS_INVAL; } @@ -1514,7 +1514,7 @@ SANE_Status sane_control_option( SANE_Handle handle, SANE_Int option, *(SANE_Word *)value = best; if( NULL != info ) { - if( v != best ) + if( v != best ) *info |= SANE_INFO_INEXACT; *info |= SANE_INFO_RELOAD_PARAMS; } @@ -1531,7 +1531,7 @@ SANE_Status sane_control_option( SANE_Handle handle, SANE_Int option, if( NULL != info ) *info |= SANE_INFO_RELOAD_PARAMS; break; - + case OPT_CUSTOM_GAMMA: s->val[option].w = *(SANE_Word *)value; if( NULL != info ) @@ -1544,9 +1544,9 @@ SANE_Status sane_control_option( SANE_Handle handle, SANE_Int option, s->opt[OPT_GAMMA_VECTOR_R].cap |= SANE_CAP_INACTIVE; s->opt[OPT_GAMMA_VECTOR_G].cap |= SANE_CAP_INACTIVE; s->opt[OPT_GAMMA_VECTOR_B].cap |= SANE_CAP_INACTIVE; - + if( SANE_TRUE == s->val[option].w ) { - + if((scanmode == COLOR_256GRAY) || (scanmode == COLOR_GRAY16)) { s->opt[OPT_GAMMA_VECTOR].cap &= ~SANE_CAP_INACTIVE; @@ -1554,20 +1554,20 @@ SANE_Status sane_control_option( SANE_Handle handle, SANE_Int option, s->opt[OPT_GAMMA_VECTOR_R].cap &= ~SANE_CAP_INACTIVE; s->opt[OPT_GAMMA_VECTOR_G].cap &= ~SANE_CAP_INACTIVE; s->opt[OPT_GAMMA_VECTOR_B].cap &= ~SANE_CAP_INACTIVE; - } - + } + } else { - + initGammaSettings( s ); - + if((scanmode == COLOR_256GRAY) || (scanmode == COLOR_GRAY16)) { s->opt[OPT_GAMMA_VECTOR].cap |= SANE_CAP_INACTIVE; - } else { + } else { s->opt[OPT_GAMMA_VECTOR_R].cap |= SANE_CAP_INACTIVE; s->opt[OPT_GAMMA_VECTOR_G].cap |= SANE_CAP_INACTIVE; s->opt[OPT_GAMMA_VECTOR_B].cap |= SANE_CAP_INACTIVE; - } + } } break; @@ -1587,7 +1587,7 @@ SANE_Status sane_control_option( SANE_Handle handle, SANE_Int option, } mp = getModeList( s ); - + if( mp[idx].scanmode != COLOR_HALFTONE ){ s->opt[OPT_HALFTONE].cap |= SANE_CAP_INACTIVE; s->opt[OPT_CONTRAST].cap &= ~SANE_CAP_INACTIVE; @@ -1601,16 +1601,16 @@ SANE_Status sane_control_option( SANE_Handle handle, SANE_Int option, if( mp[idx].scanmode == COLOR_BW ) { s->opt[OPT_CONTRAST].cap |= SANE_CAP_INACTIVE; s->opt[OPT_CUSTOM_GAMMA].cap |= SANE_CAP_INACTIVE; - } - + } + s->opt[OPT_GAMMA_VECTOR].cap |= SANE_CAP_INACTIVE; s->opt[OPT_GAMMA_VECTOR_R].cap |= SANE_CAP_INACTIVE; s->opt[OPT_GAMMA_VECTOR_G].cap |= SANE_CAP_INACTIVE; s->opt[OPT_GAMMA_VECTOR_B].cap |= SANE_CAP_INACTIVE; - + if( s->val[OPT_CUSTOM_GAMMA].w && !(s->opt[OPT_CUSTOM_GAMMA].cap & SANE_CAP_INACTIVE)) { - + if((mp[idx].scanmode == COLOR_256GRAY) || (mp[idx].scanmode == COLOR_GRAY16)) { s->opt[OPT_GAMMA_VECTOR].cap &= ~SANE_CAP_INACTIVE; @@ -1677,7 +1677,7 @@ SANE_Status sane_control_option( SANE_Handle handle, SANE_Int option, } if( s->hw->caps.dwFlag & SFLAG_TPA ) { - + s->opt[OPT_MODE].constraint.string_list = &mode_9800x_list[_TPAModeSupportMin]; } else { @@ -1708,7 +1708,7 @@ SANE_Status sane_control_option( SANE_Handle handle, SANE_Int option, return SANE_STATUS_INVAL; } break; - + default: return SANE_STATUS_INVAL; @@ -1834,7 +1834,7 @@ SANE_Status sane_start( SANE_Handle handle ) s->hw->close( s->hw ); return SANE_STATUS_IO_ERROR; } - + result = s->hw->getLensInfo( s->hw, &lens ); if( result < 0 ) { DBG( _DBG_ERROR, "dev->getLensInfo() failed(%d)\n", result ); @@ -2148,7 +2148,7 @@ SANE_Status sane_set_io_mode (SANE_Handle handle, SANE_Bool non_blocking) DBG( _DBG_ERROR, "ERROR: not supported !\n" ); return SANE_STATUS_UNSUPPORTED; } - + if( fcntl (s->r_pipe, F_SETFL, non_blocking ? O_NONBLOCK : 0) < 0) { DBG( _DBG_ERROR, "ERROR: can´t set to non-blocking mode !\n" ); return SANE_STATUS_IO_ERROR; diff --git a/backend/plustek_pp.conf.in b/backend/plustek_pp.conf.in index a0003431f..d3570074d 100644 --- a/backend/plustek_pp.conf.in +++ b/backend/plustek_pp.conf.in @@ -1,5 +1,5 @@ # Plustek-PP SANE Backend configuration file -# For use with Plustek parallel-port scanners +# For use with Plustek parallel-port scanners # # diff --git a/backend/qcam.c b/backend/qcam.c index 0148bea45..4c46fa717 100644 --- a/backend/qcam.c +++ b/backend/qcam.c @@ -1248,7 +1248,7 @@ init_options (QC_Scanner * s) int i; DBG (3, "init_options: enter\n"); - + memset (s->opt, 0, sizeof (s->opt)); memset (s->val, 0, sizeof (s->val)); @@ -1446,7 +1446,7 @@ init_options (QC_Scanner * s) s->val[OPT_SATURATION].w = 100; DBG (3, "init_options: exit\n"); - + return SANE_STATUS_GOOD; } @@ -1497,9 +1497,9 @@ sane_exit (void) { QC_Device *dev, *next; static const SANE_Device **devlist; - + DBG (5, "sane_exit: enter\n"); - + for (dev = first_dev; dev; dev = next) { next = dev->next; @@ -1510,7 +1510,7 @@ sane_exit (void) if (devlist) { free (devlist); devlist = NULL; - } + } DBG (5, "sane_exit: exit\n"); } @@ -1538,9 +1538,9 @@ sane_get_devices (const SANE_Device *** device_list, SANE_Bool local_only) devlist[i++] = 0; *device_list = devlist; - + DBG (5, "sane_get_devices: exit\n"); - + return SANE_STATUS_GOOD; } @@ -1630,7 +1630,7 @@ sane_close (SANE_Handle handle) QC_Scanner *prev, *s; DBG (5, "sane_close: enter\n"); - + /* remove handle from list of open handles: */ prev = 0; for (s = first_handle; s; s = s->next) @@ -1666,9 +1666,9 @@ sane_close (SANE_Handle handle) close (s->read_fd); free (s); - + DBG (5, "sane_close: exit\n"); - + } const SANE_Option_Descriptor * @@ -1677,7 +1677,7 @@ sane_get_option_descriptor (SANE_Handle handle, SANE_Int option) QC_Scanner *s = handle; DBG (5, "sane_get_option_descriptor: enter\n"); - + if ((unsigned) option >= NUM_OPTIONS) return 0; @@ -1698,7 +1698,7 @@ sane_control_option (SANE_Handle handle, SANE_Int option, int i; DBG (5, "sane_control_option: enter\n"); - + if (info) *info = 0; @@ -1866,7 +1866,7 @@ sane_get_parameters (SANE_Handle handle, SANE_Parameters * params) size_t Bpp = 3; /* # of bytes per pixel */ DBG (5, "sane_get_parameters: enter\n"); - + if (!s->scanning) { /* Only compute new parameters when not scanning---allows @@ -1912,7 +1912,7 @@ sane_start (SANE_Handle handle) QC_Scan_Request req; DBG (5, "sane_start: enter\n"); - + if (s->scanning) return SANE_STATUS_DEVICE_BUSY; @@ -2099,7 +2099,7 @@ sane_start (SANE_Handle handle) s->deliver_eof = 0; DBG (5, "sane_start: exit\n"); - + return SANE_STATUS_GOOD; } @@ -2114,7 +2114,7 @@ sane_read (SANE_Handle handle, SANE_Byte * buf, SANE_Int max_len, size_t len; DBG (5, "sane_read: enter\n"); - + *lenp = 0; if (s->deliver_eof) @@ -2177,7 +2177,7 @@ sane_cancel (SANE_Handle handle) SANE_Status status; DBG (5, "sane_cancel: enter\n"); - + was_scanning = s->scanning; s->scanning = SANE_FALSE; s->deliver_eof = 0; @@ -2239,7 +2239,7 @@ sane_set_io_mode (SANE_Handle handle, SANE_Bool non_blocking) QC_Scanner *s = handle; DBG (5, "sane_set_io_mode: enter\n"); - + if (!s->scanning) return SANE_STATUS_INVAL; diff --git a/backend/ricoh-scsi.c b/backend/ricoh-scsi.c index 72fd70bea..73bd4fa01 100644 --- a/backend/ricoh-scsi.c +++ b/backend/ricoh-scsi.c @@ -39,9 +39,9 @@ whether to permit this exception to apply to your modifications. If you do not wish that, delete this exception notice. */ -/* +/* $Id$ - This file implements the low-level scsi-commands. + This file implements the low-level scsi-commands. */ @@ -251,7 +251,7 @@ set_window (int fd, struct ricoh_window_data *rwd) static SANE_Status get_window (int fd, struct ricoh_window_data *rwd) { - + static struct scsi_window_cmd cmd; static size_t rwd_size; SANE_Status status; @@ -317,7 +317,7 @@ get_data_status (int fd, struct scsi_status_desc *dbs) status = sanei_scsi_cmd (fd, &cmd, sizeof (cmd), &ssd, &ssd_size); memcpy (dbs, &ssd.desc, sizeof(*dbs)); - if (status == SANE_STATUS_GOOD && + if (status == SANE_STATUS_GOOD && (((unsigned int) _3btol(ssd.len)) <= sizeof(*dbs) || _3btol(ssd.desc.filled) == 0)) { DBG (11, "get_data_status: busy\n"); status = SANE_STATUS_DEVICE_BUSY; diff --git a/backend/ricoh.c b/backend/ricoh.c index 88f33d1ae..58b3a5347 100644 --- a/backend/ricoh.c +++ b/backend/ricoh.c @@ -41,7 +41,7 @@ /* $Id$ - This file implements a SANE backend for Ricoh flatbed scanners. + This file implements a SANE backend for Ricoh flatbed scanners. */ #include "../include/sane/config.h" @@ -187,7 +187,7 @@ attach (const char *devnam, Ricoh_Device ** devp) DBG (1, "attach: MODE_SELECT failed\n"); sanei_scsi_close (fd); return (SANE_STATUS_INVAL); - } + } #endif #if 0 @@ -510,7 +510,7 @@ sane_init (SANE_Int * version_code, SANE_Auth_Callback authorize) if (line[0] == '#') /* ignore line comments */ continue; len = strlen (line); - + if (!len) continue; /* ignore empty lines */ @@ -538,7 +538,7 @@ sane_exit (void) free ((void *) dev->sane.model); free (dev); } - + if (devlist) free (devlist); @@ -824,7 +824,7 @@ sane_start (SANE_Handle handle) s->brightness = s->val[OPT_BRIGHTNESS].w; s->contrast = s->val[OPT_CONTRAST].w; s->bpp = s->params.depth; - if (strcmp (mode_str, SANE_VALUE_SCAN_MODE_LINEART) == 0) + if (strcmp (mode_str, SANE_VALUE_SCAN_MODE_LINEART) == 0) { s->image_composition = RICOH_BINARY_MONOCHROME; } @@ -849,11 +849,11 @@ sane_start (SANE_Handle handle) wbuf.image_comp = s->image_composition; /* if you throw the MRIF bit the brighness control reverses too */ /* so I reverse the reversal in software for symmetry's sake */ - if (wbuf.image_comp == RICOH_GRAYSCALE || wbuf.image_comp == RICOH_DITHERED_MONOCHROME) + if (wbuf.image_comp == RICOH_GRAYSCALE || wbuf.image_comp == RICOH_DITHERED_MONOCHROME) { - if (wbuf.image_comp == RICOH_GRAYSCALE) + if (wbuf.image_comp == RICOH_GRAYSCALE) wbuf.mrif_filtering_gamma_id = (SANE_Byte) 0x90; - if (wbuf.image_comp == RICOH_DITHERED_MONOCHROME) + if (wbuf.image_comp == RICOH_DITHERED_MONOCHROME) wbuf.mrif_filtering_gamma_id = (SANE_Byte) 0x10; wbuf.brightness = 256 - (SANE_Byte) s->brightness; if (is50) @@ -899,7 +899,7 @@ sane_start (SANE_Handle handle) if (status != SANE_STATUS_GOOD) { DBG (1, "GET WINDOW failed: %s\n", sane_strstatus (status)); - return (status); + return (status); } DBG (5, "xres=%d\n", _2btol(wbuf.x_res)); DBG (5, "yres=%d\n", _2btol(wbuf.y_res)); @@ -937,18 +937,18 @@ sane_start (SANE_Handle handle) { DBG (1, "GET DATA STATUS failed: %s\n", sane_strstatus (status)); return (status); - } + } s->bytes_to_read = s->params.bytes_per_line * s->params.lines; DBG (1, "%d pixels per line, %d bytes, %d lines high, total %lu bytes, " "dpi=%d\n", s->params.pixels_per_line, s->params.bytes_per_line, s->params.lines, (u_long) s->bytes_to_read, s->val[OPT_Y_RESOLUTION].w); - + s->scanning = SANE_TRUE; - DBG (11, "<< sane_start\n"); - return (SANE_STATUS_GOOD); + DBG (11, "<< sane_start\n"); + return (SANE_STATUS_GOOD); } SANE_Status @@ -963,7 +963,7 @@ sane_read (SANE_Handle handle, SANE_Byte * buf, SANE_Int max_len, *len = 0; DBG (11, "sane_read: bytes left to read: %ld\n", (u_long) s->bytes_to_read); - + if (s->bytes_to_read == 0) { do_cancel (s); @@ -973,7 +973,7 @@ sane_read (SANE_Handle handle, SANE_Byte * buf, SANE_Int max_len, if (!s->scanning) { DBG (11, "sane_read: scanning is false!\n"); return (do_cancel (s)); - } + } nread = max_len; if (nread > s->bytes_to_read) diff --git a/backend/ricoh.h b/backend/ricoh.h index f9bb36e83..87712976f 100644 --- a/backend/ricoh.h +++ b/backend/ricoh.h @@ -171,7 +171,7 @@ _4btol(SANE_Byte *bytes) return (rv); } -typedef enum +typedef enum { OPT_NUM_OPTS = 0, @@ -318,7 +318,7 @@ struct measurements_units_page { }; struct mode_pages { - SANE_Byte page_code; + SANE_Byte page_code; SANE_Byte parameter_length; SANE_Byte rest[6]; #if 0 diff --git a/backend/rts8891.c b/backend/rts8891.c index 0eaff7b4b..c44f7db70 100644 --- a/backend/rts8891.c +++ b/backend/rts8891.c @@ -292,7 +292,7 @@ write_rgb_data (char *name, unsigned char *image, SANE_Int width, /** * Called by SANE initially. - * + * * From the SANE spec: * This function must be called before any other SANE function can be * called. The behavior of a SANE backend is undefined if this @@ -333,7 +333,7 @@ sane_init (SANE_Int * version_code, SANE_Auth_Callback authorize) /** * Called by SANE to find out about supported devices. - * + * * From the SANE spec: * This function can be used to query the list of devices that are * available. If the function executes successfully, it stores a @@ -346,7 +346,7 @@ sane_init (SANE_Int * version_code, SANE_Auth_Callback authorize) * returned (devices directly attached to the machine that SANE is * running on). If it is false, the device list includes all remote * devices that are accessible to the SANE library. - * + * * SANE does not require that this function is called before a * sane_open() call is performed. A device name may be specified * explicitly by a user which would make it unnecessary and @@ -908,7 +908,7 @@ get_option_value (Rts8891_Session * s, int option, void *val) /** * Gets or sets an option value. - * + * * From the SANE spec: * This function is used to set or inquire the current value of option * number n of the device represented by handle h. The manner in which @@ -919,7 +919,7 @@ get_option_value (Rts8891_Session * s, int option, void *val) * area pointed to by v must be big enough to hold the entire option * value (determined by member size in the corresponding option * descriptor). - * + * * The only exception to this rule is that when setting the value of a * string option, the string pointed to by argument v may be shorter * since the backend will stop reading the option value upon @@ -1388,8 +1388,8 @@ sane_start (SANE_Handle handle) /** * This function computes two set of parameters. The one for the SANE's standard - * and the other for the hardware. Among these parameters are the bit depth, total - * number of lines, total number of columns, extra line to read for data reordering... + * and the other for the hardware. Among these parameters are the bit depth, total + * number of lines, total number of columns, extra line to read for data reordering... */ static SANE_Status compute_parameters (Rts8891_Session * session) @@ -1666,7 +1666,7 @@ compute_parameters (Rts8891_Session * session) * completion of that request. Outside of that window, the returned * values are best-effort estimates of what the parameters will be * when sane_start() gets invoked. - * + * * Calling this function before a scan has actually started allows, * for example, to get an estimate of how big the scanned image will * be. The parameters passed to this function are the handle of the @@ -1693,7 +1693,7 @@ sane_get_parameters (SANE_Handle handle, SANE_Parameters * params) /** * Called by SANE to read data. - * + * * From the SANE spec: * This function is used to read image data from the device * represented by handle h. Argument buf is a pointer to a memory @@ -1701,7 +1701,7 @@ sane_get_parameters (SANE_Handle handle, SANE_Parameters * params) * returned is stored in *len. A backend must set this to zero when * the call fails (i.e., when a status other than SANE_STATUS_GOOD is * returned). - * + * * When the call succeeds, the number of bytes returned can be * anywhere in the range from 0 to maxlen bytes. */ @@ -2077,7 +2077,7 @@ sane_read (SANE_Handle handle, SANE_Byte * buf, /** - * Cancels a scan. + * Cancels a scan. * * From the SANE spec: * This function is used to immediately or as quickly as possible @@ -2155,7 +2155,7 @@ sane_cancel (SANE_Handle handle) /** * Ends use of the session. - * + * * From the SANE spec: * This function terminates the association between the device handle * passed in argument h and the device it represents. If the device is @@ -2188,7 +2188,7 @@ sane_close (SANE_Handle handle) DBG (DBG_error, "close: invalid handle %p\n", handle); return; /* oops, not a handle we know about */ } - + dev=session->dev; /* cancel any active scan */ @@ -2202,7 +2202,7 @@ sane_close (SANE_Handle handle) rts8891_wait_for_home (dev, dev->regs); } set_lamp_brightness (dev, 0); - + if (prev) prev->next = session->next; @@ -2248,7 +2248,7 @@ sane_close (SANE_Handle handle) /** * Terminates the backend. - * + * * From the SANE spec: * This function must be called to terminate use of a backend. The * function will first close all device handles that still might be @@ -2408,8 +2408,8 @@ config_attach_rts8891 (SANEI_Config * config, const char *devname) return SANE_STATUS_INVAL; } - /* the devname has been processed and is ready to be used - * directly. Since the backend is an USB only one, we can + /* the devname has been processed and is ready to be used + * directly. Since the backend is an USB only one, we can * call sanei_usb_attach_matching_devices straight */ sanei_usb_attach_matching_devices (devname, attach_rts8891); @@ -2863,7 +2863,7 @@ init_options (struct Rts8891_Session *session) /** * average scanned rgb data, returns the global average. Each channel avearge is also - * returned. + * returned. */ static float average_area (int color, SANE_Byte * data, int width, int height, @@ -3028,7 +3028,7 @@ find_origin (struct Rts8891_Device *dev, SANE_Bool * changed) DBG (DBG_proc, "find_origin: start\n"); - /* check if head is at home + /* check if head is at home * once sensor is correctly set up, we are allways park here, * but in case sensor has just changed, we are not so we park head */ sanei_rts88xx_read_reg (dev->devnum, CONTROLER_REG, ®); @@ -3287,7 +3287,7 @@ find_origin (struct Rts8891_Device *dev, SANE_Bool * changed) dev->regs[0xe2] = 0x03; /* 0x01 */ - /* dev->regs[0xe5] = 0x0d; 0x1c + /* dev->regs[0xe5] = 0x0d; 0x1c dev->regs[0xe6] = 0x08; 0x10 080d=2061=1030*2+1 */ SET_DOUBLE (dev->regs, EXPOSURE_REG, 2061); } @@ -3326,7 +3326,7 @@ find_origin (struct Rts8891_Device *dev, SANE_Bool * changed) /** * This function detects the left margin (ie x offset of scanning area) by doing * a grey scan of the very beginning of the sensor and finding the start of the - * white area of calibration zone, which is start of usable pixels. + * white area of calibration zone, which is start of usable pixels. */ static SANE_Status find_margin (struct Rts8891_Device *dev) @@ -3547,7 +3547,7 @@ initialize_device (struct Rts8891_Device *dev) } DBG (DBG_io, "initialize_device: lamp status=0x%02x\n", dev->regs[0x8e]); - /* sensor type the one for 4470c sold with XPA is slightly different + /* sensor type the one for 4470c sold with XPA is slightly different * than those sold bare, for this model we allways start with xpa type sensor, * and change it later if we detect black scans in find_origin(). In case the * attach function set up the sensor type, we don't modify it */ @@ -4233,7 +4233,7 @@ init_device (struct Rts8891_Device *dev) rts8891_write_all (dev->devnum, dev->regs, dev->reg_count); /* now we are writing and reading back from memory, it is surely a memory test since the written data - * don't look usefull at first glance + * don't look usefull at first glance */ reg = 0x06; sanei_rts88xx_write_reg (dev->devnum, 0x93, ®); @@ -4424,7 +4424,7 @@ init_device (struct Rts8891_Device *dev) sanei_rts88xx_write_reg (dev->devnum, CONTROLER_REG, ®); /* now we init nvram */ - /* this is highly dangerous and thus desactivated + /* this is highly dangerous and thus desactivated * in sanei_rts88xx_setup_nvram (HAZARDOUS_EXPERIMENT #define) */ sanei_rts88xx_setup_nvram (dev->devnum, 21, nv_cmd1); sanei_rts88xx_setup_nvram (dev->devnum, 21, nv_cmd2); @@ -4513,17 +4513,17 @@ static SANE_Status detect_device (struct Rts8891_Device *dev) { /* ---- 5 74945 bulk_out len 4 wrote 0x80 0xb0 0x00 0x01 ---- 6 74946 bulk_in len 1 read 0x80 ---- 7 74947 bulk_out len 4 wrote 0x80 0xb3 0x00 0x01 ---- 8 74948 bulk_in len 1 read 0x04 ---- 9 74949 bulk_out len 4 wrote 0x80 0xb1 0x00 0x01 ---- 10 74950 bulk_in len 1 read 0x00 ---- 11 74951 bulk_out len 5 wrote 0x88 0xb3 0x00 0x01 0x00 ---- 12 74952 bulk_out len 5 wrote 0x88 0xb3 0x00 0x01 0x00 ---- 13 74953 bulk_out len 4 wrote 0x80 0x00 0x00 0xf4 ---- 14 74954 bulk_in len 192 read 0xf5 0x41 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x70 0x00 0x00 0x00 0x00 0x60 0x1b 0xff 0x3e 0x00 0x00 0xff 0x3e 0x00 0x00 0x00 0x00 0x00 0x22 0x00 0x00 0x00 0x00 0x00 0xff 0x00 0xff 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x01 0x42 0x00 0x00 0x10 0x00 0x00 0x00 0x00 0x02 0x00 0x00 0x00 0x00 0x00 0x00 0x80 0x00 0x00 0x00 0x18 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x20 0x24 0x04 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x80 0x10 0x00 0x80 0x00 0x10 0x00 0x01 0x00 0x00 0x10 0x00 0x00 0x20 0x20 0x00 0x00 0x00 0x00 0x20 0x01 0x00 0x02 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x41 0x00 0x10 0x21 0x20 0x00 0x20 0x81 0x20 0x01 0x01 0x00 0x22 0x00 0x40 0x05 0x00 0x00 0x01 0x1e 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0xcc 0x27 0x64 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x80 0x00 0x06 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 ---- 15 74955 bulk_in len 52 read 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x01 0x06 0x1b 0x10 0x7a 0x00 0x15 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x0f 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 +--- 5 74945 bulk_out len 4 wrote 0x80 0xb0 0x00 0x01 +--- 6 74946 bulk_in len 1 read 0x80 +--- 7 74947 bulk_out len 4 wrote 0x80 0xb3 0x00 0x01 +--- 8 74948 bulk_in len 1 read 0x04 +--- 9 74949 bulk_out len 4 wrote 0x80 0xb1 0x00 0x01 +--- 10 74950 bulk_in len 1 read 0x00 +--- 11 74951 bulk_out len 5 wrote 0x88 0xb3 0x00 0x01 0x00 +--- 12 74952 bulk_out len 5 wrote 0x88 0xb3 0x00 0x01 0x00 +--- 13 74953 bulk_out len 4 wrote 0x80 0x00 0x00 0xf4 +--- 14 74954 bulk_in len 192 read 0xf5 0x41 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x70 0x00 0x00 0x00 0x00 0x60 0x1b 0xff 0x3e 0x00 0x00 0xff 0x3e 0x00 0x00 0x00 0x00 0x00 0x22 0x00 0x00 0x00 0x00 0x00 0xff 0x00 0xff 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x01 0x42 0x00 0x00 0x10 0x00 0x00 0x00 0x00 0x02 0x00 0x00 0x00 0x00 0x00 0x00 0x80 0x00 0x00 0x00 0x18 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x20 0x24 0x04 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x80 0x10 0x00 0x80 0x00 0x10 0x00 0x01 0x00 0x00 0x10 0x00 0x00 0x20 0x20 0x00 0x00 0x00 0x00 0x20 0x01 0x00 0x02 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x41 0x00 0x10 0x21 0x20 0x00 0x20 0x81 0x20 0x01 0x01 0x00 0x22 0x00 0x40 0x05 0x00 0x00 0x01 0x1e 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0xcc 0x27 0x64 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x80 0x00 0x06 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 +--- 15 74955 bulk_in len 52 read 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x01 0x06 0x1b 0x10 0x7a 0x00 0x15 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x0f 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 */ SANE_Status status = SANE_STATUS_GOOD; SANE_Byte control; @@ -4666,7 +4666,7 @@ dark_calibration (struct Rts8891_Device *dev, int mode, int light) dev->regs[0xd8] = 0x52; dev->regs[0xe2] = 0x1f; - /*dev->regs[0xe5] = 0x28; 28=40 + /*dev->regs[0xe5] = 0x28; 28=40 dev->regs[0xe6] = 0x00; */ SET_DOUBLE (dev->regs, EXPOSURE_REG, 40); @@ -4747,7 +4747,7 @@ dark_calibration (struct Rts8891_Device *dev, int mode, int light) dev->regs[0xf0] = 0xa8; /* 0x70 */ } - /* we loop scanning a 637 (1911 bytes) pixels wide area in color mode + /* we loop scanning a 637 (1911 bytes) pixels wide area in color mode * until each black average reaches the desired value */ sanei_rts88xx_set_status (dev->devnum, dev->regs, mode, light); do @@ -4858,7 +4858,7 @@ dark_calibration (struct Rts8891_Device *dev, int mode, int light) } /* - * do gain calibration. We do scans until averaged values of the area match + * do gain calibration. We do scans until averaged values of the area match * the target code. We're doing a dichotomy again. */ static SANE_Status @@ -4973,7 +4973,7 @@ gain_calibration (struct Rts8891_Device *dev, int mode, int light) dev->regs[0xd7] = 0x10; dev->regs[0xd8] = 0x52; dev->regs[0xe2] = 0x1f; - /* dev->regs[0xe5] = 0x28; 0028 -> 40 + /* dev->regs[0xe5] = 0x28; 0028 -> 40 dev->regs[0xe6] = 0x00; */ SET_DOUBLE (dev->regs, EXPOSURE_REG, 40); dev->regs[0xe7] = 0x75; @@ -5218,7 +5218,7 @@ gain_calibration (struct Rts8891_Device *dev, int mode, int light) /** * Do fine offset calibration. Scans are done with gains from gain calibration - * at 75 dpi regardless of the dpi of the final scan. We loop scanning a 637 + * at 75 dpi regardless of the dpi of the final scan. We loop scanning a 637 * (1911 bytes) pixels wide area in color mode until each black average * reaches the desired value (OFFSET_TARGET). */ @@ -5450,7 +5450,7 @@ offset_calibration (struct Rts8891_Device *dev, int mode, int light) y offset=1 , yend=67, lines =66 */ #ifndef UNIT_TESTING -static +static #endif SANE_Status setup_shading_calibration (struct Rts8891_Device *dev, int mode, int *light, int *status1, SANE_Byte * regs) @@ -5532,7 +5532,7 @@ setup_shading_calibration (struct Rts8891_Device *dev, int mode, int *light, int /* regs[0xd3] = 0x02; 0x0e */ regs[0xd4] = 0x04; /* 0x10 */ regs[0xe2] = 0x02; /* 0x05 */ - /* regs[0xe5] = 0xbb; + /* regs[0xe5] = 0xbb; regs[0xe6] = 0x01; 1bb =443 */ exposure=443; } @@ -5739,7 +5739,7 @@ setup_shading_calibration (struct Rts8891_Device *dev, int mode, int *light, int regs[0x88] = 0x1b; regs[0x8d] = 0xde; - regs[0x8e] = 0x61; /* low nibble of 8e and 8d are proportional to + regs[0x8e] = 0x61; /* low nibble of 8e and 8d are proportional to the scanned width 1de => 5100 wide scan */ regs[0xc0] = 0xff; @@ -5826,7 +5826,7 @@ setup_shading_calibration (struct Rts8891_Device *dev, int mode, int *light, int regs[0x88] = 0x30; regs[0x8d] = 0xde; - regs[0x8e] = 0x61; /* low nibble of 8e and 8d are proportional to + regs[0x8e] = 0x61; /* low nibble of 8e and 8d are proportional to the scanned width 1de => 5100 wide scan */ regs[0xc0] = 0xff; regs[0xc1] = 0xff; @@ -5870,7 +5870,7 @@ setup_shading_calibration (struct Rts8891_Device *dev, int mode, int *light, int regs[0x87] = 0x00; regs[0x88] = 0x06; - regs[0x8d] = 0x00; + regs[0x8d] = 0x00; regs[0x8e] = 0x60; /* XXX STEF XXX */ regs[0xc0] = 0xf8; @@ -5895,7 +5895,7 @@ setup_shading_calibration (struct Rts8891_Device *dev, int mode, int *light, int regs[0xd3] = 0x0e; regs[0xd4] = 0x10; regs[0xd7] = 0x31; - + timing=0x0032; exposure=915; break; @@ -6109,8 +6109,8 @@ setup_shading_calibration (struct Rts8891_Device *dev, int mode, int *light, int } break; } - - /* apply computed settings */ + + /* apply computed settings */ SET_DOUBLE (regs, EXPOSURE_REG, exposure); SET_DOUBLE (regs, TIMING_REG, timing); SET_DOUBLE (regs, TIMING1_REG, timing+1); @@ -6167,8 +6167,8 @@ shading_calibration (struct Rts8891_Device *dev, SANE_Bool color, int mode, int "shading_calibration: failed to allocate memory for data\n"); return SANE_STATUS_NO_MEM; } - - /* set up registers */ + + /* set up registers */ status=setup_shading_calibration(dev, mode, &light, &status1, dev->regs); if (status != SANE_STATUS_GOOD) { @@ -6279,7 +6279,7 @@ fill_gamma (SANE_Byte * calibration, int *idx, SANE_Word * gamma) /* * build and send calibration data which contains gamma table and * shading correction coefficient - * + * */ static SANE_Status send_calibration_data (struct Rts8891_Session *session) @@ -6309,28 +6309,28 @@ send_calibration_data (struct Rts8891_Session *session) DBG (DBG_io, "send_calibration_data: size=%d\n", size); - /* + /* * FORMAT: - * 00 + * 00 * 512 bytes gamma table (256 16 bit entry) - * FF - * 00 + * FF + * 00 * 512 bytes gamma table (256 16 bit entry) - * FF - * 00 + * FF + * 00 * 512 bytes gamma table (256 16 bit entry) - * FF + * FF * 5400 max shading coefficients at 600 dpi repeated 3 times * overall size rounded at 32 bytes multiple * 675 CCD elements at 75 DPI. 16 bit per element. 1 or 3 channels. * there is a 0xFF marker at end of each coefficients row. - * a gamma table comes first + * a gamma table comes first * 75 DPI: 5600=1542+(675)*2*3+8 ->size rounded to 'upper 32' * 150 DPI: 9664=675*2*2*3=1542+(675*2)*2*3+22 * 17760 4 +18 * 33952 8 +10 * 65472+896=66368= 16 +26 - * + * * COEFFICIENT 16 bit value * first is 00, 0x40, 0x80 or 0xC0 => 10 significant bit * coeff*average=K => coeff=K/average @@ -6369,7 +6369,7 @@ send_calibration_data (struct Rts8891_Session *session) fill_gamma (calibration, &idx, gamma_b); /* compute calibration coefficients */ - /* real witdh != 675 --> 637 + /* real witdh != 675 --> 637 * shading data calibration starts at 1542. There are 3 rows of 16 bits values * first row is green calibration */ @@ -6404,7 +6404,7 @@ send_calibration_data (struct Rts8891_Session *session) green_code = atoi (getenv ("BLUE_CODE")); } - /* correction coefficient is target code divided by average scanned value + /* correction coefficient is target code divided by average scanned value * but it is put in a 16 bits number. Only 10 first bits are significants. */ /* first color component red data */ @@ -6511,7 +6511,7 @@ send_calibration_data (struct Rts8891_Session *session) } /* move at dev->model->min_ydpi dpi up to the scanning area. Which speeds - * up scanning + * up scanning */ static SANE_Status move_to_scan_area (struct Rts8891_Session *session) @@ -7130,7 +7130,7 @@ setup_scan_registers (struct Rts8891_Session *session, SANE_Byte *status1, SANE_ regs[0xef] = 0x00; regs[0xf0] = 0x00; regs[0x8d] = 0xf0; - regs[0x8e] = 0x60; /* low nibble of 8e and 8d are proportional to + regs[0x8e] = 0x60; /* low nibble of 8e and 8d are proportional to the scanned width 1de => 5100 wide scan */ regs[0xc0] = 0xff; @@ -7228,7 +7228,7 @@ setup_scan_registers (struct Rts8891_Session *session, SANE_Byte *status1, SANE_ regs[0x88] = 0x5a; regs[0x8d] = 0xde; - regs[0x8e] = 0x61; /* low nibble of 8e and 8d are proportional to + regs[0x8e] = 0x61; /* low nibble of 8e and 8d are proportional to the scanned width 1de => 5100 wide scan */ regs[0xc0] = 0xff; @@ -7275,7 +7275,7 @@ setup_scan_registers (struct Rts8891_Session *session, SANE_Byte *status1, SANE_ regs[0x3a] = 0x1b; regs[0x40] = 0x2c; /* 0x24 */ regs[0x50] = 0x00; /* 0x18 */ - + regs[0x64] = 0x01; /* 0x02 */ regs[0x65] = 0x20; /* 0x10 */ @@ -7421,7 +7421,7 @@ setup_scan_registers (struct Rts8891_Session *session, SANE_Byte *status1, SANE_ regs[0x88] = 0xae; regs[0x8d] = 0xbd; /* about twice the 600 dpi values */ - regs[0x8e] = 0x63; /* low nibble of 8e and 8d are proportional to + regs[0x8e] = 0x63; /* low nibble of 8e and 8d are proportional to the scanned width 3b5 => 10124 wide scan */ regs[0xc0] = 0xff; regs[0xc1] = 0xff; @@ -7716,7 +7716,7 @@ park_head (struct Rts8891_Device *dev, SANE_Bool wait) return status; } -/* update button status +/* update button status * button access is allowed during scan, which is usefull for 'cancel' button */ static SANE_Status diff --git a/backend/rts8891.h b/backend/rts8891.h index 5fbf8b58f..fa3feb682 100644 --- a/backend/rts8891.h +++ b/backend/rts8891.h @@ -1,44 +1,44 @@ /* sane - Scanner Access Now Easy. Copyright (C) 2007-2012 stef.dev@free.fr - + 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. + If you do not wish that, delete this exception notice. */ #ifndef RTS8891_H @@ -113,13 +113,13 @@ enum Rts8891_Option enum Rts8891_Configure_Option { CFG_MODEL_NUMBER = 0, /* first option number must be zero */ - CFG_SENSOR_NUMBER, + CFG_SENSOR_NUMBER, CFG_ALLOW_SHARING, NUM_CFG_OPTIONS /* MUST be last */ }; /** Scanner object. This struct holds informations usefull for - * the functions defined in SANE's standard. Informations closer + * the functions defined in SANE's standard. Informations closer * to the hardware are in the Rts8891_Device structure. There is * as many session structure than frontends using the scanner. */ diff --git a/backend/rts8891_devices.c b/backend/rts8891_devices.c index 151b28348..a46f98b9f 100644 --- a/backend/rts8891_devices.c +++ b/backend/rts8891_devices.c @@ -1,44 +1,44 @@ /* sane - Scanner Access Now Easy. Copyright (C) 2007-2012 stef.dev@free.fr - + 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. + If you do not wish that, delete this exception notice. */ diff --git a/backend/rts8891_low.c b/backend/rts8891_low.c index 917d51415..4fc56661b 100644 --- a/backend/rts8891_low.c +++ b/backend/rts8891_low.c @@ -1,44 +1,44 @@ /* sane - Scanner Access Now Easy. Copyright (C) 2007-2013 stef.dev@free.fr - + 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. + If you do not wish that, delete this exception notice. */ /* this file contains all the low level functions needed for the higher level @@ -849,21 +849,21 @@ read_data (struct Rts8891_Session *session, SANE_Byte * dest, SANE_Int length) /** * set scanner idle before leaving xxx_quiet() -write_reg(0x33,1)=0x00 -write_reg(0x33,1)=0x00 -write_reg(0x36,1)=0x00 +write_reg(0x33,1)=0x00 +write_reg(0x33,1)=0x00 +write_reg(0x36,1)=0x00 prepare(); ------ -write_reg(LAMP_REG,1)=0x80 -write_reg(LAMP_REG,1)=0xad -read_reg(0x14,2)=0xf8 0x28 -write_reg(0x14,2)=0x78 0x28 -get_status()=0x20 0x3f -read_reg(0xb1,1)=0x00 -read_control()=0x00 +write_reg(LAMP_REG,1)=0x80 +write_reg(LAMP_REG,1)=0xad +read_reg(0x14,2)=0xf8 0x28 +write_reg(0x14,2)=0x78 0x28 +get_status()=0x20 0x3f +read_reg(0xb1,1)=0x00 +read_control()=0x00 reset_lamp()=(0x20,0x3f) -write_reg(LAMP_REG,1)=0x8d -write_reg(LAMP_REG,1)=0xad +write_reg(LAMP_REG,1)=0x8d +write_reg(LAMP_REG,1)=0xad */ /* vim: set sw=2 cino=>2se-1sn-1s{s^-1st0(0u0 smarttab expandtab: */ diff --git a/backend/rts8891_low.h b/backend/rts8891_low.h index a6df8023a..6b123165a 100644 --- a/backend/rts8891_low.h +++ b/backend/rts8891_low.h @@ -1,44 +1,44 @@ /* sane - Scanner Access Now Easy. Copyright (C) 2007-2012 stef.dev@free.fr - + 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. + If you do not wish that, delete this exception notice. */ #ifndef RTS8891_LOW_H @@ -80,7 +80,7 @@ typedef struct Rts8891_Device Rts8891_Device; #define SET_DOUBLE(regs,idx,value) regs[idx]=(SANE_Byte)((value)>>8); regs[idx-1]=(SANE_Byte)((value) & 0xff); -/* +/* * defines for RTS8891 registers name */ #define BUTTONS_REG2 0x1a @@ -128,7 +128,7 @@ typedef struct Rts8891_Model SANE_Int ld_shift_r; /* red */ SANE_Int ld_shift_g; /* green */ SANE_Int ld_shift_b; /* blue */ - + /* default sensor type */ SANE_Int sensor; diff --git a/backend/rts88xx_lib.c b/backend/rts88xx_lib.c index 8e921f281..f19ceef9c 100644 --- a/backend/rts88xx_lib.c +++ b/backend/rts88xx_lib.c @@ -123,7 +123,7 @@ sanei_rts88xx_set_scan_frequency (SANE_Byte * regs, int frequency) } /* - * read one register at given index + * read one register at given index */ SANE_Status sanei_rts88xx_read_reg (SANE_Int devnum, SANE_Int index, SANE_Byte * reg) @@ -153,7 +153,7 @@ sanei_rts88xx_read_reg (SANE_Int devnum, SANE_Int index, SANE_Byte * reg) } /* - * write one register at given index + * write one register at given index */ SANE_Status sanei_rts88xx_write_reg (SANE_Int devnum, SANE_Int index, SANE_Byte * reg) @@ -200,7 +200,7 @@ sanei_rts88xx_write_regs (SANE_Int devnum, SANE_Int start, start, length, message); } - /* when writing several registers at a time, we avoid writing the 0xb3 register + /* when writing several registers at a time, we avoid writing the 0xb3 register * which is used to control the status of the scanner */ if ((start + length > 0xb3) && (length > 1)) { @@ -297,7 +297,7 @@ sanei_rts88xx_read_regs (SANE_Int devnum, SANE_Int start, } /* - * get status by reading registers 0x10 and 0x11 + * get status by reading registers 0x10 and 0x11 */ SANE_Status sanei_rts88xx_get_status (SANE_Int devnum, SANE_Byte * regs) @@ -310,7 +310,7 @@ sanei_rts88xx_get_status (SANE_Int devnum, SANE_Byte * regs) } /* - * set status by writing registers 0x10 and 0x11 + * set status by writing registers 0x10 and 0x11 */ SANE_Status sanei_rts88xx_set_status (SANE_Int devnum, SANE_Byte * regs, @@ -394,7 +394,7 @@ sanei_rts88xx_reset_lamp (SANE_Int devnum, SANE_Byte * regs) "sanei_rts88xx_reset_lamp: expected reg[0xda]=0xa7, got 0x%02x\n", reg); } - + /* store read value in shadow register */ regs[0xda] = reg; @@ -415,7 +415,7 @@ sanei_rts88xx_get_lcd (SANE_Int devnum, SANE_Byte * regs) } /* - * write to special control register CONTROL_REG=0xb3 + * write to special control register CONTROL_REG=0xb3 */ SANE_Status sanei_rts88xx_write_control (SANE_Int devnum, SANE_Byte value) diff --git a/backend/rts88xx_lib.h b/backend/rts88xx_lib.h index 71bd72a50..fa7abbd27 100644 --- a/backend/rts88xx_lib.h +++ b/backend/rts88xx_lib.h @@ -60,7 +60,7 @@ #define DBG_io2 7 /* io functions that are called very often */ #define DBG_data 8 /* log data sent and received */ -/* +/* * defines for registers name */ #define CONTROL_REG 0xb3 @@ -97,7 +97,7 @@ void sanei_rts88xx_set_scan_area (SANE_Byte * reg, SANE_Int ystart, SANE_Int xend); /* - * read one register at given index + * read one register at given index */ SANE_Status sanei_rts88xx_read_reg (SANE_Int devnum, SANE_Int index, SANE_Byte * reg); @@ -109,7 +109,7 @@ SANE_Status sanei_rts88xx_read_data (SANE_Int devnum, SANE_Word * length, unsigned char *dest); /* - * write one register at given index + * write one register at given index */ SANE_Status sanei_rts88xx_write_reg (SANE_Int devnum, SANE_Int index, SANE_Byte * reg); @@ -127,17 +127,17 @@ SANE_Status sanei_rts88xx_read_regs (SANE_Int devnum, SANE_Int start, SANE_Byte * dest, SANE_Int length); /* - * get status by reading registers 0x10 and 0x11 + * get status by reading registers 0x10 and 0x11 */ SANE_Status sanei_rts88xx_get_status (SANE_Int devnum, SANE_Byte * regs); /* - * set status by writing registers 0x10 and 0x11 + * set status by writing registers 0x10 and 0x11 */ SANE_Status sanei_rts88xx_set_status (SANE_Int devnum, SANE_Byte * regs, SANE_Byte reg10, SANE_Byte reg11); /* - * get lamp status by reading registers 0x84 to 0x8d + * get lamp status by reading registers 0x84 to 0x8d */ SANE_Status sanei_rts88xx_get_lamp_status (SANE_Int devnum, SANE_Byte * regs); @@ -148,7 +148,7 @@ SANE_Status sanei_rts88xx_reset_lamp (SANE_Int devnum, SANE_Byte * regs); SANE_Status sanei_rts88xx_get_lcd (SANE_Int devnum, SANE_Byte * regs); /* - * write to special control register CONTROL_REG=0xb3 + * write to special control register CONTROL_REG=0xb3 */ SANE_Status sanei_rts88xx_write_control (SANE_Int devnum, SANE_Byte value); diff --git a/backend/s9036.c b/backend/s9036.c index 1b97f80ea..4b0022a9f 100644 --- a/backend/s9036.c +++ b/backend/s9036.c @@ -51,7 +51,7 @@ static S9036_Device *s9036_devices; /* sets loc_s bytes long value at offset loc in scsi command to value size */ -static void +static void set_size (Byte * loc, int loc_s, size_t size) { int i; @@ -62,7 +62,7 @@ set_size (Byte * loc, int loc_s, size_t size) } } -static long +static long reserve_unit (int fd) { const Byte scsi_reserve[] = @@ -73,7 +73,7 @@ reserve_unit (int fd) return sanei_scsi_cmd (fd, scsi_reserve, sizeof (scsi_reserve), 0, 0); } -static long +static long release_unit (int fd) { const Byte scsi_release[] = @@ -871,7 +871,7 @@ sane_exit (void) sane_close (dev->handle); free (dev); } - + if (devlist) free (devlist); } @@ -881,7 +881,7 @@ sane_get_devices (const SANE_Device *** device_list, SANE_Bool local_only) { S9036_Device *dev; int i; - + local_only = local_only; /* silence compilation warnings */ if (devlist) @@ -1237,7 +1237,7 @@ sane_start (SANE_Handle handle) return SANE_STATUS_GOOD; } -static void +static void copy_buffer (S9036_Scanner * s, SANE_Byte ** buf, SANE_Int * max_len, SANE_Int * len) { @@ -1327,7 +1327,7 @@ SANE_Status sane_set_io_mode (SANE_Handle handle, SANE_Bool non_blocking) { handle = handle; /* silence compilation warnings */ - + DBG (1, "sane_set_io_mode(%d)\n", non_blocking); return (non_blocking == SANE_TRUE) ? diff --git a/backend/sceptre.c b/backend/sceptre.c index fa0da20ca..3670f3c94 100644 --- a/backend/sceptre.c +++ b/backend/sceptre.c @@ -2,47 +2,47 @@ Copyright (C) 2002 Frank Zago (sane at zago dot net) Copyright (C) 2002 Other SANE contributors - + 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. + If you do not wish that, delete this exception notice. */ -/* +/* $Id$ Sceptre S1200 SCSI scanner (sometimes also called S120) */ @@ -366,7 +366,7 @@ sceptre_get_status (Sceptre_Scanner * dev, size_t * data_left) return (SANE_STATUS_GOOD); } -/* +/* * Adjust the rasters. This function is used during a color scan, * because the scanner does not present a format sane can interpret * directly. @@ -374,9 +374,9 @@ sceptre_get_status (Sceptre_Scanner * dev, size_t * data_left) * The scanner sends the colors by rasters (R then G then B), whereas * sane is waiting for a group of 3 bytes per color. To make things * funnier, the rasters are shifted. This shift factor depends on the - * resolution used. The format of those raster is: + * resolution used. The format of those raster is: * R...R RG...RG RGB...RGB BG...GB B...B - * + * * So this function reorders all that mess. It gets the input from * dev->buffer and write the output in dev->image. size_in the the * length of the valid data in dev->buffer. @@ -401,7 +401,7 @@ sceptre_adjust_raster (Sceptre_Scanner * dev, size_t size_in) return; } - /* + /* * The color coding is one line for each color (in the RGB order). * Recombine that stuff to create a RGB value for each pixel. */ @@ -411,7 +411,7 @@ sceptre_adjust_raster (Sceptre_Scanner * dev, size_t size_in) for (raster = 0; raster < nb_rasters; raster++) { - /* + /* * Find the color to which this raster belongs to. * 0 = red * 1 = green @@ -516,7 +516,7 @@ sceptre_adjust_raster (Sceptre_Scanner * dev, size_t size_in) DBG (DBG_proc, "sceptre_adjust_raster: exit\n"); } -/* SCSI sense handler. Callback for SANE. +/* SCSI sense handler. Callback for SANE. * * Since this scanner does not have REQUEST SENSE, it is always an * error if this function is called.*/ @@ -596,14 +596,14 @@ attach_scanner (const char *devicename, Sceptre_Scanner ** devp) dev->resolution_range.max = SANE_FIX (1200); dev->resolution_range.quant = SANE_FIX (1); - /* + /* * The S1200 has an area of 8.5 inches / 11.7 inches. (A4 like) * That's roughly 215*297 mm * The values are coded by * size in inch * 600 dpi. * The maximums are: * X: 8.5 inches * 600 = 5100 dots - * Y: 11.7 inches * 600 = 7020 + * Y: 11.7 inches * 600 = 7020 * (although the windows driver stops at 7019) * * The values are stored in mm. Inches sucks anyway. @@ -840,7 +840,7 @@ sceptre_init_options (Sceptre_Scanner * dev) /* Wait until the scanner is ready. * * The only reason I know the scanner is not ready is because it is - * moving the CCD. + * moving the CCD. */ static SANE_Status sceptre_wait_scanner (Sceptre_Scanner * dev) @@ -873,7 +873,7 @@ sceptre_wait_scanner (Sceptre_Scanner * dev) return (SANE_STATUS_IO_ERROR); } - /* Apparently the scanner returns only 2 values: + /* Apparently the scanner returns only 2 values: * 0x00 - ready * 0xff - not ready */ @@ -1067,7 +1067,7 @@ sceptre_fill_image (Sceptre_Scanner * dev) /* Copy the complete lines, plus the imcompletes * ones. We don't keep the real end of data used - * in image, so we copy the biggest possible. + * in image, so we copy the biggest possible. * * This is a no-op for non color images. */ @@ -1083,7 +1083,7 @@ sceptre_fill_image (Sceptre_Scanner * dev) return (status); } - /* + /* * Try to read the maximum number of bytes. */ size = data_left; @@ -1105,7 +1105,7 @@ sceptre_fill_image (Sceptre_Scanner * dev) if (size == 0) { - /* Probably reached the end of the buffer. + /* Probably reached the end of the buffer. * Check, just in case. */ assert (dev->image_end != 0); return (SANE_STATUS_GOOD); @@ -1163,7 +1163,7 @@ sceptre_fill_image (Sceptre_Scanner * dev) return (SANE_STATUS_GOOD); /* unreachable */ } -/* Copy from the raw buffer to the buffer given by the backend. +/* Copy from the raw buffer to the buffer given by the backend. * * len in input is the maximum length available in buf, and, in * output, is the length written into buf. @@ -1693,11 +1693,11 @@ sane_get_parameters (SANE_Handle handle, SANE_Parameters * params) dev->width = dev->x_br - dev->x_tl; dev->length = dev->y_br - dev->y_tl; - /* + /* * Adjust the "X Resolution". The sceptre S1200 ignores the * Y-Resolution parameter in the windows block. X-Resolution * is used instead. However the limits are not the same for X - * (600 dpi) and Y (1200 dpi). + * (600 dpi) and Y (1200 dpi). */ x_dpi = dev->resolution; if (x_dpi > 600) @@ -1779,7 +1779,7 @@ sane_get_parameters (SANE_Handle handle, SANE_Parameters * params) * 2n + [0.0 .. 2.0[ -> round to 2n * * Note: the rounding is often incorrect at high - * resolution (ag more than 300dpi) + * resolution (ag more than 300dpi) */ dev->params.lines = (dev->length * dev->resolution) / 600; dev->params.lines &= ~1; diff --git a/backend/sceptre.h b/backend/sceptre.h index 726c1317f..8ba5cd862 100644 --- a/backend/sceptre.h +++ b/backend/sceptre.h @@ -37,10 +37,10 @@ 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. + If you do not wish that, delete this exception notice. */ -/* +/* $Id$ */ @@ -269,8 +269,8 @@ enum Sceptre_Option /*--------------------------------------------------------------------------*/ -/* - * Scanner supported by this backend. +/* + * Scanner supported by this backend. */ struct scanners_supported { @@ -382,7 +382,7 @@ Sceptre_Scanner; /*--------------------------------------------------------------------------*/ -/* Debug levels. +/* Debug levels. * Should be common to all backends. */ #define DBG_error0 0 diff --git a/backend/sharp.c b/backend/sharp.c index 69f5000f8..b2807d74f 100644 --- a/backend/sharp.c +++ b/backend/sharp.c @@ -2,7 +2,7 @@ Copyright (C) 1998, 1999 Kazuya Fukuda, Abel Deuring based on BYTEC GmbH Germany - Written by Helmut Koeberle previous Work on canon.c file from the + Written by Helmut Koeberle previous Work on canon.c file from the SANE package. This file is part of the SANE package. @@ -50,18 +50,18 @@ changes to version 0.31: - support for JX320 added (Thanks to Isaac Wilcox for providind the patch) - + Version 0.31 changes to version 0.30: - support for JX350 added (Thanks to Shuhei Tomita for providind the patch) - + changes to version 0.20 - support for the proposed extended open function in sanei_scsi.c added - support for ADF and FSU (transparency adapter) added - simple sense handler added - preview added - - added several missing statements "s->fd = -1;" after + - added several missing statements "s->fd = -1;" after "sanei_scsi_close(s->fd)" to error returns in sane_start(); - maximum scan sizes are read from the scanner, if a JX330 or JX250 is used. (this avoids the guessing of scan sizes for the JX330) @@ -69,7 +69,7 @@ - "Fixed gamma selection (1.0/2.2)", available for JX330 and JX610, is now implemented for the JX250 by downloading a gamma table - changed the calls to free() and strdup() in sane_control_option to - strcpy. + strcpy. (I don't like too frequent unchecked malloc()s and strdups :) Abel) - cleaned up some quirks in option handling, eg, that "threshold" was initially enabled, while the initial scan mode is "color" @@ -133,12 +133,12 @@ */ #define USE_CUSTOM_GAMMA #define USE_COLOR_THRESHOLD -/* enable a short list of some standard resolutions. XSane provides +/* enable a short list of some standard resolutions. XSane provides its own resolution list; therefore its is generally not reasonable to enable this list, if you mainly using XSane. But it might be handy if you are working with xscanimage */ -/* #define USE_RESOLUTION_LIST */ +/* #define USE_RESOLUTION_LIST */ /* enable separate specification of resolution in X and Y direction. XSane will show the Y-resolution at a quite different place than @@ -220,15 +220,15 @@ static SANE_String use_adf = "Automatic Document Feeder"; static SANE_String use_fsu = "Transparency Adapter"; static SANE_String use_simple = "Flatbed"; -/* auto selection of ADF and FSU, as described in the JX330 manual, - is a nice idea -- but I assume that the possible scan window - sizes depend not only for the JX250, but also for JX330 on the +/* auto selection of ADF and FSU, as described in the JX330 manual, + is a nice idea -- but I assume that the possible scan window + sizes depend not only for the JX250, but also for JX330 on the usage of ADF or FSU. Thus, the user might be able to select scan windows of an "illegal" size, which would have to be automatically - corrected, and I don't see, how the user could be informed about - this "window clipping". More important, I don't see, how the + corrected, and I don't see, how the user could be informed about + this "window clipping". More important, I don't see, how the frontend could be informed that the ADF is automatically enabled. - + Insert a "#define ALLOW_AUTO_SELECT_ADF", if you want to play with this feature. */ @@ -239,8 +239,8 @@ static SANE_String_Const use_auto = "AutoSelection"; #define HAVE_FSU 1 #define HAVE_ADF 2 -/* The follow #defines are used in SHARP_Scanner.adf_fsu_mode - and as indexes for the arrays x_ranges, y_ranges in SHARP_Device +/* The follow #defines are used in SHARP_Scanner.adf_fsu_mode + and as indexes for the arrays x_ranges, y_ranges in SHARP_Device */ #define SCAN_SIMPLE 0 #define SCAN_WITH_FSU 1 @@ -326,17 +326,17 @@ sense_handler(int __sane_unused__ fd, u_char *sense_buffer, void *s) { int sense_key; SHARP_Sense_Data *sdat = (SHARP_Sense_Data *) s; - + #define add_sense_code sense_buffer[12] #define add_sense_qual sense_buffer[13] memcpy(sdat->sb, sense_buffer, 16); - + DBG(10, "sense code: %02x %02x %02x %02x %02x %02x %02x %02x " "%02x %02x %02x %02x %02x %02x %02x %02x\n", - sense_buffer[0], sense_buffer[1], sense_buffer[2], sense_buffer[3], - sense_buffer[4], sense_buffer[5], sense_buffer[6], sense_buffer[7], - sense_buffer[8], sense_buffer[9], sense_buffer[10], sense_buffer[11], + sense_buffer[0], sense_buffer[1], sense_buffer[2], sense_buffer[3], + sense_buffer[4], sense_buffer[5], sense_buffer[6], sense_buffer[7], + sense_buffer[8], sense_buffer[9], sense_buffer[10], sense_buffer[11], sense_buffer[12], sense_buffer[13], sense_buffer[14], sense_buffer[15]); sense_key = sense_buffer[2] & 0x0F; @@ -394,7 +394,7 @@ sense_handler(int __sane_unused__ fd, u_char *sense_buffer, void *s) DBG(1, "scan head positioning error\n"); return SANE_STATUS_IO_ERROR; } - + } else if (sdat->model == JX250 || sdat->model == JX330 || sdat->model == JX350 || sdat->model == JX320) @@ -561,7 +561,7 @@ inquiry (int fd, void *inq_buf, size_t *inq_size) static SANE_Status mode_select_mud (int fd, int mud) { - static u_char cmd[6 + MODEPARAM_LEN] = + static u_char cmd[6 + MODEPARAM_LEN] = {MODE_SELECT6, 0x10, 0, 0, MODEPARAM_LEN, 0}; mode_select_param *mp; SANE_Status status; @@ -583,7 +583,7 @@ mode_select_mud (int fd, int mud) static SANE_Status mode_select_adf_fsu (int fd, int mode) { - static u_char cmd[6 + MODE_SUBDEV_LEN] = + static u_char cmd[6 + MODE_SUBDEV_LEN] = {MODE_SELECT6, 0x10, 0, 0, MODE_SUBDEV_LEN, 0}; mode_select_subdevice *mp; SANE_Status status; @@ -670,7 +670,7 @@ release_unit (int fd) #endif static SANE_Status -mode_sense (int fd, void *modeparam_buf, size_t * modeparam_size, +mode_sense (int fd, void *modeparam_buf, size_t * modeparam_size, int page) { static u_char cmd[6]; @@ -681,7 +681,7 @@ mode_sense (int fd, void *modeparam_buf, size_t * modeparam_size, cmd[0] = 0x1a; cmd[2] = page; cmd[4] = *modeparam_size; - status = sanei_scsi_cmd (fd, cmd, sizeof (cmd), modeparam_buf, + status = sanei_scsi_cmd (fd, cmd, sizeof (cmd), modeparam_buf, modeparam_size); DBG (11, ">>\n"); @@ -740,7 +740,7 @@ send (int fd, SHARP_Send * ss) static SANE_Status set_window (int fd, window_param *wp, int len) { - static u_char cmd[10 + WINDOW_LEN] = + static u_char cmd[10 + WINDOW_LEN] = {SET_WINDOW, 0, 0, 0, 0, 0, 0, 0, 0, 0}; window_param *winp; SANE_Status status; @@ -775,17 +775,17 @@ get_window (int fd, void *buf, size_t * buf_size) #ifdef USE_FORK /* the following four functions serve simply the purpose - to avoid "over-optimised" code when reader_process and - read_data wait for the buffer to become ready. The simple - while-loops in these functions which check the buffer - status may be optimised so that the machine code only - operates with registers instead of using the variable - values stored in memory. (This is only a workaround - + to avoid "over-optimised" code when reader_process and + read_data wait for the buffer to become ready. The simple + while-loops in these functions which check the buffer + status may be optimised so that the machine code only + operates with registers instead of using the variable + values stored in memory. (This is only a workaround - it would be better to set a compiler pragma, which ensures that the program looks into the RAM in these while loops -- but unfortunately I could not find appropriate information - about this at least for gcc, not to speak about other - compilers... + about this at least for gcc, not to speak about other + compilers... Abel) */ @@ -795,7 +795,7 @@ cancel_requested(SHARP_Scanner *s) return s->rdr_ctl->cancel; } -static SANE_Status +static SANE_Status rdr_status(SHARP_Scanner *s) { return s->rdr_ctl->status; @@ -832,9 +832,9 @@ reader_process(SHARP_Scanner *s) DBG(11, "<< reader_process\n"); sigemptyset (&sigterm_set); - + bytes_to_queue = s->bytes_to_read; - + /* it seems that some carriage stops can be avoided with the JX-250, if the data of an integral number of scan lines is read with one SCSI command @@ -845,9 +845,9 @@ reader_process(SHARP_Scanner *s) else /* this is a really tiny buffer..*/ max_bytes_per_read = s->dev->info.bufsize; - + /* wait_ready(s->fd); */ - + if (s->dev->info.queued_reads <= s->dev->info.buffers) max_queue = s->dev->info.queued_reads; else @@ -869,16 +869,16 @@ reader_process(SHARP_Scanner *s) #ifdef QUEUEDEBUG DBG(2, "reader: req_enter...\n"); #endif - status = sanei_scsi_req_enter (s->fd, cmd, sizeof (cmd), - bc->buffer, - &bc->used, + status = sanei_scsi_req_enter (s->fd, cmd, sizeof (cmd), + bc->buffer, + &bc->used, &bc->qid); #ifdef QUEUEDEBUG DBG(2, "reader: req_enter ok\n"); #endif if (status != SANE_STATUS_GOOD) { - DBG(1, "reader_process: read command failed: %s", + DBG(1, "reader_process: read command failed: %s", sane_strstatus(status)); #ifdef HAVE_SANEI_SCSI_OPEN_EXTENDED sanei_scsi_req_flush_all_extended(s->fd); @@ -902,9 +902,9 @@ reader_process(SHARP_Scanner *s) waitindex = 0; cmdindex = i % s->dev->info.buffers; - while(s->bytes_to_read > 0) + while(s->bytes_to_read > 0) { - if (cancel_requested(s)) + if (cancel_requested(s)) { #ifdef QUEUEDEBUG DBG(2, "reader: flushing requests...\n"); @@ -925,7 +925,7 @@ reader_process(SHARP_Scanner *s) } bc = &s->rdr_ctl->buf_ctl[waitindex]; - if (bc->shm_status == SHM_BUSY) + if (bc->shm_status == SHM_BUSY) { #ifdef DEBUG { @@ -948,7 +948,7 @@ reader_process(SHARP_Scanner *s) DBG(2, "rd: data received %li.%06li\n", t.tv_sec, t.tv_usec); } #endif - if (status == SANE_STATUS_DEVICE_BUSY && retries) + if (status == SANE_STATUS_DEVICE_BUSY && retries) { bc->used = 0; retries--; @@ -958,7 +958,7 @@ reader_process(SHARP_Scanner *s) } else if (status != SANE_STATUS_GOOD) { - DBG(1, "reader_process: read command failed: %s\n", + DBG(1, "reader_process: read command failed: %s\n", sane_strstatus(status)); #ifdef HAVE_SANEI_SCSI_OPEN_EXTENDED sanei_scsi_req_flush_all_extended(s->fd); @@ -969,7 +969,7 @@ reader_process(SHARP_Scanner *s) s->rdr_ctl->running = 0; return 2; } - else + else { retries = MAX_RETRIES; } @@ -982,7 +982,7 @@ reader_process(SHARP_Scanner *s) /* memset(bc->buffer + bc->used, 0, bc->nreq - bc->used); */ bc->used = bc->nreq; /* bytes_to_queue += bc->nreq - bc->used; */ - DBG(1, "btr: %i btq: %i nreq: %i nrcv: %i\n", + DBG(1, "btr: %i btq: %i nreq: %i nrcv: %i\n", s->bytes_to_read, bytes_to_queue, bc->nreq, bc->used); #endif bc->start = 0; @@ -993,7 +993,7 @@ reader_process(SHARP_Scanner *s) waitindex = 0; } - + if (bytes_to_queue) { /* wait until the next buffer is completely read via read_data */ @@ -1028,11 +1028,11 @@ reader_process(SHARP_Scanner *s) cmd[6] = nread >> 16; cmd[7] = nread >> 8; cmd[8] = nread; - status = sanei_scsi_req_enter (s->fd, cmd, sizeof (cmd), + status = sanei_scsi_req_enter (s->fd, cmd, sizeof (cmd), bc->buffer, &bc->used, &bc->qid); if (status != SANE_STATUS_GOOD) { - DBG(1, "reader_process: read command failed: %s", + DBG(1, "reader_process: read command failed: %s", sane_strstatus(status)); #ifdef HAVE_SANEI_SCSI_OPEN_EXTENDED sanei_scsi_req_flush_all_extended(s->fd); @@ -1046,13 +1046,13 @@ reader_process(SHARP_Scanner *s) bc->shm_status = SHM_BUSY; bc->nreq = nread; bytes_to_queue -= nread; - + cmdindex++; if (cmdindex == s->dev->info.buffers) cmdindex = 0; } - - if (cancel_requested(s)) + + if (cancel_requested(s)) { #ifdef HAVE_SANEI_SCSI_OPEN_EXTENDED sanei_scsi_req_flush_all_extended(s->fd); @@ -1066,7 +1066,7 @@ reader_process(SHARP_Scanner *s) return 1; } } - + DBG(1, "buffer full conditions: %i\n", full_count); DBG(11, " reader_process>>\n"); @@ -1079,7 +1079,7 @@ read_data (SHARP_Scanner *s, SANE_Byte *buf, size_t * buf_size) { size_t copysize, copied = 0; SHARP_shmem_ctl *bc; - + DBG(11, "<< read_data "); bc = &s->rdr_ctl->buf_ctl[s->read_buff]; @@ -1088,7 +1088,7 @@ read_data (SHARP_Scanner *s, SANE_Byte *buf, size_t * buf_size) { /* wait until the reader process delivers data or a scanner error occurs: */ while ( buf_status(bc) != SHM_FULL - && rdr_status(s) == SANE_STATUS_GOOD) + && rdr_status(s) == SANE_STATUS_GOOD) { usleep(10); /* could perhaps be longer. make this user configurable?? */ } @@ -1100,10 +1100,10 @@ read_data (SHARP_Scanner *s, SANE_Byte *buf, size_t * buf_size) } copysize = bc->used - bc->start; - + if (copysize > *buf_size - copied ) copysize = *buf_size - copied; - + memcpy(buf, &(bc->buffer[bc->start]), copysize); copied += copysize; @@ -1139,8 +1139,8 @@ read_data (SHARP_Scanner *s, SANE_Byte *buf, size_t * buf_size) /* sane_read_shuffled requires that read_data returns exactly *buf_size bytes, so it must be guaranteed here. - Further make sure that not more bytes are read in than - sanei_scsi_max_request_size allows, to avoid a failure + Further make sure that not more bytes are read in than + sanei_scsi_max_request_size allows, to avoid a failure of the read command */ while (remain > 0) @@ -1151,7 +1151,7 @@ read_data (SHARP_Scanner *s, SANE_Byte *buf, size_t * buf_size) cmd[6] = nread >> 16; cmd[7] = nread >> 8; cmd[8] = nread; - status = sanei_scsi_cmd (s->fd, cmd, sizeof (cmd), + status = sanei_scsi_cmd (s->fd, cmd, sizeof (cmd), &buf[*buf_size - remain], &nread); if (status == SANE_STATUS_DEVICE_BUSY && retries) { @@ -1164,7 +1164,7 @@ read_data (SHARP_Scanner *s, SANE_Byte *buf, size_t * buf_size) DBG(11, ">>\n"); return(status); } - else + else { retries = MAX_RETRIES; } @@ -1208,7 +1208,7 @@ wait_ready(int fd) sleep(3); } return (status); - + } /* ask the scanner for the maximum scan sizes with/without ADF and @@ -1220,7 +1220,7 @@ get_max_scan_size(int fd, SHARP_Device *dev, int mode) SANE_Status status; mode_sense_subdevice m_subdev; size_t buf_size; - + status = mode_select_adf_fsu(fd, mode); if (status != SANE_STATUS_GOOD) { @@ -1245,7 +1245,7 @@ get_max_scan_size(int fd, SHARP_Device *dev, int mode) (m_subdev.max_x[0] << 24) + (m_subdev.max_x[1] << 16) + (m_subdev.max_x[2] << 8) + m_subdev.max_x[3] - 1, dev->info.mud)); dev->info.tl_x_ranges[mode].quant = 0; - + dev->info.br_x_ranges[mode].min = SANE_FIX(PIX_TO_MM(1, dev->info.mud)); dev->info.br_x_ranges[mode].max = SANE_FIX(PIX_TO_MM( (m_subdev.max_x[0] << 24) + (m_subdev.max_x[1] << 16) + @@ -1261,19 +1261,19 @@ get_max_scan_size(int fd, SHARP_Device *dev, int mode) else /* The manual for the JX250 states on page 62 that the maximum value for tl_y in FSU mode is 13199, while the max value for - br_y is 13900, which is (probably -- I don't have a FSU) returned - by mode sense/subdevice page. Therefore, we cannot simply + br_y is 13900, which is (probably -- I don't have a FSU) returned + by mode sense/subdevice page. Therefore, we cannot simply decrement that value and store it as max(tl_y). */ dev->info.tl_y_ranges[mode].max = 13199; dev->info.tl_y_ranges[mode].quant = 0; - + dev->info.br_y_ranges[mode].min = SANE_FIX(PIX_TO_MM(1, dev->info.mud)); dev->info.br_y_ranges[mode].max = SANE_FIX(PIX_TO_MM( (m_subdev.max_y[0] << 24) + (m_subdev.max_y[1] << 16) + (m_subdev.max_y[2] << 8) + m_subdev.max_y[3], dev->info.mud)); dev->info.br_y_ranges[mode].quant = 0; - + return SANE_STATUS_GOOD; } @@ -1374,7 +1374,7 @@ attach (const char *devnam, SHARP_Device ** devp) } DBG (3, "attach: sending MODE SELECT\n"); - /* JX-610 probably supports only 25 MUD size + /* JX-610 probably supports only 25 MUD size JX-320 only supports 25 MUD size */ if (strncmp (inquiry_data + 16, "JX610", 5) == 0) @@ -1412,7 +1412,7 @@ attach (const char *devnam, SHARP_Device ** devp) model_name = (char*) inquiry_data + 16; dev->sane.model = strndup (model_name, 10); dev->sane.type = "flatbed scanner"; - + dev->sensedat.model = sensedat.model; DBG (5, "dev->sane.name = %s\n", dev->sane.name); @@ -1441,7 +1441,7 @@ attach (const char *devnam, SHARP_Device ** devp) dev->info.bmu = msp.bmu; dev->info.mud = (msp.mud[0] << 8) + msp.mud[1]; - + dev->info.adf_fsu_installed = 0; if (dev->sensedat.model == JX610) { @@ -1475,7 +1475,7 @@ attach (const char *devnam, SHARP_Device ** devp) } else { - /* ask the scanner, if ADF or FSU are installed, and ask for + /* ask the scanner, if ADF or FSU are installed, and ask for the maximum scan sizes with/without ADF and FSU. */ @@ -1489,23 +1489,23 @@ attach (const char *devnam, SHARP_Device ** devp) sanei_scsi_close (fd); return (SANE_STATUS_INVAL); } - + /* The JX330 manual is not very clear about the ADF- und FSU-Bits - returned by a JX320 and JX325 for the mode sense command: + returned by a JX320 and JX325 for the mode sense command: Are these bits set to zero or not? To be on the safe side, let's clear them. */ - + if ( strncmp(inquiry_data + 16, "JX320", 5) == 0 || strncmp(inquiry_data + 16, "JX325", 5) == 0) { m_subdev.f_mode_type = 0; m_subdev.a_mode_type = 0; } - + get_max_scan_size(fd, dev, SCAN_SIMPLE); - - if (m_subdev.a_mode_type & 0x03) + + if (m_subdev.a_mode_type & 0x03) { dev->info.adf_fsu_installed = HAVE_ADF; get_max_scan_size(fd, dev, SCAN_WITH_ADF); @@ -1516,7 +1516,7 @@ attach (const char *devnam, SHARP_Device ** devp) get_max_scan_size(fd, dev, SCAN_WITH_FSU); } - if ( dev->sensedat.model == JX320 + if ( dev->sensedat.model == JX320 || dev->sensedat.model == JX330 || dev->sensedat.model == JX350) { @@ -1540,7 +1540,7 @@ attach (const char *devnam, SHARP_Device ** devp) } } sanei_scsi_close (fd); - + dev->info.threshold_range.min = 1; dev->info.threshold_range.max = 255; dev->info.threshold_range.quant = 0; @@ -1616,12 +1616,12 @@ attach (const char *devnam, SHARP_Device ** devp) } /* Enabling / disabling of gamma options. - Depends on many user settable options, so lets put it into + Depends on many user settable options, so lets put it into one function to be called by init_options and by sane_control_option */ #ifdef USE_CUSTOM_GAMMA -static void +static void set_gamma_caps(SHARP_Scanner *s) { /* neither fixed nor custom gamma for line art modes */ @@ -1761,11 +1761,11 @@ clip_value (const SANE_Option_Descriptor * opt, void * value) /* make sure that enough memory is allocated for each string, so that the strcpy in sane_control_option / set value cannot - write behind the end of the allocated memory. + write behind the end of the allocated memory. */ static SANE_Status -init_string_option(SHARP_Scanner *s, SANE_String_Const name, - SANE_String_Const title, SANE_String_Const desc, +init_string_option(SHARP_Scanner *s, SANE_String_Const name, + SANE_String_Const title, SANE_String_Const desc, const SANE_String_Const *string_list, int option, int default_index) { int i; @@ -1869,7 +1869,7 @@ init_options (SHARP_Scanner * s) sourcename_index = i; s->dev->info.scansources[i++] = use_adf; } - else + else { if (default_source == SCAN_WITH_ADF) default_source = SCAN_SIMPLE; @@ -1893,7 +1893,7 @@ init_options (SHARP_Scanner * s) sourcename_index = i; s->dev->info.scansources[i++] = use_simple; s->dev->info.scansources[i] = 0; - + #if 0 s->opt[OPT_SCANSOURCE].name = SANE_NAME_SCAN_SOURCE; s->opt[OPT_SCANSOURCE].title = SANE_TITLE_SCAN_SOURCE; @@ -1927,7 +1927,7 @@ init_options (SHARP_Scanner * s) s->opt[OPT_PAPER].constraint.string_list = paper_list_jx610; s->val[OPT_PAPER].s = strdup (paper_list_jx610[1]); } - else + else { s->opt[OPT_PAPER].size = max_string_size (paper_list_jx330); s->opt[OPT_PAPER].constraint_type = SANE_CONSTRAINT_STRING_LIST; @@ -1975,10 +1975,10 @@ init_options (SHARP_Scanner * s) #ifdef USE_RESOLUTION_LIST if (s->dev->sensedat.model == JX610 || s->dev->sensedat.model == JX330 || s->dev->sensedat.model == JX350 || s->dev->sensedat.model == JX320) - init_string_option(s, "ResolutionList", "ResolutionList", "ResolutionList", + init_string_option(s, "ResolutionList", "ResolutionList", "ResolutionList", resolution_list_jx610, OPT_RESOLUTION_LIST, RESOLUTION_MAX_JX610); else - init_string_option(s, "ResolutionList", "ResolutionList", "ResolutionList", + init_string_option(s, "ResolutionList", "ResolutionList", "ResolutionList", resolution_list_jx250, OPT_RESOLUTION_LIST, RESOLUTION_MAX_JX250); #endif /* x resolution */ @@ -2050,7 +2050,7 @@ init_options (SHARP_Scanner * s) s->opt[OPT_BR_Y].unit = SANE_UNIT_MM; s->opt[OPT_BR_Y].constraint_type = SANE_CONSTRAINT_RANGE; s->opt[OPT_BR_Y].constraint.range = &s->dev->info.br_y_ranges[default_source]; - /* The FSU for JX250 allows a maximum scan length of 11.5 inch, + /* The FSU for JX250 allows a maximum scan length of 11.5 inch, which is less than the default value of 297 mm */ scalar = s->dev->info.y_default; @@ -2097,7 +2097,7 @@ init_options (SHARP_Scanner * s) #ifdef USE_COLOR_THRESHOLD s->opt[OPT_THRESHOLD_R].name = SANE_NAME_THRESHOLD "-red"; /* xxx the titles and decriptions are confusing: - "set white point (red)" + "set white point (red)" Any idea? maybe "threshold to get the red component on" */ s->opt[OPT_THRESHOLD_R].title = SANE_TITLE_THRESHOLD " (red)"; @@ -2153,7 +2153,7 @@ init_options (SHARP_Scanner * s) s->opt[OPT_PREVIEW].type = SANE_TYPE_BOOL; s->opt[OPT_PREVIEW].cap = SANE_CAP_SOFT_DETECT | SANE_CAP_SOFT_SELECT; s->val[OPT_PREVIEW].w = SANE_FALSE; - + #ifdef USE_CUSTOM_GAMMA /* custom-gamma table */ @@ -2241,14 +2241,14 @@ do_cancel (SHARP_Scanner * s) DBG(11, "stopping reader process\n"); s->rdr_ctl->cancel = 1; - while(reader_running(s) && count < 100) + while(reader_running(s) && count < 100) { usleep(100000); count++; }; if (reader_running(s)) { - /* be brutal... + /* be brutal... !! The waiting time of 10 seconds might be far too short !! if the resolution limit of the JX 250 is increased to !! to more than 400 dpi: for these (interpolated) resolutions, @@ -2299,13 +2299,13 @@ do_cancel (SHARP_Scanner * s) static SHARP_New_Device *new_devs = 0; static SHARP_New_Device *new_dev_pool = 0; -static SANE_Status +static SANE_Status attach_and_list(const char *devnam) { SANE_Status res; SHARP_Device *devp; SHARP_New_Device *np; - + res = attach(devnam, &devp); if (res == SANE_STATUS_GOOD) { @@ -2332,10 +2332,10 @@ static int bufsize[2] = {DEFAULT_BUFSIZE, DEFAULT_BUFSIZE}; static int queued_reads[2] = {DEFAULT_QUEUED_READS, DEFAULT_QUEUED_READS}; static int stop_on_fsu_error[2] = {COMPLAIN_ON_FSU_ERROR | COMPLAIN_ON_ADF_ERROR, COMPLAIN_ON_FSU_ERROR | COMPLAIN_ON_ADF_ERROR}; -static int default_scan_mode[2] = {-1, -1}; +static int default_scan_mode[2] = {-1, -1}; SANE_Status -sane_init (SANE_Int * version_code, +sane_init (SANE_Int * version_code, SANE_Auth_Callback __sane_unused__ authorize) { char devnam[PATH_MAX] = "/dev/scanner"; @@ -2347,7 +2347,7 @@ sane_init (SANE_Int * version_code, int opt_index = 0; int linecount = 0; #if 1 - SHARP_Device sd; + SHARP_Device sd; SHARP_Device *dp = &sd; #else SHARP_Device *dp; @@ -2443,7 +2443,7 @@ sane_init (SANE_Int * version_code, linecount); DBG(1, "%s\n", line); } - else + else queued_reads[opt_index] = i; } else if (strcmp(word, "stop_on_fsu_error") == 0) @@ -2458,8 +2458,8 @@ sane_init (SANE_Int * version_code, linecount); DBG(1, "%s\n", line); } - else - stop_on_fsu_error[opt_index] + else + stop_on_fsu_error[opt_index] = i ? COMPLAIN_ON_FSU_ERROR : 0; } else if (strcmp(word, "default_scan_source") == 0) @@ -2493,7 +2493,7 @@ sane_init (SANE_Int * version_code, { while (new_devs) { - if (buffers[1] >= 2) + if (buffers[1] >= 2) new_devs->dev->info.buffers = buffers[1]; else new_devs->dev->info.buffers = 2; @@ -2529,7 +2529,7 @@ sane_init (SANE_Int * version_code, while (new_devs) { - if (buffers[1] >= 2) + if (buffers[1] >= 2) new_devs->dev->info.buffers = buffers[1]; else new_devs->dev->info.buffers = 2; @@ -2574,7 +2574,7 @@ sane_exit (void) free ((void *) dev->sane.model); free (dev); } - + if (devlist) free(devlist); devlist = 0; @@ -2653,8 +2653,8 @@ sane_open (SANE_String_Const devnam, SANE_Handle * handle) s->fd = -1; s->dev = dev; - - s->buffer = 0; + + s->buffer = 0; #ifdef USE_CUSTOM_GAMMA for (i = 0; i < 4; ++i) for (j = 0; j < 256; ++j) @@ -2827,7 +2827,7 @@ sane_control_option (SANE_Handle handle, SANE_Int option, *info |= SANE_INFO_RELOAD_PARAMS; case OPT_NUM_OPTS: case OPT_THRESHOLD: - /* xxx theoretically, we could use OPT_THRESHOLD in + /* xxx theoretically, we could use OPT_THRESHOLD in bi-level color mode to adjust all three other threshold together. But this would require to set the bit SANE_INFO_RELOAD_OPTIONS in *info, and that @@ -2879,8 +2879,8 @@ sane_control_option (SANE_Handle handle, SANE_Int option, #endif s->opt[OPT_HALFTONE].cap |= SANE_CAP_INACTIVE; } - - if ( strcmp (val, M_LINEART) == 0 + + if ( strcmp (val, M_LINEART) == 0 || strcmp (val, M_GRAY) == 0) { s->opt[OPT_LIGHTCOLOR].cap &= ~SANE_CAP_INACTIVE; @@ -2889,7 +2889,7 @@ sane_control_option (SANE_Handle handle, SANE_Int option, { s->opt[OPT_LIGHTCOLOR].cap |= SANE_CAP_INACTIVE; } - + strcpy(s->val[option].s, val); #ifdef USE_CUSTOM_GAMMA set_gamma_caps(s); @@ -2926,19 +2926,19 @@ sane_control_option (SANE_Handle handle, SANE_Int option, else range_index = SCAN_SIMPLE; - s->opt[OPT_TL_X].constraint.range + s->opt[OPT_TL_X].constraint.range = &s->dev->info.tl_x_ranges[range_index]; clip_value (&s->opt[OPT_TL_X], &s->val[OPT_TL_X].w); - s->opt[OPT_TL_Y].constraint.range + s->opt[OPT_TL_Y].constraint.range = &s->dev->info.tl_y_ranges[range_index]; clip_value (&s->opt[OPT_TL_Y], &s->val[OPT_TL_Y].w); - s->opt[OPT_BR_X].constraint.range + s->opt[OPT_BR_X].constraint.range = &s->dev->info.br_x_ranges[range_index]; clip_value (&s->opt[OPT_BR_X], &s->val[OPT_BR_X].w); - s->opt[OPT_BR_Y].constraint.range + s->opt[OPT_BR_Y].constraint.range = &s->dev->info.br_y_ranges[range_index]; clip_value (&s->opt[OPT_BR_Y], &s->val[OPT_BR_Y].w); @@ -2994,11 +2994,11 @@ sane_control_option (SANE_Handle handle, SANE_Int option, if (info) *info |= SANE_INFO_RELOAD_OPTIONS | SANE_INFO_RELOAD_PARAMS; for (i = 0; s->opt[OPT_RESOLUTION_LIST].constraint.string_list[i]; i++) { - if (strcmp (val, + if (strcmp (val, s->opt[OPT_RESOLUTION_LIST].constraint.string_list[i]) == 0){ - s->val[OPT_X_RESOLUTION].w + s->val[OPT_X_RESOLUTION].w = atoi(s->opt[OPT_RESOLUTION_LIST].constraint.string_list[i]); - s->val[OPT_Y_RESOLUTION].w + s->val[OPT_Y_RESOLUTION].w = atoi(s->opt[OPT_RESOLUTION_LIST].constraint.string_list[i]); if (info) *info |= SANE_INFO_RELOAD_PARAMS; @@ -3055,7 +3055,7 @@ sane_get_parameters (SANE_Handle handle, SANE_Parameters * params) scanning starts. */ memset (&s->params, 0, sizeof (s->params)); - width = MM_TO_PIX( SANE_UNFIX(s->val[OPT_BR_X].w) + width = MM_TO_PIX( SANE_UNFIX(s->val[OPT_BR_X].w) - SANE_UNFIX(s->val[OPT_TL_X].w), s->dev->info.mud); length = MM_TO_PIX( SANE_UNFIX(s->val[OPT_BR_Y].w) @@ -3077,14 +3077,14 @@ sane_get_parameters (SANE_Handle handle, SANE_Parameters * params) /* if async reads are used, )ie. if USE_FORK is defined, this command may only be issued immediately after the - "start scan" command. Later calls will confuse the + "start scan" command. Later calls will confuse the read queue. */ if (!s->get_params_called) { wait_ready(s->fd); status = sanei_scsi_cmd (s->fd, cmd, sizeof (cmd), buf, &len); - + if (status != SANE_STATUS_GOOD) { do_cancel(s); @@ -3142,7 +3142,7 @@ sprint_gamma(Option_Value val, SANE_Byte *dst) { int i; SANE_Byte *p = dst; - + p += sprintf((char *) p, "%i", val.wa[0] > 255 ? 255 : val.wa[0]); /* val.wa[i] is over 255, so val.wa[i] is limitied to 255 */ for (i = 1; i < 256; i++) @@ -3155,17 +3155,17 @@ send_ascii_gamma_tables (SHARP_Scanner *s) { SANE_Status status; int i; - + DBG(11, "<< send_ascii_gamma_tables "); - + /* we need: 4 bytes for each gamma value (3 digits + delimiter) + 10 bytes for the command header i.e. 4 * 4 * 256 + 10 = 4106 bytes */ - + if (s->dev->info.bufsize < 4106) return SANE_STATUS_NO_MEM; - + memset(s->buffer, 0, 4106); i = sprint_gamma(s->val[OPT_GAMMA_VECTOR_R], &s->buffer[10]); @@ -3175,19 +3175,19 @@ send_ascii_gamma_tables (SHARP_Scanner *s) i += sprint_gamma(s->val[OPT_GAMMA_VECTOR_B], &s->buffer[10+i]); s->buffer[10+i++] = '/'; i += sprint_gamma(s->val[OPT_GAMMA_VECTOR], &s->buffer[10+i]); - + DBG(11, "%s\n", &s->buffer[10]); s->buffer[0] = SEND; s->buffer[2] = 0x03; s->buffer[7] = i >> 8; s->buffer[8] = i & 0xff; - + wait_ready(s->fd); status = sanei_scsi_cmd (s->fd, s->buffer, i+10, 0, 0); DBG(11, ">>\n"); - + return status; } #endif @@ -3197,29 +3197,29 @@ send_binary_g_table(SHARP_Scanner *s, SANE_Word *a, int dtq) { SANE_Status status; int i; - + DBG(11, "<< send_binary_g_table\n"); memset(s->buffer, 0, 522); - + s->buffer[0] = SEND; s->buffer[2] = 0x03; s->buffer[5] = dtq; s->buffer[7] = 2; s->buffer[8] = 0; - + for (i = 0; i < 256; i++) { s->buffer[2*i+11] = a[i] > 255 ? 255 : a[i]; } - + for (i = 0; i < 256; i += 16) { DBG(11, "%02x %02x %02x %02x %02x %02x %02x %02x " "%02x %02x %02x %02x %02x %02x %02x %02x\n", - a[i ], a[i+1], a[i+2], a[i+3], + a[i ], a[i+1], a[i+2], a[i+3], a[i+4], a[i+5], a[i+6], a[i+7], - a[i+8], a[i+9], a[i+10], a[i+11], + a[i+8], a[i+9], a[i+10], a[i+11], a[i+12], a[i+13], a[i+14], a[i+15]); } @@ -3236,19 +3236,19 @@ static SANE_Status send_binary_gamma_tables (SHARP_Scanner *s) { SANE_Status status; - + status = send_binary_g_table(s, s->val[OPT_GAMMA_VECTOR].wa, 0x10); if (status != SANE_STATUS_GOOD) return status; - + status = send_binary_g_table(s, s->val[OPT_GAMMA_VECTOR_R].wa, 0x11); if (status != SANE_STATUS_GOOD) return status; - + status = send_binary_g_table(s, s->val[OPT_GAMMA_VECTOR_G].wa, 0x12); if (status != SANE_STATUS_GOOD) return status; - + status = send_binary_g_table(s, s->val[OPT_GAMMA_VECTOR_B].wa, 0x13); return status; @@ -3265,7 +3265,7 @@ send_gamma_tables (SHARP_Scanner *s) { return send_binary_gamma_tables(s); } - + } #endif @@ -3276,19 +3276,19 @@ send_threshold_data(SHARP_Scanner *s) SANE_Status status; SANE_Byte cmd[26] = {SEND, 0, 0x82, 0, 0, 0, 0, 0, 0, 0}; int len; - + memset(cmd, 0, sizeof(cmd)); - /* maximum string length: 3 bytes for each number (they are + /* maximum string length: 3 bytes for each number (they are restricted to the range 0..255), 3 '/' and the null-byte, total: 16 bytes. */ - len = sprintf((char *) &cmd[10], "%i/%i/%i/%i", + len = sprintf((char *) &cmd[10], "%i/%i/%i/%i", s->val[OPT_THRESHOLD_R].w, s->val[OPT_THRESHOLD_G].w, s->val[OPT_THRESHOLD_B].w, s->val[OPT_THRESHOLD].w); cmd[8] = len; - + wait_ready(s->fd); status = sanei_scsi_cmd(s->fd, cmd, len + 10, 0, 0); return status; @@ -3315,7 +3315,7 @@ sane_start (SANE_Handle handle) if (status != SANE_STATUS_GOOD) return status; - s->dev->sensedat.complain_on_errors + s->dev->sensedat.complain_on_errors = COMPLAIN_ON_ADF_ERROR | s->dev->info.complain_on_errors; #ifdef HAVE_SANEI_SCSI_OPEN_EXTENDED @@ -3324,11 +3324,11 @@ sane_start (SANE_Handle handle) s->dev->info.bufsize = 32 * 1024; { int bsize = s->dev->info.bufsize; - status = sanei_scsi_open_extended (s->dev->sane.name, &s->fd, + status = sanei_scsi_open_extended (s->dev->sane.name, &s->fd, &sense_handler, &s->dev->sensedat, &bsize); s->dev->info.bufsize = bsize; } - + if (status != SANE_STATUS_GOOD) { DBG (1, "open of %s failed: %s\n", @@ -3337,10 +3337,10 @@ sane_start (SANE_Handle handle) } /* make sure that we got at least 32 kB. Even then, the scan will be - awfully slow. - + awfully slow. + NOTE: If you need to decrease this value, remember that s->buffer - is used in send_ascii_gamma_tables (JX330/JX610) and in + is used in send_ascii_gamma_tables (JX330/JX610) and in send_binary_g_table (JX250/JX350). send_ascii_gamma_tables needs 4106 bytes, and send_binary_g_table needs 522 bytes. */ @@ -3351,13 +3351,13 @@ sane_start (SANE_Handle handle) return SANE_STATUS_NO_MEM; } #else - status = sanei_scsi_open(s->dev->sane.name, &s->fd, &sense_handler, + status = sanei_scsi_open(s->dev->sane.name, &s->fd, &sense_handler, &s->dev->sensedat); if (s->dev->info.wanted_bufsize < sanei_scsi_max_request_size) s->dev->info.bufsize = s->dev->info.wanted_bufsize; else s->dev->info.bufsize = sanei_scsi_max_request_size; - + if (status != SANE_STATUS_GOOD) { DBG (1, "open of %s failed: %s\n", @@ -3415,7 +3415,7 @@ sane_start (SANE_Handle handle) DBG (5, "start: TEST_UNIT_READY\n"); status = test_unit_ready (s->fd); - + if (status != SANE_STATUS_GOOD) { DBG (1, "TEST UNIT READY failed: %s\n", sane_strstatus (status)); @@ -3462,7 +3462,7 @@ sane_start (SANE_Handle handle) s->uly = MM_TO_PIX(SANE_UNFIX(s->val[OPT_TL_Y].w), s->dev->info.mud); s->threshold = s->val[OPT_THRESHOLD].w; s->bpp = s->params.depth; - + s->adf_fsu_mode = SCAN_SIMPLE; /* default: scan without ADF and FSU */ #ifdef ALLOW_AUTO_SELECT_ADF if (strcmp (adf_fsu, use_auto) == 0) @@ -3565,7 +3565,7 @@ sane_start (SANE_Handle handle) DBG (11, "EDGE EMPHASIS BLUR\n"); s->edge = 3; } - + s->lightcolor = 3; if (strcmp(lightcolor, LIGHT_GREEN) == 0) s->lightcolor = 0; @@ -3592,7 +3592,7 @@ sane_start (SANE_Handle handle) memset (&m_subdev, 0, sizeof (m_subdev)); buf_size = sizeof (m_subdev); status = mode_sense (s->fd, &m_subdev, &buf_size, 0x20); - DBG(11, "mode sense result a_mode: %x f_mode: %x\n", + DBG(11, "mode sense result a_mode: %x f_mode: %x\n", m_subdev.a_mode_type, m_subdev.f_mode_type); if (status != SANE_STATUS_GOOD) { @@ -3601,7 +3601,7 @@ sane_start (SANE_Handle handle) s->fd = -1; return (status); } - if (s->adf_fsu_mode == SCAN_WITH_ADF) + if (s->adf_fsu_mode == SCAN_WITH_ADF) s->adf_scan = 1; #ifdef ALLOW_AUTO_SELECT_ADF else if (s->adf_fsu_mode == SCAN_ADF_FSU_AUTO) @@ -3612,7 +3612,7 @@ sane_start (SANE_Handle handle) #endif } - + #ifdef USE_CUSTOM_GAMMA if (s->val[OPT_CUSTOM_GAMMA].w == SANE_FALSE) { @@ -3639,7 +3639,7 @@ sane_start (SANE_Handle handle) } else { - /* the JX250 does not support the "fixed gamma selection", + /* the JX250 does not support the "fixed gamma selection", therefore, lets calculate & send gamma values */ int i; @@ -3684,7 +3684,7 @@ sane_start (SANE_Handle handle) s->fd = -1; return (status); } - + #ifdef USE_COLOR_THRESHOLD status = send_threshold_data(s); if (status != SANE_STATUS_GOOD) @@ -3696,9 +3696,9 @@ sane_start (SANE_Handle handle) } #endif } - + memset (&wp, 0, sizeof (wp)); - /* every Sharp scanner seems to have a different + /* every Sharp scanner seems to have a different window descriptor block... */ if ( s->dev->sensedat.model == JX610 @@ -3714,7 +3714,7 @@ sane_start (SANE_Handle handle) { buf_size = sizeof (WDB) + sizeof(WDBX330) + sizeof(WDBX250); } - + wp.wpdh.wdl[0] = buf_size >> 8; wp.wpdh.wdl[1] = buf_size; wp.wdb.x_res[0] = s->xres >> 8; @@ -3780,7 +3780,7 @@ sane_start (SANE_Handle handle) DBG (5, "bpp=%d\n", wp.wdb.bpp); DBG (5, "rif_padding=%d\n", wp.wdb.rif_padding); DBG (5, "eletu=%d\n", wp.wdb.eletu); - + #if 0 { unsigned char *p = (unsigned char*) &wp.wdb; @@ -3890,7 +3890,7 @@ sane_start (SANE_Handle handle) #ifdef USE_FORK { size_t i; - for (i = 0; i < s->dev->info.buffers; i++) + for (i = 0; i < s->dev->info.buffers; i++) s->rdr_ctl->buf_ctl[i].shm_status = SHM_EMPTY; s->read_buff = 0; s->rdr_ctl->cancel = 0; @@ -3906,7 +3906,7 @@ sane_start (SANE_Handle handle) s->reader_pid); } #endif - if (s->reader_pid == 0) + if (s->reader_pid == 0) { sigset_t ignore_set; struct SIGACTION act; @@ -3927,9 +3927,9 @@ sane_start (SANE_Handle handle) do_cancel(s); return SANE_STATUS_NO_MEM; } - + #endif /* USE_FORK */ - + DBG (1, "%d pixels per line, %d bytes, %d lines high, total %lu bytes, " "dpi=%d\n", s->params.pixels_per_line, s->params.bytes_per_line, @@ -3939,7 +3939,7 @@ sane_start (SANE_Handle handle) s->buf_used = 0; s->buf_pos = 0; - if (s->cancel == SANE_TRUE) + if (s->cancel == SANE_TRUE) { do_cancel(s); DBG (10, ">>\n"); @@ -4008,14 +4008,14 @@ sane_read_shuffled (SANE_Handle handle, SANE_Byte *dst_buf, SANE_Int max_len, DBG (10, "<< sane_read_shuffled "); *len = 0; - if (s->bytes_to_read == 0 && s->buf_pos == s->buf_used) + if (s->bytes_to_read == 0 && s->buf_pos == s->buf_used) { do_cancel (s); DBG (10, ">>\n"); return (SANE_STATUS_EOF); } - - if (!s->scanning) + + if (!s->scanning) { DBG (10, ">>\n"); return(do_cancel(s)); @@ -4026,14 +4026,14 @@ sane_read_shuffled (SANE_Handle handle, SANE_Byte *dst_buf, SANE_Int max_len, transfer = s->buf_used - s->buf_pos; if (transfer > max_len) transfer = max_len; - + memcpy(dst_buf, &(s->buffer[s->buf_pos]), transfer); s->buf_pos += transfer; max_len -= transfer; *len = transfer; } - while (max_len > 0 && s->bytes_to_read > 0) + while (max_len > 0 && s->bytes_to_read > 0) { if (eight_bit_data) { @@ -4060,7 +4060,7 @@ sane_read_shuffled (SANE_Handle handle, SANE_Byte *dst_buf, SANE_Int max_len, start_input = s->dev->info.bufsize - nread; } ntest = nread; - + #ifdef USE_FORK status = read_data (s, &(s->buffer[start_input]), &nread); #else @@ -4073,8 +4073,8 @@ sane_read_shuffled (SANE_Handle handle, SANE_Byte *dst_buf, SANE_Int max_len, DBG (10, ">>\n"); return (SANE_STATUS_IO_ERROR); } - - if (nread != ntest) + + if (nread != ntest) { /* if this happens, something is wrong in the input buffer management... @@ -4082,8 +4082,8 @@ sane_read_shuffled (SANE_Handle handle, SANE_Byte *dst_buf, SANE_Int max_len, DBG(1, "Warning: could not read an integral number of scan lines\n"); DBG(1, " image will be scrambled\n"); } - - + + s->buf_used = max_line * s->params.bytes_per_line; s->buf_pos = 0; s->bytes_to_read -= nread; @@ -4125,12 +4125,12 @@ sane_read_shuffled (SANE_Handle handle, SANE_Byte *dst_buf, SANE_Int max_len, } } } - + transfer = max_len; if (transfer > s->buf_used) transfer = s->buf_used; memcpy(&(dst_buf[*len]), s->buffer, transfer); - + max_len -= transfer; s->buf_pos += transfer; *len += transfer; @@ -4150,13 +4150,13 @@ sane_read (SANE_Handle handle, SANE_Byte *dst_buf, SANE_Int max_len, SANE_Status status; s->busy = SANE_TRUE; - if (s->cancel == SANE_TRUE) + if (s->cancel == SANE_TRUE) { do_cancel(s); *len = 0; return (SANE_STATUS_CANCELLED); } - + /* RGB scans with a JX 250 and bi-level color scans must be handled differently: */ if (s->image_composition <= 2) @@ -4167,7 +4167,7 @@ sane_read (SANE_Handle handle, SANE_Byte *dst_buf, SANE_Int max_len, status = sane_read_direct(handle, dst_buf, max_len, len); else status = sane_read_shuffled(handle, dst_buf, max_len, len, 1); - + s->busy = SANE_FALSE; if (s->cancel == SANE_TRUE) { @@ -4192,7 +4192,7 @@ sane_cancel (SANE_Handle handle) } SANE_Status -sane_set_io_mode (SANE_Handle __sane_unused__ handle, +sane_set_io_mode (SANE_Handle __sane_unused__ handle, SANE_Bool __sane_unused__ non_blocking) { DBG (10, "<< sane_set_io_mode"); @@ -4202,7 +4202,7 @@ sane_set_io_mode (SANE_Handle __sane_unused__ handle, } SANE_Status -sane_get_select_fd (SANE_Handle __sane_unused__ handle, +sane_get_select_fd (SANE_Handle __sane_unused__ handle, SANE_Int __sane_unused__ * fd) { DBG (10, "<< sane_get_select_fd"); diff --git a/backend/sharp.conf.in b/backend/sharp.conf.in index 054124067..eef72c416 100644 --- a/backend/sharp.conf.in +++ b/backend/sharp.conf.in @@ -9,7 +9,7 @@ # option readqueue: number of queued read requests. This is # with the current SANE version (1.01) only useful for # Linux, since queued read requests are not supported -# for other operating systems. +# for other operating systems. # # For Linux, a value of 2 is recommended, at least if a # JX-250 is used. Bigger values are only a waste of memory. @@ -22,8 +22,8 @@ # # option default_scan_source: valid values are "auto", "fsu", "adf" # and "flatbed". For "auto", the backend will enable an ADF or -# or FSU, if installed. -# +# or FSU, if installed. +# # global options: option buffers 4 option buffersize 131072 diff --git a/backend/sharp.h b/backend/sharp.h index 67972243d..c5dad279b 100644 --- a/backend/sharp.h +++ b/backend/sharp.h @@ -47,21 +47,21 @@ /* default values for configurable options. Though these options are only meaningful if USE_FORK is defined, - they are + they are DEFAULT_BUFFERS: number of buffers allocated as shared memory for the data transfer from reader_process to read_data. The minimum value is 2 DEFAULT_BUFSIZE: default size of one buffer. Must be greater than zero. - DEFAULT_QUEUED_READS: number of read requests queued by + DEFAULT_QUEUED_READS: number of read requests queued by sanei_scsi_req_enter. Since queued read requests - are currently only supported for Linux and + are currently only supported for Linux and DomainOS, this value should automatically be set dependent on the target OS... For Linux, 2 is the optimum; for DomainOS, I don't have any recommendation; other OS should use the value zero. - + The value for DEFAULT_BUFSIZE is probably too Linux-oriented... */ @@ -110,7 +110,7 @@ typedef enum OPT_LIGHTCOLOR, OPT_PREVIEW, -#ifdef USE_CUSTOM_GAMMA +#ifdef USE_CUSTOM_GAMMA OPT_GAMMA_VECTOR, OPT_GAMMA_VECTOR_R, OPT_GAMMA_VECTOR_G, @@ -123,7 +123,7 @@ SHARP_Option; #ifdef USE_FORK -/* status defines for a buffer: +/* status defines for a buffer: buffer not used / read request queued / buffer contains data */ #define SHM_EMPTY 0 @@ -150,7 +150,7 @@ typedef struct SHARP_rdr_ctl SHARP_rdr_ctl; #endif /* USE_FORK */ -typedef enum +typedef enum { /* JX250, JX330, JX350, JX610 are used as array indices, so the corresponding numbers should start at 0 @@ -187,8 +187,8 @@ typedef struct SHARP_Info int wanted_bufsize; size_t queued_reads; int complain_on_errors; - /* default scan mode: - -1 -> "automatic": Use the ADF, if installed, + /* default scan mode: + -1 -> "automatic": Use the ADF, if installed, else use the FSU, if installed. or: SCAN_ADF, SCAN_FSU, SCAN_SIMPLE */ @@ -201,14 +201,14 @@ SHARP_Info; typedef struct SHARP_Sense_Data { SHARP_Model model; - /* flag, if conditions like "paper jam" or "cover open" + /* flag, if conditions like "paper jam" or "cover open" are considered as an error. Should be 0 for attach, else a frontend might refuse to start, if the scanner returns these errors. */ int complain_on_errors; /* Linux returns only 16 bytes of sense data... */ - u_char sb[16]; + u_char sb[16]; } SHARP_Sense_Data; @@ -222,7 +222,7 @@ typedef struct SHARP_Device } SHARP_Device; -typedef struct SHARP_New_Device +typedef struct SHARP_New_Device { struct SHARP_Device *dev; struct SHARP_New_Device *next; @@ -292,7 +292,7 @@ typedef struct WPDH { u_char wpdh[6]; u_char wdl[2]; -} +} WPDH; typedef struct WDB @@ -325,7 +325,7 @@ typedef struct WDB SANE_Byte lightness_g[2]; SANE_Byte lightness_b[2]; SANE_Byte lightness_bw[2]; - + } WDB; diff --git a/backend/sm3600-color.c b/backend/sm3600-color.c index 9b3c540f9..4827311bd 100644 --- a/backend/sm3600-color.c +++ b/backend/sm3600-color.c @@ -171,7 +171,7 @@ TState StartScanColor(TInstance *this) this->state.cyTotalPath = this->param.y/2-(2*this->state.ySensorSkew)*600/this->param.res; DoJog(this,this->state.cyTotalPath); INST_ASSERT(); - this->state.cyTotalPath += + this->state.cyTotalPath += (this->state.cyPixel+2*this->state.ySensorSkew) *600/this->param.res; /* for jogging back */ @@ -214,7 +214,7 @@ TState StartScanColor(TInstance *this) RegWrite(this,R_SLEN, 2, this->state.cyWindow+ (2*this->state.ySensorSkew)*600/this->param.res); - this->state.szOrder=ORDER_BRG; + this->state.szOrder=ORDER_BRG; RegWrite(this,R_CCAL, 3, this->calibration.rgbBias); INST_ASSERT(); /* 0xBBGGRR */ switch (this->param.res) { @@ -294,7 +294,7 @@ TState StartScanColor(TInstance *this) } /* calculate and prepare intermediate line transfer buffer */ - + this->state.cchLineOut=3*this->state.cxPixel; this->state.pchLineOut = malloc(this->state.cchLineOut); if (!this->state.pchLineOut) diff --git a/backend/sm3600-gray.c b/backend/sm3600-gray.c index d9fda869c..e06a935b5 100644 --- a/backend/sm3600-gray.c +++ b/backend/sm3600-gray.c @@ -204,7 +204,7 @@ static TState ReadNextGrayLine(PTInstance this) { int iWrite; int iDot; - unsigned char chBits; + unsigned char chBits; int iRead; /* read position in raw line */ int nInterpolator; @@ -328,7 +328,7 @@ TState StartScanGray(TInstance *this) DoJog(this,this->state.cyTotalPath); INST_ASSERT(); this->state.cyTotalPath += this->param.cy/2; /* for jogging back */ - + /* regular scan is asynchronously, that is, the scanning is issued, and the driver does bulk reads, @@ -370,7 +370,7 @@ TState StartScanGray(TInstance *this) this->state.cchLineOut=(this->mode==gray) ? this->state.cxPixel : (this->state.cxPixel+7)/8; - + this->state.pchLineOut = malloc(this->state.cchLineOut); if (!this->state.pchLineOut) return FreeState(this,SetError(this, diff --git a/backend/sm3600-homerun.c b/backend/sm3600-homerun.c index fe647efe6..13c302882 100644 --- a/backend/sm3600-homerun.c +++ b/backend/sm3600-homerun.c @@ -67,7 +67,7 @@ typedef enum { ltHome, ltUnknown, ltBed, ltError } TLineType; static unsigned char auchRegsSingleLine[]={ 0x00 /*0x01*/, 0x00 /*0x02*/, 0x3F /*0x03*/, - 0xB4 /*!!0x04!!*/, 0x14 /*!!0x05!!*/, 0,0, + 0xB4 /*!!0x04!!*/, 0x14 /*!!0x05!!*/, 0,0, 0x00 /*0x08*/, 0x3F /*!!0x09!!*/, 1,0, 0x6D /*0x0C*/, @@ -119,7 +119,7 @@ static TLineType GetLineType(TInstance *this) RegWrite(this,R_CTL, 1, 0x59); /* #2496[062.5] */ RegWrite(this,R_CTL, 1, 0xD9); /* #2497[062.5] */ i=WaitWhileScanning(this,5); if (i) return i; - + cchBulk=MAX_PIXEL_PER_SCANLINE; /* cchBulk=RegRead(this,R_STAT, 2); @@ -298,7 +298,7 @@ TState DoCalibration(TInstance *this) case sm3750: default: yStart=100; /* 54 is perimeter */ - cStripes=MAX_CALIB_STRIPES; + cStripes=MAX_CALIB_STRIPES; cyGap=10; break; } /* switch */ @@ -359,7 +359,7 @@ TState DoCalibration(TInstance *this) this->calibration.achStripeY[i]=(unsigned char) ((2*(int)auchHanning[i]+auchHanning[i-1]+auchHanning[i+1])/4); #endif - + DoJog(this,-yStart-cStripes*cyGap); INST_ASSERT(); this->calibration.bCalibrated=true; diff --git a/backend/sm3600-scanusb.c b/backend/sm3600-scanusb.c index 3ca9a8a2a..7bdc90b44 100644 --- a/backend/sm3600-scanusb.c +++ b/backend/sm3600-scanusb.c @@ -61,7 +61,7 @@ TransferControlMsg() static int TransferControlMsg(TInstance *this, int nReqType, - int nRequest, + int nRequest, int nValue, int nIndex, void *pBuffer, @@ -302,7 +302,7 @@ int BulkRead(TInstance *this, FILE *fhOut, unsigned int cchBulk) { int cchChunk; int cchReal; - + cchChunk=cchBulk; if (cchChunk>0x1000) cchChunk=0x1000; @@ -366,7 +366,7 @@ int BulkReadBuffer(TInstance *this, { int cchChunk; int cchReal; - + cchChunk=cchBulk; if (cchChunk>0x1000) cchChunk=0x1000; @@ -391,7 +391,7 @@ int BulkReadBuffer(TInstance *this, ); } dprintf(DEBUG_COMM,"writing %d bytes\n",cchRead); - + if (!rc && puchBufferOut) memcpy(puchBufferOut,pchBuffer,cchRead); free(pchBuffer); diff --git a/backend/sm3600-scanutil.c b/backend/sm3600-scanutil.c index 62ba0f16b..022984e08 100644 --- a/backend/sm3600-scanutil.c +++ b/backend/sm3600-scanutil.c @@ -97,7 +97,7 @@ int SetError(TInstance *this, int nError, const char *szFormat, ...) if (this->nErrorState) return 0; /* do not overwrite error state */ this->nErrorState=nError; this->szErrorReason=malloc(500); - + if (szFormat!=NULL && this->szErrorReason) { va_start(ap,szFormat); @@ -200,7 +200,7 @@ TState CancelScan(TInstance *this) usleep(200); DoReset(this); EndScan(this); /* and step back! */ - + DBG(DEBUG_JUNK,"cs4: %d\n",(int)this->nErrorState); bCanceled=this->state.bCanceled; this->state.bCanceled=false; /* re-enable Origination! */ diff --git a/backend/sm3600.c b/backend/sm3600.c index 908e8bea8..6e411c3ba 100644 --- a/backend/sm3600.c +++ b/backend/sm3600.c @@ -180,7 +180,7 @@ InitOptions(TInstance *this) Some hints: *every* field needs a constraint, elseway there will be a warning. */ - + switch (iOpt) { case optCount: @@ -353,8 +353,8 @@ RegisterSaneDev (TModel model, SANE_String_Const szName) return SANE_STATUS_GOOD; } - -static SANE_Status + +static SANE_Status sm_usb_attach (SANE_String_Const dev_name) { int fd; @@ -398,9 +398,9 @@ sane_init (SANE_Int *version_code, SANE_Auth_Callback authCB) } pdevFirst=NULL; - + sanei_usb_init(); - for (i = 0; aScanners[i].idProduct; i++) + for (i = 0; aScanners[i].idProduct; i++) { sanei_usb_find_devices(SCANNER_VENDOR, aScanners[i].idProduct, sm_usb_attach); } @@ -417,7 +417,7 @@ sane_exit (void) /* free all bound resources and instances */ while (pinstFirst) sane_close((SANE_Handle)pinstFirst); /* free all resources */ - + /* free all device descriptors */ for (dev = pdevFirst; dev; dev = pNext) { @@ -511,7 +511,7 @@ sane_close (SANE_Handle handle) if (p==this) break; pParent=p; } - + if (!p) { DBG(1,"invalid handle in close()\n"); @@ -545,7 +545,7 @@ sane_get_option_descriptor (SANE_Handle handle, SANE_Int iOpt) SANE_Status sane_control_option (SANE_Handle handle, SANE_Int iOpt, - SANE_Action action, void *pVal, + SANE_Action action, void *pVal, SANE_Int *pnInfo) { SANE_Word cap; @@ -562,7 +562,7 @@ sane_control_option (SANE_Handle handle, SANE_Int iOpt, return SANE_STATUS_INVAL; cap=this->aoptDesc[iOpt].cap; - + switch (action) { @@ -699,7 +699,7 @@ sane_get_parameters (SANE_Handle handle, SANE_Parameters *p) p->depth=1; p->bytes_per_line=(p->pixels_per_line+7)/8; break; - } + } DBG(DEBUG_INFO,"getting parameters (%d,%d)...\n",p->bytes_per_line,p->lines); return SANE_STATUS_GOOD; } diff --git a/backend/snapscan-data.c b/backend/snapscan-data.c index 1fd1a53b0..6a20499b6 100644 --- a/backend/snapscan-data.c +++ b/backend/snapscan-data.c @@ -41,14 +41,14 @@ If you do not wish that, delete this exception notice. This file contains static calibration data for the Benq 5150C scanner. - Once it is known how calibration for this scanner works this file + Once it is known how calibration for this scanner works this file becomes obsolete. */ /* $Id$ SANE SnapScan backend */ - + static const SANE_Byte calibration_data_5150[] = { 0x78,0x01,0xcc,0x47,0xca,0x53,0xcd,0x4a,0xd0,0x57,0xd5,0x46,0xda,0x56,0xdd,0x49, diff --git a/backend/snapscan-mutex.c b/backend/snapscan-mutex.c index ad0538ae4..72b8fe143 100644 --- a/backend/snapscan-mutex.c +++ b/backend/snapscan-mutex.c @@ -1,8 +1,8 @@ /* Mutex implementation for SnapScan backend - + Copyright (C) 2000, 2004 Henrik Johansson, Oliver Schwartz - + 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 @@ -38,7 +38,7 @@ 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.*/ - + #if defined __BEOS__ #include @@ -122,14 +122,14 @@ static unsigned int snapscani_bernstein(const unsigned char* str) { unsigned int hash = 5381; /* some arbitrary number */ int c; - + while (*str) { - c = *str++; + c = *str++; hash = ((hash << 5) + hash) + c; } return hash; -} +} static int snapscani_mutex_open(snapscan_mutex_t* sem_id, const char* dev) { diff --git a/backend/snapscan-scsi.c b/backend/snapscan-scsi.c index 861ff324f..b6e43a1ab 100644 --- a/backend/snapscan-scsi.c +++ b/backend/snapscan-scsi.c @@ -80,9 +80,9 @@ static SnapScan_Model snapscani_get_model_id(char* model_str, int fd, SnapScan_B if ((bus_type == USB) && (sanei_usb_get_vendor_product(fd, &vendor_id, &product_id) == SANE_STATUS_GOOD)) { - DBG(DL_MINOR_INFO, + DBG(DL_MINOR_INFO, "%s: looking up scanner for ID 0x%04x,0x%04x.\n", - me, vendor_id, product_id); + me, vendor_id, product_id); for (i = 0; i < known_usb_scanners; i++) { if ((usb_scanners[i].vendor_id == vendor_id) && @@ -1320,7 +1320,7 @@ static SANE_Status wait_scanner_ready (SnapScan_Scanner *pss) else { /* This seems to happen for Epson scanners. Return - SANE_STATUS_GOOD and hope the scanner accepts the + SANE_STATUS_GOOD and hope the scanner accepts the next command... */ DBG (DL_CALL_TRACE, "%s: No timeout specified, returning immediately\n", me); return SANE_STATUS_GOOD; diff --git a/backend/snapscan-sources.c b/backend/snapscan-sources.c index dc783945e..e8bbb9014 100644 --- a/backend/snapscan-sources.c +++ b/backend/snapscan-sources.c @@ -238,7 +238,7 @@ typedef struct static SANE_Int FDSource_remaining (Source *pself) { - FDSource *ps = (FDSource *) pself; + FDSource *ps = (FDSource *) pself; return ps->bytes_remaining; } @@ -660,19 +660,19 @@ static SANE_Status create_Expander (SnapScan_Scanner *pss, return status; } -/* +/* This filter implements a fix for scanners that have some columns of pixels offset. Currently it only shifts every other column starting with the first one down ch_offset pixels. - + The Deinterlacer detects if data is in SANE RGB frame format (3 bytes/pixel) or in Grayscale (1 byte/pixel). - + The first ch_offset lines of data in the output are fudged so that even indexed add odd indexed pixels will have the same value. This is necessary because - the real pixel values of the columns that are shifted down are not + the real pixel values of the columns that are shifted down are not in the data for the first ch_offset lines. A better way to handle this would be to - scan in ch_offset extra lines of data, but I haven't figured out how to do this + scan in ch_offset extra lines of data, but I haven't figured out how to do this yet. */ @@ -707,7 +707,7 @@ static SANE_Status Deinterlacer_get (Source *pself, SANE_Byte *pbuf, SANE_Int *p SANE_Int remaining = *plen; SANE_Int org_len = *plen; char *me = "Deinterlacer_get"; - + DBG(DL_DATA_TRACE, "%s: remaining=%d, pself->remaining=%d, ch_ndata=%d, ch_pos=%d\n", me, remaining, pself->remaining(pself), ps->ch_ndata, ps->ch_pos); @@ -784,8 +784,8 @@ static SANE_Status Deinterlacer_get (Source *pself, SANE_Byte *pbuf, SANE_Int *p *pbuf = ps->ch_buf[(ps->ch_pos + (ps->ch_line_size)) % ps->ch_size]; }else{ /* Use data from the next pixel for even indexed pixels - if we are on the first few lines. - TODO: also we will overread the buffer if the buffer read ended + if we are on the first few lines. + TODO: also we will overread the buffer if the buffer read ended on the first pixel. */ if (ps->ch_pos % (ps->ch_line_size) == 0 ) *pbuf = ps->ch_buf[ps->ch_pos+ps->ch_bytes_per_pixel]; @@ -807,7 +807,7 @@ static SANE_Status Deinterlacer_get (Source *pself, SANE_Byte *pbuf, SANE_Int *p } *plen -= remaining; - + DBG(DL_DATA_TRACE, "%s: Request=%d, remaining=%d, read=%d, TXSource_rem=%d, bytes_rem=%lu\n", me, @@ -815,7 +815,7 @@ static SANE_Status Deinterlacer_get (Source *pself, SANE_Byte *pbuf, SANE_Int *p pself->remaining(pself), *plen, TxSource_remaining(pself), - (u_long) ps->pss->bytes_remaining); + (u_long) ps->pss->bytes_remaining); return status; } @@ -859,7 +859,7 @@ static SANE_Status Deinterlacer_init (Deinterlacer *pself, break; } pself->ch_line_size = TxSource_bytesPerLine((Source *) pself); - /* We need at least ch_offset+1 lines of buffer in order + /* We need at least ch_offset+1 lines of buffer in order to shift up ch_offset pixels. */ pself->ch_size = pself->ch_line_size * (pself->ch_offset + 1); pself->ch_buf = (SANE_Byte *) malloc(pself->ch_size); @@ -1216,10 +1216,10 @@ static SANE_Status create_source_chain (SnapScan_Scanner *pss, { case MD_COLOUR: status = create_RGBRouter (pss, *pps, pps); - /* We only have the interlace probelms on - some scanners like the Epson Perfection 2480/2580 + /* We only have the interlace probelms on + some scanners like the Epson Perfection 2480/2580 at 2400 dpi. */ - if (status == SANE_STATUS_GOOD && + if (status == SANE_STATUS_GOOD && ((pss->pdev->model == PERFECTION2480 && pss->res == 2400) || (pss->pdev->model == PERFECTION3490 && pss->res == 3200) || (pss->pdev->model == PRISA5000E && pss->res == 1200))) @@ -1229,7 +1229,7 @@ static SANE_Status create_source_chain (SnapScan_Scanner *pss, status = create_Expander (pss, *pps, pps); if (status == SANE_STATUS_GOOD) status = create_RGBRouter (pss, *pps, pps); - if (status == SANE_STATUS_GOOD && + if (status == SANE_STATUS_GOOD && ((pss->pdev->model == PERFECTION2480 && pss->res == 2400) || (pss->pdev->model == PERFECTION3490 && pss->res == 3200) || (pss->pdev->model == PRISA5000E && pss->res == 1200))) diff --git a/backend/snapscan-sources.h b/backend/snapscan-sources.h index a5ed3dfb1..595b48bfb 100644 --- a/backend/snapscan-sources.h +++ b/backend/snapscan-sources.h @@ -1,48 +1,48 @@ /* sane - Scanner Access Now Easy. - + Copyright (C) 1997, 1998 Franck Schnefra, Michel Roelofs, Emmanuel Blot, Mikko Tyolajarvi, David Mosberger-Tang, Wolfgang Goeller, Petter Reinholdtsen, Gary Plewa, Sebastien Sable, Oliver Schwartz and Kevin Charter - + 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 is a component of the implementation of a backend for many of the AGFA SnapScan and Acer Vuego/Prisa flatbed scanners. */ diff --git a/backend/snapscan-usb.c b/backend/snapscan-usb.c index ec6a53e94..dc2142830 100644 --- a/backend/snapscan-usb.c +++ b/backend/snapscan-usb.c @@ -1,8 +1,8 @@ /* Snapscan 1212U modifications for the Snapscan SANE backend - + Copyright (C) 2000 Henrik Johansson - + Henrik Johansson (henrikjo@post.urfors.se) This program is free software; you can redistribute it and/or @@ -43,7 +43,7 @@ This file implements USB equivalents to the SCSI routines used by the Snapscan backend. - + History 0.1 2000-02-01 @@ -174,7 +174,7 @@ static SANE_Status snapscani_usb_open(const char *dev, int *fdp, usb_sense_handler=sense_handler; usb_pss = pss; urb_counters->read_urbs = 0; - urb_counters->write_urbs = 0; + urb_counters->write_urbs = 0; return sanei_usb_open(dev, fdp); } @@ -182,13 +182,13 @@ static SANE_Status snapscani_usb_open(const char *dev, int *fdp, static void snapscani_usb_close(int fd) { static const char me[] = "snapscani_usb_close"; SANE_Word vendor_id, product_id; - + DBG (DL_CALL_TRACE, "%s(%d)\n", me, fd); DBG (DL_DATA_TRACE,"1st read %ld write %ld\n", urb_counters->read_urbs, urb_counters->write_urbs); - + /* Check if URB counting is needed. If yes, ensure the number of sent and received URBs is even. - Odd number of URBs only cause problems with libusb and certain + Odd number of URBs only cause problems with libusb and certain scanner models. On other scanner models, sending additional commands seems to cause problems (e.g. 1212u_2). If sanei_usb_get_vendor_product returns an error there's probably no @@ -197,12 +197,12 @@ static void snapscani_usb_close(int fd) { if (sanei_usb_get_vendor_product(fd, &vendor_id, &product_id) == SANE_STATUS_GOOD) { /* Exclude 1212u_2 */ - if (!((vendor_id == USB_VENDOR_AGFA) && (product_id == USB_PRODUCT_1212U2))) + if (!((vendor_id == USB_VENDOR_AGFA) && (product_id == USB_PRODUCT_1212U2))) { if ((urb_counters->read_urbs & 0x01) && (urb_counters->write_urbs & 0x01)) { char cmd[] = {TEST_UNIT_READY, 0, 0, 0, 0, 0}; - + snapscani_usb_cmd (fd, cmd, sizeof (cmd), NULL, 0); } else if (urb_counters->read_urbs & 0x01) @@ -211,7 +211,7 @@ static void snapscani_usb_close(int fd) { char cmd[] = {TEST_UNIT_READY, 0, 0, 0, 0, 0}; char cmd2[] = {INQUIRY, 0, 0, 0, 120, 0}; char data[120]; - + read_bytes = 120; snapscani_usb_cmd (fd, cmd2, sizeof (cmd2), data, &read_bytes); snapscani_usb_cmd (fd, cmd, sizeof (cmd), NULL, 0); @@ -221,11 +221,11 @@ static void snapscani_usb_close(int fd) { size_t read_bytes; char cmd[] = {INQUIRY, 0, 0, 0, 120, 0}; char data[120]; - + read_bytes = 120; snapscani_usb_cmd (fd, cmd, sizeof (cmd), data, &read_bytes); } - DBG (DL_DATA_TRACE,"2nd read %ld write %ld\n", urb_counters->read_urbs, + DBG (DL_DATA_TRACE,"2nd read %ld write %ld\n", urb_counters->read_urbs, urb_counters->write_urbs); } } @@ -302,7 +302,7 @@ static SANE_Status usb_read(SANE_Int fd, void *buf, size_t n) { DBG (DL_MAJOR_ERROR, "%s Only %lu bytes read\n",me, (u_long) bytes_read); status = SANE_STATUS_IO_ERROR; } - urb_counters->read_urbs += ((63 + bytes_read) / 64); + urb_counters->read_urbs += ((63 + bytes_read) / 64); DBG(DL_DATA_TRACE, "%s: reading: %s\n",me,usb_debug_data(dbgmsg,buf,n)); DBG(DL_DATA_TRACE, "Read %lu bytes\n", (u_long) bytes_read); return status; @@ -521,7 +521,7 @@ static SANE_Status snapscani_usb_shm_init(void) } memset(urb_counters, 0, shm_size); return SANE_STATUS_GOOD; - + } static void snapscani_usb_shm_exit(void) @@ -546,7 +546,7 @@ static SANE_Status snapscani_usb_shm_init(void) strerror (errno)); return SANE_STATUS_NO_MEM; } - + shm_area = shmat (shm_id, NULL, 0); if (shm_area == (void *) -1) { @@ -555,7 +555,7 @@ static SANE_Status snapscani_usb_shm_init(void) shmctl (shm_id, IPC_RMID, NULL); return SANE_STATUS_NO_MEM; } - + if (shmctl (shm_id, IPC_RMID, NULL) == -1) { DBG (DL_MAJOR_ERROR, "snapscani_usb_shm_init: cannot remove shared memory segment id: %s\n", diff --git a/backend/sp15c.c b/backend/sp15c.c index 0cabed8b8..28f122af8 100644 --- a/backend/sp15c.c +++ b/backend/sp15c.c @@ -313,7 +313,7 @@ sane_get_devices (const SANE_Device *** device_list, SANE_Bool local_only) { struct sp15c *dev; int i; - + local_only = local_only; /* silence compilation warnings */ DBG (10, "sane_get_devices\n"); @@ -392,7 +392,7 @@ sane_open (SANE_String_Const name, SANE_Handle * handle) SANE_Status sane_set_io_mode (SANE_Handle h, SANE_Bool non_blocking) { - h = h; + h = h; non_blocking = non_blocking; /* silence compilation warnings */ DBG (10, "sane_set_io_mode\n"); @@ -989,7 +989,7 @@ sane_exit (void) free (dev->buffer); free (dev); } - + if (devlist) free (devlist); } /* sane_exit */ @@ -1322,7 +1322,7 @@ static SANE_Status sp15c_do_inquiry (struct sp15c *s) { static SANE_Status ret; - + DBG (10, "do_inquiry\n"); memset (s->buffer, '\0', 256); /* clear buffer */ @@ -1606,7 +1606,7 @@ sp15c_free_scanner (struct sp15c *s) if (ret) return ret; #endif - + wait_scanner (s); ret = do_scsi_cmd (s->sfd, release_unitB.cmd, release_unitB.size, NULL, 0); @@ -1626,7 +1626,7 @@ sp15c_free_scanner (struct sp15c *s) * GOOD * RESERVE UNIT * GOOD - * + * * It is then responsible for installing appropriate signal handlers * to call emergency_give_scanner() if user aborts. */ @@ -1647,7 +1647,7 @@ sp15c_grab_scanner (struct sp15c *s) return 0; } /* sp15c_grab_scanner */ -/* +/* * wait_scanner spins until TEST_UNIT_READY returns 0 (GOOD) * returns 0 on success, * returns -1 on error or timeout @@ -1788,7 +1788,7 @@ static void swap_res (struct sp15c *s) { s = s; /* silence compilation warnings */ - + /* for the time being, do nothing */ } /* swap_res */ @@ -1820,7 +1820,7 @@ sp15c_set_window_param (struct sp15c *s, int prescan) int active_buffer_size; prescan = prescan; /* silence compilation warnings */ - + wait_scanner (s); DBG (10, "set_window_param\n"); memset (buffer_r, '\0', WDB_size_max); /* clear buffer */ @@ -1979,7 +1979,7 @@ reader_process (void *data) DBG (10, "reader_process started\n"); - if (sanei_thread_is_forked ()) + if (sanei_thread_is_forked ()) close (scanner->pipe); sigfillset (&ignore_set); diff --git a/backend/st400.c b/backend/st400.c index b8ee6d1a1..16c7f9fc7 100644 --- a/backend/st400.c +++ b/backend/st400.c @@ -1201,7 +1201,7 @@ sane_cancel( SANE_Handle handle ) #if 0 st400_stop_scan(dev->fd); #endif - if( st400_light_delay ) + if( st400_light_delay ) st400_light_off(dev->fd); st400_release(dev->fd); sanei_scsi_close(dev->fd); diff --git a/backend/stv680.c b/backend/stv680.c index 15a847227..8d2fda392 100644 --- a/backend/stv680.c +++ b/backend/stv680.c @@ -2,10 +2,10 @@ Copyright (C) 2004 - 2006 Gerard Klaver - The teco2 and gl646 backend (Frank Zago) are used as a template for + The teco2 and gl646 backend (Frank Zago) are used as a template for this backend. - For the usb commands and bayer decoding parts of the following + For the usb commands and bayer decoding parts of the following program are used: The pencam2 program (GNU GPL license 2) @@ -13,22 +13,22 @@ The libgphoto2 (camlib stv0680) (GNU GPL license 2) The stv680.c/.h kernel module (GNU GPL license 2) - For the stv680_add_text routine the add_text routine and font_6x11.h file + For the stv680_add_text routine the add_text routine and font_6x11.h file are taken from the webcam.c file, part of xawtv program, (c) 1998-2002 Gerd Knorr (GNU GPL license 2). 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, @@ -54,7 +54,7 @@ . . - sane_start() : start image acquisition . . - sane_get_parameters() : returns actual scan parameters . . - sane_read() : read image data (from pipe) - . . (sane_read called multiple times; + . . (sane_read called multiple times; . . after sane_read returns EOF) . . go back to sane_start() if more frames desired . . - sane_cancel() : cancel operation @@ -559,7 +559,7 @@ stv680_identify_vidcam (Stv680_Vidcam * dev) "stv680_vidcam_init: STV680 FAILED to set configure\n"); return status; } - */ + */ sizer = 0x02; status = sanei_usb_control_msg (dev->fd, 0xc1, 0x88, 0x5678, 0, sizer, @@ -1180,7 +1180,7 @@ stv680_fill_image (Stv680_Vidcam * dev) /* i = stv_sndctrl (0, dev, 0x80, 0, &window, 0x02); *//* Get Last Error */ /* DBG (DBG_proc, "STV(i): last error: %i, command = 0x%x", window[0], window[1]); return -1; */ -/* +/* } return 0; */ @@ -1315,9 +1315,9 @@ stv680_bayer_unshuffle (Stv680_Vidcam * dev, SANE_Byte * buf, size_t * size) } /* for y */ /****** gamma correction plus hardcoded white balance */ - /* Correction values red[], green[], blue[], are generated by - (pow(i/256.0, GAMMA)*255.0)*white balanceRGB where GAMMA=0.55, 1scan_mode == STV680_COLOR_RGB || dev->scan_mode == STV680_COLOR_RGB_TEXT) diff --git a/backend/stv680.h b/backend/stv680.h index e08976b99..a4f5fbe77 100644 --- a/backend/stv680.h +++ b/backend/stv680.h @@ -2,10 +2,10 @@ Copyright (C) 2004 -2006 Gerard Klaver (gerard at gkall dot hobby dot nl) - The teco2 and gl646 backend (Frank Zago) are used as a template for + The teco2 and gl646 backend (Frank Zago) are used as a template for this backend. - - For the usb commands and bayer decoding parts of the following + + For the usb commands and bayer decoding parts of the following program are used: The pencam2 program (GNU GPL license 2) @@ -13,7 +13,7 @@ The libgphoto2 (camlib stv0680) (GNU GPL license 2) The stv680.c/.h kernel module (GNU GPL license 2) - For the stv680_add_text routine the add_text routine and font_6x11.h file + For the stv680_add_text routine the add_text routine and font_6x11.h file are taken from the webcam.c file, part of xawtv program, (c) 1998-2002 Gerd Knorr (GNU GPL license 2). @@ -36,7 +36,7 @@ --------------------------------------------------------------------- */ -/* +/* $Id$ update 20-04-2006*/ @@ -94,8 +94,8 @@ enum Stv680_Option /*--------------------------------------------------------------------------*/ -/* - * Video Camera supported by this backend. +/* + * Video Camera supported by this backend. */ struct vidcam_hardware { @@ -207,7 +207,7 @@ Stv680_Vidcam; /*--------------------------------------------------------------------------*/ -/* Debug levels. +/* Debug levels. * Should be common to all backends. */ #define DBG_error0 0 diff --git a/backend/tamarack.c b/backend/tamarack.c index 6fc259f1e..8bf216905 100644 --- a/backend/tamarack.c +++ b/backend/tamarack.c @@ -23,8 +23,8 @@ exception gives you, Please do contact me, and we'll work something out. - R.E.Wolff@BitWizard.nl - tel: +31-152137555 + R.E.Wolff@BitWizard.nl + tel: +31-152137555 fax: +31-152138217 This file implements a SANE backend for Tamarack flatbed scanners. */ @@ -101,7 +101,7 @@ static const SANE_Range u8_range = /* David used " 100 << SANE_FIXED_SCALE_SHIFT ". This assumes that - * it is implemented that way. I want to hide the datatype. + * it is implemented that way. I want to hide the datatype. */ static const SANE_Range percentage_range = { @@ -111,7 +111,7 @@ static const SANE_Range percentage_range = }; /* David used " 100 << SANE_FIXED_SCALE_SHIFT ". This assumes that - * it is implemented that way. I want to hide the datatype. + * it is implemented that way. I want to hide the datatype. */ static const SANE_Range abs_percentage_range = { @@ -139,7 +139,7 @@ static const uint8_t stop[] = static const uint8_t get_status[] = { - TAMARACK_SCSI_GET_DATA_STATUS, 0x00, 0x00, 0x00, 0x00, 0x00, + TAMARACK_SCSI_GET_DATA_STATUS, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0c, 0x00 }; @@ -250,17 +250,17 @@ attach (const char *devname, Tamarack_Device **devp) mfg = strdup (result+8); DBG(1, "attach: Inquiry gives mfg=%s, model=%s.\n", mfg, model); - + if (strcmp (mfg, "TAMARACK") != 0) { DBG(1, "attach: device doesn't look like a Tamarack scanner " "(result[0]=%#02x)\n", result[0]); return SANE_STATUS_INVAL; } - + dev = malloc (sizeof (*dev)); if (!dev) return SANE_STATUS_NO_MEM; - + memset (dev, 0, sizeof (*dev)); dev->sane.name = strdup (devname); @@ -333,7 +333,7 @@ scan_area_and_windows (Tamarack_Scanner *s) memset (&dwp,'\0',sizeof (dwp)); dwp.dwph.opc = TAMARACK_SCSI_AREA_AND_WINDOWS; - set_triple (dwp.dwph.len,8 + sizeof (dwp.wdb)); + set_triple (dwp.dwph.len,8 + sizeof (dwp.wdb)); set_double (dwp.wdh.wpll, sizeof (dwp.wdb)); @@ -343,7 +343,7 @@ scan_area_and_windows (Tamarack_Scanner *s) set_quad (dwp.wdb.ulx, (int) (47.2 * SANE_UNFIX (s->val[OPT_TL_X].w))); set_quad (dwp.wdb.uly, (int) (47.2 * SANE_UNFIX (s->val[OPT_TL_Y].w))); - set_quad (dwp.wdb.width, + set_quad (dwp.wdb.width, (int) (47.2 * SANE_UNFIX (s->val[OPT_BR_X].w - s->val[OPT_TL_X].w))); set_quad (dwp.wdb.length, (int) (47.2 * SANE_UNFIX (s->val[OPT_BR_Y].w - s->val[OPT_TL_Y].w))); @@ -357,7 +357,7 @@ scan_area_and_windows (Tamarack_Scanner *s) case THRESHOLDED: dwp.wdb.bpp = 1; dwp.wdb.image_comp = 0; - dwp.wdb.thresh = 1 + 2.55 * (SANE_UNFIX (s->val[OPT_THRESHOLD].w)); + dwp.wdb.thresh = 1 + 2.55 * (SANE_UNFIX (s->val[OPT_THRESHOLD].w)); break; case DITHERED: dwp.wdb.bpp = 1; @@ -375,7 +375,7 @@ scan_area_and_windows (Tamarack_Scanner *s) DBG(1, "Invalid mode. %d\n", s->mode); return SANE_STATUS_INVAL; } - DBG(1, "bright, thresh, contrast = %d(%5.1f), %d, %d(%5.1f)\n", + DBG(1, "bright, thresh, contrast = %d(%5.1f), %d, %d(%5.1f)\n", dwp.wdb.brightness, SANE_UNFIX (s->val[OPT_BRIGHTNESS].w), dwp.wdb.thresh , dwp.wdb.contrast , SANE_UNFIX (s->val[OPT_CONTRAST].w)); @@ -399,7 +399,7 @@ mode_select (Tamarack_Scanner *s) struct tamarack_page page; } c; - memset (&c, '\0', sizeof (c)); + memset (&c, '\0', sizeof (c)); c.cmd.opc = TAMARACK_SCSI_MODE_SELECT; c.cmd.pad0[0] = 0x10; /* Suddenly the pad bytes are no long pad... */ c.cmd.pad0[1] = 0; @@ -412,7 +412,7 @@ mode_select (Tamarack_Scanner *s) case THRESHOLDED: case DITHERED: case GREYSCALE: - c.page.masks = 0x80; + c.page.masks = 0x80; break; case TRUECOLOR: c.page.masks = 0x40 >> s->pass; @@ -431,7 +431,7 @@ start_scan (Tamarack_Scanner *s) struct command_header cmd; unsigned char winid[1]; } c; - + memset (&c,'\0',sizeof (c)); c.cmd.opc = TAMARACK_SCSI_START_STOP; c.cmd.len = sizeof (c.winid); @@ -442,9 +442,9 @@ start_scan (Tamarack_Scanner *s) static SANE_Status stop_scan (Tamarack_Scanner *s) -{ +{ /* XXX I don't think a TAMARACK can stop in mid-scan. Just stop - sending it requests for data.... + sending it requests for data.... */ return sanei_scsi_cmd (s->fd, stop, sizeof (stop), 0, 0); } @@ -526,10 +526,10 @@ get_image_status (Tamarack_Scanner *s) result, &len); if ((status != SANE_STATUS_GOOD) && (status != SANE_STATUS_DEVICE_BUSY)) return status; - - s->params.bytes_per_line = + + s->params.bytes_per_line = result[ 8] | (result[ 7] << 8) | (result[6] << 16); - s->params.lines = + s->params.lines = result[11] | (result[10] << 8) | (result[9] << 16); switch (s->mode) { @@ -855,7 +855,7 @@ reader_process (void *scanner) if (!lines_per_buffer) return 2; /* resolution is too high */ - /* Limit the size of a single transfer to one inch. + /* Limit the size of a single transfer to one inch. XXX Add a stripsize option. */ if (lines_per_buffer > SANE_UNFIX (s->val[OPT_RESOLUTION].w)) lines_per_buffer = SANE_UNFIX (s->val[OPT_RESOLUTION].w); @@ -877,14 +877,14 @@ reader_process (void *scanner) return 3; } DBG(3, "reader_process: read %d lines\n", lines_per_buffer); - + if ((s->mode == TRUECOLOR) || (s->mode == GREYSCALE)) { fwrite (data, lines_per_buffer, bpl, fp); } else { /* in singlebit mode, the scanner returns 1 for black. ;-( --DM */ /* Hah! Same for Tamarack... -- REW */ int i; - + for (i = 0; i < lines_per_buffer * bpl; ++i) fputc (~data[i], fp); } @@ -929,10 +929,10 @@ sane_init (SANE_Int *version_code, SANE_Auth_Callback authorize) if (dev_name[0] == '#') /* ignore line comments */ continue; len = strlen (dev_name); - + if (!len) continue; /* ignore empty lines */ - + sanei_config_attach_matching_devices (dev_name, attach_one); } fclose (fp); @@ -951,7 +951,7 @@ sane_exit (void) free ((void *) dev->sane.model); free (dev); } - + if (devlist) free (devlist); } @@ -1063,7 +1063,7 @@ const SANE_Option_Descriptor * sane_get_option_descriptor (SANE_Handle handle, SANE_Int option) { Tamarack_Scanner *s = handle; - + if ((unsigned) option >= NUM_OPTIONS) return 0; return s->opt + option; @@ -1151,7 +1151,7 @@ sane_control_option (SANE_Handle handle, SANE_Int option, status = constrain_value (s, option, val, info); if (status != SANE_STATUS_GOOD) return status; - + switch (option) { /* (mostly) side-effect-free word options: */ @@ -1235,7 +1235,7 @@ sane_control_option (SANE_Handle handle, SANE_Int option, #endif - if (strcmp (val, SANE_VALUE_SCAN_MODE_LINEART) == 0) + if (strcmp (val, SANE_VALUE_SCAN_MODE_LINEART) == 0) s->opt[OPT_THRESHOLD].cap &= ~SANE_CAP_INACTIVE; else { s->opt[OPT_BRIGHTNESS].cap &= ~SANE_CAP_INACTIVE; @@ -1271,10 +1271,10 @@ sane_get_parameters (SANE_Handle handle, SANE_Parameters *params) if (!s->scanning) { double width, height, dpi; - + memset (&s->params, 0, sizeof (s->params)); - + width = SANE_UNFIX (s->val[OPT_BR_X].w - s->val[OPT_TL_X].w); height = SANE_UNFIX (s->val[OPT_BR_Y].w - s->val[OPT_TL_Y].w); dpi = SANE_UNFIX (s->val[OPT_RESOLUTION].w); @@ -1284,7 +1284,7 @@ sane_get_parameters (SANE_Handle handle, SANE_Parameters *params) scanning starts. */ if (dpi > 0.0 && width > 0.0 && height > 0.0) { double dots_per_mm = dpi / MM_PER_INCH; - + s->params.pixels_per_line = width * dots_per_mm; s->params.lines = height * dots_per_mm; } @@ -1308,14 +1308,14 @@ sane_get_parameters (SANE_Handle handle, SANE_Parameters *params) } s->params.last_frame = (s->mode != TRUECOLOR) || (s->pass == 2); - + if (params) *params = s->params; DBG(1, "Got parameters: format:%d, ppl: %d, bpl:%d, depth:%d, " - "last %d pass %d\n", - s->params.format, s->params.pixels_per_line, - s->params.bytes_per_line, s->params.depth, + "last %d pass %d\n", + s->params.format, s->params.pixels_per_line, + s->params.bytes_per_line, s->params.depth, s->params.last_frame, s->pass); return SANE_STATUS_GOOD; } @@ -1349,7 +1349,7 @@ sane_start (SANE_Handle handle) s->params.last_frame = SANE_TRUE; } } - + status = sanei_scsi_open (s->hw->sane.name, &s->fd, sense_handler, 0); if (status != SANE_STATUS_GOOD) { DBG(1, "open: open of %s failed: %s\n", @@ -1374,7 +1374,7 @@ sane_start (SANE_Handle handle) status = mode_select (s); if (status != SANE_STATUS_GOOD) goto stop_scanner_and_return; - + s->scanning = SANE_TRUE; status = start_scan (s); @@ -1417,7 +1417,7 @@ sane_read (SANE_Handle handle, SANE_Byte *buf, SANE_Int max_len, SANE_Int *len) if (!s->scanning) return do_cancel (s); - + if (nread < 0) { if (errno == EAGAIN) { return SANE_STATUS_GOOD; diff --git a/backend/tamarack.h b/backend/tamarack.h index 65697ac23..3b1e1c5ec 100644 --- a/backend/tamarack.h +++ b/backend/tamarack.h @@ -167,11 +167,11 @@ Tamarack_Scanner; #define TAMARACK_SCSI_TEST_UNIT_READY 0x00 #define TAMARACK_SCSI_INQUIRY 0x12 -#define TAMARACK_SCSI_MODE_SELECT 0x15 +#define TAMARACK_SCSI_MODE_SELECT 0x15 #define TAMARACK_SCSI_START_STOP 0x1b #define TAMARACK_SCSI_AREA_AND_WINDOWS 0x24 #define TAMARACK_SCSI_READ_SCANNED_DATA 0x28 -#define TAMARACK_SCSI_GET_DATA_STATUS 0x34 +#define TAMARACK_SCSI_GET_DATA_STATUS 0x34 /* The structures that you have to send to the tamarack to get it to @@ -190,7 +190,7 @@ struct win_desc_block { unsigned char yres[2]; unsigned char ulx[4]; unsigned char uly[4]; - unsigned char width[4]; + unsigned char width[4]; unsigned char length[4]; unsigned char brightness; unsigned char thresh; @@ -209,7 +209,7 @@ struct win_desc_block { struct command_header { unsigned char opc; - unsigned char pad0[3]; + unsigned char pad0[3]; unsigned char len; unsigned char pad1; }; @@ -217,7 +217,7 @@ struct command_header { struct command_header_10 { unsigned char opc; - unsigned char pad0[5]; + unsigned char pad0[5]; unsigned char len[3]; unsigned char pad1; }; diff --git a/backend/teco1.c b/backend/teco1.c index 2a13201a9..136f537a8 100644 --- a/backend/teco1.c +++ b/backend/teco1.c @@ -1,44 +1,44 @@ /* sane - Scanner Access Now Easy. Copyright (C) 2002 Frank Zago (sane at zago dot net) - + 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. + If you do not wish that, delete this exception notice. */ /* @@ -190,16 +190,16 @@ static const struct scanners_supported scanners[] = { 99 }, - {6, "TECO VM4540", - TECO_VM4540, - "Relisys", "RELI 4816", - {1, 1600, 1}, /* resolution */ - 400, 1600, /* max x and Y resolution */ - 1, /* color 1 pass */ - 256, /* number of bytes per gamma color */ - 99 /* number of bytes in a window */ + {6, "TECO VM4540", + TECO_VM4540, + "Relisys", "RELI 4816", + {1, 1600, 1}, /* resolution */ + 400, 1600, /* max x and Y resolution */ + 1, /* color 1 pass */ + 256, /* number of bytes per gamma color */ + 99 /* number of bytes in a window */ }, - + {6, "TECO VM4542", TECO_VM4542, "Relisys", "RELI 4830", @@ -1240,7 +1240,7 @@ teco_init_options (Teco_Scanner * dev) (SANE_String_Const *) scan_mode_list[0], NULL); } -/* +/* * Wait until the scanner is ready. */ static SANE_Status @@ -1295,7 +1295,7 @@ teco_fill_image (Teco_Scanner * dev) while (dev->real_bytes_left) { - /* + /* * Try to read the maximum number of bytes. */ size = 0; @@ -1318,7 +1318,7 @@ teco_fill_image (Teco_Scanner * dev) if (size == 0) { - /* Probably reached the end of the buffer. + /* Probably reached the end of the buffer. * Check, just in case. */ assert (dev->image_end != 0); return (SANE_STATUS_GOOD); @@ -1389,7 +1389,7 @@ teco_fill_image (Teco_Scanner * dev) return (SANE_STATUS_GOOD); /* unreachable */ } -/* Copy from the raw buffer to the buffer given by the backend. +/* Copy from the raw buffer to the buffer given by the backend. * * len in input is the maximum length available in buf, and, in * output, is the length written into buf. diff --git a/backend/teco1.h b/backend/teco1.h index 1b5fecbf2..528613f47 100644 --- a/backend/teco1.h +++ b/backend/teco1.h @@ -38,10 +38,10 @@ 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. + If you do not wish that, delete this exception notice. */ -/* +/* $Id$ */ @@ -253,8 +253,8 @@ enum Teco_Option /*--------------------------------------------------------------------------*/ -/* - * Scanner supported by this backend. +/* + * Scanner supported by this backend. */ struct scanners_supported { @@ -363,7 +363,7 @@ Teco_Scanner; /*--------------------------------------------------------------------------*/ -/* Debug levels. +/* Debug levels. * Should be common to all backends. */ #define DBG_error0 0 diff --git a/backend/teco2.c b/backend/teco2.c index 9bc8bf41d..32cd9a486 100644 --- a/backend/teco2.c +++ b/backend/teco2.c @@ -4,42 +4,42 @@ Copyright (C) 2003-2008 Gerard Klaver (gerard at gkall dot hobby dot nl) 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. + If you do not wish that, delete this exception notice. */ /* @@ -61,7 +61,7 @@ changed use of %d to %ld (when bytes values are displayed) update 2005/03/04, use of __sane_unused__ update 2005/07/29. Removed using teco_request_sense (dev) routine for VM3564 - update 2008/01/12, Update teco_request_sense routine due to no + update 2008/01/12, Update teco_request_sense routine due to no init value for size. */ @@ -1129,17 +1129,17 @@ teco_wait_for_data (Teco_Scanner * dev) /* Do the calibration stuff. Get 12 or 8 lines of data. Each pixel is coded * in 6 bytes (2 per color) or 3 bytes (3564 and 356A). To do the calibration, * allocates an array big enough for one line, read the 12 or 8 lines of calibration, - * subtract the highest and lowest value and do a average. + * subtract the highest and lowest value and do a average. * The input line is 1 raster for each color. However * the output line is interlaced (ie RBG for the first pixel, then RGB * for the second, and so on...). The output line are the value to use - * to compensate for the white point. + * to compensate for the white point. * There is two algorithms: * * The range goes from 0 to 0xfff, and the average is 0x800. So if * the average input is 0x700, the output value for that dot must be * 0x1000-0x700=0x900. - * + * * and * * the calibration needs to be a multiplication factor, to @@ -1169,7 +1169,7 @@ teco_do_calibration (Teco_Scanner * dev) colsub1_0 = 0; colsub1_1 = 0; colsub1_2 = 0; - + DBG (DBG_proc, "teco_do_calibration: enter\n"); /* Get default calibration algorithm. */ @@ -1251,7 +1251,7 @@ teco_do_calibration (Teco_Scanner * dev) memset (tmp_max_buf, 0x0000, tmp_max_buf_size); break; } - + if ((tmp_buf == NULL) || (tmp_min_buf == NULL) || (tmp_max_buf == NULL)) { DBG (DBG_proc, "teco_do_calibration: not enough memory (%ld bytes)\n", @@ -1362,29 +1362,29 @@ teco_do_calibration (Teco_Scanner * dev) tmp_min_buf[3 * j + 0] = dev->buffer[3 * j + 0]; } /* get highest value */ - if (tmp_max_buf[3 * j + 0] < dev->buffer[3 * j + 0]) + if (tmp_max_buf[3 * j + 0] < dev->buffer[3 * j + 0]) { tmp_max_buf[3 * j + 0] = dev->buffer[3 * j + 0]; } tmp_buf[3 * j + 1] += dev->buffer[3 * j + 1]; /* get lowest value */ - if (tmp_min_buf[3 * j + 1] >> dev->buffer[3 * j + 1]) + if (tmp_min_buf[3 * j + 1] >> dev->buffer[3 * j + 1]) { tmp_min_buf[3 * j + 1] = dev->buffer[3 * j + 1]; } /* get hightest value */ - if (tmp_max_buf[3 * j + 1] < dev->buffer[3 * j + 1]) + if (tmp_max_buf[3 * j + 1] < dev->buffer[3 * j + 1]) { tmp_max_buf[3 * j + 1] = dev->buffer[3 * j + 1]; } tmp_buf[3 * j + 2] += dev->buffer[3 * j + 2]; /* get lowest value */ - if (tmp_min_buf[3 * j + 2] >> dev->buffer[3 * j + 2]) + if (tmp_min_buf[3 * j + 2] >> dev->buffer[3 * j + 2]) { tmp_min_buf[3 * j + 2] = dev->buffer[3 * j + 2]; } /* get highest value */ - if (tmp_max_buf[3 * j + 2] < dev->buffer[3 * j + 2]) + if (tmp_max_buf[3 * j + 2] < dev->buffer[3 * j + 2]) { tmp_max_buf[3 * j + 2] = dev->buffer[3 * j + 2]; } @@ -1404,7 +1404,7 @@ teco_do_calibration (Teco_Scanner * dev) /* hexdump (DBG_info2, "calibration before average:", tmp_buf, tmp_buf_size); */ /* hexdump (DBG_info2, "calibration before average min value:", tmp_min_buf, tmp_min_buf_size); */ /* hexdump (DBG_info2, "calibration before average max value:", tmp_max_buf, tmp_max_buf_size); */ - + /* Do the average. Since we got 12 or 8 lines, divide all values by 10 or 6 * and create the final calibration value that compensates for the * white values read. */ @@ -1419,28 +1419,28 @@ teco_do_calibration (Teco_Scanner * dev) for (j = 0; j < dev->def->cal_length; j++) { /* subtract lowest and highest value */ - tmp_buf[j] = tmp_buf[j] - (tmp_min_buf[j] + tmp_max_buf[j]); - tmp_buf[j + dev->def->cal_length] = tmp_buf[j + dev->def->cal_length] - - (tmp_min_buf[j + dev->def->cal_length] - + tmp_max_buf[j + dev->def->cal_length]); - tmp_buf[j + 2 * dev->def->cal_length] = tmp_buf[j + 2 * dev->def->cal_length] - - (tmp_min_buf[j + 2 * dev->def->cal_length] - + tmp_max_buf[j + 2 *dev->def->cal_length]); + tmp_buf[j] = tmp_buf[j] - (tmp_min_buf[j] + tmp_max_buf[j]); + tmp_buf[j + dev->def->cal_length] = tmp_buf[j + dev->def->cal_length] + - (tmp_min_buf[j + dev->def->cal_length] + + tmp_max_buf[j + dev->def->cal_length]); + tmp_buf[j + 2 * dev->def->cal_length] = tmp_buf[j + 2 * dev->def->cal_length] + - (tmp_min_buf[j + 2 * dev->def->cal_length] + + tmp_max_buf[j + 2 *dev->def->cal_length]); /* sequence colors first color row one then two and last three */ - if (cal_algo == 1) + if (cal_algo == 1) { tmp_buf[j] = (colsub1_0 * (dev->def->cal_lines - 2)) / tmp_buf[j]; - tmp_buf[j + dev->def->cal_length] = (colsub1_1 * (dev->def->cal_lines - 2)) + tmp_buf[j + dev->def->cal_length] = (colsub1_1 * (dev->def->cal_lines - 2)) / tmp_buf[j + dev->def->cal_length]; - tmp_buf[j + 2 * dev->def->cal_length] = (colsub1_2 * (dev->def->cal_lines - 2)) + tmp_buf[j + 2 * dev->def->cal_length] = (colsub1_2 * (dev->def->cal_lines - 2)) / tmp_buf[j + 2 * dev->def->cal_length]; } - else + else { tmp_buf[j] = colsub0_0 - (tmp_buf[j] / (dev->def->cal_lines - 2)); - tmp_buf[j + dev->def->cal_length] = colsub0_1 - (tmp_buf[j + dev->def->cal_length] + tmp_buf[j + dev->def->cal_length] = colsub0_1 - (tmp_buf[j + dev->def->cal_length] / (dev->def->cal_lines - 2)); - tmp_buf[j + 2 * dev->def->cal_length] = colsub0_2 + tmp_buf[j + 2 * dev->def->cal_length] = colsub0_2 - (tmp_buf[j + 2 * dev->def->cal_length] / (dev->def->cal_lines - 2)); } } @@ -1450,7 +1450,7 @@ teco_do_calibration (Teco_Scanner * dev) { if (cal_algo == 1) tmp_buf[j] = (colsub1_1 * dev->def->cal_lines) / tmp_buf[j]; - else + else tmp_buf[j] = colsub0_1 - (tmp_buf[j] / dev->def->cal_lines); } break; */ @@ -1531,10 +1531,10 @@ teco_request_sense (Teco_Scanner * dev) /* size = 0; */ DBG (DBG_proc, "teco_request_sense: enter\n"); - + size = sizeof (buf); MKSCSI_REQUEST_SENSE (cdb, size); - + /*size = cdb.data[5]; hexdump (DBG_info2, "teco_request_sense", cdb.data, cdb.len); @@ -1545,7 +1545,7 @@ teco_request_sense (Teco_Scanner * dev) NULL, 0, buf, &size); hexdump (DBG_info2, "teco_request_sense:", buf, size); - + DBG (DBG_proc, "teco_request_sense: exit, status=%d\n", status); return (status); @@ -2083,7 +2083,7 @@ teco_init_options (Teco_Scanner * dev) dev->opt[OPT_WHITE_LEVEL_G].constraint_type = SANE_CONSTRAINT_RANGE; dev->opt[OPT_WHITE_LEVEL_G].constraint.range = &green_level_range; dev->val[OPT_WHITE_LEVEL_G].w = 32; /* to get middle value */ - + /* blue level calibration manual correction */ dev->opt[OPT_WHITE_LEVEL_B].name = SANE_NAME_WHITE_LEVEL_B; dev->opt[OPT_WHITE_LEVEL_B].title = SANE_TITLE_WHITE_LEVEL_B; @@ -2093,14 +2093,14 @@ teco_init_options (Teco_Scanner * dev) dev->opt[OPT_WHITE_LEVEL_B].constraint_type = SANE_CONSTRAINT_RANGE; dev->opt[OPT_WHITE_LEVEL_B].constraint.range = &blue_level_range; dev->val[OPT_WHITE_LEVEL_B].w = 32; /* to get middle value */ - + /* Lastly, set the default scan mode. This might change some * values previously set here. */ sane_control_option (dev, OPT_MODE, SANE_ACTION_SET_VALUE, (SANE_String_Const *) scan_mode_list[0], NULL); } -/* +/* * Wait until the scanner is ready. */ static SANE_Status @@ -2136,7 +2136,7 @@ teco_wait_scanner (Teco_Scanner * dev) return (SANE_STATUS_IO_ERROR); } -/* +/* * Adjust the rasters. This function is used during a color scan, * because the scanner does not present a format sane can interpret * directly. @@ -2147,7 +2147,7 @@ teco_wait_scanner (Teco_Scanner * dev) * * The order of the color is dependant on each scanners. Also the same * scanner can change the order depending on the resolution. - * + * * For instance, the VM6586 at 300dpi has a color shift of 2 lines. The rasters sent are: * starts with two blue rasters - BB, * then red in added - BRBR @@ -2156,7 +2156,7 @@ teco_wait_scanner (Teco_Scanner * dev) * and finaly only green stays - GG * * Overall there is the same number of RGB rasters. - * The VM3575 is a variant (when factor_x is 0). It does not keep the same order, + * The VM3575 is a variant (when factor_x is 0). It does not keep the same order, * but reverses it, eg: * BB RBRB GRB... GRGR GG * (ie it adds the new color in front of the previous one, instead of after). @@ -2192,7 +2192,7 @@ teco_adjust_raster (Teco_Scanner * dev, size_t size_in) return; } - /* + /* * The color coding is one line for each color (in the RGB order). * Recombine that stuff to create a RGB value for each pixel. */ @@ -2202,7 +2202,7 @@ teco_adjust_raster (Teco_Scanner * dev, size_t size_in) for (raster = 0; raster < nb_rasters; raster++) { - /* + /* * Find the color and the line which this raster belongs to. */ line = 0; @@ -2365,7 +2365,7 @@ teco_fill_image (Teco_Scanner * dev) /* Copy the complete lines, plus the incompletes * ones. We don't keep the real end of data used - * in image, so we copy the biggest possible. + * in image, so we copy the biggest possible. * * This is a no-op for non color images. */ @@ -2376,7 +2376,7 @@ teco_fill_image (Teco_Scanner * dev) while (dev->real_bytes_left) { - /* + /* * Try to read the maximum number of bytes. */ size = dev->real_bytes_left; @@ -2398,7 +2398,7 @@ teco_fill_image (Teco_Scanner * dev) if (size == 0) { - /* Probably reached the end of the buffer. + /* Probably reached the end of the buffer. * Check, just in case. */ assert (dev->image_end != 0); return (SANE_STATUS_GOOD); @@ -2446,7 +2446,7 @@ teco_fill_image (Teco_Scanner * dev) return (SANE_STATUS_GOOD); /* unreachable */ } -/* Copy from the raw buffer to the buffer given by the backend. +/* Copy from the raw buffer to the buffer given by the backend. * * len in input is the maximum length available in buf, and, in * output, is the length written into buf. diff --git a/backend/teco2.conf.in b/backend/teco2.conf.in index a012e5632..f5db0bb36 100644 --- a/backend/teco2.conf.in +++ b/backend/teco2.conf.in @@ -1,5 +1,5 @@ # VM3564 RELISYS AVEC II S3 scanner -scsi "RELISYS" "AVEC II S3" +scsi "RELISYS" "AVEC II S3" # VM356A Primax Jewel 4800 scanner scsi "Primax" "Jewel" @@ -13,7 +13,7 @@ scsi "RELISYS" "AVEC Super 3" # VM3575 Relisys SCORPIO Super 3 # VM3575 Mustek ScanMagic 4830S # VM6586 Relisys SCORPIO Pro-S -scsi "" "Flatbed Scanner" +scsi "" "Flatbed Scanner" # VM656A Relisys APOLLO Express 6 scsi "RELISYS" "APOLLO Express 6" diff --git a/backend/teco2.h b/backend/teco2.h index 9975f034c..ead45251e 100644 --- a/backend/teco2.h +++ b/backend/teco2.h @@ -39,10 +39,10 @@ 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. + If you do not wish that, delete this exception notice. */ -/* +/* $Id$ */ @@ -307,8 +307,8 @@ enum Teco_Option /*--------------------------------------------------------------------------*/ -/* - * Scanner supported by this backend. +/* + * Scanner supported by this backend. */ struct scanners_supported { @@ -434,7 +434,7 @@ Teco_Scanner; /*--------------------------------------------------------------------------*/ -/* Debug levels. +/* Debug levels. * Should be common to all backends. */ #define DBG_error0 0 diff --git a/backend/teco3.c b/backend/teco3.c index e66d95dec..b58312a65 100644 --- a/backend/teco3.c +++ b/backend/teco3.c @@ -1,44 +1,44 @@ /* sane - Scanner Access Now Easy. Copyright (C) 2002 Frank Zago (sane at zago dot net) - + 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. + If you do not wish that, delete this exception notice. */ /* @@ -629,7 +629,7 @@ get_filled_data_length (Teco_Scanner * dev, size_t * to_read) if (dev->buffer[17] == 0x07) { /* There is no RAM extension present. The colors will - * be shifted and the backend will need to fix that. + * be shifted and the backend will need to fix that. */ dev->does_color_shift = 1; } @@ -1065,7 +1065,7 @@ teco_init_options (Teco_Scanner * dev) (SANE_String_Const *) scan_mode_list[0], NULL); } -/* +/* * Wait until the scanner is ready. */ static SANE_Status @@ -1101,7 +1101,7 @@ teco_wait_scanner (Teco_Scanner * dev) return (SANE_STATUS_IO_ERROR); } -/* +/* * Get the sense */ static SANE_Status @@ -1125,19 +1125,19 @@ teco_query_sense (Teco_Scanner * dev) return (status); } -/* +/* * Adjust the rasters. This function is used during a color scan, * because the scanner does not present a format sane can interpret * directly. * * The scanner sends the colors by rasters (B then G then R), whereas * sane is waiting for a group of 3 bytes per color. To make things - * funnier, the rasters are shifted. The format of those raster is: + * funnier, the rasters are shifted. The format of those raster is: * BGR...BGR * * For a proper scan, the first 2 R and 1 G, and the last 1 G and 2 B * must be ignored. (TODO) - * + * * So this function reorders all that mess. It gets the input from * dev->buffer and write the output in dev->image. size_in the the * length of the valid data in dev->buffer. */ @@ -1169,7 +1169,7 @@ teco_adjust_raster (Teco_Scanner * dev, size_t size_in) return; } - /* + /* * The color coding is one line for each color (in the RGB order). * Recombine that stuff to create a RGB value for each pixel. */ @@ -1179,7 +1179,7 @@ teco_adjust_raster (Teco_Scanner * dev, size_t size_in) for (raster = 0; raster < nb_rasters; raster++) { - /* + /* * Find the color to which this raster belongs to. */ line = 0; @@ -1295,7 +1295,7 @@ teco_fill_image (Teco_Scanner * dev) /* Copy the complete lines, plus the incompletes * ones. We don't keep the real end of data used - * in image, so we copy the biggest possible. + * in image, so we copy the biggest possible. */ if (dev->scan_mode == TECO_COLOR) { @@ -1313,13 +1313,13 @@ teco_fill_image (Teco_Scanner * dev) if (dev->raster_ahead + dev->image_end + dev->params.bytes_per_line > dev->image_size) { - /* Probably reached the end of the buffer. + /* Probably reached the end of the buffer. * Check, just in case. */ assert (dev->image_end != 0); return (SANE_STATUS_GOOD); } - /* + /* * Try to read the maximum number of bytes. */ size = 0; @@ -1346,7 +1346,7 @@ teco_fill_image (Teco_Scanner * dev) if (size == 0) { - /* Probably reached the end of the buffer. + /* Probably reached the end of the buffer. * Check, just in case. */ assert (dev->image_end != 0); return (SANE_STATUS_GOOD); @@ -1401,7 +1401,7 @@ teco_fill_image (Teco_Scanner * dev) return (SANE_STATUS_GOOD); /* unreachable */ } -/* Copy from the raw buffer to the buffer given by the backend. +/* Copy from the raw buffer to the buffer given by the backend. * * len in input is the maximum length available in buf, and, in * output, is the length written into buf. diff --git a/backend/teco3.h b/backend/teco3.h index 64e894db6..4c0e1af95 100644 --- a/backend/teco3.h +++ b/backend/teco3.h @@ -38,10 +38,10 @@ 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. + If you do not wish that, delete this exception notice. */ -/* +/* $Id$ */ @@ -267,8 +267,8 @@ enum Teco_Option /*--------------------------------------------------------------------------*/ -/* - * Scanner supported by this backend. +/* + * Scanner supported by this backend. */ struct scanners_supported { @@ -391,7 +391,7 @@ Teco_Scanner; /*--------------------------------------------------------------------------*/ -/* Debug levels. +/* Debug levels. * Should be common to all backends. */ #define DBG_error0 0 diff --git a/backend/test-picture.c b/backend/test-picture.c index e2d81ce17..46407dcd6 100644 --- a/backend/test-picture.c +++ b/backend/test-picture.c @@ -36,7 +36,7 @@ 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. + If you do not wish that, delete this exception notice. This file implements test picture functions for the test backend. */ diff --git a/backend/test.c b/backend/test.c index 2ca5b3bdb..239dcfa12 100644 --- a/backend/test.c +++ b/backend/test.c @@ -2521,7 +2521,7 @@ sane_start (SANE_Handle handle) { test_device->number_of_scans++; DBG (3, "sane_start: scanning page %d\n", test_device->number_of_scans); - + if ((strcmp (test_device->val[opt_scan_source].s, "Automatic Document Feeder") == 0) && (((test_device->number_of_scans) % 11) == 0)) { diff --git a/backend/u12-ccd.c b/backend/u12-ccd.c index 3f1ad770a..fdbb54e94 100644 --- a/backend/u12-ccd.c +++ b/backend/u12-ccd.c @@ -483,7 +483,7 @@ static void fnCCDInitWolfson3799( U12_Device *dev ) } } -/** +/** */ static void fnCCDInitWolfson548( U12_Device *dev ) { @@ -788,7 +788,7 @@ static void fnDACDarkWolfson( U12_Device *dev, ShadingVarDef *sTbl, if ((short) w < 0) w = 0; - + if( w != (u_short)dev->shade.DarkDAC.bColors[dwCh] ) { dev->shade.DarkDAC.bColors [dwCh] = (SANE_Byte)w; dev->shade.fStop = SANE_FALSE; @@ -926,7 +926,7 @@ static void u12ccd_InitCCDandDAC( U12_Device *dev, SANE_Bool shading ) DBG( _DBG_INFO, "* DAC: Samsung 1224\n" ); switch( dev->CCDID ) { - + case _CCD_3797: DBG( _DBG_INFO, "* CCD-3797\n" ); pDAC_CCD = ShadingVar3797; diff --git a/backend/u12-hw.c b/backend/u12-hw.c index e21c78a7b..fb81ee6c2 100644 --- a/backend/u12-hw.c +++ b/backend/u12-hw.c @@ -216,7 +216,7 @@ static void u12hw_InitiateComponentModel( U12_Device *dev ) dev->regs.RD_MotorDriverType |= _MOTORR_WEAK; /* } */ } - + /** */ static SANE_Status u12hw_InitAsic( U12_Device *dev, SANE_Bool shading ) @@ -259,7 +259,7 @@ static SANE_Status u12hw_InitAsic( U12_Device *dev, SANE_Bool shading ) if( dev->shade.intermediate & _ScanMode_Mono ) dev->regs.RD_Model1Control += _SCAN_GRAYTYPE; - DBG( _DBG_INFO, "* MotorDrvType = 0x%02x\n", dev->regs.RD_MotorDriverType); + DBG( _DBG_INFO, "* MotorDrvType = 0x%02x\n", dev->regs.RD_MotorDriverType); DBG( _DBG_INFO, "* Model1Cntrl = 0x%02x\n", dev->regs.RD_Model1Control ); #if 0 @@ -383,7 +383,7 @@ static void u12hw_SetupPreviewCondition( U12_Device *dev ) dev->scan.dwMaxReadFifo += (dev->DataInf.dwAsicBytesPerPlane / 2); - if( dev->DataInf.wPhyDataType > COLOR_256GRAY ) + if( dev->DataInf.wPhyDataType > COLOR_256GRAY ) dev->scan.bFifoSelect = REG_BFIFOOFFSET; else dev->scan.bFifoSelect = REG_GFIFOOFFSET; @@ -714,7 +714,7 @@ static SANE_Status u12hw_Memtest( U12_Device *dev ) u12io_DataToRegister( dev, REG_WIDTHPIXELHI, 5 ); memset( buf, 0, _TEST_SIZE ); - + dev->regs.RD_ModeControl = _ModeReadMappingMem; u12io_ReadData( dev, buf, _TEST_SIZE ); @@ -793,7 +793,7 @@ static void u12hw_CancelSequence( U12_Device *dev ) { int c = 0; SANE_Byte rb[6]; - + DBG( _DBG_INFO, "u12hw_CancelSequence()\n" ); u12motor_PositionModuleToHome( dev ); @@ -888,7 +888,7 @@ static void usb_LampTimerIrq( int sig ) } else if( tmp & _TPALAMP_ON ) { DBG( _DBG_INFO, "* TPA lamp is ON\n" ); } - + u12io_DataToRegister( dev_xxx, REG_SCANCONTROL, 0 ); u12io_CloseScanPath( dev_xxx ); } diff --git a/backend/u12-hwdef.h b/backend/u12-hwdef.h index ac86cf582..43ea64fb2 100644 --- a/backend/u12-hwdef.h +++ b/backend/u12-hwdef.h @@ -224,7 +224,7 @@ #define _MotorHFullStepH 0x00 #define _MotorHHalfStep 0x04 #define _MotorHQuarterStep 0x08 -#define _MotorPowerEnable 0x40 +#define _MotorPowerEnable 0x40 #define _MotorHHomeStop 0x80 #define _DIR_FW 1 @@ -269,7 +269,7 @@ #define _AGFA_PCB 0x1f /* Register RegModelControl (Addr: 0x1f) */ -#define _HOME_SENSOR_POLARITY 0x01 +#define _HOME_SENSOR_POLARITY 0x01 #define _LED_CONTROL 0x02 #define _LED_ACTIVITY 0x04 #define _MODEL_DPI200 0x00 @@ -393,7 +393,7 @@ #define _DEFAULT_LINESCANTIME 96 -#define _LINE_TIMEOUT (_SECOND * 5 ) +#define _LINE_TIMEOUT (_SECOND * 5 ) /** for mirroring parts of the 98003 ASIC register set @@ -439,7 +439,7 @@ typedef struct svd SANE_Byte Reserved; } ShadingVarDef; -typedef struct +typedef struct { ShadingVarDef *pCcdDac; ColorByte DarkDAC; diff --git a/backend/u12-if.c b/backend/u12-if.c index be213b4a2..91a8c1fde 100644 --- a/backend/u12-if.c +++ b/backend/u12-if.c @@ -68,7 +68,7 @@ typedef struct { #define _PLUSTEK_VENID 0x07B3 #define _KYE_VENID 0x0458 - + /** to allow different vendors... */ static TabDef u12Vendors[] = { @@ -148,7 +148,7 @@ static void u12if_shutdown( U12_Device *dev ) DBG( _DBG_INFO, "Shutdown called (dev->fd=%d, %s)\n", dev->fd, dev->sane.name ); if( SANE_STATUS_GOOD == sanei_usb_open( dev->sane.name, &handle )) { - + dev->fd = handle; u12io_OpenScanPath( dev ); @@ -234,7 +234,7 @@ static SANE_Bool usbDev_autodetect( SANE_Word *vendor, SANE_Word *product ) { int i; SANE_Word p, v; - + DBG( _DBG_INFO, "Autodetection...\n" ); for( i = 0; NULL != u12Devices[i].name; i++ ) { @@ -310,7 +310,7 @@ static int u12if_open( U12_Device *dev ) */ free( dev->name ); dev->name = strdup( USB_devname ); - dev->sane.name = dev->name; + dev->sane.name = dev->name; } else { @@ -329,7 +329,7 @@ static int u12if_open( U12_Device *dev ) DBG(_DBG_INFO,"Vendor ID=0x%04X, Product ID=0x%04X\n",vendor,product); if( dev->usbId[0] != '\0' ) { - + if( 0 != strcmp( dev->usbId, devStr )) { DBG( _DBG_ERROR, "Specified Vendor and Product ID " "doesn't match with the ones\n" @@ -340,7 +340,7 @@ static int u12if_open( U12_Device *dev ) } else { sprintf( dev->usbId, "0x%04X-0x%04X", vendor, product ); was_empty = SANE_TRUE; - } + } } else { @@ -397,7 +397,7 @@ static int u12if_open( U12_Device *dev ) if( dev->Tpa ) dev->sane.model = "UT12"; } - + dev->initialized = SANE_TRUE; return handle; } @@ -413,7 +413,7 @@ static int u12if_close( U12_Device *dev ) return 0; } -/** +/** */ static SANE_Status u12if_getCaps( U12_Device *dev ) { @@ -459,7 +459,7 @@ static SANE_Status u12if_getCaps( U12_Device *dev ) dev->res_list_size++; dev->res_list[dev->res_list_size - 1] = (SANE_Int)cntr; } - + return SANE_STATUS_GOOD; } @@ -500,7 +500,7 @@ static SANE_Status u12if_stopScan( U12_Device *dev ) static SANE_Status u12if_prepare( U12_Device *dev ) { SANE_Status res; - + DBG( _DBG_INFO, "u12if_prepare()\n" ); u12motor_ToHomePosition( dev, SANE_TRUE ); @@ -514,11 +514,11 @@ static SANE_Status u12if_prepare( U12_Device *dev ) return res; u12image_PrepareScaling( dev ); - + u12motor_ForceToLeaveHomePos( dev ); if( dev->DataInf.dwScanFlag & _SCANDEF_PREVIEW ) u12hw_SetupPreviewCondition( dev ); - else + else u12hw_SetupScanningCondition( dev ); res = u12motor_WaitForPositionY( dev ); diff --git a/backend/u12-image.c b/backend/u12-image.c index 1d9acda66..df721db4f 100644 --- a/backend/u12-image.c +++ b/backend/u12-image.c @@ -217,7 +217,7 @@ static void fnColor42( U12_Device *dev, void *pb, void *img, u_long len ) { u_short *src; RGBUShortDef *dest; - + register u_long i; _VAR_NOT_USED( len ); @@ -317,7 +317,7 @@ u12image_GetPhysDPI( U12_Device *dev, ImgDef *img, SANE_Bool fDpiX ) return img->xyDpi.x; } else { - + if( img->xyDpi.y > dev->dpi_max_y ) return dev->dpi_max_y; else @@ -374,7 +374,7 @@ static void u12image_GetImageInfo( U12_Device *dev, ImgDef *image ) switch( image->wDataType ) { - case COLOR_BW: + case COLOR_BW: dev->scan.DataProcess = fnDataDirect; dev->DataInf.wPhyDataType = COLOR_BW; dev->shade.intermediate = _ScanMode_Mono; @@ -407,7 +407,7 @@ static void u12image_GetImageInfo( U12_Device *dev, ImgDef *image ) /* raus mit einem von beiden!!!!*/ dev->DataInf.dwAppBytesPerLine = dev->DataInf.dwAppPhyBytesPerLine; - + DBG( _DBG_INFO, "AppLinesPerArea = %lu\n", dev->DataInf.dwAppLinesPerArea ); DBG( _DBG_INFO, "AppPixelsPerLine = %lu\n", dev->DataInf.dwAppPixelsPerLine ); DBG( _DBG_INFO, "AppPhyBytesPerLine = %lu\n", dev->DataInf.dwAppPhyBytesPerLine ); @@ -418,7 +418,7 @@ static void u12image_GetImageInfo( U12_Device *dev, ImgDef *image ) DBG( _DBG_INFO, "Physical Bytes = %lu\n", dev->DataInf.dwPhysBytesPerLine ); } -/** +/** */ static int imageSetupScanSettings( U12_Device *dev, ImgDef *img ) { @@ -483,7 +483,7 @@ static SANE_Status u12image_SetupScanSettings( U12_Device *dev, ImgDef *img ) wPreviewScanned = 0; dev->scan.dpiIdx = 0; dev->scan.negScan = negScan; - + imageSetupScanSettings( dev, img ); if( !(dev->DataInf.dwScanFlag & _SCANDEF_TPA )) { @@ -816,7 +816,7 @@ static void u12image_PrepareScaling( U12_Device *dev ) dev->DataInf.xyAppDpi.x, dev->dpi_max_x ); if( dev->DataInf.xyAppDpi.x > dev->dpi_max_x ) { - + dev->scaleBuf = malloc( dev->DataInf.dwAppBytesPerLine ); ratio = (double)dev->DataInf.xyAppDpi.x/(double)dev->dpi_max_x; @@ -837,7 +837,7 @@ static void u12image_PrepareScaling( U12_Device *dev ) } else { DBG( _DBG_INFO, "u12image_PrepareScaling: DISABLED\n" ); - } + } } /** scaling picture data in x-direction, using a DDA algorithm diff --git a/backend/u12-io.c b/backend/u12-io.c index cd65b72fc..3c5bcb8f6 100644 --- a/backend/u12-io.c +++ b/backend/u12-io.c @@ -182,7 +182,7 @@ gl640WriteControl(int fd, GL640_Request req, u_char * data, unsigned int size) /* ind */ 0, /* len */ size, /* dat */ data); - + if( status != SANE_STATUS_GOOD ) { DBG( _DBG_ERROR, "gl640WriteControl error\n"); } @@ -507,7 +507,7 @@ static SANE_Status u12io_DataToRegs( U12_Device *dev, SANE_Byte *buf, int len ) return SANE_STATUS_GOOD; } -/** write data to the DAC +/** write data to the DAC */ static void u12io_DataRegisterToDAC( U12_Device *dev, SANE_Byte reg, SANE_Byte val ) @@ -619,7 +619,7 @@ static SANE_Bool u12io_IsConnected( U12_Device *dev ) dev->mode = mode ; } return SANE_FALSE; - } + } u12io_SwitchToEPPMode( dev ); DBG( _DBG_INFO, "* Scanner is connected!\n" ); @@ -693,7 +693,7 @@ static SANE_Status u12io_DownloadScanStates( U12_Device *dev ) dev->scanStates, _SCANSTATE_BYTES )); bulk_setup_data[1] = 0x11; -/* FIXME: refreshState probably always FALSE */ +/* FIXME: refreshState probably always FALSE */ if( dev->scan.refreshState ) { u12io_RegisterToScanner( dev, REG_REFRESHSCANSTATE ); @@ -724,7 +724,7 @@ static void u12io_PutOnAllRegisters( U12_Device *dev ) c = 0; rb = buf; - + *(rb++) = REG_MODECONTROL; *(rb++) = dev->regs.RD_ModeControl; c++; @@ -780,7 +780,7 @@ static u_long u12io_GetFifoLength( U12_Device *dev ) DBG( _DBG_READ, "Using cached FIFO len\n" ); memcpy( data, cacheLen, 13 ); u12io_ResetFifoLen(); - + } else { memset( bulk_setup_data, 0, 8 ); diff --git a/backend/u12-motor.c b/backend/u12-motor.c index c3d512081..f44f3667e 100644 --- a/backend/u12-motor.c +++ b/backend/u12-motor.c @@ -91,7 +91,7 @@ static void u12motor_Force16Steps( U12_Device *dev, int dir ) static void u12motor_ModuleFreeRun( U12_Device *dev, u_long steps ) { SANE_Byte rb[6]; - + rb[0] = REG_MOTORFREERUNCOUNT1; rb[1] = _HIBYTE(steps); rb[2] = REG_MOTORFREERUNCOUNT0; rb[3] = _LOBYTE(steps); rb[4] = REG_MOTORFREERUNTRIGGER; rb[5] = 0; @@ -124,7 +124,7 @@ static SANE_Status u12motor_PositionYProc( U12_Device *dev, u_long steps ) if( u12io_IsEscPressed()) { DBG( _DBG_INFO, "* CANCEL detected!\n" ); return SANE_STATUS_CANCELLED; - } + } } while( !u12io_CheckTimer( &timer )); DBG( _DBG_INFO, "u12motor_PositionYProc() - done\n" ); @@ -289,7 +289,7 @@ static SANE_Status u12motor_ModuleToHome( U12_Device *dev ) res = u12motor_PositionYProc( dev, 40 ); if( SANE_STATUS_GOOD != res ) return res; - + res = u12motor_BackToHomeSensor( dev ); if( SANE_STATUS_GOOD != res ) return res; @@ -425,7 +425,7 @@ static SANE_Status u12motor_GotoShadingPosition( U12_Device *dev ) SANE_Byte rb[20]; SANE_Status res; int c; - + DBG( _DBG_INFO, "u12motor_GotoShadingPosition()\n" ); res = u12motor_ModuleToHome( dev ); if( SANE_STATUS_GOOD == res ) diff --git a/backend/u12-scanner.h b/backend/u12-scanner.h index be0c200cb..c2e9cc84b 100644 --- a/backend/u12-scanner.h +++ b/backend/u12-scanner.h @@ -61,7 +61,7 @@ typedef double TimerDef; #define _DODELAY(msecs) u12io_udelay(1000*msecs) /*{ int i; for( i = msecs; i--; ) _DO_UDELAY(1000); }*/ #else -#define _DODELAY(msecs) +#define _DODELAY(msecs) #endif /* ModuleStates */ diff --git a/backend/u12-shading.c b/backend/u12-shading.c index e31c7ee4f..76cc69059 100644 --- a/backend/u12-shading.c +++ b/backend/u12-shading.c @@ -795,7 +795,7 @@ static SANE_Status u12shading_DoCalibration( U12_Device *dev ) SANE_Byte bScanControl, rb[20]; SANE_Status res; int c; - + DBG( _DBG_INFO, "u12shading_DoCalibration()\n" ); /** before getting the shading data, (re)init the ASIC @@ -847,7 +847,7 @@ static SANE_Status u12shading_DoCalibration( U12_Device *dev ) res = u12shading_AdjustRGBGain( dev ); if( SANE_STATUS_GOOD != res ) return res; - + res = u12shadingAdjustDark( dev ); if( SANE_STATUS_GOOD != res ) return res; diff --git a/backend/u12.c b/backend/u12.c index 083d9f3e6..839ad3191 100644 --- a/backend/u12.c +++ b/backend/u12.c @@ -307,7 +307,7 @@ static int reader_process( void *args ) struct SIGACTION act; sigset_t ignore_set; SANE_Status status; - + U12_Scanner *scanner = (U12_Scanner *)args; if( sanei_thread_is_forked()) { @@ -348,11 +348,11 @@ static int reader_process( void *args ) DBG( _DBG_FATAL, "NULL Pointer !!!!\n" ); return SANE_STATUS_IO_ERROR; } - + /* here we read all data from the scanner... */ buf = scanner->buf; status = u12if_prepare( scanner->hw ); - + if( SANE_STATUS_GOOD == status ) { for( line = 0; line < scanner->params.lines; line++ ) { @@ -413,7 +413,7 @@ static SANE_Status do_cancel( U12_Scanner *scanner, SANE_Bool closepipe ) if( res != scanner->reader_pid ) { DBG( _DBG_PROC,"sanei_thread_waitpid() failed !\n"); - + /* do it the hard way...*/ #ifdef USE_PTHREAD sanei_thread_kill( scanner->reader_pid ); @@ -589,12 +589,12 @@ static SANE_Status init_options( U12_Scanner *s ) s->val[OPT_BR_Y].w = SANE_FIX(_DEFAULT_BRY); /* "Enhancement" group: */ - s->opt[OPT_ENHANCEMENT_GROUP].title = SANE_I18N("Enhancement"); + s->opt[OPT_ENHANCEMENT_GROUP].title = SANE_I18N("Enhancement"); s->opt[OPT_ENHANCEMENT_GROUP].desc = ""; s->opt[OPT_ENHANCEMENT_GROUP].type = SANE_TYPE_GROUP; s->opt[OPT_ENHANCEMENT_GROUP].cap = 0; s->opt[OPT_ENHANCEMENT_GROUP].constraint_type = SANE_CONSTRAINT_NONE; - + u12map_InitGammaSettings( s->hw ); /* grayscale gamma vector */ @@ -641,7 +641,7 @@ static SANE_Status init_options( U12_Scanner *s ) s->opt[OPT_GAMMA_VECTOR_B].constraint.range = &(s->hw->gamma_range); s->opt[OPT_GAMMA_VECTOR_B].size = s->hw->gamma_length * sizeof(SANE_Word); - /* GAMMA stuff is disabled per default */ + /* GAMMA stuff is disabled per default */ s->opt[OPT_GAMMA_VECTOR].cap |= SANE_CAP_INACTIVE; s->opt[OPT_GAMMA_VECTOR_R].cap |= SANE_CAP_INACTIVE; s->opt[OPT_GAMMA_VECTOR_G].cap |= SANE_CAP_INACTIVE; @@ -661,8 +661,8 @@ static SANE_Status init_options( U12_Scanner *s ) * @param dest - pointer to a string to receive the USB ID */ static void decodeUsbIDs( char *src, char **dest ) -{ - const char *name; +{ + const char *name; char *tmp = *dest; int len = strlen(_SECTION); @@ -677,11 +677,11 @@ static void decodeUsbIDs( char *src, char **dest ) if( '\0' == name[0] ) { DBG( _DBG_SANE_INIT, "next device uses autodetection\n" ); } else { - + u_short pi = 0, vi = 0; if( *name ) { - + name = sanei_config_get_string( name, &tmp ); if( tmp ) { vi = strtol( tmp, 0, 0 ); @@ -691,7 +691,7 @@ static void decodeUsbIDs( char *src, char **dest ) name = sanei_config_skip_whitespace( name ); if( *name ) { - + name = sanei_config_get_string( name, &tmp ); if( tmp ) { pi = strtol( tmp, 0, 0 ); @@ -733,14 +733,14 @@ static SANE_Bool decodeVal( char *src, char *opt, /* on success, compare wiht the given one */ if( 0 == strcmp( tmp, opt )) { - + DBG( _DBG_SANE_INIT, "Decoding option >%s<\n", opt ); if( _INT == what ) { - + /* assign the default value for this option... */ *((int*)result) = *((int*)def); - + if( *name ) { /* get the configuration value and decode it */ @@ -751,14 +751,14 @@ static SANE_Bool decodeVal( char *src, char *opt, free( tmp2 ); } } - free( tmp ); + free( tmp ); return SANE_TRUE; - + } else if( _FLOAT == what ) { - + /* assign the default value for this option... */ *((double*)result) = *((double*)def); - + if( *name ) { /* get the configuration value and decode it */ @@ -769,13 +769,13 @@ static SANE_Bool decodeVal( char *src, char *opt, free( tmp2 ); } } - free( tmp ); + free( tmp ); return SANE_TRUE; } - } + } free( tmp ); } - + return SANE_FALSE; } @@ -788,27 +788,27 @@ static SANE_Bool decodeVal( char *src, char *opt, */ static SANE_Bool decodeDevName( char *src, char *dest ) { - char *tmp; + char *tmp; const char *name; if( 0 == strncmp( "device", src, 6 )) { name = (const char*)&src[strlen("device")]; name = sanei_config_skip_whitespace( name ); - + DBG( _DBG_SANE_INIT, "Decoding device name >%s<\n", name ); - + if( *name ) { name = sanei_config_get_string( name, &tmp ); if( tmp ) { - + strcpy( dest, tmp ); free( tmp ); return SANE_TRUE; } - } + } } - + return SANE_FALSE; } @@ -842,7 +842,7 @@ static SANE_Status attach( const char *dev_name, /* assign all the stuff we need fo this device... */ memset(dev, 0, sizeof (*dev)); - + dev->fd = -1; dev->name = strdup(dev_name); /* hold it double to avoid */ dev->sane.name = dev->name; /* compiler warnings */ @@ -855,7 +855,7 @@ static SANE_Status attach( const char *dev_name, show_cnf( cnf ); strncpy( dev->usbId, cnf->usbId, _MAX_ID_LEN ); - + /* go ahead and open the scanner device */ handle = u12if_open( dev ); if( handle < 0 ) { @@ -939,7 +939,7 @@ SANE_Status sane_init( SANE_Int *version_code, SANE_Auth_Callback authorize ) first_handle = NULL; num_devices = 0; - /* initialize the configuration structure */ + /* initialize the configuration structure */ init_config_struct( &config ); if( version_code != NULL ) @@ -953,26 +953,26 @@ SANE_Status sane_init( SANE_Int *version_code, SANE_Auth_Callback authorize ) } while( sanei_config_read( str, sizeof(str), fp)) { - + DBG( _DBG_SANE_INIT, ">%s<\n", str ); if( str[0] == '#') /* ignore line comments */ continue; - + len = strlen(str); if( 0 == len ) continue; /* ignore empty lines */ /* check for options */ if( 0 == strncmp(str, "option", 6)) { - + int ival; double dval; - + ival = -1; decodeVal( str, "warmup", _INT, &config.adj.warmup, &ival); decodeVal( str, "lampOff", _INT, &config.adj.lampOff, &ival); decodeVal( str, "lOffOnEnd", _INT, &config.adj.lampOffOnEnd,&ival); - + ival = 0; dval = 1.5; @@ -984,9 +984,9 @@ SANE_Status sane_init( SANE_Int *version_code, SANE_Auth_Callback authorize ) /* check for sections: */ } else if( 0 == strncmp( str, _SECTION, strlen(_SECTION))) { - + char *tmp; - + /* new section, try and attach previous device */ if( config.devName[0] != '\0' ) { attach( config.devName, &config, 0 ); @@ -996,20 +996,20 @@ SANE_Status sane_init( SANE_Int *version_code, SANE_Auth_Callback authorize ) " ignored!\n" ); } } - + /* re-initialize the configuration structure */ init_config_struct( &config ); - + tmp = config.usbId; decodeUsbIDs( str, &tmp ); - + DBG( _DBG_SANE_INIT, "... next device\n" ); - continue; + continue; } else if( SANE_TRUE == decodeDevName( str, config.devName )) { continue; } - + /* ignore other stuff... */ DBG( _DBG_SANE_INIT, "ignoring >%s<\n", str ); } @@ -1107,7 +1107,7 @@ SANE_Status sane_open( SANE_String_Const devicename, SANE_Handle* handle ) if( !dev ) { memset( &config, 0, sizeof(CnfDef)); - + status = attach( devicename, &config, &dev ); if( SANE_STATUS_GOOD != status ) return status; @@ -1137,7 +1137,7 @@ SANE_Status sane_open( SANE_String_Const devicename, SANE_Handle* handle ) first_handle = s; *handle = s; - + return SANE_STATUS_GOOD; } @@ -1201,7 +1201,7 @@ SANE_Status sane_control_option( SANE_Handle handle, SANE_Int option, int idx; #endif int scanmode; - + if ( s->scanning ) return SANE_STATUS_DEVICE_BUSY; @@ -1306,7 +1306,7 @@ SANE_Status sane_control_option( SANE_Handle handle, SANE_Int option, if( NULL != info ) *info |= SANE_INFO_RELOAD_PARAMS; break; - + case OPT_CUSTOM_GAMMA: s->val[option].w = *(SANE_Word *)value; if( NULL != info ) @@ -1325,26 +1325,26 @@ SANE_Status sane_control_option( SANE_Handle handle, SANE_Int option, s->opt[OPT_GAMMA_VECTOR_B].cap |= SANE_CAP_INACTIVE; if( SANE_TRUE == s->val[option].w ) { - + if( scanmode == COLOR_256GRAY ) { s->opt[OPT_GAMMA_VECTOR].cap &= ~SANE_CAP_INACTIVE; } else { s->opt[OPT_GAMMA_VECTOR_R].cap &= ~SANE_CAP_INACTIVE; s->opt[OPT_GAMMA_VECTOR_G].cap &= ~SANE_CAP_INACTIVE; s->opt[OPT_GAMMA_VECTOR_B].cap &= ~SANE_CAP_INACTIVE; - } - + } + } else { - + u12map_InitGammaSettings( s->hw ); - + if( scanmode == COLOR_256GRAY ) { s->opt[OPT_GAMMA_VECTOR].cap |= SANE_CAP_INACTIVE; - } else { + } else { s->opt[OPT_GAMMA_VECTOR_R].cap |= SANE_CAP_INACTIVE; s->opt[OPT_GAMMA_VECTOR_G].cap |= SANE_CAP_INACTIVE; s->opt[OPT_GAMMA_VECTOR_B].cap |= SANE_CAP_INACTIVE; - } + } } break; @@ -1355,26 +1355,26 @@ SANE_Status sane_control_option( SANE_Handle handle, SANE_Int option, break; #ifdef ALL_MODES - case OPT_MODE: + case OPT_MODE: idx = (optval - mode_list); mp = getModeList( s ); - + s->opt[OPT_CONTRAST].cap &= ~SANE_CAP_INACTIVE; s->opt[OPT_CUSTOM_GAMMA].cap &= ~SANE_CAP_INACTIVE; if( mp[idx].scanmode == COLOR_BW ) { s->opt[OPT_CONTRAST].cap |= SANE_CAP_INACTIVE; s->opt[OPT_CUSTOM_GAMMA].cap |= SANE_CAP_INACTIVE; - } - + } + s->opt[OPT_GAMMA_VECTOR].cap |= SANE_CAP_INACTIVE; s->opt[OPT_GAMMA_VECTOR_R].cap |= SANE_CAP_INACTIVE; s->opt[OPT_GAMMA_VECTOR_G].cap |= SANE_CAP_INACTIVE; s->opt[OPT_GAMMA_VECTOR_B].cap |= SANE_CAP_INACTIVE; - + if( s->val[OPT_CUSTOM_GAMMA].w && !(s->opt[OPT_CUSTOM_GAMMA].cap & SANE_CAP_INACTIVE)) { - + if( mp[idx].scanmode == COLOR_256GRAY ) { s->opt[OPT_GAMMA_VECTOR].cap &= ~SANE_CAP_INACTIVE; } else { @@ -1595,7 +1595,7 @@ SANE_Status sane_start( SANE_Handle handle ) u12if_close( dev ); return SANE_STATUS_IO_ERROR; } - + /* All ready to go. Set image def and see what the scanner * says for crop info. */ @@ -1728,9 +1728,9 @@ SANE_Status sane_start( SANE_Handle handle ) s->r_pipe = fds[0]; s->w_pipe = fds[1]; s->reader_pid = sanei_thread_begin( reader_process, s ); - + cancelRead = SANE_FALSE; - + if( !sanei_thread_is_valid (s->reader_pid) ) { DBG( _DBG_ERROR, "ERROR: could not start reader task\n" ); s->scanning = SANE_FALSE; @@ -1743,7 +1743,7 @@ SANE_Status sane_start( SANE_Handle handle ) close( s->w_pipe ); s->w_pipe = -1; } - + DBG( _DBG_SANE_INIT, "sane_start done\n" ); return SANE_STATUS_GOOD; } @@ -1837,7 +1837,7 @@ SANE_Status sane_set_io_mode( SANE_Handle handle, SANE_Bool non_blocking ) DBG( _DBG_ERROR, "ERROR: not supported !\n" ); return SANE_STATUS_UNSUPPORTED; } - + if( fcntl (s->r_pipe, F_SETFL, non_blocking ? O_NONBLOCK : 0) < 0) { DBG( _DBG_ERROR, "ERROR: can´t set to non-blocking mode !\n" ); return SANE_STATUS_IO_ERROR; diff --git a/backend/u12.conf.in b/backend/u12.conf.in index c5457cb40..baeea7979 100644 --- a/backend/u12.conf.in +++ b/backend/u12.conf.in @@ -63,5 +63,5 @@ device auto # # to define a new device, start with a new section: -# [usb] +# [usb] # diff --git a/backend/u12.h b/backend/u12.h index 5d18c967e..41b19b954 100644 --- a/backend/u12.h +++ b/backend/u12.h @@ -72,7 +72,7 @@ typedef union #define _MEASURE_BASE 300UL #define _DEF_DPI 50 -/** the default image +/** the default image */ #define _DEFAULT_TLX 0 #define _DEFAULT_TLY 0 @@ -184,7 +184,7 @@ typedef struct { double graygamma; /* for adjusting scan-area */ - long upNormal; + long upNormal; long upPositive; long upNegative; long leftNormal; @@ -240,7 +240,7 @@ typedef struct u12d SANE_Int res_list_size; /* resolution values */ ScannerCaps caps; /* caps reported by the driver */ AdjDef adj; /* for driver adjustment */ - + char usbId[_MAX_ID_LEN];/* to keep Vendor and product */ /* ID string (from conf) file */ /* our gamma tables */ @@ -322,7 +322,7 @@ typedef struct u12s /** for collecting configuration info... */ typedef struct { - + char devName[PATH_MAX]; char usbId[_MAX_ID_LEN]; diff --git a/backend/umax-scanner.c b/backend/umax-scanner.c index 21f24ced9..8c1309c00 100644 --- a/backend/umax-scanner.c +++ b/backend/umax-scanner.c @@ -1,7 +1,7 @@ /* -------------------------------------------------------------------- */ /* umax-scanner.c: scanner-definiton file for UMAX scanner driver. - + (C) 1997-2004 Oliver Rauch This program is free software; you can redistribute it and/or @@ -39,7 +39,7 @@ 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. - + */ /* -------------------------------------------------------------------- */ @@ -95,9 +95,9 @@ static char *scanner_str[] = "UMAX ", "Astra 600S ", "UMAX ", "Astra 610S ", "UMAX ", "Astra 1200S ", - "UMAX ", "Astra 1220S ", - "UMAX ", "Astra 2100S ", - "UMAX ", "Astra 2200 ", + "UMAX ", "Astra 1220S ", + "UMAX ", "Astra 2100S ", + "UMAX ", "Astra 2200 ", "UMAX ", "Astra 2400S ", /* "UMAX ", "Astra 6400 ", */ /* this is a firewire scanner */ /* "UMAX ", "Astra 6450 ", */ /* this is a firewire scanner */ @@ -124,8 +124,8 @@ static char *scanner_str[] = "HDM ", "LS4H1S ", /* Linoscan 1400 */ "Nikon ", "AX-110 ", /* is a Vista S6E */ "Nikon ", "AX-210 ", /* is a Supervista S12 */ - "KYE ", "ColorPage-HR5 ", - "EPSON ", "Perfection600 ", + "KYE ", "ColorPage-HR5 ", + "EPSON ", "Perfection600 ", "ESCORT ", "Galleria 600S ", /* is an Astra 600S */ "EDGE ", "KTX-9600US ", /* may be an Astra 1220S */ "TriGem ", "PowerScanII ", /* is a Supervista S12 */ diff --git a/backend/umax-scanner.h b/backend/umax-scanner.h index 6c9a93a8a..953cadc0c 100644 --- a/backend/umax-scanner.h +++ b/backend/umax-scanner.h @@ -1,7 +1,7 @@ /* -------------------------------------------------------------------- */ /* umax-scanner.h: scanner-definiton header-file for UMAX scanner driver. - + (C) 1997-2002 Oliver Rauch This program is free software; you can redistribute it and/or @@ -39,7 +39,7 @@ 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. - + */ /* -------------------------------------------------------------------- */ diff --git a/backend/umax-scsidef.h b/backend/umax-scsidef.h index f192e2cb7..ddb04bb20 100644 --- a/backend/umax-scsidef.h +++ b/backend/umax-scsidef.h @@ -287,9 +287,9 @@ static scsiblk inquiry = { inquiryC, sizeof(inquiryC) }; #define get_inquiry_0x65(in) in[0x65] #define get_inquiry_gib(in) in[0x66] -#define get_inquiry_gib_8bpp(in) getbitfield(in + 0x66, 1, 0) +#define get_inquiry_gib_8bpp(in) getbitfield(in + 0x66, 1, 0) #define get_inquiry_gib_9bpp(in) getbitfield(in + 0x66, 1, 1) -#define get_inquiry_gib_10bpp(in) getbitfield(in + 0x66, 1, 2) +#define get_inquiry_gib_10bpp(in) getbitfield(in + 0x66, 1, 2) #define get_inquiry_gib_12bpp(in) getbitfield(in + 0x66, 1, 3) #define get_inquiry_gib_14bpp(in) getbitfield(in + 0x66, 1, 4) #define get_inquiry_gib_16bpp(in) getbitfield(in + 0x66, 1, 5) @@ -301,9 +301,9 @@ static scsiblk inquiry = { inquiryC, sizeof(inquiryC) }; #define get_inquiry_0x67(in) in[0x67] #define get_inquiry_gob(in) in[0x68] -#define get_inquiry_gob_8bpp(in) getbitfield(in + 0x68, 1, 0) +#define get_inquiry_gob_8bpp(in) getbitfield(in + 0x68, 1, 0) #define get_inquiry_gob_9bpp(in) getbitfield(in + 0x68, 1, 1) -#define get_inquiry_gob_10bpp(in) getbitfield(in + 0x68, 1, 2) +#define get_inquiry_gob_10bpp(in) getbitfield(in + 0x68, 1, 2) #define get_inquiry_gob_12bpp(in) getbitfield(in + 0x68, 1, 3) #define get_inquiry_gob_14bpp(in) getbitfield(in + 0x68, 1, 4) #define get_inquiry_gob_16bpp(in) getbitfield(in + 0x68, 1, 5) @@ -653,7 +653,7 @@ static unsigned char window_descriptor_blockC[] = # define WD_calibration_lineart 0x0f # define WD_calibration_dither 0x0e # define WD_calibration_gray 0x0d -# define WD_calibration_rgb 0x0a +# define WD_calibration_rgb 0x0a # define WD_calibration_ignore 0x09 /* 0x3a */ 0x01, /* Color Sequence, Color Ordering Support */ @@ -722,7 +722,7 @@ static scsiblk window_descriptor_block = { window_descriptor_blockC, sizeof(wind /* --------------------------------------------------------------------------------------------------------- */ - + #define set_WDB_length(length) (window_descriptor_block.size = (length)) #define WPDB_OFF(b) (b + set_window.size) @@ -744,7 +744,7 @@ static scsiblk scan = { scanC, sizeof(scanC) - 3 }; #define set_SC_quality(sb, val) setbitfield(sb + 0x05, 1, 5, val) #define set_SC_adf(sb, val) setbitfield(sb + 0x05, 1, 6, val) #define set_SC_preview(sb, val) setbitfield(sb + 0x05, 1, 7, val) -#define set_SC_wid(sb, n, val) sb[0x05 + n] = val +#define set_SC_wid(sb, n, val) sb[0x05 + n] = val /* --------------------------------------------------------------------------------------------------------- */ @@ -907,12 +907,12 @@ static scsiblk request_sense = { request_senseC, sizeof(request_senseC) }; #define get_RS_filemark(b) getbitfield(b + 0x02, 1, 7) #define get_RS_EOM(b) getbitfield(b + 0x02, 1, 6) #define get_RS_ILI(b) getbitfield(b + 0x02, 1, 5) -#define get_RS_sense_key(b) getbitfield(b + 0x02, 0x0f, 0) -#define get_RS_information(b) getnbyte(b+0x03, 4) +#define get_RS_sense_key(b) getbitfield(b + 0x02, 0x0f, 0) +#define get_RS_information(b) getnbyte(b+0x03, 4) #define get_RS_additional_length(b) b[0x07] #define get_RS_ASC(b) b[0x0c] #define get_RS_ASCQ(b) b[0x0d] -#define get_RS_SKSV(b) getbitfield(b+0x0f,1,7) /* valid */ +#define get_RS_SKSV(b) getbitfield(b+0x0f,1,7) /* valid */ #define get_RS_CD(b) getbitfield(b+0x0f,1,6) /* 1=CDB */ #define get_RS_field_pointer(b) getnbyte(b+0x10, 2) diff --git a/backend/umax-uc1200s.c b/backend/umax-uc1200s.c index 97e54164f..5569a2bd2 100644 --- a/backend/umax-uc1200s.c +++ b/backend/umax-uc1200s.c @@ -2,7 +2,7 @@ /* ------------------------------------------------------------------------- */ /* umax-uc1200s.c: inquiry for UMAX scanner uc1200s - + (C) 1997-2002 Oliver Rauch This program is free software; you can redistribute it and/or @@ -59,13 +59,13 @@ static unsigned char UC1200S_INQUIRY[] = /* 28 - 29 reserved */ 0x00, 0x00, -/* 2a - 35 exposure times */ +/* 2a - 35 exposure times */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 36 - 37 reserved */ +/* 36 - 37 reserved */ 0x00, 0x00, /* 38 - 5f scsi reserved */ @@ -78,7 +78,7 @@ static unsigned char UC1200S_INQUIRY[] = /* 60 -62 scanner capability*/ 0x2f, 0x0c, - 0x07, + 0x07, /* 63 reserved */ 0x00, @@ -151,7 +151,7 @@ static unsigned char UC1200S_INQUIRY[] = /* 8a-8b dor max scan width in 0.01 inch */ 0x00, 0x00, - + /* 8c-8d dor max scan length in 0.01 inch */ 0x00, 0x00, diff --git a/backend/umax-uc1200se.c b/backend/umax-uc1200se.c index defe65a65..f1e8e31ba 100644 --- a/backend/umax-uc1200se.c +++ b/backend/umax-uc1200se.c @@ -2,7 +2,7 @@ /* ------------------------------------------------------------------------- */ /* umax-uc1200se.c: inquiry for UMAX scanner uc1200se - + (C) 1998-2002 Oliver Rauch This program is free software; you can redistribute it and/or @@ -59,13 +59,13 @@ static unsigned char UC1200SE_INQUIRY[] = /* 28 - 29 reserved */ 0x00, 0x00, -/* 2a - 35 exposure times */ +/* 2a - 35 exposure times */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 36 - 37 reserved */ +/* 36 - 37 reserved */ 0x00, 0x00, /* 38 - 5f scsi reserved */ @@ -78,7 +78,7 @@ static unsigned char UC1200SE_INQUIRY[] = /* 60 -62 scanner capability*/ 0x3e, 0x0c, - 0x03, + 0x03, /* 63 reserved */ 0x00, @@ -151,7 +151,7 @@ static unsigned char UC1200SE_INQUIRY[] = /* 8a-8b dor max scan width in 0.01 inch */ 0x00, 0x00, - + /* 8c-8d dor max scan length in 0.01 inch */ 0x00, 0x00, diff --git a/backend/umax-uc1260.c b/backend/umax-uc1260.c index 7743cd4a2..4de917051 100644 --- a/backend/umax-uc1260.c +++ b/backend/umax-uc1260.c @@ -1,7 +1,7 @@ /* ------------------------------------------------------------------------- */ /* umax-uc1260.c: inquiry for UMAX scanner uc1260 - + (C) 1997-2002 Oliver Rauch This program is free software; you can redistribute it and/or @@ -58,13 +58,13 @@ static unsigned char UC1260_INQUIRY[] = /* 28 - 29 reserved */ 0x00, 0x00, -/* 2a - 35 exposure times */ +/* 2a - 35 exposure times */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 36 - 37 reserved */ +/* 36 - 37 reserved */ 0x00, 0x00, /* 38 - 5f scsi reserved */ @@ -75,9 +75,9 @@ static unsigned char UC1260_INQUIRY[] = 00, 00, 00, 00, 00, 00, 00, 00, /* 60 -62 scanner capability*/ - 0x31, + 0x31, 0x0c, - 0x07, + 0x07, /* 63 reserved */ 0x00, @@ -151,7 +151,7 @@ static unsigned char UC1260_INQUIRY[] = /* 8a-8b dor max scan width in 0.01 inch */ 0x00, 0x00, - + /* 8c-8d dor max scan length in 0.01 inch */ 0x00, 0x00, diff --git a/backend/umax-uc630.c b/backend/umax-uc630.c index 0fbc59fa7..ccba3c1d3 100644 --- a/backend/umax-uc630.c +++ b/backend/umax-uc630.c @@ -1,7 +1,7 @@ /* ------------------------------------------------------------------------- */ /* umax-uc630.c: inquiry for UMAX scanner uc630 - + (C) 1997-2002 Oliver Rauch This program is free software; you can redistribute it and/or @@ -58,13 +58,13 @@ static unsigned char UC630_INQUIRY[] = /* 28 - 29 reserved */ 0x00, 0x00, -/* 2a - 35 exposure times */ +/* 2a - 35 exposure times */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 36 - 37 reserved */ +/* 36 - 37 reserved */ 0x00, 0x00, /* 38 - 5f scsi reserved */ @@ -77,7 +77,7 @@ static unsigned char UC630_INQUIRY[] = /* 60 -62 scanner capability */ 0xfd, 0x80, - 0x03, + 0x03, /* 63 reserved */ 0x00, @@ -150,7 +150,7 @@ static unsigned char UC630_INQUIRY[] = /* 8a-8b dor max scan width in 0.01 inch */ 0x00, 0x00, - + /* 8c-8d dor max scan length in 0.01 inch */ 0x00, 0x00, diff --git a/backend/umax-uc840.c b/backend/umax-uc840.c index 8f430feab..a0c8b9d77 100644 --- a/backend/umax-uc840.c +++ b/backend/umax-uc840.c @@ -1,7 +1,7 @@ /* ------------------------------------------------------------------------- */ /* umax-uc840.c: inquiry for UMAX scanner uc840 - + (C) 1997-2002 Oliver Rauch This program is free software; you can redistribute it and/or @@ -58,13 +58,13 @@ static unsigned char UC840_INQUIRY[] = /* 28 - 29 reserved */ 0x00, 0x00, -/* 2a - 35 exposure times */ +/* 2a - 35 exposure times */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 36 - 37 reserved */ +/* 36 - 37 reserved */ 0x00, 0x00, /* 38 - 5f scsi reserved */ @@ -77,13 +77,13 @@ static unsigned char UC840_INQUIRY[] = /* 60 -62 scanner capability*/ 0xfd, 0x8c, /* 0xbc ? */ - 0x03, + 0x03, /* 63 reserved */ 0x00, /* 64 gamma */ - 0xa1, + 0xa1, /* 65 reserved */ 0x00, @@ -150,7 +150,7 @@ static unsigned char UC840_INQUIRY[] = /* 8a-8b dor max scan width in 0.01 inch */ 0x00, 0x00, - + /* 8c-8d dor max scan length in 0.01 inch */ 0x00, 0x00, diff --git a/backend/umax-ug630.c b/backend/umax-ug630.c index 0a584b2d5..20a570993 100644 --- a/backend/umax-ug630.c +++ b/backend/umax-ug630.c @@ -1,7 +1,7 @@ /* ------------------------------------------------------------------------- */ /* umax-ug630.c: inquiry for UMAX scanner ug630 - + (C) 1997-2002 Oliver Rauch This program is free software; you can redistribute it and/or @@ -58,13 +58,13 @@ static unsigned char UG630_INQUIRY[] = /* 28 - 29 reserved */ 0x00, 0x00, -/* 2a - 35 exposure times */ +/* 2a - 35 exposure times */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 36 - 37 reserved */ +/* 36 - 37 reserved */ 0x00, 0x00, /* 38 - 5f scsi reserved */ @@ -150,7 +150,7 @@ static unsigned char UG630_INQUIRY[] = /* 8a-8b dor max scan width in 0.01 inch */ 0x00, 0x00, - + /* 8c-8d dor max scan length in 0.01 inch */ 0x00, 0x00, diff --git a/backend/umax-ug80.c b/backend/umax-ug80.c index b9d1d4247..91716b558 100644 --- a/backend/umax-ug80.c +++ b/backend/umax-ug80.c @@ -1,9 +1,9 @@ /* ------------------------------------------------------------------------- */ /* umax-ug80.c: inquiry for UMAX scanner ug80 - + (C) 1998-2002 Oliver Rauch - + Thanks to Andreas Hofmeister for his help! @@ -61,13 +61,13 @@ static unsigned char UG80_INQUIRY[] = /* 28 - 29 reserved */ 0x00, 0x00, -/* 2a - 35 exposure times */ +/* 2a - 35 exposure times */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 36 - 37 reserved */ +/* 36 - 37 reserved */ 0x00, 0x00, /* 38 - 5f scsi reserved */ @@ -153,7 +153,7 @@ static unsigned char UG80_INQUIRY[] = /* 8a-8b dor max scan width in 0.01 inch */ 0x00, 0x00, - + /* 8c-8d dor max scan length in 0.01 inch */ 0x00, 0x00, diff --git a/backend/umax-usb.c b/backend/umax-usb.c index c26aeaecf..066fc004b 100644 --- a/backend/umax-usb.c +++ b/backend/umax-usb.c @@ -2,7 +2,7 @@ /* sane - Scanner Access Now Easy. - umax-usb.c + umax-usb.c (C) 2001-2002 Frank Zago @@ -77,7 +77,7 @@ static u_char cdb_sizes[8] = { /* Sends a CDB to the scanner. Also sends the parameters and receives * the data, if necessary. When this function returns with a - * SANE_STATUS_GOOD, the SCSI command has been completed. + * SANE_STATUS_GOOD, the SCSI command has been completed. * * Note: I don't know about deferred commands. */ @@ -88,7 +88,7 @@ static SANE_Status sanei_umaxusb_cmd(int fd, const void *src, size_t src_size, v size_t param_size = src_size - cmd_size; const char * param_ptr = ((const char *) src) + cmd_size; size_t tmp_len; - + DBG(DBG_info, "Sending SCSI cmd 0x%02x cdb len %ld, param len %ld, result len %ld\n", ((const unsigned char *)src)[0], (long)cmd_size, (long)param_size, dst_size? (long)*dst_size:(long)0); /* This looks like some kind of pre-initialization. */ @@ -100,7 +100,7 @@ static SANE_Status sanei_umaxusb_cmd(int fd, const void *src, size_t src_size, v sanei_pv8630_write_byte(fd, PV8630_RMODE, 0x16); sanei_pv8630_flush_buffer(fd); sanei_pv8630_prep_bulkwrite(fd, cmd_size); - + tmp_len = cmd_size; sanei_pv8630_bulkwrite(fd, src, &tmp_len); sanei_pv8630_wait_byte(fd, PV8630_RSTATUS, 0xf8, 0xff, 1000); @@ -118,19 +118,19 @@ static SANE_Status sanei_umaxusb_cmd(int fd, const void *src, size_t src_size, v } return(SANE_STATUS_IO_ERROR); } - + /* Send the parameters and check they've been received OK. */ if (param_size) { sanei_pv8630_flush_buffer(fd); sanei_pv8630_prep_bulkwrite(fd, param_size); - + tmp_len = param_size; sanei_pv8630_bulkwrite(fd, param_ptr, &tmp_len); sanei_pv8630_wait_byte(fd, PV8630_RSTATUS, 0xf8, 0xff, 1000); - + sanei_pv8630_flush_buffer(fd); sanei_pv8630_prep_bulkread(fd, 1); - + result = 0xA5; /* to be sure */ tmp_len = 1; sanei_pv8630_bulkread(fd, &result, &tmp_len); @@ -174,7 +174,7 @@ static SANE_Status sanei_umaxusb_cmd(int fd, const void *src, size_t src_size, v sanei_pv8630_wait_byte(fd, PV8630_RSTATUS, 0xd0, 0xff, 1000); DBG(DBG_info, " SCSI command successfully executed\n"); - + return(SANE_STATUS_GOOD); } @@ -214,12 +214,12 @@ static SANE_Status pv8630_init_umaxusb_scanner(int fd) sanei_pv8630_write_byte(fd, PV8630_RMODE, 0x16); DBG(DBG_info, "PV8630 initialized\n"); - + return(SANE_STATUS_GOOD); } -/* +/* * SCSI functions for the emulation. * * The following functions emulate their sanei_scsi_* counterpart. @@ -227,7 +227,7 @@ static SANE_Status pv8630_init_umaxusb_scanner(int fd) */ -/* +/* * sanei_umaxusb_req_wait() and sanei_umaxusb_req_enter() * * I don't know if it is possible to queue the reads to the @@ -255,7 +255,7 @@ sanei_umaxusb_req_wait (void *id) return(SANE_STATUS_GOOD); } -/* Open the device. +/* Open the device. */ static SANE_Status sanei_umaxusb_open (const char *dev, int *fdp, @@ -290,16 +290,16 @@ sanei_umaxusb_open (const char *dev, int *fdp, *fdp = -1; return SANE_STATUS_UNSUPPORTED; } - - /* It's a good scanner. Initialize it. + + /* It's a good scanner. Initialize it. * * Note: pv8630_init_umaxusb_scanner() is for the UMAX * 2200. Other UMAX scanner might need a different * initialization routine. */ - pv8630_init_umaxusb_scanner(*fdp); + pv8630_init_umaxusb_scanner(*fdp); } - + return(SANE_STATUS_GOOD); } diff --git a/backend/umax.c b/backend/umax.c index 22fa2d36b..078042890 100644 --- a/backend/umax.c +++ b/backend/umax.c @@ -2,7 +2,7 @@ /* sane - Scanner Access Now Easy. - umax.c + umax.c (C) 1997-2007 Oliver Rauch @@ -106,7 +106,7 @@ in ADF mode this is done often: #ifndef SANE_I18N #define SANE_I18N(text) text -#endif +#endif /* ------------------------------------------------------------ INCLUDES ----------------------------------- */ @@ -377,7 +377,7 @@ static void umax_print_inquiry(Umax_Device *dev) if (dev->inquiry_len<=0x8e) { DBG(DBG_inquiry, "Inquiry block is unexpected short, should be at least 147 bytes\n"); - } + } DBG(DBG_inquiry,"\n"); DBG(DBG_inquiry,"ISO Version (reserved).......: %d\n", get_inquiry_iso_version(inquiry_block)); @@ -668,7 +668,7 @@ static void umax_print_inquiry(Umax_Device *dev) DBG(DBG_inquiry,"FB maximum scan length....................: %2.2f inch\n", dev->inquiry_fb_length); /* ---------- */ - + /* 0x7a - 0x81 */ if (dev->inquiry_len<=0x81) { @@ -679,9 +679,9 @@ static void umax_print_inquiry(Umax_Device *dev) DBG(DBG_inquiry,"UTA (transparency-mode):\n"); DBG(DBG_inquiry,"UTA x-original point......................: %2.2f inch\n", dev->inquiry_uta_x_off); DBG(DBG_inquiry,"UTA y-original point......................: %2.2f inch\n", dev->inquiry_uta_y_off); - DBG(DBG_inquiry,"UTA maximum scan width....................: %2.2f inch\n", dev->inquiry_uta_width); + DBG(DBG_inquiry,"UTA maximum scan width....................: %2.2f inch\n", dev->inquiry_uta_width); DBG(DBG_inquiry,"UTA maximum scan length...................: %2.2f inch\n", dev->inquiry_uta_length); - + /* ---------- */ /* 0x82-0x85 */ @@ -743,7 +743,7 @@ static void umax_print_inquiry(Umax_Device *dev) } DBG(DBG_inquiry,"lamp warmup maximum time..................: %d sec\n", dev->inquiry_max_warmup_time); - + /* 0x92 0x93 */ if (dev->inquiry_len<=0x93) { @@ -861,7 +861,7 @@ static SANE_Status sense_handler(int scsi_fd, unsigned char *result, void *arg) asc_ascq = (int)(256 * asc + ascq); len = 7 + get_RS_additional_length(result); - if ( get_RS_error_code(result) != 0x70 ) + if ( get_RS_error_code(result) != 0x70 ) { DBG(DBG_error, "invalid sense key error code (%d)\n", get_RS_error_code(result)); @@ -1318,18 +1318,18 @@ static void umax_order_line(Umax_Device *dev, unsigned char *source) { color = dev->CCD_color[1 + ((dev->pixelline_opt_res - CCD_distance) % 2)]; /* color 1,2 */ } - else if (dev->pixelline_opt_res < length * 3 - CCD_distance * 3) + else if (dev->pixelline_opt_res < length * 3 - CCD_distance * 3) { color = dev->CCD_color[3 + (dev->pixelline_opt_res % 3)]; /* color 3,4,5 */ } - else if (dev->pixelline_opt_res < length * 3 - CCD_distance) + else if (dev->pixelline_opt_res < length * 3 - CCD_distance) { color = dev->CCD_color[6 + ((dev->pixelline_opt_res - length*3 + CCD_distance*3) % 2)]; /* color 6,7 */ } - else + else { color = dev->CCD_color[8]; /* color 8 */ - } + } } while(umax_forget_line(dev, color) != 0); /* until found correct line */ umax_order_line_to_pixel(dev, source, color); @@ -1393,7 +1393,7 @@ static SANE_Status umax_scsi_cmd(Umax_Device *dev, const void *src, size_t src_s static SANE_Status umax_scsi_open_extended(const char *devicename, Umax_Device *dev, SANEI_SCSI_Sense_Handler handler, void *handler_arg, int *buffersize) { - switch (dev->connection_type) + switch (dev->connection_type) { case SANE_UMAX_SCSI: return sanei_scsi_open_extended(devicename, &dev->sfd, handler, handler_arg, buffersize); @@ -1449,7 +1449,7 @@ static void umax_scsi_close(Umax_Device *dev) dev->sfd=-1; break; #endif - } + } } /* ------------------------------------------------------------ UMAX SCSI REQ ENTER ------------------------ */ @@ -1583,7 +1583,7 @@ static SANE_Status umax_get_data_buffer_status(Umax_Device *dev) if (status) { DBG(DBG_error, "umax_get_data_buffer_status: command returned status %s\n", sane_strstatus(status)); - } + } return status; } @@ -1599,12 +1599,12 @@ static void umax_do_request_sense(Umax_Device *dev) SANE_Status status; DBG(DBG_proc, "do_request_sense\n"); - set_RS_allocation_length(request_sense.cmd, rs_return_block_size); + set_RS_allocation_length(request_sense.cmd, rs_return_block_size); status = umax_scsi_cmd(dev, request_sense.cmd, request_sense.size, dev->buffer[0], &size); if (status) { DBG(DBG_error, "umax_do_request_sense: command returned status %s\n", sane_strstatus(status)); - } + } } @@ -1663,7 +1663,7 @@ static int umax_grab_scanner(Umax_Device *dev) if (status) { DBG(DBG_error, "umax_grab_scanner: command returned status %s\n", sane_strstatus(status)); - } + } else { DBG(DBG_info, "scanner reserved\n"); @@ -1681,7 +1681,7 @@ static int umax_reposition_scanner(Umax_Device *dev) int status; int pause; - pause = dev->pause_after_reposition + dev->pause_for_moving * (dev->upper_left_y + dev->scanlength) / + pause = dev->pause_after_reposition + dev->pause_for_moving * (dev->upper_left_y + dev->scanlength) / ( (dev->inquiry_fb_length * dev->y_coordinate_base) ); DBG(DBG_info2, "trying to reposition scanner ...\n"); @@ -1724,7 +1724,7 @@ static int umax_give_scanner(Umax_Device *dev) if (status) { DBG(DBG_error, "umax_give_scanner: command returned status %s\n", sane_strstatus(status)); - } + } else { DBG(DBG_info, "scanner released\n"); @@ -1760,7 +1760,7 @@ static void umax_send_gamma_data(Umax_Device *dev, void *gamma_data, int color) DBG(DBG_error, "ERROR: gamma download not available\n"); return; } - + memcpy(dev->buffer[0], send.cmd, send.size); /* send */ set_S_datatype_code(dev->buffer[0], S_datatype_gamma); /* gamma curve */ @@ -1790,7 +1790,7 @@ static void umax_send_gamma_data(Umax_Device *dev, void *gamma_data, int color) if (status) { DBG(DBG_error, "umax_send_gamma_data(DCF=0, one color): command returned status %s\n", sane_strstatus(status)); - } + } } else /* three colors */ { @@ -1816,7 +1816,7 @@ static void umax_send_gamma_data(Umax_Device *dev, void *gamma_data, int color) if (status) { DBG(DBG_error, "umax_send_gamma_data(DCF=0, RGB): command returned status %s\n", sane_strstatus(status)); - } + } } } else if (dev->inquiry_gamma_DCF == 1) /* gamma format type 1 */ @@ -1839,7 +1839,7 @@ static void umax_send_gamma_data(Umax_Device *dev, void *gamma_data, int color) if (status) { DBG(DBG_error, "umax_send_gamma_data(DCF=1): command returned status %s\n", sane_strstatus(status)); - } + } } else if (dev->inquiry_gamma_DCF == 2) /* gamma format type 2 */ { @@ -1904,7 +1904,7 @@ static void umax_send_gamma_data(Umax_Device *dev, void *gamma_data, int color) if (status) { DBG(DBG_error, "umax_send_gamma_data(DCF=2): command returned status %s\n", sane_strstatus(status)); - } + } } else { @@ -1937,7 +1937,7 @@ static void umax_send_data(Umax_Device *dev, void *data, int size, int datatype) if (status) { DBG(DBG_error, "umax_send_data: command returned status %s\n", sane_strstatus(status)); - } + } } @@ -2037,7 +2037,7 @@ static int umax_read_data(Umax_Device *dev, size_t length, int datatype) { DBG(DBG_error, "umax_read_data: command returned status %s\n", sane_strstatus(status)); return -1; - } + } return length; } @@ -2082,7 +2082,7 @@ static int umax_read_image_data(Umax_Device *dev, unsigned int length) static int umax_correct_light(int light, int analog_gamma_byte) /* correct highlight/shadow if analog gamma is set */ -{ +{ double analog_gamma; analog_gamma=analog_gamma_table[analog_gamma_byte]; return( (int) 255 * pow( ((double) light)/255.0 , (1.0/analog_gamma) )+.5 ); @@ -2121,7 +2121,7 @@ static SANE_Status umax_set_window_param(Umax_Device *dev) set_WD_brightness(buffer_r, dev->brightness); /* brightness, only halftone */ set_WD_threshold(buffer_r, dev->threshold); /* threshold, only lineart */ set_WD_contrast(buffer_r, dev->contrast); /* contrast, only halftone */ - + /* scanmode, preset to LINEART */ set_WD_composition(buffer_r, WD_comp_lineart); /* image composition */ /* = (scan-mode) */ @@ -2136,16 +2136,16 @@ static SANE_Status umax_set_window_param(Umax_Device *dev) set_WD_shadow(buffer_r, umax_correct_light(dev->shadow_r, dev->analog_gamma_r)); /* scan options */ - set_WD_gamma(buffer_r, dev->digital_gamma_r); /* set digital gamma */ - set_WD_module(buffer_r, dev->module); /* flatbed or transparency */ - set_WD_CBHS(buffer_r, dev->cbhs_range); /* 50 or 255 */ + set_WD_gamma(buffer_r, dev->digital_gamma_r); /* set digital gamma */ + set_WD_module(buffer_r, dev->module); /* flatbed or transparency */ + set_WD_CBHS(buffer_r, dev->cbhs_range); /* 50 or 255 */ set_WD_FF(buffer_r, dev->fix_focus_position); /* fix focus position */ set_WD_RMIF(buffer_r, dev->reverse_multi); /* reverse color-values */ set_WD_FDC(buffer_r, dev->lens_cal_in_doc_pos); /* lens calibration in document position */ set_WD_PF(buffer_r, dev->disable_pre_focus); /* disable pre focus */ set_WD_LCL(buffer_r, dev->holder_focus_pos_0mm); /* 0.6mm <-> 0.0mm holder focus position */ set_WD_HBT(buffer_r, dev->low_byte_first); /* set byte order for 16 bit scanners */ - set_WD_DOR(buffer_r, dev->dor); /* double-resolution-mode */ + set_WD_DOR(buffer_r, dev->dor); /* double-resolution-mode */ set_WD_scan_exposure_level(buffer_r, dev->exposure_time_scan_r); /* scan exposure time */ set_WD_calibration_exposure_level(buffer_r, dev->exposure_time_calibration_r);/* calibration exposure time */ @@ -2217,7 +2217,7 @@ static SANE_Status umax_set_window_param(Umax_Device *dev) if (dev->do_color_ordering != 0) { - set_WD_line_arrangement(buffer_r, WD_line_arrengement_by_driver); + set_WD_line_arrangement(buffer_r, WD_line_arrengement_by_driver); if (dev->CCD_distance == 0) { @@ -2248,17 +2248,17 @@ static SANE_Status umax_set_window_param(Umax_Device *dev) set_WD_analog_gamma(buffer_g, dev->analog_gamma_g); set_WD_analog_gamma(buffer_b, dev->analog_gamma_b); - /* set highlight in dependence of analog gamma */ + /* set highlight in dependence of analog gamma */ set_WD_highlight(buffer_r, umax_correct_light(dev->highlight_r, dev->analog_gamma_r)); set_WD_highlight(buffer_g, umax_correct_light(dev->highlight_g, dev->analog_gamma_g)); set_WD_highlight(buffer_b, umax_correct_light(dev->highlight_b, dev->analog_gamma_b)); - /* set shadow in dependence of analog gamma */ + /* set shadow in dependence of analog gamma */ set_WD_shadow(buffer_r, umax_correct_light(dev->shadow_r, dev->analog_gamma_r)); set_WD_shadow(buffer_g, umax_correct_light(dev->shadow_g, dev->analog_gamma_g)); set_WD_shadow(buffer_b, umax_correct_light(dev->shadow_b, dev->analog_gamma_b)); - set_WD_scan_exposure_level(buffer_r, dev->exposure_time_scan_r); /* set scan exposure times */ + set_WD_scan_exposure_level(buffer_r, dev->exposure_time_scan_r); /* set scan exposure times */ set_WD_scan_exposure_level(buffer_g, dev->exposure_time_scan_g); set_WD_scan_exposure_level(buffer_b, dev->exposure_time_scan_b); @@ -2291,7 +2291,7 @@ static SANE_Status umax_set_window_param(Umax_Device *dev) set_WD_gamma(buffer_r, dev->digital_gamma_r); set_WD_analog_gamma(buffer_r, dev->analog_gamma_r); set_WD_highlight(buffer_r, umax_correct_light(dev->highlight_r, dev->analog_gamma_r)); - set_WD_shadow(buffer_r, umax_correct_light(dev->shadow_r, dev->analog_gamma_r)); + set_WD_shadow(buffer_r, umax_correct_light(dev->shadow_r, dev->analog_gamma_r)); set_WD_scan_exposure_level(buffer_r, dev->exposure_time_scan_r); set_WD_calibration_exposure_level(buffer_r, dev->exposure_time_calibration_r); break; @@ -2344,10 +2344,10 @@ static SANE_Status umax_set_window_param(Umax_Device *dev) if (status) { DBG(DBG_error, "umax_set_window_param: command returned status %s\n", sane_strstatus(status)); - } + } else { - DBG(DBG_info, "window(s) set\n"); + DBG(DBG_info, "window(s) set\n"); } return status; @@ -2372,7 +2372,7 @@ static void umax_do_inquiry(Umax_Device *dev) if (status) { DBG(DBG_error, "umax_do_inquiry: command returned status %s\n", sane_strstatus(status)); - } + } size = get_inquiry_additional_length(dev->buffer[0]) + 5; @@ -2381,7 +2381,7 @@ static void umax_do_inquiry(Umax_Device *dev) if (status) { DBG(DBG_error, "umax_do_inquiry: command returned status %s\n", sane_strstatus(status)); - } + } } @@ -2419,7 +2419,7 @@ static SANE_Status umax_start_scan(Umax_Device *dev) set_SC_quality(scan.cmd, dev->quality); /* 1=qual, 0=fast */ set_SC_adf( scan.cmd, dev->adf); /* ADF, 0=off, 1=use */ set_SC_preview(scan.cmd, dev->preview); /* 1=preview */ - + set_SC_wid(scan.cmd, 1, 0); /* Window-Identifier */ set_SC_xfer_length(scan.cmd, size); /* following Bytes */ @@ -2430,7 +2430,7 @@ static SANE_Status umax_start_scan(Umax_Device *dev) if (status) { DBG(DBG_error, "umax_start_scan: command returned status %s\n", sane_strstatus(status)); - } + } return status; } @@ -2485,7 +2485,7 @@ static SANE_Status umax_do_calibration(Umax_Device *dev) if (dev->calibration_width_offset > -99999) /* driver or user (umax.conf) define an offset */ { - width = width + dev->calibration_width_offset; + width = width + dev->calibration_width_offset; DBG(DBG_warning," Using calibration width offset of %d\n", dev->calibration_width_offset); } @@ -2515,7 +2515,7 @@ static SANE_Status umax_do_calibration(Umax_Device *dev) { if (dev->calibration_width_offset_batch > -99999) /* driver or user (umax.conf) define an offset for batch scanning */ { - width = width + dev->calibration_width_offset_batch; + width = width + dev->calibration_width_offset_batch; DBG(DBG_warning," Using calibration width offset for batch scanning of %d\n", dev->calibration_width_offset_batch); } } @@ -2523,7 +2523,7 @@ static SANE_Status umax_do_calibration(Umax_Device *dev) { if (dev->calibration_width_offset > -99999) /* driver or user (umax.conf) define an offset */ { - width = width + dev->calibration_width_offset; + width = width + dev->calibration_width_offset; DBG(DBG_warning," Using calibration width offset of %d\n", dev->calibration_width_offset); } } @@ -2705,7 +2705,7 @@ static void umax_do_new_inquiry(Umax_Device *dev, size_t size) /* call in if (status) { DBG(DBG_error, "umax_do_new_inquiry: command returned status %s\n", sane_strstatus(status)); - } + } } @@ -3154,7 +3154,7 @@ static int umax_identify_scanner(Umax_Device *dev) { *pp-- = '\0'; } - + pp = &version[4]; while (*pp == ' ') { @@ -3172,12 +3172,12 @@ static int umax_identify_scanner(Umax_Device *dev) while (strncmp("END_OF_LIST", scanner_str[2*i], 11) != 0) /* Now identify full supported scanners */ { if (!strncmp(vendor, scanner_str[2*i], strlen(scanner_str[2*i])) ) - { + { if (!strncmp(product, scanner_str[2*i+1], strlen(scanner_str[2*i+1])) ) { umax_correct_inquiry(dev, vendor, product, version); return 0; - } + } } i++; } @@ -3199,7 +3199,7 @@ static int umax_identify_scanner(Umax_Device *dev) "If you already use the most recent umax-backend version\n" "then please contact me: Oliver.Rauch@rauch-domain.de\n"); - return 0; + return 0; } else /* inquiry-data not complete */ if (!strncmp(vendor, "UMAX ", 5)) /* test UMAX-scanners with short inquiry */ @@ -3210,7 +3210,7 @@ static int umax_identify_scanner(Umax_Device *dev) for(i=0; i < known_inquiry; i++) { inq_data = *inquiry_table[i]; - if (!strncmp(product, inq_data.scanner, strlen(inq_data.scanner))) + if (!strncmp(product, inq_data.scanner, strlen(inq_data.scanner))) { DBG(DBG_warning, "inquiry-block-length: %d\n", get_inquiry_additional_length(dev->buffer[0])+5); DBG(DBG_warning, "using driver-internal inquiry-data for this scanner!\n"); @@ -3222,7 +3222,7 @@ static int umax_identify_scanner(Umax_Device *dev) set_inquiry_sc_uta(dev->buffer[0], get_inquiry_transavail(dev->buffer[0])); /* transparancy available ? */ set_inquiry_sc_adf(dev->buffer[0], get_inquiry_scanmode(dev->buffer[0])); /* automatic document feeder available ? */ - set_inquiry_length(dev->buffer[0], inq_data.inquiry_len); + set_inquiry_length(dev->buffer[0], inq_data.inquiry_len); umax_correct_inquiry(dev, vendor, product, version); return 0; /* ok */ @@ -3268,7 +3268,7 @@ static void umax_trim_rowbufsize(Umax_Device *dev) /* ------------------------------------------------------------ UMAX CALCULATE EXPOSURE TIME --------------- */ - + static void umax_calculate_exposure_time(Umax_Device *dev, int def, int *value) { int level; @@ -3285,7 +3285,7 @@ static void umax_calculate_exposure_time(Umax_Device *dev, int def, int *value) } } - + /* ------------------------------------------------------------ UMAX CHECK VALUES -------------------------- */ @@ -3306,7 +3306,7 @@ static int umax_check_values(Umax_Device *dev) /* --------------------------------- uta --------------------------------- */ - if (dev->uta != 0) + if (dev->uta != 0) { dev->module = WD_module_transparency; if ( (dev->inquiry_uta == 0) || (dev->inquiry_transavail == 0) ) @@ -3318,7 +3318,7 @@ static int umax_check_values(Umax_Device *dev) /* --------------------------------- adf --------------------------------- */ - if (dev->adf != 0) + if (dev->adf != 0) { if (dev->inquiry_adf == 0) { @@ -3334,7 +3334,7 @@ static int umax_check_values(Umax_Device *dev) if (dev->inquiry_dor == 0) { DBG(DBG_error, "ERROR: double optical resolution not supported by scanner\n"); - return(1); + return(1); } } @@ -3522,7 +3522,7 @@ static int umax_check_values(Umax_Device *dev) if (dev->wdb_len <= 0) { - dev->wdb_len = dev->inquiry_wdb_len; + dev->wdb_len = dev->inquiry_wdb_len; if (dev->wdb_len <= 0) { DBG(DBG_error,"ERROR: wdb-length not given\n"); @@ -3668,7 +3668,7 @@ static int umax_check_values(Umax_Device *dev) } /* ---------------------------- speed and smear ------------------------- */ - + if (dev->slow == 1) { dev->WD_speed = WD_speed_slow; @@ -3684,7 +3684,7 @@ static int umax_check_values(Umax_Device *dev) } /* ---------------------- test bits per pixel --------------------------- */ - + if ( ( (dev->inquiry_GIB | 1) & dev->gamma_input_bits_code) == 0 ) { DBG(DBG_warning,"WARNING: selected gamma input bits not supported, gamma ignored\n"); @@ -3697,7 +3697,7 @@ static int umax_check_values(Umax_Device *dev) DBG(DBG_error,"ERROR: selected bits per pixel not supported\n"); return(1); } - + /* ----------------------- scan mode dependencies ------------------------ */ switch(dev->colormode) @@ -3706,7 +3706,7 @@ static int umax_check_values(Umax_Device *dev) case RGB_LINEART: /* ---------- RGB_LINEART ----------- */ dev->use_exposure_time_min = dev->inquiry_exposure_time_l_min; - if (dev->module == WD_module_flatbed) + if (dev->module == WD_module_flatbed) { dev->use_exposure_time_def_r = dev->inquiry_exposure_time_l_fb_def; } @@ -3725,7 +3725,7 @@ static int umax_check_values(Umax_Device *dev) case HALFTONE: /* ----------- HALFTONE------------ */ case RGB_HALFTONE: /* --------- RGB_HALFTONE---------- */ dev->use_exposure_time_min = dev->inquiry_exposure_time_h_min; - if (dev->module == WD_module_flatbed) + if (dev->module == WD_module_flatbed) { dev->use_exposure_time_def_r = dev->inquiry_exposure_time_h_fb_def; } @@ -3744,7 +3744,7 @@ static int umax_check_values(Umax_Device *dev) case GRAYSCALE: /* ---------- GRAYSCALE ------------- */ dev->use_exposure_time_min = dev->inquiry_exposure_time_g_min; - if (dev->module == WD_module_flatbed) + if (dev->module == WD_module_flatbed) { dev->use_exposure_time_def_r = dev->inquiry_exposure_time_g_fb_def; } @@ -3762,7 +3762,7 @@ static int umax_check_values(Umax_Device *dev) case RGB: /* ----------------- COLOR ---------- */ dev->use_exposure_time_min = dev->inquiry_exposure_time_c_min; - if (dev->module == WD_module_flatbed) + if (dev->module == WD_module_flatbed) { dev->use_exposure_time_def_r = dev->inquiry_exposure_time_c_fb_def_r; dev->use_exposure_time_def_g = dev->inquiry_exposure_time_c_fb_def_g; @@ -3838,7 +3838,7 @@ static int umax_check_values(Umax_Device *dev) dev->CCD_color[1] = CCD_color_blue; dev->CCD_color[2] = CCD_color_red; - + dev->CCD_color[3] = CCD_color_blue; dev->CCD_color[4] = CCD_color_green; dev->CCD_color[5] = CCD_color_red; @@ -3893,13 +3893,13 @@ static int umax_check_values(Umax_Device *dev) dev->CCD_color[6] = CCD_color_green; dev->CCD_color[7] = CCD_color_blue; - + dev->CCD_color[8] = CCD_color_green; break; default: dev->CCD_color[0] = CCD_color_green; - + dev->CCD_color[1] = CCD_color_blue; dev->CCD_color[2] = CCD_color_green; @@ -3915,12 +3915,12 @@ static int umax_check_values(Umax_Device *dev) DBG(DBG_info,"scanner uses color-line-ordering with CCD-distance of %d lines\n", dev->CCD_distance); } else - { + { DBG(DBG_error,"ERROR: color-ordering-type not supported \n"); return(1); } } - else + else { DBG(DBG_info,"using three pass scanning mode\n"); dev->three_pass=1; @@ -3971,7 +3971,7 @@ static void umax_get_inquiry_values(Umax_Device *dev) dev->inquiry_highlight_min = 1; /* minimum value for h */ dev->inquiry_highlight_max = 50; /* maximum value for h */ dev->inquiry_shadow_min = 0; /* minimum value for s */ - dev->inquiry_shadow_max = 49; /* maximum value for s */ + dev->inquiry_shadow_max = 49; /* maximum value for s */ } get_inquiry_vendor( (char *)inquiry_block, dev->vendor); dev->vendor[8] ='\0'; @@ -4161,7 +4161,7 @@ static void umax_get_inquiry_values(Umax_Device *dev) if (dev->inquiry_len<=0x9d) { return; - } + } dev->inquiry_CCD_line_distance = get_inquiry_CCD_line_distance(inquiry_block); return; @@ -4185,7 +4185,7 @@ static int umax_calculate_analog_gamma(double value) while (value>analog_gamma_table[gamma]) { gamma++; - } + } if (gamma) { @@ -4194,7 +4194,7 @@ static int umax_calculate_analog_gamma(double value) gamma--; } } - + return(gamma); } @@ -4211,7 +4211,7 @@ static void umax_output_image_data(Umax_Device *dev, FILE *fp, unsigned int data for (i=0; ibuffer[bufnr][i]; + old = dev->buffer[bufnr][i]; new = 0; for (j=0; j<8; j++) /* reverse bit order of 1 byte */ { @@ -4463,11 +4463,11 @@ static void umax_initialize_values(Umax_Device *dev) /* called each time b dev->pixelline_optic[0] = 1; dev->pixelline_optic[1] = 1; dev->pixelline_optic[2] = 1; - dev->pixelline_max = 0; - dev->pixelline_opt_res = 0; - dev->pixelline_read = 0; - dev->pixelline_written = 0; - dev->CCD_distance = 0; + dev->pixelline_max = 0; + dev->pixelline_opt_res = 0; + dev->pixelline_read = 0; + dev->pixelline_written = 0; + dev->CCD_distance = 0; dev->calib_lines = 0; /* request calibration lines */ dev->do_calibration = 0; /* no calibration by driver */ @@ -4497,7 +4497,7 @@ static void umax_init(Umax_Device *dev) /* umax_init is called once while else /* SANE_UMAX_USB, USB does not support command queueing */ { DBG(DBG_info2, "setting request_scsi_maxqueue = 1 for USB connection\n"); - dev->request_scsi_maxqueue = 1; + dev->request_scsi_maxqueue = 1; } dev->request_preview_lines = umax_preview_lines; @@ -4578,7 +4578,7 @@ static void umax_init(Umax_Device *dev) /* umax_init is called once while dev->inquiry_highlight_min = 1; /* minimum value for h */ dev->inquiry_highlight_max = 255; /* maximum value for h */ dev->inquiry_shadow_min = 0; /* minimum value for s */ - dev->inquiry_shadow_max = 254; /* maximum value for s */ + dev->inquiry_shadow_max = 254; /* maximum value for s */ dev->inquiry_quality_ctrl = 0; dev->inquiry_preview = 0; dev->inquiry_lamp_ctrl = 0; @@ -4870,7 +4870,7 @@ static SANE_Status attach_scanner(const char *devicename, Umax_Device **devp, in dev->sane.name = dev->devicename; dev->sane.vendor = dev->vendor; dev->sane.model = dev->product; - dev->sane.type = "flatbed scanner"; + dev->sane.type = "flatbed scanner"; if (strcmp(dev->sane.model,"PSD ") == 0) { @@ -5001,7 +5001,7 @@ static int reader_process(void *data) /* executed as a child process or as threa if (!fp) { return SANE_STATUS_IO_ERROR; - } + } DBG(DBG_sane_info,"reader_process: starting to READ data\n"); @@ -5076,17 +5076,17 @@ static SANE_Status init_options(Umax_Scanner *scanner) if (scanner->device->inquiry_color) { -/* +/* if (scanner->device->inquiry_lineart) { scan_mode_list[++scan_modes]= COLOR_LINEART_STR; } - if (scanner->device->inquiry_halftone) + if (scanner->device->inquiry_halftone) { scan_mode_list[++scan_modes]= COLOR_HALFTONE_STR; } */ - scan_mode_list[++scan_modes]= COLOR_STR; + scan_mode_list[++scan_modes]= COLOR_STR; } - scan_mode_list[scan_modes + 1] = 0; + scan_mode_list[scan_modes + 1] = 0; { int i=0; @@ -5104,7 +5104,7 @@ static SANE_Status init_options(Umax_Scanner *scanner) source_list[i] = 0; } - + /* scan mode */ scanner->opt[OPT_MODE].name = SANE_NAME_SCAN_MODE; scanner->opt[OPT_MODE].title = SANE_TITLE_SCAN_MODE; @@ -5124,7 +5124,7 @@ static SANE_Status init_options(Umax_Scanner *scanner) scanner->opt[OPT_SOURCE].constraint_type = SANE_CONSTRAINT_STRING_LIST; scanner->opt[OPT_SOURCE].constraint.string_list = source_list; scanner->val[OPT_SOURCE].s = (SANE_Char*)strdup(source_list[0]); - + /* x-resolution */ scanner->opt[OPT_X_RESOLUTION].name = SANE_NAME_SCAN_RESOLUTION; scanner->opt[OPT_X_RESOLUTION].title = SANE_TITLE_SCAN_RESOLUTION; @@ -5906,7 +5906,7 @@ static SANE_Status init_options(Umax_Scanner *scanner) sane_control_option(scanner, OPT_MODE, SANE_ACTION_SET_VALUE, (SANE_String *) scan_mode_list[scan_modes], NULL ); - + return SANE_STATUS_GOOD; } @@ -5944,7 +5944,7 @@ static SANE_Status umax_test_configure_option(const char *option_str, char *test errno = 0; value = strtol(value_str, &end_ptr, 10); - if (end_ptr == value_str || errno) + if (end_ptr == value_str || errno) { DBG(DBG_error, "ERROR: invalid value \"%s\" for option %s in %s\n", value_str, test_name, UMAX_CONFIG_FILE); } @@ -6013,7 +6013,7 @@ SANE_Status sane_init(SANE_Int *version_code, SANE_Auth_Callback authorize) #endif fp = sanei_config_open(UMAX_CONFIG_FILE); - if (!fp) + if (!fp) { /* no config-file: try /dev/scanner and /dev/usbscanner. */ attach_scanner("/dev/scanner", 0, SANE_UMAX_SCSI); @@ -6308,7 +6308,7 @@ void sane_close(SANE_Handle handle) prev = scanner; } - + if (!scanner) { DBG(DBG_error, "ERROR: sane_close: invalid handle %p\n", handle); @@ -6318,7 +6318,7 @@ void sane_close(SANE_Handle handle) if (scanner->scanning) /* stop scan if still scanning */ { do_cancel(handle); - } + } if (scanner->device->lamp_control_available) /* lamp state can be controlled by driver */ { @@ -6380,7 +6380,7 @@ static void umax_set_max_geometry(Umax_Scanner *scanner) scanner->device->y_range.max = SANE_FIX( (scanner->device->inquiry_dor_y_off + scanner->device->inquiry_dor_length) * MM_PER_INCH); scanner->device->x_dpi_range.max = SANE_FIX(scanner->device->inquiry_dor_x_res); - scanner->device->y_dpi_range.max = SANE_FIX(scanner->device->inquiry_dor_y_res); + scanner->device->y_dpi_range.max = SANE_FIX(scanner->device->inquiry_dor_y_res); } else if ( (strcmp(scanner->val[OPT_SOURCE].s, FLB_STR) == 0) || (strcmp(scanner->val[OPT_SOURCE].s, ADF_STR) == 0) ) { @@ -6390,7 +6390,7 @@ static void umax_set_max_geometry(Umax_Scanner *scanner) scanner->device->y_range.max = SANE_FIX(scanner->device->inquiry_fb_length * MM_PER_INCH); scanner->device->x_dpi_range.max = SANE_FIX(scanner->device->inquiry_x_res); - scanner->device->y_dpi_range.max = SANE_FIX(scanner->device->inquiry_y_res); + scanner->device->y_dpi_range.max = SANE_FIX(scanner->device->inquiry_y_res); } else if (strcmp(scanner->val[OPT_SOURCE].s, UTA_STR) == 0) { @@ -6400,7 +6400,7 @@ static void umax_set_max_geometry(Umax_Scanner *scanner) scanner->device->y_range.max = SANE_FIX( ( scanner->device->inquiry_uta_y_off + scanner->device->inquiry_uta_length) * MM_PER_INCH); scanner->device->x_dpi_range.max = SANE_FIX(scanner->device->inquiry_x_res); - scanner->device->y_dpi_range.max = SANE_FIX(scanner->device->inquiry_y_res); + scanner->device->y_dpi_range.max = SANE_FIX(scanner->device->inquiry_y_res); } DBG(DBG_info,"x_range = [%f .. %f]\n", SANE_UNFIX(scanner->device->x_range.min), SANE_UNFIX(scanner->device->x_range.max)); @@ -6414,7 +6414,7 @@ static void umax_set_max_geometry(Umax_Scanner *scanner) { scanner->val[OPT_TL_X].w = scanner->device->x_range.min; } - + if (scanner->val[OPT_TL_Y].w < scanner->device->y_range.min) { scanner->val[OPT_TL_Y].w = scanner->device->y_range.min; @@ -6424,7 +6424,7 @@ static void umax_set_max_geometry(Umax_Scanner *scanner) { scanner->val[OPT_BR_X].w = scanner->device->x_range.max; } - + if (scanner->val[OPT_BR_Y].w > scanner->device->y_range.max) { scanner->val[OPT_BR_Y].w = scanner->device->y_range.max; @@ -6528,7 +6528,7 @@ SANE_Status sane_control_option(SANE_Handle handle, SANE_Int option, SANE_Action case OPT_MANUAL_PRE_FOCUS: case OPT_FIX_FOCUS_POSITION: case OPT_LENS_CALIBRATION_DOC_POS: - case OPT_HOLDER_FOCUS_POS_0MM: + case OPT_HOLDER_FOCUS_POS_0MM: case OPT_LAMP_OFF_AT_EXIT: case OPT_SELECT_LAMP_DENSITY: *(SANE_Word *) val = scanner->val[option].w; @@ -6645,7 +6645,7 @@ SANE_Status sane_control_option(SANE_Handle handle, SANE_Int option, SANE_Action case OPT_MANUAL_PRE_FOCUS: case OPT_FIX_FOCUS_POSITION: case OPT_LENS_CALIBRATION_DOC_POS: - case OPT_HOLDER_FOCUS_POS_0MM: + case OPT_HOLDER_FOCUS_POS_0MM: case OPT_LAMP_OFF_AT_EXIT: scanner->val[option].w = *(SANE_Word *) val; return SANE_STATUS_GOOD; @@ -6663,7 +6663,7 @@ SANE_Status sane_control_option(SANE_Handle handle, SANE_Int option, SANE_Action } DBG(DBG_info,"sane_control_option: set DOR = %d\n", scanner->val[option].w); - umax_set_max_geometry(scanner); + umax_set_max_geometry(scanner); } return SANE_STATUS_GOOD; } @@ -6895,7 +6895,7 @@ SANE_Status sane_control_option(SANE_Handle handle, SANE_Int option, SANE_Action case OPT_CUSTOM_GAMMA: { w = *(SANE_Word *) val; - if (w == scanner->val[OPT_CUSTOM_GAMMA].w) { return SANE_STATUS_GOOD; } + if (w == scanner->val[OPT_CUSTOM_GAMMA].w) { return SANE_STATUS_GOOD; } scanner->val[OPT_CUSTOM_GAMMA].w = w; if (w) /* use custom_gamma_table */ @@ -6944,7 +6944,7 @@ SANE_Status sane_control_option(SANE_Handle handle, SANE_Int option, SANE_Action *info |=SANE_INFO_RELOAD_OPTIONS | SANE_INFO_RELOAD_PARAMS; } - scanner->opt[OPT_NEGATIVE].cap |= SANE_CAP_INACTIVE; + scanner->opt[OPT_NEGATIVE].cap |= SANE_CAP_INACTIVE; scanner->opt[OPT_BIT_DEPTH].cap |= SANE_CAP_INACTIVE; @@ -7025,7 +7025,7 @@ SANE_Status sane_control_option(SANE_Handle handle, SANE_Int option, SANE_Action if (scanner->val[OPT_SELECT_EXPOSURE_TIME].w == SANE_TRUE) { - scanner->opt[OPT_CAL_EXPOS_TIME].cap &= ~SANE_CAP_INACTIVE; + scanner->opt[OPT_CAL_EXPOS_TIME].cap &= ~SANE_CAP_INACTIVE; scanner->opt[OPT_SCAN_EXPOS_TIME].cap &= ~SANE_CAP_INACTIVE; } @@ -7062,7 +7062,7 @@ SANE_Status sane_control_option(SANE_Handle handle, SANE_Int option, SANE_Action if (scanner->device->inquiry_reverse_multi) { - scanner->opt[OPT_NEGATIVE].cap &= ~SANE_CAP_INACTIVE; + scanner->opt[OPT_NEGATIVE].cap &= ~SANE_CAP_INACTIVE; } if (scanner->device->inquiry_gamma_dwload) @@ -7452,11 +7452,11 @@ SANE_Status sane_start(SANE_Handle handle) scanner->device->analog_gamma_b = umax_calculate_analog_gamma(SANE_UNFIX(scanner->val[OPT_ANALOG_GAMMA].w)); scanner->device->highlight_r = - scanner->device->highlight_g = + scanner->device->highlight_g = scanner->device->highlight_b = P_100_TO_255(scanner->val[OPT_HIGHLIGHT].w); scanner->device->shadow_r = - scanner->device->shadow_g = + scanner->device->shadow_g = scanner->device->shadow_b = P_100_TO_255(scanner->val[OPT_SHADOW].w); if (scanner->val[OPT_SELECT_EXPOSURE_TIME].w == SANE_TRUE) @@ -7634,7 +7634,7 @@ SANE_Status sane_start(SANE_Handle handle) } scanner->params.bytes_per_line = scanner->device->row_len; - scanner->params.pixels_per_line = scanner->device->width_in_pixels; + scanner->params.pixels_per_line = scanner->device->width_in_pixels; scanner->params.lines = scanner->device->length_in_pixels; @@ -7825,7 +7825,7 @@ SANE_Status sane_start(SANE_Handle handle) scanner->device->halftone = WD_halftone_download; } /* end of send halftonepattern */ #endif - + } /* ------------ end of first call -------------- */ @@ -7990,7 +7990,7 @@ SANE_Status sane_start(SANE_Handle handle) return SANE_STATUS_IO_ERROR; } - scanner->pipe_read_fd = fds[0]; + scanner->pipe_read_fd = fds[0]; scanner->pipe_write_fd = fds[1]; /* start reader_process, deponds on OS if fork() or threads are used */ @@ -8067,7 +8067,7 @@ SANE_Status sane_read(SANE_Handle handle, SANE_Byte *buf, SANE_Int max_len, SANE scanner->pipe_read_fd = -1; } - return SANE_STATUS_EOF; + return SANE_STATUS_EOF; } return SANE_STATUS_GOOD; @@ -8104,8 +8104,8 @@ SANE_Status sane_set_io_mode(SANE_Handle handle, SANE_Bool non_blocking) if (fcntl(scanner->pipe_read_fd, F_SETFL, non_blocking ? O_NONBLOCK : 0) < 0) { return SANE_STATUS_IO_ERROR; - } - return SANE_STATUS_GOOD; + } + return SANE_STATUS_GOOD; } diff --git a/backend/umax.conf.in b/backend/umax.conf.in index a57cf53ba..982bcfa49 100644 --- a/backend/umax.conf.in +++ b/backend/umax.conf.in @@ -17,7 +17,7 @@ # 0 = handle as device busy # 1 = handle as ok # 2 = handle as i/o error -# 3 = ignore bad error code - continue sense handler, +# 3 = ignore bad error code - continue sense handler, #option handle-bad-sense-error 0 # define if a request sense command shall be executed @@ -43,7 +43,7 @@ # define if the calibration shall be done for selected scanarea or for each ccd pixel # -1 = automatically set by driver - if known # 0 = disabled -# 1 = enabled +# 1 = enabled #option calibration-full-ccd 1 # define if an offset of the calculate calibration with has to be used @@ -54,7 +54,7 @@ # -1 = disabled # 0 = not set # 1 = 1 byte/pixel, -# 2 = 2 bytes/pixel +# 2 = 2 bytes/pixel #option calibration-bytes-pixel -1 # define if scanner uses the same exposure times for red, green and blue @@ -66,18 +66,18 @@ # define if shading data shall be inverted befor sending it back to the scanner # -1 = automatically set by driver - if known # 0 = disabled -# 1 = enabled +# 1 = enabled #option invert-shading-data 0 # define if the scanner supports lamp control commands # 0 = automatically set by driver - if known -# 1 = enabled +# 1 = enabled #option lamp-control-available 0 # define how 16 bit gamma data is padded # -1 = automatically set by driver - if known # 0 = gamma data is msb padded -# 1 = gamma data is lsb padded +# 1 = gamma data is lsb padded #option gamma-lsb-padded 0 # define connection type of following devices diff --git a/backend/umax.h b/backend/umax.h index 682e58b2a..e6b83fdb4 100644 --- a/backend/umax.h +++ b/backend/umax.h @@ -1,7 +1,7 @@ /* --------------------------------------------------------------------------------------------------------- */ /* umax.h - headerfile for SANE-backend for umax scanners - + (C) 1997-2002 Oliver Rauch This program is free software; you can redistribute it and/or @@ -39,7 +39,7 @@ 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. - + */ /* --------------------------------------------------------------------------------------------------------- */ @@ -58,7 +58,7 @@ /* #define SANE_UMAX_DEBUG_S12 */ /* #define UMAX_CALIBRATION_MODE_SELECTABLE */ - + /* --------------------------------------------------------------------------------------------------------- */ #define SANE_UMAX_SCSI_MAXQUEUE 8 @@ -269,7 +269,7 @@ typedef struct Umax_Device double inquiry_dor_y_off; /* double resolution y offset in inches */ int inquiry_exposure_adj; /* 1 if exposure adjust is supported */ - int inquiry_exposure_time_step_unit; /* exposure time unit in micro sec */ + int inquiry_exposure_time_step_unit; /* exposure time unit in micro sec */ int inquiry_exposure_time_max; /* exposure time maximum */ int inquiry_exposure_time_l_min; /* exposure tine minimum for lineart */ int inquiry_exposure_time_l_fb_def; /* exposure time default for lineart/flatbed */ diff --git a/backend/umax1220u-common.c b/backend/umax1220u-common.c index 43a4a6feb..e14dfea58 100644 --- a/backend/umax1220u-common.c +++ b/backend/umax1220u-common.c @@ -7,7 +7,7 @@ Parts copyright (C) 2006 Patrick Lessard 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 @@ -66,7 +66,7 @@ #include #include -/* +/* * The backend performs test scans in order to calibrate * the CCD and to find the zero location. If you would like * to look at those scans, define DEBUG_CALIBRATION to have diff --git a/backend/umax1220u.c b/backend/umax1220u.c index 79b8c9261..30c9e866d 100644 --- a/backend/umax1220u.c +++ b/backend/umax1220u.c @@ -376,7 +376,7 @@ optionTopLeftYCallback (SANE_Option * option, SANE_Handle handle, This option controls the bot-right-x corner of the scan */ -static SANE_Fixed optionBotRightXValue +static SANE_Fixed optionBotRightXValue = SANE_FIX (UMAX_MAX_WIDTH * MM_IN_INCH / 600); static SANE_Option_Descriptor optionBotRightXDescriptor = { diff --git a/backend/umax_pp.c b/backend/umax_pp.c index 0f7ce4e7a..179d212bc 100644 --- a/backend/umax_pp.c +++ b/backend/umax_pp.c @@ -41,10 +41,10 @@ This file implements a SANE backend for Umax PP flatbed scanners. */ /* CREDITS: - Started by being a mere copy of mustek_pp - by Jochen Eisinger - then evolved in its own thing - + Started by being a mere copy of mustek_pp + by Jochen Eisinger + then evolved in its own thing + support for the 610P has been made possible thank to an hardware donation from William Stuart */ diff --git a/backend/umax_pp.conf.in b/backend/umax_pp.conf.in index e7e9fd434..f220f1f84 100644 --- a/backend/umax_pp.conf.in +++ b/backend/umax_pp.conf.in @@ -39,19 +39,19 @@ option buffer 2097152 # valid values are 610, 1220, 1600 and 2000 # # by default, no model, we rely on autodetection -# in case you have black or 'inverted' scans, +# in case you have black or 'inverted' scans, # you may override detection by providing the # model number #option astra 1220 # DEVICES # -# specify the port your scanner is connected to. +# specify the port your scanner is connected to. # # the value 'auto' will make the backend find the correct value # by itself, it will scan ppdev, ppi device, then hardware address # 'safe-auto' will do the same but won't do direct hardware access -# on linux systems, you may provide the device name of the ppdev character +# on linux systems, you may provide the device name of the ppdev character # device : /dev/parport0, /dev/parport1, ...... # # on *BSD, you may provide the device name of the ppi device: /dev/ppi0, diff --git a/backend/umax_pp_low.c b/backend/umax_pp_low.c index 1e38aba52..968cf1705 100644 --- a/backend/umax_pp_low.c +++ b/backend/umax_pp_low.c @@ -865,7 +865,7 @@ sanei_parport_find_device (void) else { #ifdef HAVE_LINUX_PPDEV_H - /* on kernel < 2.4.23, you have to CLAIM the device + /* on kernel < 2.4.23, you have to CLAIM the device * to check it really exists * we may hang if another program already claimed it */ @@ -1793,8 +1793,8 @@ sanei_umax_pp_setauto (int autoset) } #ifdef HAVE_LINUX_PPDEV_H -/* set to the parallel port needed using ppdev - * returns 1 if ok, 0 else +/* set to the parallel port needed using ppdev + * returns 1 if ok, 0 else */ static int ppdev_set_mode (int mode) @@ -2807,7 +2807,7 @@ ECPregisterRead (int reg) Outb (CONTROL, 0x4); - /* ECP FIFO mode, interrupt bit, dma disabled, + /* ECP FIFO mode, interrupt bit, dma disabled, service bit, fifo full=0, fifo empty=0 */ ECPFifoMode (); /*Outb (ECR, 0x60); */ if (waitFifoEmpty () == 0) @@ -2825,12 +2825,12 @@ ECPregisterRead (int reg) } breg = Inb (ECR); - /* byte mode, interrupt bit, dma disabled, + /* byte mode, interrupt bit, dma disabled, service bit, fifo full=0, fifo empty=0 */ byteMode (); /*Outb (ECR, 0x20); */ Outb (CONTROL, 0x20); /* data reverse */ - /* ECP FIFO mode, interrupt bit, dma disabled, + /* ECP FIFO mode, interrupt bit, dma disabled, service bit, fifo full=0, fifo empty=0 */ ECPFifoMode (); /*Outb (ECR, 0x60); */ if (waitFifoNotEmpty () == 0) @@ -2963,12 +2963,12 @@ ECPregisterWrite (int reg, int value) } #endif - /* standard mode, interrupt bit, dma disabled, + /* standard mode, interrupt bit, dma disabled, service bit, fifo full=0, fifo empty=0 */ compatMode (); Outb (CONTROL, 0x04); /* reset ? */ - /* ECP FIFO mode, interrupt bit, dma disabled, + /* ECP FIFO mode, interrupt bit, dma disabled, service bit, fifo full=0, fifo empty=0 */ ECPFifoMode (); /*Outb (ECR, 0x60); */ if (waitFifoEmpty () == 0) @@ -3429,8 +3429,8 @@ ECPbufferWrite (int size, unsigned char *source) } breg = Inb (ECR); - /* block transfer direction - * 0x80 means from scanner to PC, 0xC0 means PC to scanner + /* block transfer direction + * 0x80 means from scanner to PC, 0xC0 means PC to scanner */ Outb (DATA, 0xC0); @@ -4957,7 +4957,7 @@ sendWord (int *cmd) /******************************************************************************/ /* ringScanner: returns 1 if scanner present, else 0 */ /******************************************************************************/ -/* +/* * in fact this function is really close to CPP macro in * /usr/src/linux/drivers/block/paride/epat.c ..... * we have almost CPP(8) @@ -6005,7 +6005,7 @@ initScanner610p (int recover) return 1; } - /* here we do re-homing + /* here we do re-homing * since it is first probe or recover */ /* move forward */ CMDSYNC (0xC2); @@ -6096,7 +6096,7 @@ initScanner610p (int recover) /* 1: OK 2: homing happened 3: scanner busy - 0: init failed + 0: init failed init transport layer init scanner @@ -6308,13 +6308,13 @@ sanei_umax_pp_initScanner (int recover) } -/* +/* 1: OK 2: failed, try again - 0: init failed + 0: init failed initialize the transport layer - + */ static int @@ -6400,13 +6400,13 @@ initTransport610p (void) return 1; } -/* +/* 1: OK 2: failed, try again - 0: init failed + 0: init failed initialize the transport layer - + */ static int @@ -6605,13 +6605,13 @@ initTransport1220P (int recover) /* ECP OK !! */ return 1; } -/* +/* 1: OK 2: failed, try again - 0: init failed + 0: init failed initialize the transport layer - + */ int @@ -6643,7 +6643,7 @@ probe610p (int recover) return 0; } - /* make sure we won't try 1220/200P later + /* make sure we won't try 1220/200P later * since we got here, we have a 610, and in any case * NOT a 1220P/2000P, since no EPAT present */ sanei_umax_pp_setastra (610); @@ -6660,7 +6660,7 @@ probe610p (int recover) } - /* + /* * try PS2 mode * returns 1 on success, 0 on failure */ @@ -9368,7 +9368,7 @@ cmdGetBlockBuffer (int cmd, int len, int window, unsigned char *buffer) return read; } -/* +/* * encodes DC offsets: must be in [0..0x0F] range */ static void @@ -9387,7 +9387,7 @@ decodeDC (int *motor) } -/* +/* * encodes VGA : must be in [0..0x0F] range */ static void @@ -9402,10 +9402,10 @@ encodeVGA (int vgaRed, int vgaGreen, int vgaBlue, int *motor) { motor[10] = (vgaGreen << 4) | vgaBlue; motor[11] = (motor[11] & 0xF0) | vgaRed; - /* ancien - F00: vert + /* ancien + F00: vert 0F0: bleu - 00F: rouge + 00F: rouge motor[10] = (vgaRed << 4) | vgaGreen; motor[11] = (motor[11] & 0xF0) | vgaBlue; */ } @@ -9693,7 +9693,7 @@ bloc8Decode (int *op) static int completionWait (void) { - /* for 610P, wait and sync is done while + /* for 610P, wait and sync is done while * reading data from the scanner */ CMDSYNC (0x40); usleep (100000); @@ -9893,7 +9893,7 @@ evalGain (int sum, int count) avg = (float) (sum) / (float) (count); pct = 100.0 - (avg * 100.0) / targetCode; gn = (int) (pct / 0.57); - + /* give gain for dark areas a boost */ #ifdef UMAX_PP_DANGEROUS_EXPERIMENT if(getenv("AREA")!=NULL) @@ -9907,7 +9907,7 @@ evalGain (int sum, int count) pct = gn; avg = exp((-pct)/area)*coeff+cnst; gn = gn * avg; - + /* bound checking : there are sightings of >127 values being negative */ if (gn < 0) gn = 0; @@ -9985,7 +9985,7 @@ computeCalibrationData (int color, int width, unsigned char *source, /* move head by the distance given using precision or not */ -/* 0: failed +/* 0: failed 1: success */ static int move (int distance, int precision, unsigned char *buffer) @@ -10437,11 +10437,11 @@ shadingCalibration1220p (int color, /* get calibration data */ /* if (sanei_umax_pp_getauto ()) - { auto settings doesn't use offset + { auto settings doesn't use offset offset = 0x000; } else - { manual settings + { manual settings gain = 0x777; offset = 0x000; } @@ -10743,7 +10743,7 @@ sanei_umax_pp_scan (int x, int y, int width, int height, int dpi, int color, read += len; } - /* in color mode we have to fill the 'reserve' area + /* in color mode we have to fill the 'reserve' area * so that we can reorder data lines */ while ((read - dataoffset < reserve) && (!gCancel)) { @@ -10823,8 +10823,8 @@ sanei_umax_pp_scan (int x, int y, int width, int height, int dpi, int color, } } /* copy tail lines for next block */ - /* memcpy (buffer, - * (buffer + reserve) + (hp * bpl - reserve), + /* memcpy (buffer, + * (buffer + reserve) + (hp * bpl - reserve), * reserve + remain); */ memcpy (buffer, buffer + hp * bpl, reserve + remain); break; @@ -11194,8 +11194,8 @@ sanei_umax_pp_startScan (int x, int y, int width, int height, int dpi, th = (height * dpi) / hwdpi; tw = (width * xdpi) / hwdpi; - /* corrects y to match exact scan area start - * and lets room for a leading zone so that + /* corrects y to match exact scan area start + * and lets room for a leading zone so that * we can reorder data */ switch (sanei_umax_pp_getastra ()) { @@ -11476,7 +11476,7 @@ sanei_umax_pp_startScan (int x, int y, int width, int height, int dpi, /* 3 ccd lines + 3 gamma tables + end tag */ if (sanei_umax_pp_getastra () <= 610) { - /* XXX STEF XXX : there is a 4 pixels shift to the right + /* XXX STEF XXX : there is a 4 pixels shift to the right * the first shading correction value applies to the forth * pixel of scan (at 300 dpi), we allready shift to the left * when doing shadingCalibration, but now we have to move coeffs @@ -11504,7 +11504,7 @@ sanei_umax_pp_startScan (int x, int y, int width, int height, int dpi, return 1; } -/* +/* * check the scanner model. Return 1220 for * a 1220P, or 2000 for a 2000P. * and 610 for a 610p @@ -11728,7 +11728,7 @@ loadDefaultTables (void) } /* set and reread first table */ - /* since 1660P seems to have another type of CCD + /* since 1660P seems to have another type of CCD * this table is not sent/needed */ err = 0; @@ -11829,7 +11829,7 @@ loadDefaultTables (void) return rc; } -/* inquire scanner status +/* inquire scanner status * O: failure * 1: OK * 2: first scanner init, needs re-homing @@ -12070,7 +12070,7 @@ offsetCalibration1220p (int color, int *offRed, int *offGreen, int *offBlue) * computes DC offset to have black pixel really black out of * CCD ie black gives 0 * 610P doesn't implement method described in LM9811 datasheet - * but scan a black line with decreasing offsets until the + * but scan a black line with decreasing offsets until the * scanned data reach a 'good black level'. * returns 1 and DC offsets in the corresponding vars on success . * On failure, returns 0. @@ -12247,7 +12247,7 @@ offsetCalibration610p (int color, int *offRed, int *offGreen, int *offBlue) return 1; } -/* +/* * generic offset calibration function */ static int @@ -12339,7 +12339,7 @@ coarseGainCalibration610p (int color, int dcRed, int dcGreen, int dcBlue, /* move back to desired area */ MOVE (-69, PRECISION_OFF, NULL); - /* first scan : taking a reference full width scan to + /* first scan : taking a reference full width scan to * find usable full width of the CCD */ *vgaRed = 0x08; diff --git a/backend/umax_pp_mid.c b/backend/umax_pp_mid.c index ee8d98d06..075fd3703 100644 --- a/backend/umax_pp_mid.c +++ b/backend/umax_pp_mid.c @@ -131,7 +131,7 @@ unlock_parport (void) -/* +/* * * This function recognize the scanner model by sending an image * filter command. 1220P will use it as is, but 2000P will return diff --git a/backend/umax_pp_mid.h b/backend/umax_pp_mid.h index 32245c665..30380832f 100644 --- a/backend/umax_pp_mid.h +++ b/backend/umax_pp_mid.h @@ -87,7 +87,7 @@ extern int sanei_umax_pp_attach (int port, char *name); extern int sanei_umax_pp_model (int port, int *model); -/* +/* if on=1 -> lights scanner lamp if on=0 -> lights off scanner lamp @@ -116,7 +116,7 @@ extern int sanei_umax_pp_open (int port, char *name); -/* +/* release any ressource acquired during open since there may be only one scanner, no port parameter */ @@ -145,9 +145,9 @@ extern int sanei_umax_pp_cancel (void); gain value is 256*red_gain+16*green_gain+blue_gain if gain is given (ie <> 0), auto gain will not be performed - - returns UMAX1220P_OK on success, or one of the error above + + returns UMAX1220P_OK on success, or one of the error above if successful, rbpp holds bytes/pixel, rth the height and rtw the width of scanned area expressed in pixels */ @@ -159,7 +159,7 @@ extern int sanei_umax_pp_start (int x, int y, int width, int height, int dpi, /* reads one block of data from scanner returns UMAX1220P_OK on success, or UMAX1220P_READ_FAILED on error it also sets internal cancel flag on error - + len if the length of the block needed window if the width in pixels of the scanned area dpi is the resolution, it is used to choose the best read method diff --git a/backend/v4l-frequencies.h b/backend/v4l-frequencies.h index 646120ecd..e926e7c91 100644 --- a/backend/v4l-frequencies.h +++ b/backend/v4l-frequencies.h @@ -3,7 +3,7 @@ * * Nathan Laredo (laredo@broked.net) * - * Frequencies are given in kHz + * Frequencies are given in kHz */ #define NTSC_AUDIO_CARRIER 4500 #define PAL_AUDIO_CARRIER_I 6000 @@ -16,7 +16,7 @@ containing 8 bits frame sync, 5 bits control, 11 bits additional data, and 704 bits audio data. The bit rate is reduced by transmitting only 10 bits plus parity of each 14 bit sample, the largest sample in a frame determines - which 10 bits are transmitted. The parity bits for audio samples also + which 10 bits are transmitted. The parity bits for audio samples also specify the scaling factor used for that channel during that frame. The companeded audio data is interleaved to reduce the influence of dropouts and the whole frame except for sync bits is scrambled for spectrum shaping. diff --git a/backend/v4l.c b/backend/v4l.c index 1e032c75e..006e7f70a 100644 --- a/backend/v4l.c +++ b/backend/v4l.c @@ -653,7 +653,7 @@ sane_open (SANE_String_Const devname, SANE_Handle * handle) DBG (5, "sane_open: x=%d, y=%d, width=%d, height=%d\n", s->window.x, s->window.y, s->window.width, s->window.height); - /* already done in sane_start + /* already done in sane_start if (-1 == v4l1_ioctl (v4lfd, VIDIOCGMBUF, &mbuf)) DBG (1, "sane_open: can't ioctl VIDIOCGMBUF (no Fbuffer?)\n"); */ diff --git a/backend/v4l.h b/backend/v4l.h index 6aee58640..e6673d0de 100644 --- a/backend/v4l.h +++ b/backend/v4l.h @@ -73,7 +73,7 @@ struct video_picture #define VIDEO_PALETTE_HI240 2 /* High 240 cube (BT848) */ #define VIDEO_PALETTE_RGB565 3 /* 565 16 bit RGB */ #define VIDEO_PALETTE_RGB24 4 /* 24bit RGB */ -#define VIDEO_PALETTE_RGB32 5 /* 32bit RGB */ +#define VIDEO_PALETTE_RGB32 5 /* 32bit RGB */ #define VIDEO_PALETTE_RGB555 6 /* 555 15bit RGB */ #define VIDEO_PALETTE_YUV422 7 /* YUV422 capture */ #define VIDEO_PALETTE_YUYV 8 @@ -112,7 +112,7 @@ struct video_mbuf int frames; /* Frames */ int offsets[VIDEO_MAX_FRAME]; }; - + struct video_mmap { unsigned int frame; /* Frame (0 - n) for double buffer */ @@ -130,7 +130,7 @@ struct video_channel #define VIDEO_VC_AUDIO 2 /* Channel has audio */ __u16 type; #define VIDEO_TYPE_TV 1 -#define VIDEO_TYPE_CAMERA 2 +#define VIDEO_TYPE_CAMERA 2 __u16 norm; /* Norm set by channel */ }; diff --git a/configure.ac b/configure.ac index 17d3c73f7..13a84bf00 100644 --- a/configure.ac +++ b/configure.ac @@ -280,7 +280,7 @@ AS_IF([test x != x$ALLOCA], [LTALLOCA=`echo "$ALLOCA" | sed 's/\.o$//; s/\.obj$//'`.lo]) AC_SUBST(LTALLOCA) -dnl Define SOCKET_LIB, NSL_LIB, BIND_LIB, and RESOLV_LIB when required +dnl Define SOCKET_LIB, NSL_LIB, BIND_LIB, and RESOLV_LIB when required dnl for functions we use. AC_CHECK_FUNC(gethostbyaddr,, [AC_CHECK_LIB(bind, gethostbyaddr, BIND_LIB="-lbind")]) AC_CHECK_FUNC(gethostbyaddr,, [AC_CHECK_LIB(nsl, gethostbyaddr, NSL_LIB="-lnsl")]) @@ -439,7 +439,7 @@ dnl conditional scans for more specific only as needed. # Unset VERSION during the SCSI header check sed "s!^#define VERSION .*!/* & */!" confdefs.h > confdefs.h.tmp mv confdefs.h.tmp confdefs.h - + AC_CHECK_HEADERS(IOKit/scsi/SCSITaskLib.h IOKit/cdb/IOSCSILib.h \ IOKit/scsi/SCSICommandOperationCodes.h \ IOKit/scsi-commands/SCSICommandOperationCodes.h scsi.h sys/scsi.h \ @@ -506,7 +506,7 @@ fi # Multiple platforms can set SCSI_LIBS so do substitution at end. AC_SUBST(SCSI_LIBS) -AC_ARG_ENABLE(scsibuffersize, +AC_ARG_ENABLE(scsibuffersize, AS_HELP_STRING([--enable-scsibuffersize=N], [specify the default size in bytes of the buffer for SCSI commands @<:@default=131072@:>@]), @@ -599,7 +599,7 @@ ALL_BACKENDS="abaton agfafocus apple artec artec_eplus48u as6e \ mustek_usb mustek_usb2 nec net niash pie pieusb pint \ pixma plustek plustek_pp qcam ricoh rts8891 s9036 \ sceptre sharp sm3600 sm3840 snapscan sp15c st400 \ - stv680 tamarack teco1 teco2 teco3 test u12 umax + stv680 tamarack teco1 teco2 teco3 test u12 umax umax_pp umax1220u v4l xerox_mfp p5" # If user specifies backends manually then cause configure @@ -608,7 +608,7 @@ ALL_BACKENDS="abaton agfafocus apple artec artec_eplus48u as6e \ user_selected_backends="yes" AC_ARG_VAR(BACKENDS, [list of backends to compile]) -if eval "test x$enable_local_backends = xno"; then +if eval "test x$enable_local_backends = xno"; then BACKENDS="net" else if test "${BACKENDS}" != "" ; then @@ -627,7 +627,7 @@ fi AM_CONDITIONAL(HAVE_JPEG, test x$sane_cv_use_libjpeg = xyes) AC_SUBST(SANEI_SANEI_JPEG_LO) -AC_ARG_ENABLE(pnm-backend, +AC_ARG_ENABLE(pnm-backend, AS_HELP_STRING([--enable-pnm-backend], [enable the pnm backend for testing frontends (possible security risk, see PROBLEMS file)]), [FILTERED_BACKENDS="${FILTERED_BACKENDS} pnm"], @@ -662,7 +662,7 @@ if test "${enable_preload}" = "yes"; then # are in automatic mode then remove backend from list instead. user_selected_backends="yes" - if eval "test x$enable_local_backends = xno"; then + if eval "test x$enable_local_backends = xno"; then PRELOADABLE_BACKENDS="net" else if test "${PRELOADABLE_BACKENDS}" != "" ; then @@ -714,7 +714,7 @@ esac AC_ARG_ENABLE(parport-directio, AS_HELP_STRING([--enable-parport-directio], - [enable direct hardware access to the parallel port, so + [enable direct hardware access to the parallel port, so frontends will require special permission level]), [ if eval "test x$enable_parport_directio = xyes"; then @@ -817,13 +817,13 @@ echo "Avahi support: `eval eval echo ${enable_avahi}`" echo "SNMP support: `eval eval echo ${with_snmp}`" echo "-> The following backends will be built:" for backend in ${BACKENDS} ; do - echo $ECHO_N "${backend} " + echo $ECHO_N "${backend} " done -echo +echo echo echo "-> The following preload backends will be built:" for backend in ${PRELOADABLE_BACKENDS} ; do - echo $ECHO_N "${backend} " + echo $ECHO_N "${backend} " done echo diff --git a/doc/Makefile.am b/doc/Makefile.am index 162d01aad..3c092dba5 100644 --- a/doc/Makefile.am +++ b/doc/Makefile.am @@ -183,7 +183,7 @@ DESC_FILES = descriptions/abaton.desc descriptions/agfafocus.desc \ descriptions/umax1220u.desc descriptions/umax.desc \ descriptions/umax_pp.desc descriptions/unsupported.desc \ descriptions/v4l.desc descriptions/xerox_mfp.desc -EXTRA_DIST += $(DESC_FILES) descriptions/template.desc. +EXTRA_DIST += $(DESC_FILES) descriptions/template.desc. DESC_EXT_FILES = descriptions-external/brother2.desc \ descriptions-external/brother.desc \ diff --git a/doc/backend-writing.txt b/doc/backend-writing.txt index 7e34d6a19..1d2092a83 100644 --- a/doc/backend-writing.txt +++ b/doc/backend-writing.txt @@ -45,7 +45,7 @@ CONFIGURATION AND BUILD SYSTEM Sane-backends uses the autoconf and automake tools. The configure script is generated from configure.ac and aclocal.m4 by running "autoreconf". Simple checks (e.g. for headers) should be placed into configure.ac while -for more complex stuff acinclude.m4 is the right file. After changes in one +for more complex stuff acinclude.m4 is the right file. After changes in one of these files, "autoreconf" should be called. This will then call a chain of autotools, such as autoconf to generate configure, autoheader to generate include/sane/config.h.in, and automake to generate various @@ -60,13 +60,13 @@ Running "make" runs the respective targets in the sub directories recursively. The Makefile.am in each directory contains lists of files which are part of the distribution and which are therefore copied to the tar.gz archive, when a -release is made. It's important that newly added files are also added to +release is made. It's important that newly added files are also added to a variable that will cause them to be distributed (EXTRA_DIST at a minimum). For creating binaries and libraries libtool is used. The ltmain.sh script -contains special modifications for SANE. These modifications ensure that -the soname of each SANE backend library is "libsane.so". Without this -change, backend libraries (like "libsane-epson.so") could not used as +contains special modifications for SANE. These modifications ensure that +the soname of each SANE backend library is "libsane.so". Without this +change, backend libraries (like "libsane-epson.so") could not used as on-the-fly replacement for the dll backend. DIRECTORY OVERVIEW @@ -76,7 +76,7 @@ This chapter explains some details about the files and directories used in the sane-backends distribution. sane-backends/ - * acinclude.m4 aclocal.m4 compile config.guess config.sub configure + * acinclude.m4 aclocal.m4 compile config.guess config.sub configure configure.ac depcomp install-sh ltmain.sh Makefile.am Makefile.in missing mkinstalldirs: Part of the build system as explained above. * ChangeLog: @@ -94,17 +94,17 @@ sane-backends/ General documentation + license. * NEWS: This is some kind of executive summary of the ChangeLog. It will be created - before a release. + before a release. * PROBLEMS: General (severe) problems that all SANE users should be - aware. Backend-specific trouble should normally not mentioned there. + aware. Backend-specific trouble should normally not mentioned there. * PROJECTS: Planned SANE-related development (e.g. ports, frontends). New backends won't be listed here but a new .desc file will be created for them (see below). * README: General building instructions. * README.aix README.beos (...): - Platform-dependent building and usage instructions. + Platform-dependent building and usage instructions. * sane-backends.lsm: The .lsm file as used for the ibiblio archive. @@ -117,13 +117,13 @@ sane-backends/backend/ directory. Code which is useful for more than one backend should be placed in sanei/ instead. * newbackend.c: - The main backend file, usually contains the SANE API code. Mandatory. + The main backend file, usually contains the SANE API code. Mandatory. * newbackend.h: Header file, containing includes and so on. * newbackend.conf.in: - Configuration file for the backend, newbackend.conf will be created by - running "make" from this file. Some variables are substituted, e.g. for - installation directories. This is especially useful for firmware + Configuration file for the backend, newbackend.conf will be created by + running "make" from this file. Some variables are substituted, e.g. for + installation directories. This is especially useful for firmware directories. See Makefile.am for a list. * newbackend-low.c: Contains low level code for the "newbackend" backend. Depending on the @@ -147,16 +147,16 @@ sane-backends/backend/ sane-backends/doc/ Documentation for SANE. For some more details, see chapter DOCUMENTATION below. Again an example for "newbackend": - * sane-newbackend.man: + * sane-newbackend.man: The manual page of the backend. From this file, "sane-newbackend.5" is - generated by running "make". + generated by running "make". * newbackend/ (directory) Contains additional information about newbackend, e.g. READMEs or TODO - files. + files. General files: * Makefile.am: "sane-newbackend.5" must be added to variable BACKEND_5MANS and - "sane-newbackend.man" to EXTRA_DIST. A backend documentation directory + "sane-newbackend.man" to EXTRA_DIST. A backend documentation directory (if used) must be added to the BEDOCS variable. * backend-writing.txt: This file. @@ -169,13 +169,13 @@ sane-backends/doc/ * sane.tex, net.tex: Contains the LaTeX source of the SANE standard. * descriptions/ (directory) - Contains the .desc files for every backend that is included into + Contains the .desc files for every backend that is included into sane-backends. * descriptions-external/ (directory) Contains the .desc files for backend that are not included into sane-backends yet (external backends). These files should only be created if the code it points to is really a SANE backend (and not just a command - line program). + line program). sane-backends/frontend/ Contains the frontends scanimage, saned, and tstbackend. @@ -186,8 +186,8 @@ sane-backends/include/ SANE-specific headers are located in include/sane/: * config.h.in: Main header file needed for portablility. config.h is created from this - file and must be included by every backend. - * sane.h: + file and must be included by every backend. + * sane.h: Official SANE API header file. Don't change this without discussion on the sane-devel mailing list. * saneopts.h: @@ -202,14 +202,14 @@ sane-backends/japi/ sane-backends/lib/ Contains various library functions that may miss in the standard C library - of some platforms. + of some platforms. sane-backends/po/ Translations of SANEbackend options. See README for details. sane-backends/sanei/ Sanei (SANE internal) code. Needed for code used in several backends - like USB access. For more details, see the documentaion on the SANE + like USB access. For more details, see the documentaion on the SANE website. sane-backends/testsuite/ @@ -231,14 +231,14 @@ PROGRAMMING least: - add the backend name to ALL_BACKENDS in configure.ac (and run autoreconf) - Add new backend to BACKEND_CONFS, be_convenience_libs, be_dlopen_libs, - and define _lib${backend}_la_SOURCES and + and define _lib${backend}_la_SOURCES and nodist_libsane_${backend}_la_SOURCES; using an existing backend as a template. Any sanei reference code should be listed in libsane_${backend}_la_LIBADD as well as any external libraries required to resolve all symbols. - - Add the source code files to the backend/ directories. All file names + - Add the source code files to the backend/ directories. All file names must start with the backend name (e.g. newbackend.c, newbackend.h and - newbackend-usb.c). + newbackend-usb.c). * Please follow the GNU coding standards. It's clear that the style outlined there is nobody's favorite, but it's much easier to @@ -295,7 +295,7 @@ PROGRAMMING * If you use headers or libraries that may not be available on all systems, write a check for configure.ac and include it conditionally. If your backend - depends on these libraries or headers, compile the backend only if they are + depends on these libraries or headers, compile the backend only if they are available (see pint for an example). * Use #include ".../include/sane/..." to include the sane header files @@ -311,9 +311,9 @@ PROGRAMMING * It's no longer necessary to #define PATH_MAX (now in sanei_backend.h). If you define it, do so *after* the system includes. -* Please use sanei functions whenever possible (e.g. +* Please use sanei functions whenever possible (e.g. sanei_config_read()). This makes porting to other os/platforms much - easier. Most of these functions are documented in their respective + easier. Most of these functions are documented in their respective header files in include/sane/sanei_*.h. For most of them there is also documentation in doxygen format: http://www.sane-project.org/sanei/. These HTML pages can be generated by calling "doxygen sanei-doxygen.conf" in @@ -389,7 +389,7 @@ TESTING compiled nor installed by default. To do that, cd into frontend and run "make tstbackend". -* Please test a backend not just with scanimage and xscanimage +* Please test a backend not just with scanimage and xscanimage (+ other frontends), but also with saned. Based on past experience, it is often the case that remote scanning can uncover subtle bugs. Note that you don't have to use two different machines to test "remote" @@ -402,7 +402,7 @@ TESTING access to other platforms, ask sane-devel. * Please make sure that all global symbols exported from a SANE backend start - with the prefix "sane" or "sanei" to avoid clashes with exported symbols + with the prefix "sane" or "sanei" to avoid clashes with exported symbols of other backends. Only symbols mentioned in the SANE standard should start with "sane_*". Make sure, the sanei_* symbols are unique, e.g. by using sanei_backendname_*. Only export symbols that are absolutely necessary. @@ -410,7 +410,7 @@ TESTING nm -g backend/.libs/libsane-hp.a - would list all global symbols in the HP backend. + would list all global symbols in the HP backend. "./configure; make; make libcheck" in the sane-backends root directory will name all backend libraries, that contain "illegal" symbols. @@ -433,8 +433,8 @@ DOCUMENTATION also a template for new .desc files: "template.desc.". The format of the files in the two directories is very similar. If you'd like to try parsing your creation to recreate the sane-backends webpages, cd into "tools/" and - enter "make sane-desc". You can either use sane-desc directly (try - "./sane-desc -h") or use "make html-pages" in "doc/". + enter "make sane-desc". You can either use sane-desc directly (try + "./sane-desc -h") or use "make html-pages" in "doc/". * For external backends, you don't need to supply :manpage and :version. The manpage link won't work anyway and version will be outdated soon. @@ -458,7 +458,7 @@ DOCUMENTATION version numbers. -CHECKLIST: SUBMITTING A NEW BACKEND +CHECKLIST: SUBMITTING A NEW BACKEND ----------------------------------- In sane-backends/ @@ -481,7 +481,7 @@ In sane-backends/doc/ check the html pages result with a browser. * Check that the backend version is the same in the source and in the description file. - + In sane-backends/po/ * Add all files using SANE_I18N() to po/POTFILES diff --git a/doc/canon/canon.install2700F.txt b/doc/canon/canon.install2700F.txt index 923a6d4a5..b80e8d94a 100644 --- a/doc/canon/canon.install2700F.txt +++ b/doc/canon/canon.install2700F.txt @@ -1,6 +1,6 @@ ----------------------------------------------------------------------- -How to install a CanoScan 2700F on a Linux box ? +How to install a CanoScan 2700F on a Linux box ? by Stephan Hegel . Date: Fri Jan 15 16:13:15 MEZ 1999 ----------------------------------------------------------------------- @@ -17,13 +17,13 @@ Corrections and suggestions are welcome, of course. Thank you. ----------------------------------------- The AVA-1502AP is is a small ISA Adaptec SCSI controller which is - shipped with the CanoScan slide scanner. Per default is has the + shipped with the CanoScan slide scanner. Per default is has the address 0x140, the IRQ 10 and the SCSI host id 7. Check first for conflicts with your already existing hardware. Install the controller into the computer. - After starting the BIOS should detect the board as a PNP board. + After starting the BIOS should detect the board as a PNP board. Boot the computer with the "SCSISelect" disk which is shipped with the scanner to check that the controller is detected. Don't change any settings except address, IRQ or SCSI id if necessary. @@ -32,13 +32,13 @@ Corrections and suggestions are welcome, of course. Thank you. SCSI Support (yes) SCSI Generic support (yes) Low level driver for aha152x (yes) - Note: here you can try to compile the SCSI support as modules as + Note: here you can try to compile the SCSI support as modules as long as you don't boot the computer from a SCSI disk. But this is not tested. Compile and install the new Linux kernel. - Add "aha152x=0x140,10,7" to the "append" line to the already existing + Add "aha152x=0x140,10,7" to the "append" line to the already existing kernel parameters in lilo.conf, e.g: ------------------- # Linux bootable partition config begins @@ -46,7 +46,7 @@ Corrections and suggestions are welcome, of course. Thank you. root = /dev/hdc1 label = linux append = "sbpcd=0x230,SoundBlaster aha152x=0x140,10,7" - # Linux bootable partition config ends + # Linux bootable partition config ends ------------------- Invoke lilo to activate the changes. @@ -64,12 +64,12 @@ Corrections and suggestions are welcome, of course. Thank you. on" since the scanner is the one and only device connected to my host adapter. - Turn on the scanner first and wait for a few second. The scanner + Turn on the scanner first and wait for a few second. The scanner performs a short self test. Turn on the computer. - Watch the boot messages, there should be a message indicating that + Watch the boot messages, there should be a message indicating that the SCSI host adapter and the scanner are there. Now you can check again that the scanner device is there: @@ -85,18 +85,18 @@ Corrections and suggestions are welcome, of course. Thank you. Fetch the latest SANE distribution from the SANE homepage at: http://www.sane-project.org/ - + Unpack and configure it. - + Get the latest canon backend from Manuel's homepage: http://www.rzg.mpg.de/~mpd/sane Put the files in the sane/backend directory as described in the README of the package. This overwrites the existing canon.* files with the latest version of these files. - + Compile and install SANE. - + Add the "canon" scanner to the /usr/local/etc/sane.d/dll.conf file: -------- cut here ------------ # enable the next line if you want to allow access through the network: @@ -108,12 +108,12 @@ Corrections and suggestions are welcome, of course. Thank you. #umax canon -------- cut here ------------ - + Add a "canon.conf" file to the /usr/local/etc/sane.d directory: -------- cut here ------------ - scsi CANON + scsi CANON -------- cut here ------------ - + Check the available scanners: scanimage -L This should give something like this: @@ -122,14 +122,14 @@ Corrections and suggestions are welcome, of course. Thank you. device `pnm:1' is a Noname PNM file reader virtual device Invoke the frontend: - xscanimage & - NOTE: The "xscanimage" frontend is in the SANE distribution. There - is also another SANE frontend available which is called "xsane" by - Oliver Rauch. It is still under heavy development and can be grabbed + xscanimage & + NOTE: The "xscanimage" frontend is in the SANE distribution. There + is also another SANE frontend available which is called "xsane" by + Oliver Rauch. It is still under heavy development and can be grabbed from: http://www.wolfsburg.de/~rauch - A dialog box appears, select the canon scanner and here we go ... + A dialog box appears, select the canon scanner and here we go ... Happy scanning !!! - + ----------------------------------------------------------------------- diff --git a/doc/descriptions-external/brother-mfc4600.desc b/doc/descriptions-external/brother-mfc4600.desc index 1d57e4724..f4e62a5f3 100644 --- a/doc/descriptions-external/brother-mfc4600.desc +++ b/doc/descriptions-external/brother-mfc4600.desc @@ -16,7 +16,7 @@ ; :yes or :no ;:manpage "sane-template" ; name of manpage (if it exists) :url "http://sourceforge.net/projects/brother-mfc" -;:comment "" +;:comment "" ; comment about the backend :devicetype :scanner ; start of a list of devices.... diff --git a/doc/descriptions-external/brother.desc b/doc/descriptions-external/brother.desc index a261712e7..00869623e 100644 --- a/doc/descriptions-external/brother.desc +++ b/doc/descriptions-external/brother.desc @@ -16,7 +16,7 @@ ; :yes or :no ;:manpage "sane-template" ; name of manpage (if it exists) :url "http://solutions.brother.com/linux/sol/printer/linux/sane_drivers.html" ; backend's web page -:comment "External backend made by brother. As this software contains non-free parts, it can't be included into SANE. If you can't find your model here, please have a look at the brother website which contains the latest list." +:comment "External backend made by brother. As this software contains non-free parts, it can't be included into SANE. If you can't find your model here, please have a look at the brother website which contains the latest list." ; comment about the backend :devicetype :scanner ; start of a list of devices.... diff --git a/doc/descriptions-external/brother2.desc b/doc/descriptions-external/brother2.desc index 92b54507d..afdb1a60b 100644 --- a/doc/descriptions-external/brother2.desc +++ b/doc/descriptions-external/brother2.desc @@ -16,7 +16,7 @@ ; :yes or :no ;:manpage "sane-template" ; name of manpage (if it exists) :url "http://solutions.brother.com/linux/sol/printer/linux/sane_drivers.html" ; backend's web page -:comment "External backend made by brother. As this software contains non-free parts, it can't be included into SANE. If you can't find your model here, please have a look at the brother website which contains the latest list." +:comment "External backend made by brother. As this software contains non-free parts, it can't be included into SANE. If you can't find your model here, please have a look at the brother website which contains the latest list." ; comment about the backend :devicetype :scanner ; start of a list of devices.... diff --git a/doc/descriptions-external/canon_mfp.desc b/doc/descriptions-external/canon_mfp.desc index e181d5374..d7dcca747 100644 --- a/doc/descriptions-external/canon_mfp.desc +++ b/doc/descriptions-external/canon_mfp.desc @@ -17,8 +17,8 @@ ;:manpage "sane-template" ; name of manpage (if it exists) :url "http://cweb.canon.jp/drv-upd/bj/other.html#linux"; :url "http://support-asia.canon-asia.com/"; -:comment "External backend made by canon. As this software contains non-free parts, it can't be included into SANE. If you can't find your model here, please have a look at the canon website which contains the latest list." -:comment "Note: these backend are designed by Canon and are part of their proprietary scanning software. They may not work at all with SANE, or with SANE frontends." +:comment "External backend made by canon. As this software contains non-free parts, it can't be included into SANE. If you can't find your model here, please have a look at the canon website which contains the latest list." +:comment "Note: these backend are designed by Canon and are part of their proprietary scanning software. They may not work at all with SANE, or with SANE frontends." ; comment about the backend :devicetype :scanner ; start of a list of devices.... diff --git a/doc/descriptions-external/cs3200f.desc b/doc/descriptions-external/cs3200f.desc index b734d020d..15c8c337a 100644 --- a/doc/descriptions-external/cs3200f.desc +++ b/doc/descriptions-external/cs3200f.desc @@ -16,7 +16,7 @@ ; :yes or :no ;:manpage "sane-cs3200f" ; name of manpage (if it exists) ;:url "http://www.luser.com/temp/" ; backend's web page -:comment "Backend is in experimental CVS" +:comment "Backend is in experimental CVS" ; comment about the backend :devicetype :scanner ; start of a list of devices.... diff --git a/doc/descriptions-external/hp3770.desc b/doc/descriptions-external/hp3770.desc index 7c2c60e9e..c6e8b9f6a 100644 --- a/doc/descriptions-external/hp3770.desc +++ b/doc/descriptions-external/hp3770.desc @@ -16,7 +16,7 @@ ; :yes or :no ;:manpage "sane-template" ; name of manpage (if it exists) :url "http://www.cyberbaladeur.fr/telechargement.html" ; backend's web page -:comment "This backend can't be added to the SANE distribution because it consists of binary-only code." +:comment "This backend can't be added to the SANE distribution because it consists of binary-only code." ; comment about the backend :devicetype :scanner ; start of a list of devices.... diff --git a/doc/descriptions-external/hp8200.desc b/doc/descriptions-external/hp8200.desc index 7dcf663b3..2be0cf8e4 100644 --- a/doc/descriptions-external/hp8200.desc +++ b/doc/descriptions-external/hp8200.desc @@ -16,7 +16,7 @@ ; :yes or :no ;:manpage "sane-template" ; name of manpage (if it exists) :url "http://www.cyberbaladeur.fr/telechargement.html" ; backend's web page -:comment "This backend can't be added to the SANE distribution because it consists of binary-only code." +:comment "This backend can't be added to the SANE distribution because it consists of binary-only code." ; comment about the backend :devicetype :scanner ; start of a list of devices.... diff --git a/doc/descriptions-external/lhii.desc b/doc/descriptions-external/lhii.desc index a75570966..5ce099065 100644 --- a/doc/descriptions-external/lhii.desc +++ b/doc/descriptions-external/lhii.desc @@ -16,7 +16,7 @@ ; :yes or :no ;:manpage "sane-template" ; name of manpage (if it exists) :url "http://www.sane-project.org/backends/lhii/lhii-v0.2.tgz" ; backend's web page -:comment "This backend is for old handscanners with proprietary adapter cards. You also need a kernel driver. You may find such drivers at that page: http://www.willamowius.de/scanner.html ." +:comment "This backend is for old handscanners with proprietary adapter cards. You also need a kernel driver. You may find such drivers at that page: http://www.willamowius.de/scanner.html ." ; comment about the backend :devicetype :scanner ; start of a list of devices.... diff --git a/doc/descriptions-external/panamfs.desc b/doc/descriptions-external/panamfs.desc index fd4992531..a82da1ffa 100644 --- a/doc/descriptions-external/panamfs.desc +++ b/doc/descriptions-external/panamfs.desc @@ -16,7 +16,7 @@ ; :yes or :no ;:manpage "sane-template" ; name of manpage (if it exists) :url "http://panasonic.net/pcc/support/fax/common/table/linuxdriver.html" ; backend's web page -:comment "External backend made by panasonic." +:comment "External backend made by panasonic." ; comment about the backend :devicetype :scanner ; start of a list of devices.... diff --git a/doc/descriptions-external/primascan.desc b/doc/descriptions-external/primascan.desc index 1f022028a..6815bcd2b 100644 --- a/doc/descriptions-external/primascan.desc +++ b/doc/descriptions-external/primascan.desc @@ -16,7 +16,7 @@ ; :yes or :no ;:manpage "sane-template" ; name of manpage (if it exists) :url "http://www.geocities.com/trsh0101/index.html" ; backend's web page -:comment "SANE backend and stand-alone program" +:comment "SANE backend and stand-alone program" ; comment about the backend :devicetype :scanner ; start of a list of devices.... diff --git a/doc/descriptions-external/template.desc. b/doc/descriptions-external/template.desc. index 25b9b5aed..f7ca92463 100644 --- a/doc/descriptions-external/template.desc. +++ b/doc/descriptions-external/template.desc. @@ -17,7 +17,7 @@ :manpage "sane-template" ; name of manpage (if it exists) :url "http://www.luser.com/temp/" ; backend's web page :url "http://www.luser.com/b/" ; another backend webpage -:comment "This backend supports only the USB and SCSI models" +:comment "This backend supports only the USB and SCSI models" ; comment about the backend :devicetype :scanner ; start of a list of devices.... diff --git a/doc/descriptions.txt b/doc/descriptions.txt index d4cab94d3..13bd9919f 100644 --- a/doc/descriptions.txt +++ b/doc/descriptions.txt @@ -44,7 +44,7 @@ should be `unmaintained' or contain this tag together with the version number. `:new' indicates that the backend is brand-new in the latest SANE release if the keyword argument is `:yes'. Otherwise, `:no' should be used or `:new' -should be omitted at all. +should be omitted at all. Example: `:new :yes' The `:manpage' keyword token has one string argument that names the manual @@ -117,7 +117,7 @@ Multi-level keyword tokens -------------------------- The following keyword tokens can be used after `:backend', `:mfg', `:model', -and `:desc'. +and `:desc'. One or more `:url' keyword tokens can be used to point to more information about the entry the keyword refers to. The string argument contains a URL to diff --git a/doc/descriptions/agfafocus.desc b/doc/descriptions/agfafocus.desc index bcb482f1f..950dd5873 100644 --- a/doc/descriptions/agfafocus.desc +++ b/doc/descriptions/agfafocus.desc @@ -1,6 +1,6 @@ :backend "agfafocus" :version "unmaintained" -:manpage "sane-agfafocus" +:manpage "sane-agfafocus" :devicetype :scanner diff --git a/doc/descriptions/apple.desc b/doc/descriptions/apple.desc index 046bb4ea2..462c74522 100644 --- a/doc/descriptions/apple.desc +++ b/doc/descriptions/apple.desc @@ -6,9 +6,9 @@ ;:url "http://no.www.page.yet/" ; backend's web page :devicetype :scanner ; start of a list of devices.... - + :mfg "Apple" -:url "http://developer.apple.com/" +:url "http://developer.apple.com/" :model "Apple Scanner" :interface "SCSI" :status :good ; :alpha, :beta, :stable, :new diff --git a/doc/descriptions/canon_dr.desc b/doc/descriptions/canon_dr.desc index 8bf6964b2..c4010642c 100644 --- a/doc/descriptions/canon_dr.desc +++ b/doc/descriptions/canon_dr.desc @@ -10,7 +10,7 @@ ; :backend "canon_dr" ; name of backend -:url "http://www.thebility.com/canon/" +:url "http://www.thebility.com/canon/" :version "51" ; version of backend :manpage "sane-canon_dr" ; name of manpage (if it exists) :comment "Backend updated for SANE release 1.0.25, see sane-canon_dr manpage" diff --git a/doc/descriptions/cardscan.desc b/doc/descriptions/cardscan.desc index df106de7a..52c303331 100644 --- a/doc/descriptions/cardscan.desc +++ b/doc/descriptions/cardscan.desc @@ -10,7 +10,7 @@ ; :backend "cardscan" ; name of backend -:url "http://www.thebility.com/cardscan/" +:url "http://www.thebility.com/cardscan/" :version "3" ; version of backend :manpage "sane-cardscan" ; name of manpage (if it exists) :comment "Backend updated for SANE release 1.0.21, see sane-cardscan manpage" diff --git a/doc/descriptions/coolscan.desc b/doc/descriptions/coolscan.desc index 6ccb49613..ea33f5c19 100644 --- a/doc/descriptions/coolscan.desc +++ b/doc/descriptions/coolscan.desc @@ -26,7 +26,7 @@ :model "LS-30" ; name models for above-specified mfg. :interface "SCSI" -:comment "alpha: only 24/30 bit RGB + 32/40 bit RGBI" +:comment "alpha: only 24/30 bit RGB + 32/40 bit RGBI" :status :basic :model "LS-2000" ; name models for above-specified mfg. @@ -36,7 +36,7 @@ :model "LS-1000" :interface "SCSI" -:comment "Doesn't support gamma correction" +:comment "Doesn't support gamma correction" :status :basic ; :comment and :url specifiers are optional after :mfg, :model, :desc, diff --git a/doc/descriptions/dc210.desc b/doc/descriptions/dc210.desc index 1f6191e27..3012fdd29 100644 --- a/doc/descriptions/dc210.desc +++ b/doc/descriptions/dc210.desc @@ -6,7 +6,7 @@ :url "mailto:peter@fales-lorenz.net" ; backend's web page :devicetype :stillcam ; start of a list of devices.... - + :mfg "Kodak" :url "http://www.kodak.com/global/en/service/digCam/dc210/dc210.shtml" :model "DC210" diff --git a/doc/descriptions/dc240.desc b/doc/descriptions/dc240.desc index 6250ce5ed..cfc6ab245 100644 --- a/doc/descriptions/dc240.desc +++ b/doc/descriptions/dc240.desc @@ -6,7 +6,7 @@ :url "mailto:peter@fales-lorenz.net" ; backend's web page :devicetype :stillcam ; start of a list of devices.... - + :mfg "Kodak" :url "http://www.kodak.com/global/en/service/products/ekn006568.jhtml" :model "DC240" diff --git a/doc/descriptions/epson.desc b/doc/descriptions/epson.desc index 65f466f13..33ae57e86 100644 --- a/doc/descriptions/epson.desc +++ b/doc/descriptions/epson.desc @@ -316,10 +316,10 @@ :usbid "0x04b8" "0x082b" :status :good -:model "DX-6000" -:interface "USB" -:usbid "0x04b8" "0x082e" -:status :good +:model "DX-6000" +:interface "USB" +:usbid "0x04b8" "0x082e" +:status :good :model "DX-7400" :interface "USB" diff --git a/doc/descriptions/fujitsu.desc b/doc/descriptions/fujitsu.desc index 60f8c5b51..2306b4355 100644 --- a/doc/descriptions/fujitsu.desc +++ b/doc/descriptions/fujitsu.desc @@ -11,7 +11,7 @@ :backend "fujitsu" ; name of backend -:url "http://www.thebility.com/fujitsu/" +:url "http://www.thebility.com/fujitsu/" :version "133" ; version of backend :manpage "sane-fujitsu" ; name of manpage (if it exists) :comment "Backend updated for SANE release 1.0.26, see sane-fujitsu manpage" @@ -26,7 +26,7 @@ ; DISCONTINUED OLDER MODELS, SMALL :model "M3091DC" :interface "SCSI" -:url "http://www.remote.org/frederik/projects/software/sane/" +:url "http://www.remote.org/frederik/projects/software/sane/" :status :complete :comment "small, old, discontinued" diff --git a/doc/descriptions/gphoto2.desc b/doc/descriptions/gphoto2.desc index f341649ad..dacc15dcd 100644 --- a/doc/descriptions/gphoto2.desc +++ b/doc/descriptions/gphoto2.desc @@ -6,7 +6,7 @@ :url "mailto:peter@fales-lorenz.net" ; backend's web page :devicetype :api ; start of a list of devices.... - + :desc "Multiple cameras supported by the gphoto2 libraries" :url "http://www.gphoto.org" ;:interface "USB, serial port" diff --git a/doc/descriptions/gt68xx.desc b/doc/descriptions/gt68xx.desc index 16e4af9f9..956a7b1e0 100644 --- a/doc/descriptions/gt68xx.desc +++ b/doc/descriptions/gt68xx.desc @@ -130,7 +130,7 @@ :mfg "Medion/Lifetec/Tevion/Cytron" :url "http://www.medion.com" :comment "Sold by Aldi and Tchibo." - + :model "MD 4394" :interface "USB" :usbid "0x05d8" "0x4002" diff --git a/doc/descriptions/hp4200.desc b/doc/descriptions/hp4200.desc index 6c2588229..8fe9b0fb1 100644 --- a/doc/descriptions/hp4200.desc +++ b/doc/descriptions/hp4200.desc @@ -40,4 +40,4 @@ :comment "8bpp color, 75/150/300/600 dpi only" ; :comment and :url specifiers are optional after :mfg, :model, :desc, -; and at the top-level. +; and at the top-level. diff --git a/doc/descriptions/kodak.desc b/doc/descriptions/kodak.desc index 7f0108a63..bef862dbe 100644 --- a/doc/descriptions/kodak.desc +++ b/doc/descriptions/kodak.desc @@ -1,5 +1,5 @@ :backend "kodak" -:url "http://www.thebility.com/kodak/" +:url "http://www.thebility.com/kodak/" :version "7" :manpage "sane-kodak" :comment "New backend for SANE release 1.0.21, see sane-kodak manpage" diff --git a/doc/descriptions/kodakaio.desc b/doc/descriptions/kodakaio.desc index 8c9c4cebd..de081cb3e 100644 --- a/doc/descriptions/kodakaio.desc +++ b/doc/descriptions/kodakaio.desc @@ -1,5 +1,5 @@ :backend "kodakaio" -:url "http://sourceforge.net/projects/cupsdriverkodak/" +:url "http://sourceforge.net/projects/cupsdriverkodak/" :version "2.7.2" :manpage "sane-kodakaio" :comment "Backend for Kodak AiO ESP and Hero printers. Also possibly Advent AWL10" diff --git a/doc/descriptions/leo.desc b/doc/descriptions/leo.desc index cf0cec360..4f25fca3d 100644 --- a/doc/descriptions/leo.desc +++ b/doc/descriptions/leo.desc @@ -17,7 +17,7 @@ :devicetype :scanner ; start of a list of devices.... :mfg "LEO" -:model "LEOScan S3" +:model "LEOScan S3" :interface "SCSI" :comment "FCC ID LUZFS1130" :status :good diff --git a/doc/descriptions/lexmark.desc b/doc/descriptions/lexmark.desc index ac0b97c3b..a97dd69c8 100644 --- a/doc/descriptions/lexmark.desc +++ b/doc/descriptions/lexmark.desc @@ -15,7 +15,7 @@ :url "http://stef.dev.free.fr/sane/lexmark" ; backend's web page -:comment "This backend supports lexmark x1100 series scanners." +:comment "This backend supports lexmark x1100 series scanners." ; comment about the backend :devicetype :scanner ; start of a list of devices.... diff --git a/doc/descriptions/ma1509.desc b/doc/descriptions/ma1509.desc index d28aeed46..de046760d 100644 --- a/doc/descriptions/ma1509.desc +++ b/doc/descriptions/ma1509.desc @@ -26,7 +26,7 @@ :interface "USB" :usbid "0x055f" "0x0010" :status :good -:comment "Works upto 600 dpi. No support for TA and ADF yet." +:comment "Works upto 600 dpi. No support for TA and ADF yet." :mfg "Fujitsu" ; name a manufacturer :url "http://www.fujitsu.com/" diff --git a/doc/descriptions/microtek.desc b/doc/descriptions/microtek.desc index 09203f5dd..e573cba94 100644 --- a/doc/descriptions/microtek.desc +++ b/doc/descriptions/microtek.desc @@ -1,6 +1,6 @@ :backend "microtek" :version "0.13.1 (unmaintained)" -:manpage "sane-microtek" +:manpage "sane-microtek" :url "http://www.mir.com/mtek/" :devicetype :scanner diff --git a/doc/descriptions/p5.desc b/doc/descriptions/p5.desc index 754890280..b62a95afd 100644 --- a/doc/descriptions/p5.desc +++ b/doc/descriptions/p5.desc @@ -24,7 +24,7 @@ :model "PagePartner" :interface "Parport (EPP/ECP)" -:status :basic +:status :basic :comment "Sheetfed scanner, work in gray and color, but uncalibrated scans" ; :comment and :url specifiers are optional after :mfg, :model, :desc, diff --git a/doc/descriptions/rts8891.desc b/doc/descriptions/rts8891.desc index e37f15853..7d5a63c48 100644 --- a/doc/descriptions/rts8891.desc +++ b/doc/descriptions/rts8891.desc @@ -12,10 +12,10 @@ :backend "rts8891" ; name of backend :version "1.0-0 (unmaintained)" ; version of backend (or "unmaintained") :manpage "sane-rts8891" ; name of manpage (if it exists) -:url "http://stef.dev.free.fr/sane/rts8891/index.html" +:url "http://stef.dev.free.fr/sane/rts8891/index.html" ; backend's web page -:comment "This backend supports Realtek RTS8891 ASIC bases scanners." +:comment "This backend supports Realtek RTS8891 ASIC bases scanners." ; comment about the backend :devicetype :scanner ; start of a list of devices.... diff --git a/doc/descriptions/sceptre.desc b/doc/descriptions/sceptre.desc index aa4f5150b..e636bdb4b 100644 --- a/doc/descriptions/sceptre.desc +++ b/doc/descriptions/sceptre.desc @@ -18,13 +18,13 @@ :mfg "Sceptre" :url "http://www.sceptre.com/" -:model "Vividscan S1200" +:model "Vividscan S1200" :interface "SCSI" :status :basic :mfg "Komodo" :url "http://www.komodo.com/" -:model "S1200" +:model "S1200" :interface "SCSI" :status :untested :comment "rebadged Sceptre S1200" diff --git a/doc/descriptions/sharp.desc b/doc/descriptions/sharp.desc index 63000af9d..10349ba7b 100644 --- a/doc/descriptions/sharp.desc +++ b/doc/descriptions/sharp.desc @@ -1,7 +1,7 @@ :backend "sharp" ; name of backend :version "0.32 (unmaintained)" ; version of backend ;:status :beta ; :alpha, :beta, :stable, :new -:url "http://www.satzbau-gmbh.de/staff/abel/sane-sharp.html" +:url "http://www.satzbau-gmbh.de/staff/abel/sane-sharp.html" ; backend's homepage :manpage "sane-sharp" :devicetype :scanner diff --git a/doc/descriptions/sm3840.desc b/doc/descriptions/sm3840.desc index e40193f12..35c7c390b 100644 --- a/doc/descriptions/sm3840.desc +++ b/doc/descriptions/sm3840.desc @@ -14,7 +14,7 @@ :version "1.1 (unmaintained)" ; version of backend (or "unmaintained") :manpage "sane-sm3840" ; name of manpage (if it exists) :url "http://www.ziplabel.com/sm3840/" ; backend's web page -:comment "This reverse-engineered backend supports the USB ScanMaker 3840 model" +:comment "This reverse-engineered backend supports the USB ScanMaker 3840 model" ; comment about the backend :devicetype :scanner ; start of a list of devices.... diff --git a/doc/descriptions/template.desc. b/doc/descriptions/template.desc. index 25b9b5aed..f7ca92463 100644 --- a/doc/descriptions/template.desc. +++ b/doc/descriptions/template.desc. @@ -17,7 +17,7 @@ :manpage "sane-template" ; name of manpage (if it exists) :url "http://www.luser.com/temp/" ; backend's web page :url "http://www.luser.com/b/" ; another backend webpage -:comment "This backend supports only the USB and SCSI models" +:comment "This backend supports only the USB and SCSI models" ; comment about the backend :devicetype :scanner ; start of a list of devices.... diff --git a/doc/descriptions/umax_pp.desc b/doc/descriptions/umax_pp.desc index e07a4a0b8..f95e82fa2 100644 --- a/doc/descriptions/umax_pp.desc +++ b/doc/descriptions/umax_pp.desc @@ -22,41 +22,41 @@ :mfg "UMAX" ; name a manufacturer :url "http://www.umax.com.tw/" -; These scanners are known to have the same ASIC family. +; These scanners are known to have the same ASIC family. :model "Astra 1220P" :interface "Parport (EPP/ECP)" -:status :good +:status :good :model "Astra 2000P" :interface "Parport (EPP/ECP)" -:status :good +:status :good :model "Astra 1600P" :interface "Parport (EPP/ECP)" -:status :good +:status :good :model "Astra 600P" :interface "Parport (SPP/ECP)" -:status :unsupported +:status :unsupported :comment "untested, but should be close to 610P" :model "Astra 610P" :interface "Parport (SPP/ECP)" -:status :good +:status :good :mfg "Hewlett-Packard" :model "Scanjet 3200C" :interface "Parport (EPP/ECP)" -:status :good +:status :good :comment "works (relabelled 1220P and 2000P)" :mfg "Genius" :model "ColorPage-Life Pro" :interface "Parport (EPP/ECP)" -:status :good +:status :good :comment "works (relabelled 1220P and 2000P)" ; :comment and :url specifiers are optional after :mfg, :model, :desc, diff --git a/doc/descriptions/unsupported.desc b/doc/descriptions/unsupported.desc index 2217594b8..49350bc2d 100644 --- a/doc/descriptions/unsupported.desc +++ b/doc/descriptions/unsupported.desc @@ -968,14 +968,14 @@ :usbid "0x043d" "0x00bb" :status :unsupported :comment "Unsupported. See link for details." - + :model "X3450" :url "/unsupported/lexmark-x3450.html" :interface "USB" :usbid "0x043d" "0x00f6" :status :unsupported :comment "Unsupported. See link for details." - + :model "X5130" :url "/unsupported/lexmark-x5130.html" :interface "USB" @@ -2778,4 +2778,4 @@ ; :comment and :url specifiers are optional after :mfg, :model, :desc, ; and at the top-level. - + diff --git a/doc/gamma4scanimage.man b/doc/gamma4scanimage.man index fe81b15a8..576d1480e 100644 --- a/doc/gamma4scanimage.man +++ b/doc/gamma4scanimage.man @@ -3,9 +3,9 @@ .SH NAME gamma4scanimage \- create a gamma table for scanimage .SH SYNOPSIS -.B gamma4scanimage +.B gamma4scanimage .I gamma -.RI [ shadow +.RI [ shadow .RI [ highlight .RI [ maxin .RI [ maxout ]]]] @@ -52,7 +52,7 @@ defines the maximum output value. Take a look at the output of scanimage \-h to find out what maxout has to be. The default value is 255. .PP .SH EXAMPLE -.B scanimage \-\-custom\-gamma=yes \-\-gamma\-table +.B scanimage \-\-custom\-gamma=yes \-\-gamma\-table .I `gamma4scanimage 1.8 0 11500 16383 255` >image.pnm diff --git a/doc/gt68xx/gt68xx.CHANGES b/doc/gt68xx/gt68xx.CHANGES index 43f2e8555..aa8750463 100644 --- a/doc/gt68xx/gt68xx.CHANGES +++ b/doc/gt68xx/gt68xx.CHANGES @@ -17,7 +17,7 @@ V 1.0.82 (2006-10-03) V 1.0.81 (2006-05-21) * Added support for Plustek OpticPro S24 (some models). Added .conf entry for - Plustek OpticPro S12. + Plustek OpticPro S12. V 1.0.80 (2006-01-02) @@ -34,7 +34,7 @@ V 1.0.79 (2005-12-09) sane-backends 1.0.17 scanners are not detected anymore after closing the device. * Fixed wait_lamp_stable. Wait for a maximum time of 60 seconds. Print warming up message after 5 seconds. Print how long warming up took. -* For Mustek ScanExpress A3 USB, use more intelligent warm-up mechanism. The +* For Mustek ScanExpress A3 USB, use more intelligent warm-up mechanism. The brightness for this scanner first decreases and then increases again. With the previous logic the scanner always warmed up for at least 10 seconds even if it wasn't necessary. @@ -50,7 +50,7 @@ V 1.0.78 (2005-10-16) V 1.0.77 (2005-09-29) * Added support for Plustek OpticSlim M12 (untested). Based on patch from - Gerhard Jaeger . + Gerhard Jaeger . * Fixed gt68xx homepage links in man page. Changed minimum version of libusb to 0.1.8. @@ -290,7 +290,7 @@ V 1.0-55 (2004-03-06) * Added detection for Genius Vivid 1200 EX. * Fixed product id of Mustek BearPaw 2448 TA Plus. * Other minor updates. - + V 1.0-54 (2004-02-10) * Added basic support for Plustek OpticSlim 2400. Thanks to Radoslaw Grzanka and @@ -335,7 +335,7 @@ V 1.0-49 (2003-09-30) * Added ScanMagic 1200 UB Plus to man page and .desc. * Added Settings for Plustek OpticSlim 1200 * Added detection of Genius Vivid 4x. It won't work out-of-the-box, however. -* CCD coarse calib shouldn't run into an endless loop anymore. Plustek 1248U +* CCD coarse calib shouldn't run into an endless loop anymore. Plustek 1248U is much faster now. V 1.0-48 (2003-07-25) @@ -376,7 +376,7 @@ V 1.0-43 (2003-03-06) - Small requests are done with a response buffer of 8 bytes (instead of 64) now. Looks like GT-6816 based scanners return 8 bytes if the firmware is loaded and 64 bytes if it's not loaded. -- Changed GT-6816 firmware check to ignore errors from above change. +- Changed GT-6816 firmware check to ignore errors from above change. GT-6816 scanners work with the BSDs now (at least once). - Updated manpage concerning the BSDs. @@ -527,8 +527,8 @@ V 1.0-27 (2002-10-25) - Removed override for Trust Copmact Scan and Medion/Tevion/Lifetec LT 9452 (Mustek ScanExpress 1200 UB Plus clones). - Removed override for Tevion MD 9458 (seems to be an Artec Ultima 2000 (e +?) - clone). - + clone). + V 1.0-26 (2002-10-22) - Several fixes for Medion MD-9385 and Artec Ultima 2000 based scanners. The diff --git a/doc/leo/leo.txt b/doc/leo/leo.txt index 4f4eb61c0..26dbe2160 100644 --- a/doc/leo/leo.txt +++ b/doc/leo/leo.txt @@ -3,8 +3,8 @@ Across Technologies FS-1130 (A rebadged LEO Technologies) - 000: 06 31 14 01 1f 00 00 00 41 43 52 4f 53 53 20 20 .1......ACROSS - 016: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 + 000: 06 31 14 01 1f 00 00 00 41 43 52 4f 53 53 20 20 .1......ACROSS + 016: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 032: 31 2e 31 36 09 f6 0d b6 01 2c 01 2c 39 36 30 30 1.16.....,.,9600 @@ -16,12 +16,12 @@ LEO LEOScan S3: or 000: 06 00 02 02 1f 00 00 00 4c 45 4f 00 00 00 00 00 ........LEO..... 016: 4c 45 4f 53 63 61 6e 2d 53 33 00 00 00 00 00 00 LEOScan-S3...... - 032: 31 2e 31 30 1.10 + 032: 31 2e 31 30 1.10 Genius FS1130 000: 06 31 14 01 1f 00 00 00 4b 59 45 20 43 4f 52 50 .1......KYE CORP 016: 43 6f 6c 6f 72 50 61 67 65 2d 43 53 20 20 20 20 ColorPage-CS - 032: 31 2e 31 34 1.14 + 032: 31 2e 31 34 1.14 /*--------------------------------------------------------------------------*/ @@ -52,7 +52,7 @@ Start a scan SET WINDOW 24 00 00 00 00 00 30 00 00 00 Total length is 48 bytes - 01 = 0x2E (may be 0x30 - 2, ie total length -2) + 01 = 0x2E (may be 0x30 - 2, ie total length -2) 07 = length (48-8 = 40 = 0x28) 10-11 = X Resolution 12-13 = Y resolution @@ -66,7 +66,7 @@ Total length is 48 bytes 0x01 = halftone 0x02 = grayscale 0x05 = color - 34 = bit depth + 34 = bit depth 1 or 8 37 = ? RIF + other 43 = ? 0x01 @@ -77,7 +77,7 @@ READ SEND -2A 00 03 00 00 01 00 03 00 00 +2A 00 03 00 00 01 00 03 00 00 2A 00 02 00 00 0F 00 01 00 00 2 = data type code 0x02 = halftone pattern @@ -89,13 +89,13 @@ GET DATA BUFFER STATUS 7-8 allocation length returned buffer is 0x10 bytes long. - 00 00 0D 00 00 00 03 D3 60 00 00 00 01 48 00 EE - + 00 00 0D 00 00 00 03 D3 60 00 00 00 01 48 00 EE + 0-2 = additional length (0x10-3 = 0x0D) 6-8 = (?) total scan length 9-11 = filled data buffer 12-13 = number of lines left (decrease during a scan) - 14-15 = bytes per line (constant during a scan) + 14-15 = bytes per line (constant during a scan) /*--------------------------------------------------------------------------*/ @@ -119,7 +119,7 @@ park the CCD: SET WINDOWS TUR SCAN - + /*--------------------------------------------------------------------------*/ Command sequence for the S3 diff --git a/doc/matsushita/matsushita.txt b/doc/matsushita/matsushita.txt index 72b8fcdda..0de6d94ed 100644 --- a/doc/matsushita/matsushita.txt +++ b/doc/matsushita/matsushita.txt @@ -38,12 +38,12 @@ REQUEST SENSE: INQUIRY: 12 00 00 00 60 00 result: - 06 00 02 02 5B 00 00 10 4B 2E 4D 2E 45 2E 20 20 - 4B 56 2D 53 53 32 35 41 20 20 20 20 20 20 20 20 - 31 2E 30 35 00 00 00 00 00 00 00 00 00 00 00 00 - 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 - 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 - 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 + 06 00 02 02 5B 00 00 10 4B 2E 4D 2E 45 2E 20 20 + 4B 56 2D 53 53 32 35 41 20 20 20 20 20 20 20 20 + 31 2E 30 35 00 00 00 00 00 00 00 00 00 00 00 00 + 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 + 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 + 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 SET WINDOWS: 24 00 00 00 00 00 00 00 00 00 @@ -51,9 +51,9 @@ SET WINDOWS: 24 00 00 00 00 00 00 00 48 00 72 bytes. 6-7 = 0x40 = window descriptor length - + Window Descriptor Block: - 0 = page side + 0 = page side 0x00 = front 0x80 = back 2-3 = X resolution @@ -80,7 +80,7 @@ SET WINDOWS: 0x80 = User downloaded pattern 29 = reverse image 0x00 = no reverse - 0x80 = reverse + 0x80 = reverse 43 = image emphasis 0x80 smooth 0x00 none @@ -111,7 +111,7 @@ SET WINDOWS: 0x82 = mode 3 59 = automatic separation 0x00 = no (twain default) - 0x80 = yes + 0x80 = yes 60 = white level 0x00 = from white stick (twain default) 0x80 = from paper @@ -136,7 +136,7 @@ READ: 5: page side 0x00 = front 0x80 = back - + 0x80 image size in dots 3(?)-4: number of the page to read. Multipage mode. @@ -147,7 +147,7 @@ READ: SEND(10): 2A 00 03 00 00 01 00 01 0A 00 2 = data type code - 0x02 = halftone pattern + 0x02 = halftone pattern data is 10 bytes of header + 64 bytes for the matrix 0x03 = gamma table data is 10 bytes of header + 256 bytes for the table diff --git a/doc/mustek/mustek.CHANGES b/doc/mustek/mustek.CHANGES index b7c7e2bff..c5de63c25 100644 --- a/doc/mustek/mustek.CHANGES +++ b/doc/mustek/mustek.CHANGES @@ -212,7 +212,7 @@ CHANGES for the SANE Mustek backend * Added OS/2 compatibility fixes from "Franz Bakan" . 2001-11-18 - * The Primax Compact 4800 seems to bes also supported. Added .desc and + * The Primax Compact 4800 seems to bes also supported. Added .desc and manpage entries. 2001-09-10 @@ -290,7 +290,7 @@ CHANGES for the SANE Mustek backend 2001-04-19 * Don't check for macro VERSION any longer in sane_init. Print out - PACKAGE_VERSION instead. + PACKAGE_VERSION instead. * Update email address and homepage. 2001-08-08 @@ -348,7 +348,7 @@ CHANGES for the SANE Mustek backend 2000-12-31 * Released Mustek backend 1.0-103 - + 2000-12-30 * Implemented calibration (color and gray mode) for the Paragon 1200 Pro. It's not perfect and needs lots of tests. It may work for the Paragon @@ -360,14 +360,14 @@ CHANGES for the SANE Mustek backend * Increased scan width to 8.6" for 1200 Pro. 2000-12-26 - * Added calibration for the SE 12000 SP Plus. Doesn't fully work until now + * Added calibration for the SE 12000 SP Plus. Doesn't fully work until now (images are too dark and colored). 2000-12-23 * Added option for Legal format (because the ScanExpress 12000 SP A4 size scanner can't be distinguished from the Paragon 1200 LS Legal size scanner by software). - + 2000-12-21 * Added a few checks for Null-Pointers. * Removed old code for SE calibration. @@ -378,7 +378,7 @@ CHANGES for the SANE Mustek backend 2000-12-10 * Released Mustek backend 1.0-102 - + 2000-12-09 * Fixed wrong comment in encode_resolution * Added missing test for return status in sane_start @@ -386,7 +386,7 @@ CHANGES for the SANE Mustek backend 2000-12-05 * Released Mustek backend 1.0-101 - + 2000-12-05 * Fixed lamp setting (avoid problems with some SE scanners). @@ -443,18 +443,18 @@ CHANGES for the SANE Mustek backend scanning (seems to work for firmware >= 2.00) * Adjusted transparency adapter support for all ScanExpress scanners. The 12000 A3 SP can only do A4 beacuse I don't have the right TA. - * don't use u_int* types in mustek.h because the definitions for these + * don't use u_int* types in mustek.h because the definitions for these types are not included 2000-11-04 * SE scanners can now scan 75, 100, 150, 200, 250, 300, 400, 500, 600, - 900 and 1200 dpi in color mode (the 1200 dpi models). These are fixed + 900 and 1200 dpi in color mode (the 1200 dpi models). These are fixed resolutions, a resolution >= the wanted resolution is selected. This makes preview and some resolutions faster than before (at least for some scanners), because lower resolutions can be used. - * Minimum scan resolution is 60 dpi in gray and lineart and 75 dpi in + * Minimum scan resolution is 60 dpi in gray and lineart and 75 dpi in color mode for the SE scanners now. - + 2000-10-29 * Fixed a bug concerning block LD. Paragon 1 and 2 were exchanged. * Paragon 12000SP color mode works now without garbage at the end @@ -479,9 +479,9 @@ CHANGES for the SANE Mustek backend 2000-10-03 * Released backend version 1.0-98. - + 2000-10-03 - * Fixed segmentation fault in sane_init (else statement was missing). + * Fixed segmentation fault in sane_init (else statement was missing). Thanks to Oliver Rauch who spotted this problem. * Re-enabled double buffering. @@ -518,7 +518,7 @@ CHANGES for the SANE Mustek backend 2000-09-24 * Released backend version 1.0-97. - + 2000-09-24 * Added RGB brightness and contrast for 3pass scanners * Brightness and contrast is +-100% for 3pass scanners now @@ -635,7 +635,7 @@ CHANGES for the SANE Mustek backend 2000-07-26 * fixed possible segfault pointer info was not checked for 0 (found by Petter Reinholdtsen) - * Updated comment about Paragon 600 II N linedistance correction in man + * Updated comment about Paragon 600 II N linedistance correction in man page 2000-07-25 @@ -643,7 +643,7 @@ CHANGES for the SANE Mustek backend 2000-07-25 * Released backend version 1.0-92 - + 2000-07-24 * Fixed ADF handling (output was mirrored in x direction). Gray and lineart seems to work now. Color and halftone modes look somewhat crazy. @@ -682,7 +682,7 @@ CHANGES for the SANE Mustek backend * Released backend version 1.0-89 2000-06-30 - * Fixed bug in do_stop. The scan slider didn't return after the scan + * Fixed bug in do_stop. The scan slider didn't return after the scan in some situations. 2000-06-28 @@ -703,7 +703,7 @@ CHANGES for the SANE Mustek backend 2000-06-25 * updated manpage concerning parport and USB scanners - * added example for 600 II N to mustek.conf + * added example for 600 II N to mustek.conf 2000-06-22 * fixed debug output bug in fix_linedistance_se (found by Jan-Erik Karlsson) @@ -750,7 +750,7 @@ CHANGES for the SANE Mustek backend * Code cleanup and reorganization for inclusion of the Paragon 1200 A3 Pro. 2000-06-07 - * Fixed bug in sane_close where the chain of handles got destroyed by + * Fixed bug in sane_close where the chain of handles got destroyed by closing the first device. This bug is in the backend since 3 1/2 years. Thanks to Jochen Eisinger for spotting this. @@ -762,7 +762,7 @@ CHANGES for the SANE Mustek backend 2000-06-04 * changed (again) Paragon 12000 SP linedistance handling, now 1.02 uses - normal LD corrections, all other use none. We'll see, if this works. + normal LD corrections, all other use none. We'll see, if this works. Thanks to Reinhard Günzel who helped to debug this. * fixed some long lines (>80 chars) @@ -805,7 +805,7 @@ CHANGES for the SANE Mustek backend 2000-05-08 * fixed remaining sane_cancel problems (in non_blocking mode) - * fixed color stripes and segmentation fault for Paragon MFS-12000SP + * fixed color stripes and segmentation fault for Paragon MFS-12000SP 1.00 (at least for me) * added more debug output to inquiry * added possibility to distinguish old and new firmware formats @@ -816,14 +816,14 @@ CHANGES for the SANE Mustek backend * released backend version 1.0-81 2000-05-06 - * added transparency adapter support for the Paragon 600 II CD, 600S, + * added transparency adapter support for the Paragon 600 II CD, 600S, 800 II SP, 600 II N, ScannExpress 6000SP and 12000SP * removed "color lineart" and "color halftone" for all scanners. These modes didn't work for any of my scanners. * added more debug output for ADF and TA * fixed bug when ADF is out of documents * Scan source option is only available if TA or ADF is present. For - SE and N models TA is always available because it can't be detected + SE and N models TA is always available because it can't be detected by hardware * removed "backtrack", "speed" and "grain" from 600 II N options, the scanner doesn't support them @@ -839,12 +839,12 @@ CHANGES for the SANE Mustek backend * Added Warning for scanners that are not (fully) tested 2000-04-26 - * changed sane_init to use sanei_config_read () and + * changed sane_init to use sanei_config_read () and sanei_config_get_string () 2000-04-24 * released backend version 1.0-80 - + 2000-04-23 * fixed lineart and color scanning >600 dpi for the SE 12000SP * added variable debug_level to be faster without debugging in attach () @@ -863,13 +863,13 @@ CHANGES for the SANE Mustek backend 2000-04-20 * Output of scanning time now works with scanimage, too. - * Adjusted scan area to the Windows driver defaults for Paragon + * Adjusted scan area to the Windows driver defaults for Paragon MFS-6000CX * Added transparency adapter support for the Paragon MFS-6000CX and MFS-12000SP 2000-04-19 - * Adjusted scan area to the Windows driver defaults for Paragon + * Adjusted scan area to the Windows driver defaults for Paragon MFS-12000SP 2000-04-17 @@ -883,14 +883,14 @@ CHANGES for the SANE Mustek backend These modes didn't work for any of my scanners. * fixed problems in color mode for the MFS-8000SP (gamma table is now uploaded even if not selected) - * Output "cover open" only for ScanExpress scanners (Paragon scanners + * Output "cover open" only for ScanExpress scanners (Paragon scanners don't have a cover sensor) * Added transparency adapter support for the Paragon MFS-6000SP and MFS-12000CX * Added output of transfer speed (kb/s) * maximum allocated memory for read request can be set by a #define * buffer size can be set on a per scanner basis - * Adjusted scan area to the Windows driver defaults for Paragon + * Adjusted scan area to the Windows driver defaults for Paragon 800 II SP * Added quotation marks to inquiry output @@ -899,7 +899,7 @@ CHANGES for the SANE Mustek backend ScanExpress 12000SP * Fixed scan area settings (TL-X and TL-Y) for transparency adapter (TA) * Added TA support for Paragon 8000SP - + 2000-04-13 * Added more debug output in sane_read and some other functions * removed warnings @@ -913,7 +913,7 @@ CHANGES for the SANE Mustek backend 2000-04-09 * released backend version 1.0-79 - + 2000-04-08 * added output of scanning time (debuglevel 2 and higher) * removed old code from sane_cancel @@ -931,16 +931,16 @@ CHANGES for the SANE Mustek backend 2000-04-03 * output backend and version information * fixed resolution encoding for MFS12000cx - * Changed version system to be compatible to the SANE standard + * Changed version system to be compatible to the SANE standard (major, minor, build); 0.78 --> 1.0-78 - + 2000-04-02 * released backend version 0.78 * added MUSTEK_FLAG_DOUBLE_RES for the MFS-12000CX 3-pass scanner, resolutions > 600 dpi should work now - + 2000-04-01 - * reduced scan area for Paragon 800 S / II SP + * reduced scan area for Paragon 800 S / II SP 2000-03-29 * released backend version 0.77 @@ -948,17 +948,17 @@ CHANGES for the SANE Mustek backend * more debug level tweaking * man page update * model name update - + 2000-03-25 * corrected some spelling errors - + 2000-03-24 * reduced scanarea for the MSF-6000SP * restructured scanner recognition 2000-03-18 * released backend version 0.76 - + 2000-03-17 * removed some compiler warnings * changed the sane.model names (e.g. ScanExpress 12000SP instead of @@ -978,12 +978,12 @@ CHANGES for the SANE Mustek backend possibly never happen) * fixed firmware version identification for newer ScanExpress models (patch from Marco G. Salvagno) - * probably fixed linedistance correction at high resolutions for + * probably fixed linedistance correction at high resolutions for MFS-1200SP firmware 1.00 and possibly others (patch from Andreas Beck) * added check for ADF ready in sane_start (patch from Joerg Anders) * Bug fix in the STORE makros (patch from Norbert Mueller) - - + + 2000-03-06 * created mustek.CHANGES file * released backend version 0.74 diff --git a/doc/mustek_usb/mustek_usb.CHANGES b/doc/mustek_usb/mustek_usb.CHANGES index 7b01c4af6..8e257c8d3 100644 --- a/doc/mustek_usb/mustek_usb.CHANGES +++ b/doc/mustek_usb/mustek_usb.CHANGES @@ -17,7 +17,7 @@ CHANGES for the SANE Mustek USB backend * Fixed check for single quotation marks. 2003-02-22: - * Release of version 1.0-16. + * Release of version 1.0-16. 2003-02-22: * Iniatialize global variables explicitely. @@ -34,7 +34,7 @@ CHANGES for the SANE Mustek USB backend to other backends for Mustek scanners. 2002-07-17: - * Release of version 1.0-15. + * Release of version 1.0-15. 2002-07-17: * Added manufacturer comment in mustek_usb.desc. @@ -43,7 +43,7 @@ CHANGES for the SANE Mustek USB backend * Really check the status in usb_low_open. 2002-04-24: - * Release of version 1.0-14. + * Release of version 1.0-14. 2002-04-24: * Undef MIN and MAX if they are defined in mustek_usb_low.h to avoid @@ -53,7 +53,7 @@ CHANGES for the SANE Mustek USB backend * Free devlist in sane_exit. 2002-04-10: - * Release of version 1.0-13. + * Release of version 1.0-13. 2002-04-10: * sane_set_io_mode must return SANE_STAUS_GOOD if non_blocking is false. @@ -63,7 +63,7 @@ CHANGES for the SANE Mustek USB backend * sane_exit: set freed variable to 0. 2002-03-20: - * Release of version 1.0-12. + * Release of version 1.0-12. 2002-03-19: * Option 0 has an empty name now. @@ -73,7 +73,7 @@ CHANGES for the SANE Mustek USB backend * Added more debug output in sane_control_option. 2002-03-17: - * Release of version 1.0-11. + * Release of version 1.0-11. 2002-03-16: * mustek_usb.c: Fixed segfault when opening device again after closing. @@ -90,7 +90,7 @@ CHANGES for the SANE Mustek USB backend * Fixed undefined operation warnings. 2002-01-11 - * Release of version 1.0-10. + * Release of version 1.0-10. 2002-01-11 * mustek_usb_high.(c|h), mustek_usb_mid.(c|h): commented out unused CCD code. @@ -106,7 +106,7 @@ CHANGES for the SANE Mustek USB backend * Added link to plustek to manual page. 2001-12-08 - * Release of version 1.0-9. + * Release of version 1.0-9. 2001-12-08 @@ -118,7 +118,7 @@ CHANGES for the SANE Mustek USB backend size of data acquired in one turn. 2001-11-15 - * Release of version 1.0-8. + * Release of version 1.0-8. 2001-11-15 * Updated manual page concerning FreeBSD and kernel configuration. @@ -140,7 +140,7 @@ CHANGES for the SANE Mustek USB backend * Removed load_private_profile (now in usb_high_scan_init). 2001-10-07 - * Release of version 1.0-7. + * Release of version 1.0-7. 2001-10-07 @@ -312,7 +312,7 @@ CHANGES for the SANE Mustek USB backend * mustek_usb_low: - fixed compilation warnings - fixed compilation problems - - fixed C++ to C transition issues (e.g. "initializer element is not + - fixed C++ to C transition issues (e.g. "initializer element is not computable at load time") - fixed debug output - adjusted some names @@ -355,7 +355,7 @@ CHANGES for the SANE Mustek USB backend 2001-07-22 * mustek_usb_low: Only one data structure: ma1017. - * mustek_usb_mid: + * mustek_usb_mid: - removed // - remove SANE disclaimers - use SANE types @@ -404,7 +404,7 @@ CHANGES for the SANE Mustek USB backend * Used "../include/sane" in #include statements * Used /dev/usbscanner in mustek_usb.conf * Fixed mustek_usb.desc - * Fixed mustek_usb.*: + * Fixed mustek_usb.*: - use correct names - no leading "_" - use only C-style comments diff --git a/doc/mustek_usb2/mustek_usb2.CHANGES b/doc/mustek_usb2/mustek_usb2.CHANGES index 38886e870..6e37236aa 100644 --- a/doc/mustek_usb2/mustek_usb2.CHANGES +++ b/doc/mustek_usb2/mustek_usb2.CHANGES @@ -7,7 +7,7 @@ V 1.0-10 (2005-10-16) V 1.0-9 (2005-10-02) -- Removed global variables in mustek_usb2.c: +- Removed global variables in mustek_usb2.c: Deleted the following variables (not necessary): m_bIsOpen Moved the following varaiables to Mustek_Scanner structure: @@ -81,7 +81,7 @@ V 1.0-4 (2005-09-27) a2nu2/spicall/spicall.c --> included in mustek_usb2.c a2nu2/spicall/spicall_ex.h a2nu2/spicall/spicall_g.h --> included in mustek_usb2_high.c - a2nu2/include/asic.h --> included in mustek_usb2_asic_low.h + a2nu2/include/asic.h --> included in mustek_usb2_asic_low.h a2nu2/include/debug.h --> removed a2nu2/include/ini.h a2nu2/include/msam.ini --> removed @@ -94,11 +94,11 @@ V 1.0-4 (2005-09-27) a2nu2/asic/asic_libusb.h --> removed a2nu2/asic/asic_mid.c --> mustek_usb2_asic_mid.c a2nu2/asic/asic_mid.h --> included in mustek_usb2_asic_mid.c - a2nu2/asic/asic_motor.c --> mustek_usb2_asic_motor.c + a2nu2/asic/asic_motor.c --> mustek_usb2_asic_motor.c a2nu2/asic/asic_motor.h --> mustek_usb2_asic_motor.h - a2nu2/asic/asic_usb.c --> mustek_usb2_asic_low.c + a2nu2/asic/asic_usb.c --> mustek_usb2_asic_low.c a2nu2/asic/asic_usb.h --> included in mustek_usb2_asic_low.h - a2nu2/asic/DefineScanner.h --> mustek_usb2_asic_low.h + a2nu2/asic/DefineScanner.h --> mustek_usb2_asic_low.h a2nu2/asic/ScanRegDef.h --> included in mustek_usb2_asic_low.h - Changed backend name to mustek_usb2. diff --git a/doc/net.tex b/doc/net.tex index a29fb751b..d6bc110d5 100644 --- a/doc/net.tex +++ b/doc/net.tex @@ -86,7 +86,7 @@ The four primitive types of the SANE standard are encoded as follows: \code{SANE\_Char} array. The trailing NUL byte is considered part of the array and a \code{NULL} pointer is encoded as a zero-length array. - + \item[\code{\defn{SANE\_Handle}}:] A handle is encoded like a word. The network backend needs to take care of converting these integer values to the opaque pointer values that are presented to the user @@ -473,7 +473,7 @@ are no request or reply arguments in this call. As a result of this call, the connection between the client and the server that was established by the \code{SANE\_NET\_INIT} call will be closed. -% Local Variables: +% Local Variables: % mode: latex % TeX-master: "sane.tex" -% End: +% End: diff --git a/doc/plustek/FAQ b/doc/plustek/FAQ index 7d65f41bc..43ad73c64 100644 --- a/doc/plustek/FAQ +++ b/doc/plustek/FAQ @@ -51,7 +51,7 @@ SOLUTION: --------- Set the link /usr/src/linux to your current kernel-source tree before recompiling -kernel-modules like pt_drv, then your version mismatch +kernel-modules like pt_drv, then your version mismatch problem should be solved. @@ -303,7 +303,7 @@ A: Normally, there is no need to do so, because once you have to worry about loading the driver. It happens automagically. ;-) The driver will be loaded when needed (and eventually removed after a specific time of not using it). - + Nevertheless, another possibility is to do a modprobe pt_drv in the /etc/rc.d/boot.local (using SuSE) or /etc/rc.d/rc.local (using RedHat or Mandrake) file diff --git a/doc/plustek/Makefile.kernel24 b/doc/plustek/Makefile.kernel24 index 207ef39dd..695864dfd 100644 --- a/doc/plustek/Makefile.kernel24 +++ b/doc/plustek/Makefile.kernel24 @@ -43,7 +43,7 @@ REFOPT = -xref-all -index-all -html32 # # add the following to get assembly listing -# -Wa,-alh,-L -g +# -Wa,-alh,-L -g # # get some version numbers diff --git a/doc/plustek/Plustek-PARPORT-TODO.txt b/doc/plustek/Plustek-PARPORT-TODO.txt index 94ef5f79d..6eb866785 100644 --- a/doc/plustek/Plustek-PARPORT-TODO.txt +++ b/doc/plustek/Plustek-PARPORT-TODO.txt @@ -28,7 +28,7 @@ Genius HR6 negative scanning not okay none ********************************* DONE *************************************** -- PS/2 bidi does not work (libieee1284) +- PS/2 bidi does not work (libieee1284) - Update the IOCTL interface and remove some old structs (CmdBlk) ******************************** SKIPPED ************************************* diff --git a/doc/plustek/Plustek-PARPORT.changes b/doc/plustek/Plustek-PARPORT.changes index 0e7d73b2e..e463b7144 100644 --- a/doc/plustek/Plustek-PARPORT.changes +++ b/doc/plustek/Plustek-PARPORT.changes @@ -149,11 +149,11 @@ Version 0.43-7 05/11/2005 1.0 Fixed timer issues in user-space (Thanx to Rod Roark) Version 0.43-8 08/10/2005 - 1.0 Fixed problem on ASIC96003/1 based devices, when scanning + 1.0 Fixed problem on ASIC96003/1 based devices, when scanning lineart at 200 and 300 dpi Version 0.43-9 11/14/2005 - 1.0 Fixed sizeof(long) issue for 64bit platforms, see + 1.0 Fixed sizeof(long) issue for 64bit platforms, see bug #302195 Version 0.43-10 02/16/2006 diff --git a/doc/plustek/Plustek-PARPORT.txt b/doc/plustek/Plustek-PARPORT.txt index e5b60978d..3470ed7e8 100644 --- a/doc/plustek/Plustek-PARPORT.txt +++ b/doc/plustek/Plustek-PARPORT.txt @@ -22,7 +22,7 @@ in sane-backends/backend. Simply do (as root user) Then the module should be compiled, installed and loaded. -Add the following three lines to file /etc/modules.conf +Add the following three lines to file /etc/modules.conf alias char-major-40 pt_drv pre-install pt_drv modprobe -k parport diff --git a/doc/plustek/Plustek-USB.changes b/doc/plustek/Plustek-USB.changes index 8ed5cc8fb..ae6e69ed8 100644 --- a/doc/plustek/Plustek-USB.changes +++ b/doc/plustek/Plustek-USB.changes @@ -148,7 +148,7 @@ optical one (sensor stops too early) V 0.50-2 (2005-08-19) --------------------- More cleanup. -Removed obsolete _WAF_BLACKFINE. +Removed obsolete _WAF_BLACKFINE. LiDE20 does not seem to have a reliable black calibration area, so the devices now will switch off the lamp for dark calibration. Fixed line statistics and added calibration data output. @@ -283,7 +283,7 @@ V 0.47-1 - 0.47-4 V 0.46-9 (2003-11-03) --------------------- -- Added alternate calibration for CIS devices +- Added alternate calibration for CIS devices - Added coarse calibration data-cache - Moved parallelport code to extra backend file plustek_pp - Fixed some minor bugs diff --git a/doc/plustek/Plustek-USB.txt b/doc/plustek/Plustek-USB.txt index e1ee793f3..f9fa53190 100644 --- a/doc/plustek/Plustek-USB.txt +++ b/doc/plustek/Plustek-USB.txt @@ -20,7 +20,7 @@ PLUSTEK ======= Vendor ID: 0x07B3 -Product ID Device-description and status +Product ID Device-description and status 0x0005 not identified yet 0x0007 not identified yet 0x000F not identified yet @@ -32,21 +32,21 @@ Product ID Device-description and status 0x0015 U24 (LM9832) - working 0x0016 not identified yet 0x0017 UT12 - working, UT16 - working, UT24 - working - + MUSTEK ====== BearPaw vendor ID: 0x0400 (They use the NationalSemiconductors ID!!!) -Product ID Device-description and status +Product ID Device-description and status 0x1000 BearPaw 1200 (LM9831) - working 0x1001 BearPaw 1200 (LM9832) - not tested 0x1001 BearPaw 2400 (LM9832) - mostly working - + KYE (Genius) ============ Vendor ID: 0x0458 - -Product ID Device-description and status + +Product ID Device-description and status 0x2007 ColorPage-HR6 V2 - working 0x2008 ColorPage-HR6 V2 - not tested 0x2009 ColorPage-HR6A - not tested @@ -58,7 +58,7 @@ Hewlett Packard =============== Vendor ID: 0x03F0 -Product ID Device-description and status +Product ID Device-description and status 0x0505 HP Scanjet 2100c - working 0x0605 HP Scanjet 2200c - working @@ -66,7 +66,7 @@ EPSON ===== Vendor ID: 0x04b8 -Product ID Device-description and status +Product ID Device-description and status 0x010F EPSON Perfection 1250/Photo - working 0x011D EPSON Perfection 1260/Photo - working @@ -74,9 +74,9 @@ UMAX ==== Vendor ID: 0x1606 -Product ID Device-description and status -0x0050 UMAX 3400 - working -0x0060 UMAX 3400/3450 - working +Product ID Device-description and status +0x0050 UMAX 3400 - working +0x0060 UMAX 3400/3450 - working 0x0160 UMAX 5400 - working COMPAQ @@ -90,7 +90,7 @@ CANON ===== Vendor ID: 0x04A9 -Product ID Device-description and status +Product ID Device-description and status 0x???? FB620U - not integrated 0x2206 N650U - working 0x2207 N1220U - working @@ -216,7 +216,7 @@ usbscanner 0x0003 0x1606 0x0160 0x0000 0x0000 0x00 0x00 0x00 0x00 0x00 0x00 0x00 The example line shows the vendor ID of UMAX 0x1606 and the product ID of the 5400 0x0160 - these values must match the ones of your scanner. -Last step is adding a script in +Last step is adding a script in /etc/hotplug/usb/ It is called "usbscanner" (don't forget the executable rights) @@ -232,7 +232,7 @@ fi This script will correct the access right to your scanner device when the device is plugged in. - + Debugging your USB scanner (written by Kev Green) ------------------------------------------------- diff --git a/doc/releases.txt b/doc/releases.txt index 740886def..170bff571 100644 --- a/doc/releases.txt +++ b/doc/releases.txt @@ -7,7 +7,7 @@ Timetable (approximate periods): Day 0: Announcement of upcoming release on sane-devel including timetable Day 14: Feature freeze (only bugfixes + documentation updates) -Day 28: Code freeze (only fixes for bugs that can destroy hardware, can cause +Day 28: Code freeze (only fixes for bugs that can destroy hardware, can cause compilation problems or render a backend completely unusable, and documentation updates are allowed) Day 35: Release @@ -41,7 +41,7 @@ Making the release: * make tar.gz, sane-backends-x.y.z.lsm, and .md5sum with "make sane-backends" * unpack tar.gz in temporary directory * make diff from last release by unpacking it also in temporary directory - and running e.g. + and running e.g. diff -uNr sane-backends-1.0.23 sane-backends-1.0.24 > sane-backends-1.0.23-1.0.24.diff * check that the diff applies cleanly to the old version * gzip the diff diff --git a/doc/sane-agfafocus.man b/doc/sane-agfafocus.man index f4c185230..d3481c521 100644 --- a/doc/sane-agfafocus.man +++ b/doc/sane-agfafocus.man @@ -107,11 +107,11 @@ variable controls the debug level for this backend. E.g., a value of 128 requests all debug output to be printed. Smaller levels reduce verbosity. SANE_DEBUG_AGFAFOCUS values: -.sp +.sp .ft CR .nf Number Remark -\ +\ 0 print important errors (printed each time) 1 print errors 2 print sense @@ -151,7 +151,7 @@ SANE_DEBUG_AGFAFOCUS to 128 and try to regenerate the problem. Then send me a report with the log attached. .PP If you encounter a SCSI bus error or trimmed and/or displaced images please -also set the environment variable SANE_DEBUG_SANEI_SCSI to 128 before sending +also set the environment variable SANE_DEBUG_SANEI_SCSI to 128 before sending me the report. .SH TODO diff --git a/doc/sane-apple.man b/doc/sane-apple.man index 7c55a5a2c..b9dce6d7b 100644 --- a/doc/sane-apple.man +++ b/doc/sane-apple.man @@ -216,7 +216,7 @@ SANE_DEBUG_APPLE to 255 and rerun the exact sequence of keystrokes and menu selections to reproduce it. Then send me a report with the log attached. .PP -If you have an Apple Macintosh with the AppleScanners driver installed, +If you have an Apple Macintosh with the AppleScanners driver installed, reporting to me which options are grayed out (inactive) in what modes would be very helpful. .PP diff --git a/doc/sane-artec.man b/doc/sane-artec.man index 5f700a866..9dd4f4407 100644 --- a/doc/sane-artec.man +++ b/doc/sane-artec.man @@ -132,7 +132,7 @@ SANE_DEBUG_ARTEC values .ft CR .nf Number Remark -\ +\ 0 print important errors 1 print errors 2 print sense @@ -147,12 +147,12 @@ Number Remark 11 print called sane\-procedures 12 print sane infos 13 print sane option-control messages -\ +\ 50 print verbose data/debug messages -\ +\ == 100 print software RGB calibration data == 101 print raw data from scanner to artec.data.raw file -\ +\ == 128 print out all messages .fi .ft R diff --git a/doc/sane-artec_eplus48u.man b/doc/sane-artec_eplus48u.man index 19f461ce6..fb3e028cd 100644 --- a/doc/sane-artec_eplus48u.man +++ b/doc/sane-artec_eplus48u.man @@ -139,6 +139,6 @@ Interpolation with 1200 dpi is weak. .PP Support for buttons is missing due to missing support in SANE. .PP -Please contact us if you find a bug: +Please contact us if you find a bug: .IR http://www.sane\-project.org/bugs.html . diff --git a/doc/sane-as6e.man b/doc/sane-as6e.man index efaf0d593..2e7dbf6c7 100644 --- a/doc/sane-as6e.man +++ b/doc/sane-as6e.man @@ -7,20 +7,20 @@ sane\-as6e \- SANE backend for using the Artec AS6E parallel port interface scan The .B sane\-as6e library implements a SANE (Scanner Access Now Easy) backend -that provides access to Artec AS6E flatbed scanner. -.B It requires the as6edriver program in order to operate. +that provides access to Artec AS6E flatbed scanner. +.B It requires the as6edriver program in order to operate. The as6edriver program is .B not -included with the SANE package. -It can be found at +included with the SANE package. +It can be found at .BR http://as6edriver.sourceforge.net. See the as6edriver documentation for technical information. .PP The -.I as6edriver +.I as6edriver program must be in the path for executables ($PATH). Especially if you run .I saned -(the SANE network scanning daemon), take care to setup the path for +(the SANE network scanning daemon), take care to setup the path for .I inetd or .I xinetd @@ -29,7 +29,7 @@ correctly or place the program in a directory that is in the path. .PP .SH FILES -.B as6edriver +.B as6edriver \- driver program that controls the scanner. .SH SEE ALSO diff --git a/doc/sane-avision.man b/doc/sane-avision.man index 6a991b692..f0a509185 100644 --- a/doc/sane-avision.man +++ b/doc/sane-avision.man @@ -24,23 +24,23 @@ you try the first scans \- especially with film-scanners! .SH CONFIGURATION -The configuration file for this backend resides in +The configuration file for this backend resides in .IR @CONFIGDIR@/avision.conf . Its contents is a list of device names that correspond to Avision and Avision compatible scanners and backend-options. Empty lines and lines starting with -a hash mark (#) are ignored. A sample configuration file is shown below: +a hash mark (#) are ignored. A sample configuration file is shown below: .nf # this is a comment -\ +\ option force\-a4 option force\-a3 option skip\-adf option disable\-gamma\-table option disable\-calibration -\ - #scsi Vendor Model Type Bus Channel ID LUN +\ + #scsi Vendor Model Type Bus Channel ID LUN scsi AVISION scsi HP scsi /dev/scanner @@ -119,7 +119,7 @@ libusb corresponding to the USB scanner. For example "0x03f0 0x0701" or "libusb:002:003". See sane\-usb(5) for details. The program -.IR sane\-find\-scanner +.IR sane\-find\-scanner helps to find out the correct scsi or usb device name. A list with supported devices is built into the avision backend so @@ -161,7 +161,7 @@ environment variable controls the debug level for this backend. Higher debug levels increase the verbosity of the output. The debug level 7 is the author's preferred value to debug backend problems. -Example: +Example: export SANE_DEBUG_AVISION=7 .SH "SEE ALSO" diff --git a/doc/sane-bh.man b/doc/sane-bh.man index 830697679..2b0244878 100644 --- a/doc/sane-bh.man +++ b/doc/sane-bh.man @@ -38,17 +38,17 @@ this backend with the newer 4000 and 8000 series scanners. If you have such a beast, please let me know. .PP The Bell+Howell Copiscan II series document scanners are high -volume, high throughput scanners designed for document scanning +volume, high throughput scanners designed for document scanning applications. As such, they are lineart/grayscale scanners supporting -a fixed number of fairly low resolutions (e.g. 200/240/300dpi). -However, they do have a number of interesting and useful features -suited to needs of document imaging applications. +a fixed number of fairly low resolutions (e.g. 200/240/300dpi). +However, they do have a number of interesting and useful features +suited to needs of document imaging applications. This backend attempts to support as many of these features as possible. .PP The main technical reference used in writing this backend is the -.B Bell and Howell Copiscan II Remote SCSI Controller (RSC) OEM -.B Technical Manual Version 1.5. -The Linux SCSI programming HOWTO, the SANE API documentation, and +.B Bell and Howell Copiscan II Remote SCSI Controller (RSC) OEM +.B Technical Manual Version 1.5. +The Linux SCSI programming HOWTO, the SANE API documentation, and SANE source code were also extremely valuable resources. .PP @@ -80,9 +80,9 @@ The contents of the .I bh.conf file is a list of device names that correspond to Bell+Howell scanners. See sane\-scsi(5) on details of what constitutes a valid device name. -Additionally, options can be specified; these lines begin with the word "option". -Each option is described in detail below. Empty lines and lines starting -with a hash mark (#) are ignored. +Additionally, options can be specified; these lines begin with the word "option". +Each option is described in detail below. Empty lines and lines starting +with a hash mark (#) are ignored. .SH OPTIONS The following options can be specified in the @@ -99,9 +99,9 @@ These frames are generated based on the compression and barcode options. These frames are never sent in preview mode. .TP .B fake\-inquiry -This option is used for debugging purposes and its use is not encouraged. +This option is used for debugging purposes and its use is not encouraged. Essentially, it allows the backend to initialize in the absence of -a scanner. This is useful for development and not much else. +a scanner. This is useful for development and not much else. This option must be specified earlier in the configuration file than the devices which are to be "faked". @@ -144,8 +144,8 @@ levels reduce verbosity. .TP .B ADF support With document scanners, automatic document feeder (ADF) support is a key -feature. The backend supports the ADF by default and returns -.B SANE_STATUS_NO_DOCS +feature. The backend supports the ADF by default and returns +.B SANE_STATUS_NO_DOCS when the out-of-paper condition is detected. The SANE frontend .B scanadf is a command line frontend that supports multi-page scans. It has been @@ -158,8 +158,8 @@ scans is included in xsane version 0.35 and above. .B Duplex scanning Some models, such as the COPISCAN II 6338, support duplex scanning. That is, they scan both sides of the document during a single pass through the -scanner (the scanner has two cameras). This backend supports duplex -scanning (with the +scanner (the scanner has two cameras). This backend supports duplex +scanning (with the .B \-\-duplex option). The front and back page images are delivered consecutively as if they were separately scanned pages. @@ -167,16 +167,16 @@ as if they were separately scanned pages. .TP .B Hardware compression The scanner is capable of compressing the data into several industry -standard formats (CCITT G3, CCITT G3-2D, CCITT G4). This results in +standard formats (CCITT G3, CCITT G3-2D, CCITT G4). This results in increased performance as less data is passed from the scanner to the host over the SCSI bus. The backend supports these compression formats -via the +via the .B \-\-g31d, \-\-g32d, \-\-g42d options, respectively. Many SANE frontends are not equipped to deal with these formats, however. The SANE frontend .B scanadf -supports these optional frame formats. The compressed image data -is written directly to a file and can then be processed by a scan-script +supports these optional frame formats. The compressed image data +is written directly to a file and can then be processed by a scan-script using the .B \-\-scan\-script option. Examples of this are given on the scanadf homepage. @@ -197,18 +197,18 @@ parameters must remain constant during the entire batch. .TP .B Icon Generation The Icon function generates a thumbnail of the full page image, that can be -transferred as if it were a separate page. This allows the host to +transferred as if it were a separate page. This allows the host to quickly display a thumbnail representation during the scanning operation. -Perhaps this would be a great way of implementing a preview scan, but +Perhaps this would be a great way of implementing a preview scan, but since a normal scan is so quick, it might not be worth the trouble. .TP .B Multiple Sections Multiple sections (scanning sub-windows) can be defined for the front and -back pages. Each section can have different characteristics (e.g. geometry, +back pages. Each section can have different characteristics (e.g. geometry, compression). The sections are returned as if they were separately scanned images. Additionally sections can be used to greatly enhance the -accuracy and efficiency of the barcode/patchcode decoding process by +accuracy and efficiency of the barcode/patchcode decoding process by limiting the search area to a small subset of the page. Most Copiscan II series scanners support up to 8 user-defined sections. @@ -218,18 +218,18 @@ The RSC unit can recognize Bar and Patch Codes of various types embedded in the scanned image. The codes are decoded and the data is returned to the frontend as a text frame. The text is encoded in xml and contains a great deal of information about the decoded data such as the location -where it was found, its orientation, and the time it took to find. -Further information on the content of this text frame as well as some +where it was found, its orientation, and the time it took to find. +Further information on the content of this text frame as well as some barcode decoding examples can be found on the backend homepage. .SH LIMITATIONS .TP .B Decoding a single barcode type per scan The RSC unit can search for up to six different barcode types at a time. -While the code generally supports this as well, the +While the code generally supports this as well, the .B \-\-barcode\-search\-bar -option only allows the user to specify a single barcode type. -Perhaps another option which allows a comma separated list of barcode +option only allows the user to specify a single barcode type. +Perhaps another option which allows a comma separated list of barcode type codes could be added to address this. .TP .B Scanning a fixed number of pages in batch mode @@ -241,12 +241,12 @@ prior to initiating the last scan command. Currently, there is no mechanism available for the frontend to pass this knowledge to the backend. If batch mode is enabled and the \-\-end\-count terminates a scanadf session, an extra page will be pulled through the scanner, but is neither read -nor delivered to the frontend. The issue can be avoided by specifying +nor delivered to the frontend. The issue can be avoided by specifying \-\-batch=no when scanning a fixed number of pages. .TP .B Revision 1.2 Patch detector There is an enhanced patchcode detection algorithm available in the RSC -with revision 1.2 or higher that is faster and more reliable than the +with revision 1.2 or higher that is faster and more reliable than the standard Bar/Patch code decoder. This is not currently supported. .SH OPTIONS @@ -255,14 +255,14 @@ standard Bar/Patch code decoder. This is not currently supported. .TP .B \-\-preview[=(yes|no)] [no] Request a preview-quality scan. When preview is set to yes image -compression is disabled and the image is delivered in a +compression is disabled and the image is delivered in a SANE_FRAME_GRAY frame. .TP .B \-\-mode lineart|halftone [lineart] Selects the scan mode (e.g., lineart,monochrome, or color). .TP .B \-\-resolution 200|240|300dpi [200] -Sets the resolution of the scanned image. Each scanner model supports +Sets the resolution of the scanned image. Each scanner model supports a list of standard resolutions; only these resolutions can be used. .TP .B \-\-compression none|g31d|g32d|g42d [none] @@ -313,7 +313,7 @@ Bottom-right y position of scan area. .B Feeder Options: .TP .B \-\-source Automatic Document Feeder|Manual Feed Tray [Automatic Document Feeder] -Selects the scan source (such as a document feeder). This option is provided +Selects the scan source (such as a document feeder). This option is provided to allow multiple image scans with xsane; it has no other purpose. .TP .B \-\-batch[=(yes|no)] [no] @@ -329,7 +329,7 @@ affect both the front and back pages. .TP .B \-\-timeout\-adf 0..255 [0] Sets the timeout in seconds for the automatic document feeder (ADF). -The value 0 specifies the hardware default value which varies based +The value 0 specifies the hardware default value which varies based on the scanner model. .TP .B \-\-timeout\-manual 0..255 [0] @@ -388,40 +388,40 @@ feature is completely disabled. The valid barcode type are: .RS .br .B none -.br +.br .B ean\-8 .br .B ean\-13 -.br +.br .B reserved\-ean\-add -.br +.br .B code39 -.br +.br .B code2\-5\-interleaved -.br +.br .B code2\-5\-3lines\-matrix -.br +.br .B code2\-5\-3lines\-datalogic -.br +.br .B code2\-5\-5lines\-industrial -.br +.br .B patchcode -.br +.br .B codabar -.br +.br .B codabar\-with\-start\-stop -.br +.br .B code39ascii -.br +.br .B code128 -.br +.br .B code2\-5\-5lines\-iata .br .RE .TP .B \-\-barcode\-search\-count 1..7 [3] Number of times that the RSC performs the decoding algorithm. Specify -the smallest number possible to increase performance. If you are having +the smallest number possible to increase performance. If you are having trouble recognizing barcodes, it is suggested that you increase this option to its maximum value (7). .TP @@ -440,7 +440,7 @@ are: .RE .TP .B \-\-barcode\-hmin 0..1660mm [5] -Sets the barcode minimum height in millimeters (larger values increase +Sets the barcode minimum height in millimeters (larger values increase recognition speed). Of course the actual barcodes in the document must be of sufficient size. .TP @@ -450,67 +450,67 @@ expires, the decoder will stop trying to decode barcodes. .TP .B \-\-section [] Specifies a series of image sections. A section can be used to gather -a subset image or to provide a small area for barcode decoding. +a subset image or to provide a small area for barcode decoding. Each section is specified in the following format (units are in millimeters): .PP .B x++[:functioncode...] -.PP +.PP Multiple sections can be specified by separating them with commas. .PP For example .B 76.2x25.4+50.8+0:frontbar -identifies an area 3 inches wide and 1 inch high with a top left corner +identifies an area 3 inches wide and 1 inch high with a top left corner at the top of the page two inches from the left hand edge of the page. -This section will be used for barcode decoding on the front page only. +This section will be used for barcode decoding on the front page only. .PP For example -.B 50.8x25.4+25.4+0:frontbar:front:g42d -identifies an area 2 inches wide and 1 inch high with a top left corner -at the top of the page one inch from the left hand edge of the page. -This section will be used for barcode decoding on the front page as well -as generating an image compressed in g42d format. +.B 50.8x25.4+25.4+0:frontbar:front:g42d +identifies an area 2 inches wide and 1 inch high with a top left corner +at the top of the page one inch from the left hand edge of the page. +This section will be used for barcode decoding on the front page as well +as generating an image compressed in g42d format. .PP Ordinarily barcodes are searched in the entire image. However, when you specify sections all barcode searching is done within the specific sections -identified. This can significantly speed up the decoding process. +identified. This can significantly speed up the decoding process. The following functioncodes are available: .RS .br .B front \- generate an image for the front page section -.br +.br .B back \- generate an image for the back page section .br .B frontbar \- perform barcode search in front page section -.br +.br .B backbar \- perform barcode search in back page section .br .B frontpatch \- perform patchcode search in front page section -.br +.br .B backpatch \- perform patchcode search in back page section .br .B none \- use no image compression -.br +.br .B g31d \- use Group 3 1 dimension image compression -.br +.br .B g32d \- use Group 3 2 dimensions image compression -.br +.br .B g42d \- use Group 4 2 dimensions image compression .br .RE .PP If you omit a compression functioncode, the full page compression setting -is used. If you specify multiple compression functioncodes, only the +is used. If you specify multiple compression functioncodes, only the last one is used. .TP diff --git a/doc/sane-canon.man b/doc/sane-canon.man index be7693c10..6085b16ca 100644 --- a/doc/sane-canon.man +++ b/doc/sane-canon.man @@ -17,9 +17,9 @@ CanoScan FB620S .br CanoScan FB1200S .br -CanoScan FS2700F +CanoScan FS2700F .br -CanoScan FS2710S +CanoScan FS2710S .br .RE .PP @@ -44,7 +44,7 @@ FS2710S Ulrich Deiters . .SH TIPS (FS2700F) .PP Scanning either slides or negatives has been found to require rather -large gamma corrections of about 2.2 to 2.4 (same value for red, green, +large gamma corrections of about 2.2 to 2.4 (same value for red, green, and blue). It is recommended to use the automatic exposure controls of the frontend xsane for best results. .PP @@ -82,9 +82,9 @@ support dynamic loading). .B SANE_DEBUG_CANON If the library was compiled with debug support enabled, this environment variable controls the debug level for this backend. Higher -debug levels increase the verbosity of the output. +debug levels increase the verbosity of the output. -Example: +Example: export SANE_DEBUG_CANON=4 .SH "SEE ALSO" diff --git a/doc/sane-canon630u.man b/doc/sane-canon630u.man index bdfb87471..f421f5883 100644 --- a/doc/sane-canon630u.man +++ b/doc/sane-canon630u.man @@ -26,10 +26,10 @@ The contents of the .I canon630u.conf file is a list of device names that correspond to Canon USB scanners. Empty lines and lines starting with a hash mark (#) are -ignored. Only one device name can be listed in +ignored. Only one device name can be listed in .IR canon630u.conf . The program -.IR sane\-find\-scanner +.IR sane\-find\-scanner helps to find out the correct device. Under Linux, such a device name could be .I /dev/usb/scanner0 @@ -46,7 +46,7 @@ software was developed by analyzing the USB traffic of the Windows it seems to work for my scanner. If you have complaints, let me know. .PP This driver requires the ability to send USB Control Messages, available in -kernel 2.4.12 or later. +kernel 2.4.12 or later. .PP Some users have reported that this driver doesn't work at all. This seems to be a hardware specific issue, although I don't know what exactly the @@ -71,7 +71,7 @@ support dynamic loading). .I /tmp/canon.cal The calibration file used to normalize pixel brightness. This is calculated every time the scanner is first used after it has lost power. -Deleting this file will force recalibration. +Deleting this file will force recalibration. .SH ENVIRONMENT .TP .B SANE_CONFIG_DIR @@ -91,10 +91,10 @@ to "/tmp/config:" would result in directories "tmp/config", ".", and .B SANE_DEBUG_CANON630U If the library was compiled with debug support enabled, this environment variable controls the debug level for this backend. Higher -debug levels increase the verbosity of the output. +debug levels increase the verbosity of the output. Example: -.br +.br SANE_DEBUG_CANON630U=12 scanimage > /dev/null .SH "SEE ALSO" sane(7), sane\-usb(5), sane\-find\-scanner(1) diff --git a/doc/sane-canon_dr.man b/doc/sane-canon_dr.man index 3e8ac0621..9e71fe8a1 100644 --- a/doc/sane-canon_dr.man +++ b/doc/sane-canon_dr.man @@ -5,7 +5,7 @@ sane\-canon_dr \- SANE backend for Canon DR-series scanners .SH DESCRIPTION -The +The .B sane\-canon_dr library implements a SANE (Scanner Access Now Easy) backend which provides access to some Canon DR-series scanners. @@ -13,8 +13,8 @@ provides access to some Canon DR-series scanners. This document describes backend version 51, which shipped with SANE 1.0.25. .SH SUPPORTED HARDWARE -This version has only been tested with a few scanner models. Please see -http://www.sane\-project.org/sane\-supported\-devices.html for the most recent +This version has only been tested with a few scanner models. Please see +http://www.sane\-project.org/sane\-supported\-devices.html for the most recent list. This backend may support other Canon scanners. The best @@ -23,8 +23,8 @@ or to collect a trace of the windows driver in action. Please contact the author for help or with test results. In general, the larger machines (DR-4000 and up) which have been tested use -a fairly complete protocol, with hardware support for many modes, resolutions -and features. The smaller machines have many limitations, like missing +a fairly complete protocol, with hardware support for many modes, resolutions +and features. The smaller machines have many limitations, like missing horizontal resolutions, missing binary mode, always scanning full-width, etc. There is code in the backend to address these problems, but there seems to be no way to detect if they are required, so they must be hard-coded. @@ -32,26 +32,26 @@ no way to detect if they are required, so they must be hard-coded. .SH OPTIONS Effort has been made to expose most hardware options, including: .PP -source s +source s .RS Selects the source for the scan. Options may include "Flatbed", "ADF Front", "ADF Back", "ADF Duplex". .RE .PP -mode m +mode m .RS Selects the mode for the scan. Options may include "Lineart", "Halftone", "Gray", and "Color". .RE .PP -resolution +resolution .RS Controls scan resolution. .RE .PP tl\-x, tl\-y, br\-x, br\-y .RS -Sets scan area upper left and lower right coordinates. These are renamed +Sets scan area upper left and lower right coordinates. These are renamed t, l, x, y by some frontends. .RE .PP @@ -67,37 +67,37 @@ enhancement, compression, buttons and sensors, etc. Additionally, several 'software' options are exposed by the backend. These are reimplementations of features provided natively by larger scanners, but running on the host computer. This enables smaller machines to have similar -capabilities. Please note that these features are somewhat simplistic, and -may not perform as well as the native implementations. Note also that these -features all require that the driver cache the entire image in memory. This +capabilities. Please note that these features are somewhat simplistic, and +may not perform as well as the native implementations. Note also that these +features all require that the driver cache the entire image in memory. This will almost certainly result in a reduction of scanning speed. .PP -swcrop +swcrop .RS -Requests the driver to detect the extremities of the paper within the larger -image, and crop the empty edges. +Requests the driver to detect the extremities of the paper within the larger +image, and crop the empty edges. .RE .PP -swdeskew +swdeskew .RS -Requests the driver to detect the rotation of the paper within the larger +Requests the driver to detect the rotation of the paper within the larger image, and counter the rotation. .RE .PP -swdespeck X +swdespeck X .RS -Requests the driver to find and remove dots of X diameter or smaller from the +Requests the driver to find and remove dots of X diameter or smaller from the image, and fill the space with the average surrounding color. .RE -Use 'scanimage \-\-help' to get a list, but be aware that some options may -be settable only when another option has been set, and that advanced options +Use 'scanimage \-\-help' to get a list, but be aware that some options may +be settable only when another option has been set, and that advanced options may be hidden by some frontend programs. .PP .SH CONFIGURATION FILE The configuration file "canon_dr.conf" is used to tell the backend how to look for scanners, and provide options controlling the operation of the backend. -This file is read each time the frontend asks the backend for a list +This file is read each time the frontend asks the backend for a list of scanners, generally only when the frontend starts. If the configuration file is missing, the backend will fail to run. .PP @@ -105,9 +105,9 @@ Scanners can be specified in the configuration file in 4 ways: .PP "scsi CANON DR" .RS -Requests backend to search all scsi busses in the system for a device +Requests backend to search all scsi busses in the system for a device which reports itself to be a scanner made by 'CANON', with a model name -starting with 'DR'. +starting with 'DR'. .RE .PP "scsi /dev/sg0" (or other scsi device file) @@ -119,7 +119,7 @@ specify one. Probably should not be used with the other "scsi" line above. .PP "usb 0x04a9 0x1603" (or other vendor/product ids) .RS -Requests backend to search all usb busses in the system for a device +Requests backend to search all usb busses in the system for a device which uses that vendor and product id. The device will then be queried to determine if it is a Canon scanner. .RE @@ -129,12 +129,12 @@ to determine if it is a Canon scanner. Some systems use a kernel driver to access usb scanners. This method is untested. .RE .PP -Besides the 'scsi' and 'usb' lines, the configuration file supports the +Besides the 'scsi' and 'usb' lines, the configuration file supports the following 'option' lines: .PP "option buffer-size [number of bytes]" .RS -Set the number of bytes in the data buffer to something other than the +Set the number of bytes in the data buffer to something other than the compiled\-in default of 4MB. Large values may cause timeouts or hangs, small values may cause slow scans. .PP @@ -150,7 +150,7 @@ warned. .br "option version-name [string of text]" .RS -These options can be used collectively to override the values provided by the +These options can be used collectively to override the values provided by the scanner, or to provide the values when the scanner cannot. .RE .PP @@ -189,12 +189,12 @@ enables debugging output to stderr. Valid values are: .RE .SH KNOWN ISSUES -This backend was entirely reverse engineered from usb traces of the proprietary +This backend was entirely reverse engineered from usb traces of the proprietary driver. Various advanced features of the machines may not be enabled. Many machines have not been tested. Their protocol is unknown. .SH CREDITS - + The various authors of the sane\-fujitsu backend provided useful code .br Yabarana Corp. www.yabarana.com provided significant funding diff --git a/doc/sane-canon_pp.man b/doc/sane-canon_pp.man index ae307cb32..fe6715d50 100644 --- a/doc/sane-canon_pp.man +++ b/doc/sane-canon_pp.man @@ -5,7 +5,7 @@ sane\-canon_pp \- SANE backend for Canon CanoScan Parallel Port flatbed scanners .SH DESCRIPTION The .B sane\-canon_pp -library implements a SANE (Scanner Access Now Easy) backend that provides +library implements a SANE (Scanner Access Now Easy) backend that provides access to the following Canon flatbed scanners: .PP .RS @@ -25,11 +25,11 @@ CanoScan N640P ex .br .RE .PP -No USB scanners are supported and there are no plans to support them in the -future. Other projects are working on support for USB scanners. See the -.B PROJECTS +No USB scanners are supported and there are no plans to support them in the +future. Other projects are working on support for USB scanners. See the +.B PROJECTS file for more detail. The FB310P and FB610P are re-badged Avision scanners -which use a different command set, so are unlikely to be supported by this +which use a different command set, so are unlikely to be supported by this backend in the future. .PP IMPORTANT: this is alpha code. While we have made every effort to make it as @@ -42,77 +42,77 @@ below). . .PP .SH "DEVICE NAMES" -This backend expects device names of the form presented by libieee1284. These +This backend expects device names of the form presented by libieee1284. These names are highly dependent on operating system and version. -On Linux 2.4 kernels this will be of the form +On Linux 2.4 kernels this will be of the form .I "parport0" -or older (2.2 and before) kernels may produce names like +or older (2.2 and before) kernels may produce names like .IR "0x378" -(the base address of your port) or simply +(the base address of your port) or simply .IR "0" -depending on your module configuration. Check the contents of +depending on your module configuration. Check the contents of .I /proc/parport -if it exists. If you don't want to specify a default port (or don't know its +if it exists. If you don't want to specify a default port (or don't know its name), the backend should be able to detect which port your scanner is on. .SH CONFIGURATION The contents of the .I canon_pp.conf -file is a list of options for the driver to use. Empty lines and lines +file is a list of options for the driver to use. Empty lines and lines starting with a hash mark (#) are ignored. .PP The supported options are currently .BR ieee1284 , .BR calibrate , .BR init_mode , -and +and .BR force_nibble Option -.B ieee1284 +.B ieee1284 .IR port-name -defines which port to use. The format of port-name is OS dependent, based on +defines which port to use. The format of port-name is OS dependent, based on the names presented by libieee1284. Please only have one of these lines, or all but one will be ignored. -Option -.B calibrate -.IR cal-file +Option +.B calibrate +.IR cal-file .IR [port-name] -defines which calibration file to use on a per-port basis. If you only have -one parport, the port-name argument may be omitted \- but be careful as this +defines which calibration file to use on a per-port basis. If you only have +one parport, the port-name argument may be omitted \- but be careful as this will cause problems on multi-scanner systems. You may have as many of these -lines as you like, as long as each has a unique port name. The tilde (`~') -character is acceptable and will be expanded to the value of the HOME +lines as you like, as long as each has a unique port name. The tilde (`~') +character is acceptable and will be expanded to the value of the HOME environment. -Option +Option .B init_mode .IR .IR [portname] -defines which initialisation (wake-up) mode to use on a per-port basis. -If you only have one parport, the portname argument may be omitted \- but -be careful as this may cause problems on multi-scanner systems. -You may have as many of these lines as you like, as long as each has a unique -port name. The valid initialisation modes are FB620P (which strobes 10101010 -and 01010101 on the data pins), FB630P (which strobes 11001100 and 00110011 +defines which initialisation (wake-up) mode to use on a per-port basis. +If you only have one parport, the portname argument may be omitted \- but +be careful as this may cause problems on multi-scanner systems. +You may have as many of these lines as you like, as long as each has a unique +port name. The valid initialisation modes are FB620P (which strobes 10101010 +and 01010101 on the data pins), FB630P (which strobes 11001100 and 00110011 on the data pins) and AUTO, which will try FB630P mode first then FB620P mode second. The FB620P mode is also used by the FB320P. The FB630P mode is used by the FB330P, N340P, and N640P. Option .B force_nibble -forces the driver to use nibble mode even if ECP mode is reported to work by -libieee1284. This works-around the rare issue of ECP mode being reported to +forces the driver to use nibble mode even if ECP mode is reported to work by +libieee1284. This works-around the rare issue of ECP mode being reported to work by the library, then not working. .SH TIPS .PP -Hit the "Calibrate" button before scanning. It vastly improves the quality of +Hit the "Calibrate" button before scanning. It vastly improves the quality of scans. .PP -To enable automatic detection of your scanner, uncomment the "canon_pp" line +To enable automatic detection of your scanner, uncomment the "canon_pp" line from .I @CONFIGDIR@/dll.conf .PP @@ -127,40 +127,40 @@ below). The static library implementing this backend. .TP .I @LIBDIR@/libsane\-canon_pp.so -The shared library implementing this backend (present on systems that support +The shared library implementing this backend (present on systems that support dynamic loading). .SH ENVIRONMENT .TP .B SANE_CONFIG_DIR -This environment variable specifies the list of directories that may contain -the configuration file. Under UNIX, the directories are separated by a colon +This environment variable specifies the list of directories that may contain +the configuration file. Under UNIX, the directories are separated by a colon (`:'), under OS/2, they are separated by a semi-colon (`;'). If this variable -is not set, the configuration file is searched in two default directories: -first, the current working directory (".") and then in @CONFIGDIR@. If the +is not set, the configuration file is searched in two default directories: +first, the current working directory (".") and then in @CONFIGDIR@. If the value of the environment variable ends with the directory separator character, -then the default directories are searched after the explicitly specified +then the default directories are searched after the explicitly specified directories. For example, setting .B SANE_CONFIG_DIR to "/tmp/config:" would result in directories "tmp/config", ".", and "@CONFIGDIR@" being searched (in this order). .TP .B SANE_DEBUG_CANON_PP -If the library was compiled with debug support enabled, this environment -variable controls the debug level for this backend. Higher debug levels +If the library was compiled with debug support enabled, this environment +variable controls the debug level for this backend. Higher debug levels increase the verbosity of the output. -Example: +Example: export SANE_DEBUG_CANON_PP=4 .SH NOTES .B Features available in the Windows interface .TP -.B Brightness and Contrast -These are not implemented, and probably never will be. These appear to be -implemented entirely in software. Use GIMP or a similar program if you need +.B Brightness and Contrast +These are not implemented, and probably never will be. These appear to be +implemented entirely in software. Use GIMP or a similar program if you need these features. .TP .B Descreen Mode -This appears on our first analysis to be just oversampling with an +This appears on our first analysis to be just oversampling with an anti-aliasing filter. Again, it seems to be implemented entirely in software, so GIMP is your best bet for now. .TP @@ -170,51 +170,51 @@ one returned during calibration) will be loaded. .PP .B Communication Problems .PP -ECP mode in libieee1284 doesn't always work properly, even with new hardware. +ECP mode in libieee1284 doesn't always work properly, even with new hardware. We believe that this is a ppdev problem. If you change the configuration file -to include +to include .B force_nibble , the problem will go away, but you will only be able to scan in nibble mode. .PP Sometimes the scanner can be left in a state where our code cannot revive it. -If the backend reports no scanner present, try unplugging the power and +If the backend reports no scanner present, try unplugging the power and plugging it back in. Also try unplugging printers from the pass-through port. .PP -The scanner will not respond correctly to our commands when you first plug in -the power. You may find if you try a scan very soon after plugging in the +The scanner will not respond correctly to our commands when you first plug in +the power. You may find if you try a scan very soon after plugging in the power that the backend will incorrectly report that you have no scanner present. -To avoid this, give it about 10 seconds to reset itself before attempting any +To avoid this, give it about 10 seconds to reset itself before attempting any scans. .PP .B Repeated Lines .PP Sometimes at high resolutions (ie. 600dpi) you will notice lines which appear twice. These lines correspond to points where the scanner head has stopped -during the scan (it stops every time the internal 64kb buffer is full). +during the scan (it stops every time the internal 64kb buffer is full). Basically it's a mechanical problem inside the scanner, that the tolerance of movement for a start/stop event is greater than 1/600 inches. I've never tried -the windows driver so I'm not sure how (or if) it works around this problem, -but as we don't know how to rewind the scanner head to do these bits again, +the windows driver so I'm not sure how (or if) it works around this problem, +but as we don't know how to rewind the scanner head to do these bits again, there's currently no nice way to deal with the problem. .PP .B Grey-scale Scans .PP -Be aware that the scanner uses the green LEDs to read grey-scale scans, meaning -green coloured things will appear lighter than normal, and red and blue -coloured items will appear darker than normal. For high-accuracy grey-scale -scans of colour items, it's best just to scan in colour and convert to +Be aware that the scanner uses the green LEDs to read grey-scale scans, meaning +green coloured things will appear lighter than normal, and red and blue +coloured items will appear darker than normal. For high-accuracy grey-scale +scans of colour items, it's best just to scan in colour and convert to grey-scale in graphics software such as the GIMP. .PP .B FB620P/FB320P Caveats .PP These models can not be reset in the same way as the others. The windows driver -doesn't know how to reset them either \- when left with an inconsistent scanner, +doesn't know how to reset them either \- when left with an inconsistent scanner, it will start scanning half way down the page! .PP Aborting is known to work correctly on the FB*30P models, and is known to be -broken on the FB*20P models. The FB620P which I tested on simply returns -garbage after a scan has been aborted using the method we know. -Aborting is able to leave the scanner in a state where it can be shut down, +broken on the FB*20P models. The FB620P which I tested on simply returns +garbage after a scan has been aborted using the method we know. +Aborting is able to leave the scanner in a state where it can be shut down, but not where another scan can be made. @@ -224,9 +224,9 @@ sane(7), sane\-dll(5) http://canon\-fb330p.sourceforge.net/ .SH AUTHOR -This backend is primarily the work of Simon Krix (Reverse Engineering), and -Matthew Duggan (SANE interface). +This backend is primarily the work of Simon Krix (Reverse Engineering), and +Matthew Duggan (SANE interface). .PP -Many thanks to Kevin Easton for his comments and help, and Kent A. Signorini +Many thanks to Kevin Easton for his comments and help, and Kent A. Signorini for his help with the N340P. diff --git a/doc/sane-cardscan.man b/doc/sane-cardscan.man index 7c081afbb..72ea41bd9 100644 --- a/doc/sane-cardscan.man +++ b/doc/sane-cardscan.man @@ -5,16 +5,16 @@ sane\-cardscan \- SANE backend for Corex CardScan usb scanners .SH DESCRIPTION -The +The .B sane\-cardscan library implements a SANE (Scanner Access Now Easy) backend which provides access to the Corex CardScan 800c & 600c small-format scanners. -The backend supports only grayscale and color modes and media of +The backend supports only grayscale and color modes and media of (theoretically) infinite length. This backend may support other scanners. The best -way to determine level of support is to get a trace of the windows +way to determine level of support is to get a trace of the windows driver in action, and send it to the author. .SH OPTIONS @@ -28,7 +28,7 @@ Selects the mode for the scan. Options are "Gray" and "Color". .SH CONFIGURATION FILE The configuration file "cardscan.conf" is used to tell the backend how to look for scanners, and provide options controlling the operation of the backend. -This file is read each time the frontend asks the backend for a list +This file is read each time the frontend asks the backend for a list of scanners, generally only when the frontend starts. If the configuration file is missing, the backend will use a set of compiled defaults, which are identical to the default configuration file shipped with SANE. @@ -37,7 +37,7 @@ Scanners can be specified in the configuration file in 2 ways: .PP "usb 0x04c5 0x1042" (or other vendor/product ids) .RS -Requests backend to search all usb busses in the system for a device +Requests backend to search all usb busses in the system for a device which uses that vendor and product id. The device will then be queried to determine if it is a cardscan scanner. .RE @@ -91,11 +91,11 @@ cannot set x/y coordinate values, resolutions, etc. These things could be simulated in the backend, but there are plenty of command line tools. .br .br -The backend also does not send all the commands that the windows driver +The backend also does not send all the commands that the windows driver does, so it may not function the same. .br .br -The backend does not have the calibration or ejection options of the +The backend does not have the calibration or ejection options of the windows driver. .br .br diff --git a/doc/sane-config.man b/doc/sane-config.man index 42c6f9a13..997a34216 100644 --- a/doc/sane-config.man +++ b/doc/sane-config.man @@ -37,7 +37,7 @@ frontend to libsane. .B \-\-cflags Print the compiler flags that are necessary to compile a .B SANE -frontend. +frontend. .TP 8 .B \-\-prefix Print the prefix used during compilation of libsane. diff --git a/doc/sane-coolscan.man b/doc/sane-coolscan.man index 5952039ec..65c8d5360 100644 --- a/doc/sane-coolscan.man +++ b/doc/sane-coolscan.man @@ -6,7 +6,7 @@ sane\-coolscan \- SANE backend for Nikon film-scanners .SH ABOUT THIS FILE -This file is a short description of the coolscan-backend for sane! +This file is a short description of the coolscan-backend for sane! .SH DESCRIPTION @@ -18,22 +18,22 @@ library implements a SANE backend that provides the interface to the following N .SH CONFIGURATION -The configuration file for this backend resides in +The configuration file for this backend resides in .IR @CONFIGDIR@/coolscan.conf . Its contents is a list of device names that correspond to Nikon Coolscan scanners. Empty lines and lines starting with a hash mark (#) are ignored. A sample configuration file is -shown below: +shown below: .nf - #scsi Vendor Model Type - scsi Nikon * Scanner - /dev/scanner + #scsi Vendor Model Type + scsi Nikon * Scanner + /dev/scanner .fi The special device name must be a generic SCSI device or a symlink to such a device. To find out to which device your scanner is assigned and how you have to set the -permissions of that device, have a look at sane\-scsi. +permissions of that device, have a look at sane\-scsi. .SH SCSI ADAPTER TIPS diff --git a/doc/sane-coolscan2.man b/doc/sane-coolscan2.man index af27f1a8f..71f589a60 100644 --- a/doc/sane-coolscan2.man +++ b/doc/sane-coolscan2.man @@ -6,12 +6,12 @@ sane\-coolscan2 \- SANE backend for Nikon Coolscan film scanners The .B sane\-coolscan2 library implements a SANE (Scanner Access Now Easy) backend that -provides access to Nikon Coolscan film scanners. Some functions of this +provides access to Nikon Coolscan film scanners. Some functions of this backend should be considered .B beta-quality -software. Most functions have been stable for a long time, but of +software. Most functions have been stable for a long time, but of course new development can not and will not function properly from -the very first day. Please report any strange behaviour to the +the very first day. Please report any strange behaviour to the maintainer of the backend. .PP @@ -38,7 +38,7 @@ report successes or failures. The options the backend supports can either be selected through command line options to programs like scanimage or through GUI elements in xscanimage or xsane. -Valid command line options and their syntax can be listed by using +Valid command line options and their syntax can be listed by using .RS scanimage \-\-help \-d coolscan2:: .RE @@ -69,7 +69,7 @@ unit is mm). .I \-\-infrared=yes/no If set to "yes", the scanner will read the infrared channel, thus allowing defect removal in software. The infrared image is read during a second scan, -with no options altered. The backend must not be restarted between the scans. +with no options altered. The backend must not be restarted between the scans. If you use scanimage, perform a batch scan with batch\-count=2 to obtain the IR information. .TP diff --git a/doc/sane-coolscan3.man b/doc/sane-coolscan3.man index 364d5ef27..be2bd52ff 100644 --- a/doc/sane-coolscan3.man +++ b/doc/sane-coolscan3.man @@ -6,11 +6,11 @@ sane\-coolscan3 \- SANE backend for Nikon Coolscan film scanners The .B sane\-coolscan3 library implements a SANE (Scanner Access Now Easy) backend that -provides access to Nikon Coolscan film scanners. Some functions of this -backend should be considered +provides access to Nikon Coolscan film scanners. Some functions of this +backend should be considered .B beta-quality -software. Most functions have been stable for a long time, but of -course new development can not and will not function properly from +software. Most functions have been stable for a long time, but of +course new development can not and will not function properly from the very first day. .PP @@ -31,27 +31,27 @@ LS-8000 ED IEEE 1394 .ft R .RE -Please send mail to sane-devel@lists.alioth.debian.org to report successes +Please send mail to sane-devel@lists.alioth.debian.org to report successes or failures. .SH OPTIONS -The options the backend supports can either be selected through command line +The options the backend supports can either be selected through command line options to programs like scanimage or through GUI elements in xscanimage or xsane. -Valid command line options and their syntax can be listed by using +Valid command line options and their syntax can be listed by using .RS scanimage \-\-help \-d coolscan3:: .RE where and specify the device in question, as in the configuration file (see next section). The \-d parameter and its argument can be omitted to obtain information on the first scanner identified. Use -the command +the command .RS scanimage \-L .RE to list all devices recognized by your SANE installation. -The options should be fully described by the description or tooltips given by +The options should be fully described by the description or tooltips given by frontend. Here is a description of some of the most important options, in the syntax with which they must be supplied to scanimage: .TP @@ -69,7 +69,7 @@ unit is mm). .I \-\-infrared=yes/no If set to "yes", the scanner will read the infrared channel, thus allowing defect removal in software. The infrared image is read during a second scan, -with no options altered. The backend must not be restarted between the scans. +with no options altered. The backend must not be restarted between the scans. If you use scanimage, perform a batch scan with batch\-count=2 to obtain the IR information. .TP @@ -109,7 +109,7 @@ Eject the film strip or mounted slide when using the slide loader. Reset scanner. The scanner will perform the same action as when power is turned on: it will eject the film strip and calibrate itself. Use this whenever the scanner refuses to load a film strip properly, as a result of -which +which .I \-\-eject does not work. @@ -126,7 +126,7 @@ entries are case-sensitive: These lines are ignored, thus '#' can be used to include comments. .TP .I containing only the word """auto""" -This instructs the backend to probe for a scanner by scanning the buses for +This instructs the backend to probe for a scanner by scanning the buses for devices with know identifiers. This is the action taken when no configuration file is present. .TP @@ -178,5 +178,5 @@ No real bugs currently known, please report any to the SANE developers' list. .SH AUTHORS coolscan3 written by A. Zummo (a.zummo@towertech.it), based heavily on -coolscan2 written by Andr\['a]s Major (andras@users.sourceforge.net). +coolscan2 written by Andr\['a]s Major (andras@users.sourceforge.net). diff --git a/doc/sane-dc210.man b/doc/sane-dc210.man index bc0db755b..7d3ad6502 100644 --- a/doc/sane-dc210.man +++ b/doc/sane-dc210.man @@ -14,15 +14,15 @@ connected. The device name is always "0". .SH CONFIGURATION The contents of the .I dc210.conf -specify the serial port and baud rate to use. The baud rate +specify the serial port and baud rate to use. The baud rate specifies the maximum rate to use while downloading pictures. (The camera is always initialized using 9600 baud, then switches to the higher rate). On my 90MHz Pentium, I usually have no problems downloading -at 115200 baud as long as the system is not excessively busy and +at 115200 baud as long as the system is not excessively busy and the "interrupt-unmask flag" is set in the IDE driver (hdparm \-u1). Supported baud rates are: 9600, 19200, 38400, 57600, and 115200. .PP -The dumpinquiry line causes some information about the camera to +The dumpinquiry line causes some information about the camera to be printed. .PP cmdrespause specifies how many usec (1,000,000ths of a) between @@ -30,7 +30,7 @@ writing the command and reading the result should be used. 125000 seems to be the lowest I could go reliably. .PP breakpause is the time in 1,000,000ths of a usec between sending the -"back to default" break sending commands. +"back to default" break sending commands. .PP Empty lines and lines starting with a hash mark (#) are ignored. A sample configuration file is shown below: @@ -81,7 +81,7 @@ to "/tmp/config:" would result in directories "tmp/config", ".", and .TP .B SANE_DEBUG_DC210 If the library was compiled with debugging support enabled, this -environment variable controls the debug level for this backend. +environment variable controls the debug level for this backend. A value of 128 requests maximally copious debug output; smaller levels reduce verbosity. @@ -101,7 +101,7 @@ Henning Meier-Geinitz. Known bugs/limitations are: ? .PP More general comments, suggestions, and inquiries about frontends -or SANE should go to the SANE Developers mailing list -(see http://www.sane\-project.org/mailing\-lists.html for details). +or SANE should go to the SANE Developers mailing list +(see http://www.sane\-project.org/mailing\-lists.html for details). You must be subscribed to the list, otherwise your mail won't be sent to the subscribers. diff --git a/doc/sane-dc240.man b/doc/sane-dc240.man index ba7fd63c6..b925851c2 100644 --- a/doc/sane-dc240.man +++ b/doc/sane-dc240.man @@ -14,16 +14,16 @@ connected. The device name is always "0". .SH CONFIGURATION The contents of the .I dc240.conf -specify the serial port and baud rate to use. The baud rate +specify the serial port and baud rate to use. The baud rate specifies the maximum rate to use while downloading pictures. (The camera is always initialized using 9600 baud, then switches to the higher rate). On a 450MHz Pentium, I usually have no problems downloading at 115200 baud, though the camera sometimes has to resend packets due -to lost characters. Results are better when +to lost characters. Results are better when the "interrupt-unmask flag" is set in the IDE driver (hdparm \-u1). Supported baud rates are: 9600, 19200, 38400, 57600, and 115200. .PP -The dumpinquiry line causes some information about the camera to +The dumpinquiry line causes some information about the camera to be printed. .PP cmdrespause specifies how many usec (1,000,000ths of a) between @@ -31,7 +31,7 @@ writing the command and reading the result should be used. 125000 seems to be the lowest I could go reliably. .PP breakpause is the time in 1,000,000ths of a usec between sending the -"back to default" break sending commands. +"back to default" break sending commands. .PP Empty lines and lines starting with a hash mark (#) are ignored. A sample configuration file is shown below: @@ -82,7 +82,7 @@ to "/tmp/config:" would result in directories "tmp/config", ".", and .TP .B SANE_DEBUG_DC240 If the library was compiled with debugging support enabled, this -environment variable controls the debug level for this backend. +environment variable controls the debug level for this backend. A value of 128 requests maximally copious debug output; smaller levels reduce verbosity. @@ -101,13 +101,13 @@ The manpage was largely copied from the dc210 manpage. .SH BUGS The major limitation that I know of is that the backend assumes the directory in the camera is 100dc240. Once the camera has -taken more than 9999 pictures, the directory will increment to 101dc240. +taken more than 9999 pictures, the directory will increment to 101dc240. Not only should we check for the additional directory, but pictures may actually be found in multiple directories. .PP More general comments, suggestions, and inquiries about frontends -or SANE should go to the SANE Developers mailing list -(see http://www.sane\-project.org/mailing\-lists.html for details). +or SANE should go to the SANE Developers mailing list +(see http://www.sane\-project.org/mailing\-lists.html for details). You must be subscribed to the list, otherwise your mail won't be sent to the subscribers. diff --git a/doc/sane-dc25.man b/doc/sane-dc25.man index eabe765de..889fd2d27 100644 --- a/doc/sane-dc25.man +++ b/doc/sane-dc25.man @@ -15,15 +15,15 @@ connected. The device name is always "0". .SH CONFIGURATION The contents of the .I dc25.conf -specify the serial port and baud rate to use. The baud rate +specify the serial port and baud rate to use. The baud rate specifies the maximum rate to use while downloading pictures. (The camera is always initialized using 9600 baud, then switches to the higher rate). On my 90MHz Pentium, I usually have no problems downloading -at 115200 baud as long as the system is not excessively busy and +at 115200 baud as long as the system is not excessively busy and the "interrupt-unmask flag" is set in the IDE driver (hdparm \-u1). Supported baud rates are: 9600, 19200, 38400, 57600, and 115200. .PP -The dumpinquiry line causes some information about the camera to +The dumpinquiry line causes some information about the camera to be printed to stderr during startup. Note: This is not compatible with saned, so make sure you don't have any dumpinquiry lines if you are using saned (i.e. scanning on a remote machine using a @@ -74,7 +74,7 @@ to "/tmp/config:" would result in directories "tmp/config", ".", and .TP .B SANE_DEBUG_DC25 If the library was compiled with debugging support enabled, this -environment variable controls the debug level for this backend. +environment variable controls the debug level for this backend. A value of 128 requests maximally copious debug output; smaller levels reduce verbosity. @@ -93,7 +93,7 @@ slider that is used to select the picture from the camera may not be updated immediately. .PP More general comments, suggestions, and inquiries about frontends -or SANE should go to the SANE Developers mailing list -(see http://www.sane\-project.org/mailing\-lists.html for details). +or SANE should go to the SANE Developers mailing list +(see http://www.sane\-project.org/mailing\-lists.html for details). You must be subscribed to the list, otherwise your mail won't be sent to the subscribers. diff --git a/doc/sane-dll.man b/doc/sane-dll.man index 54f968648..e93f89790 100644 --- a/doc/sane-dll.man +++ b/doc/sane-dll.man @@ -55,11 +55,11 @@ mustek .PP It is also possible to add a file in .I @CONFIGDIR@/dll.d -that contains the list of backends to be added. Backends mentioned in a -file included in this directory will be added before any backends listed -in +that contains the list of backends to be added. Backends mentioned in a +file included in this directory will be added before any backends listed +in .I dll.conf. -Files in +Files in .I @CONFIGDIR@/dll.d can be freely named. They shall follow the format conventions as apply for .I dll.conf. @@ -76,7 +76,7 @@ in file backend/Makefile.in of the SANE source code distribution. After changing the value of this macro, it is necessary to reconfigure, rebuild, and reinstall SANE for the change to take effect. -Aliases are defined in the config file +Aliases are defined in the config file .IR dll.aliases . It can contain entries of the form .PP @@ -152,7 +152,7 @@ to "/tmp/config:" would result in directories "tmp/config", ".", and If the library was compiled with debug support enabled, this environment variable controls the debug level for this backend. E.g., a value of 128 requests all debug output to be printed. Smaller -levels reduce verbosity. +levels reduce verbosity. .ft CR .nf @@ -165,7 +165,7 @@ Value Description .fi .ft R -Example: +Example: export SANE_DEBUG_DLL=3 diff --git a/doc/sane-epjitsu.man b/doc/sane-epjitsu.man index 355269141..94518b7da 100644 --- a/doc/sane-epjitsu.man +++ b/doc/sane-epjitsu.man @@ -5,12 +5,12 @@ sane\-epjitsu \- SANE backend for Epson-based Fujitsu USB scanners. .SH DESCRIPTION -The +The .B sane\-epjitsu library implements a SANE (Scanner Access Now Easy) backend which provides basic access the Fujitsu fi\-60F/fi\-65F and ScanSnap S300/S1300(i)/S1100(i) scanners. .SH HARDWARE SUPPORT -These scanners are fairly limited, only supporting a couple of modes and resolutions, and always scanning full width. The backend supports missing modes (binary, grayscale) and intermediate resolutions in software, but provides only minimal scan area controls. See +These scanners are fairly limited, only supporting a couple of modes and resolutions, and always scanning full width. The backend supports missing modes (binary, grayscale) and intermediate resolutions in software, but provides only minimal scan area controls. See .B KNOWN ISSUES. This backend may support other scanners. If physical inspection reveals an Epson chipset, please contact the author for instructions on collecting a USB trace under Windows to verify. @@ -18,12 +18,12 @@ This backend may support other scanners. If physical inspection reveals an Epson .SH OPTIONS A limited effort has been made to expose the standard options to the API. This allows a frontend to set resolution, color mode, and choose the ADF setting. The epjitsu backend supports the following basic options for most scanners: .PP -source s +source s .RS Selects the source for the scan. Options may include "Flatbed", "ADF Front", "ADF Back", "ADF Duplex". .RE .PP -mode m +mode m .RS Selects the mode for the scan. Options may include "Lineart", "Gray", "Color". .RE @@ -52,13 +52,13 @@ Some systems use a kernel driver to access usb scanners. This method is untested .PP The only configuration option supported is "firmware /PATH/TO/FILE", allowing you to set the location of the firmware file you have extracted from the Windows driver. .PP -.B Note: +.B Note: This firmware is a copyrighted work of Fujitsu, so cannot be provided by the backend or the author. Please do not ask. .PP -.B Note: +.B Note: These scanners REQUIRE a firmware file to function. See the supplied configuration file for more detail. .PP -.B Note: +.B Note: This option may appear multiple times in the configuration file. It only applies to scanners discovered by 'usb' lines that follow this option. .PP diff --git a/doc/sane-epson.man b/doc/sane-epson.man index af2b3cf14..f09f07532 100644 --- a/doc/sane-epson.man +++ b/doc/sane-epson.man @@ -6,12 +6,12 @@ sane\-epson \- SANE backend for EPSON scanners The .B sane\-epson library implements a SANE (Scanner Access Now Easy) backend that -provides access to Epson flatbed scanners. Some functions of this +provides access to Epson flatbed scanners. Some functions of this backend should be considered .B beta-quality -software! Most functions have been stable for a long time, but of +software! Most functions have been stable for a long time, but of course new development can not and often times will not function properly from -the very first day. Please report any strange behavior to the +the very first day. Please report any strange behavior to the maintainer of the backend. .PP At present, the following scanners are known to work with this backend: @@ -48,23 +48,23 @@ CX-5200 USB and many more. The official list is on the Sane web site. .RE -For other scanners the software may or may not work. Please send mail to +For other scanners the software may or may not work. Please send mail to the backend author (khk@khk.net) to report success with scanners not on -the list or problems with scanners that are listed. +the list or problems with scanners that are listed. .SH OPTIONS The options the backend supports can either be selected through command line options to programs like scanimage or through GUI elements in programs like xscanimage or xsane. -Valid command line options and their syntax can be listed by using +Valid command line options and their syntax can be listed by using .RS scanimage \-\-help \-d epson .RE Not all devices support all options. .TP .I Scan Mode -The -.I \-\-mode +The +.I \-\-mode switch selects the basic mode of operation of the scanner. Valid choices are Binary, Gray and Color. The Binary mode is black and white only, Gray will produce 256 levels of gray or more depending on the scanner @@ -89,7 +89,7 @@ are "None", "Halftone A (Hard Tone)", "Halftone B (Soft Tone)", "Halftone C (4x4 Net Screen)", "Dither D (8x4 Net Screen)", "Text Enhanced Technology", "Download pattern A", and "Download pattern B". -The +The .I \-\-dropout switch selects the so called dropout color. Valid options are None, Red, Green and Blue. The default is None. The dropout color is used for @@ -109,62 +109,62 @@ switch sets the sharpness of the image data. Valid options are integer values from \-2 to 2, with \-2 meaning "Defocus", \-1 "Defocus slightly", 0 "Normal", 1 "Sharpen slightly" and 2 "Sharpen". -The +The .I \-\-gamma\-correction switch controls the scanner's internal gamma correction. Valid options are "Default", "User defined", "High density printing" "Low density printing" and "High contrast printing". -The +The .I \-\-color\-correction switch controls the scanner's internal color correction function. Valid options are "No Correction", "Impact\-dot printers", "Thermal printers", "Ink\-jet printers" and "CRT monitors". The default is "CRT monitors". -The +The .I \-\-resolution switch selects the resolution for a scan. Some EPSON scanners will scan in any resolution between the lowest and highest possible value. The list reported by the scanner can be displayed using the "\-\-help \-d epson" parameters to scanimage. -The +The .I \-\-mirror option controls the way the image is scanned. By reading the image data from right to left the image is mirrored. Valid options are "yes" and "no". The default is "no". -The +The .I \-\-speed option can improve the scan speed in monochrome mode. Valid options are "yes" or "no", the "yes" option will speed up the scan if this option is supported. -The -.I \-\-auto\-area\-segmentation +The +.I \-\-auto\-area\-segmentation switch activates the automatic area segmentation for monochrome scans. The scanner will try to determine which areas are text and which contain images. The image areas will be halftoned, and the text will be improved. Valid options are "yes" and "no". The default is "yes". -The +The .I \-\-gamma\-table parameter can be used to download a user defined gamma table. The option takes 256 values from the range 0-255. In color mode this option equally affects the red, green, and blue channel. -The -.I \-\-red\-gamma\-table +The +.I \-\-red\-gamma\-table parameter can be used to download a user defined gamma table for the red channel. The valid options are the same as for \-\-gamma\-table. -The -.I \-\-green\-gamma\-table +The +.I \-\-green\-gamma\-table parameter can be used to download a user defined gamma table for the green channel. The valid options are the same as for \-\-gamma\-table. -The -.I \-\-blue\-gamma\-table +The +.I \-\-blue\-gamma\-table parameter can be used to download a user defined gamma table for the blue channel. The valid options are the same as for \-\-gamma\-table. @@ -173,19 +173,19 @@ The color correction coefficients will install color correction coefficients for the user defined color correction. Values are specified as integers in the range \-127..127. -The +The .I \-\-preview -option requests a preview scan. The frontend software automatically selects a low +option requests a preview scan. The frontend software automatically selects a low resolution. Valid options are "yes" and "no". The default is "no". -The +The .I \-\-preview\-speed options will increase the scan speed if this is supported by the scanner. Valid options are "yes" and "no", the default is "no". The geometry options -.I \-l \-t \-x \-y +.I \-l \-t \-x \-y control the scan area: \-l sets the top left x coordinate, \-t the top left y coordinate, \-x selects the width and \-y the height of the scan area. All parameters are specified in millimeters. @@ -201,9 +201,9 @@ The option selects the scan source. Valid options depend on the installed options. The default is "Flatbed". -The +The .I \-\-auto\-eject -option will eject a page after scanning from the document feeder. +option will eject a page after scanning from the document feeder. The .I \-\-film\-type @@ -222,7 +222,7 @@ will ignore this option. .SH CONFIGURATION FILE -The configuration file @CONFIGDIR@/epson.conf specifies the device(s) that the +The configuration file @CONFIGDIR@/epson.conf specifies the device(s) that the backend will use. Possible connection types are: .TP .I SCSI @@ -230,22 +230,22 @@ This is the default, and if nothing else is specified the backend software will open a given path as SCSI device. More information about valid syntax for SCSI devices can be found in sane\-scsi(5). .br -Usually SCSI scanners are configured with a line "scsi EPSON" in this file. In +Usually SCSI scanners are configured with a line "scsi EPSON" in this file. In some cases it may be necessary to only use the string "scsi" (e.g. for the GT-6500). .TP .I PIO \- Parallel Interface The parallel interface can be configured in two ways: An integer value starting at the beginning of a line will be interpreted as the IO address of the parallel -port. To make it clearer that a configured IO address is a parallel port the +port. To make it clearer that a configured IO address is a parallel port the port address can be preceded by the string "PIO". The PIO connection does not use a special device file in the /dev directory. The IO address can be specified in hex mode (prefixed with "0x"). .TP .I USB -A device file that is preceded by the string "USB" is treated as a scanner +A device file that is preceded by the string "USB" is treated as a scanner connected via the Universal Serial Bus. The correct special device file has -to be created prior to using it with Sane. See the USB documentation for -more information about how to set up the USB subsystem and the required +to be created prior to using it with Sane. See the USB documentation for +more information about how to set up the USB subsystem and the required device files. .SH FILES .TP @@ -265,14 +265,14 @@ levels reduce verbosity. .TP .B SANE_DEBUG_EPSON_SCSI If the library was compiled with debug support enabled, this -environment variable controls the SCSI related debug level for this backend. +environment variable controls the SCSI related debug level for this backend. Only a value of 2 is supported. .TP .B SANE_EPSON_CMD_LVL This allows one to override the function or command level that the backend uses to communicate with the scanner. The function level a scanner supports is determined during the initialization of the device. If -the backend does not recognize the function level reported by the +the backend does not recognize the function level reported by the scanner it will default to function level B3. Valid function levels are A1, A2, B1, B2, B3, B4, B5, B6, B7, B8, D1 and F5. Use this feature only if you know what you are doing! @@ -286,18 +286,18 @@ sane\-scsi(5), scanimage(1), xscanimage(1), xsane(1) None :-) At least none are currently known. .SH UNSUPPORTED DEVICES -The backend may be used with Epson scanners that are not yet listed +The backend may be used with Epson scanners that are not yet listed under the list of supported devices. A scanner that is not recognized -may default to the function level B3, which means that not all -functions that the scanner may be capable of are accessible. +may default to the function level B3, which means that not all +functions that the scanner may be capable of are accessible. If the scanner is not even recognized as an Epson scanner this is probably because the device name reported by the scanner is not in the correct format. Please send this information to the backend maintainer (email address is in the AUTHOR section of this man page or in the -AUTHORS file of the SANE distribution). +AUTHORS file of the SANE distribution). -The Perfection 600, Perfection 650, Perfection 660, Perfection 1250 and +The Perfection 600, Perfection 650, Perfection 660, Perfection 1250 and Perfection 1260 are not supported by this backend. .SH AUTHOR diff --git a/doc/sane-epson2.man b/doc/sane-epson2.man index 6d47eeab2..33acd782e 100644 --- a/doc/sane-epson2.man +++ b/doc/sane-epson2.man @@ -13,11 +13,11 @@ include network access. .PP Because .B sane\-epson -and -.B sane\-epson2 +and +.B sane\-epson2 drivers support many of the same devices, if one driver gives you problems you may try disabling it to try the other. -This can be done by removing the driver name from the +This can be done by removing the driver name from the .I dll.conf or perhaps by commenting out the options in .I epson.conf @@ -94,23 +94,23 @@ V750 USB, IEEE-1394 and many more. The official list is on the Sane web site. .RE -For other scanners the software may or may not work. Please send mail to +For other scanners the software may or may not work. Please send mail to the sane-backend mailing list to report success with scanners not on -the list or problems with scanners that are listed. +the list or problems with scanners that are listed. .SH OPTIONS The options the backend supports can either be selected through command line options to programs like scanimage or through GUI elements in programs like xscanimage or xsane. -Valid command line options and their syntax can be listed by using +Valid command line options and their syntax can be listed by using .RS scanimage \-\-help \-d epson2 .RE Not all devices support all options. .TP .I Scan Mode -The -.I \-\-mode +The +.I \-\-mode switch selects the basic mode of operation of the scanner. Valid choices are Binary, Gray and Color. The Binary mode is black and white only, Gray will produce 256 levels of gray or more depending on the scanner @@ -135,7 +135,7 @@ are "None", "Halftone A (Hard Tone)", "Halftone B (Soft Tone)", "Halftone C (4x4 Net Screen)", "Dither D (8x4 Net Screen)", "Text Enhanced Technology", "Download pattern A", and "Download pattern B". -The +The .I \-\-dropout switch selects the so called dropout color. Valid options are None, Red, Green and Blue. The default is None. The dropout color is used for @@ -155,54 +155,54 @@ switch sets the sharpness of the image data. Valid options are integer values from \-2 to 2, with \-2 meaning "Defocus", \-1 "Defocus slightly", 0 "Normal", 1 "Sharpen slightly" and 2 "Sharpen". -The +The .I \-\-gamma\-correction switch controls the scanner's internal gamma correction. Valid options are "Default", "User defined", "High density printing" "Low density printing" and "High contrast printing". -The +The .I \-\-color\-correction switch controls the scanner's internal color correction function. Valid options are "No Correction", "Impact\-dot printers", "Thermal printers", "Ink\-jet printers" and "CRT monitors". The default is "CRT monitors". -The +The .I \-\-resolution switch selects the resolution for a scan. Some EPSON scanners will scan in any resolution between the lowest and highest possible value. The list reported by the scanner can be displayed using the "\-\-help \-d epson" parameters to scanimage. -The +The .I \-\-threshold switch selects the minimum brightness to get a white point. -The +The .I \-\-mirror option controls the way the image is scanned. By reading the image data from right to left the image is mirrored. Valid options are "yes" and "no". The default is "no". -The -.I \-\-auto\-area\-segmentation +The +.I \-\-auto\-area\-segmentation switch activates the automatic area segmentation for monochrome scans. The scanner will try to determine which areas are text and which contain images. The image areas will be halftoned, and the text will be improved. Valid options are "yes" and "no". The default is "yes". -The -.I \-\-red\-gamma\-table +The +.I \-\-red\-gamma\-table parameter can be used to download a user defined gamma table for the red channel. The valid options are the same as for \-\-gamma\-table. -The -.I \-\-green\-gamma\-table +The +.I \-\-green\-gamma\-table parameter can be used to download a user defined gamma table for the green channel. The valid options are the same as for \-\-gamma\-table. -The -.I \-\-blue\-gamma\-table +The +.I \-\-blue\-gamma\-table parameter can be used to download a user defined gamma table for the blue channel. The valid options are the same as for \-\-gamma\-table. @@ -216,13 +216,13 @@ The color correction coefficients will install color correction coefficients for the user defined color correction. Values are specified as integers in the range \-127..127. -The +The .I \-\-preview -option requests a preview scan. The frontend software automatically selects a low +option requests a preview scan. The frontend software automatically selects a low resolution. Valid options are "yes" and "no". The default is "no". The geometry options -.I \-l \-t \-x \-y +.I \-l \-t \-x \-y control the scan area: \-l sets the top left x coordinate, \-t the top left y coordinate, \-x selects the width and \-y the height of the scan area. All parameters are specified in millimeters. @@ -232,9 +232,9 @@ The option selects the scan source. Valid options depend on the installed options. The default is "Flatbed". -The +The .I \-\-auto\-eject -option will eject a page after scanning from the document feeder. +option will eject a page after scanning from the document feeder. The .I \-\-film\-type @@ -264,7 +264,7 @@ The option select the ADF mode (simplex/duplex). .SH CONFIGURATION FILE -The configuration file @CONFIGDIR@/epson2.conf specifies the device(s) that the +The configuration file @CONFIGDIR@/epson2.conf specifies the device(s) that the backend will use. Possible connection types are: .TP .I SCSI @@ -272,28 +272,28 @@ This is the default, and if nothing else is specified the backend software will open a given path as SCSI device. More information about valid syntax for SCSI devices can be found in sane\-scsi(5). .br -Usually SCSI scanners are configured with a line "scsi EPSON" in this file. In +Usually SCSI scanners are configured with a line "scsi EPSON" in this file. In some cases it may be necessary to only use the string "scsi" (e.g. for the GT-6500). .TP .I PIO \- Parallel Interface The parallel interface can be configured in two ways: An integer value starting at the beginning of a line will be interpreted as the IO address of the parallel -port. To make it clearer that a configured IO address is a parallel port the +port. To make it clearer that a configured IO address is a parallel port the port address can be preceded by the string "PIO". The PIO connection does not use a special device file in the /dev directory. The IO address can be specified in hex mode (prefixed with "0x"). .TP .I USB For USB scanners not automatically detect, their VENDOR and PRODUCT ID can -be specified manually in the config file. +be specified manually in the config file. More information about valid syntax for USB devices can be found in sane\-usb(5). .TP .I Network Network scanners can be auto-discovered if .I autodiscovery -is specified after +is specified after .I -net +net keyword. An IP address to connect to can also be used. .SH FILES .TP @@ -313,20 +313,20 @@ levels reduce verbosity. .TP .B SANE_DEBUG_EPSON2_SCSI If the library was compiled with debug support enabled, this -environment variable controls the SCSI related debug level for this backend. +environment variable controls the SCSI related debug level for this backend. Only a value of 2 is supported. .TP .B SANE_DEBUG_EPSON2_NET If the library was compiled with debug support enabled, this -environment variable controls the network related debug level for this -backend. E.g., a value of 128 requests all debug output to be printed. +environment variable controls the network related debug level for this +backend. E.g., a value of 128 requests all debug output to be printed. Smaller levels reduce verbosity. .TP .B SANE_EPSON2_CMD_LVL This allows one to override the function or command level that the backend uses to communicate with the scanner. The function level a scanner supports is determined during the initialization of the device. If -the backend does not recognize the function level reported by the +the backend does not recognize the function level reported by the scanner it will default to function level B3. Valid function levels are A1, A2, B1, B2, B3, B4, B5, B6, B7, B8, D1 and F5. Use this feature only if you know what you are doing! @@ -340,16 +340,16 @@ sane\-scsi(5), sane\-usb(5), scanimage(1), xscanimage(1), xsane(1) None :-) At least none are currently known. .SH UNSUPPORTED DEVICES -The backend may be used with Epson scanners that are not yet listed +The backend may be used with Epson scanners that are not yet listed under the list of supported devices. A scanner that is not recognized -may default to the function level B3, which means that not all -functions that the scanner may be capable of are accessible. +may default to the function level B3, which means that not all +functions that the scanner may be capable of are accessible. If the scanner is not even recognized as an Epson scanner this is probably because the device name reported by the scanner is not in the correct format. Please send this information to the backend maintainer (email address is in the AUTHOR section of this man page or in the -AUTHORS file of the SANE distribution). +AUTHORS file of the SANE distribution). .SH AUTHOR diff --git a/doc/sane-epsonds.man b/doc/sane-epsonds.man index 3324804ec..03bbbd238 100644 --- a/doc/sane-epsonds.man +++ b/doc/sane-epsonds.man @@ -8,15 +8,15 @@ The library implements a SANE (Scanner Access Now Easy) backend that provides access to Epson ESC/I-2 scanners. .PP -Valid command line options and their syntax can be listed by using +Valid command line options and their syntax can be listed by using .RS scanimage \-\-help \-d epsonds .RE Not all devices support all options. .TP .I Scan Mode -The -.I \-\-mode +The +.I \-\-mode switch selects the basic mode of operation of the scanner. Valid choices are Lineart, Gray and Color. The Lineart mode is black and white only, Gray will produce 256 levels of gray or more depending on the scanner @@ -33,7 +33,7 @@ allow one to select either 8 bits, 12 or 14 bits per color channel. For a color scan this means an effective color depth of 36 or 42 bits over all three channels. The valid choices depend on the scanner model. -The +The .I \-\-resolution switch selects the resolution for a scan. Some EPSON scanners will scan in any resolution between the lowest and highest possible value. The list @@ -41,7 +41,7 @@ reported by the scanner can be displayed using the "\-\-help \-d epson" parameters to scanimage. The geometry options -.I \-l \-t \-x \-y +.I \-l \-t \-x \-y control the scan area: \-l sets the top left x coordinate, \-t the top left y coordinate, \-x selects the width and \-y the height of the scan area. All parameters are specified in millimeters. @@ -60,20 +60,20 @@ The option select the ADF mode (simplex/duplex). .SH CONFIGURATION FILE -The configuration file @CONFIGDIR@/epsonds.conf specifies the device(s) that the +The configuration file @CONFIGDIR@/epsonds.conf specifies the device(s) that the backend will use. Possible connection types are: .TP .I USB For not automatically detected USB scanners, their VENDOR and PRODUCT ID can -be specified manually in the config file. +be specified manually in the config file. More information about valid syntax for USB devices can be found in sane\-usb(5). .TP .I Network (not yet supported) Network scanners can be auto-discovered if .I autodiscovery -is specified after +is specified after .I -net +net keyword. An IP address to connect to can also be used. .SH FILES .TP diff --git a/doc/sane-find-scanner.man b/doc/sane-find-scanner.man index da2d377f7..3d3d9ff51 100644 --- a/doc/sane-find-scanner.man +++ b/doc/sane-find-scanner.man @@ -9,7 +9,7 @@ sane\-find\-scanner \- find SCSI and USB scanners and their device files .RB [ \-q ] .RB [ \-p ] .RB [ \-f ] -.RB [ \-F +.RB [ \-F .IR filename ] .RI [ devname ] @@ -19,15 +19,15 @@ is a command-line tool to find SCSI and USB scanners and determine their Unix device files. Its primary aim is to make sure that scanners can be detected by SANE backends. .PP -For +For .B SCSI -scanners, it checks the default generic SCSI device files (e.g., +scanners, it checks the default generic SCSI device files (e.g., .IR /dev/sg0 ) -and +and .IR /dev/scanner . The test is done by sending a SCSI inquiry command and looking for a device type of "scanner" or "processor" (some old HP scanners seem to send -"processor"). So +"processor"). So .B sane\-find\-scanner will find any SCSI scanner connected to those default device files even if it isn't supported by any SANE backend. @@ -42,12 +42,12 @@ and are tested. The files are opened and the vendor and device ids are determined, if the operating system supports this feature. Currently USB scanners are only found this way if they are supported by the Linux scanner module or the -FreeBSD or OpenBSD uscanner driver. After that test, +FreeBSD or OpenBSD uscanner driver. After that test, .B sane\-find\-scanner tries to scan for USB devices found by the USB library libusb (if available). There is no special USB class for scanners, so the heuristics used to distinguish scanners from other USB devices is not -perfect. +perfect. .B sane\-find\-scanner also tries to find out the type of USB chip used in the scanner. If detected, it will be printed after the vendor and product ids. @@ -55,11 +55,11 @@ it will be printed after the vendor and product ids. will even find USB scanners, that are not supported by any SANE backend. .PP .B sane\-find\-scanner -won't find most +won't find most parallel port scanners, or scanners connected to proprietary ports. Some .B parallel port scanners may be detected by -.B sane\-find\-scanner -p. +.B sane\-find\-scanner -p. At the time of writing this will only detect Mustek parallel port scanners. .SH OPTIONS @@ -68,7 +68,7 @@ At the time of writing this will only detect Mustek parallel port scanners. Prints a short usage message. .TP 8 .B \-v -Verbose output. If used once, +Verbose output. If used once, .B sane\-find\-scanner shows every device name and the test result. If used twice, SCSI inquiry information and the USB device descriptors are also printed. @@ -81,7 +81,7 @@ Probe parallel port scanners. .TP 8 .B \-f Force opening all explicitly given devices as SCSI and USB devices. That's -useful if +useful if .B sane\-find\-scanner is wrong in determining the device type. .TP 8 @@ -128,7 +128,7 @@ SCSI support is available on Irix, EMX, Linux, Next, AIX, Solaris, FreeBSD, NetBSD, OpenBSD, and HP-UX. .SH BUGS -No support for most parallel port scanners yet. +No support for most parallel port scanners yet. .br Detection of USB chipsets is limited to a few chipsets. diff --git a/doc/sane-fujitsu.man b/doc/sane-fujitsu.man index 6bd5f735f..44e820cd7 100644 --- a/doc/sane-fujitsu.man +++ b/doc/sane-fujitsu.man @@ -5,7 +5,7 @@ sane\-fujitsu \- SANE backend for Fujitsu flatbed and ADF scanners .SH DESCRIPTION -The +The .B sane\-fujitsu library implements a SANE (Scanner Access Now Easy) backend which provides access to most Fujitsu flatbed and ADF scanners. @@ -13,10 +13,10 @@ provides access to most Fujitsu flatbed and ADF scanners. This document describes backend version 133, which shipped with SANE 1.0.26. .SH SUPPORTED HARDWARE -This version supports every known model which speaks the Fujitsu SCSI and -SCSI\-over\-USB protocols. Specifically, the SCSI M309x and M409x series, the +This version supports every known model which speaks the Fujitsu SCSI and +SCSI\-over\-USB protocols. Specifically, the SCSI M309x and M409x series, the SCSI fi\-series, most of the USB fi\-series, the USB ScanSnap S5xx/S15xx, and -the USB iX1xx/5xx series scanners are supported. Please see the list at +the USB iX1xx/5xx series scanners are supported. Please see the list at http://www.sane\-project.org/sane\-supported\-devices.html for details. This backend may support other Fujitsu scanners. The best @@ -51,13 +51,13 @@ SP\-600C/620C fi\-5015C .SH OPTIONS Effort has been made to expose all hardware options, including: .PP -source s +source s .RS Selects the source for the scan. Options may include "Flatbed", "ADF Front", "ADF Back", "ADF Duplex". .RE .PP -mode m +mode m .RS Selects the mode for the scan. Options may include "Lineart", "Halftone", "Gray", and "Color". @@ -65,13 +65,13 @@ may include "Lineart", "Halftone", "Gray", and "Color". .PP resolution, y\-resolution .RS -Controls scan resolution. Setting \-\-resolution also sets \-\-y\-resolution, +Controls scan resolution. Setting \-\-resolution also sets \-\-y\-resolution, though this behavior is overridden by some frontends. .RE .PP tl\-x, tl\-y, br\-x, br\-y .RS -Sets scan area upper left and lower right coordinates. These are renamed +Sets scan area upper left and lower right coordinates. These are renamed t, l, x, y by some frontends. .RE .PP @@ -89,19 +89,19 @@ group of endorser options. Additionally, several 'software' options are exposed by the backend. These are reimplementations of features provided natively by larger scanners, but running on the host computer. This enables smaller machines to have similar -capabilities. Please note that these features are somewhat simplistic, and -may not perform as well as the native implementations. Note also that these -features all require that the driver cache the entire image in memory. This +capabilities. Please note that these features are somewhat simplistic, and +may not perform as well as the native implementations. Note also that these +features all require that the driver cache the entire image in memory. This will almost certainly result in a reduction of scanning speed. -Use 'scanimage \-\-help' to get a list, but be aware that some options may -be settable only when another option has been set, and that advanced options +Use 'scanimage \-\-help' to get a list, but be aware that some options may +be settable only when another option has been set, and that advanced options may be hidden by some frontend programs. .PP .SH CONFIGURATION FILE The configuration file "fujitsu.conf" is used to tell the backend how to look for scanners, and provide options controlling the operation of the backend. -This file is read each time the frontend asks the backend for a list +This file is read each time the frontend asks the backend for a list of scanners, generally only when the frontend starts. If the configuration file is missing, the backend will be unable to locate any scanners. .PP @@ -109,8 +109,8 @@ Scanners can be specified in the configuration file in 4 ways: .PP "scsi FUJITSU" .RS -Requests backend to search all scsi busses in the system for a device -which reports itself to be a scanner made by 'FUJITSU'. +Requests backend to search all scsi busses in the system for a device +which reports itself to be a scanner made by 'FUJITSU'. .RE .PP "scsi /dev/sg0" (or other scsi device file) @@ -122,7 +122,7 @@ specify one. Probably should not be used with the other "scsi" line above. .PP "usb 0x04c5 0x1042" (or other vendor/product ids) .RS -Requests backend to search all usb busses in the system for a device +Requests backend to search all usb busses in the system for a device which uses that vendor and product id. The device will then be queried to determine if it is a Fujitsu scanner. .RE @@ -134,7 +134,7 @@ untested. .RE .PP The only configuration option supported is "buffer\-size=xxx", allowing you -to set the number of bytes in the data buffer to something other than the +to set the number of bytes in the data buffer to something other than the compiled\-in default, 65536 (64K). Some users report that their scanner will "hang" mid\-page, or fail to transmit the image if the buffer is not large enough. @@ -174,13 +174,13 @@ enables debugging output to stderr. Valid values are: Flatbed units may fail to scan at maximum area, particularly at high resolution. .PP -Any model that does not support VPD during inquiry will not function until +Any model that does not support VPD during inquiry will not function until an override is added to the backend. .PP CCITT Fax compression used by older scanners is not supported. .PP JPEG output is supported by the backend, but not by the SANE protocol, so is -disabled in this release. It can be enabled if you rebuild from source. +disabled in this release. It can be enabled if you rebuild from source. .SH CREDITS m3091 backend: Frederik Ramm diff --git a/doc/sane-genesys.man b/doc/sane-genesys.man index cd00cc323..65407542d 100644 --- a/doc/sane-genesys.man +++ b/doc/sane-genesys.man @@ -8,14 +8,14 @@ The library implements a SANE (Scanner Access Now Easy) backend that provides access to USB flatbed scanners based on the Genesys GL646, GL841, GL843, GL847 and GL124 chips. At present, the following scanners are known to work with this backend: -.PP +.PP .RS Canon LiDE 35/40/50/60/100/110/120/200/210/220/700 .br Hewlett-Packard HP2300C/HP2400/HP3670/HP3690/G4010/G4050 .br Medion MD5345/MD6228/MD6274 -.br +.br Panasonic KV-SS080 .br Plustek OpticBook 3600 @@ -29,11 +29,11 @@ Visioneer OneTouch 7100/Strobe XP100 (rev3)/XP200/XP300/Roadwarrior Xerox Travel Scanner 100, OneTouch 2400 .RE -.PP +.PP This is stable software for supported models. But if you test new or untested scanners, keep your hand at the scanner's plug and unplug it, if the head bumps at the end of the scan area. -.PP +.PP If you own a scanner other than the ones listed above that works with this backend, please let me know this by sending the scanner's exact model name and the USB vendor and device ids (e.g. from @@ -41,10 +41,10 @@ the USB vendor and device ids (e.g. from .I sane\-find\-scanner or syslog) to the sane\-devel mailing list. Even if the scanner's name is only slightly different from the models mentioned above, please let me know. -.PP +.PP If you own a scanner that isn't detected by the genesys backend but has a GL646, -GL841, GL843, GL847 or GL124 chipset, you can try to add it to the backend. -.PP +GL841, GL843, GL847 or GL124 chipset, you can try to add it to the backend. +.PP .SH "CALIBRATION" To give correct image quality, sheet fed scanners need to be calibrated using the calibration sheet sold with the scanner. To do calibration, you must insert this target @@ -135,26 +135,26 @@ userwith the calibration clear option. A value of 0 means cache is disabled. Additionally, several 'software' options are exposed by the backend. These are reimplementations of features provided natively by larger scanners, but running on the host computer. This enables smaller machines to have similar -capabilities. Please note that these features are somewhat simplistic, and -may not perform as well as the native implementations. Note also that these -features all require that the driver cache the entire image in memory. This +capabilities. Please note that these features are somewhat simplistic, and +may not perform as well as the native implementations. Note also that these +features all require that the driver cache the entire image in memory. This will almost certainly result in a reduction of scanning speed. .PP -.B \-\-swcrop +.B \-\-swcrop .RS - Requests the driver to detect the extremities of the paper within the larger -image, and crop the empty edges. + Requests the driver to detect the extremities of the paper within the larger +image, and crop the empty edges. .RE .PP -.B \-\-swdeskew +.B \-\-swdeskew .RS - Requests the driver to detect the rotation of the paper within the larger + Requests the driver to detect the rotation of the paper within the larger image, and counter the rotation. .RE .PP .B \-\-swdespeck \-\-despeck X .RS - Requests the driver to find and remove dots of X diameter or smaller from the + Requests the driver to find and remove dots of X diameter or smaller from the image, and fill the space with the average surrounding color. .RE .PP @@ -187,24 +187,24 @@ autodetected by statements which are already included into .IR genesys.conf . "vendor_id" and "product_id" are hexadecimal numbers that identify the -scanner. -.PP +scanner. +.PP .SH "FILES" -.TP +.TP .I @CONFIGDIR@/genesys.conf The backend configuration file (see also description of .B SANE_CONFIG_DIR below). -.TP +.TP .I @LIBDIR@/libsane\-genesys.a The static library implementing this backend. -.TP +.TP .I @LIBDIR@/libsane\-genesys.so The shared library implementing this backend (present on systems that support dynamic loading). .SH "ENVIRONMENT" -.TP +.TP .B SANE_CONFIG_DIR This environment variable specifies the list of directories that may contain the configuration file. Under UNIX, the directories are @@ -218,7 +218,7 @@ directories. For example, setting .B SANE_CONFIG_DIR to "/tmp/config:" would result in directories "tmp/config", ".", and "@CONFIGDIR@" being searched (in this order). -.TP +.TP .B SANE_DEBUG_GENESYS If the library was compiled with debug support enabled, this environment variable controls the debug level for this backend. Higher debug levels @@ -229,29 +229,29 @@ care. This will print messages related to core genesys functions. .B SANE_DEBUG_GENESYS_LOW This environment variable controls the debug level for low level functions common to all genesys ASICs. -.TP +.TP .B SANE_DEBUG_GENESYS_GL646 This environment variable controls the debug level for the specific GL646 code part. -.TP +.TP .B SANE_DEBUG_GENESYS_GL841 This environment variable controls the debug level for the specific GL841 code part. -.TP +.TP .B SANE_DEBUG_GENESYS_GL843 This environment variable controls the debug level for the specific GL843 code part. -.TP +.TP .B SANE_DEBUG_GENESYS_GL847 This environment variable controls the debug level for the specific GL847 code part. -.TP +.TP .B SANE_DEBUG_GENESYS_GL124 This environment variable controls the debug level for the specific GL124 code part. -Example (full and highly verbose output for gl646): +Example (full and highly verbose output for gl646): .br export SANE_DEBUG_GENESYS=255 .br @@ -260,12 +260,12 @@ export SANE_DEBUG_GENESYS_LOW=255 export SANE_DEBUG_GENESYS_GL646=255 .SH CREDITS - + Jack McGill for donating several sheetfed and flatbed scanners, which made possible to add support for them in the genesys backend: .RS Hewlett-Packard HP3670 -.br +.br Visioneer Strobe XP100 (rev3)/XP200/XP300/Roadwarrior .br Canon LiDE 200 @@ -292,20 +292,20 @@ Luc Verhaegen for donating a Canoscan LiDE 120. .SH "SEE ALSO" .BR sane (7), .BR sane\-usb (5) -.br +.br .SH "AUTHOR" Oliver Rauch -.br +.br Henning Meier-Geinitz -.br +.br Gerhard Jaeger -.br +.br St\['e]phane Voltz -.br +.br Philipp Schmid -.br +.br Pierre Willenbrock .br Alexey Osipov for HP2400 final support @@ -321,4 +321,4 @@ This backend will be much slower if not using libusb\-1.0. So be sure that sane\ .SH "BUGS" For the LiDE 200, the scanned data at 4800 dpi is obtained "as is" from sensor. It seems the windows driver does some digital processing to improve it, which is not implemented in the backend. -.PP +.PP diff --git a/doc/sane-gphoto2.man b/doc/sane-gphoto2.man index ef8141faa..e72503934 100644 --- a/doc/sane-gphoto2.man +++ b/doc/sane-gphoto2.man @@ -6,7 +6,7 @@ sane\-gphoto2 \- SANE backend for gphoto2 supported cameras The .B sane\-gphoto2 library implements a SANE (Scanner Access Now Easy) backend that -provides access to the digital cameras supported by gphoto2. +provides access to the digital cameras supported by gphoto2. This backend has only been tested with a handful of cameras so far. Patches to support other models are welcome. .PP @@ -26,16 +26,16 @@ required since they are needed by the sane frontends, but can't be obtained through the gphoto2 interface. Valid ports and cameras can be obtained by "gphoto2 \-\-list\-cameras" and "gphoto2 \-\-list\-ports". .PP -The dumpinquiry line causes some information about the camera to +The dumpinquiry line causes some information about the camera to be printed. .PP Empty lines and lines starting with a hash mark (#) are ignored. A sample configuration file is shown below: .PP -The "topfolder" line specifies the "fixed" part of the file path. For -example, on the Kodak DC-240, files are stored in the directory +The "topfolder" line specifies the "fixed" part of the file path. For +example, on the Kodak DC-240, files are stored in the directory /DCIM/100DC240. The /DCIM portion is constant, but 100DC240 will -change and must be read from the camera. In this case, the +change and must be read from the camera. In this case, the line would read "topfolder=/DCIM" .PP Some cameras don't implement a file structure and store all pictures @@ -90,12 +90,12 @@ to "/tmp/config:" would result in directories "tmp/config", ".", and .TP .B SANE_DEBUG_GPHOTO2 If the library was compiled with debugging support enabled, this -environment variable controls the debug level for this backend. +environment variable controls the debug level for this backend. A value of 128 requests maximally copious debug output; smaller levels reduce verbosity. -.TP +.TP .B GP_DEBUG -Set to 1, 2, or 3, to enable various levels of debugging within the +Set to 1, 2, or 3, to enable various levels of debugging within the gphoto2 libraries. .SH "SEE ALSO" @@ -111,8 +111,8 @@ The manpage was largely copied from the dc210 manpage. Many, no doubt. .PP More general comments, suggestions, and inquiries about frontends -or SANE should go to the SANE Developers mailing list -(see http://www.sane\-project.org/mailing\-lists.html for details). +or SANE should go to the SANE Developers mailing list +(see http://www.sane\-project.org/mailing\-lists.html for details). You must be subscribed to the list, otherwise your mail won't be sent to the subscribers. diff --git a/doc/sane-gt68xx.man b/doc/sane-gt68xx.man index e3d29af9f..9c44e9c01 100644 --- a/doc/sane-gt68xx.man +++ b/doc/sane-gt68xx.man @@ -8,7 +8,7 @@ The library implements a SANE (Scanner Access Now Easy) backend that provides access to USB flatbed scanners based on the Grandtech GT-6801 and GT-6816 chips. A list of supported scanners can be found on the gt68xx backend -homepage: +homepage: .IR http://www.meier\-geinitz.de/sane/gt68xx\-backend/ . .PP This is BETA software. Especially if you test new or untested scanners, keep @@ -24,7 +24,7 @@ the models already listed as supported, please let me know. .PP If you own a scanner that isn't detected by the gt68xx backend but has a GT-6801 or GT-6816 chipset, you can try to add it to the backend. Have a look at the -following web page: +following web page: .I http://www.meier\-geinitz.de/sane/gt68xx\-backend/adding.html .PP .SH LIBUSB ISSUES @@ -38,7 +38,7 @@ USB information looks at .SH FIRMWARE FILE You need a firmware file for your scanner. That's a small file containing software that will be uploaded to the scanner's memory. It's usually named -*.usb, e.g. +*.usb, e.g. .IR PS1fw.usb . It comes on the installation CD that was provided by the manufacturer, but it may be packaged together with the installation program in an .exe file. For @@ -64,9 +64,9 @@ autodetected by statements which are already included into .IR gt68xx.conf . "vendor_id" and "product_id" are hexadecimal numbers that identify the -scanner. +scanner. .PP -The +The .BR override , .BR firmware , .BR vendor , @@ -82,7 +82,7 @@ Option is used to override the default model parameters. That's necessary for some scanners that use the same vendor/product ids but are different. For these scanners there are already commented out override lines in the configuration -file. +file. .B override "mustek\-scanexpress\-1200\-ub\-plus" is necessary for the Mustek Scanexpress 1200 UB Plus, the Medion/Lifetec/Tevion LT 9452, and the Trust Compact Scan USB 19200. @@ -93,7 +93,7 @@ Medion/ Lifetec/ Tevion/ Cytron MD/LT 9385, the Medion/ Lifetec/ Tevion MD .B override "mustek\-bearpaw\-2400\-cu" is necessary for the Mustek BearPaw 2400 CU and the Fujitsu 1200CUS. The .B override -option must be the first one after the +option must be the first one after the .B usb line. .PP @@ -107,7 +107,7 @@ at a different path, use a .B firmware line. .PP -The +The .B vendor and .B model @@ -178,7 +178,7 @@ increase the verbosity of the output. If the debug level is set to 1 or higher, some debug options become available that are normally hidden. Handle them with care. -Example: +Example: export SANE_DEBUG_GT68XX=4 .SH "SEE ALSO" diff --git a/doc/sane-hp.man b/doc/sane-hp.man index 4e7d35d4a..1aeaea836 100644 --- a/doc/sane-hp.man +++ b/doc/sane-hp.man @@ -39,7 +39,7 @@ PhotoSmart C5100A R029,R030,R032 SCSI .RE .PP Support for models 5100C/5200C connected to the parallel port requires -the ppSCSI driver available at +the ppSCSI driver available at .I http://cyberelk.net/tim/parport/ppscsi.html and .IR http://penguin-breeder.org/kernel/download/ . @@ -52,7 +52,7 @@ for more details. .PP The "hp" backend no longer supports OfficeJet multi-function peripherals. For these devices use the external "hpoj" backend in version 0.90 and later of -the "HP OfficeJet Linux driver", available at +the "HP OfficeJet Linux driver", available at .br .IR http://hpoj.sourceforge.net . @@ -66,7 +66,7 @@ by another one. See You can also watch the sane\-devel mailing list at .IR http://www.sane\-project.org/mailing\-lists.html . .PP -More details about the hp backend can be found on its homepage +More details about the hp backend can be found on its homepage .IR http://www.kirchgessner.net/sane.html . .PP .SH "DEVICE NAMES" @@ -104,7 +104,7 @@ and .BR sane\-usb (5) on details of what constitutes a valid device name. .PP -Options specified in front of the first line that contains a device name +Options specified in front of the first line that contains a device name are defaults for all devices. Options specified below a line that contains a device name apply just to the most recently mentioned device. .PP @@ -203,7 +203,7 @@ levels reduce verbosity. .TP .B SANE_HOME_HP Only used for OS/2 and along with use of HP PhotoSmart PhotoScanner. -Must be set to the directory where the directory .sane is located. +Must be set to the directory where the directory .sane is located. Is used to save and read the calibration file. .TP .B SANE_HP_KEEPOPEN_SCSI @@ -237,7 +237,7 @@ and 24 bit color. .B Automatic Document Feeder (ADF) For use of the ADF with xscanimage(1), first place paper in the ADF and then change option scan source to 'ADF'. Press 'change document' -to load a sheet. Then press 'scan' to start a scan. +to load a sheet. Then press 'scan' to start a scan. Maybe it is sufficient to press 'scan' without 'change document' for repeated scans. The use of the preview window is not recommended when working with the ADF. diff --git a/doc/sane-hp3500.man b/doc/sane-hp3500.man index 2785b0e35..4b5ccb768 100644 --- a/doc/sane-hp3500.man +++ b/doc/sane-hp3500.man @@ -37,9 +37,9 @@ support dynamic loading). .B SANE_DEBUG_HP3500 If the library was compiled with debug support enabled, this environment variable controls the debug level for this backend. Higher -debug levels increase the verbosity of the output. +debug levels increase the verbosity of the output. -Example: +Example: export SANE_DEBUG_HP3500=4 .SH "SEE ALSO" diff --git a/doc/sane-hp3900.man b/doc/sane-hp3900.man index ab0a1006c..7a787e70c 100644 --- a/doc/sane-hp3900.man +++ b/doc/sane-hp3900.man @@ -26,7 +26,7 @@ BenQ 5550 RTS8823L-01E * .ft R .RE .PP -More details can be found on the hp3900 backend homepage +More details can be found on the hp3900 backend homepage .IR http://sourceforge.net/projects/hp3900\-series/ . .PP This is ALPHA software. Keep your hand at the scanner's plug and unplug it, if @@ -88,9 +88,9 @@ to "/tmp/config:" would result in directories "tmp/config", ".", and .B SANE_DEBUG_HP3900 If the library was compiled with debug support enabled, this environment variable controls the debug level for this backend. Higher -debug levels increase the verbosity of the output. +debug levels increase the verbosity of the output. -Example: +Example: export SANE_DEBUG_HP3900=4 .SH "SEE ALSO" diff --git a/doc/sane-hp4200.man b/doc/sane-hp4200.man index e392d85ed..794d2e807 100644 --- a/doc/sane-hp4200.man +++ b/doc/sane-hp4200.man @@ -16,11 +16,11 @@ ScanJet 4200 Cxi ScanJet 4200 Cse .RE .PP -More details can be found on the hp4200 backend homepage +More details can be found on the hp4200 backend homepage .IR http://hp4200\-backend.sourceforge.net/ . .PP This is BETA software. Keep your hand at the scanner's plug and unplug it, if -the head bumps at the end of the scan area. +the head bumps at the end of the scan area. .PP If you own a scanner other than the ones listed above that works with this backend, please let us know this by sending the scanner's exact model name and @@ -79,9 +79,9 @@ to "/tmp/config:" would result in directories "tmp/config", ".", and .B SANE_DEBUG_HP4200 If the library was compiled with debug support enabled, this environment variable controls the debug level for this backend. Higher -debug levels increase the verbosity of the output. +debug levels increase the verbosity of the output. -Example: +Example: export SANE_DEBUG_HP4200=4 .SH "SEE ALSO" diff --git a/doc/sane-hp5400.man b/doc/sane-hp5400.man index d789215a5..12c959c18 100644 --- a/doc/sane-hp5400.man +++ b/doc/sane-hp5400.man @@ -16,7 +16,7 @@ ScanJet 5470C ScanJet 5490C .RE .PP -More details can be found on the hp5400 backend homepage +More details can be found on the hp5400 backend homepage .IR http://hp5400backend.sourceforge.net/ . .PP This is ALPHA software. Keep your hand at the scanner's plug and unplug it, if @@ -79,9 +79,9 @@ to "/tmp/config:" would result in directories "tmp/config", ".", and .B SANE_DEBUG_HP5400 If the library was compiled with debug support enabled, this environment variable controls the debug level for this backend. Higher -debug levels increase the verbosity of the output. +debug levels increase the verbosity of the output. -Example: +Example: export SANE_DEBUG_HP5400=4 .SH "SEE ALSO" diff --git a/doc/sane-hp5590.man b/doc/sane-hp5590.man index 2ccfcc59a..aeb446693 100644 --- a/doc/sane-hp5590.man +++ b/doc/sane-hp5590.man @@ -57,7 +57,7 @@ Level 40 - HP5590 high-level commands Level 50 - HP5590 low-level (USB-in-USB) commands .P -Example: +Example: export SANE_DEBUG_HP5590=50 diff --git a/doc/sane-hs2p.man b/doc/sane-hs2p.man index b0df57dbb..9757eff0b 100644 --- a/doc/sane-hs2p.man +++ b/doc/sane-hs2p.man @@ -25,12 +25,12 @@ Where .I special is either the path-name for the special device that corresponds to a SCSI scanner. The program -.I sane\-find\-scanner +.I sane\-find\-scanner helps to find out the correct device. Under Linux, such a device name could be .I /dev/sg0 or .IR /dev/sga , -for example. See +for example. See .BR sane\-scsi (5) for details. @@ -39,7 +39,7 @@ The contents of the .I hs2p.conf file is a list of device names that correspond to SCSI scanners. Empty lines and lines starting with a hash mark (#) are -ignored. See +ignored. See .BR sane\-scsi (5) on details of what constitutes a valid device name. @@ -84,29 +84,29 @@ from the flatbed or ADF (either simplex or duplex) is supported. Lineart, halftone, 4-bit gray, and 8-bit gray are supported. Pre-set gamma tables and halftone patterns are supported, as well as brightness, threshold, contrast. Also supported is scan wait mode, binary and gray filtering, negative scanning, -and absolute or relative white setting. Printing with the optional endorser +and absolute or relative white setting. Printing with the optional endorser also is supported. .SH PLANNED FUNCTIONALITY -This scanner can scan from the ADF in continuous simplex mode. +This scanner can scan from the ADF in continuous simplex mode. Surprisingly, many scanners scan an entire document from the ADF into memory before ejecting the sheet. Thus if the document is too -long, the scanner cannot hold the entire image data in memory. -But if the scanner would send its image data when its memory got full, -and then read the next buffer's worth of data, continuous scanning -could be achieved. +long, the scanner cannot hold the entire image data in memory. +But if the scanner would send its image data when its memory got full, +and then read the next buffer's worth of data, continuous scanning +could be achieved. .SH MISSING FUNCTIONALITY The SCSI commands for uploading (2AH) or downloading (28H) -custom halftone patterns (02H) and gamma vectors (03H) should work, -but require implementing the SANE Option-Value code to allow the -user to create the tables to be uploaded to the scanner. No support -for Maintenance Data (80H) is planned as this functionality is more -suited to a stand-alone utility to be used by a technician when -replacing the lamp or ADF unit. Nor is support for reading or changing +custom halftone patterns (02H) and gamma vectors (03H) should work, +but require implementing the SANE Option-Value code to allow the +user to create the tables to be uploaded to the scanner. No support +for Maintenance Data (80H) is planned as this functionality is more +suited to a stand-alone utility to be used by a technician when +replacing the lamp or ADF unit. Nor is support for reading or changing IPU (93H) parameters and adjustments planned, since my IS450 lacks -such a unit. The 31-byte Auto Photo/Letter struct and 21-byte Dynamic -threshold struct are documented in the hs2p-scsi.h file should someone +such a unit. The 31-byte Auto Photo/Letter struct and 21-byte Dynamic +threshold struct are documented in the hs2p-scsi.h file should someone wish to use their IPU for image data processing. .SH "SEE ALSO" diff --git a/doc/sane-ibm.man b/doc/sane-ibm.man index 50138d74b..0b5013cbc 100644 --- a/doc/sane-ibm.man +++ b/doc/sane-ibm.man @@ -25,12 +25,12 @@ Where .I special is either the path-name for the special device that corresponds to a SCSI scanner. The program -.I sane\-find\-scanner +.I sane\-find\-scanner helps to find out the correct device. Under Linux, such a device name could be .I /dev/sg0 or .IR /dev/sga , -for example. See +for example. See .BR sane\-scsi (5) for details. @@ -39,7 +39,7 @@ The contents of the .I ibm.conf file is a list of device names that correspond to SCSI scanners. Empty lines and lines starting with a hash mark (#) are -ignored. See +ignored. See .BR sane\-scsi (5) on details of what constitutes a valid device name. @@ -75,7 +75,7 @@ to "/tmp/config:" would result in directories "tmp/config", ".", and .B SANE_DEBUG_IBM If the library was compiled with debug support enabled, this environment variable controls the debug level for this backend. Higher -debug levels increase the verbosity of the output. +debug levels increase the verbosity of the output. .SH "SEE ALSO" .BR sane (7), diff --git a/doc/sane-kodak.man b/doc/sane-kodak.man index 2566f3d2e..61ea88ecb 100644 --- a/doc/sane-kodak.man +++ b/doc/sane-kodak.man @@ -5,7 +5,7 @@ sane\-kodak \- SANE backend for big Kodak flatbed and ADF scanners .SH DESCRIPTION -The +The .B sane\-kodak library implements a SANE (Scanner Access Now Easy) backend which provides access to large Kodak flatbed and ADF scanners. @@ -13,44 +13,44 @@ provides access to large Kodak flatbed and ADF scanners. This document describes backend version 7, which shipped with SANE 1.0.21. .SH SUPPORTED HARDWARE -This version should support models which speak the Kodak SCSI and Firewire -protocols. The i1860 was used to develop the backend, but other models may -work with only minimal modifications. Please see the list at +This version should support models which speak the Kodak SCSI and Firewire +protocols. The i1860 was used to develop the backend, but other models may +work with only minimal modifications. Please see the list at http://www.sane\-project.org/sane\-supported\-devices.html for an updated list. -If you have a machine not on that list, or reported as 'untested': the best way -to determine level of support is to test the scanner directly, or to collect a -trace of the windows driver in action. Please contact the author for help or +If you have a machine not on that list, or reported as 'untested': the best way +to determine level of support is to test the scanner directly, or to collect a +trace of the windows driver in action. Please contact the author for help or with test results. .SH UNSUPPORTED HARDWARE -Most of the recent Kodak consumer or workgroup level machines are based on -other chipsets and are not supported by this backend. Some of these scanners +Most of the recent Kodak consumer or workgroup level machines are based on +other chipsets and are not supported by this backend. Some of these scanners may be supported by another backend. .SH OPTIONS Effort has been made to expose the basic hardware options, including: .PP -source s +source s .RS Selects the source for the scan. Options may include "Flatbed", "ADF Front", "ADF Back", "ADF Duplex". .RE .PP -mode m +mode m .RS Selects the mode for the scan. Options may include "Lineart", "Halftone", "Gray", and "Color". .RE .PP -resolution +resolution .RS Controls scan resolution. Available choices may be limited by mode. .RE .PP tl\-x, tl\-y, br\-x, br\-y .RS -Sets scan area upper left and lower right coordinates. These are renamed +Sets scan area upper left and lower right coordinates. These are renamed t, l, x, y by some frontends. .RE .PP @@ -61,14 +61,14 @@ coordinates when using ADF and to detect double feed errors. .RE .PP Other options will be available based on the capabilities of the scanner. -Use 'scanimage \-\-help' to get a list, but be aware that some options may -be settable only when another option has been set, and that advanced options +Use 'scanimage \-\-help' to get a list, but be aware that some options may +be settable only when another option has been set, and that advanced options may be hidden by some frontend programs. .PP .SH CONFIGURATION FILE The configuration file "kodak.conf" is used to tell the backend how to look for scanners, and provide options controlling the operation of the backend. -This file is read each time the frontend asks the backend for a list +This file is read each time the frontend asks the backend for a list of scanners, generally only when the frontend starts. If the configuration file is missing, the backend will use a set of compiled defaults, which are identical to the default configuration file shipped with SANE. @@ -77,8 +77,8 @@ Scanners can be specified in the configuration file in 2 ways: .PP "scsi KODAK" .RS -Requests backend to search all scsi busses in the system for a device -which reports itself to be a scanner made by 'KODAK'. +Requests backend to search all scsi busses in the system for a device +which reports itself to be a scanner made by 'KODAK'. .RE .PP "scsi /dev/sg0" (or other scsi device file) @@ -89,7 +89,7 @@ specify one. Probably should not be used with the other "scsi" line above. .RE .PP The only configuration option supported is "buffer\-size=xxx", allowing you -to set the number of bytes in the data buffer to something other than the +to set the number of bytes in the data buffer to something other than the compiled\-in default, 32768 (32K). Some users report that their scanner will "hang" mid\-page, or fail to transmit the image if the buffer is not large enough. @@ -124,7 +124,7 @@ enables debugging output to stderr. Valid values are: .RE .SH KNOWN ISSUES -Most hardware options are either not supported or not exposed for control by +Most hardware options are either not supported or not exposed for control by the user, including: multifeed detection, image compression, autocropping, endorser, iThresholding, multi\-stream, etc. .PP @@ -133,7 +133,7 @@ endorser, iThresholding, multi\-stream, etc. The various authors of the sane\-fujitsu backend provided useful code. .br Kodak provided access to hardware, documentation and personnel. - + .SH "SEE ALSO" sane(7), sane\-scsi(5) diff --git a/doc/sane-kodakaio.man b/doc/sane-kodakaio.man index 40310ed2d..664a41829 100644 --- a/doc/sane-kodakaio.man +++ b/doc/sane-kodakaio.man @@ -5,7 +5,7 @@ sane\-kodakaio \- SANE backend for Kodak aio printer / scanners .SH DESCRIPTION -The +The .B sane\-kodakaio library implements a SANE (Scanner Access Now Easy) backend which provides access to Kodak aio printer / scanners, like the ESP and Hero series. @@ -15,24 +15,24 @@ incorporation in sane-backends. .SH SUPPORTED HARDWARE This version should support models of the Kodak ESP and Hero series, and possibly some -Advent AiO scanners. The ESP 5250 and Hero 9.1 were used to develop the backend, +Advent AiO scanners. The ESP 5250 and Hero 9.1 were used to develop the backend, but other models may work. Please see the desc file. -If you have a model not on that list, or reported as 'untested': the best way +If you have a model not on that list, or reported as 'untested': the best way to determine level of support is to test the scanner directly. .SH CONFIGURATION FILE The configuration file "kodakaio.conf" is used to tell the backend how to look for scanners, and provide options controlling the operation of the backend. -This file is read each time the frontend asks the backend for a list +This file is read each time the frontend asks the backend for a list of scanners, generally only when the frontend starts. .SH ENVIRONMENT The backend uses a single environment variable, SANE_DEBUG_KODAKAIO, which -enables debugging output to stderr. +enables debugging output to stderr. .SH KNOWN ISSUES -Most hardware options are either not supported or not exposed for control by +Most hardware options are either not supported or not exposed for control by the user, including: multifeed detection, image compression etc. .PP diff --git a/doc/sane-kvs1025.man b/doc/sane-kvs1025.man index 23dcd509e..5cb9063c2 100644 --- a/doc/sane-kvs1025.man +++ b/doc/sane-kvs1025.man @@ -5,7 +5,7 @@ sane\-kvs1025 \- SANE backend for Panasonic KV-S102xC USB ADF scanners. .SH DESCRIPTION -The +The .B sane\-kvs1025 library implements a SANE (Scanner Access Now Easy) backend which provides access to the Panasonic KV-S1020C/1025C and KV-S1045C scanners. diff --git a/doc/sane-kvs20xx.man b/doc/sane-kvs20xx.man index 8cb8b9c9b..ad91642f3 100644 --- a/doc/sane-kvs20xx.man +++ b/doc/sane-kvs20xx.man @@ -5,7 +5,7 @@ sane\-kvs20xx \- SANE backend for Panasonic KV-S20xxC USB/SCSI ADF scanners. .SH DESCRIPTION -The +The .B sane\-kvs20xx library implements a SANE (Scanner Access Now Easy) backend which provides access to the Panasonic KV-S202xC and KV-S204xC scanners. diff --git a/doc/sane-kvs40xx.man b/doc/sane-kvs40xx.man index f1aecbcfc..2a2aa339b 100644 --- a/doc/sane-kvs40xx.man +++ b/doc/sane-kvs40xx.man @@ -5,7 +5,7 @@ sane\-kvs40xx \- SANE backend for Panasonic KV-S40xxC USB/SCSI ADF scanners. .SH DESCRIPTION -The +The .B sane\-kvs40xx library implements a SANE (Scanner Access Now Easy) backend which provides access to the Panasonic KV-S40xxC and KV-S70xxC scanners. diff --git a/doc/sane-leo.man b/doc/sane-leo.man index a34640343..f0d9266ce 100644 --- a/doc/sane-leo.man +++ b/doc/sane-leo.man @@ -32,7 +32,7 @@ elements in xscanimage or xsane. If you have any strange behavior, please report to the backend maintainer or to the SANE mailing list. -Valid command line options and their syntax can be listed by using +Valid command line options and their syntax can be listed by using .RS scanimage \-\-help \-d leo .RE @@ -42,7 +42,7 @@ scanimage \-\-help \-d leo .TP .B \-\-mode -selects the basic mode of operation of the scanner valid choices are +selects the basic mode of operation of the scanner valid choices are .I Black & White , .I Grayscale @@ -62,7 +62,7 @@ between 1 and 300, in increments of 1. .B Geometry options .TP -.B \-l \-t \-x \-y +.B \-l \-t \-x \-y control the scan area: \-l sets the top left x coordinate, \-t the top left y coordinate, \-x selects the width and \-y the height of the scan area. All parameters are specified in millimeters by default. @@ -76,24 +76,24 @@ area. All parameters are specified in millimeters by default. (grayscale and color mode only) allows the user to specify a gamma table (see the next 3 parameters). -.TP -.B \-\-red\-gamma\-table +.TP +.B \-\-red\-gamma\-table (color mode only) can be used to download a user defined gamma table for the red channel. The table must be 256 bytes long. -.TP -.B \-\-green\-gamma\-table +.TP +.B \-\-green\-gamma\-table (color mode only) can be used to download a user defined gamma table for the green channel. The table must be 256 bytes long. .TP -.B \-\-blue\-gamma\-table +.B \-\-blue\-gamma\-table (color mode only) can be used to download a user defined gamma table for the blue channel. The table must be 256 bytes long. .TP .B \-\-halftone -(Black & White only) select the halftone mask to use. Possible values are +(Black & White only) select the halftone mask to use. Possible values are .I Diamond , .I 8x8 Coarse Fatting @@ -104,7 +104,7 @@ for the blue channel. The table must be 256 bytes long. and .I 8x8 Vertical Line -.TP +.TP .B \-\-preview requests a preview scan. The resolution used for that scan is 28 dpi and the scan area is the maximum allowed. The scan mode is user diff --git a/doc/sane-lexmark.man b/doc/sane-lexmark.man index 30bba879b..06e3359f0 100644 --- a/doc/sane-lexmark.man +++ b/doc/sane-lexmark.man @@ -9,13 +9,13 @@ library implements a SANE (Scanner Access Now Easy) backend that provides access to the scanner part of Lexmark X1100/X1200 AIOs. This backend should be considered .B beta-quality -software! -.PP +software! +.PP The scanners that should work with this backend are: -.PP +.PP .RS .ft CR -.nf +.nf Vendor Model status \-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\- \-\-\-\-\-\-\-\-\-\-\- Lexmark X74 good @@ -28,7 +28,7 @@ The scanners that should work with this backend are: Lexmark X12xx good in USB1.1, not fully tested in USB2.0 Dell A920 good -.fi +.fi .ft R .RE @@ -36,58 +36,58 @@ The options the backend supports can either be selected through command line options to programs like scanimage or through GUI elements in xscanimage or xsane. -.br +.br If you have any strange behavior, please report to the backend maintainer or to the SANE mailing list. -Valid command line options and their syntax can be listed by using +Valid command line options and their syntax can be listed by using .RS scanimage \-\-help \-d lexmark:usb: .RE -.TP +.TP .B Scan Mode Options -.TP +.TP .B \-\-mode -selects the basic mode of operation of the scanner valid choices are +selects the basic mode of operation of the scanner valid choices are .IR Color , .I Gray and .I Lineart -The default mode is Color. The Lineart mode is black and white only (1 bit). +The default mode is Color. The Lineart mode is black and white only (1 bit). Grayscale will produce 256 levels of gray (8 bits). Color mode allows for over 16 million different colors produced from 24 bits of color information. -.TP +.TP .B \-\-resolution -selects the resolution for a scan. The horizontal and vertical resolutions are set +selects the resolution for a scan. The horizontal and vertical resolutions are set by the value of this option. The scanner is capable of the following resolutions for the specified option value: -.PP +.PP .RS .ft CR -.nf - Value Hor. Resolution Vert. Resolution +.nf + Value Hor. Resolution Vert. Resolution \-\-\-\-\- \-\-\-\-\-\-\-\-\-\-\-\-\-\-\- \-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\- 75 75dpi 75dpi - 150 150dpi 150dpi - 300 300dpi 300dpi - 600 600dpi 600dpi + 150 150dpi 150dpi + 300 300dpi 300dpi + 600 600dpi 600dpi 1200 600dpi 1200dpi (only for X11xx models with 'B2' sensor) -.fi +.fi .ft R .RE -.TP +.TP .B \-\-preview requests a preview scan. The resolution used for that scan is 75 dpi -and the scan area and the scan mode are as specified through their options, +and the scan area and the scan mode are as specified through their options, or the default if not specified. The default value for preview mode is "no". -.TP +.TP .B \-\-threshold selects the minimum-brightness to get a white point. The threshold is only used with Lineart mode scans. -It is specified as a percentage in the range 0..100% (in steps of 1). +It is specified as a percentage in the range 0..100% (in steps of 1). The default value of the threshold option is 50. @@ -96,17 +96,17 @@ The configuration file @CONFIGDIR@/lexmark.conf contains only the usb device id .SH "FILES" -.TP +.TP .I @LIBDIR@/libsane\-lexmark.a The static library implementing this backend. -.TP +.TP .I @LIBDIR@/libsane\-lexmark.so The shared library implementing this backend (present on systems that support dynamic loading). .SH "ENVIRONMENT" -.TP +.TP .B SANE_DEBUG_LEXMARK .B SANE_DEBUG_LEXMARK_LOW If the library was compiled with debug support enabled, this @@ -125,7 +125,7 @@ The data compression isn't supported for the X1200 series on USB 1.1, leading to slow scans. .SH "BUGS" -.br +.br No bugs currently known. @@ -135,16 +135,16 @@ sane\-scsi(5), scanimage(1), xscanimage(1), xsane(1), sane(7) .SH "AUTHOR" -.TP +.TP The backend was originally written by Fred Odendaal. .I http://ca.geocities.com/freshshelf@rogers.com/ -.TP +.TP The new version is currently developed by St\['e]phane Voltz. .I http://stef.dev.free.fr/sane/lexmark .TP X74 support was written by Torsten Houwaart () .SH "CREDITS" -.TP +.TP Many thanks go to: Julien Furgerot who lend me a Dell A920. Robert Price, Dani Ele and Dalai Felinto for the time they spent recording diff --git a/doc/sane-ma1509.man b/doc/sane-ma1509.man index bdd20f73e..2677fcd20 100644 --- a/doc/sane-ma1509.man +++ b/doc/sane-ma1509.man @@ -13,7 +13,7 @@ also work. This backend is ALPHA software. Be careful and remove the power plug immediately if your hear unusual noises. .PP -More details can be found on the ma1509 backend homepage +More details can be found on the ma1509 backend homepage .IR http://www.meier\-geinitz.de/sane/ma1509\-backend/ . .PP Other Mustek USB scanners are supported by the gt68xx, mustek_usb and the @@ -25,7 +25,7 @@ and for details. .PP This backend can only work with scanners that are already detected by the -operating system. See +operating system. See .BR sane\-usb (5) for details. .PP @@ -59,20 +59,20 @@ file is a list of options and device names that correspond to Mustek BearPaw 1200F scanners. Empty lines and lines starting with a hash mark (#) are ignored. .PP -Instead of using the device name, the scanner can be autodetected by +Instead of using the device name, the scanner can be autodetected by .B "usb vendor_id product_id" statements which are already included into .IR ma1509.conf . This is only supported with Linux 2.4.8 and higher and all systems that support libsub. "vendor_id" and "product_id" are hexadecimal numbers that identify the scanner. If this doesn't work, a device name must be placed in -.I ma1509.conf +.I ma1509.conf as described above. .PP To set the time the lamp needs for warm-up, use .B option .B warmup-time -in +in .IR ma1509.conf . The time is given in seconds after the option. The default is 30 seconds. .SH FILES @@ -107,7 +107,7 @@ to "/tmp/config:" would result in directories "tmp/config", ".", and .B SANE_DEBUG_MA1509 If the library was compiled with debug support enabled, this environment variable controls the debug level for this backend. Higher -debug levels increase the verbosity of the output. +debug levels increase the verbosity of the output. .SH "SEE ALSO" .BR sane (7), diff --git a/doc/sane-magicolor.man b/doc/sane-magicolor.man index 1e6c0a5e3..17ef38797 100644 --- a/doc/sane-magicolor.man +++ b/doc/sane-magicolor.man @@ -10,21 +10,21 @@ backend supports KONICA MINOLTA magicolor scanners connected via USB or LAN. Cur The following scanner should work with this backend: Device Details -.br +.br \-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\- -.br +.br Vendor: KONICA MINOLTA -.br +.br Model: magicolor 1690MF .SH "CONFIGURATION" -.PP +.PP This section describes the backend's configuration file entries. The file is located at: -.IP +.IP .I @CONFIGDIR@/magicolor.conf -.PP +.PP For a proper setup, at least one of the following entries are needed: -.IP +.IP .I net autodiscovery .br .I net [IP ADDRESS] [DEVICE-ID] @@ -34,22 +34,22 @@ For a proper setup, at least one of the following entries are needed: .I usb [VENDOR-ID] [DEVICE-ID] .SH "FILES" -.TP +.TP .I @CONFIGDIR@/magicolor.conf The backend configuration file -.TP +.TP .I @LIBDIR@/libsane\-magicolor.a The static library implementing this backend. -.TP +.TP .I @LIBDIR@/libsane\-magicolor.so The shared library implementing this backend (present on systems that support dynamic loading). .SH "ENVIRONMENT" -.TP +.TP .B SANE_CONFIG_DIR This environment variable specifies the list of directories that may contain the configuration file. Under UNIX, the directories are separated by a colon (`:'), under OS/2, they are separated by a semi\-colon (`;'). If this variable is not set, the configuration file is searched in two default directories: first, the current working directory (".") and then in @CONFIGDIR@. If the value of the environment variable ends with the directory separator character, then the default directories are searched after the explicitly specified directories. For example, setting .B SANE_CONFIG_DIR to "/tmp/config:" would result in directories "/tmp/config", ".", and "@CONFIGDIR@" being searched (in this order). -.TP +.TP .B SANE_DEBUG_MAGICOLOR If the library was compiled with debug support enabled, this environment variable controls the debug level for this backend. Higher debug levels increase the verbosity of the output. @@ -59,14 +59,14 @@ To obtain debug messages from the backend, set this environment variable before Example: SANE_DEBUG_MAGICOLOR=65 xscanimage .SH "KNOWN BUGS AND RESTRICTIONS" -.PP +.PP Large color scans may sometimes timeout due to unknown reasons (the scanner simply stops returning data) -.PP +.PP Cancelling large scans may lock up the scanner. .SH "SEE ALSO" .BR sane (7), -.br +.br .I http://wiki.kainhofer.com/hardware/magicolor_scan .SH "AUTHOR" -.PP +.PP Reinhold Kainhofer diff --git a/doc/sane-matsushita.man b/doc/sane-matsushita.man index 578421aa7..5bbf7341b 100644 --- a/doc/sane-matsushita.man +++ b/doc/sane-matsushita.man @@ -31,7 +31,7 @@ backend: Other Panasonic high speed scanners may or may not work with that backend. -Valid command line options and their syntax can be listed by using +Valid command line options and their syntax can be listed by using .RS scanimage \-\-help \-d matsushita .RE @@ -57,12 +57,12 @@ selects the number of pages to scan (one or until the tray is empty). .TP .B \-\-paper\-size A4|...|Legal|Letter [A4] -options selects the area to scan. It adjust the +options selects the area to scan. It adjust the .B \-l \-t \-x \-y options accordingly. It does not need to be the real size of the paper. .TP -.B \-l \-t \-x \-y +.B \-l \-t \-x \-y control the scan area: \-l sets the top left x coordinate, \-t the top left y coordinate, \-x selects the width and \-y the height of the scan area. All parameters are specified in millimeters. It is possible to use @@ -87,7 +87,7 @@ automatically sets brightness, contrast, white level, gamma, noise reduction and option sets the tonal gradation for the halftone mode. Pattern downloading is not implemented by the backend. .TP .B \-\-autoseparation -provides automatic separation of text and images. +provides automatic separation of text and images. .TP .B \-\-white\-level option indicate the source of the white base. diff --git a/doc/sane-microtek.man b/doc/sane-microtek.man index 84047dca4..200f5a066 100644 --- a/doc/sane-microtek.man +++ b/doc/sane-microtek.man @@ -46,7 +46,7 @@ port models may work (under Linux), if they use a parport->scsi chip, and if you can find a scsi->parport driver. This is known to be the case for the Color PageWiz. .PP -The driver does +The driver does .B not support the newest Microtek scanners, such as the V330 and V660, which use a new and very different SCSI-II command set. For those, try the alternate @@ -144,7 +144,7 @@ to "/tmp/config:" would result in directories "tmp/config", ".", and .TP .B SANE_DEBUG_MICROTEK If the library was compiled with debugging support enabled, this -environment variable controls the debug level for this backend. +environment variable controls the debug level for this backend. A value of 128 requests maximally copious debug output; smaller levels reduce verbosity. @@ -169,7 +169,7 @@ i.e. don't complain about these --- but if brightness and/or contrast .B do work for you, please tell me. .PP -If your scanner locks up, try setting the +If your scanner locks up, try setting the .I norealcal or .I noprecal @@ -188,7 +188,7 @@ setenv SANE_DEBUG_MICROTEK 128 .RE .PP More general comments, suggestions, and inquiries about frontends -or SANE should go to +or SANE should go to .BR sane\-devel@lists.alioth.debian.org , the SANE Developers mailing list. Have a look at http://www.sane\-project.org/mailing\-lists.html concerning subscription to sane\-devel. diff --git a/doc/sane-mustek.man b/doc/sane-mustek.man index 536466fbe..e236b5557 100644 --- a/doc/sane-mustek.man +++ b/doc/sane-mustek.man @@ -15,7 +15,7 @@ Paragon MFS-6000CX .br Paragon MFS-12000CX .br -Paragon MFC-600S, 600 II CD, ScanMagic 600 II SP +Paragon MFC-600S, 600 II CD, ScanMagic 600 II SP .br Paragon MFC-800S, 800 II SP .br @@ -37,7 +37,7 @@ Paragon 1200 SP Pro .br Paragon 1200 A3 Pro .br -Paragon 600 II EP +Paragon 600 II EP .br Paragon 600 II N .br @@ -53,7 +53,7 @@ Primax Compact 4800 SCSI .br .RE .PP -More details can be found on the Mustek SCSI backend homepage +More details can be found on the Mustek SCSI backend homepage .IR http://www.meier\-geinitz.de/sane/mustek\-backend/ . .PP Don't mix up MFS (Paragon), Pro and ScanExpress models! They're @@ -112,17 +112,17 @@ Where .I special is either the path-name for the special device that corresponds to a SCSI scanner or the port number at which the parallel port scanners can -be found (see section +be found (see section .B "PARALLEL PORT SCANNERS" below). For SCSI scanners, the special device name must be a generic SCSI device or a symlink to such a device. The program -.I sane\-find\-scanner +.I sane\-find\-scanner helps to find out the correct device. Under Linux, such a device name could be .I /dev/sg0 or .IR /dev/sg3 , -for example. See +for example. See .BR sane\-scsi (5) for details. .SH CONFIGURATION @@ -130,7 +130,7 @@ The contents of the .I mustek.conf file is a list of options and device names that correspond to Mustek scanners. Empty lines and lines starting with a hash mark (#) are -ignored. See +ignored. See .BR sane\-scsi (5) on details of what constitutes a valid device name. .PP @@ -279,7 +279,7 @@ for driver- and platform-specific information. The ScanExpress models have sometimes trouble with high resolution color mode. If you encounter sporadic corrupted images (parts duplicated or shifted horizontally) kill all other applications before scanning -and (if sufficient memory is available) disable swapping. +and (if sufficient memory is available) disable swapping. .PP Details on how to get the Mustek SCSI adapters and other cards running can be found at @@ -306,12 +306,12 @@ only one number on a single line. Example: .RE .PP Note that for these scanners usually root privileges are required to access the -I/O ports. Thus, either make frontends such as +I/O ports. Thus, either make frontends such as .BR scanimage (1) -and +and .BR xscanimage (1) setuid root (generally not recommended for safety reasons) or, alternatively, -access this backend through the network daemon +access this backend through the network daemon .BR saned (8). .PP If the Mustek backend blocks while sending the inquiry command to the scanner, @@ -360,7 +360,7 @@ to "/tmp/config:" would result in directories "tmp/config", ".", and .B SANE_DEBUG_MUSTEK If the library was compiled with debug support enabled, this environment variable controls the debug level for this backend. Higher -debug levels increase the verbosity of the output. +debug levels increase the verbosity of the output. .ft CR .nf @@ -374,15 +374,15 @@ Value Description .fi .ft R -Example: +Example: export SANE_DEBUG_MUSTEK=4 .SH "SEE ALSO" .BR sane (7), .BR sane\-find\-scanner (1), .BR sane\-scsi (5), -.BR sane\-mustek_usb (5), -.BR sane\-gt68xx (5), +.BR sane\-mustek_usb (5), +.BR sane\-gt68xx (5), .BR sane\-plustek (5), .BR sane\-mustek_pp (5) .br @@ -396,7 +396,7 @@ Henning Meier-Geinitz, James Perry (600 II EP). .SH BUGS Scanning with the SCSI adapters supplied by Mustek is very slow at -high resolutions and wide scan areas. +high resolutions and wide scan areas. .PP Some scanners (e.g. Paragon 1200 A3 + Pro, SE A3) need more testing. .PP diff --git a/doc/sane-mustek_pp.man b/doc/sane-mustek_pp.man index 253759d2e..2e61106e1 100644 --- a/doc/sane-mustek_pp.man +++ b/doc/sane-mustek_pp.man @@ -18,10 +18,10 @@ The library implements a SANE (Scanner Access Now Easy) backend that provides access to Mustek parallel port flatbed scanners and OEM versions. -There are 2 classes of Mustek parallel port scanners: regular +There are 2 classes of Mustek parallel port scanners: regular .B CCD -(cold cathode device) scanners and -.B CIS +(cold cathode device) scanners and +.B CIS (contact image sensor) scanners. .P The current version of this backend supports both CCD type scanners and @@ -29,7 +29,7 @@ CIS type scanners. .P The following scanners might work with this backend: -.SS "CCD scanners" +.SS "CCD scanners" .EX Model: ASIC ID: CCD Type: works: @@ -56,25 +56,25 @@ Mustek 1200 CP+ 1015 yes .EE .EX -OEM versions Original works +OEM versions Original works -------------------------------------------------- Medion/LifeTec/Tevion MD/LT 9350/9351 1200 CP yes MD/LT 9850/9851 1200 CP maybe (**) MD/LT 9858 1200 CP probably MD/LT 9890/9891 1200 CP yes -Targa +Targa Funline TS12EP 1200 CP yes Funline TS6EP 600 CP yes Trust Easy Connect 9600+ 600 CP yes -Cybercom +Cybercom 9352 1200 CP yes (***) .EE -.HP +.HP (*) Calibration problems existed with earlier version of this driver. They seem to be solved now. -.HP +.HP (**) Problems have been reported in the past for the MD/LT9850 type (striped scans, head moving in wrong direction at some resolutions). It is not known whether @@ -82,7 +82,7 @@ the current version of the driver still has these problems. .PP .B IF YOU HEAR LOUD CLICKING NOISES, IMMEDIATELY UNPLUG THE SCANNER ! (This holds for any type of scanner). -.HP +.HP (***) Possibly, the engine_delay parameter has to be set to 1 ms for accurate engine movements. .PP @@ -90,15 +90,15 @@ Please note that this backend is still under construction. Certain models are currently not supported and some may never be because the communication protocol is still unknown (eg., SE 12000 P). .PP -Some scanners work faster when +Some scanners work faster when .B EPP/ECP is enabled in the BIOS. EPP mode however may lead to hard-locks on some Linux systems. If that is the case for you, you can either disable ECP/EPP in your BIOS or disable it in the backend itself (see GLOBAL OPTIONS). .PP Note that the backend needs to run as root or has to have appropriate access -rights to /dev/parport* if libieee1284 support is compiled in. To allow user -access to the scanner run the backend through the network interface (See +rights to /dev/parport* if libieee1284 support is compiled in. To allow user +access to the scanner run the backend through the network interface (See saned(8) and sane\-net(5)). Note also that the backend .I does not support @@ -112,7 +112,7 @@ to enable the backend explicitly in your dll.conf, just remove the hash mark in the line "mustek_pp". .SH "DEVICE DEFINITION" -This backend allows multiple devices being defined and configured via the +This backend allows multiple devices being defined and configured via the .B mustek_pp.conf file (even simultaneously, provided that they are connected to different parallel ports). Please make sure to edit this file @@ -134,23 +134,23 @@ for instance "LifeTec 9350". .B is the name of the parallel port to which the device is connected. In case libieee1284 is used for communication with the port -.I (default -.IR setup) , -valid port names are -.BR parport0 , -.BR parport1 , +.I (default +.IR setup) , +valid port names are +.BR parport0 , +.BR parport1 , and .BR parport2 . .PP In case the backend is configured for raw IO -.I (old +.I (old .IR setup) , port addresses have to be used instead of port names: .BR 0x378 , -.BR 0x278 , +.BR 0x278 , or .BR 0x3BC . -The mapping of parallel ports (lp0, lp1, and lp2) to these addresses +The mapping of parallel ports (lp0, lp1, and lp2) to these addresses can be different for different Linux kernel versions. For instance, if you are using a Kernel 2.2.x or better and you have only one parallel port, this port is named lp0 regardless of the base address. However, @@ -159,7 +159,7 @@ port your scanner is connected to, have a look at your /etc/conf.modules, /etc/modules.conf and/or /proc/ioports. .PP If you are unsure which port to use, you can use the magic value -.BR * +.BR * to probe for your scanner. .PP .HP @@ -169,7 +169,7 @@ is the driver to use for this device. Currently available drivers are: .BR cis600 " : for 600 CP, 96 CP & OEM versions" .br .BR cis1200 " : for 1200 CP & OEM versions" -.br +.br .BR cis1200+ " : for 1200 CP+ & OEM versions" .br .BR ccd300 " : for 600 IIIE P & OEM version" @@ -187,12 +187,12 @@ cover only half of the width of the scan area (also not dangerous). .PP If unsure about the exact model of your OEM version, check the optical resolution in the manual or on the box: the 600CP has a maximum optical -resolution of 300x600 DPI, whereas the 1200CP and 1200CP+ have a maximum -optical resolution of 600x1200 DPI. +resolution of 300x600 DPI, whereas the 1200CP and 1200CP+ have a maximum +optical resolution of 600x1200 DPI. .PP Examples: .PP -.RS +.RS scanner "LifeTec 9350" 0x378 cis1200 .PP scanner Mustek_600CP 0x378 cis600 @@ -201,7 +201,7 @@ scanner Mustek_600IIIEP * ccd300 .RE If in doubt which port you have to use, or whether your scanner is -detected at all, you can use +detected at all, you can use .B sane\-find\-scanner \-p to probe all configured ports. @@ -209,7 +209,7 @@ to probe all configured ports. .PP The contents of the .B mustek_pp.conf -file is a list of device definitions and device options that correspond to +file is a list of device definitions and device options that correspond to Mustek scanners. Empty lines and lines starting with a hash mark (#) are ignored. Options have the following format: .PP @@ -220,19 +220,19 @@ ignored. Options have the following format: Depending on the nature of the option, a value may or may not be present. Options always apply to the scanner definition that precedes them. There are no global options. Options are also driver-specific: not all drivers -support all possible options. +support all possible options. .SS Common options .TP .B bw Black/white discrimination value to be used during lineart scanning. Pixel values below this value are assumed to be black, values above are -assumed to be white. +assumed to be white. .br Default value: 127 -.br +.br Minimum: 0 -.br +.br Maximum: 255 .sp Example: option bw 150 @@ -240,7 +240,7 @@ Example: option bw 150 .SS CIS driver options .TP .B top_adjust -Vertical adjustment of the origin, expressed in millimeter (floating point). +Vertical adjustment of the origin, expressed in millimeter (floating point). This option can be used to calibrate the position of the origin, within certain limits. Note that CIS scanners are probably temperature sensitive, and that a certain inaccuracy may be hard to avoid. Differences in offset between @@ -261,7 +261,7 @@ scan does not start at the origin, the driver will try to move the scanhead to the start of the scan area at the fastest possible speed. On some models, this may not work, resulting in large inaccuracies (up to centimeters). By setting this option, the driver is forced to use normal speed during -skipping, which can circumvent the accuracy problems. Currently, there are +skipping, which can circumvent the accuracy problems. Currently, there are no models for which these inaccuracy problems are known to occur. .sp By default, fast skipping is used. @@ -454,12 +454,12 @@ For additional information on the CIS driver, see .SH AUTHORS .nf -Jochen Eisinger +Jochen Eisinger Eddy De Greef .fi .SH BUGS -Too many... please send bug reports to +Too many... please send bug reports to .I sane\-devel@lists.alioth.debian.org (note that you have to subscribe first to the list before you can send emails... see http://www.sane\-project.org/mailing\-lists.html) diff --git a/doc/sane-mustek_usb.man b/doc/sane-mustek_usb.man index a934e8a21..a70ad5e43 100644 --- a/doc/sane-mustek_usb.man +++ b/doc/sane-mustek_usb.man @@ -23,11 +23,11 @@ Trust Compact Scan USB 19200 .br .RE .PP -More details can be found on the Mustek USB backend homepage +More details can be found on the Mustek USB backend homepage .IR http://www.meier\-geinitz.de/sane/mustek_usb\-backend/ . .PP The Mustek BearPaw 1200 and 2400 scanners are supported by the plustek -backend. See +backend. See .BR sane\-plustek (5) for details. The Mustek BearPaw 1200F is supported by the MA-1509 backend. See .BR sane\-ma1509 (5) @@ -36,7 +36,7 @@ see .BR sane\-gt68xx (5). .PP This backend can only work with scanners that are already detected by the -operating system. See +operating system. See .BR sane\-usb (5) for details. .PP @@ -70,7 +70,7 @@ The contents of the .I mustek_usb.conf file is a list of options and device names that correspond to Mustek USB scanners. Empty lines and lines starting with a hash mark (#) are -ignored. If a device name is placed in +ignored. If a device name is placed in .IR mustek_usb.conf , it must be followed by a line containing the keyword .B option @@ -81,7 +81,7 @@ and an option specifying the scanner type. The following options can be used: .BR 1200ub . For the Trust Compact Scan USB 19200 use `option 1200ub'. .PP -Instead of using the device name, the scanner can be autodetected by +Instead of using the device name, the scanner can be autodetected by .B "usb vendor_id product_id" statements which are already included into .IR mustek_usb.conf . @@ -89,7 +89,7 @@ This is only supported with Linux 2.4.8 and higher and all systems that support libsub. "vendor_id" and "product_id" are hexadecimal numbers that identify the scanner. If this doesn't work, a device name and the option specifying the scanner type must be placed in -.I mustek_usb.conf +.I mustek_usb.conf as described above. .PP The global @@ -114,7 +114,7 @@ option 600cu The first line is ignored. The second line sets the buffer size to a maximum of 1024 bytes. The third line tries to autodetect a scanner with vendor id 0x055f and product id 0x0001 (Mustek 1200 CU). The fourth line tells the backend to -attach to +attach to .I /dev/usb/scanner0 and the fifth line specifies that .I /dev/usb/scanner0 @@ -151,7 +151,7 @@ to "/tmp/config:" would result in directories "tmp/config", ".", and .B SANE_DEBUG_MUSTEK_USB If the library was compiled with debug support enabled, this environment variable controls the debug level for this backend. Higher -debug levels increase the verbosity of the output. +debug levels increase the verbosity of the output. .ft CR .nf @@ -167,7 +167,7 @@ Value Description .fi .ft R -Example: +Example: export SANE_DEBUG_MUSTEK_USB=4 .SH "SEE ALSO" diff --git a/doc/sane-mustek_usb2.man b/doc/sane-mustek_usb2.man index b134afac7..dab26dc3b 100644 --- a/doc/sane-mustek_usb2.man +++ b/doc/sane-mustek_usb2.man @@ -9,7 +9,7 @@ library implements a SANE (Scanner Access Now Easy) backend that provides access to USB flatbed scanners based on the Service & Quality SQ113 chipset. At the moment, only the Mustek BearPaw 2448 TA Pro is supported. It's planned to add support for other scanners that are based on the SQ113 and maybe SQ11 chip. For -more details, see the mustek_usb2 backend homepage: +more details, see the mustek_usb2 backend homepage: .IR http://www.meier\-geinitz.de/sane/mustek_usb2\-backend/ . .PP This is BETA software. Especially if you test new or untested scanners, keep @@ -44,9 +44,9 @@ support dynamic loading). .B SANE_DEBUG_MUSTEK_USB2 If the library was compiled with debug support enabled, this environment variable controls the debug level for this backend. Higher debug levels -increase the verbosity of the output. +increase the verbosity of the output. -Example: +Example: export SANE_DEBUG_MUSTEK_USB2=4 .SH "SEE ALSO" diff --git a/doc/sane-nec.man b/doc/sane-nec.man index 0fd895e8c..e36ebe9d9 100644 --- a/doc/sane-nec.man +++ b/doc/sane-nec.man @@ -9,7 +9,7 @@ library implements a SANE (Scanner Access Now Easy) backend that provides access to NEC SCSI scanners. This backend should be considered .B alpha-quality -software! In the current state it is known to work with PC-IN500/4C +software! In the current state it is known to work with PC-IN500/4C scanners. Another MultiReader scanner series is not supported. PC-IN 500/4C and MultiReader scanner are only sold in Japan.(except Multi Reader PetiScan.) diff --git a/doc/sane-p5.man b/doc/sane-p5.man index 860a01941..66ef34f89 100644 --- a/doc/sane-p5.man +++ b/doc/sane-p5.man @@ -7,28 +7,28 @@ The .B sane\-p5 library implements a SANE (Scanner Access Now Easy) backend that provides access to the Primax PagePartner parallel port sheet fed scanner. -.PP +.PP This backend handles 100, 150, 200, 300 and 600 dpi scan resolutions, in color and gray modes. The 600 dpi is actually 300x600 with lines enlarged to match the vertical resolution. -.PP +.PP .B EPP/ECP MODES ONLY -The current version of the backend uses only EPP or ECP mode to communicate -with the scanner. It is -recommended that you set your parallel port to EPP in BIOS with the current +The current version of the backend uses only EPP or ECP mode to communicate +with the scanner. It is +recommended that you set your parallel port to EPP in BIOS with the current version of this backend. ECPEPP will only work if you use a 2.4 or 2.6 kernel with ppdev character device support. -.PP +.PP .SH "DEVICE NAMES" This backend expects device names of the form: -.PP +.PP .RS .I port value .RE -.PP +.PP Where -\fBvalue\fR is : +\fBvalue\fR is : .RS .TP @@ -40,43 +40,43 @@ them for scanner uses linux ppdev device, depending on the number of available parallel port, you have to use /dev/parport1, /dev/parport2, ... -.PP +.PP .RE You can rename any device using the -.PP +.PP .RS .br .I option name my_name .RE -.PP -option. This option apply to the last port option. +.PP +option. This option apply to the last port option. .SH "CONFIGURATION" Please make sure to edit dll.conf .B before you use the backend, since this backend isn't enabled by default. -.PP +.PP -.PP +.PP .SH "FILES" -.TP +.TP .I @CONFIGDIR@/p5.conf The backend configuration file (see also description of .B SANE_CONFIG_DIR below). -.TP +.TP .I @LIBDIR@/libsane\-p5.a The static library implementing this backend. -.TP +.TP .I @LIBDIR@/libsane\-p5.so The shared library implementing this backend (present on systems that support dynamic loading). .SH "ENVIRONMENT" -.TP +.TP .B SANE_CONFIG_DIR This environment variable specifies the list of directories that may contain the configuration file. Under UNIX, the directories are @@ -90,14 +90,14 @@ directories. For example, setting .B SANE_CONFIG_DIR to "/tmp/config:" would result in directories "tmp/config", ".", and "@CONFIGDIR@" being searched (in this order). -.TP +.TP .B SANE_DEBUG_P5 If the library was compiled with debug support enabled, this environment variable controls the debug level for this backend. E.g., a value of 255 requests all debug output to be printed. Smaller levels reduce verbosity. -.PP +.PP .RS .ft CR .nf @@ -108,23 +108,23 @@ level debug output 2 warnings & minor errors 4 information messages 8 start/stop of functions - 16 tracing messages + 16 tracing messages 32 I/O functions 64 I/O functions with traces 128 scanned/calibration data .fi .ft R .RE -.PP -.TP +.PP +.TP -.PP +.PP .RS .ft CR .nf -.PP - -.PP +.PP + +.PP .SH "SEE ALSO" sane(7), sane\-net(5), saned(8) @@ -138,23 +138,23 @@ by S\['e]bastien Lange. .SH "BUG REPORTS" If something doesn't work mail sane-devel@lists.alioth.debian.org or use the bug tracker at https://alioth.debian.org/tracker/?atid=410366&group_id=30186 . -Please give as much information as you can. +Please give as much information as you can. -.TP +.TP .I SANE version run "scanimage \-V" to determine this -.TP +.TP .I the backend version and your scanner hardware run "SANE_DEBUG_P5=255 scanimage \-L 2>log" as root. If you don't get any output from the p5 backend, make sure a line "p5" is included into your @CONFIGDIR@/dll.conf. If your scanner isn't detected, make sure you've defined the right port address, or the -correct device +correct device in your p5.conf. -.TP +.TP .I the name of your scanner/vendor also a worthy information. Please also include the optical resolution and lamp type of your scanner, both can be found in the manual of your scanner. -.TP +.TP .I any further comments if you have comments about the documentation (what could be done better), or you think I should know something, please include it. diff --git a/doc/sane-pixma.man b/doc/sane-pixma.man index 1058e92fd..058c71abb 100644 --- a/doc/sane-pixma.man +++ b/doc/sane-pixma.man @@ -8,8 +8,8 @@ The library implements a SANE (Scanner Access Now Easy) backend that provides access to Canon PIXMA / i-SENSYS / imageCLASS / imageRUNNER multi-function devices (All-in-one printers) and the Canon CanoScan Flatbed/TPU scanners. -The backend implements both the USB interface and network interface -(using Canon's BJNP and MFNP protocols). The network interface supports scanners +The backend implements both the USB interface and network interface +(using Canon's BJNP and MFNP protocols). The network interface supports scanners over IPv4 as well as IPv6 (MFNP over IPv6 is untested). .PP Currently, the following models work with this backend: @@ -77,9 +77,9 @@ and must be switched off and on. PIXMA MP760, MP770, MP780, MP790 .RE .PP -The following models may use the same Pixma protocol as those listed -above, but have not yet been reported to work (or not). They are declared -in the backend so that they get recognized and activated. +The following models may use the same Pixma protocol as those listed +above, but have not yet been reported to work (or not). They are declared +in the backend so that they get recognized and activated. Feedback in the sane\-devel mailing list welcome. .PP .RS @@ -109,8 +109,8 @@ MAXIFY MB2000, MB2300, MB5300 .RE .PP \#The following models may use partly the same Pixma protocol as other devices -\#listed above, but may still need some work. They are declared in the backend -\#as experimental. Snoop logs are required to further investigate, please contact +\#listed above, but may still need some work. They are declared in the backend +\#as experimental. Snoop logs are required to further investigate, please contact \#the sane\-devel mailing list. \#.PP \#.RS @@ -133,7 +133,7 @@ The backend supports: .PP The device name for USB devices is in the form pixma:xxxxyyyy_zzzzz where x, y and z are vendor ID, product ID and serial number respectively. -.PP +.PP Example: pixma:04A91709_123456 is a MP150. .PP Device names for BJNP/MFNP devices is in the form pixma:aaaa_bbbbb @@ -141,12 +141,12 @@ where aaaa is the scanners model and bbbb is the hostname or ip-adress. .PP Example: pixma:MF4800_192.168.1.45 is a MF4800 Series multi-function peripheral. .PP -This backend, based on cloning original Canon drivers protocols, is in +This backend, based on cloning original Canon drivers protocols, is in a production stage. Designed has been carried out without any applicable -manufacturer documentation, probably never available. However, we have tested -it as well as we could, but it may not work in all situations. You will find -an up-to-date status at the project homepage. (See below). -Users feedback is essential to help improve features and performances. +manufacturer documentation, probably never available. However, we have tested +it as well as we could, but it may not work in all situations. You will find +an up-to-date status at the project homepage. (See below). +Users feedback is essential to help improve features and performances. .SH OPTIONS Besides "well-known" options (e.g. resolution, mode etc.) pixma backend also provides the following options, i.e. the options might change in the future. @@ -178,20 +178,20 @@ the button and so on. When you finished, press the gray-scan button. (For MP150 you have to stop the frontend by pressing Ctrl-C for example.) .TP .I button\-update (deprecated) -(write only) In the past this option was required to be set to force +(write only) In the past this option was required to be set to force reading of the button status for .I button\-1 and .I button\-2. -The +The .B sane\-pixma -no longer requires this option to be used: if no fresh data is available, it -will be now requested automatically from the scanner. This option is left for +no longer requires this option to be used: if no fresh data is available, it +will be now requested automatically from the scanner. This option is left for backward compatibility reasons. .TP .I button\-1 button\-2 (read only) These options will return the value of the respective buttons. -value 0 means that the button was not pressed, 1 is returned when the button +value 0 means that the button was not pressed, 1 is returned when the button was pressed. Some scanners with more than two buttons send the button number as target. .TP @@ -225,10 +225,10 @@ support dynamic loading). .I @CONFIGDIR@/pixma.conf The backend configuration file (see also description of .B SANE_CONFIG_DIR -below). The file contains an optional list of networked scanners. Normally -only scanners that cannot be auto-detected because they are on a different -subnet shall be listed here. If your OS does not allow enumeration of -interfaces (i.e. it does not support the getifaddrs() function) you also may need +below). The file contains an optional list of networked scanners. Normally +only scanners that cannot be auto-detected because they are on a different +subnet shall be listed here. If your OS does not allow enumeration of +interfaces (i.e. it does not support the getifaddrs() function) you also may need to add your scanner here as well. .RS .PP @@ -239,16 +239,16 @@ to add your scanner here as well. .RE .PP where method indicates the protocol used (bjnp is used for inkjet multi-functionals -and mfnp is used for laser multi-functionals). +and mfnp is used for laser multi-functionals). .PP -host is the hostname or IP address of the scanner, e.g. bjnp://10.0.1.4 -for IPv4, bjnp://[2001:888:118e:18e2:21e:8fff:fe36:b64a] for a literal +host is the hostname or IP address of the scanner, e.g. bjnp://10.0.1.4 +for IPv4, bjnp://[2001:888:118e:18e2:21e:8fff:fe36:b64a] for a literal IPv6-address or bjnp://myscanner.mydomain.org for a hostname. .PP The port number is optional and in normally implied by the method. Port 8610 is the standard port for mfnp, 8612 for bjnp. .PP -A scanner specific timeout value for the network protocol can be set using the +A scanner specific timeout value for the network protocol can be set using the bjnp-timeout parameter. The value is in ms. .PP Define scanners each on a new line. @@ -260,17 +260,17 @@ More globally applicable tinmeouts can be set using the bjnp-timeout parameter a .RE .PP A timeout defined using bjnp-timeout will apply to the following scanner definitions -in the file. If required the bjnp-timeout setting +in the file. If required the bjnp-timeout setting can be defined multiple times, where each settng will apply only to the scanners that follow the setting. The last setting is used for the auto discovered scanners. -If not explicitely set, the default 1000ms setting will apply. +If not explicitely set, the default 1000ms setting will apply. .PP Setting timeouts should only be required in exceptional cases. .PP .SH USB SUPPORT USB scanners will be auto-detected and require no configuration. .SH NETWORKING SUPPORT -The pixma backend supports network scanners using the so called Canon BJNP +The pixma backend supports network scanners using the so called Canon BJNP protocol and MFNP protocol. Both IPv4 and IPv6 are supported, but IPv6 is as yet untested with MFNP. Please report your results on the mailing list. .PP @@ -278,28 +278,28 @@ Configuration is normally not required. The pixma backend will auto-detect your scanner if it is within the same subnet as your computer if your OS does support this. .PP -If your scanner can not be auto-detected, you can add it to the pixma +If your scanner can not be auto-detected, you can add it to the pixma configuration file (see above). .SH FIREWALLING FOR NETWORKED SCANNERS -The sane pixma backend communicates with port 8610 for MFNP or port 8612 +The sane pixma backend communicates with port 8610 for MFNP or port 8612 for BJNP on the scanner. So -you will have to allow outgoing traffic TO port 8610 or 8612 on the +you will have to allow outgoing traffic TO port 8610 or 8612 on the common subnet for scanning. .PP Scanner detection is slightly more complicated. The pixma backend sends -a broadcast on all direct connected subnets it can find (provided your OS -allows for enumeration of all netowrk interfaces). The broadcast is sent FROM +a broadcast on all direct connected subnets it can find (provided your OS +allows for enumeration of all netowrk interfaces). The broadcast is sent FROM port 8612 TO port 8610 or 8612 on the broadcast address of each interface. The outgoing packets will be allowed by the rule described above. .PP Responses from the scanner are sent back to the computer TO port 8612. Connection tracking however does not see a match as the response does not come from the broadcast address but from the scanners own address. -For automatic detection of your scanner, you will therefore have to allow +For automatic detection of your scanner, you will therefore have to allow incoming packets TO port 8612 on your computer. This applies to both MFNP and BJNP. .PP -So in short: open the firewall for all traffic from your computer to port +So in short: open the firewall for all traffic from your computer to port 8610 (for MFNP) or 8612 (for BJNP) AND to port 8612 (for both BJNP and MFNP) to your computer. .PP @@ -331,7 +331,7 @@ the verbosity and includes the information printed at the lower levels. .TP .B SANE_DEBUG_BJNP If the library was compiled with debug support enabled, this environment -variable controls the debug level for the +variable controls the debug level for the .B BJNP and MFNP network protocols for this backend. Higher value increases the verbosity and includes the information printed at the lower levels. @@ -341,7 +341,7 @@ the verbosity and includes the information printed at the lower levels. 1 Print error and warning messages (recommended) .br 2 Print high level function tracing information -.br +.br 3 Print more detailed protocol tracing information .br 4 Print protocol headers @@ -372,7 +372,7 @@ to "/tmp/config:" would result in directories "tmp/config", ".", and .I http://home.arcor.de/wittawat/pixma/, .I http://mp610.blogspot.com/ .PP -In case of trouble with a recent Pixma model, try the latest code for +In case of trouble with a recent Pixma model, try the latest code for the pixma backend, available in the Sane git repository at: .br .I http://git.debian.org/?p=sane/sane-backends.git diff --git a/doc/sane-plustek.man b/doc/sane-plustek.man index a6bb993f5..600807d06 100644 --- a/doc/sane-plustek.man +++ b/doc/sane-plustek.man @@ -241,7 +241,7 @@ The Options: option warmup t .RS .I t -specifies the warmup period in seconds, if set to \-1, the +specifies the warmup period in seconds, if set to \-1, the automatic warmup function will be used .RE .PP @@ -505,13 +505,13 @@ For problem reports it should be enough the set the verbosity to * The driver does not support these manic scalings up to 16 times the physical resolution. The only scaling is done on resolutions between the physical resolution -of the CCD-/CIS-sensor and the stepper motor i.e. you -have a 600x1200 dpi scanner and you are scanning using -800dpi, so scaling is necessary, because the sensor only -delivers 600dpi but the motor is capable to perform +of the CCD-/CIS-sensor and the stepper motor i.e. you +have a 600x1200 dpi scanner and you are scanning using +800dpi, so scaling is necessary, because the sensor only +delivers 600dpi but the motor is capable to perform 1200dpi steps. .PP -* Plusteks' model policy is somewhat inconsistent. They +* Plusteks' model policy is somewhat inconsistent. They sell technically different devices under the same product name. Therefore it is possible that some devices like the UT12 or U12 won't work \- please check diff --git a/doc/sane-plustek_pp.man b/doc/sane-plustek_pp.man index c01aba69a..937904933 100644 --- a/doc/sane-plustek_pp.man +++ b/doc/sane-plustek_pp.man @@ -13,7 +13,7 @@ The access of the scanner is either done directly by the backend or via kernel module, called pt_drv which can be created out of the plustek_pp backend code \- see also section .B "BUILDING THE KERNEL MODULE" -for further information. +for further information. .SH "SUPPORTED DEVICES" @@ -242,13 +242,13 @@ Within this directory, you should find a script called: .br .I MakeModule.sh .br -Now if your Linux kernelsources are installed correctly, -it should be possible to build, install and load the +Now if your Linux kernelsources are installed correctly, +it should be possible to build, install and load the module .B pt_drv. -.B Please note, +.B Please note, that the kernelsources need to be configured correctly. -Refer to your distributions +Refer to your distributions manual on how this is done. As root user, try .br .I ./MakeModule.sh @@ -257,7 +257,7 @@ the script will try and get all necessary information about your running kernel and will lead you through the whole installation process. .br -.B Note: Installing and loading the can only be done as +.B Note: Installing and loading the can only be done as superuser. .PP @@ -510,7 +510,7 @@ and without transparency unit. * 30bit mode is currently not supported. .PP * On low end systems under heavy system load the -driver may lose data, which can result in picture +driver may lose data, which can result in picture corruption or cause the sensor to hit the scan bed. .PP * The scanning speed on 600x1200 dpi models is slow. diff --git a/doc/sane-ricoh.man b/doc/sane-ricoh.man index 8cb38a2bf..6460e3439 100644 --- a/doc/sane-ricoh.man +++ b/doc/sane-ricoh.man @@ -26,8 +26,8 @@ Where .I special is the path-name for the special device that corresponds to a SCSI scanner. The special device name must be a generic SCSI device or a -symlink to such a device. The program -.IR sane\-find\-scanner +symlink to such a device. The program +.IR sane\-find\-scanner helps to find out the correct device. Under Linux, such a device name could be .I /dev/sga @@ -67,9 +67,9 @@ to "/tmp/config:" would result in directories "tmp/config", ".", and .B SANE_DEBUG_RICOH If the library was compiled with debug support enabled, this environment variable controls the debug level for this backend. Higher -debug levels increase the verbosity of the output. +debug levels increase the verbosity of the output. -Example: +Example: export SANE_DEBUG_RICOH=4 .SH "SEE ALSO" diff --git a/doc/sane-rts8891.man b/doc/sane-rts8891.man index 6424f7a59..de0683d34 100644 --- a/doc/sane-rts8891.man +++ b/doc/sane-rts8891.man @@ -6,19 +6,19 @@ The .B sane\-rts8891 library implements a SANE (Scanner Access Now Easy) backend that provides access to scanners based on the rts8891 ASIC. -.PP +.PP The scanners that work with this backend are: -.PP +.PP .RS .ft CR -.nf +.nf Vendor Model status \-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\- \-\-\-\-\-\-\-\-\-\-\- Umax Astra 4400 untested Umax Astra 4450 untested HP scanjet 4000c good HP scanjet 4470c good -.fi +.fi .ft R .RE @@ -26,58 +26,58 @@ The options the backend supports can either be selected through command line options to programs like scanimage or through GUI elements in xscanimage or xsane. -.br +.br If you have any strange behavior, please report to the backend maintainer or to the SANE mailing list. -Valid command line options and their syntax can be listed by using +Valid command line options and their syntax can be listed by using .RS scanimage \-\-help \-d rts8891 .RE -.TP +.TP .B Scan Mode Options -.TP +.TP .B \-\-mode -selects the basic mode of operation of the scanner valid choices are +selects the basic mode of operation of the scanner valid choices are .I R Color , .I Gray and .I Lineart -The default mode is Color. The Lineart mode is black and white only (1 bit). +The default mode is Color. The Lineart mode is black and white only (1 bit). Grayscale will produce 256 levels of gray (8 bits). Color mode allows for over 16 million different colors produced from 24 bits of color information. -.TP +.TP .B \-\-resolution -selects the resolution for a scan. The horizontal and vertical resolutions are set +selects the resolution for a scan. The horizontal and vertical resolutions are set by the value of this option. The scanner is capable of the following resolutions for the specified option value: -.PP +.PP .RS .ft CR -.nf - Value Hor. Resolution Vert. Resolution +.nf + Value Hor. Resolution Vert. Resolution \-\-\-\-\- \-\-\-\-\-\-\-\-\-\-\-\-\-\-\- \-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\- 75 75dpi 75dpi - 150 150dpi 150dpi - 300 300dpi 300dpi - 600 600dpi 600dpi + 150 150dpi 150dpi + 300 300dpi 300dpi + 600 600dpi 600dpi 1200 1200dpi 1200dpi -.fi +.fi .ft R .RE -.TP +.TP .B \-\-preview requests a preview scan. The resolution used for that scan is 75 dpi -and the scan area and the scan mode are as specified through their options, +and the scan area and the scan mode are as specified through their options, or the default if not specified. The default value for preview mode is "no". -.TP +.TP .B \-\-threshold selects the minimum\-brightness to get a white point. The threshold is only used with Lineart mode scans. -It is specified as a percentage in the range 0..100% (in steps of 1). +It is specified as a percentage in the range 0..100% (in steps of 1). The default value of the threshold option is 50. @@ -87,11 +87,11 @@ The configuration file contains the usb device ids of supported scanners (eg usb 0x043d 0x007c) and scanner configuration options. Empty lines and lines starting with a hash mark (#) are ignored. -.PP +.PP The options supported are .B allowsharing , -.B modelnumber +.B modelnumber . Option @@ -103,27 +103,27 @@ enables or not the sharing of the scanner between multiple frontends at the same is used to force the reported model by the backend and is only useful in the case of a scanner which NVRAM has been erased. .RS .ft CR -.nf +.nf 0 to report a HP4470c. 1 to report a HP4400c. 2 to report an Astra 4400. -.fi +.fi .ft R .RE -.PP +.PP .SH "FILES" -.TP +.TP .I @LIBDIR@/libsane\-rts8891.a The static library implementing this backend. -.TP +.TP .I @LIBDIR@/libsane\-rts8891.so The shared library implementing this backend (present on systems that support dynamic loading). .SH "ENVIRONMENT" -.TP +.TP .B SANE_DEBUG_RTS8891 SANE_DEBUG_RTS8891_LOW SANE_DEBUG_RTS88XX_LIB If the library was compiled with debug support enabled, these environment variables controls the debug level for this backend. E.g., @@ -139,7 +139,7 @@ at the same time (allowsharing option) may not work on some USB controllers. .PP XPA is no (yet) supported. .SH "BUGS" -.br +.br No bugs currently known. @@ -148,11 +148,11 @@ sane\-scsi(5), scanimage(1), xscanimage(1), xsane(1), sane(7) .SH "AUTHOR" -.TP +.TP This backend has been developed by St\['e]phane Voltz. .I http://stef.dev.free.fr/sane/rts8891 .SH "CREDITS" -.TP +.TP Many thanks go to: Laurent Fournier who donated me a HP4470c. Vladimir Sysoev and "TheUnruly Squash" for the time they spent recording diff --git a/doc/sane-s9036.man b/doc/sane-s9036.man index fe194b6db..468b44ee2 100644 --- a/doc/sane-s9036.man +++ b/doc/sane-s9036.man @@ -19,8 +19,8 @@ Where .I special is the path-name for the special device that corresponds to a SCSI scanner. The special device name must be a generic SCSI device or a -symlink to such a device. The program -.IR sane\-find\-scanner +symlink to such a device. The program +.IR sane\-find\-scanner helps to find out the correct device. Under Linux, such a device name could be .I /dev/sga @@ -60,9 +60,9 @@ to "/tmp/config:" would result in directories "tmp/config", ".", and .B SANE_DEBUG_S9036 If the library was compiled with debug support enabled, this environment variable controls the debug level for this backend. Higher -debug levels increase the verbosity of the output. +debug levels increase the verbosity of the output. -Example: +Example: export SANE_DEBUG_S9036=4 .SH "SEE ALSO" diff --git a/doc/sane-sceptre.man b/doc/sane-sceptre.man index 9c344133f..b60da2737 100644 --- a/doc/sane-sceptre.man +++ b/doc/sane-sceptre.man @@ -29,7 +29,7 @@ The make of this scanner is KINPO, so other scanners from that manufacturer may The options the backend supports can either be selected through command line options to programs like scanimage or through GUI elements in xscanimage or xsane. -Valid command line options and their syntax can be listed by using +Valid command line options and their syntax can be listed by using .RS scanimage \-\-help \-d sceptre .RE @@ -38,9 +38,9 @@ scanimage \-\-help \-d sceptre .B Scan Mode .TP -.B \-\-mode -selects the basic mode of operation of the scanner valid choices are -.I Lineart, Halftone, Gray and Color. +.B \-\-mode +selects the basic mode of operation of the scanner valid choices are +.I Lineart, Halftone, Gray and Color. The Lineart and Halftone mode are black and white only (1 bit). Gray will produce 256 levels of gray (8 bits). Color will produce a 24 bits color image. The scanner supports 30 bits internally but it only @@ -56,7 +56,7 @@ resolutions between 50 and 1200. selects the pattern mode that is used in Halftone mode. Valid options are 1, 2, 3 and 4. -.TP +.TP .B \-\-gamma\-correction controls the scanner internal gamma correction. Valid options are "Default", "User defined", "High density printing" "Low density @@ -67,18 +67,18 @@ printing" and "High contrast printing". (color mode only) allows the user to specify a gamma table (see the next 3 parameters). -.TP -.B \-\-red\-gamma\-table +.TP +.B \-\-red\-gamma\-table (color mode only) can be used to download a user defined gamma table for the red channel. The table must be 256 bytes long. -.TP -.B \-\-green\-gamma\-table +.TP +.B \-\-green\-gamma\-table (color mode only) can be used to download a user defined gamma table for the green channel. The table must be 256 bytes long. .TP -.B \-\-blue\-gamma\-table +.B \-\-blue\-gamma\-table (color mode only) can be used to download a user defined gamma table for the blue channel. The table must be 256 bytes long. @@ -87,7 +87,7 @@ for the blue channel. The table must be 256 bytes long. sets the threshold for black and white pixels in lineart mode. Possible values are from 0 (darker) to 255 (lighter). -.TP +.TP .B \-\-preview requests a preview scan. The resolution used for that scan is 30 dpi and the scan area is the maximum allowed. The scan mode is user @@ -97,7 +97,7 @@ selected. The default is "no". .B The geometry options .TP -.B \-l \-t \-x \-y +.B \-l \-t \-x \-y control the scan area: \-l sets the top left x coordinate, \-t the top left y coordinate, \-x selects the width and \-y the height of the scan area. All parameters are specified in millimeters by default. diff --git a/doc/sane-scsi.man b/doc/sane-scsi.man index bcb7d77c3..5a27555bd 100644 --- a/doc/sane-scsi.man +++ b/doc/sane-scsi.man @@ -21,9 +21,9 @@ to the generic SCSI device that the scanner is connected to. In this case, the configuration file simply lists the line .BR /dev/scanner . For a detailed description of each backend's configuration file, -please refer to the relevant backend manual page (e.g., +please refer to the relevant backend manual page (e.g., .BR sane\-epson (5) -for Epson scanners, +for Epson scanners, .BR sane\-hp (5) for HP scanners, etc.). .PP @@ -65,7 +65,7 @@ will be probed by the backend one by one and registered if the backend thinks it is a compatible device. For example, the line .PP .RS -scsi MUSTEK MFS\-06000CX Scanner 0 00 03 00 +scsi MUSTEK MFS\-06000CX Scanner 0 00 03 00 .RE .PP would attach the Mustek SCSI scanner with the following /proc/scsi/scsi entry: @@ -84,7 +84,7 @@ Usually it's sufficient to use vendor and model strings only or even only the vendor string. The following example .PP .RS -scsi MUSTEK * * * * * * +scsi MUSTEK * * * * * * .RE .PP would have the effect that all SCSI devices in the system with a @@ -188,10 +188,10 @@ version 2.2.7 on. If the new SG driver is available some backends buffers. If a backend does not automatically request a larger scsi buffer, set the environment variable .B SANE_SG_BUFFERSIZE -to the desired buffer size in bytes. It is not recommended to use more -than 1 MB, because for large values the probability increases that the -SG driver cannot allocate the necessary buffer(s). For ISA cards, even -1 MB might be a too large value. For a detailed discussion of memory +to the desired buffer size in bytes. It is not recommended to use more +than 1 MB, because for large values the probability increases that the +SG driver cannot allocate the necessary buffer(s). For ISA cards, even +1 MB might be a too large value. For a detailed discussion of memory issues of the SG driver, see http://www.torque.net/sg. .PP For Linux kernels before version 2.2.7 the size of the buffer is only 32KB. @@ -266,7 +266,7 @@ therefore while a scan is in progress, the system becomes almost unusable. You may change the values of the USLEEP macros in drivers/scsi/g_NCR5380.c. Some documentation is in this file and NCR5380.c. .TP -NCR/Symbios 810 +NCR/Symbios 810 For some scanners it may be necessary to disable disconnect/reconnect. To achieve this use the option ncr53c8xx="disc:n". Some people reported that their scanner only worked with the 53c7,8xx driver, not the ncr53c8xx. Try @@ -315,7 +315,7 @@ of 255 also prints kernel messages from the SCSI subsystem (where available). Smaller levels reduce verbosity. .TP .B SANE_SCSICMD_TIMEOUT -sets the timeout value for SCSI commands in seconds. Overriding the default +sets the timeout value for SCSI commands in seconds. Overriding the default value of 120 seconds should only be necessary for very slow scanners. .SH "SEE ALSO" diff --git a/doc/sane-sharp.man b/doc/sane-sharp.man index f089538ec..b4453eeaa 100644 --- a/doc/sane-sharp.man +++ b/doc/sane-sharp.man @@ -9,7 +9,7 @@ library implements a SANE (Scanner Access Now Easy) backend that provides access to Sharp SCSI scanners. This backend should be considered .B beta-quality -software! In the current state it is known to work with JX-610 and JX-250 +software! In the current state it is known to work with JX-610 and JX-250 scanners. It is prepared for usage with the JX-330 series scanners, but we are not able to test it with these devices. .PP @@ -63,18 +63,18 @@ for example. See sane\-scsi(5) for details. .SH SCAN OPTIONS .B Scan Mode -(parameter +(parameter .B \-\-mode -for scanimage). Possible settings: +for scanimage). Possible settings: .RS .B Lineart -(1 bit black & white scans), +(1 bit black & white scans), .br .B Gray (8 bit gray scale scans), .br .B Lineart Color -(bi-level color scans), +(bi-level color scans), .br .B Color (8 bit RGB scans). @@ -91,11 +91,11 @@ Possible settings: .B none .br .B Dither Bayer -.br +.br .B Dither Spiral .br .B Dither Dispersed -.br +.br .B Error Diffusion .RE The default value is @@ -114,12 +114,12 @@ feeder or a transparency adapter is installed. Possible settings: .B Transparency Adapter .RE If an ADF or a transparency adapter is installed, using it is the -default selection. +default selection. .B Custom Gamma -(parameter +(parameter .B \-\-custom\-gamma -for scanimage). This option determines whether a builtin or a custom +for scanimage). This option determines whether a builtin or a custom gamma-table is used. Possible settings: .RS .B yes @@ -130,11 +130,11 @@ enables a built gamma table .RE .B Gamma -(parameter +(parameter .B \-\-Gamma -for scanimage). This option is only available, if +for scanimage). This option is only available, if .B Custom Gamma -is set to +is set to .B no. Possible values: .RS @@ -142,32 +142,32 @@ Possible values: .br .B 2.2 .RE -The default value is 2.2. (The JX-250 and JX-350 have no built in gamma -correction; for these scanner, a gamma table is downloaded to the scanner +The default value is 2.2. (The JX-250 and JX-350 have no built in gamma +correction; for these scanner, a gamma table is downloaded to the scanner by the backend.) .B Gamma Table -(parameter +(parameter .B \-\-gamma\-table -for scanimage). Allowed values: 0..255; 256 numbers must be defined. -The default values are 0, 1, 2, .. 255 (i.e., gamma == 1). This table +for scanimage). Allowed values: 0..255; 256 numbers must be defined. +The default values are 0, 1, 2, .. 255 (i.e., gamma == 1). This table is only used for gray scale scans. .B Red Gamma Table -(parameter -.B \-\-red\-gamma\-table +(parameter +.B \-\-red\-gamma\-table for scanimage). Allowed values: 0..255; 256 numbers must be defined. The default values are 0, 1, 2, .. 255 (i.e., gamma == 1). .B Green Gamma Table -(parameter -.B \-\-green\-gamma\-table +(parameter +.B \-\-green\-gamma\-table for scanimage). Allowed values: 0..255; 256 numbers must be defined. The default values are 0, 1, 2, .. 255 (i.e., gamma == 1). .B Blue Gamma Table -(parameter -.B \-\-blue\-gamma\-table +(parameter +.B \-\-blue\-gamma\-table for scanimage). Allowed values: 0..255; 256 numbers must be defined. The default values are 0, 1, 2, .. 255 (i.e., gamma == 1). @@ -177,7 +177,7 @@ in pixel per inch (parameter for scanimage). Selects the resolution of the scanned image. Allowed values: .RS .B 30..600 -(JX-330, JX-350 and JX-610) resp. +(JX-330, JX-350 and JX-610) resp. .B 30..400 (JX-250) .RE @@ -203,19 +203,19 @@ in order to see the allowed parameter values for the scan window. The scan window parameters are: .RS -Top-left x position of scan area (parameter +Top-left x position of scan area (parameter .B \-l for scanimage); .br -Top-left y position of scan area (parameter +Top-left y position of scan area (parameter .B \-t for scanimage); .br -bottom right x position of scan area (parameter +bottom right x position of scan area (parameter .B \-x for scanimage); .br -bottom right y position of scan area (parameter +bottom right y position of scan area (parameter .B \-y for scanimage); .RE @@ -223,7 +223,7 @@ for scanimage); .B Edge emphasis (parameter .B \-\-Edge emphasis -for scanimage). This option is not available for the JX-250 and the JX-350. +for scanimage). This option is not available for the JX-250 and the JX-350. Possible settings: .RS .B None @@ -234,59 +234,59 @@ Possible settings: .br .B Blur .RE -The default value is +The default value is .B None. .B Threshold -(parameter +(parameter .B \-\-threshold for scanimage). Sets the threshold for black and white pixels in lineart mode. Possible values: .RS .B 1..255 .RE -The default value is +The default value is .B 128. This option is only available in scan mode lineart. .B Threshold Red -(parameter +(parameter .B \-\-threshold-red for scanimage). Sets the threshold for the red component of a pixel in in lineart color scan mode. Possible values: .RS .B 1..255 .RE -The default value is +The default value is .B 128. This option is only available in scan mode color lineart. .B Threshold Green -(parameter +(parameter .B \-\-threshold-green for scanimage). Sets the threshold for the green component of a pixel in in lineart color scan mode. Possible values: .RS .B 1..255 .RE -The default value is +The default value is .B 128. This option is only available in scan mode color lineart. .B Threshold Blue -(parameter +(parameter .B \-\-threshold-blue for scanimage). Sets the threshold for the blue component of a pixel in in lineart color scan mode. Possible values: .RS .B 1..255 .RE -The default value is +The default value is .B 128. This option is only available in scan mode color lineart. .B Light Color -(parameter +(parameter .B \-\-LightColor for scanimage). Sets the color of the light source. Possible values: .RS @@ -298,7 +298,7 @@ for scanimage). Sets the color of the light source. Possible values: .br .B blue .RE -The default value is +The default value is .B white. This option is only available in scan modes lineart color and color. @@ -310,75 +310,75 @@ be opened and closed, even if the jammed paper can be removed without opening the maintenance cover. Otherwise, the error condition cannot be cleared. .SH CONFIGURATION -The contents of the +The contents of the .I sharp.conf -file is a list of options and device names that correspond to Sharp +file is a list of options and device names that correspond to Sharp scanners. Empty lines and lines beginning with a hash mark (#) are ignored. See sane\-scsi(5) for details about device names. .PP Lines setting an option start with the key word .B option, followed by the option's name and the option's value. At present, three -options are defined: -.B buffers, buffersize, +options are defined: +.B buffers, buffersize, and -.B readqueue. +.B readqueue. .PP -Options defined at the start of +Options defined at the start of .I sharp.conf apply to all devices; options defined after a device name apply to this device. .PP -The options +The options .B buffers and .B readqueue are only significant if the backend has been compiled -so that for each scan a second process is forked (switch +so that for each scan a second process is forked (switch .B USE_FORK -in +in .I sharp.c ). This process reads the scan data from the scanner and writes this data into a block of shared memory. -The parent process reads the data from this memory block and delivers it -to the frontend. The options control the size and usage of this shared +The parent process reads the data from this memory block and delivers it +to the frontend. The options control the size and usage of this shared memory block. .PP .B option buffers -defines the number of buffers used. The smallest number allowed is 2. +defines the number of buffers used. The smallest number allowed is 2. .PP .B option buffersize -defines the size of one buffer. Since each buffer is filled with a +defines the size of one buffer. Since each buffer is filled with a single read command sent to the scanner, its size is limited automatically to the size allowed by the operating system or by the Sane SCSI library for SCSI read commands. A buffer size of 128 kB or 256 kB is recommended for scan resolutions of 300 dpi and above. .PP -.B option readqueue -defines how many read commands to be sent to the scanner -are queued. At present, the Sane SCSI library supports queued read -commands only for for Linux. For other operating systems, .B option readqueue -should be set to 0. For Linux, +defines how many read commands to be sent to the scanner +are queued. At present, the Sane SCSI library supports queued read +commands only for for Linux. For other operating systems, +.B option readqueue +should be set to 0. For Linux, .B option readqueue should be set to 2. Larger values than 2 for .B option readqueue are not reasonable in most cases. .B option buffers -should be greater than +should be greater than .B option readqueue. .SH Performance Considerations This section focuses on the problem of stops of the scanner's carriage -during a scan. Carriage stops happen mainly with the JX-250. This scanner -has obviously only a small internal buffer compared to its speed. That -means that the backend must read the data as fast as possible from the -scanner in order to avoid carriage stops. +during a scan. Carriage stops happen mainly with the JX-250. This scanner +has obviously only a small internal buffer compared to its speed. That +means that the backend must read the data as fast as possible from the +scanner in order to avoid carriage stops. .PP -Even the JX-250 needs only less than 10 seconds for a 400 dpi A4 gray -scale scan, which results in a data transfer rate of more than 1.6 MB -per second. This means that the data produced by the scanner must be +Even the JX-250 needs only less than 10 seconds for a 400 dpi A4 gray +scale scan, which results in a data transfer rate of more than 1.6 MB +per second. This means that the data produced by the scanner must be processed fairly fast. Due to the small internal buffer of the JX-250, the backend must issue a read request for the next data block as soon as possible after reading a block of data in order to avoid carriage @@ -395,25 +395,25 @@ Stops of the carriage can be caused by the following reasons: .PP .RE Too much "traffic" on the SCSI bus: This happens for example, if hard disks -are connected to the same SCSI bus as the scanner, and when data transfer +are connected to the same SCSI bus as the scanner, and when data transfer from/to these hard disks requires a considerable part of the SCSI bandwidth -during a scan. If this is the case, you should consider to connect the +during a scan. If this is the case, you should consider to connect the scanner to a separate SCSI adapter. .PP Slow responses by the backend to the scanner: Unfortunately, Unix-like operating systems generally have no real time capabilities. Thus there is no guarantee that the backend is under any circumstances able to communicate with the scanner as fast as required. To minimize this -problem, the backend should be compiled so that a separate reader process +problem, the backend should be compiled so that a separate reader process is forked: Make sure that .B USE_FORK -is defined when you compile +is defined when you compile .I sharp.c. If slow responses of the backend remain to be problem, you could try to -reduce the load of the system. Even while the backend and the reader -process need only a minor amount of processor time, other running +reduce the load of the system. Even while the backend and the reader +process need only a minor amount of processor time, other running processes can cause an increase in the time delay between two time -slices given to the reader process. On slower systems, such an +slices given to the reader process. On slower systems, such an increased delay can be enough to cause a carriage stop with the JX-250. For Linux, the usage of the SG driver version 2.1.36 or above is recommended, because it supports, in combination with @@ -424,20 +424,20 @@ This queueing implementation, combined with a buffer size of at least Slow processing of the scan data: An example for this situation is the access to the scanner via a 10 MBit Ethernet, which is definitely too slow to transfer the scan data as fast as they are produced by the -scanner. If you have enough memory available, you can increase +scanner. If you have enough memory available, you can increase .B option buffers, -so that an entire image can be stored in these buffers. +so that an entire image can be stored in these buffers. .PP In order to see, if the backend is too slow or if the further processing of the data is too slow, set the environment variable .B SANE_DEBUG_SHARP to 1. When a scan is finished, the backend writes the line "buffer full -conditions: +conditions: .I nn" to stderr. If .I nn is zero, carriage stops are caused by too slow responses of the backend -or too much "traffic" on the SCSI bus. If +or too much "traffic" on the SCSI bus. If .I nn is greater than zero, the backend had to wait .I nn @@ -469,21 +469,21 @@ levels reduce verbosity. 1. ADF Mode .RS After several ADF scans, the scanner moves the carriage back to the idle -position and back to ADF scan position, before a scan starts. We do not -know, if this is a problem of the scanner, or if this is a bug of the +position and back to ADF scan position, before a scan starts. We do not +know, if this is a problem of the scanner, or if this is a bug of the backend. At present, the scanner must power off and on to stop this annoying behaviour. .RE 2. Threshold level does not work (only JX-610) .PP -3. The maximum resolution is limited to 600 dpi(JX-610 supported +3. The maximum resolution is limited to 600 dpi(JX-610 supported to 1200 dpi) resp. 400 dpi (JX-250) .PP 4. If the JX250 is used with an ADF, the following situation can occur: After several scans, the scanner moves, after loading a new sheet of paper, the carriage to the idle position, and then back to the position used for ADF -scans. This happens for +scans. This happens for .I every scan, in contrast to the calibration, which is done after 10 scans. (For the diff --git a/doc/sane-sm3600.man b/doc/sane-sm3600.man index 8f5862235..1fb79ae5b 100644 --- a/doc/sane-sm3600.man +++ b/doc/sane-sm3600.man @@ -8,7 +8,7 @@ The library implements a SANE (Scanner Access Now Easy) backend that provides access to some Microtek scanners with the Toshiba M011 custom USB chip. This backend should be considered alpha. -.PP +.PP There are also backends for Microtek scanners with SCSI command set. Refer to sane\-microtek(5) and sane\-microtek2(5) for details. .PP diff --git a/doc/sane-sm3840.man b/doc/sane-sm3840.man index 96959b66c..c384802d1 100644 --- a/doc/sane-sm3840.man +++ b/doc/sane-sm3840.man @@ -8,7 +8,7 @@ The library implements a SANE (Scanner Access Now Easy) backend that provides access to some Microtek scanners with the SCAN08 USB chip. -.PP +.PP There exist backends for Microtek scanners with SCSI command set. Refer to sane\-microtek(5) and sane\-microtek2(5) for details. .PP diff --git a/doc/sane-snapscan.man b/doc/sane-snapscan.man index 39148687a..6e718750f 100644 --- a/doc/sane-snapscan.man +++ b/doc/sane-snapscan.man @@ -33,8 +33,8 @@ or .IR /dev/sge , for example. See sane\-scsi(5) for details. .P -For USB scanners the devicename must contain the keyword "usb", as in -.I /dev/usbscanner +For USB scanners the devicename must contain the keyword "usb", as in +.I /dev/usbscanner or .IR /dev/usb/scanner0 . For scanners that need a firmware upload before scanning add a line starting @@ -107,5 +107,5 @@ Mikko Tyolajarvi, David Mosberger-Tang, Wolfgang Goeller, Petter Reinholdtsen, Gary Plewa, Sebastien Sable, Oliver Schwartz and Mikael Magnusson. .br -Man page by Henning Meier-Geinitz (mostly based on the web pages and +Man page by Henning Meier-Geinitz (mostly based on the web pages and source code). diff --git a/doc/sane-st400.man b/doc/sane-st400.man index 9dac97cf4..8852ef34d 100644 --- a/doc/sane-st400.man +++ b/doc/sane-st400.man @@ -139,7 +139,7 @@ me the report. .SH "SEE ALSO" sane(7), sane\-scsi(5) .br -http://www.informatik.uni-oldenburg.de/~ingo/sane/ +http://www.informatik.uni-oldenburg.de/~ingo/sane/ .SH AUTHOR diff --git a/doc/sane-stv680.man b/doc/sane-stv680.man index 7b63b925d..c6f65f333 100644 --- a/doc/sane-stv680.man +++ b/doc/sane-stv680.man @@ -32,7 +32,7 @@ for the exact status of each camera. For startup of this backend check that if present the stv680 kernel module is removed or disabled. .br -Also before using, enable the backend by editing the /etc/sane.d/dll.conf file, +Also before using, enable the backend by editing the /etc/sane.d/dll.conf file, change #stv680 to stv680. For problems with the untested cameras, you @@ -62,7 +62,7 @@ If you have any success with a camera not listed here, or if you have any strange behavior, please report to the backend maintainer or to the SANE mailing list. -Valid command line options and their syntax can be listed by using +Valid command line options and their syntax can be listed by using .RS scanimage \-\-help \-d stv680 .RE @@ -75,7 +75,7 @@ scanimage \-\-help \-d stv680 .B \-\-mode selects the basic mode of operation of the webcams valid choices. -The read resolution mode is 8 bits, output resolution is 24 bits. +The read resolution mode is 8 bits, output resolution is 24 bits. Selects the resolution for a scan. The camera can do only the resolutions listed. .TP @@ -98,7 +98,7 @@ Bayer unshuffle, color correction, textline with date and time is added .TP .B \-\-white\-level\-r Selects what red radiance level should be -considered "white", when scanning some sheets by changing the calibration +considered "white", when scanning some sheets by changing the calibration value loaded into the scanner. Scale \-32 .. 0 .. +32 in steps of 1. .TP diff --git a/doc/sane-tamarack.man b/doc/sane-tamarack.man index 628069c43..7084924de 100644 --- a/doc/sane-tamarack.man +++ b/doc/sane-tamarack.man @@ -28,8 +28,8 @@ Where .I special is the path-name for the special device that corresponds to a SCSI scanner. The special device name must be a generic SCSI device or a -symlink to such a device. The program -.IR sane\-find\-scanner +symlink to such a device. The program +.IR sane\-find\-scanner helps to find out the correct device. Under Linux, such a device name could be .I /dev/sga @@ -69,9 +69,9 @@ to "/tmp/config:" would result in directories "tmp/config", ".", and .B SANE_DEBUG_TAMARACK If the library was compiled with debug support enabled, this environment variable controls the debug level for this backend. Higher -debug levels increase the verbosity of the output. +debug levels increase the verbosity of the output. -Example: +Example: export SANE_DEBUG_TAMARACK=4 .SH "SEE ALSO" diff --git a/doc/sane-teco1.man b/doc/sane-teco1.man index acb498521..4f4ce85c8 100644 --- a/doc/sane-teco1.man +++ b/doc/sane-teco1.man @@ -20,21 +20,21 @@ The scanners that should work with this backend are: .nf Vendor Model TECO model status ---------------------- -------------- ----------- - Relisys AVEC 2400 VM3520 tested + Relisys AVEC 2400 VM3520 tested Relisys AVEC 2412 VM3520+ tested - Relisys AVEC 4800 VM4530 untested - Relisys AVEC 4816 VM4530+ untested - Relisys RELI 2400 VM3530 untested + Relisys AVEC 4800 VM4530 untested + Relisys AVEC 4816 VM4530+ untested + Relisys RELI 2400 VM3530 untested Relisys RELI 2412 VM3530+ tested - Relisys RELI 2412 VM3530+ untested - Relisys RELI 4816 VM4540 tested + Relisys RELI 2412 VM3530+ untested + Relisys RELI 4816 VM4540 tested Relisys RELI 4830 VM4542 tested - Relisys RELI 9600 VM6530 untested - Relisys RELI 9612 VM6530* untested - Relisys RELI 9624 VM6530+ untested - Relisys RELI 9630 VM6540 untested - Relisys RELI DS15 VM3440 untested - Relisys RELI DS6 VM3420 untested + Relisys RELI 9600 VM6530 untested + Relisys RELI 9612 VM6530* untested + Relisys RELI 9624 VM6530+ untested + Relisys RELI 9630 VM6540 untested + Relisys RELI DS15 VM3440 untested + Relisys RELI DS6 VM3420 untested Dextra DF-600P VM3510 tested Dextra DF-4830T VM4542 untested Dextra DF-1200T+ VM3530+ untested @@ -59,7 +59,7 @@ If you have any success with a scanner not listed here, or if you have any strange behavior, please report to the backend maintainer or to the SANE mailing list. -Valid command line options and their syntax can be listed by using +Valid command line options and their syntax can be listed by using .RS scanimage \-\-help \-d teco1 .RE @@ -69,7 +69,7 @@ scanimage \-\-help \-d teco1 .TP .B \-\-mode -selects the basic mode of operation of the scanner valid choices are +selects the basic mode of operation of the scanner valid choices are .I Black & White , .I Grayscale @@ -89,7 +89,7 @@ between 1 and 600, in increments of 1. .B Geometry options .TP -.B \-l \-t \-x \-y +.B \-l \-t \-x \-y control the scan area: \-l sets the top left x coordinate, \-t the top left y coordinate, \-x selects the width and \-y the height of the scan area. All parameters are specified in millimeters by default. @@ -103,24 +103,24 @@ area. All parameters are specified in millimeters by default. (color mode only) allows the user to specify a gamma table (see the next 3 parameters). -.TP -.B \-\-red\-gamma\-table +.TP +.B \-\-red\-gamma\-table (color mode only) can be used to download a user defined gamma table for the red channel. The table must be 256 bytes long. -.TP -.B \-\-green\-gamma\-table +.TP +.B \-\-green\-gamma\-table (color mode only) can be used to download a user defined gamma table for the green channel. The table must be 256 bytes long. .TP -.B \-\-blue\-gamma\-table +.B \-\-blue\-gamma\-table (color mode only) can be used to download a user defined gamma table for the blue channel. The table must be 256 bytes long. .TP .B \-\-dither -(Black & White only) select the dither mask to use. Possible values are +(Black & White only) select the dither mask to use. Possible values are .I Line art , .I 2x2 @@ -140,7 +140,7 @@ and .I 8x8 vertical -.TP +.TP .B \-\-preview requests a preview scan. The resolution used for that scan is 22 dpi and the scan area is the maximum allowed. The scan mode is user diff --git a/doc/sane-teco2.man b/doc/sane-teco2.man index 3abd3b8a8..4b7996058 100644 --- a/doc/sane-teco2.man +++ b/doc/sane-teco2.man @@ -45,7 +45,7 @@ Note that the untested scanner will not be directly supported. You should contact the author for that. The TECO VM number can usually be found at the back of the -scanner. It is also part of the FCC ID. +scanner. It is also part of the FCC ID. The options the backend supports can either be selected through command line options to programs like scanimage or through GUI @@ -56,7 +56,7 @@ If you have any success with a scanner not listed here, or if you have any strange behavior, please report to the backend maintainer or to the SANE mailing list. -Valid command line options and their syntax can be listed by using +Valid command line options and their syntax can be listed by using .RS scanimage \-\-help \-d teco2 .RE @@ -66,7 +66,7 @@ scanimage \-\-help \-d teco2 .TP .B \-\-mode -selects the basic mode of operation of the scanner valid choices are +selects the basic mode of operation of the scanner valid choices are .I Lineart , .I Gray @@ -84,21 +84,21 @@ between 1 and 600, in increments of 1. Color -selects the resolution for a scan. The scanner can do only the +selects the resolution for a scan. The scanner can do only the resolutions listed. -All values with ydpi > 300 (300 x 600) or 600 (600 x 1200) result in -a wrong proportion for the scan. The proportion can be adjusted with -the following imagemagick command: -convert \-geometry (dpi/max_xdpi * 100%)x100% -max_xdpi is for the vm3575 constant with 300 dpi -e.g. 600dpi adjust with: convert \-geometry 200%x100% +All values with ydpi > 300 (300 x 600) or 600 (600 x 1200) result in +a wrong proportion for the scan. The proportion can be adjusted with +the following imagemagick command: +convert \-geometry (dpi/max_xdpi * 100%)x100% +max_xdpi is for the vm3575 constant with 300 dpi +e.g. 600dpi adjust with: convert \-geometry 200%x100% .TP .B Geometry options .TP -.B \-l \-t \-x \-y +.B \-l \-t \-x \-y control the scan area: \-l sets the top left x coordinate, \-t the top left y coordinate, \-x selects the width and \-y the height of the scan area. All parameters are specified in millimeters by default. @@ -112,25 +112,25 @@ area. All parameters are specified in millimeters by default. (color mode only) allows the user to specify a gamma table (see the next 3 parameters). -.TP -.B \-\-red\-gamma\-table +.TP +.B \-\-red\-gamma\-table (color mode only) can be used to download a user defined gamma table for the red channel. The table must be 256 bytes long. -.TP -.B \-\-green\-gamma\-table +.TP +.B \-\-green\-gamma\-table (color mode only) can be used to download a user defined gamma table for the green channel. The table must be 256 bytes long. .TP -.B \-\-blue\-gamma\-table +.B \-\-blue\-gamma\-table (color mode only) can be used to download a user defined gamma table for the blue channel. The table must be 256 bytes long. .TP .B \-\-white\-level\-r (VM3564, VM356A, VM3575 and VM6575 only) Selects what red radiance level should be -considered "white", when scanning some sheets by changing the calibration +considered "white", when scanning some sheets by changing the calibration value loaded into the scanner. Scale 0..64 in steps of 1. .TP @@ -145,10 +145,10 @@ value loaded into the scanner. Scale 0..64 in steps of 1. considered "white", when scanning some sheets by changing the calibration value loaded into the scanner. Scale 0..64 in steps of 1. -.TP +.TP .B \-\-preview requests a preview scan. The resolution used for that scan is 50 dpi -(for VM356A and VM6575 75 dpi) and the scan area is the maximum allowed. +(for VM356A and VM6575 75 dpi) and the scan area is the maximum allowed. The scan mode is user selected. The default is "no". diff --git a/doc/sane-teco3.man b/doc/sane-teco3.man index a2b041d39..8fc6c3c38 100644 --- a/doc/sane-teco3.man +++ b/doc/sane-teco3.man @@ -31,7 +31,7 @@ The scanners that should work with this backend are: .RE The TECO VM number can usually be found at the back of the -scanner. It is also part of the FCC ID. +scanner. It is also part of the FCC ID. The options the backend supports can either be selected through command line options to programs like scanimage or through GUI @@ -42,7 +42,7 @@ If you have any success with a scanner not listed here, or if you have any strange behavior, please report to the backend maintainer or to the SANE mailing list. -Valid command line options and their syntax can be listed by using +Valid command line options and their syntax can be listed by using .RS scanimage \-\-help \-d teco3 .RE @@ -52,7 +52,7 @@ scanimage \-\-help \-d teco3 .TP .B \-\-mode -selects the basic mode of operation of the scanner valid choices are +selects the basic mode of operation of the scanner valid choices are .I Black & White , .I Grayscale @@ -72,7 +72,7 @@ between 1 and 1200, in increments of 1. .B Geometry options .TP -.B \-l \-t \-x \-y +.B \-l \-t \-x \-y control the scan area: \-l sets the top left x coordinate, \-t the top left y coordinate, \-x selects the width and \-y the height of the scan area. All parameters are specified in millimeters by default. @@ -86,23 +86,23 @@ area. All parameters are specified in millimeters by default. (color mode only) allows the user to specify a gamma table (see the next 3 parameters). -.TP -.B \-\-red\-gamma\-table +.TP +.B \-\-red\-gamma\-table (color mode only) can be used to download a user defined gamma table for the red channel. The table must be 1024 bytes long. -.TP -.B \-\-green\-gamma\-table +.TP +.B \-\-green\-gamma\-table (color mode only) can be used to download a user defined gamma table for the green channel. The table must be 1024 bytes long. .TP -.B \-\-blue\-gamma\-table +.B \-\-blue\-gamma\-table (color mode only) can be used to download a user defined gamma table for the blue channel. The table must be 1024 bytes long. -.TP +.TP .B \-\-preview requests a preview scan. The resolution used for that scan is 22 dpi and the scan area is the maximum allowed. The scan mode is user diff --git a/doc/sane-test.man b/doc/sane-test.man index e5828957d..08c9f86fd 100644 --- a/doc/sane-test.man +++ b/doc/sane-test.man @@ -15,10 +15,10 @@ The idea is not only to find bugs in frontends but also to show all capabilities of SANE. Therefore .B sane\-test implements functions and options that are not (or seldom) found in other -backends. +backends. .PP The backend is commented out in @CONFIGDIR@/dll.conf, so either the comment -character must be removed or the backend must be called explicitly. E.g. +character must be removed or the backend must be called explicitly. E.g. `scanimage \-d test' or `xscanimage test'. .SH SCAN MODE OPTIONS @@ -86,7 +86,7 @@ If option is set, the maximum amount of data transferred with each call to sane_read() is limited. .PP -Option +Option .B read\-limit\-size sets the limit for option read-limit. A low limit slows down scanning. It can be used to detect errors in frontend that occur because of wrong @@ -198,7 +198,7 @@ backend. .PP .SH INT TEST OPTIONS -There are 6 int test options in total. +There are 6 int test options in total. .PP Option .B int @@ -229,7 +229,7 @@ Option constraint. .SH FIXED TEST OPTIONS -There are 3 fixed test options in total. +There are 3 fixed test options in total. .PP Option .B fixed @@ -246,7 +246,7 @@ Option .PP .SH STRING TEST OPTIONS -There are 3 string test options in total. +There are 3 string test options in total. .PP Option .B string @@ -276,7 +276,7 @@ The backend configuration file (see also description of below). The initial values of most of the basic SANE options can be configured in this file. A template containing all the default values is provided together with this backend. One of the more interesting values may be -.BR number_of_devices . +.BR number_of_devices . It can be used to check the frontend's ability to show a long list of devices. The config values concerning resolution and geometry can be useful to test the handling of big file sizes. @@ -307,13 +307,13 @@ to "/tmp/config:" would result in directories "tmp/config", ".", and .B SANE_DEBUG_TEST If the library was compiled with debug support enabled, this environment variable controls the debug level for this backend. Higher -debug levels increase the verbosity of the output. +debug levels increase the verbosity of the output. -Example: +Example: export SANE_DEBUG_TEST=4 .SH "SEE ALSO" -sane(7), +sane(7), .IR http://www.meier\-geinitz.de/sane/test\-backend/ diff --git a/doc/sane-u12.man b/doc/sane-u12.man index 8b35fdf6e..e076b4466 100644 --- a/doc/sane-u12.man +++ b/doc/sane-u12.man @@ -180,5 +180,5 @@ The value controls the verbosity of the backend. .SH "KNOWN BUGS & RESTRICTIONS" * The driver is in alpha state, so please don't expect too much!!! .PP -* When using libusb, it might be, that the backend hangs. +* When using libusb, it might be, that the backend hangs. In that case, reconnect the scanner. diff --git a/doc/sane-umax.man b/doc/sane-umax.man index 7dd9382c8..41b4bebb8 100644 --- a/doc/sane-umax.man +++ b/doc/sane-umax.man @@ -20,12 +20,12 @@ parallel- and USB-scanners are not (and probably will never be) supported! .SH CONFIGURATION -The configuration file for this backend resides in +The configuration file for this backend resides in .IR @CONFIGDIR@/umax.conf . Its contents is a list of device names that correspond to UMAX and UMAX compatible scanners. Empty lines and lines starting with a hash mark (#) are ignored. A sample configuration file is -shown below: +shown below: .nf # this is a comment @@ -44,19 +44,19 @@ shown below: option calibration\-width\-offset \-1 option calibration\-bytes\-pixel \-1 option exposure\-time\-rgb\-bind \-1 - option invert\-shading\-data \-1 + option invert\-shading\-data \-1 option lamp\-control\-available 0 option gamma\-lsb\-padded 0 - /dev/sge -\ - #scsi Vendor Model Type Bus Channel ID LUN + /dev/sge +\ + #scsi Vendor Model Type Bus Channel ID LUN # The following scanner supports lamp control option lamp\-control\-available 1 - scsi UMAX * Scanner * * * * * -\ + scsi UMAX * Scanner * * * * * +\ # scanner on /dev/scanner does not support lamp control option lamp\-control\-available 0 - /dev/scanner + /dev/scanner .fi .TP @@ -194,7 +194,7 @@ command queueing you can try to set this value to 1. .PP The special device name must be a generic SCSI device or a symlink to such a device. To find out to which device your scanner is assigned and how you have to set the -permissions of that device, have a look at sane\-scsi. +permissions of that device, have a look at sane\-scsi. .SH SCSI ADAPTER TIPS @@ -203,7 +203,7 @@ well by Linux (I suggest not to use it), the PCI-SCSI-adapters that come with so Umax-scanners are not supported at all (as far as I know). On other platforms these SCSI-adapters are not supported. So you typically need to purchase another SCSI-adapter that is supported by your platform. See the relevant hardware FAQs and HOWTOs for your -platform for more information. +platform for more information. The UMAX-scanners do block the scsi-bus for a few seconds while scanning. It is not necessary to connect the scanner to its own SCSI-adapter. But if you need short @@ -240,7 +240,7 @@ SANE_DEBUG_UMAX values .ft CR .nf Number Remark -\ +\ 0 print important errors (printed each time) 1 print errors 2 print sense diff --git a/doc/sane-umax1220u.man b/doc/sane-umax1220u.man index e90a4e90c..fc2ce4ef1 100644 --- a/doc/sane-umax1220u.man +++ b/doc/sane-umax1220u.man @@ -27,13 +27,13 @@ Usually, no manual configuration is necessary. The configuration file for this b Its contents is a list of device names that correspond to UMAX Astra scanners. Empty lines and lines starting with a hash mark (#) are ignored. A sample -configuration file is shown below: +configuration file is shown below: .nf #usb vendor product usb 0x1606 0x0010 # Device list for non-linux systems - /dev/scanner + /dev/scanner /dev/usb/scanner0 .fi @@ -66,7 +66,7 @@ SANE_DEBUG_UMAX1220U values .ft CR .nf Number Remark -\ +\ 1 print failures 2 print information 3 print high-level function calls diff --git a/doc/sane-umax_pp.man b/doc/sane-umax_pp.man index 09e6ea0bd..40972ce28 100644 --- a/doc/sane-umax_pp.man +++ b/doc/sane-umax_pp.man @@ -8,52 +8,52 @@ The library implements a SANE (Scanner Access Now Easy) backend that provides access to Umax parallel port flatbed scanners. The following scanners work with this backend: -.PP +.PP .RS -Model: -.br -\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\- -.br -Astra 610P -.br -Astra 1220P -.br -HP3200C -.br -Astra 1600P -.br -Astra 2000P -.br +Model: +.br +\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\- +.br +Astra 610P +.br +Astra 1220P +.br +HP3200C +.br +Astra 1600P +.br +Astra 2000P +.br Genius ColorPage-Life Pro -.br +.br .RE -.PP +.PP This backend handles 75x75, 150x150, 300x300, 600x600 and 600x1200 for 1220P/1600P/2000P -dpi scan resolutions, and 75x75, 150x150, 300x300 and 300x600 for 610P. In color and gray +dpi scan resolutions, and 75x75, 150x150, 300x300 and 300x600 for 610P. In color and gray levels, there is a software lineart mode. -.PP -The new generation models share a newer version of the 610P ASIC embedded in an EPAT chip. +.PP +The new generation models share a newer version of the 610P ASIC embedded in an EPAT chip. Only parts such as CCD and ADC change from one to another. They even all reports being UMAX Astra 1220P via IEEE1284. There isn't software way to recognize them properly. Under windows, model is -set by the driver installed, regardless of the hardware. -.PP -.TP +set by the driver installed, regardless of the hardware. +.PP +.TP .B EPP/ECP MODES ONLY -The current version of the backend uses only EPP or ECP mode to communicate -with the scanner. PS/2 mode isn't implemented. The 610P only use SPP. It is -recommended that you set your parallel port to EPP in BIOS with the current -version of this +The current version of the backend uses only EPP or ECP mode to communicate +with the scanner. PS/2 mode isn't implemented. The 610P only use SPP. It is +recommended that you set your parallel port to EPP in BIOS with the current +version of this backend. You can leave it to ECP or ECP+EPP, but in this case you may not use ppdev but only direct hardware access if you have to use ECP. ECPEPP will only work if you use a 2.4 or 2.6 kernel with ppdev character device support. -.PP -This backend does support parport sharing only -.I +.PP +This backend does support parport sharing only +.I if you have a kernel with ppdev support. -.I -.PP -Note that if you don't use the ppdev character device, the backend +.I +.PP +Note that if you don't use the ppdev character device, the backend needs to run as root. To allow user access to the scanner run the backend through the network interface (See saned(8) and sane\-net(5)). A more relaxed solution (security wise) is to add suid bit to the frontend @@ -63,13 +63,13 @@ access to IO ports, which lessen risks when being root. .SH "DEVICE NAMES" This backend expects device names of the form: -.PP +.PP .RS .I port value .RE -.PP +.PP Where -\fBvalue\fR is : +\fBvalue\fR is : .RS .TP @@ -95,40 +95,40 @@ have to use /dev/parport1, /dev/parport2, ... 0x378 does direct hardware access on the given address. Usual values are 0x378, 0x278, 0x3BC -In this case, you have to run the scanner as +In this case, you have to run the scanner as root (*BSD and linux), or with 'IOPL=yes' on OS/2 -.PP +.PP .RE \fBNOTE:\fR in all cases, you must have sufficient privileges to get access to the chosen device or address. Depending on the security settings, devices may not be available for all users. -You have to change permissions on the dev/ppi* or /dev/parport* devices. -.PP +You have to change permissions on the dev/ppi* or /dev/parport* devices. +.PP .RE You can rename any device using the -.PP +.PP .RS .I name devname -.br +.br .I model model -.br +.br .I vendor vendor .RE -.PP -options. These options apply to the last port option. +.PP +options. These options apply to the last port option. .SH "CONFIGURATION" Please make sure to edit umax_pp.conf .B before you use the backend. -.PP +.PP The contents of the .B umax_pp.conf file is a list of options and device names that correspond to Umax scanners. Empty lines and lines starting with a hash mark (#) are ignored. -.PP +.PP The eight options supported are .BR red\-gain , .BR green\-gain , @@ -151,7 +151,7 @@ range from 0 (lowest gain) to 15 (highest). If the advanced option "Gain" isn't checked in the frontend, the backend does automatic gain calibration, and do not use user provided values. -.PP +.PP Options .B red\-offset @@ -160,21 +160,21 @@ Options and .B blue\-offset allow you to adjust the offset of your scanner for the given color. Values -range from 0 (lowest offset) to 15 (highest). -.PP +range from 0 (lowest offset) to 15 (highest). +.PP Option .B astra allows you to change the model of your scanner. Current auto detection is based on side effects on scanning when using 1220P command set on other models, so -it may fail on unknown hardware combination. Valid values are 610, 1220, 1600 +it may fail on unknown hardware combination. Valid values are 610, 1220, 1600 and 2000. It is useful only when autodetection fails to detect properly -your scanner model. If your scanner work properly but is reported wrongly, -let it be that way. -The only valid case to change the model is when your scanner produces "black" or -"inverted" scans. In this case you can put the model. Be aware that it will +your scanner model. If your scanner work properly but is reported wrongly, +let it be that way. +The only valid case to change the model is when your scanner produces "black" or +"inverted" scans. In this case you can put the model. Be aware that it will prevent scanner model autodetection. -.PP +.PP Option .B buffer @@ -183,26 +183,26 @@ bytes. The default value is 2 megabytes. Decreasing this value will improve the smoothness of progress bar in the frontend, but will stall the scan more often. -.PP +.PP .SH "FILES" -.TP +.TP .I @CONFIGDIR@/umax_pp.conf The backend configuration file (see also description of .B SANE_CONFIG_DIR below). -.TP +.TP .I @LIBDIR@/libsane\-umax_pp.a The static library implementing this backend. -.TP +.TP .I @LIBDIR@/libsane\-umax_pp.so The shared library implementing this backend (present on systems that support dynamic loading). .SH "ENVIRONMENT" -.TP +.TP .B SANE_CONFIG_DIR This environment variable specifies the list of directories that may contain the configuration file. Under UNIX, the directories are @@ -216,14 +216,14 @@ directories. For example, setting .B SANE_CONFIG_DIR to "/tmp/config:" would result in directories "tmp/config", ".", and "@CONFIGDIR@" being searched (in this order). -.TP +.TP .B SANE_DEBUG_UMAX_PP If the library was compiled with debug support enabled, this environment variable controls the debug level for this backend. E.g., a value of 128 requests all debug output to be printed. Smaller levels reduce verbosity. -.PP +.PP .RS .ft CR .nf @@ -239,14 +239,14 @@ level debug output .fi .ft R .RE -.PP -.TP +.PP +.TP .B SANE_DEBUG_UMAX_PP_LOW This variable sets the debug level for the SANE interface for the Umax ASIC. Note that enabling this will spam your terminal with some million lines of debug output. -.PP +.PP .RS .ft CR .nf @@ -256,18 +256,18 @@ level debug output 1 errors 8 command blocks 16 detailed code flow - 32 dump datafiles + 32 dump datafiles 255 everything .fi .ft R .RE -.PP - -.PP +.PP + +.PP .SH "SEE ALSO" sane(7), sane\-net(5), saned(8) -.TP +.TP For latest bug fixes and information see .I http://umax1220p.sourceforge.net/ @@ -282,21 +282,21 @@ by William Stuart. If something doesn't work, please contact me. But I need some information about your scanner to be able to help you... -.TP +.TP .I SANE version run "scanimage \-V" to determine this -.TP +.TP .I the backend version and your scanner hardware run "SANE_DEBUG_UMAX_PP=255 scanimage \-L 2>log" as root. If you don't get any output from the umax_pp backend, make sure a line "umax_pp" is included into your @CONFIGDIR@/dll.conf. If your scanner isn't detected, make sure you've defined the right port address, or the -correct device +correct device in your umax_pp.conf. -.TP +.TP .I the name of your scanner/vendor also a worthy information. Please also include the optical resolution and lamp type of your scanner, both can be found in the manual of your scanner. -.TP +.TP .I any further comments if you have comments about the documentation (what could be done better), or you think I should know something, please include it. diff --git a/doc/sane-usb.man b/doc/sane-usb.man index 8237a8a70..5285b2f84 100644 --- a/doc/sane-usb.man +++ b/doc/sane-usb.man @@ -12,7 +12,7 @@ sanei_usb interface. However, there is one exceptions: USB Scanners supported by the microtek2 backend need a special USB kernel driver, see .BR sane\-microtek2 (5) -for details. +for details. .SH "QUICK START" This is a short HOWTO-like section. For the full details, read the following @@ -71,11 +71,11 @@ Usually udev or for older distributions the hotplug utilities are used, which support dynamic setting of access permissions. SANE comes with udev and hotplug scripts in the directory tools/udev and tools/hotplug. They can be used for setting permissions, see @DOCDIR@/README.linux, tools/README and the README in -the tools/hotplug directory for more details. +the tools/hotplug directory for more details. .PP For the .BR BSDs , -the device files used by libusb are named +the device files used by libusb are named .IR /dev/ugen* . Use chmod to apply appropriate permissions. @@ -114,7 +114,7 @@ usb 0x055f 0x0006 .PP would have the effect that all USB devices in the system with a vendor id of 0x55f and a product id of 0x0006 would be probed and recognized by the -backend. +backend. .PP If your scanner is not detected automatically, it may be necessary to edit the appropriate backend configuration file before using SANE for the first time. diff --git a/doc/sane-xerox_mfp.man b/doc/sane-xerox_mfp.man index 0ffa3e876..d68408609 100644 --- a/doc/sane-xerox_mfp.man +++ b/doc/sane-xerox_mfp.man @@ -20,7 +20,7 @@ For SCX\-4500W in network mode you need to specify .B tcp host_address [port] .RE .PP -The +The .B host_address is passed through resolver, thus can be a dotted quad or a name from /etc/hosts or resolvable through DNS. .SH FILES @@ -39,9 +39,9 @@ support dynamic loading). .B SANE_DEBUG_XEROX_MFP If the library was compiled with debug support enabled, this environment variable controls the debug level for this backend. Higher -debug levels increase the verbosity of the output. +debug levels increase the verbosity of the output. -Example: +Example: export SANE_DEBUG_XEROX_MFP=4 .SH LIMITATIONS @@ -49,7 +49,7 @@ Multicast autoconfiguration for LAN scanners is not implemented yet. IPv6 addres .SH BUGS AND SUPPORT If you have found a bug or need support please follow open\-source way of acquiring support via -mail\-lists http://www.sane\-project.org/mailing\-lists.html or SANE bug tracker +mail\-lists http://www.sane\-project.org/mailing\-lists.html or SANE bug tracker http://www.sane\-project.org/bugs.html .SH AUTHORS diff --git a/doc/sane.man b/doc/sane.man index 3eadf4240..8591dbf40 100644 --- a/doc/sane.man +++ b/doc/sane.man @@ -24,33 +24,33 @@ If you have trouble getting your scanner detected, read the PROBLEMS section. .SH TERMINOLOGY -An application that uses the +An application that uses the .B SANE -interface is called a +interface is called a .B SANE frontend. -A driver that implements the +A driver that implements the .B SANE interface is called a .B SANE backend. -A +A .B meta backend provides some means to manage one or more other backends. .SH "SOFTWARE PACKAGES" -The package +The package .RB ` sane\-backends ' -contains a lot of backends, documentation (including the +contains a lot of backends, documentation (including the .B SANE -standard), networking support, and the command line frontend +standard), networking support, and the command line frontend .RB ` scanimage '. -The frontends +The frontends .RB ` xscanimage "', `" xcam "', and `" scanadf ' are included in the package -.RB ` sane\-frontends '. +.RB ` sane\-frontends '. Both packages can be downloaded from the .B SANE -homepage +homepage .RI ( http://www.sane\-project.org/ ). Information about other frontends and backends can also be found on the .B SANE @@ -60,15 +60,15 @@ homepage. The following sections provide short descriptions and links to more information about several aspects of .B SANE. -A name with a number in parenthesis (e.g. +A name with a number in parenthesis (e.g. .RB ` sane\-dll (5)') -points to a manual page. In this case +points to a manual page. In this case .RB ` "man 5 sane\-dll" ' will display the page. Entries like .RI ` @DOCDIR@/sane.tex ' are references to text files that were copied to the .B SANE -documentation directory +documentation directory .RI ( @DOCDIR@/ ) during installation. Everything else is a URL to a resource on the web. @@ -79,9 +79,9 @@ can be found on the SANE homepage: .IR http://www.sane\-project.org/ . .TP .B SANE device lists -The +The .B SANE -device lists contain information about the status of +device lists contain information about the status of .B SANE support for a specific device. If your scanner is not listed there (either supported or unsupported), please contact us. See section HOW CAN YOU HELP @@ -100,9 +100,9 @@ unsubscribe: .TP .B SANE IRC channel The IRC (Internet Relay Chat) channel #sane can be found on the Freenode -network (irc.freenode.net). It's for discussing +network (irc.freenode.net). It's for discussing .B SANE -problems, talking about development and general +problems, talking about development and general .B SANE related chatting. Before asking for help, please read the other documentation mentioned in this manual page. The channel's topic is also used for @@ -127,13 +127,13 @@ For information about USB configuration see .SH "FRONTENDS AND MISCELLANEOUS PROGRAMS" .TP 2 .B scanimage -Command-line frontend. See +Command-line frontend. See .BR scanimage (1). .TP .B saned .B SANE network daemon that allows remote clients to access image acquisition devices -available on the local host. See +available on the local host. See .BR saned (8). .TP .B sane\-find\-scanner @@ -192,7 +192,7 @@ This backend supports several Avision based scanners. This includes the original Avision scanners (like AV 630, AV 620, ...) as well as the HP ScanJet 53xx and 74xx series, Fujitsu ScanPartner, some Mitsubishi and Minolta film-scanners. -See +See .BR sane\-avision (5) for details. .TP @@ -225,7 +225,7 @@ parallel port scanners. See for details. .TP .B cardscan -This backend provides support for Corex Cardscan USB scanners. See +This backend provides support for Corex Cardscan USB scanners. See .BR sane\-cardscan (5) for details. .TP @@ -260,7 +260,7 @@ and adf scanners. See for details. .TP .B genesys -The genesys backend provides support for several scanners based on the Genesys Logic +The genesys backend provides support for several scanners based on the Genesys Logic GL646, GL841, GL843, GL847 and GL124 chips like the Medion 6471 and Hewlett-Packard 2300c. See .BR sane\-genesys (5) @@ -363,7 +363,7 @@ for details. .TP .B microtek The microtek backend provides access to the "second generation" Microtek -scanners with SCSI-1 command set. See +scanners with SCSI-1 command set. See .BR sane\-microtek (5) for details. .TP @@ -515,7 +515,7 @@ for details. .TP .B umax_pp The sane\-umax_pp backend provides access to Umax parallel port flatbed scanners -and the HP 3200C. See +and the HP 3200C. See .BR sane\-umax_pp (5) for details. .TP @@ -565,7 +565,7 @@ backend. See .BR sane\-gphoto2 (5). .TP .B qcam -Backend for Connectix QuickCam cameras. See +Backend for Connectix QuickCam cameras. See .BR sane\-qcam (5). .TP .B stv680 @@ -589,7 +589,7 @@ backends by dynamic loading. See .BR sane\-dll (5). .TP .B net -The +The .B SANE network daemon saned provides access to scanners located on different computers in connection with the net backend. See @@ -634,9 +634,9 @@ and the list of projects in .IR @DOCDIR@/PROJECTS . .SH "CHANGING THE TOP-LEVEL BACKEND" -By default, all +By default, all .B SANE -backends (drivers) are loaded dynamically by the +backends (drivers) are loaded dynamically by the .B sane\-dll meta backend. If you have any questions about the dynamic loading, read @@ -655,8 +655,8 @@ It's not hard to write a backend. It can take some time, however. You should have basic knowledge of C and enough patience to work through the documentation and find out how your scanner works. Appended is a list of some documents that help to write backends -and frontends. -.PP +and frontends. +.PP The .B SANE standard defines the application programming interface (API) that is used to @@ -685,7 +685,7 @@ for projects that are planned or not yet included into the distribution and at our bug-tracking system: .IR http://www.http://www.sane\-project.org/bugs.html . .PP -There are some links on how to find out about the protocol of a scanner: +There are some links on how to find out about the protocol of a scanner: .IR http://www.meier\-geinitz.de/sane/misc/develop.html . .PP @@ -731,9 +731,9 @@ If your scanner (or other device) is not connected over the SCSI bus or USB, read the backend's manual page for details on how to set it up. .PP -Now your scanner is detected by the operating system but not by +Now your scanner is detected by the operating system but not by .BR SANE ? -Try +Try .BR "scanimage \-L" . If the scanner is not found, check that the backend's name is mentioned in .IR @CONFIGDIR@/dll.conf . @@ -741,7 +741,7 @@ Some backends are commented out by default. Remove the comment sign for your backend in this case. Also some backends aren't compiled at all if one of their prerequisites are missing. Examples include dc210, dc240, canon_pp, hpsj5s, gphoto2, pint, qcam, v4l, net, sm3600, snapscan, pnm. If you need one of these -backends and they aren't available, read the build instructions in the +backends and they aren't available, read the build instructions in the .B README file and the individual manual pages of the backends. .PP @@ -761,7 +761,7 @@ debugging. The environment variables are documented in the relevant manual pages. For example, to get the maximum amount of debug information when testing a Mustek SCSI scanner, set environment variables .BR SANE_DEBUG_DLL ", " SANE_DEBUG_MUSTEK ", and " SANE_DEBUG_SANEI_SCSI -to 128 and then invoke +to 128 and then invoke .B scanimage .B \-L . The debug messages for the dll backend tell if the mustek backend was found @@ -803,11 +803,11 @@ works and you want to use one of the graphical frontends like .BR xscanimage ", or" .B quiteinsane but those frontends don't detect your scanner? One reason may be that you -installed two versions of +installed two versions of .BR SANE . -E.g. the version that was installed by your distribution in +E.g. the version that was installed by your distribution in .I /usr -and one you installed from source in +and one you installed from source in .IR /usr/local/ . Make sure that only one version is installed. Another possible reason is, that your system's dynamic loader can't find the @@ -825,7 +825,7 @@ See also the documentation of the frontends. .SH "HOW CAN YOU HELP SANE" We appreciate any help we can get. Please have a look at our web page about -contributing to +contributing to .BR SANE : .I http://www.sane\-project.org/contrib.html .PP diff --git a/doc/sane.tex b/doc/sane.tex index 461179755..9534874a3 100644 --- a/doc/sane.tex +++ b/doc/sane.tex @@ -423,7 +423,7 @@ numbers. frontend/backend pair is compatible. The minor version and the build revision are used for informational and bug-fixing purposes only. - + \item[\code{\defn{SANE\_VERSION\_MAJOR}(\var{vc})}:] This macro returns the major version number component of the version code passed in argument \var{vc}. @@ -574,7 +574,7 @@ typedef char SANE_Char; Type \code{\defn{SANE\_String}} represents a text string as a sequence of C \verb|char| values. The end of the sequence is indicated by a -\verb|'\0'| (\defn{NUL}) character. +\verb|'\0'| (\defn{NUL}) character. \begin{quote} \begin{verbatim} typedef SANE_Char *SANE_String; @@ -702,20 +702,20 @@ will be expanded as need arises): \hline \multicolumn{2}{|c|}{\bf \defn{Vendor Strings}} \\ \hline\hline - \code{AGFA} & \code{Microtek} \\ - \code{Abaton} & \code{Minolta} \\ - \code{Acer} & \code{Mitsubishi} \\ - \code{Apple} & \code{Mustek} \\ - \code{Artec} & \code{NEC} \\ - \code{Avision} & \code{Nikon} \\ - \code{CANON} & \code{Plustek} \\ - \code{Connectix} & \code{Polaroid} \\ - \code{Epson} & \code{Relisys} \\ - \code{Fujitsu} & \code{Ricoh} \\ - \code{Hewlett-Packard} & \code{Sharp} \\ - \code{IBM} & \code{Siemens} \\ - \code{Kodak} & \code{Tamarack} \\ - \code{Lexmark} & \code{UMAX} \\ + \code{AGFA} & \code{Microtek} \\ + \code{Abaton} & \code{Minolta} \\ + \code{Acer} & \code{Mitsubishi} \\ + \code{Apple} & \code{Mustek} \\ + \code{Artec} & \code{NEC} \\ + \code{Avision} & \code{Nikon} \\ + \code{CANON} & \code{Plustek} \\ + \code{Connectix} & \code{Polaroid} \\ + \code{Epson} & \code{Relisys} \\ + \code{Fujitsu} & \code{Ricoh} \\ + \code{Hewlett-Packard} & \code{Sharp} \\ + \code{IBM} & \code{Siemens} \\ + \code{Kodak} & \code{Tamarack} \\ + \code{Lexmark} & \code{UMAX} \\ \code{Logitech} & \code{Noname} \\ \hline \end{tabular} @@ -823,29 +823,29 @@ in Table \ref{tab:valuetype}. \hline\hline \code{\defn{SANE\_TYPE\_BOOL}} & 0 & Option value is of type - \verb|SANE_Bool|. \\ + \verb|SANE_Bool|. \\ \code{\defn{SANE\_TYPE\_INT}} & 1 & Option value is of type - \verb|SANE_Int|. \\ + \verb|SANE_Int|. \\ \code{\defn{SANE\_TYPE\_FIXED}}&2 & Option value is of type - \verb|SANE_Fixed|. \\ + \verb|SANE_Fixed|. \\ \code{\defn{SANE\_TYPE\_STRING}}&3 & Option value is of type - \verb|SANE_String|. \\ + \verb|SANE_String|. \\ \code{\defn{SANE\_TYPE\_BUTTON}} & 4 & An option of this type has no value. Instead, setting an option of this type has an option-specific side-effect. For example, a button-typed option could be used by a backend to provide a means to select default values or to the tell an -automatic document feeder to advance to the next sheet of paper. \\ +automatic document feeder to advance to the next sheet of paper. \\ \code{\defn{SANE\_TYPE\_GROUP}} & 5 & An option of this type has no value. This type is used to group logically related options. A group option is in effect up to the point where another group option is encountered (or up to the end of the option list, if there are no other group options). For group options, only members \code{title} and -\code{type} are valid in the option descriptor. \\ +\code{type} are valid in the option descriptor. \\ \hline \end{tabular} @@ -945,14 +945,14 @@ capability bitset: \hline\hline \code{\defn{SANE\_CAP\_SOFT\_SELECT}} & 1 & The option - value can be set by a call to \code{sane\_con\-trol\_opt\-ion()}.\\ + value can be set by a call to \code{sane\_con\-trol\_opt\-ion()}.\\ \code{\defn{SANE\_CAP\_HARD\_SELECT}} & 2 & The option value can be set by user-intervention (e.g., by flipping a switch). The user-interface should prompt the user to execute the appropriate action to set such an option. This capability is mutually exclusive with SANE\_CAP\_SOFT\_SELECT (either one of them can be set, but not both - simultaneously). \\ + simultaneously). \\ \code{\defn{SANE\_CAP\_SOFT\_DETECT}} & 4 & The option value can be detected by software. If @@ -961,23 +961,23 @@ capability bitset: may or may not be set. If this capability is set but neither \code{SANE\_CAP\_SO\-FT\_SEL\-ECT} nor \code{SANE\_CAP\_HA\-RD\_SEL\-ECT} are, then there is no way to control the option. That is, the - option provides read-out of the current value only. \\ + option provides read-out of the current value only. \\ \code{\defn{SANE\_CAP\_EMULATED}} & 8 & If set, this capability indicates that an option is not directly supported by the device and is instead emulated in the backend. A sophisticated frontend may elect to use its own (presumably better) emulation in lieu of an emulated - option. \\ + option. \\ \code{\defn{SANE\_CAP\_AUTOMATIC}} & 16 & If set, this capability indicates that the backend (or the device) is capable to picking a reasonable option value automatically. For such options, it is possible to select automatic operation by calling \code{sane\_control\_option()} - with an action value of \code{SANE\_ACTION\_SET\_AUTO}. \\ + with an action value of \code{SANE\_ACTION\_SET\_AUTO}. \\ \code{\defn{SANE\_CAP\_INACTIVE}} & 32 & If set, this capability indicates that the option is not currently active (e.g., because it's - meaningful only if another option is set to some other value). \\ + meaningful only if another option is set to some other value). \\ \code{\defn{SANE\_CAP\_ADVANCED}} & 64 & If set, this capability indicates that the option should be @@ -985,7 +985,7 @@ capability bitset: displays such options in a less conspicuous way than regular options (e.g., a command line interface may list such options last or a graphical interface may make them available in a seperate ``advanced - settings'' dialog). + settings'' dialog). \\ \hline @@ -1045,7 +1045,7 @@ SANE_Range; specifies the quantization value. If $l$ is the minimum value, $u$ the maximum value and $q$ the (non-zero) quantization of a range, then the legal values are $v=k\cdot q+l$ for all non-negative - integer values of $k$ such that $v<=u$. \\ + integer values of $k$ such that $v<=u$. \\ \code{\defn{SANE\_CONSTRAINT\_WORD\_LIST}} & 2 & This constraint is applicable to integer and fixed-point valued options only. It constrains the @@ -1055,7 +1055,7 @@ SANE_Range; integer (\verb|SANE_Int|) that specifies the length of the list (not counting the length itself). The remaining elements in the list are interpreted according to the type of the option value - (\verb|SANE_TYPE_INT| or \verb|SANE_TYPE_FIXED|). \\ + (\verb|SANE_TYPE_INT| or \verb|SANE_TYPE_FIXED|). \\ \code{\defn{SANE\_CONSTRAINT\_STRING\_LIST}} & 3 & This constraint is applicable to string-valued options only. It constrains the option @@ -1288,7 +1288,7 @@ described in Table~\ref{tab:actions}. \code{\defn{SANE\_ACTION\_SET\_VALUE}} & 1 & Set option value. The option value passed through argument \code{v} may be modified by the - backend if the value cannot be set exactly. \\ + backend if the value cannot be set exactly. \\ \code{\defn{SANE\_ACTION\_SET\_AUTO}} & 2 & Turn on automatic mode. Backend or device will automatically select an appropriate value. This mode @@ -1862,7 +1862,7 @@ regarding these options: \item A frontend must work properly with any or all of these options missing. - + \end{itemize} \input{net.tex} diff --git a/doc/saned.man b/doc/saned.man index 7b0fa4ad7..34764f1fa 100644 --- a/doc/saned.man +++ b/doc/saned.man @@ -4,9 +4,9 @@ saned \- SANE network daemon .SH SYNOPSIS .B saned -.B [ \-a +.B [ \-a .I [ username ] -.B | \-d +.B | \-d .I [ n ] .B | \-s .I [ n ] @@ -22,10 +22,10 @@ The .B \-a flag requests that .B saned -run in standalone daemon mode. In this mode, +run in standalone daemon mode. In this mode, .B saned will detach from the console and run in the background, listening for incoming -client connections; +client connections; .B inetd is not required for .B saned @@ -59,7 +59,7 @@ is used, the debug messages will be printed to stderr while .B \-s requests using syslog. .PP -If +If .B saned is run from inetd, xinetd or systemd, no option can be given. .PP @@ -67,11 +67,11 @@ The .B \-h flag displays a short help message. .SH CONFIGURATION -First and foremost: +First and foremost: .B saned is not intended to be exposed to the internet or other non-trusted networks. Make sure that access is limited by tcpwrappers and/or a firewall -setup. Don't depend only on +setup. Don't depend only on .BR saned 's own authentication. Don't run .B saned @@ -81,7 +81,7 @@ install .B saned as setuid root. .PP -The +The .I saned.conf configuration file contains both options for the daemon and the access list. @@ -131,21 +131,21 @@ identical to ahost.com. .SH SERVER DAEMON CONFIGURATION For .B saned -to work properly in its default mode of operation, it is also necessary to -add the appropriate configuration for +to work properly in its default mode of operation, it is also necessary to +add the appropriate configuration for .I (x)inetd or systemd. (see below). Note that your inetd must support IPv6 if you -want to connect to saned over IPv6 ; xinetd, openbsd-inetd and systemd +want to connect to saned over IPv6 ; xinetd, openbsd-inetd and systemd are known to support IPv6, check the documentation for your inetd daemon. .PP -In the sections below the configuration for +In the sections below the configuration for .I inetd, xinetd and .I systemd are described in more detail. .PP -For the configurations below it is necessary to add a line of the following +For the configurations below it is necessary to add a line of the following form to .IR /etc/services : .PP @@ -153,7 +153,7 @@ form to sane\-port 6566/tcp # SANE network scanner daemon .RE .PP -The official IANA short name for port 6566 is "sane\-port". The older name +The official IANA short name for port 6566 is "sane\-port". The older name "sane" is now deprecated. .SH INETD CONFIGURATION It is required to add a single line to the inetd configuration file @@ -183,22 +183,22 @@ Note that both examples assume that there is a .B saned group and a .B saned -user. If you follow this example, please make sure that the +user. If you follow this example, please make sure that the access permissions on the special device are set such that .B saned can access the scanner (the program generally needs read and write access to scanner devices). .SH XINETD CONFIGURATION If xinetd is installed on your system instead of inetd the following example -for -.I /etc/xinetd.conf +for +.I /etc/xinetd.conf may be helpful: .PP .RS .ft CR .nf # default: off -# description: The sane server accepts requests +# description: The sane server accepts requests # for network access to a local scanner via the # network. service sane\-port @@ -214,14 +214,14 @@ service sane\-port .ft R .RE .SH SYSTEMD CONFIGURATION -Saned can be compiled with explicit systemd support. This +Saned can be compiled with explicit systemd support. This will allow logging debugging information to be forwarded to the systemd journal. The systemd support requires compilation with the systemd-devel package installed on the system. this is the preferred option. -Saned can be used wih systemd without the systemd integration -compiled in, but then logging of debug information is not supported. +Saned can be used wih systemd without the systemd integration +compiled in, but then logging of debug information is not supported. The systemd configuration is different for the 2 options, so both are described below. @@ -229,8 +229,8 @@ both are described below. for the systemd configuration we need to add 2 configuration files in .I /etc/systemd/system. .PP -The first file we need to add here is called -.I saned.socket. +The first file we need to add here is called +.I saned.socket. It shall have the following contents: .PP @@ -251,8 +251,8 @@ WantedBy=sockets.target .ft R .RE .PP -The second file to be added is -.I saned@.service +The second file to be added is +.I saned@.service with the following contents: .PP .RS @@ -269,7 +269,7 @@ Group=saned StandardInput=null StandardOutput=syslog StandardError=syslog -Environment=SANE_CONFIG_DIR=@CONFIGDIR@ +Environment=SANE_CONFIG_DIR=@CONFIGDIR@ # If you need to debug your configuration uncomment the next line and # change it as appropriate to set the desired debug options # Environment=SANE_DEBUG_DLL=255 SANE_DEBUG_BJNP=5 @@ -280,21 +280,21 @@ Also=saned.socket .ft R .RE .PP -You need to set an environment variable for +You need to set an environment variable for .B SANE_CONFIG_DIR pointing to the directory where saned can find its configuration files. -you will have to remove the # on the last line and set the variables -for the desired debugging information if required. Multiple variables -can be set by separating the assignments by spaces as shown in the +you will have to remove the # on the last line and set the variables +for the desired debugging information if required. Multiple variables +can be set by separating the assignments by spaces as shown in the example above. .PP -Unlike +Unlike .I (x)inetd , systemd allows debugging output from backends set using .B SANE_DEBUG_XXX to be captured. See the man-page for your backend to see what options are supported. -With the service unit as described above, the debugging output is +With the service unit as described above, the debugging output is forwarded to the system log. .SH Systemd configuration when saned is compiled without systemd support @@ -305,7 +305,7 @@ for systemd configuration for saned, we need to add 2 configuration files in .I /etc/systemd/system. .PP The first file we need to add here is called -.I saned.socket. +.I saned.socket. It is identical to the version for systemd with the support compiled in. It shall have the following contents: .PP diff --git a/doc/scanimage.man b/doc/scanimage.man index 4d47eb8a5..447314058 100644 --- a/doc/scanimage.man +++ b/doc/scanimage.man @@ -11,7 +11,7 @@ scanimage \- scan an image .RB [ \-i | \-\-icc\-profile .IR profile ] .RB [ \-L | \-\-list\-devices ] -.RB [ \-f | \-\-formatted\-device\-list +.RB [ \-f | \-\-formatted\-device\-list .IR format ] .RB [ \-b | \-\-batch .RI [= format ]] @@ -84,9 +84,9 @@ or .B \-\-device\-name options must be followed by a .B SANE -device-name like +device-name like .RI ` epson:/dev/sg0 ' -or +or .RI ` hp:/dev/usbscanner0 '. A (partial) list of available devices can be obtained with the .B \-\-list\-devices @@ -94,12 +94,12 @@ option (see below). If no device-name is specified explicitly, .B scanimage reads a device-name from the environment variable .BR SANE_DEFAULT_DEVICE . -If this variable is not set, +If this variable is not set, .B scanimage will attempt to open the first available device. .PP The -.B \-\-format +.B \-\-format .I format option selects how image data is written to standard output. .I format @@ -126,7 +126,7 @@ or option requests a (partial) list of devices that are available. The list is not complete since some devices may be available, but are not listed in any of the configuration files (which are typically stored -in directory +in directory .IR @CONFIGDIR@ ). This is particularly the case when accessing scanners through the network. If a device is not listed in a configuration file, the only way to access it is @@ -161,7 +161,7 @@ SCSI, produced by SHARP The .B \-\-batch* options provide the features for scanning documents using document -feeders. +feeders. .BR \-\-batch .RI [ format ] is used to specify the format of the filename that each page will be written @@ -177,11 +177,11 @@ selects the page number to start naming files with. If this option is not given, the counter will start at 1. .B \-\-batch\-count .I count -specifies the number of pages to attempt to scan. If not given, +specifies the number of pages to attempt to scan. If not given, scanimage will continue scanning until the scanner returns a state other than OK. Not all scanners with document feeders signal when the ADF is empty, use this command to work around them. -With +With .B \-\-batch\-increment .I increment you can change the amount that the number in the filename is incremented @@ -211,7 +211,7 @@ option requests that .B scanimage prints a progress counter. It shows how much image data of the current image has already been received by -.B scanimage +.B scanimage (in percent). .PP The @@ -265,7 +265,7 @@ level. .PP The .B \-B -option without argument changes the input buffer size from the default 32KB to 1MB. For finer grained control, use +option without argument changes the input buffer size from the default 32KB to 1MB. For finer grained control, use .B \-\-buffer-size= followed by the number of KB. .PP @@ -426,7 +426,7 @@ is possible to specify multiple such linear segments. For example, "[0]3-[2]3-[6]7,[7]10-[9]6" is equivalent to "3,3,3,4,5,6,7,10,8,6". The program .B gamma4scanimage -can be used to generate such gamma tables (see +can be used to generate such gamma tables (see .BR gamma4scanimage (1) for details). .RE @@ -440,7 +440,7 @@ for details). The description above is an example of an option that takes an arbitrary string value (which happens to be a filename). Again, the value in brackets show that the option is current set to the -filename +filename .BR /tmp/input.ppm . .RE diff --git a/doc/sceptre/s1200.txt b/doc/sceptre/s1200.txt index ade81db5b..0629e69eb 100644 --- a/doc/sceptre/s1200.txt +++ b/doc/sceptre/s1200.txt @@ -30,13 +30,13 @@ Vendor Spec 02 00 00 00 04 00 Get 4 bytes of status. Used to check the button. Default result when the button is not pressed - 06 00 00 00 + 06 00 00 00 INQUIRY result: - 06 00 02 02 30 00 00 10 4b 49 4e 50 4f 20 20 20 ....0...KINPO - 56 69 76 69 64 73 63 61 6e 20 53 31 32 30 20 20 Vividscan S120 - 53 31 33 20 20 20 20 20 02 01 00 00 4a 45 46 46 S13 ....JEFF + 06 00 02 02 30 00 00 10 4b 49 4e 50 4f 20 20 20 ....0...KINPO + 56 69 76 69 64 73 63 61 6e 20 53 31 32 30 20 20 Vividscan S120 + 53 31 33 20 20 20 20 20 02 01 00 00 4a 45 46 46 S13 ....JEFF ... MODE SEL @@ -55,15 +55,15 @@ SET WINDOW 24 00 00 00 00 00 00 00 52 00 The window size is always 0x52 bytes. The parameters look standard: - X/Y resolution | - - Upper left X,Y |- all three coded in 600 dpi units + - Upper left X,Y |- all three coded in 600 dpi units - Width, Length | - + The supported scan modes are: - lineart image comp=0, halftone=0, depth=1 - halftone image comp=0, haltone=1 to 4, depth=1 - grayscale image comp=2, halftone=0, depth=8 - color image comp=5, halftone=0, depth=24 - + Y resolution is not used (X is also used for Y) X resolution is limited to 600 (if above, scanner defaults to 600) Y resolution is limited to 1200 (if above, scanner defaults to 1200) diff --git a/doc/teco/teco1.txt b/doc/teco/teco1.txt index d555e9e57..47519fa52 100644 --- a/doc/teco/teco1.txt +++ b/doc/teco/teco1.txt @@ -6,8 +6,8 @@ Relisys RELI 2412 (no ADF, no transparency adapter) single pass scanner - 300*1200 dpi - 8.5*14 Inquiry: - 000: 06 00 02 02 30 00 00 10 52 45 4c 49 53 59 53 20 ....0...RELISYS - 016: 56 4d 33 35 33 30 2b 20 20 20 20 20 20 20 20 20 VM3530+ + 000: 06 00 02 02 30 00 00 10 52 45 4c 49 53 59 53 20 ....0...RELISYS + 016: 56 4d 33 35 33 30 2b 20 20 20 20 20 20 20 20 20 VM3530+ 032: 31 2e 30 38 31 2e 30 38 02 00 54 45 43 4f 20 56 1.081.08..TECO V 048: 4d 33 35 33 41 M353A Inquiry page 0x82 @@ -16,16 +16,16 @@ Inquiry page 0x82 AVEC Colour 2412 three pass scanner - 300*600 dpi - 8.5*14 - 000: 06 00 02 02 30 00 00 10 20 20 20 20 20 20 20 20 ....0... - 016: 49 6d 61 67 65 20 53 63 61 6e 6e 65 72 20 20 20 Image Scanner + 000: 06 00 02 02 30 00 00 10 20 20 20 20 20 20 20 20 ....0... + 016: 49 6d 61 67 65 20 53 63 61 6e 6e 65 72 20 20 20 Image Scanner 032: 31 2e 30 38 31 2e 30 38 02 00 54 45 43 4f 20 56 1.081.08..TECO V 048: 4d 33 35 32 41 M352A Avec Color Office 2400 (no ADF, no transparency adapter) three pass scanner - 300*600 dpi - 8.5*14 Inquiry: - 000: 06 00 02 02 30 00 00 10 20 20 20 20 20 20 20 20 ....0... - 016: 49 6d 61 67 65 20 53 63 61 6e 6e 65 72 20 20 20 Image Scanner + 000: 06 00 02 02 30 00 00 10 20 20 20 20 20 20 20 20 ....0... + 016: 49 6d 61 67 65 20 53 63 61 6e 6e 65 72 20 20 20 Image Scanner 032: 32 2e 30 34 32 2e 30 34 02 00 54 45 43 4f 20 56 2.042.04..TECO V 048: 4d 33 35 32 30 M3520 Inquiry page 0x82 @@ -33,8 +33,8 @@ Inquiry page 0x82 016: 20 56 32 2e 30 34 V2.04 RELI 4830 (no ADF, with transparency adapter) - 000: 06 00 02 02 30 00 00 10 52 45 4c 49 53 59 53 20 ....0...RELISYS - 016: 52 45 4c 49 20 34 38 33 30 20 20 20 20 20 20 20 RELI 4830 + 000: 06 00 02 02 30 00 00 10 52 45 4c 49 53 59 53 20 ....0...RELISYS + 016: 52 45 4c 49 20 34 38 33 30 20 20 20 20 20 20 20 RELI 4830 032: 31 2e 30 33 31 2e 30 33 02 00 54 45 43 4f 20 56 1.031.03..TECO V 048: 4d 34 35 34 32 M4542 Inquiry page 0x82 @@ -42,9 +42,9 @@ Inquiry page 0x82 016: 20 56 31 2e 30 33 V1.03 Dextra DF-600P - VM3510 - 000: 06 00 02 02 24 00 00 10 44 46 2D 36 30 30 4D 20 ....$...DF-600M - 016: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 - 032: 31 2E 31 37 31 2E 31 37 02 1.171.17. + 000: 06 00 02 02 24 00 00 10 44 46 2D 36 30 30 4D 20 ....$...DF-600M + 016: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 + 032: 31 2E 31 37 31 2E 31 37 02 1.171.17. /*--------------------------------------------------------------------------*/ @@ -54,13 +54,13 @@ SCSI commands supported by the RELISYS VM3530+: TEST UNIT READY 00 00 00 00 00 00 -REQ SENSE +REQ SENSE 03 00 00 00 12 00 VENDOR-09 09 00 00 78 00 00 - 3-4 = length of data to receive. Always 30720 bytes. - Probably 12 lines of calibration at 300dpi. + 3-4 = length of data to receive. Always 30720 bytes. + Probably 12 lines of calibration at 300dpi. 8.5*300*12=30600 VENDOR-0E (?) @@ -77,21 +77,21 @@ INQUIRY: page 0x82 (vendor specific) - real scanner name with version 0-3 = page header - 4 = string length + 4 = string length 5-21 = real scanner name with version MODE SELECT 15 10 00 00 18 00 always sends: - 00 00 00 00 00 00 00 08 00 00 00 00 00 00 00 01 - 03 06 02 00 00 01 00 00 + 00 00 00 00 00 00 00 08 00 00 00 00 00 00 00 01 + 03 06 02 00 00 01 00 00 SCAN 1B 00 00 00 00 00 SET WINDOW -24 00 00 00 00 00 00 00 63 00 +24 00 00 00 00 00 00 00 63 00 Total length is 99 07 = length (99-8 = 91) 10-11 = X Resolution @@ -116,7 +116,7 @@ Total length is 99 0x06 = 8 X 8 Smooth 0x07 = 8 X 8 Horizontal 0x08 = 8 X 8 Vertical - 37 = + 37 = 0x80 = RIF (VM353A only?) 63 = calibration? 0x00 yes @@ -127,9 +127,9 @@ Total length is 99 93 = 0x80 = ? (seems to activate a contrast value on VM353A) - 37, 55, 57, 59, 61, 65, 67, 69, 71, 73, 75, 77, 79 = 0x80 + 37, 55, 57, 59, 61, 65, 67, 69, 71, 73, 75, 77, 79 = 0x80 85, 89, 93, 97 = 0xff - + READ 28 00 00 00 00 00 00 00 3E 00 6-8 = length @@ -147,10 +147,10 @@ GET DATA BUFFER STATUS returned buffer is 0x10 bytes long. 0-2 = additional length (0x10-3 = 0x0D) 3 = reserved(?) - 8 = ? + 8 = ? 9-11 = filled data buffer 12-13 = number of lines (constant during a scan) - 14-15 = bytes per line (constant during a scan) + 14-15 = bytes per line (constant during a scan) /*--------------------------------------------------------------------------*/ diff --git a/doc/teco/teco2.txt b/doc/teco/teco2.txt index 5b64a837d..877f46346 100644 --- a/doc/teco/teco2.txt +++ b/doc/teco/teco2.txt @@ -4,15 +4,15 @@ INQUIRY TECO VM3564 (1) -000: 06 00 02 02 43 00 00 10 52 45 4c 49 53 59 53 20 ....C...RELISYS -016: 41 56 45 43 20 49 49 20 53 33 20 20 20 20 20 20 AVEC II S3 +000: 06 00 02 02 43 00 00 10 52 45 4c 49 53 59 53 20 ....C...RELISYS +016: 41 56 45 43 20 49 49 20 53 33 20 20 20 20 20 20 AVEC II S3 032: 31 2e 30 37 31 2e 30 37 00 01 54 45 43 4f 20 56 1.071.07..TECO V 048: 4d 33 35 36 34 20 00 01 01 2c 00 01 02 58 09 f6 M3564 ...,...X.. 064: 0d af 01 2c 00 08 01 00 ...,.... TECO VM3564 (2) -000: 06 00 02 02 43 00 00 10 52 45 4c 49 53 59 53 20 ....C...RELISYS -016: 41 56 45 43 20 49 49 20 53 33 20 20 20 20 20 20 AVEC II S3 +000: 06 00 02 02 43 00 00 10 52 45 4c 49 53 59 53 20 ....C...RELISYS +016: 41 56 45 43 20 49 49 20 53 33 20 20 20 20 20 20 AVEC II S3 032: 31 2e 30 39 31 2e 30 39 00 01 54 45 43 4f 20 56 1.091.09..TECO V 048: 4d 33 35 36 34 20 00 01 01 2c 00 01 02 58 09 f6 M3564 ...,...X.. 064: 0d af 01 2c 00 08 01 00 ...,.... @@ -25,21 +25,21 @@ TECO VM356A (1) 064: 0d af 01 2c 00 08 01 00 ...,.... TECO VM356A (2) -000: 06 00 02 02 43 00 00 10 50 72 69 6d 61 78 20 20 ....C...Primax -016: 4a 65 77 65 6c 20 20 20 20 20 20 20 20 20 20 20 Jewel +000: 06 00 02 02 43 00 00 10 50 72 69 6d 61 78 20 20 ....C...Primax +016: 4a 65 77 65 6c 20 20 20 20 20 20 20 20 20 20 20 Jewel 032: 31 2e 30 31 31 2e 30 31 00 01 54 45 43 4f 20 56 1.011.01..TECO V 048: 4d 33 35 36 41 20 00 01 01 2c 00 01 02 58 09 f6 M356A ...,...X.. 064: 0d af 01 2c 00 08 01 00 ...,.... TECO VM3575 -000: 06 00 02 02 43 00 00 00 20 20 20 20 20 20 20 20 ....C... -016: 46 6c 61 74 62 65 64 20 53 63 61 6e 6e 65 72 20 Flatbed Scanner +000: 06 00 02 02 43 00 00 00 20 20 20 20 20 20 20 20 ....C... +016: 46 6c 61 74 62 65 64 20 53 63 61 6e 6e 65 72 20 Flatbed Scanner 032: 31 2e 30 33 31 2e 30 33 00 01 54 45 43 4f 20 56 1.031.03..TECO V 048: 4d 33 35 37 35 20 00 01 01 2c 00 01 02 58 09 f6 M3575 ...,...X.. 064: 0d af 01 2c 00 08 01 00 ...,.... TECO VM656A -000: 06 00 02 02 43 00 00 00 52 45 4c 49 53 59 53 20 ....C...RELISYS +000: 06 00 02 02 43 00 00 00 52 45 4c 49 53 59 53 20 ....C...RELISYS 016: 41 50 4f 4c 4c 4f 20 45 78 70 72 65 73 73 20 36 APOLLO Express 6 032: 31 2e 30 33 31 2e 30 33 00 01 54 45 43 4f 20 56 1.031.03..TECO V 048: 4d 36 35 36 41 00 01 01 2c 00 01 02 58 09 f6 0d M656A...,...X... @@ -53,8 +53,8 @@ TECO VM6575 064: 0d af 01 2c 00 08 01 00 ...,.... TECO VM6586 -000: 06 00 02 02 43 00 00 00 20 20 20 20 20 20 20 20 ....C... -016: 46 6c 61 74 62 65 64 20 53 63 61 6e 6e 65 72 20 Flatbed Scanner +000: 06 00 02 02 43 00 00 00 20 20 20 20 20 20 20 20 ....C... +016: 46 6c 61 74 62 65 64 20 53 63 61 6e 6e 65 72 20 Flatbed Scanner 032: 33 2e 30 31 33 2e 30 31 00 01 54 45 43 4f 20 56 3.013.01..TECO V 048: 4d 36 35 38 36 20 00 01 01 2c 00 01 02 58 09 f6 M6586 ...,...X.. 064: 0d af 01 2c 00 08 01 00 ...,.... @@ -93,7 +93,7 @@ Set calibration. Apparently the line is computed from the calibration lines. It INQUIRY -12 00 00 00 48 00 +12 00 00 00 48 00 standard inquiry 72 bytes 32-39: firmware version @@ -123,8 +123,8 @@ SET WINDOW 24 00 00 00 00 00 00 00 35 00 (VM3575) 24 00 00 00 00 00 00 00 38 00 (VM6586) -Total length is - 07 = length +Total length is + 07 = length VM3575 53-8 = 45 VM6586 56-8 = 48 VM3552 69-8 = 61 @@ -142,11 +142,11 @@ Total length is 34 = bit depth? - invariant, always 8 36 = (vm6586 only ?) halftone pattern ? 1 = type 1 dithering - 37 = + 37 = 0x80 = RIF? 48 = color channel to use if scan mode is 0 or 2: - 0x00 = red + 0x00 = red 0x01 = green 0x02 = blue if scan mode is 05 -> ignored @@ -161,10 +161,10 @@ Total length is READ 28 00 00 00 00 19 00 1f 0e 00 5 = number of lines to read - 7-8 = buffer size. + 7-8 = buffer size. Always number of lines to read * size of a line. 0x2000 appears to be the upper limit - + SEND 2A 00 03 00 00 04 00 0C 00 00 @@ -194,7 +194,7 @@ GET DATA BUFFER STATUS 7 = ? always 0x14 11 = bit 7 - (maybe) scanner is ready to send data 12-13 = number of lines (constant during a scan) - 14-15 = bytes per line (constant during a scan) + 14-15 = bytes per line (constant during a scan) 16-17 = garbage (the command only returns 0x10 bytes) @@ -236,31 +236,31 @@ TECO VM656A reads 8 lines of calibration TECO VM6586 ?? Algorithms used (text from Alex Wulms): -The old algorithm was based on the assumption that the calibration value needs -to be an offset, to go from the value obtained during input to the average +The old algorithm was based on the assumption that the calibration value needs +to be an offset, to go from the value obtained during input to the average value (0x800). -E.g., if the input value is 0x800, the calibration value must be 0x800 (0x1000 +E.g., if the input value is 0x800, the calibration value must be 0x800 (0x1000 - 0x800). -Likewise, if the input value is 0x700, the calibration value must be 0x900 +Likewise, if the input value is 0x700, the calibration value must be 0x900 (0x1000 - 0x700) And if the input value is 0x600, the calibration value must be 0xA00 -The new algorithm is based on the assumption that the calibration needs to be -a multiplication factor, to compensate for the too strong or too weak pixel -in the sensor. Again, we want to obtain the average value (approximately +The new algorithm is based on the assumption that the calibration needs to be +a multiplication factor, to compensate for the too strong or too weak pixel +in the sensor. Again, we want to obtain the average value (approximately 0x800) for every pixel read during calibration. -E.g., if the input value is 0x800, the calibration value must be 0x800 +E.g., if the input value is 0x800, the calibration value must be 0x800 (0x800*0x800 / 0x800). -Likewise, if the input value is 0x700, the calibration value must be 0x924 +Likewise, if the input value is 0x700, the calibration value must be 0x924 (0x800*0x800 / 0x700). -And if the input value is 0x600, the calibration value must 0xAAA (0x800*0x800 +And if the input value is 0x600, the calibration value must 0xAAA (0x800*0x800 / 0x600) -Though, carefull comparison with scans done under windows has shown that the -factor is slightly different from 0x800*0x800(=0x400000) but in stead it -seems to be approximately 0x40302f (which would mean that the average value +Though, carefull comparison with scans done under windows has shown that the +factor is slightly different from 0x800*0x800(=0x400000) but in stead it +seems to be approximately 0x40302f (which would mean that the average value is approximately 0x803 in stead of 0x800). Hope this is clarifies the new algorithm. diff --git a/doc/teco/teco3.txt b/doc/teco/teco3.txt index bc6391f70..959d04f11 100644 --- a/doc/teco/teco3.txt +++ b/doc/teco/teco3.txt @@ -7,7 +7,7 @@ sharing features of both. Hence a third backend. PIOTECH 3024 (TECO Scorpio/Taurus Infinity VM3552): - 000: 06 00 02 02 43 00 00 10 20 20 20 20 20 20 20 20 ....C... + 000: 06 00 02 02 43 00 00 10 20 20 20 20 20 20 20 20 ....C... 016: 46 6c 61 74 2d 62 65 64 20 73 63 61 6e 6e 65 72 Flat-bed scanner 032: 35 2e 30 38 35 2e 30 38 03 02 54 45 43 4f 20 56 5.085.08..TECO V 048: 4d 33 35 35 32 20 00 01 01 2c 00 01 04 b0 09 f6 M3552 ...,...... @@ -41,13 +41,13 @@ SCSI commands supported by the RELISYS VM3530+: TEST UNIT READY 00 00 00 00 00 00 -REQ SENSE +REQ SENSE 03 00 00 00 12 00 VENDOR-09 09 00 00 78 00 00 - 3-4 = length of data to receive. Always 30720 bytes. - Probably 12 lines of calibration at 300dpi. + 3-4 = length of data to receive. Always 30720 bytes. + Probably 12 lines of calibration at 300dpi. 8.5*300*12=30600 VENDOR-0E (?) @@ -91,7 +91,7 @@ Total length is 99 0x06 = 8 X 8 Smooth 0x07 = 8 X 8 Horizontal 0x08 = 8 X 8 Vertical - 37 = + 37 = 0x80 = RIF ? 48 = color channel to use if scan mode is 0 or 2: @@ -105,7 +105,7 @@ Total length is 99 02 = no 53, 57, 61, 65: 0xff - + READ 28 00 00 00 00 00 00 00 3E 00 6-8 = length @@ -130,7 +130,7 @@ GET DATA BUFFER STATUS 6-8 = scanner memory (with no RAM, it is 32KB on the VM3552) 9-11 = filled data buffer 12-13 = number of lines (constant during a scan) - 14-15 = bytes per line (constant during a scan) + 14-15 = bytes per line (constant during a scan) 16 = ? 17 = in color mode, 0x07 seems to means to the colors are shifted and given by rasters. 0x00 seems to mean that there is no diff --git a/doc/umax/sane-umax-advanced-options-doc.html b/doc/umax/sane-umax-advanced-options-doc.html index dd2277b46..fa2995223 100644 --- a/doc/umax/sane-umax-advanced-options-doc.html +++ b/doc/umax/sane-umax-advanced-options-doc.html @@ -64,7 +64,7 @@ Supported scanners:
  • XSane homepage

  • - +
    diff --git a/doc/umax/sane-umax-config-doc.html b/doc/umax/sane-umax-config-doc.html index c5f43b146..a26907941 100644 --- a/doc/umax/sane-umax-config-doc.html +++ b/doc/umax/sane-umax-config-doc.html @@ -194,7 +194,7 @@ with the calibration please enable debug output.

    calibration-full-ccd:
    The calibration can be done for each element of the CCD (1) -or for each pixel of the requested image(0). +or for each pixel of the requested image(0). The value -1 enables the value defined in the driver.

    calibration-width-offset:
    @@ -205,7 +205,7 @@ The value -1 enables the value defined in the driver. calibration-bytes-pixel:
    Some scanners use 1 byte calibration data although the scanner supports more than 8 bits/pixel. You can define -1 or 2 bytes per pixel calinration data. +1 or 2 bytes per pixel calinration data. The value -1 enables the value defined in the driver.

    invert-shading-data:
    diff --git a/doc/umax/sane-umax-standard-options-doc.html b/doc/umax/sane-umax-standard-options-doc.html index da0ade31a..fad212641 100644 --- a/doc/umax/sane-umax-standard-options-doc.html +++ b/doc/umax/sane-umax-standard-options-doc.html @@ -64,7 +64,7 @@ Supported scanners:

  • XSane homepage

  • - +
    diff --git a/doc/umax/umax.CHANGES b/doc/umax/umax.CHANGES index 77d8d6217..9239127d7 100644 --- a/doc/umax/umax.CHANGES +++ b/doc/umax/umax.CHANGES @@ -101,7 +101,7 @@ sane-0.6 / 0.61 / 0.62 -> 0.63 * added support for each color (R,G,B) for highlight and shadow - * added "Astra 1200S" and "UC840" as supported + * added "Astra 1200S" and "UC840" as supported * added bad bugfix for preview-problem with S6E (in umax-scsi.c function start_scan) @@ -344,7 +344,7 @@ sane-0.70/0.71 -> 0.72 * combined bind for highlight, shadow, analog-gamma and new exposure time functions to rgb-bind - + * added set_WD_line_arrangement(buffer_r, WD_line_arrengement_by_driver); if driver is doing color-ordering from line to pixel @@ -423,11 +423,11 @@ sane-0.73 -> 0.74 * added sigterm_handler for umax_reader_process changed sane_canel, do_canel and do_eof(=close_pipe), cancel now works! - + * changed trim_rowbufsize that made problems with SGI, there has been an overflow because of big buffersize - + sane-0.74 -> 1.00 (build 0) --------------------------- @@ -682,7 +682,7 @@ build-15 -> build-16 * OPT_SOURCE: removed change of width/height and "*info |= SANE_INFO_RELOAD_PARAMS;" from get_value to set_value and added "*info |= SANE_INFO_RELOAD_OPTIONS;" - + build-16 -> build-17 -------------------- @@ -782,7 +782,7 @@ build-21 -> build-22 scsi-read commands, it also is possible to give bothe scanners different scsi command queueing depth). - * prepared replacement of pipe by sanei_ipc_* routines + * prepared replacement of pipe by sanei_ipc_* routines * added routines umax_get_lamp_status and umax_set_lamp_status @@ -826,7 +826,7 @@ build-22 -> build-23 * for Astra 2200 selection for different x/y resolutions is disabled - + build-23 -> build-24 (sane-1.0.4) -------------------- @@ -837,8 +837,8 @@ build-23 -> build-24 (sane-1.0.4) * enabled lamp control for Astra 2100S * Added warning in sane_control_option if option could not be set - - + + build-24 -> build-25 -------------------- @@ -906,7 +906,7 @@ build-24 -> build-25 * added #define SANE_I18N(text) text to umax.c. This is to mark the backend specific texts that shall be translated by the frontend - + build-25 -> build-26 -------------------- @@ -925,11 +925,11 @@ build-25 -> build-26 * changed some static unsigned int to static int - * sane_exit does free devlist + * sane_exit does free devlist * added some options for Powerlook 3000 - still is not completly supported - + build-26 -> build-27 -------------------- @@ -940,7 +940,7 @@ build-26 -> build-27 * changed default minimum scsi buffer size from 64KB to 32 KB - + build-27 -> build-28 -------------------- @@ -967,7 +967,7 @@ build-27 -> build-28 * added Heidelberg Linoscan 1400 "HDM LS4H1S" as supported scanner - + build-28 -> build-29 -------------------- @@ -1026,10 +1026,10 @@ build-32 -> build-33 * added USB support for Astra 2200 thanks to Frank Zago for creating umax-usb.c and suggesting several changes to umax.c - + * added umax.conf option "connection-type", values: 1=scsi, 2=usb - * added umax.conf device selection "usb 0x1606 0x0230" (usb vendor_id product_id) + * added umax.conf device selection "usb 0x1606 0x0230" (usb vendor_id product_id) * removed #ifdef HAVE_SANEI_IPC parts (SANEI_IPC was never defined) diff --git a/doc/umax/umax.FAQ b/doc/umax/umax.FAQ index 0901a2cbd..2bbdf613e 100644 --- a/doc/umax/umax.FAQ +++ b/doc/umax/umax.FAQ @@ -39,7 +39,7 @@ A: There are at least two kind of scsi controller cards that On linux you may have the chance to get it work with the recent g_NCR5380-driver. The card does not have IRQ/DMA. - Try the following option for kernel: dtc3181e=0x280,255 + Try the following option for kernel: dtc3181e=0x280,255 or use the following command: insmod g_NCR5380 ncr_irq=255 ncr_addr=0x280 dtc3181e=1 diff --git a/frontend/saned.c b/frontend/saned.c index 3bb99bb91..2fc332169 100644 --- a/frontend/saned.c +++ b/frontend/saned.c @@ -87,7 +87,7 @@ #if defined(HAVE_SYS_POLL_H) && defined(HAVE_POLL) # include #else -/* +/* * This replacement poll() using select() is only designed to cover * our needs in run_standalone(). It should probably be extended... */ @@ -203,13 +203,13 @@ static AvahiEntryGroup *avahi_group = NULL; (((const uint32_t *) (a))[0] == 0 \ && ((const uint32_t *) (a))[1] == 0 \ && ((const uint32_t *) (a))[2] == 0 \ - && ((const uint32_t *) (a))[3] == htonl (1)) + && ((const uint32_t *) (a))[3] == htonl (1)) # endif # ifndef IN6_IS_ADDR_V4MAPPED # define IN6_IS_ADDR_V4MAPPED(a) \ ((((const uint32_t *) (a))[0] == 0) \ && (((const uint32_t *) (a))[1] == 0) \ - && (((const uint32_t *) (a))[2] == htonl (0xffff))) + && (((const uint32_t *) (a))[2] == htonl (0xffff))) # endif #endif /* ENABLE_IPV6 */ @@ -402,7 +402,7 @@ auth_callback (SANE_String_Const res, break; default: - DBG (DBG_WARN, + DBG (DBG_WARN, "auth_callback: called for unexpected request %d (resource=%s)\n", current_request, res); break; @@ -430,7 +430,7 @@ auth_callback (SANE_String_Const res, { DBG (DBG_WARN, "auth_callback: bad procedure number %d " - "(expected: %d, resource=%s)\n", procnum, SANE_NET_AUTHORIZE, + "(expected: %d, resource=%s)\n", procnum, SANE_NET_AUTHORIZE, res); return; } @@ -565,7 +565,7 @@ check_v4_in_range (struct sockaddr_in *sin, char *base_ip, char *netmask) int cidr; int i, err; char *end; - uint32_t mask; + uint32_t mask; struct sockaddr_in *base; struct addrinfo hints; struct addrinfo *res; @@ -573,7 +573,7 @@ check_v4_in_range (struct sockaddr_in *sin, char *base_ip, char *netmask) cidr = -1; cidr = strtol (netmask, &end, 10); - + /* Sanity check on the cidr value */ if ((cidr < 0) || (cidr > 32) || (end == netmask)) { @@ -584,13 +584,13 @@ check_v4_in_range (struct sockaddr_in *sin, char *base_ip, char *netmask) mask = 0; cidr -= 8; - /* Build a bitmask out of the CIDR value */ + /* Build a bitmask out of the CIDR value */ for (i = 3; cidr >= 0; i--) { mask |= (0xff << (8 * i)); cidr -= 8; } - + if (cidr < 0) mask |= (cidrtomask[cidr + 8] << (8 * i)); @@ -600,7 +600,7 @@ check_v4_in_range (struct sockaddr_in *sin, char *base_ip, char *netmask) memset (&hints, 0, sizeof (struct addrinfo)); hints.ai_flags = AI_NUMERICHOST; hints.ai_family = PF_INET; - + err = getaddrinfo (base_ip, NULL, &hints, &res); if (err) { @@ -616,9 +616,9 @@ check_v4_in_range (struct sockaddr_in *sin, char *base_ip, char *netmask) */ if ((base->sin_addr.s_addr & mask) == (sin->sin_addr.s_addr & mask)) ret = SANE_TRUE; - + freeaddrinfo (res); - + return ret; } @@ -649,17 +649,17 @@ check_v6_in_range (struct sockaddr_in6 *sin6, char *base_ip, char *netmask) memset (mask, 0, (16 * sizeof (unsigned int))); cidr -= 8; - + /* Build a bitmask out of the CIDR value */ for (i = 0; cidr >= 0; i++) { mask[i] = 0xff; cidr -= 8; } - + if (cidr < 0) mask[i] = cidrtomask[cidr + 8]; - + /* get a sockaddr_in6 representing the base IP address */ memset (&hints, 0, sizeof (struct addrinfo)); hints.ai_flags = AI_NUMERICHOST; @@ -686,9 +686,9 @@ check_v6_in_range (struct sockaddr_in6 *sin6, char *base_ip, char *netmask) break; } } - + freeaddrinfo (res); - + return ret; } # endif /* ENABLE_IPV6 */ @@ -699,12 +699,12 @@ check_v4_in_range (struct in_addr *inaddr, struct in_addr *base, char *netmask) int cidr; int i; char *end; - uint32_t mask; + uint32_t mask; SANE_Bool ret = SANE_FALSE; cidr = -1; cidr = strtol (netmask, &end, 10); - + /* sanity check on the cidr value */ if ((cidr < 0) || (cidr > 32) || (end == netmask)) { @@ -714,14 +714,14 @@ check_v4_in_range (struct in_addr *inaddr, struct in_addr *base, char *netmask) mask = 0; cidr -= 8; - + /* Build a bitmask out of the CIDR value */ for (i = 3; cidr >= 0; i--) { mask |= (0xff << (8 * i)); cidr -= 8; } - + if (cidr < 0) mask |= (cidrtomask[cidr + 8] << (8 * i)); @@ -733,7 +733,7 @@ check_v4_in_range (struct in_addr *inaddr, struct in_addr *base, char *netmask) */ if ((base->s_addr & mask) == (inaddr->s_addr & mask)) ret = SANE_TRUE; - + return ret; } #endif /* SANED_USES_AF_INDEP */ @@ -801,7 +801,7 @@ check_host (int fd) memset (&hints, 0, sizeof (struct addrinfo)); hints.ai_flags = AI_NUMERICHOST; hints.ai_family = PF_INET; - + err = getaddrinfo (remote_ipv4, NULL, &hints, &res); if (err) { @@ -901,13 +901,13 @@ check_host (int fd) { DBG (DBG_DBG, "check_host: local hostname(s) (from DNS): %s\n", resp->ai_canonname); - + err = getnameinfo (resp->ai_addr, resp->ai_addrlen, text_addr, sizeof (text_addr), NULL, 0, NI_NUMERICHOST); if (err) strncpy (text_addr, "[error]", 8); -#ifdef ENABLE_IPV6 +#ifdef ENABLE_IPV6 if ((strcasecmp (text_addr, remote_ip) == 0) || ((IPv4map == SANE_TRUE) && (strcmp (text_addr, remote_ipv4) == 0))) #else @@ -915,18 +915,18 @@ check_host (int fd) #endif /* ENABLE_IPV6 */ { DBG (DBG_MSG, "check_host: remote host has same addr as local: access granted\n"); - + freeaddrinfo (res); res = NULL; return SANE_STATUS_GOOD; } } - + freeaddrinfo (res); res = NULL; - - DBG (DBG_DBG, + + DBG (DBG_DBG, "check_host: remote host doesn't have same addr as local\n"); } @@ -947,8 +947,8 @@ check_host (int fd) config_file_names[j], strerror (errno)); continue; } - - while (!access_ok && sanei_config_read (config_line_buf, + + while (!access_ok && sanei_config_read (config_line_buf, sizeof (config_line_buf), fp)) { config_line = config_line_buf; /* from now on, use a pointer */ @@ -993,7 +993,7 @@ check_host (int fd) if (strcmp (config_line, "+") == 0) { access_ok = 1; - DBG (DBG_DBG, + DBG (DBG_DBG, "check_host: access granted from any host (`+')\n"); } /* compare remote_ip (remote IP address) to the config_line */ @@ -1033,7 +1033,7 @@ check_host (int fd) memset (&hints, 0, sizeof (struct addrinfo)); hints.ai_flags = AI_NUMERICHOST; hints.ai_family = PF_INET; - + err = getaddrinfo (remote_ipv4, NULL, &hints, &res); if (err) DBG (DBG_DBG, "check_host: getaddrinfo() failed: %s\n", gai_strerror (err)); @@ -1044,7 +1044,7 @@ check_host (int fd) if ((SS_FAMILY(remote_address.ss) == AF_INET) || (IPv4map == SANE_TRUE)) { - + if (check_v4_in_range (sin, config_line, netmask)) { DBG (DBG_DBG, "check_host: access granted from IP address %s (in subnet %s/%s)\n", @@ -1056,7 +1056,7 @@ check_host (int fd) /* restore the old sin pointer */ sin = &remote_address.sin; } - + if (res != NULL) { freeaddrinfo (res); @@ -1086,11 +1086,11 @@ check_host (int fd) #else hints.ai_family = PF_INET; #endif /* ENABLE_IPV6 */ - + err = getaddrinfo (config_line, NULL, &hints, &res); if (err) { - DBG (DBG_DBG, + DBG (DBG_DBG, "check_host: getaddrinfo for `%s' failed: %s\n", config_line, gai_strerror (err)); DBG (DBG_MSG, "check_host: entry isn't an IP address " @@ -1105,19 +1105,19 @@ check_host (int fd) sizeof (text_addr), NULL, 0, NI_NUMERICHOST); if (err) strncpy (text_addr, "[error]", 8); - - DBG (DBG_MSG, - "check_host: DNS lookup returns IP address: %s\n", - text_addr); - -#ifdef ENABLE_IPV6 + + DBG (DBG_MSG, + "check_host: DNS lookup returns IP address: %s\n", + text_addr); + +#ifdef ENABLE_IPV6 if ((strcasecmp (text_addr, remote_ip) == 0) || ((IPv4map == SANE_TRUE) && (strcmp (text_addr, remote_ipv4) == 0))) #else if (strcmp (text_addr, remote_ip) == 0) #endif /* ENABLE_IPV6 */ access_ok = 1; - + if (access_ok) break; } @@ -1128,10 +1128,10 @@ check_host (int fd) } fclose (fp); } - + if (access_ok) return SANE_STATUS_GOOD; - + return SANE_STATUS_ACCESS_DENIED; } @@ -1150,7 +1150,7 @@ check_host (int fd) char hostname[MAXHOSTNAMELEN]; char *r_hostname; static struct in_addr config_line_address; - + int len; FILE *fp; @@ -1164,7 +1164,7 @@ check_host (int fd) } r_hostname = inet_ntoa (sin.sin_addr); remote_ip = strdup (r_hostname); - DBG (DBG_WARN, "check_host: access by remote host: %s\n", + DBG (DBG_WARN, "check_host: access by remote host: %s\n", remote_ip); /* Save remote address for check of control and data connections */ memcpy (&remote_address, &sin.sin_addr, sizeof (remote_address)); @@ -1203,7 +1203,7 @@ check_host (int fd) { DBG (DBG_DBG, "check_host: local hostname (from DNS): %s\n", he->h_name); - + if ((he->h_length == 4) || (he->h_addrtype == AF_INET)) { if (!inet_ntop (he->h_addrtype, he->h_addr_list[0], text_addr, @@ -1211,9 +1211,9 @@ check_host (int fd) strcpy (text_addr, "[error]"); DBG (DBG_DBG, "check_host: local host address (from DNS): %s\n", text_addr); - if (memcmp (he->h_addr_list[0], &remote_address.s_addr, 4) == 0) + if (memcmp (he->h_addr_list[0], &remote_address.s_addr, 4) == 0) { - DBG (DBG_MSG, + DBG (DBG_MSG, "check_host: remote host has same addr as local: " "access accepted\n"); return SANE_STATUS_GOOD; @@ -1246,8 +1246,8 @@ check_host (int fd) config_file_names[j], strerror (errno)); continue; } - - while (!access_ok && sanei_config_read (config_line_buf, + + while (!access_ok && sanei_config_read (config_line_buf, sizeof (config_line_buf), fp)) { config_line = config_line_buf; /* from now on, use a pointer */ @@ -1275,14 +1275,14 @@ check_host (int fd) if (strcmp (config_line, "+") == 0) { access_ok = 1; - DBG (DBG_DBG, + DBG (DBG_DBG, "check_host: access accepted from any host (`+')\n"); } else { if (inet_pton (AF_INET, config_line, &config_line_address) > 0) { - if (memcmp (&remote_address.s_addr, + if (memcmp (&remote_address.s_addr, &config_line_address.s_addr, 4) == 0) access_ok = 1; else if (netmask != NULL) @@ -1297,13 +1297,13 @@ check_host (int fd) } else { - DBG (DBG_DBG, + DBG (DBG_DBG, "check_host: inet_pton for `%s' failed\n", config_line); he = gethostbyname (config_line); if (!he) { - DBG (DBG_DBG, + DBG (DBG_DBG, "check_host: gethostbyname for `%s' failed: %s\n", config_line, hstrerror (h_errno)); DBG (DBG_MSG, "check_host: entry isn't an IP address " @@ -1313,10 +1313,10 @@ check_host (int fd) if (!inet_ntop (he->h_addrtype, he->h_addr_list[0], text_addr, sizeof (text_addr))) strcpy (text_addr, "[error]"); - DBG (DBG_MSG, + DBG (DBG_MSG, "check_host: DNS lookup returns IP address: %s\n", text_addr); - if (memcmp (&remote_address.s_addr, + if (memcmp (&remote_address.s_addr, he->h_addr_list[0], 4) == 0) access_ok = 1; } @@ -1356,7 +1356,7 @@ init (Wire * w) DBG (DBG_ERR, "init: bad status after sanei_w_set_dir: %d\n", w->status); return -1; } - + sanei_w_word (w, &word); /* decode procedure number */ if (w->status || word != SANE_NET_INIT) { @@ -1658,7 +1658,7 @@ do_scan (Wire * w, int h, int data_fd) long int nwritten; SANE_Int length; size_t nbytes; - + DBG (3, "do_scan: start\n"); FD_ZERO (&rd_mask); @@ -1699,8 +1699,8 @@ do_scan (Wire * w, int h, int data_fd) FD_CLR (be_fd, &rd_mask); be_fd = -1; /* only set status_dirty if EOF hasn't been already detected */ - if (status == SANE_STATUS_GOOD) - status_dirty = 1; + if (status == SANE_STATUS_GOOD) + status_dirty = 1; status = SANE_STATUS_EOF; DBG (DBG_INFO, "do_scan: select_fd was closed --> EOF\n"); continue; @@ -1723,11 +1723,11 @@ do_scan (Wire * w, int h, int data_fd) nbytes = bytes_in_buf; if (writer + nbytes > sizeof (buf)) nbytes = sizeof (buf) - writer; - DBG (DBG_INFO, + DBG (DBG_INFO, "do_scan: trying to write %d bytes to client\n", nbytes); nwritten = write (data_fd, buf + writer, nbytes); - DBG (DBG_INFO, + DBG (DBG_INFO, "do_scan: wrote %ld bytes to client\n", nwritten); if (nwritten < 0) { @@ -1791,7 +1791,7 @@ do_scan (Wire * w, int h, int data_fd) reader = store_reclen (buf, sizeof (buf), reader, 0xffffffff); buf[reader] = status; bytes_in_buf += 5; - DBG (DBG_MSG, "do_scan: statuscode `%s' was added to buffer\n", + DBG (DBG_MSG, "do_scan: statuscode `%s' was added to buffer\n", sane_strstatus(status)); } @@ -1854,7 +1854,7 @@ process_request (Wire * w) sanei_w_string (w, &name); if (w->status) { - DBG (DBG_ERR, + DBG (DBG_ERR, "process_request: (open) error while decoding args (%s)\n", strerror (w->status)); return 1; @@ -1871,7 +1871,7 @@ process_request (Wire * w) can_authorize = 1; resource = strdup (name); - + if (strlen(resource) == 0) { const SANE_Device **device_list; @@ -1879,8 +1879,8 @@ process_request (Wire * w) DBG(DBG_DBG, "process_request: (open) strlen(resource) == 0\n"); free (resource); - if ((i = sane_get_devices (&device_list, SANE_TRUE)) != - SANE_STATUS_GOOD) + if ((i = sane_get_devices (&device_list, SANE_TRUE)) != + SANE_STATUS_GOOD) { DBG(DBG_ERR, "process_request: (open) sane_get_devices failed\n"); memset (&reply, 0, sizeof (reply)); @@ -1889,7 +1889,7 @@ process_request (Wire * w) break; } - if ((device_list == NULL) || (device_list[0] == NULL)) + if ((device_list == NULL) || (device_list[0] == NULL)) { DBG(DBG_ERR, "process_request: (open) device_list[0] == 0\n"); memset (&reply, 0, sizeof (reply)); @@ -1907,7 +1907,7 @@ process_request (Wire * w) if (sanei_authorize (resource, "saned", auth_callback) != SANE_STATUS_GOOD) { - DBG (DBG_ERR, "process_request: access to resource `%s' denied\n", + DBG (DBG_ERR, "process_request: access to resource `%s' denied\n", resource); free (resource); memset (&reply, 0, sizeof (reply)); /* avoid leaking bits */ @@ -1915,12 +1915,12 @@ process_request (Wire * w) } else { - DBG (DBG_MSG, "process_request: access to resource `%s' granted\n", + DBG (DBG_MSG, "process_request: access to resource `%s' granted\n", resource); free (resource); memset (&reply, 0, sizeof (reply)); /* avoid leaking bits */ reply.status = sane_open (name, &be_handle); - DBG (DBG_MSG, "process_request: sane_open returned: %s\n", + DBG (DBG_MSG, "process_request: sane_open returned: %s\n", sane_strstatus (reply.status)); } @@ -2112,7 +2112,7 @@ process_request (Wire * w) DBG (DBG_MSG, "process_request: access to data port from %s\n", text_addr); - + if (strcmp (text_addr, remote_ip) != 0) { DBG (DBG_ERR, "process_request: however, only %s is authorized\n", @@ -2136,7 +2136,7 @@ process_request (Wire * w) /* Get address of remote host */ len = sizeof (sin); - if (getpeername (data_fd, (struct sockaddr *) &sin, + if (getpeername (data_fd, (struct sockaddr *) &sin, (socklen_t *) &len) < 0) { DBG (DBG_ERR, "process_request: getpeername failed: %s\n", @@ -2147,13 +2147,13 @@ process_request (Wire * w) if (memcmp (&remote_address, &sin.sin_addr, sizeof (remote_address)) != 0) { - DBG (DBG_ERR, + DBG (DBG_ERR, "process_request: access to data port from %s\n", inet_ntoa (sin.sin_addr)); - DBG (DBG_ERR, + DBG (DBG_ERR, "process_request: however, only %s is authorized\n", inet_ntoa (remote_address)); - DBG (DBG_ERR, + DBG (DBG_ERR, "process_request: configuration problem or attack?\n"); close (data_fd); data_fd = -1; @@ -2320,7 +2320,7 @@ handle_connection (int fd) reset_watchdog (); if (process_request (&wire) < 0) break; - } + } } static void @@ -3034,7 +3034,7 @@ run_standalone (char *user) } if (need_to_add) { - grplist = (gid_t *)realloc(grplist, + grplist = (gid_t *)realloc(grplist, sizeof(gid_t)*ngroups+1); if (grplist == NULL) { @@ -3215,7 +3215,7 @@ run_standalone (char *user) static void run_inetd (char __sane_unused__ *sock) { - + int fd = -1; #ifdef HAVE_SYSTEMD @@ -3223,7 +3223,7 @@ run_inetd (char __sane_unused__ *sock) n = sd_listen_fds(0); - if (n > 1) + if (n > 1) { DBG (DBG_ERR, "run_inetd: Too many file descriptors (sockets) received from systemd!\n"); return; @@ -3236,7 +3236,7 @@ run_inetd (char __sane_unused__ *sock) } #endif - if (fd == -1) + if (fd == -1) { int dave_null; diff --git a/frontend/scanimage.c b/frontend/scanimage.c index fe027500e..51b3b81ae 100644 --- a/frontend/scanimage.c +++ b/frontend/scanimage.c @@ -2,7 +2,7 @@ Uses the SANE library. Copyright (C) 2015 Rolf Bensch Copyright (C) 1996, 1997, 1998 Andreas Beck and David Mosberger - + Copyright (C) 1999 - 2009 by the SANE Project -- See AUTHORS and ChangeLog for details. @@ -403,7 +403,7 @@ print_option (SANE_Device * device, int opt_num, const SANE_Option_Descriptor *o }*/ /* if one of these three is not set, option is useless, skip it */ - if(!(opt->cap & + if(!(opt->cap & (SANE_CAP_SOFT_SELECT | SANE_CAP_HARD_SELECT | SANE_CAP_SOFT_DETECT) )){ return; @@ -462,7 +462,7 @@ print_option (SANE_Device * device, int opt_num, const SANE_Option_Descriptor *o if (!strcmp (opt->name, "x")) { printf ("%d..%d", - opt->constraint.range->min, + opt->constraint.range->min, opt->constraint.range->max - tl_x); } else if (!strcmp (opt->name, "y")) @@ -1011,7 +1011,7 @@ set_option (SANE_Handle device, int optnum, void *valuep) prog_name, opt->name); return; } - + if (opt->size == sizeof (SANE_Word) && opt->type != SANE_TYPE_STRING) orig = *(SANE_Word *) valuep; @@ -1483,7 +1483,7 @@ scan_it (FILE *ofp) offset = parm.format - SANE_FRAME_RED; image.x = image.y = 0; } - hundred_percent = parm.bytes_per_line * parm.lines + hundred_percent = parm.bytes_per_line * parm.lines * ((parm.format == SANE_FRAME_RGB || parm.format == SANE_FRAME_GRAY) ? 1:3); while (1) diff --git a/frontend/test.c b/frontend/test.c index df06751d7..3b1c4aea4 100644 --- a/frontend/test.c +++ b/frontend/test.c @@ -16,9 +16,9 @@ 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 simple SANE frontend (well it rather is a - transport layer, but seen from libsane it is a frontend) which acts - as a NETSANE server. The NETSANE specifications should have come + This file implements a simple SANE frontend (well it rather is a + transport layer, but seen from libsane it is a frontend) which acts + as a NETSANE server. The NETSANE specifications should have come with this package. Feel free to enhance this program ! It needs extension especially regarding crypto-support and authentication. diff --git a/frontend/tstbackend.c b/frontend/tstbackend.c index 82c54dcf2..bbacf57ff 100644 --- a/frontend/tstbackend.c +++ b/frontend/tstbackend.c @@ -1,4 +1,4 @@ -/* +/* tstbackend -- backend test utility Uses the SANE library. @@ -85,15 +85,15 @@ int verbose_level; static void display_stats(void) { #ifdef HAVE_LONG_LONG - printf("warnings: %d error: %d checks: %lld\n", + printf("warnings: %d error: %d checks: %lld\n", message_number_wrn, message_number_err, checks_done); #else - printf("warnings: %d error: %d checks: %ld\n", + printf("warnings: %d error: %d checks: %ld\n", message_number_wrn, message_number_err, checks_done); #endif } -/* +/* * If the condition is false, display a message with some headers * depending on the level. * @@ -109,8 +109,8 @@ static int check(enum message_level level, int condition, const char *format, .. va_list args; if (level != MSG && level != INF) checks_done ++; - - if (condition != 0) + + if (condition != 0) return condition; va_start(args, format); @@ -135,10 +135,10 @@ static int check(enum message_level level, int condition, const char *format, .. case FATAL: /* fatal error */ printf("FATAL ERROR : %s\n", str); message_number_err ++; - break; + break; case BUG: /* bug in tstbackend */ printf("tstbackend BUG : %s\n", str); - break; + break; } if (level == FATAL || level == BUG) { @@ -210,14 +210,14 @@ static void guards_check(void *ptr, size_t size) /*--------------------------------------------------------------------------*/ -static void +static void test_parameters (SANE_Device * device, SANE_Parameters *params) { SANE_Status status; SANE_Parameters p; status = sane_get_parameters (device, &p); - check(FATAL, (status == SANE_STATUS_GOOD), + check(FATAL, (status == SANE_STATUS_GOOD), "cannot get the parameters (error %s)", sane_strstatus(status)); check(FATAL, ((p.format == SANE_FRAME_GRAY) || @@ -227,7 +227,7 @@ test_parameters (SANE_Device * device, SANE_Parameters *params) (p.format == SANE_FRAME_BLUE)), "parameter format is not a known SANE_FRAME_* (%d)", p.format); - check(FATAL, ((p.last_frame == SANE_FALSE) || + check(FATAL, ((p.last_frame == SANE_FALSE) || (p.last_frame == SANE_TRUE)), "parameter last_frame is neither SANE_FALSE or SANE_TRUE (%d)", p.last_frame); @@ -243,7 +243,7 @@ test_parameters (SANE_Device * device, SANE_Parameters *params) /* Try to set every option in a word list. */ static void -test_options_word_list (SANE_Device * device, int option_num, +test_options_word_list (SANE_Device * device, int option_num, const SANE_Option_Descriptor *opt, int can_do_recursive) { @@ -252,24 +252,24 @@ test_options_word_list (SANE_Device * device, int option_num, SANE_Int val_int; SANE_Int info; - check(FATAL, (opt->type == SANE_TYPE_INT || + check(FATAL, (opt->type == SANE_TYPE_INT || opt->type == SANE_TYPE_FIXED), "type must be SANE_TYPE_INT or SANE_TYPE_FIXED (%d)", opt->type); if (!SANE_OPTION_IS_SETTABLE(opt->cap)) return; for (i=1; iconstraint.word_list[0]; i++) { - + info = 0x1010; /* garbage */ val_int = opt->constraint.word_list[i]; - status = sane_control_option (device, option_num, + status = sane_control_option (device, option_num, SANE_ACTION_SET_VALUE, &val_int, &info); - + check(FATAL, (status == SANE_STATUS_GOOD), "cannot set a settable option (status=%s)", sane_strstatus(status)); - check(WRN, ((info & ~(SANE_INFO_RELOAD_OPTIONS | + check(WRN, ((info & ~(SANE_INFO_RELOAD_OPTIONS | SANE_INFO_RELOAD_PARAMS)) == 0), "sane_control_option set an invalid info (%d)", info); @@ -281,8 +281,8 @@ test_options_word_list (SANE_Device * device, int option_num, } /* The option might have become inactive or unsettable. Skip it. */ - if (!SANE_OPTION_IS_ACTIVE(opt->cap) || - !SANE_OPTION_IS_SETTABLE(opt->cap)) + if (!SANE_OPTION_IS_ACTIVE(opt->cap) || + !SANE_OPTION_IS_SETTABLE(opt->cap)) return; } @@ -290,7 +290,7 @@ test_options_word_list (SANE_Device * device, int option_num, /* Try to set every option in a string list. */ static void -test_options_string_list (SANE_Device * device, int option_num, +test_options_string_list (SANE_Device * device, int option_num, const SANE_Option_Descriptor *opt, int can_do_recursive) { @@ -314,13 +314,13 @@ test_options_string_list (SANE_Device * device, int option_num, val_string, opt->size); info = 0xE1000; /* garbage */ - status = sane_control_option (device, option_num, + status = sane_control_option (device, option_num, SANE_ACTION_SET_VALUE, val_string, &info); check(FATAL, (status == SANE_STATUS_GOOD), "cannot set a settable option (status=%s)", sane_strstatus(status)); - check(WRN, ((info & ~(SANE_INFO_RELOAD_OPTIONS | + check(WRN, ((info & ~(SANE_INFO_RELOAD_OPTIONS | SANE_INFO_RELOAD_PARAMS)) == 0), "sane_control_option set an invalid info (%d)", info); @@ -334,8 +334,8 @@ test_options_string_list (SANE_Device * device, int option_num, } /* The option might have become inactive or unsettable. Skip it. */ - if (!SANE_OPTION_IS_ACTIVE(opt->cap) || - !SANE_OPTION_IS_SETTABLE(opt->cap)) + if (!SANE_OPTION_IS_ACTIVE(opt->cap) || + !SANE_OPTION_IS_SETTABLE(opt->cap)) return; } } @@ -352,8 +352,8 @@ test_options (SANE_Device * device, int can_do_recursive) void *optval; /* value for the option */ size_t optsize; /* size of the optval buffer */ - /* - * Test option 0 + /* + * Test option 0 */ opt = sane_get_option_descriptor (device, 0); check(FATAL, (opt != NULL), @@ -374,7 +374,7 @@ test_options (SANE_Device * device, int can_do_recursive) check(WRN, (status != SANE_STATUS_GOOD), "the option 0 value can be set"); - /* + /* * Test all options */ option_num = 0; @@ -454,7 +454,7 @@ test_options (SANE_Device * device, int can_do_recursive) check(WRN, (opt->constraint_type == SANE_CONSTRAINT_NONE), "invalid constraint type for option [%d, %s] (%d)", option_num, opt->name, opt->constraint_type); break; - + case SANE_TYPE_INT: case SANE_TYPE_FIXED: check(WRN, (opt->size > 0 && (opt->size % sizeof(SANE_Word) == 0)), @@ -467,7 +467,7 @@ test_options (SANE_Device * device, int can_do_recursive) "invalid constraint type for option [%d, %s] (%d)", option_num, opt->name, opt->constraint_type); break; - case SANE_TYPE_STRING: + case SANE_TYPE_STRING: check(WRN, (opt->size >= 1), "size of option [%d, %s] must be at least 1 for the NUL terminator", option_num, opt->name); check(INF, (opt->unit == SANE_UNIT_NONE), @@ -479,7 +479,7 @@ test_options (SANE_Device * device, int can_do_recursive) optsize = opt->size; break; - case SANE_TYPE_BUTTON: + case SANE_TYPE_BUTTON: case SANE_TYPE_GROUP: check(INF, (opt->unit == SANE_UNIT_NONE), "option [%d, %s], unit is not SANE_UNIT_NONE", option_num, opt->name); @@ -491,11 +491,11 @@ test_options (SANE_Device * device, int can_do_recursive) default: check(ERR, 0, - "invalid type %d for option %s", + "invalid type %d for option %s", opt->type, opt->name); break; } - + if (optval) { /* This is an option with a value */ @@ -505,7 +505,7 @@ test_options (SANE_Device * device, int can_do_recursive) * consider that an inactive option shouldn't be read by a * frontend because its value is meaningless. I think * that, in that case, SANE_STATUS_INVAL is an appropriate - * return. + * return. */ guards_set(optval, optsize); status = sane_control_option (device, option_num, @@ -522,7 +522,7 @@ test_options (SANE_Device * device, int can_do_recursive) /* set with NULL info */ guards_set(optval, optsize); - status = sane_control_option (device, option_num, + status = sane_control_option (device, option_num, SANE_ACTION_SET_VALUE, optval, NULL); guards_check(optval, optsize); if (SANE_OPTION_IS_SETTABLE (opt->cap) && SANE_OPTION_IS_ACTIVE (opt->cap)) { @@ -531,13 +531,13 @@ test_options (SANE_Device * device, int can_do_recursive) } else { check(ERR, (status == SANE_STATUS_INVAL), "was able to set option [%d, %s] value, although it is not active or settable", option_num, opt->name); - } - + } + /* Get with invalid info. Since if is a get, info should be either * ignored or set to 0. */ info = 0xdeadbeef; guards_set(optval, optsize); - status = sane_control_option (device, option_num, SANE_ACTION_GET_VALUE, + status = sane_control_option (device, option_num, SANE_ACTION_GET_VALUE, optval, &info); guards_check(optval, optsize); if (SANE_OPTION_IS_GETTABLE (opt->cap)) { @@ -549,19 +549,19 @@ test_options (SANE_Device * device, int can_do_recursive) } check(ERR, ((info == (SANE_Int)0xdeadbeef) || (info == 0)), "when getting option [%d, %s], info was set to %x", option_num, opt->name, info); - + /* Set with invalid info. Info should be reset by the backend. */ info = 0x10000; guards_set(optval, optsize); - status = sane_control_option (device, option_num, + status = sane_control_option (device, option_num, SANE_ACTION_SET_VALUE, optval, &info); guards_check(optval, optsize); if (SANE_OPTION_IS_SETTABLE (opt->cap) && SANE_OPTION_IS_ACTIVE (opt->cap)) { check(ERR, (status == SANE_STATUS_GOOD), "cannot set option [%d, %s] value, although it is active and settable (%s)", option_num, opt->name, sane_strstatus(status)); - check(ERR, ((info & ~(SANE_INFO_INEXACT | - SANE_INFO_RELOAD_OPTIONS | + check(ERR, ((info & ~(SANE_INFO_INEXACT | + SANE_INFO_RELOAD_OPTIONS | SANE_INFO_RELOAD_PARAMS)) == 0), "sane_control_option set some wrong bit in info (%d)", info); @@ -575,10 +575,10 @@ test_options (SANE_Device * device, int can_do_recursive) /* Ask the backend to set the option automatically. */ guards_set(optval, optsize); - status = sane_control_option (device, option_num, + status = sane_control_option (device, option_num, SANE_ACTION_SET_AUTO, optval, &info); guards_check(optval, optsize); - if (SANE_OPTION_IS_SETTABLE (opt->cap) && + if (SANE_OPTION_IS_SETTABLE (opt->cap) && SANE_OPTION_IS_ACTIVE (opt->cap) && (opt->cap & SANE_CAP_AUTOMATIC)) { check(ERR, (status == SANE_STATUS_GOOD), @@ -594,7 +594,7 @@ test_options (SANE_Device * device, int can_do_recursive) if (optval) { guards_free(optval); - optval = NULL; + optval = NULL; } /* Some capabilities checks. */ @@ -605,18 +605,18 @@ test_options (SANE_Device * device, int can_do_recursive) check(ERR, ((opt->cap & SANE_CAP_SOFT_DETECT) != 0), "option [%d, %s], SANE_CAP_SOFT_DETECT must be set if SANE_CAP_SOFT_SELECT is set", option_num, opt->name); } - if ((opt->cap & (SANE_CAP_SOFT_SELECT | - SANE_CAP_HARD_SELECT | + if ((opt->cap & (SANE_CAP_SOFT_SELECT | + SANE_CAP_HARD_SELECT | SANE_CAP_SOFT_DETECT)) == SANE_CAP_SOFT_DETECT) { check(ERR, (!SANE_OPTION_IS_SETTABLE (opt->cap)), "option [%d, %s], must not be settable", option_num, opt->name); } - + if (!SANE_OPTION_IS_SETTABLE (opt->cap)) { /* Unsettable option. Ignore the rest of the test. */ continue; } - + /* Check that will sane_control_option copy the string * parameter and not just store a pointer to it. */ if (opt->type == SANE_TYPE_STRING) { @@ -624,7 +624,7 @@ test_options (SANE_Device * device, int can_do_recursive) char *optstr; optstr = guards_malloc(opt->size); - val_string2 = guards_malloc(opt->size); + val_string2 = guards_malloc(opt->size); /* Poison the current value. */ strncpy(optstr, "-pOiSoN-", opt->size-1); @@ -632,7 +632,7 @@ test_options (SANE_Device * device, int can_do_recursive) /* Get the value */ guards_set(optstr, opt->size); - status = sane_control_option (device, option_num, SANE_ACTION_GET_VALUE, + status = sane_control_option (device, option_num, SANE_ACTION_GET_VALUE, optstr, NULL); guards_check(optstr, opt->size); check(FATAL, (status == SANE_STATUS_GOOD), @@ -642,7 +642,7 @@ test_options (SANE_Device * device, int can_do_recursive) /* Set the value */ guards_set(optstr, opt->size); - status = sane_control_option (device, option_num, + status = sane_control_option (device, option_num, SANE_ACTION_SET_VALUE, optstr, NULL); guards_check(optstr, opt->size); check(ERR, (status == SANE_STATUS_GOOD), @@ -653,13 +653,13 @@ test_options (SANE_Device * device, int can_do_recursive) optstr[opt->size-1] = 0; /* Read again the value and compare. */ - guards_set(val_string2, opt->size); - status = sane_control_option (device, option_num, SANE_ACTION_GET_VALUE, + guards_set(val_string2, opt->size); + status = sane_control_option (device, option_num, SANE_ACTION_GET_VALUE, val_string2, NULL); guards_check(val_string2, opt->size); check(ERR, (status == SANE_STATUS_GOOD), "cannot get option [%d, %s] value", option_num, opt->name); - + check(FATAL, (strcmp(optstr, val_string2) != 0), "sane_control_option did not copy the string parameter for option [%d, %s]", option_num, opt->name); @@ -671,8 +671,8 @@ test_options (SANE_Device * device, int can_do_recursive) if (opt->type == SANE_TYPE_BOOL) { SANE_Bool org_v; SANE_Bool v; - - status = sane_control_option (device, option_num, SANE_ACTION_GET_VALUE, + + status = sane_control_option (device, option_num, SANE_ACTION_GET_VALUE, &org_v, &info); check(ERR, (status == SANE_STATUS_GOOD), "cannot get boolean option [%d, %s] value (%s)", option_num, opt->name, sane_strstatus(status)); @@ -686,12 +686,12 @@ test_options (SANE_Device * device, int can_do_recursive) break; default: check(ERR, 0, - "invalid boolean value %d for option [%d, %s]", + "invalid boolean value %d for option [%d, %s]", org_v, option_num, opt->name); } - + /* Set the opposite of the current value. */ - status = sane_control_option (device, option_num, + status = sane_control_option (device, option_num, SANE_ACTION_SET_VALUE, &v, &info); check(ERR, (status == SANE_STATUS_GOOD), "cannot set boolean option [%d, %s] value (%s)", option_num, opt->name, sane_strstatus(status)); @@ -704,7 +704,7 @@ test_options (SANE_Device * device, int can_do_recursive) /* Set the initial value. */ v = org_v; - status = sane_control_option (device, option_num, + status = sane_control_option (device, option_num, SANE_ACTION_SET_VALUE, &v, &info); check(ERR, (status == SANE_STATUS_GOOD), "cannot set boolean option [%d, %s] value (%s)", option_num, opt->name, sane_strstatus(status)); @@ -713,22 +713,22 @@ test_options (SANE_Device * device, int can_do_recursive) if (info & SANE_INFO_RELOAD_PARAMS) { test_parameters(device, NULL); - } + } } - + /* Try to set an invalid option. */ switch(opt->type) { case SANE_TYPE_BOOL: { SANE_Word v; /* should be SANE_Bool instead */ - + v = -1; /* invalid value. must be SANE_FALSE or SANE_TRUE */ - status = sane_control_option (device, option_num, + status = sane_control_option (device, option_num, SANE_ACTION_SET_VALUE, &v, NULL); check(ERR, (status != SANE_STATUS_GOOD), "was able to set an invalid value for boolean option [%d, %s]", option_num, opt->name); v = 2; /* invalid value. must be SANE_FALSE or SANE_TRUE */ - status = sane_control_option (device, option_num, + status = sane_control_option (device, option_num, SANE_ACTION_SET_VALUE, &v, NULL); check(ERR, (status != SANE_STATUS_GOOD), "was able to set an invalid value for boolean option [%d, %s]", option_num, opt->name); @@ -750,7 +750,7 @@ test_options (SANE_Device * device, int can_do_recursive) v[i] = opt->constraint.range->min - 1; /* invalid range */ guards_set(v, opt->size); - status = sane_control_option (device, option_num, + status = sane_control_option (device, option_num, SANE_ACTION_SET_VALUE, v, &info); guards_check(v, opt->size); check(ERR, (status == SANE_STATUS_GOOD && (info & SANE_INFO_INEXACT) ), @@ -758,7 +758,7 @@ test_options (SANE_Device * device, int can_do_recursive) /* Set the corrected value. */ guards_set(v, opt->size); - status = sane_control_option (device, option_num, + status = sane_control_option (device, option_num, SANE_ACTION_SET_VALUE, v, &info); guards_check(v, opt->size); check(ERR, (status == SANE_STATUS_GOOD && !(info & SANE_INFO_INEXACT) ), @@ -769,7 +769,7 @@ test_options (SANE_Device * device, int can_do_recursive) v[i] = opt->constraint.range->max + 1; /* invalid range */ guards_set(v, opt->size); - status = sane_control_option (device, option_num, + status = sane_control_option (device, option_num, SANE_ACTION_SET_VALUE, v, &info); guards_check(v, opt->size); check(ERR, (status == SANE_STATUS_GOOD && (info & SANE_INFO_INEXACT) ), @@ -777,7 +777,7 @@ test_options (SANE_Device * device, int can_do_recursive) /* Set the corrected value. */ guards_set(v, opt->size); - status = sane_control_option (device, option_num, + status = sane_control_option (device, option_num, SANE_ACTION_SET_VALUE, v, &info); guards_check(v, opt->size); check(ERR, (status == SANE_STATUS_GOOD && !(info & SANE_INFO_INEXACT) ), @@ -791,15 +791,15 @@ test_options (SANE_Device * device, int can_do_recursive) default: break; } - + /* TODO: button */ - - /* + + /* * Here starts all the recursive stuff. After the test, it is * possible that the value is not settable nor active - * anymore. + * anymore. */ - + /* Try to set every option in a list */ switch(opt->constraint_type) { case SANE_CONSTRAINT_WORD_LIST: @@ -813,12 +813,12 @@ test_options (SANE_Device * device, int can_do_recursive) "no constraint list for option [%d, %s]", option_num, opt->name); test_options_string_list (device, option_num, opt, can_do_recursive); break; - + case SANE_CONSTRAINT_RANGE: check(FATAL, (opt->constraint.range != NULL), "no constraint range for option [%d, %s]", option_num, opt->name); check(FATAL, (opt->constraint.range->max >= opt->constraint.range->min), - "incorrect range for option [%d, %s] (min=%d > max=%d)", + "incorrect range for option [%d, %s] (min=%d > max=%d)", option_num, opt->name, opt->constraint.range->min, opt->constraint.range->max); /* Recurse. */ if (can_do_recursive) { @@ -838,7 +838,7 @@ test_options (SANE_Device * device, int can_do_recursive) } /* End of the test for that option. */ - } + } /* test random non-existing options. */ opt = sane_get_option_descriptor (device, -1); @@ -852,7 +852,7 @@ test_options (SANE_Device * device, int can_do_recursive) opt = sane_get_option_descriptor (device, num_dev_options+2); check(ERR, (opt == NULL), "was able to get option descriptor for option %d", num_dev_options+2); - + opt = sane_get_option_descriptor (device, num_dev_options+50); check(ERR, (opt == NULL), "was able to get option descriptor for option %d", num_dev_options+50); @@ -863,8 +863,8 @@ static const SANE_Option_Descriptor *get_optdesc_by_name(SANE_Handle device, con { const SANE_Option_Descriptor *opt; SANE_Int num_dev_options; - SANE_Status status; - + SANE_Status status; + /* Get the number of options. */ status = sane_control_option (device, 0, SANE_ACTION_GET_VALUE, &num_dev_options, 0); check(FATAL, (status == SANE_STATUS_GOOD), @@ -876,7 +876,7 @@ static const SANE_Option_Descriptor *get_optdesc_by_name(SANE_Handle device, con opt = sane_get_option_descriptor (device, *option_num); check(FATAL, (opt != NULL), "cannot get option descriptor for option %d", *option_num); - + if (opt->name && strcmp(opt->name, name) == 0) { return(opt); } @@ -886,10 +886,10 @@ static const SANE_Option_Descriptor *get_optdesc_by_name(SANE_Handle device, con /* Set the first value for an option. That equates to the minimum for a * range or the first element in a list. */ -static void set_min_value(SANE_Handle device, int option_num, +static void set_min_value(SANE_Handle device, int option_num, const SANE_Option_Descriptor *opt) { - SANE_Status status; + SANE_Status status; SANE_String val_string; SANE_Int val_int; int rc; @@ -915,7 +915,7 @@ static void set_min_value(SANE_Handle device, int option_num, if (!rc) return; val_string = strdup(opt->constraint.string_list[0]); assert(val_string); - status = sane_control_option (device, option_num, + status = sane_control_option (device, option_num, SANE_ACTION_SET_VALUE, val_string, NULL); check(ERR, (status == SANE_STATUS_GOOD), "cannot set option %s to [%s] (%s)", opt->name, val_string, sane_strstatus(status)); @@ -929,7 +929,7 @@ static void set_min_value(SANE_Handle device, int option_num, check(ERR, (status == SANE_STATUS_GOOD), "cannot set option %s to %d (%s)", opt->name, val_int, sane_strstatus(status)); break; - + default: abort(); } @@ -937,10 +937,10 @@ static void set_min_value(SANE_Handle device, int option_num, /* Set the last value for an option. That equates to the maximum for a * range or the last element in a list. */ -static void set_max_value(SANE_Handle device, int option_num, +static void set_max_value(SANE_Handle device, int option_num, const SANE_Option_Descriptor *opt) { - SANE_Status status; + SANE_Status status; SANE_String val_string; SANE_Int val_int; int i; @@ -968,7 +968,7 @@ static void set_max_value(SANE_Handle device, int option_num, for (i=1; opt->constraint.string_list[i] != NULL; i++); val_string = strdup(opt->constraint.string_list[i-1]); assert(val_string); - status = sane_control_option (device, option_num, + status = sane_control_option (device, option_num, SANE_ACTION_SET_VALUE, val_string, NULL); check(ERR, (status == SANE_STATUS_GOOD), "cannot set option %s to [%s] (%s)", opt->name, val_string, sane_strstatus(status)); @@ -982,17 +982,17 @@ static void set_max_value(SANE_Handle device, int option_num, check(ERR, (status == SANE_STATUS_GOOD), "cannot set option %s to %d (%s)", opt->name, val_int, sane_strstatus(status)); break; - + default: abort(); } } /* Set a random value for an option amongst the possible values. */ -static void set_random_value(SANE_Handle device, int option_num, +static void set_random_value(SANE_Handle device, int option_num, const SANE_Option_Descriptor *opt) { - SANE_Status status; + SANE_Status status; SANE_String val_string; SANE_Int val_int; int i; @@ -1022,7 +1022,7 @@ static void set_random_value(SANE_Handle device, int option_num, i = rand() % i; val_string = strdup(opt->constraint.string_list[0]); assert(val_string); - status = sane_control_option (device, option_num, + status = sane_control_option (device, option_num, SANE_ACTION_SET_VALUE, val_string, NULL); check(ERR, (status == SANE_STATUS_GOOD), "cannot set option %s to [%s] (%s)", opt->name, val_string, sane_strstatus(status)); @@ -1038,7 +1038,7 @@ static void set_random_value(SANE_Handle device, int option_num, check(ERR, (status == SANE_STATUS_GOOD), "cannot set option %s to %d (%s)", opt->name, val_int, sane_strstatus(status)); break; - + default: abort(); } @@ -1053,18 +1053,18 @@ static char *get_option_value(SANE_Handle device, const char *option_name) void *optval; /* value for the option */ int optnum; static char str[100]; - SANE_Status status; + SANE_Status status; opt = get_optdesc_by_name(device, option_name, &optnum); if (opt) { - + optval = guards_malloc(opt->size); status = sane_control_option (device, optnum, SANE_ACTION_GET_VALUE, optval, NULL); - + if (status == SANE_STATUS_GOOD) { switch(opt->type) { - + case SANE_TYPE_BOOL: if (*(SANE_Word*) optval == SANE_FALSE) { strcpy(str, "FALSE"); @@ -1072,22 +1072,22 @@ static char *get_option_value(SANE_Handle device, const char *option_name) strcpy(str, "TRUE"); } break; - + case SANE_TYPE_INT: sprintf(str, "%d", *(SANE_Word*) optval); break; - + case SANE_TYPE_FIXED: { int i; i = SANE_UNFIX(*(SANE_Word*) optval); sprintf(str, "%d", i); } break; - + case SANE_TYPE_STRING: strcpy(str, optval); break; - + default: str[0] = 0; } @@ -1113,7 +1113,7 @@ static char *display_scan_parameters(SANE_Handle device) char *p = str; *p = 0; - + p += sprintf(p, "scan mode=[%s] ", get_option_value(device, SANE_NAME_SCAN_MODE)); p += sprintf(p, "resolution=[%s] ", get_option_value(device, SANE_NAME_SCAN_RESOLUTION)); @@ -1129,7 +1129,7 @@ static char *display_scan_parameters(SANE_Handle device) static void test_scan(SANE_Handle device) { const SANE_Option_Descriptor *opt; - SANE_Status status; + SANE_Status status; int option_num; SANE_Int val_int; unsigned char *image = NULL; @@ -1140,7 +1140,7 @@ static void test_scan(SANE_Handle device) int rc; int fd; - /* Set the largest scan possible. + /* Set the largest scan possible. * * For that test, the corner * position must exists and be SANE_CONSTRAINT_RANGE (this is not @@ -1169,17 +1169,17 @@ static void test_scan(SANE_Handle device) /* Try to set the I/O mode outside of a scan. */ status = sane_set_io_mode (device, SANE_FALSE); check(ERR, (status == SANE_STATUS_INVAL), - "it is possible to sane_set_io_mode outside of a scan"); + "it is possible to sane_set_io_mode outside of a scan"); status = sane_set_io_mode (device, SANE_TRUE); check(ERR, (status == SANE_STATUS_INVAL || status == SANE_STATUS_UNSUPPORTED), - "it is possible to sane_set_io_mode outside of a scan"); + "it is possible to sane_set_io_mode outside of a scan"); /* Test sane_get_select_fd outside of a scan. */ status = sane_get_select_fd(device, &fd); - check(ERR, (status == SANE_STATUS_INVAL || + check(ERR, (status == SANE_STATUS_INVAL || status == SANE_STATUS_UNSUPPORTED), - "sane_get_select_fd outside of a scan returned an invalid status (%s)", + "sane_get_select_fd outside of a scan returned an invalid status (%s)", sane_strstatus (status)); if (test_level > 2) { @@ -1197,11 +1197,11 @@ static void test_scan(SANE_Handle device) check(ERR, (status == SANE_STATUS_GOOD), "sane_set_io_mode with SANE_FALSE must return SANE_STATUS_GOOD"); - /* test sane_set_io_mode with SANE_TRUE. */ + /* test sane_set_io_mode with SANE_TRUE. */ status = sane_set_io_mode (device, SANE_TRUE); - check(ERR, (status == SANE_STATUS_GOOD || + check(ERR, (status == SANE_STATUS_GOOD || status == SANE_STATUS_UNSUPPORTED), - "sane_set_io_mode with SANE_TRUE returned an invalid status (%s)", + "sane_set_io_mode with SANE_TRUE returned an invalid status (%s)", sane_strstatus (status)); /* Put the backend back into blocking mode. */ @@ -1212,9 +1212,9 @@ static void test_scan(SANE_Handle device) /* Test sane_get_select_fd */ fd = 0x76575; /* won't exists */ status = sane_get_select_fd(device, &fd); - check(ERR, (status == SANE_STATUS_GOOD || + check(ERR, (status == SANE_STATUS_GOOD || status == SANE_STATUS_UNSUPPORTED), - "sane_get_select_fd returned an invalid status (%s)", + "sane_get_select_fd returned an invalid status (%s)", sane_strstatus (status)); if (status == SANE_STATUS_GOOD) { check(ERR, (fd != 0x76575), @@ -1222,13 +1222,13 @@ static void test_scan(SANE_Handle device) check(ERR, (fd >= 0), "sane_get_select_fd returned an invalid fd"); } - + /* Check that it is not possible to set an option. It is probably * a requirement stated indirectly in the section 4.4 on code - * flow. + * flow. */ - status = sane_control_option (device, option_num, - SANE_ACTION_SET_VALUE, + status = sane_control_option (device, option_num, + SANE_ACTION_SET_VALUE, &val_int , NULL); check(WRN, (status != SANE_STATUS_GOOD), "it is possible to set a value during a scan"); @@ -1236,7 +1236,7 @@ static void test_scan(SANE_Handle device) test_parameters(device, ¶ms); if (params.bytes_per_line != 0 && params.lines != 0) { - + to_read = params.bytes_per_line * params.lines; while(SANE_TRUE) { len = 76457645; /* garbage */ @@ -1288,8 +1288,8 @@ static void test_scan(SANE_Handle device) "it is possible to sane_read outside a scan"); - /* - * Do a partial scan + /* + * Do a partial scan */ check(MSG, 0, "TEST: partial scan - %s", display_scan_parameters(device)); @@ -1301,7 +1301,7 @@ static void test_scan(SANE_Handle device) test_parameters(device, ¶ms); if (params.bytes_per_line != 0 && params.lines != 0) { - + len = 10; guards_set(image, 1); @@ -1311,12 +1311,12 @@ static void test_scan(SANE_Handle device) check(ERR, (len == 1), "sane_read() didn't return 1 byte as requested"); } - + sane_cancel(device); - /* - * Do a scan, reading random length. + /* + * Do a scan, reading random length. */ check(MSG, 0, "TEST: scan random length - %s", display_scan_parameters(device)); @@ -1336,8 +1336,8 @@ static void test_scan(SANE_Handle device) if (!rc) goto the_end; /* Check that it is not possible to set an option. */ - status = sane_control_option (device, option_num, - SANE_ACTION_SET_VALUE, + status = sane_control_option (device, option_num, + SANE_ACTION_SET_VALUE, &val_int , NULL); check(WRN, (status != SANE_STATUS_GOOD), "it is possible to set a value during a scan"); @@ -1345,10 +1345,10 @@ static void test_scan(SANE_Handle device) test_parameters(device, ¶ms); if (params.bytes_per_line != 0 && params.lines != 0) { - + to_read = params.bytes_per_line * params.lines; srandom(time(NULL)); - + while (SANE_TRUE) { ask_len = rand() & 0x7ffff; /* 0 to 512K-1 */ @@ -1387,7 +1387,7 @@ static void test_scan(SANE_Handle device) if (!rc) { break; } - + to_read -= len; } @@ -1422,7 +1422,7 @@ static void test_scan(SANE_Handle device) test_parameters(device, ¶ms); if (params.bytes_per_line != 0 && params.lines != 0) { - + to_read = params.bytes_per_line * params.lines; while(SANE_TRUE) { ask_len = IMAGE_SIZE; @@ -1481,7 +1481,7 @@ static void test_scans(SANE_Device * device) { const SANE_Option_Descriptor *scan_mode_opt; const SANE_Option_Descriptor *resolution_mode_opt; - SANE_Status status; + SANE_Status status; int scan_mode_optnum; int resolution_mode_optnum; SANE_String val_string; @@ -1519,27 +1519,27 @@ static void test_scans(SANE_Device * device) if (scan_mode_opt) { /* Do several scans, with several resolution. */ for (i=0; scan_mode_opt->constraint.string_list[i] != NULL; i++) { - + val_string = strdup(scan_mode_opt->constraint.string_list[i]); assert(val_string); - - status = sane_control_option (device, scan_mode_optnum, + + status = sane_control_option (device, scan_mode_optnum, SANE_ACTION_SET_VALUE, val_string, NULL); check(FATAL, (status == SANE_STATUS_GOOD), "cannot set a settable option (status=%s)", sane_strstatus(status)); - + free(val_string); if (resolution_mode_opt) { - set_min_value(device, resolution_mode_optnum, - resolution_mode_opt); - test_scan(device); - - set_max_value(device, resolution_mode_optnum, + set_min_value(device, resolution_mode_optnum, resolution_mode_opt); test_scan(device); - set_random_value(device, resolution_mode_optnum, + set_max_value(device, resolution_mode_optnum, + resolution_mode_opt); + test_scan(device); + + set_random_value(device, resolution_mode_optnum, resolution_mode_opt); test_scan(device); } else { @@ -1548,15 +1548,15 @@ static void test_scans(SANE_Device * device) } } else { if (resolution_mode_opt) { - set_min_value(device, resolution_mode_optnum, - resolution_mode_opt); - test_scan(device); - - set_max_value(device, resolution_mode_optnum, + set_min_value(device, resolution_mode_optnum, resolution_mode_opt); test_scan(device); - set_random_value(device, resolution_mode_optnum, + set_max_value(device, resolution_mode_optnum, + resolution_mode_opt); + test_scan(device); + + set_random_value(device, resolution_mode_optnum, resolution_mode_opt); test_scan(device); } else { @@ -1593,7 +1593,7 @@ SANE_Status status; check(FATAL, (dev->vendor != NULL), "device vendor is NULL"); check(FATAL, (dev->type != NULL), "device type is NULL"); check(FATAL, (dev->model != NULL), "device model is NULL"); - + check(INF, ((strcmp(dev->type, "flatbed scanner") == 0) || (strcmp(dev->type, "frame grabber") == 0) || (strcmp(dev->type, "handheld scanner") == 0) || @@ -1784,7 +1784,7 @@ main (int argc, char **argv) status = sane_open ("opihndvses75bvt6fg", &device); check(WRN, (status == SANE_STATUS_INVAL), "sane_open() failed (%s)", sane_strstatus (status)); - + if (status == SANE_STATUS_GOOD) sane_close(device); @@ -1809,7 +1809,7 @@ main (int argc, char **argv) status = sane_init (&version_code, NULL); check(FATAL, (status == SANE_STATUS_GOOD), "sane_init failed with %s", sane_strstatus (status)); - + /* Check the device list */ rc = test_get_devices(&device_list, time); if (rc) goto the_exit; @@ -1833,7 +1833,7 @@ main (int argc, char **argv) if (!rc) goto the_exit; check(MSG, 0, "using device %s", devname); - + /* Test open close */ check(MSG, 0, "TEST: open/close"); for (i=0; i<10; i++) { diff --git a/include/lalloca.h b/include/lalloca.h index 85e4ea8f3..214e55085 100644 --- a/include/lalloca.h +++ b/include/lalloca.h @@ -37,8 +37,8 @@ whether to permit this exception to apply to your modifications. If you do not wish that, delete this exception notice. - Choose suitable implementation of alloca. - + Choose suitable implementation of alloca. + */ #ifndef lalloca_h diff --git a/include/lassert.h b/include/lassert.h index 4d1c74025..5a86e21a6 100644 --- a/include/lassert.h +++ b/include/lassert.h @@ -48,7 +48,7 @@ /* The idea is from the gcc header file assert.h. */ #if defined __GNUC__ && defined _AIX -/* The implementation of assert of gcc on AIX is in libgcc.a. This +/* The implementation of assert of gcc on AIX is in libgcc.a. This doesn't work with shared libraries. So let's make our own assert(). */ #define assert(arg) \ ((void) ((arg) ? 0 : lassert (arg, __FILE__, __LINE__))) diff --git a/include/md5.h b/include/md5.h index 51e2512cf..bee44f64f 100644 --- a/include/md5.h +++ b/include/md5.h @@ -87,7 +87,7 @@ typedef unsigned long int md5_uintptr; #define ALIGN __attribute__ ((__aligned__ (4))) #else #define ALIGN -#endif +#endif /* Structure to save state of computation between the single steps. */ struct md5_ctx diff --git a/include/sane/sane.h b/include/sane/sane.h index 5320b4a5f..9f8bc7c66 100644 --- a/include/sane/sane.h +++ b/include/sane/sane.h @@ -242,7 +242,7 @@ extern SANE_String_Const sane_strstatus (SANE_Status status); #ifdef __cplusplus } -#endif +#endif #endif /* sane_h */ diff --git a/include/sane/sanei.h b/include/sane/sanei.h index 9458f342d..4ff765d74 100644 --- a/include/sane/sanei.h +++ b/include/sane/sanei.h @@ -20,24 +20,24 @@ 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. + If you do not wish that, delete this exception notice. */ /** @file sanei.h @@ -58,14 +58,14 @@ * to be platform-independent to avoid lots of \#ifdef code in the backends. * Please use the SANEI functions wherever possible. * - * This documentation was created by the use of doxygen, the + * This documentation was created by the use of doxygen, the * doc/doxygen-sanei.conf configuration file and documentation in the sanei_*.h * files. * * This documentation is far from complete. Any help is appreciated. * * @section additional Additional documentation - * - The SANE standard can be found at the SANE webserver, * though the PostScript version produced from the source may be more recent. * - Information on how to write a backend: the SANE documentation * page. - * - * @section contact Contact + * + * @section contact Contact * * The common way to contact the developers of SANE is the sane-devel * mailing list. See the mailing list webpage * for details. That's the place to ask questions, report bugs, or announce * a new backend. - * + * */ #ifndef sanei_h @@ -113,7 +113,7 @@ * @param opt option to check * @param value value of the option * - * @return + * @return * - SANE_STATUS_GOOD - on success * - SANE_STATUS_INVAL - if the value doesn't fit inside the constraint * or any other error occured @@ -130,7 +130,7 @@ * @param value value of the option * @param info info is set to SANE_INFO_INEXACT if value was changed * - * @return + * @return * - SANE_STATUS_GOOD - on success * - SANE_STATUS_INVAL - if the function wasn't able to fit value into the * constraint or any other error occured diff --git a/include/sane/sanei_access.h b/include/sane/sanei_access.h index d668b9845..0f73f5f41 100644 --- a/include/sane/sanei_access.h +++ b/include/sane/sanei_access.h @@ -46,7 +46,7 @@ * Interface file for the sanei_access functions. * * The idea is to provide some simple locking/unlocking mecanism, which - * can be used to protect device access from more than one frontend + * can be used to protect device access from more than one frontend * simultaneously. */ @@ -66,7 +66,7 @@ extern void sanei_access_init( const char * backend ); /** Set a lock. * - * The function tries to open/create exclusively a lock file in + * The function tries to open/create exclusively a lock file in * $PATH_SANE_LOCK_DIR. * If the file could be created successfully, the function fills in the * process ID. @@ -77,7 +77,7 @@ extern void sanei_access_init( const char * backend ); * * @param devicename - unique part of the lockfile name * @param timeout - time in seconds to try to set a lock - * @return + * @return * - SANE_STATUS_GOOD - if the lock has been successfully set * - SANE_STATUS_ACCESS_DENIED - the lock could not set */ diff --git a/include/sane/sanei_auth.h b/include/sane/sanei_auth.h index 1fd240d3c..37c8d1f70 100644 --- a/include/sane/sanei_auth.h +++ b/include/sane/sanei_auth.h @@ -36,7 +36,7 @@ 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. + If you do not wish that, delete this exception notice. */ /** @file sanei_auth.h @@ -67,9 +67,9 @@ * If the requested resource isn't listed in this file, sanei_authorize * return SANE_SATUS_GOOD. In all other cases, sanei_authorize sends a * challenge to the frontend of the form - * + * * resource$MD5$randomstring - * + * * where randomstring consists of the PID, the time, and some random * characters. It accepts two forms of answers * @@ -77,7 +77,7 @@ * md5: username:$MD5$m5digest * * where md5digest is md5(randomstring password). - * + * * If this username/password/resource triple is listed in backend.users * sanei_authorize returns SANE_STATUS_GOOD, in all other cases it returns * SANE_STATUS_ACCESS_DENIED. diff --git a/include/sane/sanei_backend.h b/include/sane/sanei_backend.h index 8273e889c..89e2edb64 100644 --- a/include/sane/sanei_backend.h +++ b/include/sane/sanei_backend.h @@ -152,7 +152,7 @@ extern void ENTRY(exit) (void); /** Internationalization for SANE backends * * Add SANE_I18N() to all texts that can be translated. - * E.g. out_txt = SANE_I18N("Hello"); + * E.g. out_txt = SANE_I18N("Hello"); */ #ifndef SANE_I18N #define SANE_I18N(text) text diff --git a/include/sane/sanei_config.h b/include/sane/sanei_config.h index cf877cfc0..f81bdd49f 100644 --- a/include/sane/sanei_config.h +++ b/include/sane/sanei_config.h @@ -53,7 +53,7 @@ #include /** Search configuration file \a name along directory list and return file - * pointer if such a file exists. + * pointer if such a file exists. * * The following directory list is used: * 1st: SANE_CONFIG_DIR environment variable. @@ -127,9 +127,9 @@ extern void sanei_config_attach_matching_devices (const char *name, (const char *dev)); /** this structure holds the description of configuration options. There is - * a list for options and another for their values. + * a list for options and another for their values. * These lists are used when the configuration file is - * parsed. Read values are stored in Option_Value. Helpers functions are + * parsed. Read values are stored in Option_Value. Helpers functions are * provided to access values easily */ typedef struct { diff --git a/include/sane/sanei_debug.h b/include/sane/sanei_debug.h index 557f8a7d3..5198af400 100644 --- a/include/sane/sanei_debug.h +++ b/include/sane/sanei_debug.h @@ -16,14 +16,14 @@ * Before including sanei_debug.h, the following macros must be set: * * - BACKEND_NAME - The name of your backend without double-quotes (must be set in any case) - * - STUBS - If this is defined, no macros will be included. Used in + * - STUBS - If this is defined, no macros will be included. Used in * backends consisting of more than one .c file. - * - DEBUG_DECLARE_ONLY - Generates prototypes instead of functions. Used in + * - DEBUG_DECLARE_ONLY - Generates prototypes instead of functions. Used in * backends consisting of more than one .c file. * - DEBUG_NOT_STATIC - Doesn't generate static functions. Used in header files if * they are include in more than one .c file. * - * @{ + * @{ */ /** @def DBG_INIT() @@ -44,7 +44,7 @@ /** @def IF_DBG(x) * Compile code only if debugging is enabled. * - * Expands to x if debug support is enabled at compile-time. If NDEBUG is + * Expands to x if debug support is enabled at compile-time. If NDEBUG is * defined at compile-time this macro expands to nothing. * * @param x code to expand when debugging is enabled @@ -52,7 +52,7 @@ /** * @def DBG_LEVEL - * Current debug level. + * Current debug level. * * You can only read this "variable". */ @@ -70,16 +70,16 @@ #define ENTRY(name) PASTE(PASTE(PASTE(sane_,BACKEND_NAME),_),name) #ifdef NDEBUG - + extern void sanei_debug_ndebug (int level, const char *msg, ...); - + # define DBG_LEVEL (0) # define DBG_INIT() # define DBG sanei_debug_ndebug # define IF_DBG(x) - + #else /* !NDEBUG */ - + /** @hideinitializer*/ # define DBG_LEVEL PASTE(sanei_debug_,BACKEND_NAME) @@ -103,7 +103,7 @@ int DBG_LEVEL = 0; # ifdef DEBUG_DECLARE_ONLY -extern void DBG_LOCAL (int level, const char *msg, ...) +extern void DBG_LOCAL (int level, const char *msg, ...) #ifdef __GNUC__ __attribute__ ((format (printf, 2, 3))) #endif @@ -112,8 +112,8 @@ __attribute__ ((format (printf, 2, 3))) # else /* !DEBUG_DECLARE_ONLY */ # include - -extern void sanei_debug_msg + +extern void sanei_debug_msg (int level, int max_level, const char *be, const char *fmt, va_list ap); #ifdef __GNUC__ @@ -144,7 +144,7 @@ DBG_LOCAL (int level, const char *msg, ...) # define DBG DBG_LOCAL extern void sanei_init_debug (const char * backend, int * debug_level_var); - + /** @hideinitializer*/ # define IF_DBG(x) x diff --git a/include/sane/sanei_lm983x.h b/include/sane/sanei_lm983x.h index 6b9d8c83a..d108fbf56 100644 --- a/include/sane/sanei_lm983x.h +++ b/include/sane/sanei_lm983x.h @@ -4,7 +4,7 @@ Copyright (C) 2002-2003 Gerhard Jaeger 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 @@ -140,7 +140,7 @@ extern SANE_Status sanei_lm983x_read( SANE_Int fd, SANE_Byte reg, * Reset the LM983x chip. * * @param fd - device file descriptor - * @return + * @return * - SANE_TRUE - reset successfuly done * - SANE_FALSE - reset failed */ diff --git a/include/sane/sanei_magic.h b/include/sane/sanei_magic.h index ab704a8e6..ba6a43286 100644 --- a/include/sane/sanei_magic.h +++ b/include/sane/sanei_magic.h @@ -1,5 +1,5 @@ /* sane - Scanner Access Now Easy. - + Copyright (C) 2009 m. allan noah This file is part of the SANE package. @@ -141,7 +141,7 @@ sanei_magic_findEdges(SANE_Parameters * params, SANE_Byte * buffer, * @param buffer contains image data * @param top vertical offset to upper edge of crop * @param bot vertical offset to lower edge of crop - * @param left horizontal offset to left edge of crop + * @param left horizontal offset to left edge of crop * @param right horizontal offset to right edge of crop * * @return diff --git a/include/sane/sanei_pa4s2.h b/include/sane/sanei_pa4s2.h index c5394a863..7138ceb83 100644 --- a/include/sane/sanei_pa4s2.h +++ b/include/sane/sanei_pa4s2.h @@ -36,11 +36,11 @@ 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. + If you do not wish that, delete this exception notice. */ /** @file sanei_pa4s2.h - * This file implements an interface for the Mustek PP chipset A4S2 + * This file implements an interface for the Mustek PP chipset A4S2 * * @sa sanei_usb.h, sanei_ab306.h, sanei_lm983x.h, sanei_scsi.h, sanei_pio.h */ @@ -72,39 +72,39 @@ */ extern const char ** sanei_pa4s2_devices(void); -/** Open pa4s2 device +/** Open pa4s2 device * * Opens *dev as pa4s2 device. * * @param dev IO port address ("0x378", "0x278", or "0x3BC") * @param fd file descriptor - * - * @return + * + * @return * - SANE_STATUS_GOOD - on success * - SANE_STATUS_INVAL - if no scanner was found or the port number was wrong * - SANE_STATUS_DEVICE_BUSY - if the device is already in use * - SANE_STATUS_IO_ERROR - if the port couldn't be accessed - * + * */ extern SANE_Status sanei_pa4s2_open (const char *dev, int *fd); -/** Open pa4s2 SCSI-over-parallel device +/** Open pa4s2 SCSI-over-parallel device * * Opens *dev as pa4s2 SCSI-over-parallel device. * * @param dev IO port address ("0x378", "0x278", or "0x3BC") * @param fd file descriptor - * - * @return + * + * @return * - SANE_STATUS_GOOD - on success * - SANE_STATUS_INVAL - if no scanner was found or the port number was wrong * - SANE_STATUS_DEVICE_BUSY - if the device is already in use * - SANE_STATUS_IO_ERROR - if the port couldn't be accessed - * + * */ extern SANE_Status sanei_pa4s2_scsi_pp_open (const char *dev, int *fd); -/** Close pa4s2 device +/** Close pa4s2 device * * @param fd file descriptor */ @@ -175,7 +175,7 @@ extern SANE_Status sanei_pa4s2_scsi_pp_get_status (int fd, u_char *status); */ extern SANE_Status sanei_pa4s2_scsi_pp_reg_select (int fd, int reg); -/** Read a register +/** Read a register * * The function to read a register is split up in three parts, so a register * can be read more than once. @@ -191,7 +191,7 @@ extern SANE_Status sanei_pa4s2_scsi_pp_reg_select (int fd, int reg); */ extern SANE_Status sanei_pa4s2_readbyte (int fd, u_char * val); -/** Terminate reading sequence +/** Terminate reading sequence * * The function to read a register is split up in three parts, so a register * can be read more than once. diff --git a/include/sane/sanei_pp.h b/include/sane/sanei_pp.h index d3e7b92ef..902fcfaa2 100644 --- a/include/sane/sanei_pp.h +++ b/include/sane/sanei_pp.h @@ -36,7 +36,7 @@ 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. + If you do not wish that, delete this exception notice. */ /** @file sanei_pp.h @@ -78,7 +78,7 @@ enum sanei_pp_mode { */ extern SANE_Status sanei_pp_init( void ); -/** Open a parport device. +/** Open a parport device. * * @param dev - name of device to open. * @param fd - pointer to variable that should revceive the handle. @@ -95,7 +95,7 @@ extern void sanei_pp_close( int fd ); /** Claim a parport device * * @param fd - handle of the device to claim - * @return + * @return */ extern SANE_Status sanei_pp_claim( int fd ); diff --git a/include/sane/sanei_pv8630.h b/include/sane/sanei_pv8630.h index ef7e9ddd8..d69a024f7 100644 --- a/include/sane/sanei_pv8630.h +++ b/include/sane/sanei_pv8630.h @@ -5,7 +5,7 @@ Copyright (C) 2001 Marcio Teixeira 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 diff --git a/include/sane/sanei_scsi.h b/include/sane/sanei_scsi.h index d69fd0f62..fa6e5d114 100644 --- a/include/sane/sanei_scsi.h +++ b/include/sane/sanei_scsi.h @@ -39,7 +39,7 @@ */ /** @file sanei_scsi.h - * Generic interface to SCSI drivers. + * Generic interface to SCSI drivers. * @sa sanei_usb.h, sanei_ab306.h,sanei_lm983x.h, sanei_pa4s2.h, sanei_pio.h, * and man sane-scsi(5) for user-oriented documentation */ @@ -76,8 +76,8 @@ extern int sanei_scsi_max_request_size; * * Find each SCSI device that matches the pattern specified by the * arguments. String arguments can be "omitted" by passing NULL, - * integer arguments can be "omitted" by passing -1. - * + * integer arguments can be "omitted" by passing -1. + * * Example: vendor="HP" model=NULL, type=NULL, bus=3, id=-1, lun=-1 would * attach all HP devices on SCSI bus 3. * @@ -100,15 +100,15 @@ extern void sanei_scsi_find_devices (const char *vendor, const char *model, /** Open a SCSI device * * Opens a SCSI device by its device filename and returns a file descriptor. - * If it's necessary to adjust the SCSI buffer size, use + * If it's necessary to adjust the SCSI buffer size, use * sanei_scsi_open_extended(). * * @param device_name name of the devicefile, e.g. "/dev/sg0" * @param fd file descriptor * @param sense_handler called whenever the SCSI driver returns a sense buffer * @param sense_arg pointer to data for the sense handler - * - * @return + * + * @return * - SANE_STATUS_GOOD - on success * - SANE_STATUS_ACCESS_DENIED - if the file couldn't be accessed due to * permissions @@ -138,8 +138,8 @@ extern SANE_Status sanei_scsi_open (const char * device_name, int * fd, * @param sense_handler called whenever the SCSI driver returns a sense buffer * @param sense_arg pointer to data for the sense handler * @param buffersize size of the SCAI request buffer (in bytes) - * - * @return + * + * @return * - SANE_STATUS_GOOD - on success * - SANE_STATUS_ACCESS_DENIED - if the file couldn't be accessed due to * permissions @@ -195,7 +195,7 @@ extern SANE_Status sanei_scsi_req_enter (int fd, void * dst, size_t * dst_size, void **idp); -/** Enqueue SCSI command and separated data +/** Enqueue SCSI command and separated data * * Same as sanei_scsi_req_enter(), but with separate buffers for the SCSI * command and for the data to be sent to the device. @@ -235,7 +235,7 @@ extern SANE_Status sanei_scsi_req_enter2 (int fd, /** Wait for SCSI command * - * Wait for the completion of the SCSI command with id ID. + * Wait for the completion of the SCSI command with id ID. * * @param id id used in sanei_scsi_req_enter() * diff --git a/include/sane/sanei_tcp.h b/include/sane/sanei_tcp.h index 0c3aeb481..227e61315 100644 --- a/include/sane/sanei_tcp.h +++ b/include/sane/sanei_tcp.h @@ -12,7 +12,7 @@ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * FITNESS FOR A PARTICULAR PURPOSE. * - * Header file for TCP/IP communications. + * Header file for TCP/IP communications. */ #ifndef sanei_tcp_h diff --git a/include/sane/sanei_thread.h b/include/sane/sanei_thread.h index fa72481be..f2323cedd 100644 --- a/include/sane/sanei_thread.h +++ b/include/sane/sanei_thread.h @@ -131,7 +131,7 @@ extern int sanei_thread_kill (SANE_Pid pid); * @param pid - the id of the task * @param sig - the signal to send * - * @return + * @return * - 0 - on success * - any other value - if an error occured while sending the signal */ @@ -139,7 +139,7 @@ extern int sanei_thread_sendsig (SANE_Pid pid, int sig); /** Wait for task termination. * - * This function waits until a task that has been terminated by + * This function waits until a task that has been terminated by * sanei_thread_kill(), sanei_thread_sendsys() or by any other means * is finished. * @@ -153,7 +153,7 @@ extern SANE_Pid sanei_thread_waitpid (SANE_Pid pid, int *status); /** Check the current status of the spawned task * - * + * * @param pid - the id of the task * * @return diff --git a/include/sane/sanei_udp.h b/include/sane/sanei_udp.h index e32fc1a66..bee013ad8 100644 --- a/include/sane/sanei_udp.h +++ b/include/sane/sanei_udp.h @@ -12,7 +12,7 @@ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * FITNESS FOR A PARTICULAR PURPOSE. * - * Header file for UDP/IP communications. + * Header file for UDP/IP communications. */ #ifndef sanei_udp_h diff --git a/japi/Jscanimage.java b/japi/Jscanimage.java index d3ab32d0a..129d0559a 100644 --- a/japi/Jscanimage.java +++ b/japi/Jscanimage.java @@ -238,7 +238,7 @@ public class Jscanimage extends Frame implements WindowListener, int status = sane.getControlOption(saneHandle, 0, numDevOptions, null); if (status != Sane.STATUS_GOOD) { - System.out.println("controlOption() failed. Status= " + System.out.println("controlOption() failed. Status= " + status); return (false); } @@ -262,7 +262,7 @@ public class Jscanimage extends Frame implements WindowListener, if (opt.unit == SaneOption.UNIT_NONE) title = opt.title; else // Show units. - title = opt.title + " [" + + title = opt.title + " [" + opt.unitString(unitLength) + ']'; switch (opt.type) { @@ -295,7 +295,7 @@ public class Jscanimage extends Frame implements WindowListener, case SaneOption.CONSTRAINT_RANGE: // A scale. SaneSlider slider = new FixedSaneSlider( - opt.rangeConstraint.min, + opt.rangeConstraint.min, opt.rangeConstraint.max, opt.unit == SaneOption.UNIT_MM, this, i, opt.desc); @@ -320,7 +320,7 @@ public class Jscanimage extends Frame implements WindowListener, case SaneOption.CONSTRAINT_RANGE: // A scale. SaneSlider slider = new SaneSlider( - opt.rangeConstraint.min, + opt.rangeConstraint.min, opt.rangeConstraint.max, this, i, opt.desc); addLabeledOption(group, title, slider, c); @@ -347,7 +347,7 @@ public class Jscanimage extends Frame implements WindowListener, addControl(list); break; case SaneOption.CONSTRAINT_NONE: - SaneTextField tfield = new SaneTextField(16, + SaneTextField tfield = new SaneTextField(16, this, i, opt.desc); addLabeledOption(group, title, tfield, c); addControl(tfield); @@ -511,8 +511,8 @@ public class Jscanimage extends Frame implements WindowListener, public void setControlOption(int optNum, int val) { int [] info = new int[1]; - if (sane.setControlOption(saneHandle, optNum, - SaneOption.ACTION_SET_VALUE, val, info) + if (sane.setControlOption(saneHandle, optNum, + SaneOption.ACTION_SET_VALUE, val, info) != Sane.STATUS_GOOD) System.out.println("setControlOption() failed."); checkOptionInfo(info[0]); @@ -524,8 +524,8 @@ public class Jscanimage extends Frame implements WindowListener, public void setControlOption(int optNum, String val) { int [] info = new int[1]; - if (sane.setControlOption(saneHandle, optNum, - SaneOption.ACTION_SET_VALUE, val, info) + if (sane.setControlOption(saneHandle, optNum, + SaneOption.ACTION_SET_VALUE, val, info) != Sane.STATUS_GOOD) System.out.println("setControlOption() failed."); checkOptionInfo(info[0]); @@ -783,7 +783,7 @@ class SaneSlider extends JPanel implements SaneComponent, ChangeListener add(label, c); c.weightx = .8; // Give most weight to slider. c.fill = GridBagConstraints.HORIZONTAL; - slider = new JSlider(JSlider.HORIZONTAL, min, max, + slider = new JSlider(JSlider.HORIZONTAL, min, max, min + (max - min)/2); add(slider, c); // Set tool tip. @@ -855,7 +855,7 @@ class FixedSaneSlider extends SaneSlider double val = (double) slider.getValue(); // Convert to actual control scale. val = min + ((val - SCALE_MIN)/(SCALE_MAX - SCALE_MIN)) * (max - min); - label.setText(format.format(optMM ? + label.setText(format.format(optMM ? val/dialog.getUnitLength() : val)); dialog.setControlOption(optNum, dialog.getSane().fix(val)); } @@ -872,9 +872,9 @@ class FixedSaneSlider extends SaneSlider { double val = dialog.getSane().unfix(ival[0]); // Show value with user's pref. - label.setText(format.format(optMM ? + label.setText(format.format(optMM ? val/dialog.getUnitLength() : val)); - val = SCALE_MIN + ((val - min)/(max - min)) * + val = SCALE_MIN + ((val - min)/(max - min)) * (SCALE_MAX - SCALE_MIN); slider.setValue((int) val); } @@ -916,7 +916,7 @@ class SaneButton extends JButton implements ActionListener /* * A combo-box for showing a list of items. */ -abstract class SaneComboBox extends JComboBox +abstract class SaneComboBox extends JComboBox implements SaneComponent, ItemListener { protected Jscanimage dialog; // That which created us. diff --git a/japi/Makefile.am b/japi/Makefile.am index cc7ac4aa1..6e88a60d4 100644 --- a/japi/Makefile.am +++ b/japi/Makefile.am @@ -21,7 +21,7 @@ AM_LDFLAGS += $(STRICT_LDFLAGS) -version-number $(V_MAJOR):$(V_MINOR):$(V_REV) JAVA_SRC = SaneDevice.java SaneOption.java SaneRange.java\ Sane.java SaneParameters.java ScanIt.java \ ImageCanvas.java ImageCanvasClient.java \ - Test.java Jscanimage.java + Test.java Jscanimage.java dist_noinst_JAVA = $(JAVA_SRC) diff --git a/japi/Sane.c b/japi/Sane.c index 1ddb4fc33..3fd9996e4 100644 --- a/japi/Sane.c +++ b/japi/Sane.c @@ -104,7 +104,7 @@ JNIEXPORT jint JNICALL Java_Sane_getDevicesNative int i; /* Get the list. */ - status = sane_get_devices(&device_list, localOnly); + status = sane_get_devices(&device_list, localOnly); if (status != SANE_STATUS_GOOD) return (status); /* Get length of Java array. */ @@ -232,13 +232,13 @@ JNIEXPORT void JNICALL Java_Sane_getOptionNative jobject range = (*env)->AllocObject(env, rangeClass); /* Fill in fields. */ fid = (*env)->GetFieldID(env, rangeClass, "min", "I"); - (*env)->SetIntField(env, range, fid, + (*env)->SetIntField(env, range, fid, sopt->constraint.range->min); fid = (*env)->GetFieldID(env, rangeClass, "max", "I"); - (*env)->SetIntField(env, range, fid, + (*env)->SetIntField(env, range, fid, sopt->constraint.range->max); fid = (*env)->GetFieldID(env, rangeClass, "quant", "I"); - (*env)->SetIntField(env, range, fid, + (*env)->SetIntField(env, range, fid, sopt->constraint.range->quant); fid = (*env)->GetFieldID(env, optClass, "rangeConstraint", "LSaneRange;"); @@ -251,7 +251,7 @@ JNIEXPORT void JNICALL Java_Sane_getOptionNative jint *elements; int i; /* First word. is the length. */ - wordList = (*env)->NewIntArray(env, + wordList = (*env)->NewIntArray(env, sopt->constraint.word_list[0]); /* Copy in the integers. */ elements = (*env)->GetIntArrayElements(env, wordList, 0); @@ -272,7 +272,7 @@ JNIEXPORT void JNICALL Java_Sane_getOptionNative for (len = 0; sopt->constraint.string_list[len]; len++) ; - stringList = (*env)->NewObjectArray(env, len + 1, + stringList = (*env)->NewObjectArray(env, len + 1, stringClass, 0); /* Add each string. */ for (i = 0; i < len; i++) @@ -284,7 +284,7 @@ JNIEXPORT void JNICALL Java_Sane_getOptionNative /* 0 at end. */ (*env)->SetObjectArrayElement(env, stringList, len, 0); /* Set the field. */ - fid = (*env)->GetFieldID(env, optClass, + fid = (*env)->GetFieldID(env, optClass, "stringListConstraint", "[Ljava/lang/String;"); (*env)->SetObjectField(env, optObj, fid, stringList); } @@ -296,7 +296,7 @@ JNIEXPORT void JNICALL Java_Sane_getOptionNative * Signature: (II[I[I)I */ JNIEXPORT jint JNICALL Java_Sane_getControlOption__II_3I_3I - (JNIEnv *env, jobject jobj, jint handle, jint option, jintArray value, + (JNIEnv *env, jobject jobj, jint handle, jint option, jintArray value, jintArray info) { SANE_Status status; /* Gets status. */ @@ -318,7 +318,7 @@ JNIEXPORT jint JNICALL Java_Sane_getControlOption__II_3I_3I * Signature: (II[B[I)I */ JNIEXPORT jint JNICALL Java_Sane_getControlOption__II_3B_3I - (JNIEnv *env, jobject jobj, jint handle, jint option, jbyteArray value, + (JNIEnv *env, jobject jobj, jint handle, jint option, jbyteArray value, jintArray info) { SANE_Status status; /* Gets status. */ @@ -340,7 +340,7 @@ JNIEXPORT jint JNICALL Java_Sane_getControlOption__II_3B_3I * Signature: (IIII[I)I */ JNIEXPORT jint JNICALL Java_Sane_setControlOption__IIII_3I - (JNIEnv *env, jobject jobj, jint handle, jint option, jint action, + (JNIEnv *env, jobject jobj, jint handle, jint option, jint action, jint value, jintArray info) { SANE_Status status; /* Gets status. */ @@ -457,7 +457,7 @@ JNIEXPORT jint JNICALL Java_Sane_read /* Get actual data ptr. */ dataElements = (*env)->GetByteArrayElements(env, data, 0); /* Do the read. */ - status = sane_read((SANE_Handle) handle, dataElements, + status = sane_read((SANE_Handle) handle, dataElements, maxLength, &read_len); (*env)->ReleaseByteArrayElements(env, data, dataElements, 0); /* Return # bytes read. */ diff --git a/japi/Sane.java b/japi/Sane.java index 85600e783..88b949578 100644 --- a/japi/Sane.java +++ b/japi/Sane.java @@ -57,7 +57,7 @@ public static int STATUS_GOOD = 0; // everything A-OK public static int STATUS_UNSUPPORTED = 1;// operation is not supported public static int STATUS_CANCELLED = 2; // operation was cancelled public static int STATUS_DEVICE_BUSY = 3;// device is busy; try again later -public static int STATUS_INVAL = 4; // data is invalid (includes no +public static int STATUS_INVAL = 4; // data is invalid (includes no // dev at open) public static int STATUS_EOF = 5; // no more data available (end-of-file) public static int STATUS_JAMMED = 6; // document feeder jammed @@ -137,7 +137,7 @@ public native int setControlOption(int handle, int option, int action, String value, int [] info); public native int getParameters(int handle, SaneParameters params); public native int start(int handle); -public native int read(int handle, byte [] data, +public native int read(int handle, byte [] data, int maxLength, int [] length); public native void cancel(int handle); public native String strstatus(int status); diff --git a/japi/SaneDevice.java b/japi/SaneDevice.java index dc73365a4..8d5a9a80c 100644 --- a/japi/SaneDevice.java +++ b/japi/SaneDevice.java @@ -46,10 +46,10 @@ public class SaneDevice { -public String name; // unique device name -public String vendor; // device vendor string -public String model; // device model name -public String type; // device type (e.g., "flatbed scanner") +public String name; // unique device name +public String vendor; // device vendor string +public String model; // device model name +public String type; // device type (e.g., "flatbed scanner") } diff --git a/japi/SaneOption.java b/japi/SaneOption.java index ed460c752..1b2a01001 100644 --- a/japi/SaneOption.java +++ b/japi/SaneOption.java @@ -58,13 +58,13 @@ public class SaneOption // // Sane value units: // - public static final int UNIT_NONE = 0; // the value is unit-less - // (e.g., # of scans) - public static final int UNIT_PIXEL = 1; // value is number of pixels - public static final int UNIT_BIT = 2; // value is number of bits - public static final int UNIT_MM = 3; // value is millimeters - public static final int UNIT_DPI = 4; // value is res. in dots/inch - public static final int UNIT_PERCENT = 5;// value is a percentage + public static final int UNIT_NONE = 0; // the value is unit-less + // (e.g., # of scans) + public static final int UNIT_PIXEL = 1; // value is number of pixels + public static final int UNIT_BIT = 2; // value is number of bits + public static final int UNIT_MM = 3; // value is millimeters + public static final int UNIT_DPI = 4; // value is res. in dots/inch + public static final int UNIT_PERCENT = 5;// value is a percentage // // Option capabilities: // @@ -100,13 +100,13 @@ public class SaneOption // // Class members: // - public String name; // name of this option (command-line name) - public String title; // title of this option (single-line) - public String desc; // description of this option (multi-line) + public String name; // name of this option (command-line name) + public String title; // title of this option (single-line) + public String desc; // description of this option (multi-line) public int type; // how are values interpreted? (TYPE_) public int unit; // what is the (physical) unit? (UNIT_) public int size; - public int cap; // capabilities + public int cap; // capabilities public int constraintType; // These are a union in the "C" API: // Null-terminated list: @@ -123,7 +123,7 @@ public class SaneOption { return ((cap) & CAP_SOFT_SELECT) == 0; } // Return string describing units. // "unitLength" is # mm. preferred. - public String unitString(double unitLength) + public String unitString(double unitLength) { switch (unit) { diff --git a/japi/SaneParameters.java b/japi/SaneParameters.java index 4e629c441..e78981af2 100644 --- a/japi/SaneParameters.java +++ b/japi/SaneParameters.java @@ -49,12 +49,12 @@ public class SaneParameters // // Frame values: // -public static final int FRAME_GRAY = 0; // band covering human visual range -public static final int FRAME_RGB = 1; // pixel-interleaved - // red/green/blue bands -public static final int FRAME_RED = 2; // red band only -public static final int FRAME_GREEN = 3;// green band only -public static final int FRAME_BLUE = 4; // blue band only +public static final int FRAME_GRAY = 0; // band covering human visual range +public static final int FRAME_RGB = 1; // pixel-interleaved + // red/green/blue bands +public static final int FRAME_RED = 2; // red band only +public static final int FRAME_GREEN = 3;// green band only +public static final int FRAME_BLUE = 4; // blue band only // // Class members: diff --git a/japi/ScanIt.java b/japi/ScanIt.java index 21afba0d2..a35762671 100644 --- a/japi/ScanIt.java +++ b/japi/ScanIt.java @@ -156,7 +156,7 @@ public class ScanIt implements ImageProducer */ public synchronized void removeConsumer(ImageConsumer ic) { consumers.removeElement(ic); } - + /* * Add a consumer and start scanning. */ @@ -224,7 +224,7 @@ public class ScanIt implements ImageProducer // Single frame. for (i = 0; i < readLen; ++i) { // Doing a single color frame. - image[offset + i] |= + image[offset + i] |= (((int) data[i]) & 0xff) << (8*cindex); ++x; if (x >= width) @@ -235,7 +235,7 @@ public class ScanIt implements ImageProducer for (i = 0; i < readLen; ++i) { int b = 2 - (offset + i)%3; - image[(offset + i)/3] |= + image[(offset + i)/3] |= (((int) data[i]) & 0xff) << (8*b); if (b == 0) { @@ -261,7 +261,7 @@ public class ScanIt implements ImageProducer offset += readLen; // Update where we are. // Show it. System.out.println("PrevY = " + prevY + ", y = " + y); -// tellPixels(0, prevY, width, y - prevY); +// tellPixels(0, prevY, width, y - prevY); tellPixels(0, 0, width, height); return true; } @@ -289,7 +289,7 @@ public class ScanIt implements ImageProducer status = sane.start(handle); if (status != Sane.STATUS_GOOD) { - System.out.println("start() failed. Status= " + System.out.println("start() failed. Status= " + status); tellStatus(ImageConsumer.IMAGEERROR); return; @@ -297,7 +297,7 @@ public class ScanIt implements ImageProducer status = sane.getParameters(handle, parms); if (status != Sane.STATUS_GOOD) { - System.out.println("getParameters() failed. Status= " + System.out.println("getParameters() failed. Status= " + status); tellStatus(ImageConsumer.IMAGEERROR); return; //++++cleanup. @@ -342,7 +342,7 @@ public class ScanIt implements ImageProducer catch (IOException e) { //+++++++++++++++ System.out.println("I/O error writing file."); - } + } outputFile = null; // Clear for next time. } tellStatus(ImageConsumer.STATICIMAGEDONE); @@ -364,7 +364,7 @@ public class ScanIt implements ImageProducer case SaneParameters.FRAME_GREEN: case SaneParameters.FRAME_BLUE: case SaneParameters.FRAME_RGB: - pout.print("P6\n# SANE data follows\n" + + pout.print("P6\n# SANE data follows\n" + width + ' ' + height + "\n255\n"); for (i = 0; i < len; i++) { diff --git a/japi/Test.java b/japi/Test.java index 52a711261..4a0f5072c 100644 --- a/japi/Test.java +++ b/japi/Test.java @@ -81,7 +81,7 @@ public static void main(String[] args) status = sane.getControlOption(handle[0], 0, numDevOptions, null); if (status != Sane.STATUS_GOOD) { - System.out.println("controlOption() failed. Status= " + System.out.println("controlOption() failed. Status= " + status); return; } @@ -101,7 +101,7 @@ public static void main(String[] args) switch (opt.constraintType) { case SaneOption.CONSTRAINT_RANGE: - System.out.println("Range: " + + System.out.println("Range: " + opt.rangeConstraint.min + ", " + opt.rangeConstraint.max + ", " + opt.rangeConstraint.quant); @@ -123,11 +123,11 @@ public static void main(String[] args) break; } } - status = sane.setControlOption(handle[0], 2, + status = sane.setControlOption(handle[0], 2, SaneOption.ACTION_SET_VALUE, "../test1.pnm", null); if (status != Sane.STATUS_GOOD) { - System.out.println("setControlOption() failed. Status= " + System.out.println("setControlOption() failed. Status= " + status); } // @@ -145,14 +145,14 @@ public static void main(String[] args) status = sane.start(handle[0]); if (status != Sane.STATUS_GOOD) { - System.out.println("start() failed. Status= " + System.out.println("start() failed. Status= " + status); return; } status = sane.getParameters(handle[0], parm); if (status != Sane.STATUS_GOOD) { - System.out.println("getParameters() failed. Status= " + System.out.println("getParameters() failed. Status= " + status); return; //++++cleanup. } diff --git a/lib/inet_pton.c b/lib/inet_pton.c index 7638b6e9f..e1178540a 100644 --- a/lib/inet_pton.c +++ b/lib/inet_pton.c @@ -13,7 +13,7 @@ #include #endif -int +int inet_pton (int af, const char *src, void *dst) { diff --git a/lib/isfdtype.c b/lib/isfdtype.c index 8e515165e..429f872ef 100644 --- a/lib/isfdtype.c +++ b/lib/isfdtype.c @@ -8,7 +8,7 @@ int isfdtype(int fd, int fdtype) { struct stat st; - + if (fstat(fd, &st) == -1) return 0; /* couldn't stat fd */ if (st.st_mode == 0) diff --git a/lib/strcasestr.c b/lib/strcasestr.c index 8999c50f6..1c8dc87d5 100644 --- a/lib/strcasestr.c +++ b/lib/strcasestr.c @@ -29,7 +29,7 @@ #include "../include/sane/config.h" -#ifndef HAVE_STRCASESTR +#ifndef HAVE_STRCASESTR #if defined HAVE_STRING_H # include diff --git a/m4/byteorder.m4 b/m4/byteorder.m4 index c8b91d313..c4cb42309 100644 --- a/m4/byteorder.m4 +++ b/m4/byteorder.m4 @@ -20,7 +20,7 @@ AC_EGREP_CPP([symbol is present|\<$1\>],[ #ifdef $1 symbol is present #endif - ], + ], [AC_MSG_RESULT(yes) $3 ], diff --git a/po/LINGUAS b/po/LINGUAS index 904d3321c..1b88bdfad 100644 --- a/po/LINGUAS +++ b/po/LINGUAS @@ -1,4 +1,4 @@ -# List of languages +# List of languages # try to keep this list ordered bg cs diff --git a/po/README b/po/README index 028451909..8461ec052 100644 --- a/po/README +++ b/po/README @@ -61,5 +61,5 @@ Frontend developers: I want to add internationalization support for my frontend language exactly one .mo file is installed. Earlier releases of sane-backends installed one file per backend, e.g. sane-umax.mo. For backward compatibility, frontends may want to check for these files, also. -* As mentioned above, GNU gettext is used. +* As mentioned above, GNU gettext is used. * With other NLS implementations, converting the mo files may work. diff --git a/sane-backends.lsm b/sane-backends.lsm index 5f8f72190..0eba9570c 100644 --- a/sane-backends.lsm +++ b/sane-backends.lsm @@ -8,7 +8,7 @@ Description: SANE (Scanner Access Now Easy) is a universal scanner networking support. For other/graphical frontends take a look at sane-frontends and XSane. Keywords: scanner, camera, flatbed, automatic document feeder (ADF), - slides, diapositive, negative, film, transparency, CIS, CCD, + slides, diapositive, negative, film, transparency, CIS, CCD, network server & client, Java API & client Author: The SANE development team (sane-devel@lists.alioth.debian.org) (see AUTHORS for complete list) @@ -18,8 +18,8 @@ Primary-site: ftp.sane-project.org /pub/sane/sane-backends-_VERSION_ _L_S_ kB sane-backends-_VERSION_.lsm Alternate-site: sunsite.unc.edu /pub/Linux/apps/graphics/capture Platforms: AIX, Digital Unix, HP Apollo Domain/OS, FreeBSD, HP-UX, IRIX, - Linux (Alpha, m68k, SPARC, x86), NetBSD, OpenBSD, - OpenStep (x86), SCO OpenServer 5.x (x86), OS/2, + Linux (Alpha, m68k, SPARC, x86), NetBSD, OpenBSD, + OpenStep (x86), SCO OpenServer 5.x (x86), OS/2, Solaris (SPARC, x86), SunOS. GNU make is needed. Copying-policy: GPL (programs), relaxed GPL (libraries), and public domain diff --git a/sanei/sanei_DomainOS.c b/sanei/sanei_DomainOS.c index 547315115..7b851a8a0 100644 --- a/sanei/sanei_DomainOS.c +++ b/sanei/sanei_DomainOS.c @@ -326,7 +326,7 @@ static void DomainSCSIWait(void) static status_$t sense_status; static pinteger sense_return_count; static int temp; - + /* Issue the sense command (wire, issue, wait, unwire */ sense_cdb_size = sizeof(scanner_sense_cdb); memcpy(&sense_cdb, scanner_sense_cdb, sense_cdb_size); diff --git a/sanei/sanei_ab306.c b/sanei/sanei_ab306.c index 898acf686..4483fec78 100644 --- a/sanei/sanei_ab306.c +++ b/sanei/sanei_ab306.c @@ -294,7 +294,7 @@ sanei_ab306_open (const char *dev, int *fdp) status = sanei_ab306_get_io_privilege (i); if (status != SANE_STATUS_GOOD) return status; - + DBG(1, "sanei_ab306_ioport: using inb/outb access\n"); for (j = 0; j < NELEMS(wakeup); ++j) { @@ -477,7 +477,7 @@ sanei_ab306_rdata (int fd, int planes, SANE_Byte * buf, int lines, int bpl) do nstat = ab306_inb (p, p->base + 1); while (((p->lstat ^ nstat) & 0x10) == 0); - + if (p->port_fd >= 0) { /* the pixel-loop: */ diff --git a/sanei/sanei_access.c b/sanei/sanei_access.c index b77cdd97b..cb19c5cea 100644 --- a/sanei/sanei_access.c +++ b/sanei/sanei_access.c @@ -80,10 +80,10 @@ #ifdef ENABLE_LOCKING /** get the status/owner of a lock file * - * The function tries to open an existing lockfile. On success, it reads out + * The function tries to open an existing lockfile. On success, it reads out * the pid which is stored inside and tries to find out more about the status * of the process with the corresponding PID. - * + * * @param fn - the complete filename of the lockfile to check * @return * - PROCESS_SELF - the calling process is owner of the lockfile @@ -96,10 +96,10 @@ get_lock_status( char *fn ) char pid_buf[PID_BUFSIZE]; int fd, status; pid_t pid; - + fd = open( fn, O_RDONLY ); if( fd < 0 ) { - DBG( 2, "does_process_exist: open >%s< failed: %s\n", + DBG( 2, "does_process_exist: open >%s< failed: %s\n", fn, strerror(errno)); return PROCESS_OTHER; } @@ -155,7 +155,7 @@ sanei_access_init( const char *backend ) DBG( 2, "sanei_access_init: >%s<\n", backend); } -SANE_Status +SANE_Status sanei_access_lock( const char *devicename, SANE_Word timeout ) { #ifdef ENABLE_LOCKING @@ -164,7 +164,7 @@ sanei_access_lock( const char *devicename, SANE_Word timeout ) int fd, to, i; #endif - DBG( 2, "sanei_access_lock: devname >%s<, timeout: %u\n", + DBG( 2, "sanei_access_lock: devname >%s<, timeout: %u\n", devicename, timeout ); #ifndef ENABLE_LOCKING return SANE_STATUS_GOOD; @@ -179,7 +179,7 @@ sanei_access_lock( const char *devicename, SANE_Word timeout ) fd = open( fn, O_CREAT | O_EXCL | O_WRONLY, 0644 ); if (fd < 0) { - + if (errno == EEXIST) { switch( get_lock_status( fn )) { case PROCESS_DEAD: @@ -198,7 +198,7 @@ sanei_access_lock( const char *devicename, SANE_Word timeout ) DBG( 2, "sanei_access_lock: lock exists, waiting...\n" ); sleep(1); } else { - DBG( 1, "sanei_access_lock: open >%s< failed: %s\n", + DBG( 1, "sanei_access_lock: open >%s< failed: %s\n", fn, strerror(errno)); return SANE_STATUS_ACCESS_DENIED; } @@ -215,7 +215,7 @@ sanei_access_lock( const char *devicename, SANE_Word timeout ) #endif } -SANE_Status +SANE_Status sanei_access_unlock( const char *devicename ) { #ifdef ENABLE_LOCKING diff --git a/sanei/sanei_auth.c b/sanei/sanei_auth.c index cbba06c8b..9039187b6 100644 --- a/sanei/sanei_auth.c +++ b/sanei/sanei_auth.c @@ -36,7 +36,7 @@ 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. + If you do not wish that, delete this exception notice. This file implements an interface for user authorization using MD5 digest */ diff --git a/sanei/sanei_config.c b/sanei/sanei_config.c index c15876641..0eaee9afb 100644 --- a/sanei/sanei_config.c +++ b/sanei/sanei_config.c @@ -227,7 +227,7 @@ sanei_config_read (char *str, int n, FILE *stream) while( isspace( *start)) start++; - if (start != str) + if (start != str) do { *str++ = *start++; } while( *str); @@ -266,7 +266,7 @@ sanei_configure_attach (const char *config_file, SANEI_Config * config, } /* loop reading the configuration file, all line beginning by "option " are - * parsed for value to store in configuration structure, other line are + * parsed for value to store in configuration structure, other line are * used are device to try to attach */ while (sanei_config_read (line, PATH_MAX, fp) && status == SANE_STATUS_GOOD) @@ -292,7 +292,7 @@ sanei_configure_attach (const char *config_file, SANEI_Config * config, /* to ensure maximum compatibility, we accept line like: * option "option_name" "option_value" - * "option_name" "option_value" + * "option_name" "option_value" * So we parse the line 2 time to find an option */ /* check if it is an option */ lp = sanei_config_get_string (lp, &token); @@ -405,7 +405,7 @@ sanei_configure_attach (const char *config_file, SANEI_Config * config, config->descriptors[i]->type, config->descriptors[i]->name); } - + /* check decoded value */ status = sanei_check_value (config->descriptors[i], value); @@ -438,7 +438,7 @@ sanei_configure_attach (const char *config_file, SANEI_Config * config, /* to avoid every backend to depend on scsi and usb functions * we call back the backend for attach. In turn it will call * sanei_usb_attach_matching_devices, sanei_config_attach_matching_devices - * or other. This means 2 callback functions per backend using this + * or other. This means 2 callback functions per backend using this * function. */ DBG (3, "sanei_configure_attach: trying to attach with '%s'\n", lp2); diff --git a/sanei/sanei_config2.c b/sanei/sanei_config2.c index 44c6b936b..cd9484d6d 100644 --- a/sanei/sanei_config2.c +++ b/sanei/sanei_config2.c @@ -149,6 +149,6 @@ sanei_config_attach_matching_devices (const char *name, if (type) free (type); } - else + else (*attach) (name); } diff --git a/sanei/sanei_init_debug.c b/sanei/sanei_init_debug.c index 0abb8918a..8e9eb0a9f 100644 --- a/sanei/sanei_init_debug.c +++ b/sanei/sanei_init_debug.c @@ -112,7 +112,7 @@ sanei_debug_msg (int level, int max_level, const char *be, const char *fmt, va_list ap) { char *msg; - + if (max_level >= level) { #ifdef S_IFSOCK @@ -137,7 +137,7 @@ sanei_debug_msg fprintf (stderr, "[%s] ", be); vfprintf (stderr, fmt, ap); } - + } } diff --git a/sanei/sanei_lm983x.c b/sanei/sanei_lm983x.c index 5b41985c2..62dfad970 100644 --- a/sanei/sanei_lm983x.c +++ b/sanei/sanei_lm983x.c @@ -4,7 +4,7 @@ Copyright (C) 2002-2004 Gerhard Jaeger 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 @@ -96,20 +96,20 @@ sanei_lm983x_write( SANE_Int fd, SANE_Byte reg, DBG( 15, "sanei_lm983x_write: fd=%d, reg=%d, len=%d, increment=%d\n", fd, reg, len, increment); - + if( reg > _LM9831_MAX_REG ) { DBG( 1, "sanei_lm983x_write: register out of range (%u>%u)\n", reg, _LM9831_MAX_REG ); return SANE_STATUS_INVAL; } - + for( bytes = 0; len > 0; ) { max_len = _MIN( len, _MAX_TRANSFER_SIZE ); command_buffer[0] = 0; /* write */ command_buffer[1] = reg; /* LM983x register */ - + if( increment == SANE_TRUE ) { command_buffer[0] += 0x02; /* increase reg? */ command_buffer[1] += bytes; @@ -122,7 +122,7 @@ sanei_lm983x_write( SANE_Int fd, SANE_Byte reg, size = (max_len + _CMD_BYTE_CNT); result = sanei_usb_write_bulk( fd, command_buffer, &size ); - + if( SANE_STATUS_GOOD != result ) return result; @@ -183,7 +183,7 @@ sanei_lm983x_read( SANE_Int fd, SANE_Byte reg, if( SANE_STATUS_GOOD != result ) return result; - + if( size != _CMD_BYTE_CNT) { DBG( 1, "sanei_lm983x_read: short write while writing command " "(%d/_CMD_BYTE_CNT)\n", result); @@ -228,7 +228,7 @@ SANE_Bool sanei_lm983x_reset( SANE_Int fd ) DBG( 15, "sanei_lm983x_reset()\n" ); for( i = 0; i < _MAX_RETRY; i++ ) { - + /* Read the command register and check that the reset bit is not set * If it is set, clear it and return false to indicate that * the bit has only now been cleared diff --git a/sanei/sanei_magic.c b/sanei/sanei_magic.c index bfd56cc58..bfd10a7b5 100644 --- a/sanei/sanei_magic.c +++ b/sanei/sanei_magic.c @@ -123,17 +123,17 @@ sanei_magic_despeck (SANE_Parameters * params, SANE_Byte * buffer, /* convert darkest pixel into a brighter threshold */ thresh = (thresh + 255*3 + 255*3)/3; - + /*loop over rows and columns around window */ for(k=-1; kformat == SANE_FRAME_GRAY && params->depth == 1){ for(i=bw; i> (7-(j+l)%8) & 1; if(hits) @@ -631,7 +631,7 @@ sanei_magic_rotate (SANE_Parameters * params, SANE_Byte * buffer, goto cleanup; } - if(params->format == SANE_FRAME_RGB || + if(params->format == SANE_FRAME_RGB || (params->format == SANE_FRAME_GRAY && params->depth == 8) ){ @@ -642,19 +642,19 @@ sanei_magic_rotate (SANE_Parameters * params, SANE_Byte * buffer, for (i=0; i= pwidth) continue; - + sourceY = centerY + (int)(-shiftY * slopeCos + shiftX * slopeSin); if (sourceY < 0 || sourceY >= height) continue; - + for (k=0; k= pwidth) continue; - + sourceY = centerY + (int)(-shiftY * slopeCos + shiftX * slopeSin); if (sourceY < 0 || sourceY >= height) continue; @@ -689,7 +689,7 @@ sanei_magic_rotate (SANE_Parameters * params, SANE_Byte * buffer, outbuf[i*bwidth + j/8] &= ~(1 << (7-(j%8))); /* fill in new bit */ - outbuf[i*bwidth + j/8] |= + outbuf[i*bwidth + j/8] |= ((buffer[sourceY*bwidth + sourceX/8] >> (7-(sourceX%8))) & 1) << (7-(j%8)); } @@ -726,7 +726,7 @@ sanei_magic_isBlank (SANE_Parameters * params, SANE_Byte * buffer, /*convert thresh from percent (0-100) to 0-1 range*/ thresh /= 100; - if(params->format == SANE_FRAME_RGB || + if(params->format == SANE_FRAME_RGB || (params->format == SANE_FRAME_GRAY && params->depth == 8) ){ @@ -783,7 +783,7 @@ sanei_magic_isBlank (SANE_Parameters * params, SANE_Byte * buffer, /* Divide the image into 1/2 inch squares, skipping a 1/4 inch * margin on all sides. If all squares are under the user's density, - * signal our caller to skip the image entirely, by returning + * signal our caller to skip the image entirely, by returning * SANE_STATUS_NO_DOCS */ SANE_Status sanei_magic_isBlank2 (SANE_Parameters * params, SANE_Byte * buffer, @@ -813,12 +813,12 @@ sanei_magic_isBlank2 (SANE_Parameters * params, SANE_Byte * buffer, for(yb=0; ybbytes_per_line + (xquarter + xb*xhalf) * Bpp; @@ -826,7 +826,7 @@ sanei_magic_isBlank2 (SANE_Parameters * params, SANE_Byte * buffer, /*count darkness of pix in this row*/ int rowsum = 0; - + for(x=0; xbytes_per_line + (xquarter + xb*xhalf) / 8; @@ -860,7 +860,7 @@ sanei_magic_isBlank2 (SANE_Parameters * params, SANE_Byte * buffer, /*count darkness of pix in this row*/ int rowsum = 0; - + for(x=0; x> (7-(x%8)) & 1; } @@ -898,7 +898,7 @@ sanei_magic_findTurn(SANE_Parameters * params, SANE_Byte * buffer, DBG(10,"sanei_magic_findTurn: start\n"); - if(params->format == SANE_FRAME_RGB || + if(params->format == SANE_FRAME_RGB || (params->format == SANE_FRAME_GRAY && params->depth == 8) ){ @@ -1125,7 +1125,7 @@ sanei_magic_turn(SANE_Parameters * params, SANE_Byte * buffer, } /*turn color & gray image*/ - if(params->format == SANE_FRAME_RGB || + if(params->format == SANE_FRAME_RGB || (params->format == SANE_FRAME_GRAY && params->depth == 8) ){ @@ -1282,7 +1282,7 @@ getTopEdge(int width, int height, int resolution, double topSlope = 0; int topOffset = 0; int topDensity = 0; - + int i,j; int pass = 0; @@ -1436,7 +1436,7 @@ getLine (int height, int width, int * buff, /* find central value of this 'bucket' */ slopeCenter[j] = ( - (double)j*(maxSlope-minSlope)/slopes+minSlope + (double)j*(maxSlope-minSlope)/slopes+minSlope + (double)(j+1)*(maxSlope-minSlope)/slopes+minSlope )/2; @@ -1525,7 +1525,7 @@ getLine (int height, int width, int * buff, maxDensity = lines[i][j]; } } - + DBG(15,"getLine: maxDensity %d\n",maxDensity); *finSlope = 0; @@ -1544,20 +1544,20 @@ getLine (int height, int width, int * buff, } } } - + if(0){ fprintf(stderr,"offsetCenter: "); for(j=0;j -1){ int byi = bot[i] - (slope * i); @@ -1677,7 +1677,7 @@ getLeftEdge (int width, int height, int * top, int * bot, /* Loop thru the image and look for first color change in each column. * Return a malloc'd array. Caller is responsible for freeing. */ -int * +int * sanei_magic_getTransY ( SANE_Parameters * params, int dpi, SANE_Byte * buffer, int top) { @@ -1715,7 +1715,7 @@ sanei_magic_getTransY ( /* load the buff array with y value for first color change from edge * gray/color uses a different algo from binary/halftone */ - if(params->format == SANE_FRAME_RGB || + if(params->format == SANE_FRAME_RGB || (params->format == SANE_FRAME_GRAY && params->depth == 8) ){ @@ -1734,10 +1734,10 @@ sanei_magic_getTransY ( } near *= winLen; far = near; - + /* move windows, check delta */ for(j=firstLine+direction; j!=lastLine; j+=direction){ - + int farLine = j-winLen*2*direction; int nearLine = j-winLen*direction; @@ -1770,10 +1770,10 @@ sanei_magic_getTransY ( int near = 0; for(i=0; i> (7-(i%8)) & 1; - + /* move */ for(j=firstLine+direction; j!=lastLine; j+=direction){ if((buffer[(j*width+i)/8] >> (7-(i%8)) & 1) != near){ @@ -1809,7 +1809,7 @@ sanei_magic_getTransY ( /* Loop thru the image height and look for first color change in each row. * Return a malloc'd array. Caller is responsible for freeing. */ -int * +int * sanei_magic_getTransX ( SANE_Parameters * params, int dpi, SANE_Byte * buffer, int left) { @@ -1848,7 +1848,7 @@ sanei_magic_getTransX ( /* load the buff array with x value for first color change from edge * gray/color uses a different algo from binary/halftone */ - if(params->format == SANE_FRAME_RGB || + if(params->format == SANE_FRAME_RGB || (params->format == SANE_FRAME_GRAY && params->depth == 8) ){ @@ -1867,10 +1867,10 @@ sanei_magic_getTransX ( } near *= winLen; far = near; - + /* move windows, check delta */ for(j=firstCol+direction; j!=lastCol; j+=direction){ - + int farCol = j-winLen*2*direction; int nearCol = j-winLen*direction; @@ -1888,7 +1888,7 @@ sanei_magic_getTransX ( near -= buffer[i*bwidth + nearCol*depth + k]; near += buffer[i*bwidth + j*depth + k]; } - + if(abs(near - far) > 50*winLen*depth - near*40/255){ buff[i] = j; break; @@ -1902,10 +1902,10 @@ sanei_magic_getTransX ( int near = 0; for(i=0; i> (7-(firstCol%8)) & 1; - + /* move */ for(j=firstCol+direction; j!=lastCol; j+=direction){ if((buffer[i*bwidth + j/8] >> (7-(j%8)) & 1) != near){ diff --git a/sanei/sanei_pa4s2.c b/sanei/sanei_pa4s2.c index d1be0c067..282e6fdf6 100644 --- a/sanei/sanei_pa4s2.c +++ b/sanei/sanei_pa4s2.c @@ -37,7 +37,7 @@ 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. + If you do not wish that, delete this exception notice. This file implements an interface for the Mustek PP chipset A4S2 */ @@ -48,7 +48,7 @@ 3 - things nice to know 4 - code flow 5 - detailed flow - 6 - everything + 6 - everything These debug levels can be set using the environment variable SANE_DEBUG_SANEI_PA4S2 */ @@ -333,7 +333,7 @@ pa4s2_init (SANE_Status *status) } DBG (3, "pa4s2_init: %d ports reported by IEEE 1284 library\n", pplist.portc); - + for (n=0; nname); @@ -388,7 +388,7 @@ pa4s2_open (const char *dev, SANE_Status * status) #if !defined (HAVE_LIBIEEE1284) u_long base; #endif - + DBG (4, "pa4s2_open: trying to attach dev `%s`\n", dev); if ((result = pa4s2_init(status)) != 0) @@ -397,7 +397,7 @@ pa4s2_open (const char *dev, SANE_Status * status) DBG (1, "pa4s2_open: failed to initialize\n"); return result; } - + #if !defined (HAVE_LIBIEEE1284) { @@ -526,7 +526,7 @@ pa4s2_open (const char *dev, SANE_Status * status) if (ioperm (port[n].base, 5, 1)) { - DBG (1, "pa4s2_open: cannot get io privilege for port 0x%03lx\n", + DBG (1, "pa4s2_open: cannot get io privilege for port 0x%03lx\n", port[n].base); @@ -715,7 +715,7 @@ pa4s2_readbyte_nib (int fd) { u_char val; - + outbyte2 (fd, 0x05); val = inbyte1(fd); val >>= 4; @@ -891,7 +891,7 @@ pa4s2_close (int fd, SANE_Status * status) { #if defined(HAVE_LIBIEEE1284) - DBG (1, "pa4s2_close: can't free port '%s' (%s)\n", + DBG (1, "pa4s2_close: can't free port '%s' (%s)\n", pplist.portv[fd]->name, pa4s2_libieee1284_errorstr(result)); #else DBG (1, "pa4s2_close: can't free port 0x%03lx\n", port[fd].base); @@ -1034,7 +1034,7 @@ sanei_pa4s2_scsi_pp_get_status(int fd, u_char *status) /* * SCSI-over-parallel scanners need this done when a register is * selected - */ + */ SANE_Status sanei_pa4s2_scsi_pp_reg_select (int fd, int reg) { @@ -1430,7 +1430,7 @@ sanei_pa4s2_enable (int fd, int enable) /* io-permissions are not inherited after fork (at least not on linux 2.2, although they seem to be inherited on linux 2.4), so we should make sure we get the permission */ - + if (ioperm (port[fd].base, 5, 1)) { DBG (1, "sanei_pa4s2_enable: cannot get io privilege for port" @@ -1457,7 +1457,7 @@ sanei_pa4s2_enable (int fd, int enable) { #if defined(HAVE_LIBIEEE1284) - DBG (4, "sanei_pa4s2_enable: disable port '%s'\n", + DBG (4, "sanei_pa4s2_enable: disable port '%s'\n", pplist.portv[fd]->name); #else DBG (4, "sanei_pa4s2_enable: disable port 0x%03lx\n", port[fd].base); diff --git a/sanei/sanei_pio.c b/sanei/sanei_pio.c index 00e40ee5a..329070486 100644 --- a/sanei/sanei_pio.c +++ b/sanei/sanei_pio.c @@ -112,7 +112,7 @@ inb (u_long port) #define PORT_DEV "/dev/port" /* base 278 (lpt2) - + ioport stat ctrl offs 0 1 2 len 1 1 1 */ @@ -174,7 +174,7 @@ static int pio_write (const Port port, const u_char * buf, int n); static int pio_read (const Port port, u_char * buf, int n); static int pio_open (const char *dev, SANE_Status * status); -static inline int +static inline int pio_outb (const Port port, u_char val, u_long addr) { @@ -190,7 +190,7 @@ pio_outb (const Port port, u_char val, u_long addr) return 0; } -static inline int +static inline int pio_inb (const Port port, u_char * val, u_long addr) { @@ -206,7 +206,7 @@ pio_inb (const Port port, u_char * val, u_long addr) return 0; } -static inline int +static inline int pio_wait (const Port port, u_char val, u_char mask) { int stat = 0; @@ -268,7 +268,7 @@ pio_ctrl (const Port port, u_char val) return; } -static inline void +static inline void pio_delay (const Port port) { inb (port->base + PIO_STAT); /* delay */ @@ -276,14 +276,14 @@ pio_delay (const Port port) return; } -static inline void +static inline void pio_init (const Port port) { pio_ctrl (port, PIO_CTRL_IE); return; } -static void +static void pio_reset (const Port port) { int n; @@ -302,7 +302,7 @@ pio_reset (const Port port) return; } -static int +static int pio_write (const Port port, const u_char * buf, int n) { int k; @@ -356,7 +356,7 @@ pio_write (const Port port, const u_char * buf, int n) return k; } -static int +static int pio_read (const Port port, u_char * buf, int n) { int k; @@ -401,10 +401,10 @@ pio_read (const Port port, u_char * buf, int n) } /* - Open the device, must contain a valid port number (as string). + Open the device, must contain a valid port number (as string). */ -static int +static int pio_open (const char *dev, SANE_Status * status) { static int first_time = 1; @@ -481,7 +481,7 @@ pio_open (const char *dev, SANE_Status * status) return n; } -SANE_Status +SANE_Status sanei_pio_open (const char *dev, int *fdp) { SANE_Status status; @@ -490,7 +490,7 @@ sanei_pio_open (const char *dev, int *fdp) return status; } -void +void sanei_pio_close (int fd) { Port p = port + fd; @@ -512,7 +512,7 @@ sanei_pio_close (int fd) return; } -int +int sanei_pio_read (int fd, u_char * buf, int n) { if ((0 > fd) && (NELEMS (port) <= fd)) @@ -524,7 +524,7 @@ sanei_pio_read (int fd, u_char * buf, int n) return pio_read (&port[fd], buf, n); } -int +int sanei_pio_write (int fd, const u_char * buf, int n) { if ((0 > fd) && (NELEMS (port) <= fd)) @@ -546,30 +546,30 @@ SANE_Status sanei_pio_open (const char *dev, int *fdp) { int fp; - + /* open internal parallel port */ fp=open("/dev/parallel/parallel1",O_RDWR); - + *fdp=fp; if(fp<0) return SANE_STATUS_INVAL; return(SANE_STATUS_GOOD); } -void +void sanei_pio_close (int fd) { close(fd); return; } -int +int sanei_pio_read (int fd, u_char * buf, int n) { return(read(fd,buf,n)); } -int +int sanei_pio_write (int fd, const u_char * buf, int n) { return(write(fd,buf,n)); @@ -585,19 +585,19 @@ sanei_pio_open (const char *dev, int *fdp) } -void +void sanei_pio_close (int fd) { return; } -int +int sanei_pio_read (int fd, u_char * buf, int n) { return -1; } -int +int sanei_pio_write (int fd, const u_char * buf, int n) { return -1; diff --git a/sanei/sanei_pp.c b/sanei/sanei_pp.c index dec84ee26..89f3232a8 100644 --- a/sanei/sanei_pp.c +++ b/sanei/sanei_pp.c @@ -38,7 +38,7 @@ * * 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. + * If you do not wish that, delete this exception notice. * * This file implements an interface for accessing the parallelport */ @@ -50,7 +50,7 @@ * 3 - things nice to know * 4 - code flow * 5 - detailed flow - * 6 - everything + * 6 - everything * * These debug levels can be set using the environment variable * SANE_DEBUG_SANEI_PP @@ -156,7 +156,7 @@ static unsigned long pp_thresh = 0; #if (defined (HAVE_IOPERM) || defined (HAVE_LIBIEEE1284)) && !defined (IO_SUPPORT_MISSING) typedef struct { - + #ifndef HAVE_LIBIEEE1284 const char name[6]; u_long base; /**< i/o base address */ @@ -166,7 +166,7 @@ typedef struct { u_int in_use; /**< port in use? */ u_int claimed; /**< port claimed? */ - + int caps; /**< port capabilities */ } PortRec, *Port; @@ -181,8 +181,8 @@ static PortRec port[_MAX_PORTS]; /** redefine the CAPability flags */ enum ieee1284_capabilities { - CAP1284_RAW = (1<<0), - CAP1284_NIBBLE = (1<<1), /* SPP mode */ + CAP1284_RAW = (1<<0), + CAP1284_NIBBLE = (1<<1), /* SPP mode */ CAP1284_BYTE = (1<<2), /* PS/2 bidirectional */ CAP1284_COMPAT = (1<<3), CAP1284_BECP = (1<<4), @@ -315,12 +315,12 @@ pp_showcaps( int caps ) char ct[1024]; ct[0] = '\0'; - + if( caps & CAP1284_NIBBLE ) { strcat( ct, "SPP " ); mode |= SANEI_PP_MODE_SPP; } - + if( caps & CAP1284_BYTE ) { strcat( ct, "PS/2 " ); mode |= SANEI_PP_MODE_BIDI; @@ -330,7 +330,7 @@ pp_showcaps( int caps ) strcat( ct, "EPP " ); mode |= SANEI_PP_MODE_EPP; } - + if( caps & CAP1284_EPPSWE ) { strcat( ct, "EPPSWE " ); mode |= SANEI_PP_MODE_EPP; @@ -357,13 +357,13 @@ pp_showcaps( int caps ) static int pp_probe( int fd ) { -#ifdef HAVE_IOPL +#ifdef HAVE_IOPL SANE_Byte c; int i, j; #endif SANE_Byte a, b; int retv = 0; - + DBG( 4, "pp_probe: port 0x%04lx\n", port[fd].base ); /* SPP check */ @@ -383,7 +383,7 @@ pp_probe( int fd ) #ifdef HAVE_IOPL /* clear at most 1k of data from FIFO */ - for( i = 1024; i > 0; i-- ) { + for( i = 1024; i > 0; i-- ) { a = inbyte402( fd ); if ((a & 0x03) == 0x03) goto no_ecp; @@ -428,7 +428,7 @@ pp_probe( int fd ) DBG( 4, "pp_probe: ECP with a %i byte FIFO present\n", i ); retv += CAP1284_ECP; } - + no_ecp: #endif /* check for PS/2 compatible port */ @@ -522,7 +522,7 @@ static int pp_set_scpmode( int fd ) { SANE_Byte tmp; DBG( 4, "pp_set_scpmode\n" ); - + #ifdef HAVE_IOPL tmp = inbyte402( fd ); tmp &= 0x1f; @@ -531,7 +531,7 @@ static int pp_set_scpmode( int fd ) tmp = inb_ctrl( fd ); tmp &= 0x0f; outb_ctrl ( fd, tmp ); - + return SANE_STATUS_GOOD; } @@ -547,7 +547,7 @@ static int pp_set_bidimode( int fd ) tmp = inb_ctrl( fd ); tmp = (tmp & 0x0f) | 0x20; outb_ctrl ( fd, tmp ); - + return SANE_STATUS_GOOD; } @@ -563,7 +563,7 @@ static int pp_set_eppmode( int fd ) tmp = inb_ctrl( fd ); tmp = (tmp & 0xf0) | 0x40; outb_ctrl ( fd, tmp ); - + return SANE_STATUS_GOOD; } @@ -572,7 +572,7 @@ static int pp_set_ecpmode( int fd ) #ifdef HAVE_IOPL SANE_Byte tmp; #endif - + DBG( 4, "pp_set_ecpmode\n" ); #ifdef HAVE_IOPL tmp = inbyte402( fd ); @@ -594,7 +594,7 @@ pp_setmode( int fd, int mode ) DBG( 2, "pp_setmode: mode not supported %d\n", mode ); return SANE_STATUS_UNSUPPORTED; } - + switch( mode ) { case SANEI_PP_MODE_SPP: ret = pp_set_scpmode( fd ); break; case SANEI_PP_MODE_BIDI: ret = pp_set_bidimode( fd ); break; @@ -715,13 +715,13 @@ pp_init( void ) } DBG( 3, "pp_init: %d ports reported by IEEE 1284 library\n", pplist.portc); - + for( i = 0; i < pplist.portc; i++ ) DBG( 6, "pp_init: port %d is `%s`\n", i, pplist.portv[i]->name); /* we support only up to _MAX_PORTS... */ if( pplist.portc > _MAX_PORTS ) { - DBG (1, "pp_init: Lib IEEE 1284 reports too much ports: %d\n", + DBG (1, "pp_init: Lib IEEE 1284 reports too much ports: %d\n", pplist.portc ); ieee1284_free_ports( &pplist ); @@ -759,7 +759,7 @@ pp_open( const char *dev, SANE_Status * status ) #else int result; #endif - + DBG( 4, "pp_open: trying to attach dev `%s`\n", dev ); #if !defined (HAVE_LIBIEEE1284) @@ -853,7 +853,7 @@ pp_open( const char *dev, SANE_Status * status ) /* TODO: insert FreeBSD compatible code here */ if( ioperm( port[i].base, 5, 1 )) { - DBG( 1, "pp_open: cannot get io privilege for port 0x%03lx\n", + DBG( 1, "pp_open: cannot get io privilege for port 0x%03lx\n", port[i].base); port[i].in_use = SANE_FALSE; @@ -867,7 +867,7 @@ pp_open( const char *dev, SANE_Status * status ) port[i].ecp_ctrl = inbyte402(i); port[i].ctrl = inb_ctrl(i); #endif - + /* check the capabilities of this port */ port[i].caps = pp_probe( i ); #endif @@ -908,7 +908,7 @@ pp_close( int fd, SANE_Status *status ) if( ioperm( port[fd].base, 5, 0 )) { #endif #if defined(HAVE_LIBIEEE1284) - DBG( 1, "pp_close: can't free port '%s' (%s)\n", + DBG( 1, "pp_close: can't free port '%s' (%s)\n", pplist.portv[fd]->name, pp_libieee1284_errorstr(result)); #else DBG( 1, "pp_close: can't free port 0x%03lx\n", port[fd].base ); @@ -930,7 +930,7 @@ SANE_Status sanei_pp_init( void ) { SANE_Status result; - + DBG_INIT(); result = pp_init(); @@ -1008,7 +1008,7 @@ sanei_pp_claim( int fd ) DBG( 2, "sanei_pp_claim: fd %d is invalid\n", fd ); return SANE_STATUS_INVAL; } - + result = ieee1284_claim (pplist.portv[fd]); if (result) { DBG (1, "sanei_pp_claim: failed (%s)\n", @@ -1018,7 +1018,7 @@ sanei_pp_claim( int fd ) #endif port[fd].claimed = SANE_TRUE; - + return SANE_STATUS_GOOD; } @@ -1032,11 +1032,11 @@ sanei_pp_release( int fd ) DBG( 2, "sanei_pp_release: fd %d is invalid\n", fd ); return SANE_STATUS_INVAL; } - + ieee1284_release( pplist.portv[fd] ); #endif port[fd].claimed = SANE_FALSE; - + return SANE_STATUS_GOOD; } @@ -1121,7 +1121,7 @@ sanei_pp_inb_data( int fd ) { #ifdef _PARANOIA DBG( 4, "sanei_pp_inb_data: called for fd %d\n", fd ); - + #if defined(HAVE_LIBIEEE1284) if ((fd < 0) || (fd >= pplist.portc)) { #else @@ -1139,7 +1139,7 @@ sanei_pp_inb_stat( int fd ) { #ifdef _PARANOIA DBG( 4, "sanei_pp_inb_stat: called for fd %d\n", fd ); - + #if defined(HAVE_LIBIEEE1284) if ((fd < 0) || (fd >= pplist.portc)) { #else @@ -1174,7 +1174,7 @@ sanei_pp_inb_epp( int fd ) { #ifdef _PARANOIA DBG( 4, "sanei_pp_inb_epp: called for fd %d\n", fd ); - + #if defined(HAVE_LIBIEEE1284) if ((fd < 0) || (fd >= pplist.portc)) { #else @@ -1224,7 +1224,7 @@ sanei_pp_setmode( int fd, int mode ) DBG( 2, "sanei_pp_setmode: invalid mode %d\n", mode ); return SANE_STATUS_INVAL; } - + #if defined(HAVE_LIBIEEE1284) switch( mode ) { case SANEI_PP_MODE_SPP: mode = M1284_NIBBLE; break; @@ -1267,7 +1267,7 @@ sanei_pp_udelay( unsigned long usec ) if( usec < pp_thresh ) return; - + do { gettimeofday( &now, NULL ); } while ((now.tv_sec < deadline.tv_sec) || diff --git a/sanei/sanei_pv8630.c b/sanei/sanei_pv8630.c index 848558efd..c9bafce7a 100644 --- a/sanei/sanei_pv8630.c +++ b/sanei/sanei_pv8630.c @@ -5,7 +5,7 @@ Copyright (C) 2001 Marcio Teixeira 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 diff --git a/sanei/sanei_scsi.c b/sanei/sanei_scsi.c index 2413d8fb0..ac094419e 100644 --- a/sanei/sanei_scsi.c +++ b/sanei/sanei_scsi.c @@ -252,11 +252,11 @@ static int unit_ready (int fd); #endif #if USE == SYSVR4_INTERFACE -# define MAX_DATA 56*1024 /* don't increase or kernel will dump - * tested with adsl, adsa and umax backend - * it depends on the lowend scsi - * drivers . But the most restriction - * is in the UNIXWARE KERNEL witch do +# define MAX_DATA 56*1024 /* don't increase or kernel will dump + * tested with adsl, adsa and umax backend + * it depends on the lowend scsi + * drivers . But the most restriction + * is in the UNIXWARE KERNEL witch do * not allow more then 64kB DMA transfers */ static char lastrcmd[16]; /* hold command block of last read command */ #endif @@ -875,7 +875,7 @@ sanei_scsi_open (const char *dev, int *fdp, int fd, i; #if USE == LINUX_INTERFACE static int first_time = 1; -#elif USE == MACOSX_INTERFACE +#elif USE == MACOSX_INTERFACE UInt8 *guid; int len; u_int d; @@ -909,7 +909,7 @@ sanei_scsi_open (const char *dev, int *fdp, With newer versions of the SG driver, check the available buffer size by opening all SG device files belonging to a scanner, issue the ioctl calls for setting and reading the reserved - buffer size, and take the smallest value. + buffer size, and take the smallest value. For older version of the SG driver, which don't support variable buffer size, try to read /proc/sys/kernel/sg-big-biff ; if @@ -1222,21 +1222,21 @@ sanei_scsi_open (const char *dev, int *fdp, { char scsi_hca_name[20]; u_int hca = 0; - + if (sscanf (dev, "h%ub%ut%ul%u", &hca, &bus, &target, &lun) != 4) { DBG (1, "sanei_scsi_open: device name %s is not valid\n", dev); return SANE_STATUS_INVAL; } - + snprintf(scsi_hca_name, 19, "\\\\.\\Scsi%d:", hca); scsi_hca_name[19] = 0; - + fd = CreateFile(scsi_hca_name, GENERIC_READ | GENERIC_WRITE, FILE_SHARE_READ | FILE_SHARE_WRITE, NULL, OPEN_EXISTING, FILE_FLAG_RANDOM_ACCESS, NULL ); - + if (fd == INVALID_HANDLE_VALUE) fd = -1; } #else @@ -1420,7 +1420,7 @@ sanei_scsi_open (const char *dev, int *fdp, else { /* we have a really old SG driver version, or we're not opening - an SG device file + an SG device file */ if (ioctl (fd, SG_GET_TIMEOUT, &ioctl_val) < 0) { @@ -2436,8 +2436,8 @@ issue (struct req *req) } #if 0 - /* Sometimes the Linux SCSI system reports bogus resid values. - Observed with lk 2.4.5, 2.4.13, aic7xxx and sym53c8xx drivers, + /* Sometimes the Linux SCSI system reports bogus resid values. + Observed with lk 2.4.5, 2.4.13, aic7xxx and sym53c8xx drivers, if command queueing is used. So we better issue only a warning */ if (status == SANE_STATUS_GOOD) @@ -2601,7 +2601,7 @@ issue (struct req *req) } static int /* Returns 1 if match with 'name' set, else 0 */ - + lx_scan_sg (int exclude_devnum, char *name, size_t name_len, int host, int channel, int id, int lun) { @@ -2636,7 +2636,7 @@ issue (struct req *req) } static int /* Returns 1 if match, else 0 */ - + lx_chk_devicename (int guess_devnum, char *name, size_t name_len, int host, int channel, int id, int lun) { @@ -3179,7 +3179,7 @@ sanei_scsi_find_devices (const char *findvendor, const char *findmodel, scsireq_t hdr; int result; -/* xxx obsolete: +/* xxx obsolete: cdb_size = CDB_SIZE (*(u_char *) src); */ @@ -5013,7 +5013,7 @@ sanei_scsi_find_devices (const char *findvendor, const char *findmodel, #if USE == WIN32_INTERFACE SANE_Status -sanei_scsi_cmd2 (int fd, +sanei_scsi_cmd2 (int fd, const void *cmd, size_t cmd_size, const void *src, size_t src_size, void *dst, size_t * dst_size) @@ -5049,8 +5049,8 @@ sanei_scsi_cmd2 (int fd, pkt.sptd.DataBuffer = src; } else { - pkt.sptd.DataIn = SCSI_IOCTL_DATA_UNSPECIFIED; - } + pkt.sptd.DataIn = SCSI_IOCTL_DATA_UNSPECIFIED; + } pkt.sptd.TimeOutValue = sane_scsicmd_timeout; @@ -5081,7 +5081,7 @@ sanei_scsi_cmd2 (int fd, else { return SANE_STATUS_IO_ERROR; } - } + } else if (pkt.sptd.ScsiStatus != 0) { DBG (1, "sanei_scsi_cmd2: ScsiStatus is %d\n", pkt.sptd.ScsiStatus); @@ -5152,14 +5152,14 @@ sanei_scsi_find_devices (const char *findvendor, const char *findmodel, adapter = (PSCSI_ADAPTER_BUS_INFO)buffer; - for(i = 0; i < adapter->NumberOfBuses; i++) { + for(i = 0; i < adapter->NumberOfBuses; i++) { if (adapter->BusData[i].InquiryDataOffset == 0) { /* No device here */ continue; } - inquiry = (PSCSI_INQUIRY_DATA) (buffer + + inquiry = (PSCSI_INQUIRY_DATA) (buffer + adapter->BusData[i].InquiryDataOffset); while(1) { diff --git a/sanei/sanei_thread.c b/sanei/sanei_thread.c index fcf52c14a..186523c7c 100644 --- a/sanei/sanei_thread.c +++ b/sanei/sanei_thread.c @@ -225,7 +225,7 @@ sanei_thread_begin( int (*func)(void *args), void* args ) DBG( 1, "_beginthread() failed\n" ); return -1; } - + DBG( 2, "_beginthread() created thread %d\n", pid ); return pid; } @@ -282,7 +282,7 @@ sanei_thread_begin( int (*func)(void *args), void* args ) DBG( 1, "resume_thread() failed\n" ); return -1; } - + DBG( 2, "spawn_thread() created thread %d\n", pid ); return pid; } @@ -374,7 +374,7 @@ restore_sigpipe( void ) sigemptyset( &act.sa_mask ); act.sa_flags = 0; act.sa_handler = SIG_DFL; - + DBG( 2, "restoring SIGPIPE to SIG_DFL\n" ); sigaction( SIGPIPE, &act, NULL ); } @@ -458,7 +458,7 @@ sanei_thread_begin( int (func)(void *args), void* args ) /* run in child context... */ int status = func( args ); - + /* don't use exit() since that would run the atexit() handlers */ _exit( status ); } @@ -511,7 +511,7 @@ sanei_thread_waitpid( SANE_Pid pid, int *status ) } if ( EDEADLK == rc ) { if ( (pthread_t)pid != pthread_self() ) { - /* call detach in any case to make sure that the thread resources + /* call detach in any case to make sure that the thread resources * will be freed, when the thread has terminated */ DBG(2, "* detaching thread(%ld)\n", pid ); diff --git a/sanei/sanei_wire.c b/sanei/sanei_wire.c index a43cc2e9c..32cd1a092 100644 --- a/sanei/sanei_wire.c +++ b/sanei/sanei_wire.c @@ -67,7 +67,7 @@ sanei_w_space (Wire * w, size_t howmuch) if (w->status != 0) { - DBG (1, "sanei_w_space: wire is in invalid state %d\n", + DBG (1, "sanei_w_space: wire is in invalid state %d\n", w->status); return; } @@ -81,7 +81,7 @@ sanei_w_space (Wire * w, size_t howmuch) case WIRE_ENCODE: nbytes = w->buffer.curr - w->buffer.start; w->buffer.curr = w->buffer.start; - DBG (4, "sanei_w_space: ENCODE: sending %lu bytes\n", + DBG (4, "sanei_w_space: ENCODE: sending %lu bytes\n", (u_long) nbytes); while (nbytes > 0) { @@ -184,7 +184,7 @@ sanei_w_array (Wire * w, SANE_Word * len_ptr, void **v, else DBG (1, "sanei_w_array: FREE: tried to free array but *len_ptr or *v " "was NULL\n"); - + DBG (4, "sanei_w_array: FREE: done\n"); return; } @@ -200,14 +200,14 @@ sanei_w_array (Wire * w, SANE_Word * len_ptr, void **v, return; } DBG (4, "sanei_w_array: array has %d elements\n", len); - + if (w->direction == WIRE_DECODE) { *len_ptr = len; if (len) { - if (((unsigned int) len) > MAX_MEM - || ((unsigned int) len * element_size) > MAX_MEM + if (((unsigned int) len) > MAX_MEM + || ((unsigned int) len * element_size) > MAX_MEM || (w->allocated_memory + len * element_size) > MAX_MEM) { DBG (0, "sanei_w_array: DECODE: maximum amount of allocated memory " @@ -291,7 +291,7 @@ sanei_w_ptr (Wire * w, void **v, WireCodecFunc w_value, size_t value_size) { DBG (0, "sanei_w_ptr: DECODE: maximum amount of allocated memory " "exceeded (limit: %u, new allocation: %lu, total: %lu bytes)\n", - MAX_MEM, (unsigned long)value_size, + MAX_MEM, (unsigned long)value_size, (unsigned long)(w->allocated_memory + value_size)); w->status = ENOMEM; return; @@ -581,8 +581,8 @@ flush (Wire * w) void sanei_w_set_dir (Wire * w, WireDirection dir) { - DBG (3, "sanei_w_set_dir: wire %d, old direction WIRE_%s\n", w->io.fd, - w->direction == WIRE_ENCODE ? "ENCODE" : + DBG (3, "sanei_w_set_dir: wire %d, old direction WIRE_%s\n", w->io.fd, + w->direction == WIRE_ENCODE ? "ENCODE" : (w->direction == WIRE_DECODE ? "DECODE" : "FREE")); if (w->direction == WIRE_DECODE && w->buffer.curr != w->buffer.end) DBG (1, "sanei_w_set_dir: WARNING: will delete %lu bytes from buffer\n", @@ -591,8 +591,8 @@ sanei_w_set_dir (Wire * w, WireDirection dir) w->direction = dir; DBG (4, "sanei_w_set_dir: direction changed\n"); flush (w); - DBG (3, "sanei_w_set_dir: wire %d, new direction WIRE_%s\n", w->io.fd, - dir == WIRE_ENCODE ? "ENCODE" : + DBG (3, "sanei_w_set_dir: wire %d, new direction WIRE_%s\n", w->io.fd, + dir == WIRE_ENCODE ? "ENCODE" : (dir == WIRE_DECODE ? "DECODE" : "FREE")); } @@ -656,13 +656,13 @@ void sanei_w_init (Wire * w, void (*codec_init_func) (Wire *)) { DBG_INIT (); - + DBG (3, "sanei_w_init: initializing\n"); w->status = 0; w->direction = WIRE_ENCODE; w->buffer.size = 8192; w->buffer.start = malloc (w->buffer.size); - + if (w->buffer.start == 0) { /* Malloc failed, so return an error. */ diff --git a/testsuite/Makefile.am b/testsuite/Makefile.am index 9e9eac7f5..998dfc659 100644 --- a/testsuite/Makefile.am +++ b/testsuite/Makefile.am @@ -22,7 +22,7 @@ help: test: test.local -test.local: +test.local: @echo "**** Testing $(SCANIMAGE) with device $(DEVICE)" @if echo "---> Trying flatbed scanner" && \ $(SCANIMAGE) -d $(DEVICE) -T && \ diff --git a/testsuite/sanei/README b/testsuite/sanei/README index 247d1919d..25b11cd88 100644 --- a/testsuite/sanei/README +++ b/testsuite/sanei/README @@ -7,7 +7,7 @@ and run by 'make check'. sanei_usb_test --------------- Tests sanei_usb_* functions. No USB scanner needs to be plugged, -but in this case less code is covered (open/close and claim/release +but in this case less code is covered (open/close and claim/release of real devices). Function currently tested are: - sanei_usb_init() diff --git a/testsuite/sanei/data/umax_pp.conf b/testsuite/sanei/data/umax_pp.conf index 69cc47d8e..eb84f74c0 100644 --- a/testsuite/sanei/data/umax_pp.conf +++ b/testsuite/sanei/data/umax_pp.conf @@ -8,12 +8,12 @@ option buffer 1048576 # DEVICES # -# specify the port your scanner is connected to. +# specify the port your scanner is connected to. # # the value 'auto' will make the backend find the correct value # by itself, it will scan ppdev, ppi device, then hardware address # 'safe-auto' will do the same but won't do direct hardware access -# on linux systems, you may provide the device name of the ppdev character +# on linux systems, you may provide the device name of the ppdev character # device : /dev/parport0, /dev/parport1, ...... # # on *BSD, you may provide the device name of the ppi device: /dev/ppi0, @@ -58,7 +58,7 @@ option blue-offset 6 # valid values are 610, 1220, 1600 and 2000 # # by default, no model, we rely on autodetection -# in case you have black or 'inverted' scans, +# in case you have black or 'inverted' scans, # you may override detection by providing the # model number option astra 1600 diff --git a/testsuite/sanei/sanei_check_test.c b/testsuite/sanei/sanei_check_test.c index a149b7e6f..db4f2e4c0 100644 --- a/testsuite/sanei/sanei_check_test.c +++ b/testsuite/sanei/sanei_check_test.c @@ -427,7 +427,7 @@ wrong_bool_array (void) /** - * run the test suite for sanei_check_value related tests + * run the test suite for sanei_check_value related tests */ static void sanei_check_suite (void) diff --git a/testsuite/sanei/sanei_config_test.c b/testsuite/sanei/sanei_config_test.c index 3d1f5afc2..ea0043320 100644 --- a/testsuite/sanei/sanei_config_test.c +++ b/testsuite/sanei/sanei_config_test.c @@ -863,7 +863,7 @@ snapscan (void) /** - * create the test suite for sanei config related tests + * create the test suite for sanei config related tests */ static void sanei_config_suite (void) @@ -890,7 +890,7 @@ sanei_config_suite (void) } /** - * main function to run the test suites + * main function to run the test suites */ int main (void) diff --git a/testsuite/sanei/sanei_constrain_test.c b/testsuite/sanei/sanei_constrain_test.c index 0f66bbb5c..9ddb61af1 100644 --- a/testsuite/sanei/sanei_constrain_test.c +++ b/testsuite/sanei/sanei_constrain_test.c @@ -271,7 +271,7 @@ max_fixed_value (void) /* check results */ assert (status == SANE_STATUS_GOOD); assert (info == 0); - assert (value == fixed_range.max); + assert (value == fixed_range.max); } static void @@ -721,7 +721,7 @@ string_array_ok (void) } /** - * run the test suite for sanei constrain related tests + * run the test suite for sanei constrain related tests */ static void sanei_constrain_suite (void) @@ -781,7 +781,7 @@ sanei_constrain_suite (void) } /** - * main function to run the test suites + * main function to run the test suites */ int main (void) diff --git a/testsuite/tools/Makefile.am b/testsuite/tools/Makefile.am index 71188d289..836e0b098 100644 --- a/testsuite/tools/Makefile.am +++ b/testsuite/tools/Makefile.am @@ -26,7 +26,7 @@ help: check: check.local -check.local: +check.local: @echo "**** Testing $(SANEDESC) with $(TESTFILE)" @for mode in ascii html-backends-split html-mfgs xml statistics usermap db udev udev+acl udev+hwdb hwdb plist hal hal-new; \ do \ diff --git a/testsuite/tools/README b/testsuite/tools/README index ac32db9a8..dcd62611e 100644 --- a/testsuite/tools/README +++ b/testsuite/tools/README @@ -5,6 +5,6 @@ This directory contains test for tools programs. They are run by 'make check'. sane-desc --------- - sane-desc is ran for all known modes, using a test 'desc' file. + sane-desc is ran for all known modes, using a test 'desc' file. The output is compared to a reference file for the same mode. Test fails if they are different. diff --git a/testsuite/tools/data/db.ref b/testsuite/tools/data/db.ref index f293b5bf5..bbf08fba6 100644 --- a/testsuite/tools/data/db.ref +++ b/testsuite/tools/data/db.ref @@ -25,1338 +25,1338 @@ # the sane-devel mailing list (sane-devel@lists.alioth.debian.org). # # Hewlett-Packard ScanJet 4100C -0x03f0 0x0101 root:scanner 0664 +0x03f0 0x0101 root:scanner 0664 # Hewlett-Packard ScanJet 4200C | Hewlett-Packard ScanJet 4200Cxi | Hewlett-Packard ScanJet 4200Cse -0x03f0 0x0105 root:scanner 0664 +0x03f0 0x0105 root:scanner 0664 # Hewlett-Packard ScanJet 6200C | Hewlett-Packard ScanJet 6250C -0x03f0 0x0201 root:scanner 0664 +0x03f0 0x0201 root:scanner 0664 # Hewlett-Packard ScanJet 3300c -0x03f0 0x0205 root:scanner 0664 +0x03f0 0x0205 root:scanner 0664 # Hewlett-Packard ScanJet 4300c -0x03f0 0x0305 root:scanner 0664 +0x03f0 0x0305 root:scanner 0664 # Hewlett-Packard ScanJet 5200C -0x03f0 0x0401 root:scanner 0664 +0x03f0 0x0401 root:scanner 0664 # Hewlett-Packard ScanJet 3400c -0x03f0 0x0405 root:scanner 0664 +0x03f0 0x0405 root:scanner 0664 # Hewlett-Packard ScanJet 2100C -0x03f0 0x0505 root:scanner 0664 +0x03f0 0x0505 root:scanner 0664 # Hewlett-Packard ScanJet 6300C | Hewlett-Packard ScanJet 6350C | Hewlett-Packard ScanJet 6390C -0x03f0 0x0601 root:scanner 0664 +0x03f0 0x0601 root:scanner 0664 # Hewlett-Packard ScanJet 2200C -0x03f0 0x0605 root:scanner 0664 +0x03f0 0x0605 root:scanner 0664 # Hewlett-Packard ScanJet 5300C | Hewlett-Packard ScanJet 5370C -0x03f0 0x0701 root:scanner 0664 +0x03f0 0x0701 root:scanner 0664 # Hewlett-Packard scanjet 4400c -0x03f0 0x0705 root:scanner 0664 +0x03f0 0x0705 root:scanner 0664 # Hewlett-Packard ScanJet 7400c | Hewlett-Packard ScanJet 7450c | Hewlett-Packard ScanJet 7490c -0x03f0 0x0801 root:scanner 0664 +0x03f0 0x0801 root:scanner 0664 # Hewlett-Packard scanjet 4470c -0x03f0 0x0805 root:scanner 0664 +0x03f0 0x0805 root:scanner 0664 # Hewlett-Packard ScanJet 2300C -0x03f0 0x0901 root:scanner 0664 +0x03f0 0x0901 root:scanner 0664 # Hewlett-Packard ScanJet 2400C | Hewlett-Packard ScanJet G2410 -0x03f0 0x0a01 root:scanner 0664 +0x03f0 0x0a01 root:scanner 0664 # Hewlett-Packard ScanJet 8200 | Hewlett-Packard ScanJet 8250 | Hewlett-Packard ScanJet 8290 -0x03f0 0x0b01 root:scanner 0664 +0x03f0 0x0b01 root:scanner 0664 # Hewlett-Packard ScanJet 5400c -0x03f0 0x1005 root:scanner 0664 +0x03f0 0x1005 root:scanner 0664 # Hewlett-Packard ScanJet 5470c -0x03f0 0x1105 root:scanner 0664 +0x03f0 0x1105 root:scanner 0664 # Hewlett-Packard ScanJet 4500C | Hewlett-Packard ScanJet 5550C -0x03f0 0x1205 root:scanner 0664 +0x03f0 0x1205 root:scanner 0664 # Hewlett-Packard ScanJet 4570C | Hewlett-Packard ScanJet 5500C -0x03f0 0x1305 root:scanner 0664 +0x03f0 0x1305 root:scanner 0664 # Hewlett-Packard ScanJet 3670C | Hewlett-Packard ScanJet 3690C -0x03f0 0x1405 root:scanner 0664 +0x03f0 0x1405 root:scanner 0664 # Hewlett-Packard ScanJet 5590 -0x03f0 0x1705 root:scanner 0664 +0x03f0 0x1705 root:scanner 0664 # Hewlett-Packard ScanJet 7650 -0x03f0 0x1805 root:scanner 0664 +0x03f0 0x1805 root:scanner 0664 # Hewlett-Packard ScanJet 4850C -0x03f0 0x1b05 root:scanner 0664 +0x03f0 0x1b05 root:scanner 0664 # Hewlett-Packard ScanJet 3530C | Hewlett-Packard ScanJet 3570C -0x03f0 0x2005 root:scanner 0664 +0x03f0 0x2005 root:scanner 0664 # Hewlett-Packard ScanJet 3500C -0x03f0 0x2205 root:scanner 0664 +0x03f0 0x2205 root:scanner 0664 # Hewlett-Packard ScanJet 3970c -0x03f0 0x2305 root:scanner 0664 +0x03f0 0x2305 root:scanner 0664 # Hewlett-Packard ScanJet 4070 Photosmart -0x03f0 0x2405 root:scanner 0664 +0x03f0 0x2405 root:scanner 0664 # Hewlett-Packard ScanJet 3800 -0x03f0 0x2605 root:scanner 0664 +0x03f0 0x2605 root:scanner 0664 # Hewlett-Packard ScanJet G2710 -0x03f0 0x2805 root:scanner 0664 +0x03f0 0x2805 root:scanner 0664 # Hewlett-Packard ScanJet 8300 | Hewlett-Packard ScanJet 8350 | Hewlett-Packard ScanJet 8390 -0x03f0 0x3805 root:scanner 0664 +0x03f0 0x3805 root:scanner 0664 # Hewlett-Packard ScanJet 8270 -0x03f0 0x3905 root:scanner 0664 +0x03f0 0x3905 root:scanner 0664 # Hewlett-Packard LaserJet M1005 MFP -0x03f0 0x3b17 root:scanner 0664 +0x03f0 0x3b17 root:scanner 0664 # Hewlett-Packard ScanJet 4370 -0x03f0 0x4105 root:scanner 0664 +0x03f0 0x4105 root:scanner 0664 # Hewlett-Packard ScanJet G3010 -0x03f0 0x4205 root:scanner 0664 +0x03f0 0x4205 root:scanner 0664 # Hewlett-Packard ScanJet G3110 -0x03f0 0x4305 root:scanner 0664 +0x03f0 0x4305 root:scanner 0664 # Hewlett-Packard ScanJet G4010 -0x03f0 0x4505 root:scanner 0664 +0x03f0 0x4505 root:scanner 0664 # Hewlett-Packard ScanJet G4050 -0x03f0 0x4605 root:scanner 0664 +0x03f0 0x4605 root:scanner 0664 # Hewlett-Packard ScanJet N6310 -0x03f0 0x4705 root:scanner 0664 +0x03f0 0x4705 root:scanner 0664 # Hewlett-Packard LaserJet M1120 MFP -0x03f0 0x5617 root:scanner 0664 +0x03f0 0x5617 root:scanner 0664 # Hewlett-Packard LaserJet M1120n MFP -0x03f0 0x5717 root:scanner 0664 +0x03f0 0x5717 root:scanner 0664 # Mustek BearPaw 1200 -0x0400 0x1000 root:scanner 0664 +0x0400 0x1000 root:scanner 0664 # Mustek BearPaw 1200 | Mustek BearPaw 2400 -0x0400 0x1001 root:scanner 0664 +0x0400 0x1001 root:scanner 0664 # Kodak ESP 5100 -0x040a 0x4025 root:scanner 0664 +0x040a 0x4025 root:scanner 0664 # Kodak ESP 5300 -0x040a 0x4026 root:scanner 0664 +0x040a 0x4026 root:scanner 0664 # Kodak ESP 5500 -0x040a 0x4027 root:scanner 0664 +0x040a 0x4027 root:scanner 0664 # Kodak ESP 5000 -0x040a 0x4028 root:scanner 0664 +0x040a 0x4028 root:scanner 0664 # Kodak ESP 3300 -0x040a 0x4031 root:scanner 0664 +0x040a 0x4031 root:scanner 0664 # Kodak ESP 5 -0x040a 0x4032 root:scanner 0664 +0x040a 0x4032 root:scanner 0664 # Kodak ESP 7 -0x040a 0x403e root:scanner 0664 +0x040a 0x403e root:scanner 0664 # Kodak ESP 9 -0x040a 0x403f root:scanner 0664 +0x040a 0x403f root:scanner 0664 # Kodak ESP 5200 -0x040a 0x4041 root:scanner 0664 +0x040a 0x4041 root:scanner 0664 # Kodak ESP 3200 -0x040a 0x4043 root:scanner 0664 +0x040a 0x4043 root:scanner 0664 # Kodak ESP 4100 -0x040a 0x4053 root:scanner 0664 +0x040a 0x4053 root:scanner 0664 # Kodak ESP 6100 -0x040a 0x4054 root:scanner 0664 +0x040a 0x4054 root:scanner 0664 # Kodak ESP 7200 -0x040a 0x4056 root:scanner 0664 +0x040a 0x4056 root:scanner 0664 # Kodak ESP C110 -0x040a 0x4057 root:scanner 0664 +0x040a 0x4057 root:scanner 0664 # Kodak ESP C115 -0x040a 0x4058 root:scanner 0664 +0x040a 0x4058 root:scanner 0664 # Kodak ESP 2150 -0x040a 0x4059 root:scanner 0664 +0x040a 0x4059 root:scanner 0664 # Kodak ESP C310 -0x040a 0x405d root:scanner 0664 +0x040a 0x405d root:scanner 0664 # Kodak ESP C315 -0x040a 0x405e root:scanner 0664 +0x040a 0x405e root:scanner 0664 # Advent AW10 -0x040a 0x4060 root:scanner 0664 +0x040a 0x4060 root:scanner 0664 # Kodak Hero Office 6.1 -0x040a 0x4062 root:scanner 0664 +0x040a 0x4062 root:scanner 0664 # Kodak Hero 7.1 -0x040a 0x4063 root:scanner 0664 +0x040a 0x4063 root:scanner 0664 # Kodak Hero 5.1 -0x040a 0x4064 root:scanner 0664 +0x040a 0x4064 root:scanner 0664 # Kodak ESP 9200 -0x040a 0x4065 root:scanner 0664 +0x040a 0x4065 root:scanner 0664 # Kodak ESP 2170 -0x040a 0x4066 root:scanner 0664 +0x040a 0x4066 root:scanner 0664 # Kodak Hero 9.1 -0x040a 0x4067 root:scanner 0664 +0x040a 0x4067 root:scanner 0664 # Kodak Hero 3.1 -0x040a 0x406d root:scanner 0664 +0x040a 0x406d root:scanner 0664 # Kodak i30 -0x040a 0x6001 root:scanner 0664 +0x040a 0x6001 root:scanner 0664 # Kodak i40 -0x040a 0x6002 root:scanner 0664 +0x040a 0x6002 root:scanner 0664 # Kodak i50 | Kodak i55 -0x040a 0x6003 root:scanner 0664 +0x040a 0x6003 root:scanner 0664 # Kodak i60 | Kodak i65 -0x040a 0x6004 root:scanner 0664 +0x040a 0x6004 root:scanner 0664 # Kodak i80 -0x040a 0x6005 root:scanner 0664 +0x040a 0x6005 root:scanner 0664 # Creative WebCam Go Mini -0x041e 0x4007 root:scanner 0664 +0x041e 0x4007 root:scanner 0664 # Lexmark X70 | Lexmark X73 -0x043d 0x002d root:scanner 0664 +0x043d 0x002d root:scanner 0664 # Lexmark X74 -0x043d 0x0060 root:scanner 0664 +0x043d 0x0060 root:scanner 0664 # Lexmark X1110 | Lexmark X1130 | Lexmark X1140 | Lexmark X1150 | Lexmark X1170 | Lexmark X1180 | Lexmark X1185 | Lexmark X1195 -0x043d 0x007c root:scanner 0664 +0x043d 0x007c root:scanner 0664 # Lexmark X12xx -0x043d 0x007d root:scanner 0664 +0x043d 0x007d root:scanner 0664 # Genius ColorPage HR6 V1 -0x0458 0x2004 root:scanner 0664 +0x0458 0x2004 root:scanner 0664 # Genius Colorpage HR6 V2 -0x0458 0x2007 root:scanner 0664 +0x0458 0x2007 root:scanner 0664 # Genius Colorpage HR6 V2 -0x0458 0x2008 root:scanner 0664 +0x0458 0x2008 root:scanner 0664 # Genius Colorpage HR6A -0x0458 0x2009 root:scanner 0664 +0x0458 0x2009 root:scanner 0664 # Genius Colorpage Vivid3x | Genius Colorpage Vivid3 V2 -0x0458 0x2011 root:scanner 0664 +0x0458 0x2011 root:scanner 0664 # Genius Colorpage HR7 -0x0458 0x2013 root:scanner 0664 +0x0458 0x2013 root:scanner 0664 # Genius Colorpage Vivid4 -0x0458 0x2014 root:scanner 0664 +0x0458 0x2014 root:scanner 0664 # Genius Colorpage HR7LE -0x0458 0x2015 root:scanner 0664 +0x0458 0x2015 root:scanner 0664 # Genius Colorpage HR6X -0x0458 0x2016 root:scanner 0664 +0x0458 0x2016 root:scanner 0664 # Genius Colorpage Vivid3xe -0x0458 0x2017 root:scanner 0664 +0x0458 0x2017 root:scanner 0664 # Genius Colorpage Vivid4xe -0x0458 0x201a root:scanner 0664 +0x0458 0x201a root:scanner 0664 # Genius Colorpage Vivid4x -0x0458 0x201b root:scanner 0664 +0x0458 0x201b root:scanner 0664 # Genius Colorpage Vivid 1200 X -0x0458 0x201d root:scanner 0664 +0x0458 0x201d root:scanner 0664 # Genius ColorPage Slim 1200 -0x0458 0x201e root:scanner 0664 +0x0458 0x201e root:scanner 0664 # Genius Colorpage Vivid 1200 XE -0x0458 0x201f root:scanner 0664 +0x0458 0x201f root:scanner 0664 # Genius Colorpage SF600 -0x0458 0x2021 root:scanner 0664 +0x0458 0x2021 root:scanner 0664 # Medion/Lifetec/Tevion/Cytron MD5345 | Medion/Lifetec/Tevion/Cytron MD6228 | Medion/Lifetec/Tevion/Cytron MD6471 -0x0461 0x0377 root:scanner 0664 +0x0461 0x0377 root:scanner 0664 # Xerox 2400 Onetouch -0x0461 0x038b root:scanner 0664 +0x0461 0x038b root:scanner 0664 # Trust Office Scan USB 19200 -0x047b 0x1000 root:scanner 0664 +0x047b 0x1000 root:scanner 0664 # Hewlett-Packard ScanJet 4300c/Silitek -0x047b 0x1002 root:scanner 0664 +0x047b 0x1002 root:scanner 0664 # Kyocera FS-1016MFP -0x0482 0x0335 root:scanner 0664 +0x0482 0x0335 root:scanner 0664 # Compaq S4-100 -0x049f 0x001a root:scanner 0664 +0x049f 0x001a root:scanner 0664 # Benq (Acer) 310U -0x04a5 0x1a20 root:scanner 0664 +0x04a5 0x1a20 root:scanner 0664 # Benq (Acer) 620U -0x04a5 0x1a2a root:scanner 0664 +0x04a5 0x1a2a root:scanner 0664 # Benq (Acer) 320U | Benq (Acer) 340U | Mitsubishi Diamondview 648UT -0x04a5 0x2022 root:scanner 0664 +0x04a5 0x2022 root:scanner 0664 # Benq (Acer) 620UT -0x04a5 0x2040 root:scanner 0664 +0x04a5 0x2040 root:scanner 0664 # Benq (Acer) 640U | Guillemot / Hercules Maxi Scan A4 USB 640U | Guillemot / Hercules Maxi A4 36 bit -0x04a5 0x2060 root:scanner 0664 +0x04a5 0x2060 root:scanner 0664 # Benq (Acer) 640bu -0x04a5 0x207e root:scanner 0664 +0x04a5 0x207e root:scanner 0664 # Benq (Acer) 3300 | Benq (Acer) 4300 | Mitsubishi Diamondview 650U -0x04a5 0x20b0 root:scanner 0664 +0x04a5 0x20b0 root:scanner 0664 # Benq (Acer) 640BT -0x04a5 0x20be root:scanner 0664 +0x04a5 0x20be root:scanner 0664 # Benq (Acer) 1240 -0x04a5 0x20c0 root:scanner 0664 +0x04a5 0x20c0 root:scanner 0664 # Benq (Acer) 3300 | Benq (Acer) 4300 | Guillemot / Hercules Scan@home Touch 1248 (USB) -0x04a5 0x20de root:scanner 0664 +0x04a5 0x20de root:scanner 0664 # Benq (Acer) 5000 -0x04a5 0x20f8 root:scanner 0664 +0x04a5 0x20f8 root:scanner 0664 # Benq (Acer) 5000E | Benq (Acer) 5000U -0x04a5 0x20fc root:scanner 0664 +0x04a5 0x20fc root:scanner 0664 # Benq (Acer) 5300 -0x04a5 0x20fe root:scanner 0664 +0x04a5 0x20fe root:scanner 0664 # Benq (Acer) 5150 | Benq (Acer) 5250 -0x04a5 0x2137 root:scanner 0664 +0x04a5 0x2137 root:scanner 0664 # BenQ 5550 -0x04a5 0x2211 root:scanner 0664 +0x04a5 0x2211 root:scanner 0664 # Visioneer Visioneer OneTouch 7100 -0x04a7 0x0229 root:scanner 0664 +0x04a7 0x0229 root:scanner 0664 # Visioneer 9650 -0x04a7 0x0390 root:scanner 0664 +0x04a7 0x0390 root:scanner 0664 # Visioneer 9320 -0x04a7 0x0420 root:scanner 0664 +0x04a7 0x0420 root:scanner 0664 # Visioneer 9450 -0x04a7 0x0421 root:scanner 0664 +0x04a7 0x0421 root:scanner 0664 # Visioneer 9550 -0x04a7 0x0422 root:scanner 0664 +0x04a7 0x0422 root:scanner 0664 # Visioneer 9750 -0x04a7 0x0423 root:scanner 0664 +0x04a7 0x0423 root:scanner 0664 # Visioneer Strobe XP 450 -0x04a7 0x0424 root:scanner 0664 +0x04a7 0x0424 root:scanner 0664 # Visioneer Strobe XP 200 -0x04a7 0x0426 root:scanner 0664 +0x04a7 0x0426 root:scanner 0664 # Visioneer Strobe XP 100 -0x04a7 0x0427 root:scanner 0664 +0x04a7 0x0427 root:scanner 0664 # Visioneer OneTouch 7300 -0x04a7 0x0444 root:scanner 0664 +0x04a7 0x0444 root:scanner 0664 # Xerox DocuMate510 -0x04a7 0x0446 root:scanner 0664 +0x04a7 0x0446 root:scanner 0664 # Xerox DocuMate520 -0x04a7 0x0447 root:scanner 0664 +0x04a7 0x0447 root:scanner 0664 # Xerox DocuMate250 -0x04a7 0x0448 root:scanner 0664 +0x04a7 0x0448 root:scanner 0664 # Xerox DocuMate252 -0x04a7 0x0449 root:scanner 0664 +0x04a7 0x0449 root:scanner 0664 # Xerox DocuMate262 -0x04a7 0x044c root:scanner 0664 +0x04a7 0x044c root:scanner 0664 # Visioneer Strobe XP 300 -0x04a7 0x0474 root:scanner 0664 +0x04a7 0x0474 root:scanner 0664 # Xerox DocuMate272 -0x04a7 0x0475 root:scanner 0664 +0x04a7 0x0475 root:scanner 0664 # Xerox DocuMate232 -0x04a7 0x0476 root:scanner 0664 +0x04a7 0x0476 root:scanner 0664 # Xerox DocuMate152 -0x04a7 0x0477 root:scanner 0664 +0x04a7 0x0477 root:scanner 0664 # Xerox DocuMate752 -0x04a7 0x0478 root:scanner 0664 +0x04a7 0x0478 root:scanner 0664 # Visioneer Strobe XP 470 -0x04a7 0x0479 root:scanner 0664 +0x04a7 0x0479 root:scanner 0664 # Visioneer 9450-G -0x04a7 0x047a root:scanner 0664 +0x04a7 0x047a root:scanner 0664 # Visioneer 9650-G -0x04a7 0x047b root:scanner 0664 +0x04a7 0x047b root:scanner 0664 # Xerox DocuMate510-G -0x04a7 0x047c root:scanner 0664 +0x04a7 0x047c root:scanner 0664 # Xerox DocuMate252-G -0x04a7 0x048c root:scanner 0664 +0x04a7 0x048c root:scanner 0664 # Xerox DocuMate262-G -0x04a7 0x048d root:scanner 0664 +0x04a7 0x048d root:scanner 0664 # Xerox DocuMate272-G -0x04a7 0x048e root:scanner 0664 +0x04a7 0x048e root:scanner 0664 # Visioneer Strobe XP 470-G | Visioneer Patriot 470 -0x04a7 0x048f root:scanner 0664 +0x04a7 0x048f root:scanner 0664 # Xerox DocuMate250-G -0x04a7 0x0490 root:scanner 0664 +0x04a7 0x0490 root:scanner 0664 # Visioneer Strobe XP 450-G -0x04a7 0x0491 root:scanner 0664 +0x04a7 0x0491 root:scanner 0664 # Xerox DocuMate520-G -0x04a7 0x0492 root:scanner 0664 +0x04a7 0x0492 root:scanner 0664 # Visioneer 9750-G -0x04a7 0x0493 root:scanner 0664 +0x04a7 0x0493 root:scanner 0664 # Visioneer Roadwarrior -0x04a7 0x0494 root:scanner 0664 +0x04a7 0x0494 root:scanner 0664 # Xerox DocuMate512 -0x04a7 0x0495 root:scanner 0664 +0x04a7 0x0495 root:scanner 0664 # Visioneer Patriot 430 -0x04a7 0x0497 root:scanner 0664 +0x04a7 0x0497 root:scanner 0664 # Visioneer Patriot 680 | Xerox DocuMate632 -0x04a7 0x0498 root:scanner 0664 +0x04a7 0x0498 root:scanner 0664 # Visioneer Patriot 780 -0x04a7 0x0499 root:scanner 0664 +0x04a7 0x0499 root:scanner 0664 # Xerox DocuMate752 -0x04a7 0x049a root:scanner 0664 +0x04a7 0x049a root:scanner 0664 # Visioneer Strobe XP 100,r3 -0x04a7 0x049b root:scanner 0664 +0x04a7 0x049b root:scanner 0664 # Xerox DocuMate150 -0x04a7 0x049c root:scanner 0664 +0x04a7 0x049c root:scanner 0664 # Xerox DocuMate162 -0x04a7 0x049d root:scanner 0664 +0x04a7 0x049d root:scanner 0664 # Xerox DocuMate262i -0x04a7 0x04a7 root:scanner 0664 +0x04a7 0x04a7 root:scanner 0664 # Xerox Travel Scanner 100 -0x04a7 0x04ac root:scanner 0664 +0x04a7 0x04ac root:scanner 0664 # Canon DR-2080C -0x04a9 0x1601 root:scanner 0664 +0x04a9 0x1601 root:scanner 0664 # Canon CR-180 | Canon CR-180II -0x04a9 0x1602 root:scanner 0664 +0x04a9 0x1602 root:scanner 0664 # Canon DR-9080C -0x04a9 0x1603 root:scanner 0664 +0x04a9 0x1603 root:scanner 0664 # Canon DR-7080C -0x04a9 0x1604 root:scanner 0664 +0x04a9 0x1604 root:scanner 0664 # Canon DR-5010C -0x04a9 0x1606 root:scanner 0664 +0x04a9 0x1606 root:scanner 0664 # Canon DR-6080 -0x04a9 0x1607 root:scanner 0664 +0x04a9 0x1607 root:scanner 0664 # Canon DR-2580C -0x04a9 0x1608 root:scanner 0664 +0x04a9 0x1608 root:scanner 0664 # Canon DR-3080CII -0x04a9 0x1609 root:scanner 0664 +0x04a9 0x1609 root:scanner 0664 # Canon DR-2050C | Canon DR-2050SP -0x04a9 0x160a root:scanner 0664 +0x04a9 0x160a root:scanner 0664 # Canon DR-7580 -0x04a9 0x160b root:scanner 0664 +0x04a9 0x160b root:scanner 0664 # Canon PIXMA MP750 -0x04a9 0x1706 root:scanner 0664 +0x04a9 0x1706 root:scanner 0664 # Canon PIXMA MP780 | Canon PIXMA MP790 -0x04a9 0x1707 root:scanner 0664 +0x04a9 0x1707 root:scanner 0664 # Canon PIXMA MP760 | Canon PIXMA MP770 -0x04a9 0x1708 root:scanner 0664 +0x04a9 0x1708 root:scanner 0664 # Canon PIXMA MP150 -0x04a9 0x1709 root:scanner 0664 +0x04a9 0x1709 root:scanner 0664 # Canon PIXMA MP170 -0x04a9 0x170a root:scanner 0664 +0x04a9 0x170a root:scanner 0664 # Canon PIXMA MP450 -0x04a9 0x170b root:scanner 0664 +0x04a9 0x170b root:scanner 0664 # Canon PIXMA MP500 -0x04a9 0x170c root:scanner 0664 +0x04a9 0x170c root:scanner 0664 # Canon PIXMA MP800 -0x04a9 0x170d root:scanner 0664 +0x04a9 0x170d root:scanner 0664 # Canon PIXMA MP800R -0x04a9 0x170e root:scanner 0664 +0x04a9 0x170e root:scanner 0664 # Canon PIXMA MP530 -0x04a9 0x1712 root:scanner 0664 +0x04a9 0x1712 root:scanner 0664 # Canon PIXMA MP830 -0x04a9 0x1713 root:scanner 0664 +0x04a9 0x1713 root:scanner 0664 # Canon PIXMA MP160 -0x04a9 0x1714 root:scanner 0664 +0x04a9 0x1714 root:scanner 0664 # Canon PIXMA MP180 -0x04a9 0x1715 root:scanner 0664 +0x04a9 0x1715 root:scanner 0664 # Canon PIXMA MP460 -0x04a9 0x1716 root:scanner 0664 +0x04a9 0x1716 root:scanner 0664 # Canon PIXMA MP510 -0x04a9 0x1717 root:scanner 0664 +0x04a9 0x1717 root:scanner 0664 # Canon PIXMA MP600 -0x04a9 0x1718 root:scanner 0664 +0x04a9 0x1718 root:scanner 0664 # Canon PIXMA MP600R -0x04a9 0x1719 root:scanner 0664 +0x04a9 0x1719 root:scanner 0664 # Canon PIXMA MP810 -0x04a9 0x171a root:scanner 0664 +0x04a9 0x171a root:scanner 0664 # Canon PIXMA MP960 -0x04a9 0x171b root:scanner 0664 +0x04a9 0x171b root:scanner 0664 # Canon PIXMA MX7600 -0x04a9 0x171c root:scanner 0664 +0x04a9 0x171c root:scanner 0664 # Canon PIXMA MP210 -0x04a9 0x1721 root:scanner 0664 +0x04a9 0x1721 root:scanner 0664 # Canon PIXMA MP220 -0x04a9 0x1722 root:scanner 0664 +0x04a9 0x1722 root:scanner 0664 # Canon PIXMA MP470 -0x04a9 0x1723 root:scanner 0664 +0x04a9 0x1723 root:scanner 0664 # Canon PIXMA MP520 -0x04a9 0x1724 root:scanner 0664 +0x04a9 0x1724 root:scanner 0664 # Canon PIXMA MP610 -0x04a9 0x1725 root:scanner 0664 +0x04a9 0x1725 root:scanner 0664 # Canon PIXMA MP970 -0x04a9 0x1726 root:scanner 0664 +0x04a9 0x1726 root:scanner 0664 # Canon PIXMA MX300 -0x04a9 0x1727 root:scanner 0664 +0x04a9 0x1727 root:scanner 0664 # Canon PIXMA MX310 -0x04a9 0x1728 root:scanner 0664 +0x04a9 0x1728 root:scanner 0664 # Canon PIXMA MX700 -0x04a9 0x1729 root:scanner 0664 +0x04a9 0x1729 root:scanner 0664 # Canon PIXMA MP140 -0x04a9 0x172b root:scanner 0664 +0x04a9 0x172b root:scanner 0664 # Canon PIXMA MX850 -0x04a9 0x172c root:scanner 0664 +0x04a9 0x172c root:scanner 0664 # Canon PIXMA MP980 -0x04a9 0x172d root:scanner 0664 +0x04a9 0x172d root:scanner 0664 # Canon PIXMA MP630 -0x04a9 0x172e root:scanner 0664 +0x04a9 0x172e root:scanner 0664 # Canon PIXMA MP620 -0x04a9 0x172f root:scanner 0664 +0x04a9 0x172f root:scanner 0664 # Canon PIXMA MP540 -0x04a9 0x1730 root:scanner 0664 +0x04a9 0x1730 root:scanner 0664 # Canon PIXMA MP480 -0x04a9 0x1731 root:scanner 0664 +0x04a9 0x1731 root:scanner 0664 # Canon PIXMA MP240 -0x04a9 0x1732 root:scanner 0664 +0x04a9 0x1732 root:scanner 0664 # Canon PIXMA MP260 -0x04a9 0x1733 root:scanner 0664 +0x04a9 0x1733 root:scanner 0664 # Canon PIXMA MP190 -0x04a9 0x1734 root:scanner 0664 +0x04a9 0x1734 root:scanner 0664 # Canon PIXMA MX860 -0x04a9 0x1735 root:scanner 0664 +0x04a9 0x1735 root:scanner 0664 # Canon PIXMA MX320 -0x04a9 0x1736 root:scanner 0664 +0x04a9 0x1736 root:scanner 0664 # Canon PIXMA MX330 -0x04a9 0x1737 root:scanner 0664 +0x04a9 0x1737 root:scanner 0664 # Canon PIXMA MP250 -0x04a9 0x173a root:scanner 0664 +0x04a9 0x173a root:scanner 0664 # Canon PIXMA MP270 -0x04a9 0x173b root:scanner 0664 +0x04a9 0x173b root:scanner 0664 # Canon PIXMA MP490 -0x04a9 0x173c root:scanner 0664 +0x04a9 0x173c root:scanner 0664 # Canon PIXMA MP550 -0x04a9 0x173d root:scanner 0664 +0x04a9 0x173d root:scanner 0664 # Canon PIXMA MP560 -0x04a9 0x173e root:scanner 0664 +0x04a9 0x173e root:scanner 0664 # Canon PIXMA MP640 -0x04a9 0x173f root:scanner 0664 +0x04a9 0x173f root:scanner 0664 # Canon PIXMA MP990 -0x04a9 0x1740 root:scanner 0664 +0x04a9 0x1740 root:scanner 0664 # Canon PIXMA MX340 -0x04a9 0x1741 root:scanner 0664 +0x04a9 0x1741 root:scanner 0664 # Canon PIXMA MX350 -0x04a9 0x1742 root:scanner 0664 +0x04a9 0x1742 root:scanner 0664 # Canon PIXMA MX870 -0x04a9 0x1743 root:scanner 0664 +0x04a9 0x1743 root:scanner 0664 # Canon PIXMA MP280 -0x04a9 0x1746 root:scanner 0664 +0x04a9 0x1746 root:scanner 0664 # Canon PIXMA MP495 -0x04a9 0x1747 root:scanner 0664 +0x04a9 0x1747 root:scanner 0664 # Canon PIXMA MG5100 Series -0x04a9 0x1748 root:scanner 0664 +0x04a9 0x1748 root:scanner 0664 # Canon PIXMA MG5200 Series -0x04a9 0x1749 root:scanner 0664 +0x04a9 0x1749 root:scanner 0664 # Canon PIXMA MG6100 Series -0x04a9 0x174a root:scanner 0664 +0x04a9 0x174a root:scanner 0664 # Canon PIXMA MG8100 Series -0x04a9 0x174b root:scanner 0664 +0x04a9 0x174b root:scanner 0664 # Canon PIXMA MX360 -0x04a9 0x174d root:scanner 0664 +0x04a9 0x174d root:scanner 0664 # Canon PIXMA MX410 -0x04a9 0x174e root:scanner 0664 +0x04a9 0x174e root:scanner 0664 # Canon PIXMA MX420 -0x04a9 0x174f root:scanner 0664 +0x04a9 0x174f root:scanner 0664 # Canon PIXMA MX880 Series | Canon PIXMA MX882 | Canon PIXMA MX885 -0x04a9 0x1750 root:scanner 0664 +0x04a9 0x1750 root:scanner 0664 # Canon PIXMA MG2100 Series -0x04a9 0x1751 root:scanner 0664 +0x04a9 0x1751 root:scanner 0664 # Canon PIXMA MG3100 Series -0x04a9 0x1752 root:scanner 0664 +0x04a9 0x1752 root:scanner 0664 # Canon PIXMA MG4100 Series -0x04a9 0x1753 root:scanner 0664 +0x04a9 0x1753 root:scanner 0664 # Canon PIXMA MG5300 Series -0x04a9 0x1754 root:scanner 0664 +0x04a9 0x1754 root:scanner 0664 # Canon PIXMA MG6200 Series -0x04a9 0x1755 root:scanner 0664 +0x04a9 0x1755 root:scanner 0664 # Canon PIXMA MG8200 Series -0x04a9 0x1756 root:scanner 0664 +0x04a9 0x1756 root:scanner 0664 # Canon PIXMA MP493 -0x04a9 0x1757 root:scanner 0664 +0x04a9 0x1757 root:scanner 0664 # Canon PIXMA E500 -0x04a9 0x1758 root:scanner 0664 +0x04a9 0x1758 root:scanner 0664 # Canon PIXMA MX370 Series -0x04a9 0x1759 root:scanner 0664 +0x04a9 0x1759 root:scanner 0664 # Canon PIXMA E600 -0x04a9 0x175a root:scanner 0664 +0x04a9 0x175a root:scanner 0664 # Canon PIXMA MX430 Series -0x04a9 0x175b root:scanner 0664 +0x04a9 0x175b root:scanner 0664 # Canon PIXMA MX510 Series -0x04a9 0x175c root:scanner 0664 +0x04a9 0x175c root:scanner 0664 # Canon PIXMA MX710 Series -0x04a9 0x175d root:scanner 0664 +0x04a9 0x175d root:scanner 0664 # Canon PIXMA MX890 Series -0x04a9 0x175e root:scanner 0664 +0x04a9 0x175e root:scanner 0664 # Canon PIXMA MP230 -0x04a9 0x175f root:scanner 0664 +0x04a9 0x175f root:scanner 0664 # Canon PIXMA MG2200 Series -0x04a9 0x1760 root:scanner 0664 +0x04a9 0x1760 root:scanner 0664 # Canon PIXMA E510 -0x04a9 0x1761 root:scanner 0664 +0x04a9 0x1761 root:scanner 0664 # Canon PIXMA MG3200 Series -0x04a9 0x1762 root:scanner 0664 +0x04a9 0x1762 root:scanner 0664 # Canon PIXMA MG4200 Series -0x04a9 0x1763 root:scanner 0664 +0x04a9 0x1763 root:scanner 0664 # Canon PIXMA MG5400 Series -0x04a9 0x1764 root:scanner 0664 +0x04a9 0x1764 root:scanner 0664 # Canon PIXMA MG6300 Series -0x04a9 0x1765 root:scanner 0664 +0x04a9 0x1765 root:scanner 0664 # Canon PIXMA MX390 Series -0x04a9 0x1766 root:scanner 0664 +0x04a9 0x1766 root:scanner 0664 # Canon PIXMA E610 -0x04a9 0x1767 root:scanner 0664 +0x04a9 0x1767 root:scanner 0664 # Canon PIXMA MX450 Series -0x04a9 0x1768 root:scanner 0664 +0x04a9 0x1768 root:scanner 0664 # Canon PIXMA MX520 Series -0x04a9 0x1769 root:scanner 0664 +0x04a9 0x1769 root:scanner 0664 # Canon PIXMA MX720 Series -0x04a9 0x176a root:scanner 0664 +0x04a9 0x176a root:scanner 0664 # Canon PIXMA MX920 Series -0x04a9 0x176b root:scanner 0664 +0x04a9 0x176b root:scanner 0664 # Canon CanoScan 8800F -0x04a9 0x1901 root:scanner 0664 +0x04a9 0x1901 root:scanner 0664 # Canon CanoScan LiDE 100 -0x04a9 0x1904 root:scanner 0664 +0x04a9 0x1904 root:scanner 0664 # Canon CanoScan LiDE 200 -0x04a9 0x1905 root:scanner 0664 +0x04a9 0x1905 root:scanner 0664 # Canon CanoScan 700F -0x04a9 0x1907 root:scanner 0664 +0x04a9 0x1907 root:scanner 0664 # Canon CanoScan 9000F -0x04a9 0x1908 root:scanner 0664 +0x04a9 0x1908 root:scanner 0664 # Canon CanoScan LiDE 110 -0x04a9 0x1909 root:scanner 0664 +0x04a9 0x1909 root:scanner 0664 # Canon CanoScan LiDE 210 -0x04a9 0x190a root:scanner 0664 +0x04a9 0x190a root:scanner 0664 # Canon CanoScan 9000F Mark II -0x04a9 0x190d root:scanner 0664 +0x04a9 0x190d root:scanner 0664 # Canon CanoScan fb630u | Canon CanoScan fb636u -0x04a9 0x2204 root:scanner 0664 +0x04a9 0x2204 root:scanner 0664 # Canon CanoScan N650U/N656U -0x04a9 0x2206 root:scanner 0664 +0x04a9 0x2206 root:scanner 0664 # Canon CanoScan N1220U -0x04a9 0x2207 root:scanner 0664 +0x04a9 0x2207 root:scanner 0664 # Canon CanoScan D660U -0x04a9 0x2208 root:scanner 0664 +0x04a9 0x2208 root:scanner 0664 # Canon CanoScan N670U/N676U/LiDE20 -0x04a9 0x220d root:scanner 0664 +0x04a9 0x220d root:scanner 0664 # Canon CanoScan N1240U/LiDE30 -0x04a9 0x220e root:scanner 0664 +0x04a9 0x220e root:scanner 0664 # Canon CanoScan LiDE 35 | Canon CanoScan LiDE 40 | Canon CanoScan LiDE 50 -0x04a9 0x2213 root:scanner 0664 +0x04a9 0x2213 root:scanner 0664 # Canon CanoScan LiDE 60 -0x04a9 0x221c root:scanner 0664 +0x04a9 0x221c root:scanner 0664 # Canon CanoScan LiDE25 -0x04a9 0x2220 root:scanner 0664 +0x04a9 0x2220 root:scanner 0664 # Canon DR-1210C -0x04a9 0x2222 root:scanner 0664 +0x04a9 0x2222 root:scanner 0664 # Canon PIXMA MP730 -0x04a9 0x262f root:scanner 0664 +0x04a9 0x262f root:scanner 0664 # Canon PIXMA MP700 -0x04a9 0x2630 root:scanner 0664 +0x04a9 0x2630 root:scanner 0664 # Canon PIXMA MP360 -0x04a9 0x263c root:scanner 0664 +0x04a9 0x263c root:scanner 0664 # Canon PIXMA MP370 -0x04a9 0x263d root:scanner 0664 +0x04a9 0x263d root:scanner 0664 # Canon PIXMA MP390 -0x04a9 0x263e root:scanner 0664 +0x04a9 0x263e root:scanner 0664 # Canon PIXMA MP375R -0x04a9 0x263f root:scanner 0664 +0x04a9 0x263f root:scanner 0664 # Canon PIXMA MP740 -0x04a9 0x264c root:scanner 0664 +0x04a9 0x264c root:scanner 0664 # Canon PIXMA MP710 -0x04a9 0x264d root:scanner 0664 +0x04a9 0x264d root:scanner 0664 # Canon imageCLASS MF5630 -0x04a9 0x264e root:scanner 0664 +0x04a9 0x264e root:scanner 0664 # Canon laserBase MF5650 -0x04a9 0x264f root:scanner 0664 +0x04a9 0x264f root:scanner 0664 # Canon imageCLASS MF8170c -0x04a9 0x2659 root:scanner 0664 +0x04a9 0x2659 root:scanner 0664 # Canon imageCLASS MF5730 -0x04a9 0x265d root:scanner 0664 +0x04a9 0x265d root:scanner 0664 # Canon imageCLASS MF5750 -0x04a9 0x265e root:scanner 0664 +0x04a9 0x265e root:scanner 0664 # Canon imageCLASS MF5770 -0x04a9 0x265f root:scanner 0664 +0x04a9 0x265f root:scanner 0664 # Canon imageCLASS MF3110 -0x04a9 0x2660 root:scanner 0664 +0x04a9 0x2660 root:scanner 0664 # Canon imageCLASS MF3240 -0x04a9 0x2684 root:scanner 0664 +0x04a9 0x2684 root:scanner 0664 # Canon imageCLASS MF6500 series | Canon imageCLASS MF6550 -0x04a9 0x2686 root:scanner 0664 +0x04a9 0x2686 root:scanner 0664 # Canon imageCLASS MF4120 | Canon imageCLASS MF4122 | Canon imageCLASS MF4140 | Canon imageCLASS MF4150 -0x04a9 0x26a3 root:scanner 0664 +0x04a9 0x26a3 root:scanner 0664 # Canon imageCLASS MF4660 | Canon imageCLASS MF4690 -0x04a9 0x26b0 root:scanner 0664 +0x04a9 0x26b0 root:scanner 0664 # Canon imageCLASS MF4010 | Canon imageCLASS MF4018 -0x04a9 0x26b4 root:scanner 0664 +0x04a9 0x26b4 root:scanner 0664 # Canon imageCLASS MF4270 -0x04a9 0x26b5 root:scanner 0664 +0x04a9 0x26b5 root:scanner 0664 # Canon imageRUNNER 1020/1024/1025 -0x04a9 0x26e6 root:scanner 0664 +0x04a9 0x26e6 root:scanner 0664 # Canon imageCLASS MF4370dn | Canon imageCLASS MF4380dn -0x04a9 0x26ec root:scanner 0664 +0x04a9 0x26ec root:scanner 0664 # Canon imageCLASS D480 -0x04a9 0x26ed root:scanner 0664 +0x04a9 0x26ed root:scanner 0664 # Canon I-SENSYS MF4320d | Canon I-SENSYS MF4330d | Canon imageCLASS MF4350d -0x04a9 0x26ee root:scanner 0664 +0x04a9 0x26ee root:scanner 0664 # Canon imageCLASS D420 -0x04a9 0x26ef root:scanner 0664 +0x04a9 0x26ef root:scanner 0664 # Canon i-SENSYS MF5880dn -0x04a9 0x26f9 root:scanner 0664 +0x04a9 0x26f9 root:scanner 0664 # Canon i-SENSYS MF6680dn -0x04a9 0x26fa root:scanner 0664 +0x04a9 0x26fa root:scanner 0664 # Canon imageCLASS MF8030 -0x04a9 0x2707 root:scanner 0664 +0x04a9 0x2707 root:scanner 0664 # Canon i-SENSYS MF4550d -0x04a9 0x2736 root:scanner 0664 +0x04a9 0x2736 root:scanner 0664 # Canon imageCLASS MF4410 | Canon imageCLASS MF4430 -0x04a9 0x2737 root:scanner 0664 +0x04a9 0x2737 root:scanner 0664 # Canon i-SENSYS MF3010 -0x04a9 0x2759 root:scanner 0664 +0x04a9 0x2759 root:scanner 0664 # Nikon LS 40 ED | Nikon LS 40 ED | Nikon Coolspan IV -0x04b0 0x4000 root:scanner 0664 +0x04b0 0x4000 root:scanner 0664 # Nikon LS 50 ED | Nikon Coolscan V ED | Nikon LS 50 ED | Nikon Coolscan V ED -0x04b0 0x4001 root:scanner 0664 +0x04b0 0x4001 root:scanner 0664 # Nikon Super Coolscan LS-5000 ED | Nikon Super Coolscan LS-5000 ED -0x04b0 0x4002 root:scanner 0664 +0x04b0 0x4002 root:scanner 0664 # Epson Perfection 636U | Epson GT-7000U | Epson Perfection 636U -0x04b8 0x0101 root:scanner 0664 +0x04b8 0x0101 root:scanner 0664 # Epson Perfection 610 | Epson GT-6600U | Epson Perfection 610 -0x04b8 0x0103 root:scanner 0664 +0x04b8 0x0103 root:scanner 0664 # Epson Perfection 1200U | Epson Perfection 1200Photo | Epson GT-7600U | Epson GT-7600UF | Epson Perfection 1200U | Epson Perfection 1200U PHOTO -0x04b8 0x0104 root:scanner 0664 +0x04b8 0x0104 root:scanner 0664 # Epson Stylus Scan 2000 -0x04b8 0x0105 root:scanner 0664 +0x04b8 0x0105 root:scanner 0664 # Epson Stylus Scan 2500 -0x04b8 0x0106 root:scanner 0664 +0x04b8 0x0106 root:scanner 0664 # Epson Expression 1600 | Epson ES-2000 | Epson Expression 1600 -0x04b8 0x0107 root:scanner 0664 +0x04b8 0x0107 root:scanner 0664 # Epson ES-8500 | Epson Expression 1640XL -0x04b8 0x0109 root:scanner 0664 +0x04b8 0x0109 root:scanner 0664 # Epson Perfection 1640 | Epson GT-8700 | Epson GT-8700F | Epson Perfection 1640SU | Epson Perfection 1640SU PHOTO -0x04b8 0x010a root:scanner 0664 +0x04b8 0x010a root:scanner 0664 # Epson Perfection 1240 | Epson GT-7700U | Epson Perfection 1240U -0x04b8 0x010b root:scanner 0664 +0x04b8 0x010b root:scanner 0664 # Epson Perfection 640 | Epson GT-6700U | Epson Perfection 640U -0x04b8 0x010c root:scanner 0664 +0x04b8 0x010c root:scanner 0664 # Epson Expression 1680 | Epson ES-2200 | Epson Expression 1680 -0x04b8 0x010e root:scanner 0664 +0x04b8 0x010e root:scanner 0664 # Epson Perfection 1250 | Epson Perfection 1250Photo -0x04b8 0x010f root:scanner 0664 +0x04b8 0x010f root:scanner 0664 # Epson Perfection 1650 | Epson GT-8200U | Epson GT-8200UF | Epson Perfection 1650 | Epson Perfection 1650 PHOTO -0x04b8 0x0110 root:scanner 0664 +0x04b8 0x0110 root:scanner 0664 # Epson Perfection 2450 | Epson GT-9700F | Epson Perfection 2450 PHOTO -0x04b8 0x0112 root:scanner 0664 +0x04b8 0x0112 root:scanner 0664 # Epson Perfection 660 -0x04b8 0x0114 root:scanner 0664 +0x04b8 0x0114 root:scanner 0664 # Epson Perfection 2400 | Epson GT-9300UF | Epson Perfection 2400 PHOTO -0x04b8 0x011b root:scanner 0664 +0x04b8 0x011b root:scanner 0664 # Epson Perfection 3200 | Epson GT-9800F | Epson Perfection 3200 PHOTO -0x04b8 0x011c root:scanner 0664 +0x04b8 0x011c root:scanner 0664 # Epson Perfection 1260 | Epson Perfection 1260Photo -0x04b8 0x011d root:scanner 0664 +0x04b8 0x011d root:scanner 0664 # Epson Perfection 1660 | Epson GT-8300UF | Epson Perfection 1660 PHOTO -0x04b8 0x011e root:scanner 0664 +0x04b8 0x011e root:scanner 0664 # Epson Perfection 1670 -0x04b8 0x011f root:scanner 0664 +0x04b8 0x011f root:scanner 0664 # Epson Perfection 1270 -0x04b8 0x0120 root:scanner 0664 +0x04b8 0x0120 root:scanner 0664 # Epson Perfection 2480 | Epson Perfection 2580 -0x04b8 0x0121 root:scanner 0664 +0x04b8 0x0121 root:scanner 0664 # Epson Perfection 3490 | Epson Perfection 3590 -0x04b8 0x0122 root:scanner 0664 +0x04b8 0x0122 root:scanner 0664 # Epson ES-7000H | Epson GT-15000 -0x04b8 0x0126 root:scanner 0664 +0x04b8 0x0126 root:scanner 0664 # Epson Perfection 4870 | Epson GT-X700 | Epson Perfection 4870 PHOTO -0x04b8 0x0128 root:scanner 0664 +0x04b8 0x0128 root:scanner 0664 # Epson ES-10000G | Epson Expression 10000XL -0x04b8 0x0129 root:scanner 0664 +0x04b8 0x0129 root:scanner 0664 # Epson Perfection 4990 | Epson GT-X800 | Epson Perfection 4990 PHOTO -0x04b8 0x012a root:scanner 0664 +0x04b8 0x012a root:scanner 0664 # Epson ES-H300 | Epson GT-2500 -0x04b8 0x012b root:scanner 0664 +0x04b8 0x012b root:scanner 0664 # Epson V700 | Epson V750 | Epson GT-X900 | Epson Perfection V700 Photo | Epson Perfection V750 Photo -0x04b8 0x012c root:scanner 0664 +0x04b8 0x012c root:scanner 0664 # Epson GT-X970 -0x04b8 0x0135 root:scanner 0664 +0x04b8 0x0135 root:scanner 0664 # Epson CX-5200 | Epson CX-5400 | Epson CC-600PX | Epson Stylus CX5100 | Epson Stylus CX5200 -0x04b8 0x0801 root:scanner 0664 +0x04b8 0x0801 root:scanner 0664 # Epson CX-3200 | Epson CC-570L | Epson Stylus CX3100 | Epson Stylus CX3200 -0x04b8 0x0802 root:scanner 0664 +0x04b8 0x0802 root:scanner 0664 # Epson CX-6300 | Epson CX-6400 | Epson Stylus CX6300 | Epson Stylus CX6400 -0x04b8 0x0805 root:scanner 0664 +0x04b8 0x0805 root:scanner 0664 # Epson RX-600 | Epson PM-A850 | Epson Stylus Photo RX600 -0x04b8 0x0806 root:scanner 0664 +0x04b8 0x0806 root:scanner 0664 # Epson RX-500 | Epson Stylus Photo RX500 | Epson Stylus Photo RX510 -0x04b8 0x0807 root:scanner 0664 +0x04b8 0x0807 root:scanner 0664 # Epson CX-5400 | Epson Stylus CX5300 | Epson Stylus CX5400 -0x04b8 0x0808 root:scanner 0664 +0x04b8 0x0808 root:scanner 0664 # Epson Stylus CX-1500 -0x04b8 0x080c root:scanner 0664 +0x04b8 0x080c root:scanner 0664 # Epson CX-4600 | Epson Stylus CX4500 | Epson Stylus CX4600 -0x04b8 0x080d root:scanner 0664 +0x04b8 0x080d root:scanner 0664 # Epson CX-3600 | Epson CX-3650 | Epson PX-A550 | Epson Stylus CX3500 | Epson Stylus CX3600 | Epson Stylus CX3650 -0x04b8 0x080e root:scanner 0664 +0x04b8 0x080e root:scanner 0664 # Epson RX-425 | Epson Stylus Photo RX420 | Epson Stylus Photo RX425 | Epson Stylus Photo RX430 -0x04b8 0x080f root:scanner 0664 +0x04b8 0x080f root:scanner 0664 # Epson RX-700 | Epson PM-A900 | Epson Stylus Photo RX700 -0x04b8 0x0810 root:scanner 0664 +0x04b8 0x0810 root:scanner 0664 # Epson RX-620 | Epson PM-A870 | Epson Stylus Photo RX620 | Epson Stylus Photo RX630 -0x04b8 0x0811 root:scanner 0664 +0x04b8 0x0811 root:scanner 0664 # Epson CX-6500 | Epson CX-6600 | Epson Stylus CX6500 | Epson Stylus CX6600 -0x04b8 0x0813 root:scanner 0664 +0x04b8 0x0813 root:scanner 0664 # Epson PM-A700 -0x04b8 0x0814 root:scanner 0664 +0x04b8 0x0814 root:scanner 0664 # Epson AcuLaser CX11 | Epson AcuLaser CX11NF | Epson AcuLaser CX11 | Epson AcuLaser CX11NF | Epson LP-A500 -0x04b8 0x0815 root:scanner 0664 +0x04b8 0x0815 root:scanner 0664 # Epson LP-M5500 | Epson LP-M5500F -0x04b8 0x0817 root:scanner 0664 +0x04b8 0x0817 root:scanner 0664 # Epson DX-3850 | Epson CX-3700 | Epson CX-3800 | Epson DX-3800 | Epson Stylus CX3700 | Epson Stylus CX3800 | Epson Stylus DX3800 -0x04b8 0x0818 root:scanner 0664 +0x04b8 0x0818 root:scanner 0664 # Epson CX-4800 | Epson PX-A650 | Epson Stylus CX4700 | Epson Stylus CX4800 | Epson Stylus DX4800 | Epson Stylus DX4850 -0x04b8 0x0819 root:scanner 0664 +0x04b8 0x0819 root:scanner 0664 # Epson PM-A750 | Epson Stylus Photo RX520 | Epson Stylus Photo RX530 -0x04b8 0x081a root:scanner 0664 +0x04b8 0x081a root:scanner 0664 # Epson PM-A890 | Epson Stylus Photo RX640 | Epson Stylus Photo RX650 -0x04b8 0x081c root:scanner 0664 +0x04b8 0x081c root:scanner 0664 # Epson PM-A950 -0x04b8 0x081d root:scanner 0664 +0x04b8 0x081d root:scanner 0664 # Epson Stylus CX7700 | Epson Stylus CX7800 -0x04b8 0x081f root:scanner 0664 +0x04b8 0x081f root:scanner 0664 # Epson CX-4200 | Epson Stylus CX4100 | Epson Stylus CX4200 | Epson Stylus DX4200 -0x04b8 0x0820 root:scanner 0664 +0x04b8 0x0820 root:scanner 0664 # Epson PM-A820 | Epson Stylus Photo RX560 | Epson Stylus Photo RX580 | Epson Stylus Photo RX590 -0x04b8 0x0827 root:scanner 0664 +0x04b8 0x0827 root:scanner 0664 # Epson PM-A970 -0x04b8 0x0828 root:scanner 0664 +0x04b8 0x0828 root:scanner 0664 # Epson PM-T990 -0x04b8 0x0829 root:scanner 0664 +0x04b8 0x0829 root:scanner 0664 # Epson PM-A920 -0x04b8 0x082a root:scanner 0664 +0x04b8 0x082a root:scanner 0664 # Epson CX-5000 | Epson DX-5000 | Epson DX-5050 | Epson Stylus CX4900 | Epson Stylus CX5000 | Epson Stylus DX5000 -0x04b8 0x082b root:scanner 0664 +0x04b8 0x082b root:scanner 0664 # Epson DX-6000 | Epson PX-A720 | Epson Stylus CX5900 | Epson Stylus CX6000 | Epson Stylus DX6000 -0x04b8 0x082e root:scanner 0664 +0x04b8 0x082e root:scanner 0664 # Epson DX-4050 | Epson PX-A620 | Epson Stylus CX3900 | Epson Stylus DX4000 -0x04b8 0x082f root:scanner 0664 +0x04b8 0x082f root:scanner 0664 # Epson ME 200 | Epson Stylus CX2800 | Epson Stylus CX2900 -0x04b8 0x0830 root:scanner 0664 +0x04b8 0x0830 root:scanner 0664 # Epson LP-M5600 -0x04b8 0x0833 root:scanner 0664 +0x04b8 0x0833 root:scanner 0664 # Epson LP-M6000 -0x04b8 0x0834 root:scanner 0664 +0x04b8 0x0834 root:scanner 0664 # Epson AcuLaser CX21 -0x04b8 0x0835 root:scanner 0664 +0x04b8 0x0835 root:scanner 0664 # Epson PM-T960 -0x04b8 0x0836 root:scanner 0664 +0x04b8 0x0836 root:scanner 0664 # Epson PM-A940 | Epson Stylus Photo RX680 | Epson Stylus Photo RX685 | Epson Stylus Photo RX690 -0x04b8 0x0837 root:scanner 0664 +0x04b8 0x0837 root:scanner 0664 # Epson DX-7400 | Epson PX-A640 | Epson Stylus CX7300 | Epson Stylus CX7400 | Epson Stylus DX7400 -0x04b8 0x0838 root:scanner 0664 +0x04b8 0x0838 root:scanner 0664 # Epson PX-A740 | Epson Stylus CX8300 | Epson Stylus CX8400 | Epson Stylus DX8400 -0x04b8 0x0839 root:scanner 0664 +0x04b8 0x0839 root:scanner 0664 # Epson PX-FA700 | Epson Stylus CX9300F | Epson Stylus CX9400Fax | Epson Stylus DX9400F -0x04b8 0x083a root:scanner 0664 +0x04b8 0x083a root:scanner 0664 # Epson PM-A840 | Epson PM-A840S | Epson Stylus Photo RX585 | Epson Stylus Photo RX595 | Epson Stylus Photo RX610 -0x04b8 0x083c root:scanner 0664 +0x04b8 0x083c root:scanner 0664 # Epson ME 300 | Epson PX-401A | Epson Stylus NX100 | Epson Stylus SX100 | Epson Stylus TX100 -0x04b8 0x0841 root:scanner 0664 +0x04b8 0x0841 root:scanner 0664 # Epson LP-M5000 -0x04b8 0x0843 root:scanner 0664 +0x04b8 0x0843 root:scanner 0664 # Epson Artisan 800 | Epson EP-901A | Epson EP-901F | Epson Stylus Photo PX800FW | Epson Stylus Photo TX800FW -0x04b8 0x0844 root:scanner 0664 +0x04b8 0x0844 root:scanner 0664 # Epson Artisan 700 | Epson EP-801A | Epson Stylus Photo PX700W | Epson Stylus Photo TX700W -0x04b8 0x0846 root:scanner 0664 +0x04b8 0x0846 root:scanner 0664 # Epson ME Office 700FW | Epson PX-601F | Epson Stylus Office BX600FW | Epson Stylus Office TX600FW | Epson Stylus SX600FW | Epson WorkForce 600 -0x04b8 0x0847 root:scanner 0664 +0x04b8 0x0847 root:scanner 0664 # Epson ME Office 600F | Epson Stylus Office BX300F | Epson Stylus Office TX300F | Epson Stylus NX300 -0x04b8 0x0848 root:scanner 0664 +0x04b8 0x0848 root:scanner 0664 # Epson Stylus NX200 | Epson Stylus SX200 | Epson Stylus SX205 | Epson Stylus TX200 | Epson Stylus TX203 | Epson Stylus TX209 -0x04b8 0x0849 root:scanner 0664 +0x04b8 0x0849 root:scanner 0664 # Epson PX-501A | Epson Stylus NX400 | Epson Stylus SX400 | Epson Stylus SX405 | Epson Stylus TX400 -0x04b8 0x084a root:scanner 0664 +0x04b8 0x084a root:scanner 0664 # Epson WorkForce 500 -0x04b8 0x084c root:scanner 0664 +0x04b8 0x084c root:scanner 0664 # Epson PX-402A | Epson Stylus NX110 Series | Epson Stylus SX110 Series | Epson Stylus TX110 Series -0x04b8 0x084d root:scanner 0664 +0x04b8 0x084d root:scanner 0664 # Epson ME OFFICE 510 | Epson Stylus NX210 Series | Epson Stylus SX210 Series | Epson Stylus TX210 Series -0x04b8 0x084f root:scanner 0664 +0x04b8 0x084f root:scanner 0664 # Epson Stylus NX410 Series | Epson Stylus SX410 Series | Epson Stylus TX410 Series -0x04b8 0x0851 root:scanner 0664 +0x04b8 0x0851 root:scanner 0664 # Epson ME OFFICE 650FN Series | Epson Stylus Office BX310FN Series | Epson Stylus Office TX510FN Series | Epson WorkForce 310 Series -0x04b8 0x0854 root:scanner 0664 +0x04b8 0x0854 root:scanner 0664 # Epson PX-502A | Epson Stylus NX510 Series | Epson Stylus SX510W Series | Epson Stylus TX550W Series -0x04b8 0x0856 root:scanner 0664 +0x04b8 0x0856 root:scanner 0664 # Epson Stylus SX125 -0x04b8 0x085c root:scanner 0664 +0x04b8 0x085c root:scanner 0664 # Fujitsu fi-4010CU -0x04c5 0x1029 root:scanner 0664 +0x04c5 0x1029 root:scanner 0664 # Fujitsu fi-4120C -0x04c5 0x1041 root:scanner 0664 +0x04c5 0x1041 root:scanner 0664 # Fujitsu fi-4220C -0x04c5 0x1042 root:scanner 0664 +0x04c5 0x1042 root:scanner 0664 # Fujitsu fi-4530C -0x04c5 0x1078 root:scanner 0664 +0x04c5 0x1078 root:scanner 0664 # Fujitsu fi-5750C -0x04c5 0x1095 root:scanner 0664 +0x04c5 0x1095 root:scanner 0664 # Fujitsu fi-5110EOX/2 -0x04c5 0x1096 root:scanner 0664 +0x04c5 0x1096 root:scanner 0664 # Fujitsu fi-5110C -0x04c5 0x1097 root:scanner 0664 +0x04c5 0x1097 root:scanner 0664 # Fujitsu fi-5650C -0x04c5 0x10ad root:scanner 0664 +0x04c5 0x10ad root:scanner 0664 # Fujitsu fi-4120C2 -0x04c5 0x10ae root:scanner 0664 +0x04c5 0x10ae root:scanner 0664 # Fujitsu fi-4220C2 -0x04c5 0x10af root:scanner 0664 +0x04c5 0x10af root:scanner 0664 # Fujitsu fi-60F -0x04c5 0x10c7 root:scanner 0664 +0x04c5 0x10c7 root:scanner 0664 # Fujitsu fi-4340C -0x04c5 0x10cf root:scanner 0664 +0x04c5 0x10cf root:scanner 0664 # Fujitsu fi-5120C -0x04c5 0x10e0 root:scanner 0664 +0x04c5 0x10e0 root:scanner 0664 # Fujitsu fi-5220C -0x04c5 0x10e1 root:scanner 0664 +0x04c5 0x10e1 root:scanner 0664 # Fujitsu fi-5530C -0x04c5 0x10e2 root:scanner 0664 +0x04c5 0x10e2 root:scanner 0664 # Fujitsu fi-5110EOX3 -0x04c5 0x10e6 root:scanner 0664 +0x04c5 0x10e6 root:scanner 0664 # Fujitsu fi-5900C -0x04c5 0x10e7 root:scanner 0664 +0x04c5 0x10e7 root:scanner 0664 # Fujitsu fi-5015C -0x04c5 0x10ef root:scanner 0664 +0x04c5 0x10ef root:scanner 0664 # Fujitsu fi-5110EOXM -0x04c5 0x10f2 root:scanner 0664 +0x04c5 0x10f2 root:scanner 0664 # Fujitsu ScanSnap S500 -0x04c5 0x10fe root:scanner 0664 +0x04c5 0x10fe root:scanner 0664 # Fujitsu ScanSnap S500M -0x04c5 0x1135 root:scanner 0664 +0x04c5 0x1135 root:scanner 0664 # Fujitsu fi-5530C2 -0x04c5 0x114a root:scanner 0664 +0x04c5 0x114a root:scanner 0664 # Fujitsu fi-6140 -0x04c5 0x114d root:scanner 0664 +0x04c5 0x114d root:scanner 0664 # Fujitsu fi-6240 -0x04c5 0x114e root:scanner 0664 +0x04c5 0x114e root:scanner 0664 # Fujitsu fi-6130 -0x04c5 0x114f root:scanner 0664 +0x04c5 0x114f root:scanner 0664 # Fujitsu fi-6230 -0x04c5 0x1150 root:scanner 0664 +0x04c5 0x1150 root:scanner 0664 # Fujitsu ScanSnap S510 -0x04c5 0x1155 root:scanner 0664 +0x04c5 0x1155 root:scanner 0664 # Fujitsu ScanSnap S300 -0x04c5 0x1156 root:scanner 0664 +0x04c5 0x1156 root:scanner 0664 # Fujitsu ScanSnap S510M -0x04c5 0x116f root:scanner 0664 +0x04c5 0x116f root:scanner 0664 # Fujitsu fi-6770 -0x04c5 0x1174 root:scanner 0664 +0x04c5 0x1174 root:scanner 0664 # Fujitsu fi-6770A -0x04c5 0x1175 root:scanner 0664 +0x04c5 0x1175 root:scanner 0664 # Fujitsu fi-6670 -0x04c5 0x1176 root:scanner 0664 +0x04c5 0x1176 root:scanner 0664 # Fujitsu fi-6670A -0x04c5 0x1177 root:scanner 0664 +0x04c5 0x1177 root:scanner 0664 # Fujitsu fi-6750S -0x04c5 0x1178 root:scanner 0664 +0x04c5 0x1178 root:scanner 0664 # Fujitsu ScanSnap S300M -0x04c5 0x117f root:scanner 0664 +0x04c5 0x117f root:scanner 0664 # Fujitsu fi-6800 -0x04c5 0x119d root:scanner 0664 +0x04c5 0x119d root:scanner 0664 # Fujitsu fi-6800-CGA -0x04c5 0x119e root:scanner 0664 +0x04c5 0x119e root:scanner 0664 # Fujitsu ScanSnap S1500 | Fujitsu ScanSnap S1500M -0x04c5 0x11a2 root:scanner 0664 +0x04c5 0x11a2 root:scanner 0664 # Fujitsu ScanSnap S1300 -0x04c5 0x11ed root:scanner 0664 +0x04c5 0x11ed root:scanner 0664 # Fujitsu fi-6140Z -0x04c5 0x11f1 root:scanner 0664 +0x04c5 0x11f1 root:scanner 0664 # Fujitsu fi-6240Z -0x04c5 0x11f2 root:scanner 0664 +0x04c5 0x11f2 root:scanner 0664 # Fujitsu fi-6130Z -0x04c5 0x11f3 root:scanner 0664 +0x04c5 0x11f3 root:scanner 0664 # Fujitsu fi-6230Z -0x04c5 0x11f4 root:scanner 0664 +0x04c5 0x11f4 root:scanner 0664 # Fujitsu fi-6110 -0x04c5 0x11fc root:scanner 0664 +0x04c5 0x11fc root:scanner 0664 # Fujitsu fi-5950 -0x04c5 0x1213 root:scanner 0664 +0x04c5 0x1213 root:scanner 0664 # Fujitsu ScanSnap iX500 -0x04c5 0x132b root:scanner 0664 +0x04c5 0x132b root:scanner 0664 # Konica e-mini -0x04c8 0x0722 root:scanner 0664 +0x04c8 0x0722 root:scanner 0664 # Panasonic KV-S2026C -0x04da 0x1000 root:scanner 0664 +0x04da 0x1000 root:scanner 0664 # Panasonic KV-S2046C -0x04da 0x1001 root:scanner 0664 +0x04da 0x1001 root:scanner 0664 # Panasonic KV-S1025C -0x04da 0x1006 root:scanner 0664 +0x04da 0x1006 root:scanner 0664 # Panasonic KV-S1020C -0x04da 0x1007 root:scanner 0664 +0x04da 0x1007 root:scanner 0664 # Panasonic KV-S2048C -0x04da 0x1009 root:scanner 0664 +0x04da 0x1009 root:scanner 0664 # Panasonic KV-S2028C -0x04da 0x100a root:scanner 0664 +0x04da 0x100a root:scanner 0664 # Panasonic KV-S4085C -0x04da 0x100c root:scanner 0664 +0x04da 0x100c root:scanner 0664 # Panasonic KV-S4065C -0x04da 0x100d root:scanner 0664 +0x04da 0x100d root:scanner 0664 # Panasonic KV-S7075C -0x04da 0x100e root:scanner 0664 +0x04da 0x100e root:scanner 0664 # Panasonic KV-SS080 -0x04da 0x100f root:scanner 0664 +0x04da 0x100f root:scanner 0664 # Panasonic KV-S1045C -0x04da 0x1010 root:scanner 0664 +0x04da 0x1010 root:scanner 0664 # Samsung SCX-4x16 -0x04e8 0x3409 root:scanner 0664 +0x04e8 0x3409 root:scanner 0664 # Samsung SCX-6x20 -0x04e8 0x340d root:scanner 0664 +0x04e8 0x340d root:scanner 0664 # Samsung MFP-560 -0x04e8 0x340e root:scanner 0664 +0x04e8 0x340e root:scanner 0664 # Samsung MFP-750 -0x04e8 0x340f root:scanner 0664 +0x04e8 0x340f root:scanner 0664 # Samsung SCX-4x20 -0x04e8 0x3412 root:scanner 0664 +0x04e8 0x3412 root:scanner 0664 # Samsung SCX-4100 -0x04e8 0x3413 root:scanner 0664 +0x04e8 0x3413 root:scanner 0664 # Samsung SCX-4x21 -0x04e8 0x3419 root:scanner 0664 +0x04e8 0x3419 root:scanner 0664 # Samsung SCX-5x30 -0x04e8 0x341a root:scanner 0664 +0x04e8 0x341a root:scanner 0664 # Samsung SCX-4200 -0x04e8 0x341b root:scanner 0664 +0x04e8 0x341b root:scanner 0664 # Samsung CLX-3160 -0x04e8 0x341c root:scanner 0664 +0x04e8 0x341c root:scanner 0664 # Samsung SCX-6x22 -0x04e8 0x341d root:scanner 0664 +0x04e8 0x341d root:scanner 0664 # Samsung SCX4725 | Samsung SCX4725-FN -0x04e8 0x341f root:scanner 0664 +0x04e8 0x341f root:scanner 0664 # Samsung SCX-6x45 -0x04e8 0x3420 root:scanner 0664 +0x04e8 0x3420 root:scanner 0664 # Samsung CLX-8380 -0x04e8 0x3421 root:scanner 0664 +0x04e8 0x3421 root:scanner 0664 # Samsung CLX-2160 -0x04e8 0x3425 root:scanner 0664 +0x04e8 0x3425 root:scanner 0664 # Samsung SCX-4500 -0x04e8 0x3426 root:scanner 0664 +0x04e8 0x3426 root:scanner 0664 # Samsung CLX-6200 -0x04e8 0x3427 root:scanner 0664 +0x04e8 0x3427 root:scanner 0664 # Samsung CLX-6240 -0x04e8 0x3428 root:scanner 0664 +0x04e8 0x3428 root:scanner 0664 # Samsung SCX-6x55 -0x04e8 0x3429 root:scanner 0664 +0x04e8 0x3429 root:scanner 0664 # Samsung CLX-3170fn (CLX-3170 Series) | Samsung CLX-3175FW -0x04e8 0x342a root:scanner 0664 +0x04e8 0x342a root:scanner 0664 # Samsung SCX-4500W -0x04e8 0x342b root:scanner 0664 +0x04e8 0x342b root:scanner 0664 # Samsung SCX-4824 (SCX-4x24 Series) -0x04e8 0x342c root:scanner 0664 +0x04e8 0x342c root:scanner 0664 # Samsung SCX-4828FN (SCX-4x28 Series) -0x04e8 0x342d root:scanner 0664 +0x04e8 0x342d root:scanner 0664 # Samsung SCX-4300 -0x04e8 0x342e root:scanner 0664 +0x04e8 0x342e root:scanner 0664 # Samsung SCX-5835_5935 -0x04e8 0x342f root:scanner 0664 +0x04e8 0x342f root:scanner 0664 # Samsung SCX-5635 -0x04e8 0x3430 root:scanner 0664 +0x04e8 0x3430 root:scanner 0664 # Samsung SCX-4x26 -0x04e8 0x3432 root:scanner 0664 +0x04e8 0x3432 root:scanner 0664 # Samsung SCX-4600 -0x04e8 0x3433 root:scanner 0664 +0x04e8 0x3433 root:scanner 0664 # Samsung SCX-4623 -0x04e8 0x3434 root:scanner 0664 +0x04e8 0x3434 root:scanner 0664 # Samsung MFP-65x -0x04e8 0x3435 root:scanner 0664 +0x04e8 0x3435 root:scanner 0664 # Samsung SCX-6545 -0x04e8 0x3437 root:scanner 0664 +0x04e8 0x3437 root:scanner 0664 # Samsung CLX-8385 -0x04e8 0x3439 root:scanner 0664 +0x04e8 0x3439 root:scanner 0664 # Samsung CLX-6220 -0x04e8 0x343a root:scanner 0664 +0x04e8 0x343a root:scanner 0664 # Samsung CLX-6250 -0x04e8 0x343b root:scanner 0664 +0x04e8 0x343b root:scanner 0664 # Samsung SCX-4825FN (SCX-4x25 Series) -0x04e8 0x343c root:scanner 0664 +0x04e8 0x343c root:scanner 0664 # Samsung CLX-3185 -0x04e8 0x343d root:scanner 0664 +0x04e8 0x343d root:scanner 0664 # Samsung CLX-8540 -0x04e8 0x343f root:scanner 0664 +0x04e8 0x343f root:scanner 0664 # Samsung SCX-4623FW -0x04e8 0x3440 root:scanner 0664 +0x04e8 0x3440 root:scanner 0664 # Samsung SCX-3205W (SCX-3200 Series) -0x04e8 0x3441 root:scanner 0664 +0x04e8 0x3441 root:scanner 0664 # Samsung SCX-6545X -0x04e8 0x3442 root:scanner 0664 +0x04e8 0x3442 root:scanner 0664 # Samsung SCX-6x55X -0x04e8 0x3443 root:scanner 0664 +0x04e8 0x3443 root:scanner 0664 # Samsung CLX-8385X -0x04e8 0x3444 root:scanner 0664 +0x04e8 0x3444 root:scanner 0664 # Samsung SCX-5835_5935X -0x04e8 0x3446 root:scanner 0664 +0x04e8 0x3446 root:scanner 0664 # Samsung SCX-4833FD | Samsung SCX-4835FD -0x04e8 0x344b root:scanner 0664 +0x04e8 0x344b root:scanner 0664 # Samsung SCX-3400 -0x04e8 0x344f root:scanner 0664 +0x04e8 0x344f root:scanner 0664 # Samsung SF-760 -0x04e8 0x3450 root:scanner 0664 +0x04e8 0x3450 root:scanner 0664 # Samsung SCX-4729FD -0x04e8 0x3453 root:scanner 0664 +0x04e8 0x3453 root:scanner 0664 # Samsung CLX-6260 -0x04e8 0x3455 root:scanner 0664 +0x04e8 0x3455 root:scanner 0664 # Samsung CLX-3300 Series -0x04e8 0x3456 root:scanner 0664 +0x04e8 0x3456 root:scanner 0664 # Samsung SCX-470x -0x04e8 0x3457 root:scanner 0664 +0x04e8 0x3457 root:scanner 0664 # Samsung CLX-4190 -0x04e8 0x345a root:scanner 0664 +0x04e8 0x345a root:scanner 0664 # Samsung SCX-4650 4x21S Series -0x04e8 0x345b root:scanner 0664 +0x04e8 0x345b root:scanner 0664 # Samsung M337x 387x 407x Series -0x04e8 0x3460 root:scanner 0664 +0x04e8 0x3460 root:scanner 0664 # Samsung M267x 287x Series -0x04e8 0x3461 root:scanner 0664 +0x04e8 0x3461 root:scanner 0664 # Samsung SCX-681x -0x04e8 0x3466 root:scanner 0664 +0x04e8 0x3466 root:scanner 0664 # Samsung C460 -0x04e8 0x3468 root:scanner 0664 +0x04e8 0x3468 root:scanner 0664 # Pentax DSmobile 600 -0x04f9 0x2038 root:scanner 0664 +0x04f9 0x2038 root:scanner 0664 # Aiptek Aiptek Pencam -0x0553 0x0202 root:scanner 0664 +0x0553 0x0202 root:scanner 0664 # Mustek ScanExpress 1200 CU -0x055f 0x0001 root:scanner 0664 +0x055f 0x0001 root:scanner 0664 # Mustek ScanExpress 600 CU -0x055f 0x0002 root:scanner 0664 +0x055f 0x0002 root:scanner 0664 # Mustek ScanExpress 1200 UB | Trust Compact Scan USB 19200 -0x055f 0x0006 root:scanner 0664 +0x055f 0x0006 root:scanner 0664 # Mustek ScanExpress 1200 CU Plus -0x055f 0x0008 root:scanner 0664 +0x055f 0x0008 root:scanner 0664 # Mustek BearPaw 1200 F -0x055f 0x0010 root:scanner 0664 +0x055f 0x0010 root:scanner 0664 # Mustek ScanExpress A3 USB -0x055f 0x0210 root:scanner 0664 +0x055f 0x0210 root:scanner 0664 # Mustek BearPaw 2400 CS | Mustek BearPaw 2400 TA | Trust 240TH Easy Webscan Gold -0x055f 0x0218 root:scanner 0664 +0x055f 0x0218 root:scanner 0664 # Mustek BearPaw 2400 CS Plus | Mustek BearPaw 2400 TA Plus | Mustek Plug-n-Scan 2400 MT | Mustek Plug-n-Scan 2400 M | Packard Bell Diamond 2450 -0x055f 0x0219 root:scanner 0664 +0x055f 0x0219 root:scanner 0664 # Mustek BearPaw 2448 CS Plus | Mustek BearPaw 2448 TA Plus -0x055f 0x021a root:scanner 0664 +0x055f 0x021a root:scanner 0664 # Mustek BearPaw 1200 CU Plus | Packard Bell Diamond 1200 Plus -0x055f 0x021b root:scanner 0664 +0x055f 0x021b root:scanner 0664 # Mustek BearPaw 1200 CU Plus | Mustek BearPaw 1248 CU | Packard Bell Diamond 1200 Plus | Trust Direct WebScan 19200 -0x055f 0x021c root:scanner 0664 +0x055f 0x021c root:scanner 0664 # Mustek BearPaw 2400 CU Plus -0x055f 0x021d root:scanner 0664 +0x055f 0x021d root:scanner 0664 # Mustek BearPaw 1200 CS | Mustek BearPaw 1200 TA -0x055f 0x021e root:scanner 0664 +0x055f 0x021e root:scanner 0664 # Mustek ScanExpress 1248 UB -0x055f 0x021f root:scanner 0664 +0x055f 0x021f root:scanner 0664 # Mustek BearPaw 2448TA Pro -0x055f 0x0409 root:scanner 0664 +0x055f 0x0409 root:scanner 0664 # Artec/Ultima Ultima 2000 | Artec/Ultima Ultima 2000 e+ | Boeder Sm@rtScan Slim Edition | Fujitsu 1200CUS | Googlegear 2000 | Medion/Lifetec/Tevion/Cytron MD 4394 | Medion/Lifetec/Tevion/Cytron MD/LT 9375 | Medion/Lifetec/Tevion/Cytron MD/LT 9385 | Medion/Lifetec/Tevion/Cytron LT 9452 | Medion/Lifetec/Tevion/Cytron MD 9458 | Mustek BearPaw 1200 CU | Mustek BearPaw 2400 CU | Mustek ScanExpress 1200 UB Plus | Mustek ScanExpress 2400 USB | Mustek ScanMagic 1200 UB Plus | Packard Bell Diamond 1200 | Trust Compact Scan USB 19200 | Trust Flat Scan USB 19200 -0x05d8 0x4002 root:scanner 0664 +0x05d8 0x4002 root:scanner 0664 # Artec/Ultima E+ 48U | Medion/Lifetec/Tevion/Cytron MD9693 | Medion/Lifetec/Tevion/Cytron MD9705 | Medion/Lifetec/Tevion/Cytron MD4394 | Microstar MR 9791 -0x05d8 0x4003 root:scanner 0664 +0x05d8 0x4003 root:scanner 0664 # Artec/Ultima E+ Pro -0x05d8 0x4004 root:scanner 0664 +0x05d8 0x4004 root:scanner 0664 # Memorex MEM 48U -0x05d8 0x4005 root:scanner 0664 +0x05d8 0x4005 root:scanner 0664 # Trust Easy Webscan 19200 -0x05d8 0x4006 root:scanner 0664 +0x05d8 0x4006 root:scanner 0664 # Trust 240H Easy Webscan Gold -0x05d8 0x4007 root:scanner 0664 +0x05d8 0x4007 root:scanner 0664 # UMAX AstraSlim SE -0x05d8 0x4009 root:scanner 0664 +0x05d8 0x4009 root:scanner 0664 # UMAX AstraSlim 1200 SE -0x05d8 0x4010 root:scanner 0664 +0x05d8 0x4010 root:scanner 0664 # Yakumo Scan50 -0x05d8 0x4011 root:scanner 0664 +0x05d8 0x4011 root:scanner 0664 # Microtek ScanMaker X6USB -0x05da 0x0099 root:scanner 0664 +0x05da 0x0099 root:scanner 0664 # Microtek SlimScan C6 -0x05da 0x009a root:scanner 0664 +0x05da 0x009a root:scanner 0664 # Microtek ScanMaker V6USL -0x05da 0x00a3 root:scanner 0664 +0x05da 0x00a3 root:scanner 0664 # Microtek ScanMaker V6UPL -0x05da 0x00b6 root:scanner 0664 +0x05da 0x00b6 root:scanner 0664 # Microtek ScanMaker 4800 -0x05da 0x30cf root:scanner 0664 +0x05da 0x30cf root:scanner 0664 # Microtek ScanMaker 3840 -0x05da 0x30d4 root:scanner 0664 +0x05da 0x30d4 root:scanner 0664 # Microtek ScanMaker 3600 -0x05da 0x40b3 root:scanner 0664 +0x05da 0x40b3 root:scanner 0664 # Microtek ScanMaker 3700 -0x05da 0x40b8 root:scanner 0664 +0x05da 0x40b8 root:scanner 0664 # Microtek ScanMaker 3600 -0x05da 0x40ca root:scanner 0664 +0x05da 0x40ca root:scanner 0664 # Microtek ScanMaker 3700 -0x05da 0x40cb root:scanner 0664 +0x05da 0x40cb root:scanner 0664 # Microtek ScanMaker 3750 -0x05da 0x40dd root:scanner 0664 +0x05da 0x40dd root:scanner 0664 # Microtek ScanMaker 3600 -0x05da 0x40ff root:scanner 0664 +0x05da 0x40ff root:scanner 0664 # Microtek ScanMaker V6USL -0x05da 0x80a3 root:scanner 0664 +0x05da 0x80a3 root:scanner 0664 # iVina 1200U -0x0638 0x0268 root:scanner 0664 +0x0638 0x0268 root:scanner 0664 # Minolta Dimage Scan Dual II -0x0638 0x026a root:scanner 0664 +0x0638 0x026a root:scanner 0664 # Avision AV600U -0x0638 0x0a13 root:scanner 0664 +0x0638 0x0a13 root:scanner 0664 # Minolta-QMS SC-110 -0x0638 0x0a15 root:scanner 0664 +0x0638 0x0a15 root:scanner 0664 # Avision DS610CU Scancopier | Minolta-QMS SC-215 | OKI S700 Scancopier -0x0638 0x0a16 root:scanner 0664 +0x0638 0x0a16 root:scanner 0664 # Avision AV610 | Avision AV600U Plus -0x0638 0x0a18 root:scanner 0664 +0x0638 0x0a18 root:scanner 0664 # Avision AV220 -0x0638 0x0a23 root:scanner 0664 +0x0638 0x0a23 root:scanner 0664 # Avision AV210 -0x0638 0x0a24 root:scanner 0664 +0x0638 0x0a24 root:scanner 0664 # Avision AV210 -0x0638 0x0a25 root:scanner 0664 +0x0638 0x0a25 root:scanner 0664 # Avision AV120 -0x0638 0x0a27 root:scanner 0664 +0x0638 0x0a27 root:scanner 0664 # Avision AV220C2 -0x0638 0x0a2a root:scanner 0664 +0x0638 0x0a2a root:scanner 0664 # Avision AV220D2 -0x0638 0x0a2b root:scanner 0664 +0x0638 0x0a2b root:scanner 0664 # Avision AV220+ -0x0638 0x0a2c root:scanner 0664 +0x0638 0x0a2c root:scanner 0664 # Avision AV220C2-G -0x0638 0x0a2d root:scanner 0664 +0x0638 0x0a2d root:scanner 0664 # Avision AV220C2-B -0x0638 0x0a2e root:scanner 0664 +0x0638 0x0a2e root:scanner 0664 # Avision AV210C2-G -0x0638 0x0a2f root:scanner 0664 +0x0638 0x0a2f root:scanner 0664 # Avision AV122 -0x0638 0x0a33 root:scanner 0664 +0x0638 0x0a33 root:scanner 0664 # Avision AV210C2 -0x0638 0x0a3a root:scanner 0664 +0x0638 0x0a3a root:scanner 0664 # Avision AV121 -0x0638 0x0a3c root:scanner 0664 +0x0638 0x0a3c root:scanner 0664 # Avision AV8300 -0x0638 0x0a40 root:scanner 0664 +0x0638 0x0a40 root:scanner 0664 # Avision AM3000 Series -0x0638 0x0a41 root:scanner 0664 +0x0638 0x0a41 root:scanner 0664 # Avision @V5100 -0x0638 0x0a45 root:scanner 0664 +0x0638 0x0a45 root:scanner 0664 # Avision AV8050U -0x0638 0x0a4d root:scanner 0664 +0x0638 0x0a4d root:scanner 0664 # Avision AV3200SU -0x0638 0x0a4e root:scanner 0664 +0x0638 0x0a4e root:scanner 0664 # Avision AV3730SU -0x0638 0x0a4f root:scanner 0664 +0x0638 0x0a4f root:scanner 0664 # Avision AV610C2 -0x0638 0x0a5e root:scanner 0664 +0x0638 0x0a5e root:scanner 0664 # Avision IT8300 -0x0638 0x0a61 root:scanner 0664 +0x0638 0x0a61 root:scanner 0664 # Avision AV3750SU -0x0638 0x0a65 root:scanner 0664 +0x0638 0x0a65 root:scanner 0664 # Avision AV3850SU -0x0638 0x0a66 root:scanner 0664 +0x0638 0x0a66 root:scanner 0664 # Avision AV8350 -0x0638 0x0a68 root:scanner 0664 +0x0638 0x0a68 root:scanner 0664 # Avision FB6080E -0x0638 0x0a82 root:scanner 0664 +0x0638 0x0a82 root:scanner 0664 # Avision FB2080E -0x0638 0x0a84 root:scanner 0664 +0x0638 0x0a84 root:scanner 0664 # Avision AV122 C2 -0x0638 0x0a93 root:scanner 0664 +0x0638 0x0a93 root:scanner 0664 # Avision AV220-G -0x0638 0x0a94 root:scanner 0664 +0x0638 0x0a94 root:scanner 0664 # Avision @V2500 -0x0638 0x0aa1 root:scanner 0664 +0x0638 0x0aa1 root:scanner 0664 # Avision AV210D2+ -0x0638 0x1a35 root:scanner 0664 +0x0638 0x1a35 root:scanner 0664 # Minolta Elite II -0x0686 0x4004 root:scanner 0664 +0x0686 0x4004 root:scanner 0664 # Minolta Dimage Scan Dual III -0x0686 0x400d root:scanner 0664 +0x0686 0x400d root:scanner 0664 # Minolta Dimage Scan Elite 5400 -0x0686 0x400e root:scanner 0664 +0x0686 0x400e root:scanner 0664 # AGFA SnapScan 1212U -0x06bd 0x0001 root:scanner 0664 +0x06bd 0x0001 root:scanner 0664 # AGFA SnapScan 1236u -0x06bd 0x0002 root:scanner 0664 +0x06bd 0x0002 root:scanner 0664 # Agfa Snapscan Touch -0x06bd 0x0100 root:scanner 0664 +0x06bd 0x0100 root:scanner 0664 # AGFA SnapScan 1212U_2 -0x06bd 0x2061 root:scanner 0664 +0x06bd 0x2061 root:scanner 0664 # AGFA SnapScan e40 -0x06bd 0x208d root:scanner 0664 +0x06bd 0x208d root:scanner 0664 # AGFA SnapScan e50 -0x06bd 0x208f root:scanner 0664 +0x06bd 0x208f root:scanner 0664 # AGFA SnapScan e20 -0x06bd 0x2091 root:scanner 0664 +0x06bd 0x2091 root:scanner 0664 # AGFA SnapScan e10 -0x06bd 0x2093 root:scanner 0664 +0x06bd 0x2093 root:scanner 0664 # AGFA SnapScan e25 -0x06bd 0x2095 root:scanner 0664 +0x06bd 0x2095 root:scanner 0664 # AGFA SnapScan e26 -0x06bd 0x2097 root:scanner 0664 +0x06bd 0x2097 root:scanner 0664 # AGFA SnapScan e52 -0x06bd 0x20fd root:scanner 0664 +0x06bd 0x20fd root:scanner 0664 # AGFA SnapScan e42 -0x06bd 0x20ff root:scanner 0664 +0x06bd 0x20ff root:scanner 0664 # UMAX Astra 4900 -0x06dc 0x0020 root:scanner 0664 +0x06dc 0x0020 root:scanner 0664 # Plustek OpticPro U12 | Plustek OpticPro UT12 | Plustek OpticPro 1212U | RevScan RevScan Orange R48Ti | Genius ColorPage Vivid III USB -0x07b3 0x0001 root:scanner 0664 +0x07b3 0x0001 root:scanner 0664 # Plustek OpticPro U12 -0x07b3 0x0010 root:scanner 0664 +0x07b3 0x0010 root:scanner 0664 # Plustek OpticPro U24 -0x07b3 0x0011 root:scanner 0664 +0x07b3 0x0011 root:scanner 0664 # Plustek OpticPro UT12 -0x07b3 0x0013 root:scanner 0664 +0x07b3 0x0013 root:scanner 0664 # Plustek OpticPro U24 -0x07b3 0x0015 root:scanner 0664 +0x07b3 0x0015 root:scanner 0664 # Plustek OpticPro UT12 | Plustek OpticPro UT16 | Plustek OpticPro UT24 -0x07b3 0x0017 root:scanner 0664 +0x07b3 0x0017 root:scanner 0664 # Plustek OpticPro 1248U | RevScan 19200i -0x07b3 0x0400 root:scanner 0664 +0x07b3 0x0400 root:scanner 0664 # Plustek OpticPro 1248U -0x07b3 0x0401 root:scanner 0664 +0x07b3 0x0401 root:scanner 0664 # Plustek OpticPro U16B -0x07b3 0x0402 root:scanner 0664 +0x07b3 0x0402 root:scanner 0664 # Plustek OpticPro U16B+ | Plustek OpticPro UT16B -0x07b3 0x0403 root:scanner 0664 +0x07b3 0x0403 root:scanner 0664 # Nortek MyScan 1200 | Plustek OpticPro S12 | Plustek OpticPro ST12 -0x07b3 0x040b root:scanner 0664 +0x07b3 0x040b root:scanner 0664 # Plustek OpticPro S24 -0x07b3 0x040e root:scanner 0664 +0x07b3 0x040e root:scanner 0664 # NeatReceipts Scanalizer Professional 2.5 | Plustek OpticSlim M12 -0x07b3 0x0412 root:scanner 0664 +0x07b3 0x0412 root:scanner 0664 # Plustek OpticSlim 1200 -0x07b3 0x0413 root:scanner 0664 +0x07b3 0x0413 root:scanner 0664 # Plustek OpticSlim 2400 -0x07b3 0x0422 root:scanner 0664 +0x07b3 0x0422 root:scanner 0664 # Plustek OpticSlim 2400 plus -0x07b3 0x0454 root:scanner 0664 +0x07b3 0x0454 root:scanner 0664 # Plustek Iriscan Express 2 -0x07b3 0x045f root:scanner 0664 +0x07b3 0x045f root:scanner 0664 # NeatReceipts Mobile Scanner -0x07b3 0x0462 root:scanner 0664 +0x07b3 0x0462 root:scanner 0664 # Plustek OpticBook 3600 -0x07b3 0x0900 root:scanner 0664 +0x07b3 0x0900 root:scanner 0664 # Corex 600c -0x08f0 0x0002 root:scanner 0664 +0x08f0 0x0002 root:scanner 0664 # Corex 800c -0x08f0 0x0005 root:scanner 0664 +0x08f0 0x0005 root:scanner 0664 # Xerox Phaser 6110MFP -0x0924 0x3d5d root:scanner 0664 +0x0924 0x3d5d root:scanner 0664 # Xerox Phaser 3200MFP -0x0924 0x3da4 root:scanner 0664 +0x0924 0x3da4 root:scanner 0664 # Xerox WorkCentre 4118 Series -0x0924 0x420c root:scanner 0664 +0x0924 0x420c root:scanner 0664 # Xerox WorkCentre 3119 Series -0x0924 0x4265 root:scanner 0664 +0x0924 0x4265 root:scanner 0664 # Xerox WorkCentre 3210 -0x0924 0x4293 root:scanner 0664 +0x0924 0x4293 root:scanner 0664 # Xerox WorkCentre 3220 -0x0924 0x4294 root:scanner 0664 +0x0924 0x4294 root:scanner 0664 # Pentax DSmobile 600 -0x0a17 0x3210 root:scanner 0664 +0x0a17 0x3210 root:scanner 0664 # Portable Peripheral Co., Ltd. Q-Scan USB001 (A4 portable scanner) -0x0a53 0x1000 root:scanner 0664 +0x0a53 0x1000 root:scanner 0664 # Portable Peripheral Co., Ltd. Q-Scan USB201 (A6 portable scanner) -0x0a53 0x2000 root:scanner 0664 +0x0a53 0x2000 root:scanner 0664 # Syscan TravelScan 460/464 | Ambir Visigo A4 -0x0a82 0x4600 root:scanner 0664 +0x0a82 0x4600 root:scanner 0664 # Syscan DocketPort 465 -0x0a82 0x4802 root:scanner 0664 +0x0a82 0x4802 root:scanner 0664 # Syscan DocketPort 665 -0x0a82 0x4803 root:scanner 0664 +0x0a82 0x4803 root:scanner 0664 # Syscan DocketPort 685/ Ambir DS685 -0x0a82 0x480c root:scanner 0664 +0x0a82 0x480c root:scanner 0664 # Syscan DocketPort 485 -0x0a82 0x4810 root:scanner 0664 +0x0a82 0x4810 root:scanner 0664 # Syscan TravelScan 662 -0x0a82 0x6620 root:scanner 0664 +0x0a82 0x6620 root:scanner 0664 # Canon CR-55 -0x1083 0x160c root:scanner 0664 +0x1083 0x160c root:scanner 0664 # Canon DR-1210C -0x1083 0x160f root:scanner 0664 +0x1083 0x160f root:scanner 0664 # Canon DR-4010C -0x1083 0x1614 root:scanner 0664 +0x1083 0x1614 root:scanner 0664 # Canon DR-2510C -0x1083 0x1617 root:scanner 0664 +0x1083 0x1617 root:scanner 0664 # Canon DR-X10C -0x1083 0x1618 root:scanner 0664 +0x1083 0x1618 root:scanner 0664 # Canon CR-25 -0x1083 0x161a root:scanner 0664 +0x1083 0x161a root:scanner 0664 # Canon DR-2010C -0x1083 0x161b root:scanner 0664 +0x1083 0x161b root:scanner 0664 # Canon DR-3010C -0x1083 0x161d root:scanner 0664 +0x1083 0x161d root:scanner 0664 # Canon DR-7090C -0x1083 0x1620 root:scanner 0664 +0x1083 0x1620 root:scanner 0664 # Canon DR-9050C -0x1083 0x1622 root:scanner 0664 +0x1083 0x1622 root:scanner 0664 # Canon DR-7550C -0x1083 0x1623 root:scanner 0664 +0x1083 0x1623 root:scanner 0664 # Canon DR-6050C -0x1083 0x1624 root:scanner 0664 +0x1083 0x1624 root:scanner 0664 # Canon DR-6010C -0x1083 0x1626 root:scanner 0664 +0x1083 0x1626 root:scanner 0664 # Canon CR-190i -0x1083 0x162b root:scanner 0664 +0x1083 0x162b root:scanner 0664 # Canon DR-6030C -0x1083 0x1638 root:scanner 0664 +0x1083 0x1638 root:scanner 0664 # Canon CR-135i -0x1083 0x1639 root:scanner 0664 +0x1083 0x1639 root:scanner 0664 # Digital Dream l' espion XS -0x1183 0x0001 root:scanner 0664 +0x1183 0x0001 root:scanner 0664 # KONICA MINOLTA magicolor 1690MF -0x132b 0x2089 root:scanner 0664 +0x132b 0x2089 root:scanner 0664 # UMAX Astra 1220U -0x1606 0x0010 root:scanner 0664 +0x1606 0x0010 root:scanner 0664 # UMAX Astra 1600U | UMAX Astra 2000U -0x1606 0x0030 root:scanner 0664 +0x1606 0x0030 root:scanner 0664 # Umax UMAX 3400 -0x1606 0x0050 root:scanner 0664 +0x1606 0x0050 root:scanner 0664 # Umax UMAX 3400 | Umax UMAX Astranet ia101 | Umax UMAX 3450 -0x1606 0x0060 root:scanner 0664 +0x1606 0x0060 root:scanner 0664 # UMAX Astra 4400 | UMAX Astra 4450 -0x1606 0x0070 root:scanner 0664 +0x1606 0x0070 root:scanner 0664 # UMAX Astra 2100U -0x1606 0x0130 root:scanner 0664 +0x1606 0x0130 root:scanner 0664 # Umax UMAX 5400 -0x1606 0x0160 root:scanner 0664 +0x1606 0x0160 root:scanner 0664 # UMAX Astra 2200 (SU) -0x1606 0x0230 root:scanner 0664 +0x1606 0x0230 root:scanner 0664 # DCT DocketPort 487 -0x1dcc 0x4810 root:scanner 0664 +0x1dcc 0x4810 root:scanner 0664 # Dell A920 -0x413c 0x5105 root:scanner 0664 +0x413c 0x5105 root:scanner 0664 # Dell Dell MFP Laser Printer 1815dn -0x413c 0x5124 root:scanner 0664 +0x413c 0x5124 root:scanner 0664 # Dell 1600n -0x413c 0x5250 root:scanner 0664 +0x413c 0x5250 root:scanner 0664 diff --git a/testsuite/tools/data/html-backends-split.ref b/testsuite/tools/data/html-backends-split.ref index 72fd949bb..2739181b9 100644 --- a/testsuite/tools/data/html-backends-split.ref +++ b/testsuite/tools/data/html-backends-split.ref @@ -16,7 +16,7 @@ for more detailed (and usually important) information concerning each backend.

    If you have new information or corrections, please file a bug report -with as many details as possible. Also please tell us if your scanner +with as many details as possible. Also please tell us if your scanner isn't mentioned in this list at all.

    For an explanation of the tables, see the legend. @@ -84,82 +84,82 @@ isn't mentioned in this list at all.

    Scanners

    -

    Backends: -abaton, -agfafocus, -apple, -artec, -artec_eplus48u, -as6e, -avision, -bh, -canon, -canon630u, -canon_dr, -canon_pp, -cardscan, -coolscan, -coolscan2, -coolscan3, -dell1600n_net, -epjitsu, -epson, -epson2, -fujitsu, -genesys, -gt68xx, -hp, -hp3500, -hp3900, -hp4200, -hp5400, -hp5590, -hpljm1005, -hpsj5s, -hs2p, -ibm, -kodak, -kodakaio, -kvs20xx, -kvs40xx, -kvs1025, -leo, -lexmark, -ma1509, -magicolor, -matsushita, -microtek, -microtek2, -mustek, -mustek_pp, -mustek_usb, -mustek_usb2, -nec, -niash, -p5, -pie, -pixma, -plustek, -plustek_pp, -ricoh, -rts8891, -s9036, -sceptre, -sharp, -sm3600, -sm3840, -SnapScan, -sp15c, -st400, -tamarack, -teco1, -teco2, -teco3, -u12, -umax, -umax1220u, -umax_pp, -unsupported, +

    Backends: +abaton, +agfafocus, +apple, +artec, +artec_eplus48u, +as6e, +avision, +bh, +canon, +canon630u, +canon_dr, +canon_pp, +cardscan, +coolscan, +coolscan2, +coolscan3, +dell1600n_net, +epjitsu, +epson, +epson2, +fujitsu, +genesys, +gt68xx, +hp, +hp3500, +hp3900, +hp4200, +hp5400, +hp5590, +hpljm1005, +hpsj5s, +hs2p, +ibm, +kodak, +kodakaio, +kvs20xx, +kvs40xx, +kvs1025, +leo, +lexmark, +ma1509, +magicolor, +matsushita, +microtek, +microtek2, +mustek, +mustek_pp, +mustek_usb, +mustek_usb2, +nec, +niash, +p5, +pie, +pixma, +plustek, +plustek_pp, +ricoh, +rts8891, +s9036, +sceptre, +sharp, +sm3600, +sm3840, +SnapScan, +sp15c, +st400, +tamarack, +teco1, +teco2, +teco3, +u12, +umax, +umax1220u, +umax_pp, +unsupported, xerox_mfp

    Backend: abaton (unmaintained) @@ -298,7 +298,7 @@ Siemens (unmaintained)

    -Link(s): +Link(s): http://www4.infi.net/~cpinkham/sane/sane-artec-doc.html
    Manual page: sane-artec

    @@ -492,7 +492,7 @@ Siemens (0.5)

    -Link(s): +Link(s): http://as6edriver.sourceforge.net/
    Manual page: sane-as6e

    @@ -537,7 +537,7 @@ Siemens (Build: 296)

    -Link(s): +Link(s): http://skull.piratehaven.org/~mike/sane/avision.html
    Manual page: sane-avision

    @@ -1617,7 +1617,7 @@ Kyocera (1.0-4)

    -Link(s): +Link(s): http://www.martoneconsulting.com/sane-bh.html
    Manual page: sane-bh
    Comment: Supports Copiscan II scanners with Remote SCSI Controller (RSC) interface
    @@ -1680,7 +1680,7 @@ Kyocera (1.12)

    -Link(s): +Link(s): http://www.rzg.mpg.de/~mpd/sane/
    Manual page: sane-canon

    @@ -1758,7 +1758,7 @@ Kyocera (0.1)

    -Link(s): +Link(s): http://canon-fb630u.sourceforge.net/
    Manual page: sane-canon630u

    @@ -1792,7 +1792,7 @@ Kyocera (38)

    -Link(s): +Link(s): http://www.thebility.com/canon/
    Manual page: sane-canon_dr
    Comment: Backend updated for SANE release 1.0.23, see sane-canon_dr manpage
    @@ -2093,7 +2093,7 @@ Kyocera (0.33)

    -Link(s): +Link(s): http://canon-fb330p.sourceforge.net
    Manual page: sane-canon_pp

    @@ -2176,7 +2176,7 @@ Kyocera (2)

    -Link(s): +Link(s): http://www.thebility.com/cardscan/
    Manual page: sane-cardscan
    Comment: Backend updated for SANE release 1.0.21, see sane-cardscan manpage
    @@ -2211,7 +2211,7 @@ Kyocera (0.4.3)

    -Link(s): +Link(s): http://andreas.rick.free.fr/sane/
    Manual page: sane-coolscan

    @@ -2259,7 +2259,7 @@ Kyocera (0.1.8)

    -Link(s): +Link(s): http://coolscan2.sourceforge.net/
    Manual page: sane-coolscan2

    @@ -2446,7 +2446,7 @@ Kyocera (20)

    -Link(s): +Link(s): http://www.thebility.com/epjitsu/
    Manual page: sane-epjitsu
    Comment: Backend updated for SANE release 1.0.21, see sane-epjitsu manpage
    @@ -2502,7 +2502,7 @@ Kyocera (unmaintained)

    -Link(s): +Link(s): http://www.khk.net/sane
    Manual page: sane-epson

    @@ -5396,7 +5396,7 @@ Kyocera (117)

    -Link(s): +Link(s): http://www.thebility.com/fujitsu/
    Manual page: sane-fujitsu
    Comment: Backend updated for SANE release 1.0.23, see sane-fujitsu manpage
    @@ -5921,7 +5921,7 @@ Kyocera (1.0-63)

    -Link(s): +Link(s): http://www.meier-geinitz.de/sane/genesys-backend/
    Manual page: sane-genesys
    Comment: Only the USB scanners mentioned below are currently supported.
    @@ -6240,7 +6240,7 @@ Panasonic (1.0-84)

    -Link(s): +Link(s): http://www.meier-geinitz.de/sane/gt68xx-backend/
    Manual page: sane-gt68xx
    Comment: Only the USB scanners mentioned below are supported. For other Mustek BearPaws, look at the Plustek and the MA-1509 backend.
    @@ -6772,7 +6772,7 @@ RevScan (1.06)

    -Link(s): +Link(s): http://www.kirchgessner.net/
    Manual page: sane-hp

    @@ -6925,7 +6925,7 @@ RevScan (1.1)

    -Link(s): +Link(s): http://projects.troy.rollo.name/rt-scanners/
    Manual page: sane-hp3500
    Comment: HP3500 series scanners.
    @@ -6967,7 +6967,7 @@ RevScan (0.12)

    -Link(s): +Link(s): http://sourceforge.net/projects/hp3900-series/
    Manual page: sane-hp3900
    Comment: Still Beta
    @@ -7055,7 +7055,7 @@ RevScan (1.0-2)

    -Link(s): +Link(s): http://hp4200-backend.sourceforge.net
    Manual page: sane-hp4200

    @@ -7096,7 +7096,7 @@ RevScan (1.0-2)

    -Link(s): +Link(s): http://sourceforge.net/projects/hp5400backend
    Manual page: sane-hp5400
    Comment: HP5400 and HP5470 scanners. Prototype backend available
    @@ -7237,7 +7237,7 @@ RevScan (0.03)

    -Link(s): +Link(s): http://hpsj5s.sourceforge.net/
    Manual page: sane-hpsj5s

    @@ -7264,7 +7264,7 @@ RevScan (1.00)

    -Link(s): +Link(s): http://www.acjlaw.net:8080/~jeremy/Ricoh/
    Manual page: sane-hs2p
    Comment: This backend has been tested with the IS450DE (Duplex/Endorser). All major functions necessary for scanning are supported. This backend should work with all Ricoh scanners in the IS450 family as well as the IS420 series, but the IS420 has not yet been tested. Features provided by the optional Image Processing Unit (IPU) are not yet integrated into the backend, as my scanner lacks the IPU.
    @@ -7313,7 +7313,7 @@ RevScan (1.0-4)

    -Link(s): +Link(s): http://www.meier-geinitz.de/sane/ibm-backend/
    Manual page: sane-ibm
    Comment: This backend has had only limited testing. It needs more work especially for the Ricoh scanners. Patches are welcome.
    @@ -7364,7 +7364,7 @@ Ricoh (7)

    -Link(s): +Link(s): http://www.thebility.com/kodak/
    Manual page: sane-kodak
    Comment: New backend for SANE release 1.0.21, see sane-kodak manpage
    @@ -7616,7 +7616,7 @@ Ricoh (2.4.6)

    -Link(s): +Link(s): http://sourceforge.net/projects/cupsdriverkodak/
    Manual page: sane-kodakaio
    Comment: Backend for Kodak AiO ESP and Hero printers. Also possibly Advent AWL10
    @@ -7962,7 +7962,7 @@ Ricoh (1.0-10)

    -Link(s): +Link(s): http://www.zago.net/sane/#leo
    Manual page: sane-leo

    @@ -8007,7 +8007,7 @@ Genius (1.0-0)

    -Link(s): +Link(s): http://stef.dev.free.fr/sane/lexmark
    Manual page: sane-lexmark
    Comment: This backend supports lexmark x1100 series scanners.
    @@ -8107,7 +8107,7 @@ Dell (1.0-3)

    -Link(s): +Link(s): http://www.meier-geinitz.de/sane/ma1509-backend/
    Manual page: sane-ma1509

    @@ -8143,7 +8143,7 @@ Dell (1.0.0)

    -Link(s): +Link(s): http://wiki.kainhofer.com/hardware/magicolor_scan
    Manual page: sane-magicolor

    @@ -8184,7 +8184,7 @@ Dell (1.0-7)

    -Link(s): +Link(s): http://www.zago.net/sane
    Manual page: sane-matsushita

    @@ -8281,7 +8281,7 @@ Dell (0.13.1)

    -Link(s): +Link(s): http://www.mir.com/mtek/
    Manual page: sane-microtek

    @@ -8461,7 +8461,7 @@ Dell (unmaintained)

    -Link(s): +Link(s): http://karstenfestag.gmxhome.de/linux.html
    Manual page: sane-microtek2

    @@ -8711,7 +8711,7 @@ Dell (1.0-138)

    -Link(s): +Link(s): http://www.meier-geinitz.de/sane/mustek-backend/
    Manual page: sane-mustek
    Comment: Most Mustek SCSI scanners are supported by this backend. For USB scanners, look at the mustek_usb backend.
    @@ -8960,7 +8960,7 @@ Dell (13)

    -Link(s): +Link(s): http://penguin-breeder.org/sane/mustek_pp/
    Manual page: sane-mustek_pp
    Comment: Supports CIS and CCD type parallel port scanners from Mustek.
    @@ -9158,7 +9158,7 @@ Micromaxx (1.0-18)

    -Link(s): +Link(s): http://www.meier-geinitz.de/sane/mustek_usb-backend/
    Manual page: sane-mustek_usb
    Comment: Only the USB scanners mentioned below are supported. For BearPaws, look at the Plustek, MA-1509, and gt68xx backends.
    @@ -9216,7 +9216,7 @@ Micromaxx (1.0-10)

    -Link(s): +Link(s): http://www.meier-geinitz.de/sane/mustek_usb2-backend/
    Manual page: sane-mustek_usb2
    Comment: Only BearPaw 2448TA Pro is supported at the moment
    @@ -9244,7 +9244,7 @@ Micromaxx (0.12)

    -Link(s): +Link(s): http://www5a.biglobe.ne.jp/~saetaka/
    Manual page: sane-nec

    @@ -9271,7 +9271,7 @@ Micromaxx (0.3)

    -Link(s): +Link(s): http://sourceforge.net/projects/hp3300backend
    Manual page: sane-niash

    @@ -9337,7 +9337,7 @@ Micromaxx (1)

    -Link(s): +Link(s): http://www.sane-project.org/
    Manual page: sane-p5
    Comment: New backend for SANE release 1.0.21, see sane-p5 manpage
    @@ -9365,7 +9365,7 @@ Micromaxx (1.0)

    -Link(s): +Link(s): http://www.munton.demon.co.uk/sane
    Manual page: sane-pie

    @@ -9508,7 +9508,7 @@ Adlib (0.17.3)

    -Link(s): +Link(s): http://home.arcor.de/wittawat/pixma/, http://mp610.blogspot.com/
    Manual page: sane-pixma

    @@ -10494,7 +10494,7 @@ Adlib (0.52)

    -Link(s): +Link(s): http://www.gjaeger.de/scanner/plustek/
    Manual page: sane-plustek

    @@ -10816,7 +10816,7 @@ Ambir (0.43)

    -Link(s): +Link(s): http://www.gjaeger.de/scanner/plustek_pp/
    Manual page: sane-plustek_pp

    @@ -11058,7 +11058,7 @@ BrightScan (1.0-0)

    -Link(s): +Link(s): http://stef.dev.free.fr/sane/rts8891/index.html
    Manual page: sane-rts8891
    Comment: This backend supports Realtek RTS8891 ASIC bases scanners.
    @@ -11134,7 +11134,7 @@ BrightScan (1.0-10)

    -Link(s): +Link(s): http://www.zago.net/sane/
    Manual page: sane-sceptre

    @@ -11170,7 +11170,7 @@ BrightScan (0.32)

    -Link(s): +Link(s): http://www.satzbau-gmbh.de/staff/abel/sane-sharp.html
    Manual page: sane-sharp

    @@ -11232,7 +11232,7 @@ BrightScan (0.1)

    -Link(s): +Link(s): http://sm3600.sourceforge.net/
    Manual page: sane-sm3600

    @@ -11294,7 +11294,7 @@ BrightScan (1.1)

    -Link(s): +Link(s): http://www.ziplabel.com/sm3840/
    Manual page: sane-sm3840
    Comment: This reverse-engineered backend supports the USB ScanMaker 3840 model
    @@ -11329,7 +11329,7 @@ BrightScan (1.4)

    -Link(s): +Link(s): http://snapscan.sourceforge.net/
    Manual page: sane-snapscan
    Comment: Supported bit depths: 24 bit (color), 48 bit (color, Epson) 8 bit (gray)
    @@ -11789,7 +11789,7 @@ BrightScan (1.6)

    -Link(s): +Link(s): http://www.informatik.uni-oldenburg.de/~ingo/sane/
    Manual page: sane-st400

    @@ -11862,7 +11862,7 @@ Tamarack (1.0-10)

    -Link(s): +Link(s): http://www.zago.net/sane/#teco
    Manual page: sane-teco1

    @@ -12019,7 +12019,7 @@ Dextra (1.0-9)

    -Link(s): +Link(s): http://gkall.hobby.nl/teco2.html
    Manual page: sane-teco2

    @@ -12120,7 +12120,7 @@ Dextra (1.0-1)

    -Link(s): +Link(s): http://www.zago.net/sane/#teco3
    Manual page: sane-teco3

    @@ -12188,7 +12188,7 @@ Trust (0.02)

    -Link(s): +Link(s): http://www.gjaeger.de/scanner/u12/
    Manual page: sane-u12

    @@ -12254,7 +12254,7 @@ RevScan (1.0-41)

    -Link(s): +Link(s): http://www.rauch-domain.de/sane-umax/index.html
    Manual page: sane-umax

    @@ -12747,7 +12747,7 @@ Genius (unmaintained)

    -Link(s): +Link(s): http://sourceforge.net/projects/umax1220u-sane
    Manual page: sane-umax1220u

    @@ -12795,7 +12795,7 @@ Genius (1)

    -Link(s): +Link(s): http://umax1220p.sourceforge.net/
    Manual page: sane-umax_pp

    @@ -12868,7 +12868,7 @@ Genius (2010-06-09)

    -Link(s): +Link(s): /contrib.html
    Comment: The devices mentioned here are not supported by any SANE backend. However, there may be links to information about them or stand-alone programs.

    @@ -16120,16 +16120,16 @@ Vantas

    Still Cameras

    -

    Backends: -dc25, -dc210, -dc240, +

    Backends: +dc25, +dc210, +dc240, dmc

    Backend: dc25 (1.2)

    -Link(s): +Link(s): mailto:peter@fales-lorenz.net
    Manual page: sane-dc25

    @@ -16163,7 +16163,7 @@ Vantas (0.0)

    -Link(s): +Link(s): mailto:peter@fales-lorenz.net
    Manual page: sane-dc210

    @@ -16190,7 +16190,7 @@ Vantas (0.0)

    -Link(s): +Link(s): mailto:peter@fales-lorenz.net
    Manual page: sane-dc240

    @@ -16239,9 +16239,9 @@ Vantas

    Video Cameras

    -

    Backends: -qcam, -stv680, +

    Backends: +qcam, +stv680, unsupported

    Backend: qcam (unmaintained) @@ -16279,7 +16279,7 @@ Connectix (1.0-1)

    -Link(s): +Link(s): http://gkall.hobby.nl/stv680-aiptek.html
    Manual page: sane-stv680
    Comment: This vidcam backend is for the stv0680 chipset, See the website for more info.
    @@ -16334,7 +16334,7 @@ Connectix (2010-06-09)

    -Link(s): +Link(s): /contrib.html
    Comment: The devices mentioned here are not supported by any SANE backend. However, there may be links to information about them or stand-alone programs.

    @@ -16367,17 +16367,17 @@ Grandtek Scopecam

    APIs

    -

    Backends: -gphoto2, -pint, -pnm, -test, +

    Backends: +gphoto2, +pint, +pnm, +test, v4l

    Backend: gphoto2 (0.0)

    -Link(s): +Link(s): mailto:peter@fales-lorenz.net
    Manual page: sane-gphoto2
    Description: Multiple cameras supported by the gphoto2 libraries
    @@ -16395,7 +16395,7 @@ Grandtek Scopecam (1.0.8)

    -Link(s): +Link(s): mailto:henning@meier-geinitz.de
    Manual page: sane-pnm
    Description: Reads PNM files
    @@ -16405,7 +16405,7 @@ Grandtek Scopecam (1.0-28)

    -Link(s): +Link(s): http://www.meier-geinitz.de/sane/test-backend/
    Manual page: sane-test
    Description: Frontend-tester
    @@ -16415,21 +16415,21 @@ Grandtek Scopecam (1.0-3)

    -Link(s): +Link(s): mailto:henning@meier-geinitz.de
    Manual page: sane-v4l
    Description: Interface to Video For Linux API
    Comment: Supports video cameras and other devices accessed by the v4l kernel API, e.g. bttv devices. Quite a lot of known bugs.

    Meta Backends

    -

    Backends: -dll, +

    Backends: +dll, net

    Backend: dll (1.0.13)

    -Link(s): +Link(s): mailto:henning@meier-geinitz.de
    Manual page: sane-dll
    Description: Dynamic loading of shared-library backends.
    @@ -16438,7 +16438,7 @@ Grandtek Scopecam (1.0.14)

    -Link(s): +Link(s): http://www.penguin-breeder.org/?page=sane-net
    Manual page: sane-net
    Description: Network access to saned servers
    @@ -16451,8 +16451,8 @@ Grandtek Scopecam Version of backend/driver; newer versions may be available from their home sites.
    NEW! means brand-new to the current release of SANE.
    - UNMAINTAINED means that nobody maintains that backend. Expect no - new features or newly supported devices. You are welcome to take over + UNMAINTAINED means that nobody maintains that backend. Expect no + new features or newly supported devices. You are welcome to take over maintainership.

    Link(s):
    @@ -16472,18 +16472,18 @@ Grandtek Scopecam
    USB id:
    The USB vendor and product ids as printed by sane-find-scanner -q (only applicable for USB devices).
    Status:
    -
    Indicates how many of the features the device provides +
    Indicates how many of the features the device provides are supported by SANE.
    • unsupported means the device is not supported at least by this backend. It may be supported by other backends, however.
    • untested means the device may be supported but couldn't be tested. Be very careful and report success/failure.
    • minimal means that the - device is detected and scans at least in one mode. But the quality + device is detected and scans at least in one mode. But the quality is bad or important features won't work. -
    • basic means it works at +
    • basic means it works at least in the most important modes but quality is not perfect. -
    • good means the device is usable +
    • good means the device is usable for day-to-day work. Some rather exotic features may be missing. -
    • complete means the backends +
    • complete means the backends supports everything the device can do.
    Description:
    diff --git a/testsuite/tools/data/html-mfgs.ref b/testsuite/tools/data/html-mfgs.ref index 5e53ee3a2..0a59d3175 100644 --- a/testsuite/tools/data/html-mfgs.ref +++ b/testsuite/tools/data/html-mfgs.ref @@ -16,7 +16,7 @@ for more detailed (and usually important) information concerning each backend.

    If you have new information or corrections, please file a bug report -with as many details as possible. Also please tell us if your scanner +with as many details as possible. Also please tell us if your scanner isn't mentioned in this list at all.

    For an explanation of the tables, see the legend. @@ -84,125 +84,125 @@ isn't mentioned in this list at all.

    Scanners

    -

    Manufacturers: -Abaton, -Acer Peripherals, -Across Technologies, -Actown, -Adlib, -Advent, -AGFA, -Ambir, -Apple, -Aries, -Artec/Ultima, -Avigramm, -Avision, -Bell and Howell, -Bell+Howell, -BenQ, -Benq (Acer), -BlackWidow, -Boeder, -BrightScan, -Brother, -C-Channel, -Canon, -Chinon, -Compaq, -Compeye, -Corex, -Cybercom, -DCT, -Dell, -Devcom, -Dextra, -Dexxa, -E-Lux, -EDGE, -EDT (Electronic Document Technology), -Enhans, -Epson, -Escom, -Escort, -Fujitsu, -Gallery, -Genius, -Googlegear, -Guillemot, -Guillemot / Hercules, -Hercules, -Hewlett-Packard, -IBM, -IOMagic, -Iris, -iVina, -Kodak, -Komodo, -KONICA MINOLTA, -Kyocera, -LEO, -Lexmark, -Linotype Hell, -Logitech, -Medion/Lifetec/Tevion/Cytron, -Memorex, -Micromaxx, -Microstar, -Microtek, -Minolta, -Minolta-QMS, -Mitsubishi, -Mustek, -NeatReceipts, -NEC, -Network, -Nikon, -Nortek, -OKI, -Olivetti, -Olympus, -Optoelectronics, -Optrox, -Packard Bell, -Panasonic, -Pentax, -PIE, -PIOTECH, -PLANon, -Plustek, -Portable Peripheral Co., Ltd., -Primax, -Prolink, -Quato, -Reflecta, -Relisys, -RevScan, -Ricoh, -Samsung, -Scanport, -Scanshell, -Sceptre, -Sharp, -Sicos, -Siemens, -SmartDisk, -Spot Technology, -Syscan, -Tamarack, -Targa, -TCE, -Teco, -Tiny, -TriGem, -Trust, -UMAX, -Vantas, -Visioneer, -Viviscan, -Vobis, -Vuego, -Xerox, +

    Manufacturers: +Abaton, +Acer Peripherals, +Across Technologies, +Actown, +Adlib, +Advent, +AGFA, +Ambir, +Apple, +Aries, +Artec/Ultima, +Avigramm, +Avision, +Bell and Howell, +Bell+Howell, +BenQ, +Benq (Acer), +BlackWidow, +Boeder, +BrightScan, +Brother, +C-Channel, +Canon, +Chinon, +Compaq, +Compeye, +Corex, +Cybercom, +DCT, +Dell, +Devcom, +Dextra, +Dexxa, +E-Lux, +EDGE, +EDT (Electronic Document Technology), +Enhans, +Epson, +Escom, +Escort, +Fujitsu, +Gallery, +Genius, +Googlegear, +Guillemot, +Guillemot / Hercules, +Hercules, +Hewlett-Packard, +IBM, +IOMagic, +Iris, +iVina, +Kodak, +Komodo, +KONICA MINOLTA, +Kyocera, +LEO, +Lexmark, +Linotype Hell, +Logitech, +Medion/Lifetec/Tevion/Cytron, +Memorex, +Micromaxx, +Microstar, +Microtek, +Minolta, +Minolta-QMS, +Mitsubishi, +Mustek, +NeatReceipts, +NEC, +Network, +Nikon, +Nortek, +OKI, +Olivetti, +Olympus, +Optoelectronics, +Optrox, +Packard Bell, +Panasonic, +Pentax, +PIE, +PIOTECH, +PLANon, +Plustek, +Portable Peripheral Co., Ltd., +Primax, +Prolink, +Quato, +Reflecta, +Relisys, +RevScan, +Ricoh, +Samsung, +Scanport, +Scanshell, +Sceptre, +Sharp, +Sicos, +Siemens, +SmartDisk, +Spot Technology, +Syscan, +Tamarack, +Targa, +TCE, +Teco, +Tiny, +TriGem, +Trust, +UMAX, +Vantas, +Visioneer, +Viviscan, +Vobis, +Vuego, +Xerox, Yakumo

    Manufacturer: Abaton

    @@ -330,7 +330,7 @@ abaton
    (unmaintained)

    Manufacturer: Advent

    -Link(s): +Link(s): http://www.adventcomputers.co.uk

    @@ -357,7 +357,7 @@ abaton
    (unmaintained)

    Manufacturer: AGFA

    -Link(s): +Link(s): http://www.agfa.com/, http://www.agfa.com

    @@ -800,7 +800,7 @@ agfafocus
    (unmaintained)

    Manufacturer: Apple

    -Link(s): +Link(s): http://developer.apple.com/, http://www.apple.com/

    @@ -882,7 +882,7 @@ apple
    (unmaintained)

    Manufacturer: Artec/Ultima

    -Link(s): +Link(s): http://www.artecusa.com/

    @@ -1075,7 +1075,7 @@ artec_eplus48u
    (unmaintained)

    Manufacturer: Avision

    -Link(s): +Link(s): http://www.avision.com, http://www.avision.com/

    @@ -1850,7 +1850,7 @@ artec_eplus48u
    (unmaintained)

    Manufacturer: Bell and Howell

    -Link(s): +Link(s): http://www.bhscanners.com/

    @@ -1957,7 +1957,7 @@ artec_eplus48u
    (unmaintained)

    Manufacturer: BenQ

    -Link(s): +Link(s): http://www.benq.com/

    @@ -1984,7 +1984,7 @@ artec_eplus48u
    (unmaintained)

    Manufacturer: Benq (Acer)

    -Link(s): +Link(s): http://www.benq.com
    Comment: Formerly Acer Peripherals

    @@ -2408,7 +2408,7 @@ artec_eplus48u
    (unmaintained)

    Manufacturer: BlackWidow

    -Link(s): +Link(s): http://www.blackwidow.co.uk/

    @@ -2496,7 +2496,7 @@ artec_eplus48u
    (unmaintained)

    Manufacturer: Brother

    -Link(s): +Link(s): http://www.brother.com/

    @@ -2556,7 +2556,7 @@ artec_eplus48u
    (unmaintained)

    Manufacturer: C-Channel

    -Link(s): +Link(s): http://www.c-channel.ch/

    @@ -2605,7 +2605,7 @@ artec_eplus48u
    (unmaintained)

    Manufacturer: Canon

    -Link(s): +Link(s): http://www.canon.com/

    @@ -5407,7 +5407,7 @@ artec_eplus48u
    (unmaintained)

    Manufacturer: Compaq

    -Link(s): +Link(s): http://www.compaq.com/

    @@ -5470,7 +5470,7 @@ artec_eplus48u
    (unmaintained)

    Manufacturer: Corex

    -Link(s): +Link(s): http://www.cardscan.com/

    @@ -5555,7 +5555,7 @@ artec_eplus48u
    (unmaintained)

    Manufacturer: DCT

    -Link(s): +Link(s): http://www.docucap.com/
    Comment: Successor of Syscan in the USA

    @@ -5583,7 +5583,7 @@ artec_eplus48u
    (unmaintained)

    Manufacturer: Dell

    -Link(s): +Link(s): http://www.dell.com/

    @@ -5662,7 +5662,7 @@ xerox_mfp
    (1.0-13)

    Manufacturer: Devcom

    -Link(s): +Link(s): http://www.blackwidow.co.uk/

    @@ -5769,7 +5769,7 @@ xerox_mfp
    (1.0-13)

    Manufacturer: Dexxa

    -Link(s): +Link(s): http://www.dexxa.com

    @@ -5847,7 +5847,7 @@ xerox_mfp
    (1.0-13)

    Manufacturer: EDT (Electronic Document Technology)

    -Link(s): +Link(s): http://www.bizcardreader.com/

    @@ -5911,7 +5911,7 @@ xerox_mfp
    (1.0-13)

    Manufacturer: Epson

    -Link(s): +Link(s): http://www.epson.com/, http://www.epson.com

    @@ -10239,7 +10239,7 @@ epson2
    (1.0.124)

    Manufacturer: Fujitsu

    -Link(s): +Link(s): http://www.fujitsu.com, http://www.fujitsu.com/, http://www.fcpa.fujitsu.com/products/scanners/

    @@ -11268,7 +11268,7 @@ sp15c
    (unmaintained)

    Manufacturer: Genius

    -Link(s): +Link(s): http://www.genius-kye.com/, http://www.geniusmouse.co.uk/, http://www.geniusnet.com.tw/

    @@ -11697,7 +11697,7 @@ sp15c
    (unmaintained)

    Manufacturer: Guillemot / Hercules

    -Link(s): +Link(s): http://www.guillemot.com

    @@ -11782,7 +11782,7 @@ sp15c
    (unmaintained)

    Manufacturer: Hewlett-Packard

    -Link(s): +Link(s): http://www.hp.com, http://www.hp.com/

    @@ -12746,7 +12746,7 @@ hp5590
    (1.0.5)

    Manufacturer: IBM

    -Link(s): +Link(s): http://www.ibm.com/, http://www.ibm.com

    @@ -12784,7 +12784,7 @@ hp5590
    (1.0.5)

    Manufacturer: IOMagic

    -Link(s): +Link(s): http://www.iomagic.com/

    @@ -12811,7 +12811,7 @@ hp5590
    (1.0.5)

    Manufacturer: Iris

    -Link(s): +Link(s): http://irislink.com/

    @@ -12885,7 +12885,7 @@ hp5590
    (1.0.5)

    Manufacturer: Kodak

    -Link(s): +Link(s): http://www.kodak.com, http://www.kodak.com/

    @@ -13627,7 +13627,7 @@ hp5590
    (1.0.5)

    Manufacturer: Komodo

    -Link(s): +Link(s): http://www.komodo.com/

    @@ -13654,7 +13654,7 @@ hp5590
    (1.0.5)

    Manufacturer: KONICA MINOLTA

    -Link(s): +Link(s): http://www.konicaminolta.com/

    @@ -13819,7 +13819,7 @@ hp5590
    (1.0.5)

    Manufacturer: Lexmark

    -Link(s): +Link(s): http://www.lexmark.com/

    @@ -14121,7 +14121,7 @@ hp5590
    (1.0.5)

    Manufacturer: Linotype Hell

    -Link(s): +Link(s): http://www.heidelberg.com/

    @@ -14316,7 +14316,7 @@ hp5590
    (1.0.5)

    Manufacturer: Medion/Lifetec/Tevion/Cytron

    -Link(s): +Link(s): http://www.medion.com, http://www.medion.com/, http://www.medion.de/
    Comment: Sold by Aldi and Tchibo.

    @@ -14616,7 +14616,7 @@ artec_eplus48u
    (unmaintained)

    Manufacturer: Memorex

    -Link(s): +Link(s): http://www.artecusa.com/, http://www.memorex.com/

    @@ -14711,7 +14711,7 @@ artec_eplus48u
    (unmaintained)

    Manufacturer: Microstar

    -Link(s): +Link(s): http://www.microstar.de/

    @@ -14737,7 +14737,7 @@ artec_eplus48u
    (unmaintained)

    Manufacturer: Microtek

    -Link(s): +Link(s): http://www.microtek.com/
    Comment: Microtek makes a wide variety of devices.

    @@ -15667,7 +15667,7 @@ artec_eplus48u
    (unmaintained)

    Manufacturer: Minolta

    -Link(s): +Link(s): http://www.minolta.com

    @@ -15785,7 +15785,7 @@ artec_eplus48u
    (unmaintained)

    Manufacturer: Mitsubishi

    -Link(s): +Link(s): http://www.mitsubishi.com

    @@ -15867,7 +15867,7 @@ artec_eplus48u
    (unmaintained)

    Manufacturer: Mustek

    -Link(s): +Link(s): http://www.mustek.com/, http://www.mustek.com.tw/, http://www.mustek.de/

    @@ -16810,7 +16810,7 @@ artec_eplus48u
    (unmaintained)

    Manufacturer: NEC

    -Link(s): +Link(s): http://www.nevt.co.jp/

    @@ -16873,7 +16873,7 @@ artec_eplus48u
    (unmaintained)

    Manufacturer: Nikon

    -Link(s): +Link(s): http://www.nikon.com/

    @@ -17204,7 +17204,7 @@ coolscan3
    (1.0.0)

    Manufacturer: Olivetti

    -Link(s): +Link(s): http://www.olivetti.com

    @@ -17231,7 +17231,7 @@ coolscan3
    (1.0.0)

    Manufacturer: Olympus

    -Link(s): +Link(s): http://www.olympus.com

    @@ -17432,7 +17432,7 @@ coolscan3
    (1.0.0)

    Manufacturer: Panasonic

    -Link(s): +Link(s): http://www.panasonic.com/

    @@ -17823,7 +17823,7 @@ kvs40xx
    (unmaintained)

    Manufacturer: Pentax

    -Link(s): +Link(s): http://www.pentaxtech.com/, http://mobilesolutions.brother-usa.com/

    @@ -17872,7 +17872,7 @@ kvs40xx
    (unmaintained)

    Manufacturer: PIE

    -Link(s): +Link(s): http://www.scanace.com/
    Comment: Pacific Image Electronics

    @@ -18076,7 +18076,7 @@ kvs40xx
    (unmaintained)

    Manufacturer: PIOTECH

    -Link(s): +Link(s): http://www.image-land.com/

    @@ -18103,7 +18103,7 @@ kvs40xx
    (unmaintained)

    Manufacturer: PLANon

    -Link(s): +Link(s): http://www.planon.com/

    @@ -18152,7 +18152,7 @@ kvs40xx
    (unmaintained)

    Manufacturer: Plustek

    -Link(s): +Link(s): http://www.plustek.com/, http://www.plustek.de/

    @@ -18993,7 +18993,7 @@ kvs40xx
    (unmaintained)

    Manufacturer: Portable Peripheral Co., Ltd.

    -Link(s): +Link(s): http://www.pandp.com.tw/

    @@ -19031,7 +19031,7 @@ kvs40xx
    (unmaintained)

    Manufacturer: Primax

    -Link(s): +Link(s): http://www.primax.nl/, http://www.primax.com.tw

    @@ -19344,7 +19344,7 @@ kvs40xx
    (unmaintained)

    Manufacturer: Prolink

    -Link(s): +Link(s): http://www.fida.com/

    @@ -19382,7 +19382,7 @@ kvs40xx
    (unmaintained)

    Manufacturer: Quato

    -Link(s): +Link(s): http://www.quato.de/

    @@ -19467,7 +19467,7 @@ kvs40xx
    (unmaintained)

    Manufacturer: Relisys

    -Link(s): +Link(s): http://www.relisys.com/, http://www.tecoimage.com.tw/

    @@ -19805,7 +19805,7 @@ kvs40xx
    (unmaintained)

    Manufacturer: Ricoh

    -Link(s): +Link(s): http://www.ricoh.com/

    @@ -19907,7 +19907,7 @@ ricoh
    (unmaintained)

    Manufacturer: Samsung

    -Link(s): +Link(s): http://www.samsung.com

    @@ -20534,7 +20534,7 @@ xerox_mfp
    (1.0-13)

    Manufacturer: Scanport

    -Link(s): +Link(s): http://www.scanport.com/

    @@ -20608,7 +20608,7 @@ xerox_mfp
    (1.0-13)

    Manufacturer: Sceptre

    -Link(s): +Link(s): http://www.sceptre.com/

    @@ -20635,7 +20635,7 @@ xerox_mfp
    (1.0-13)

    Manufacturer: Sharp

    -Link(s): +Link(s): http://sharp-world.com/

    @@ -20742,7 +20742,7 @@ xerox_mfp
    (1.0-13)

    Manufacturer: Siemens

    -Link(s): +Link(s): http://www.siemens.com/, http://www.siemens.de/

    @@ -20895,7 +20895,7 @@ agfafocus
    (unmaintained)

    Manufacturer: Syscan

    -Link(s): +Link(s): http://www.syscaninc.com/

    @@ -21112,7 +21112,7 @@ tamarack
    (unmaintained)

    Manufacturer: TCE

    -Link(s): +Link(s): http://www.tce.com.br/
    Comment: Brasilian vendor.

    @@ -21151,7 +21151,7 @@ tamarack
    (unmaintained)

    Manufacturer: Teco

    -Link(s): +Link(s): http://www.tecoimage.com.tw/

    @@ -21203,7 +21203,7 @@ tamarack
    (unmaintained)

    Manufacturer: TriGem

    -Link(s): +Link(s): http://www.nikon.com/

    @@ -21230,7 +21230,7 @@ tamarack
    (unmaintained)

    Manufacturer: Trust

    -Link(s): +Link(s): http://www.trust-site.com, http://www.trust-site.com/home/, http://www.trust.com
    Comment: Carefully check the model names. Trust uses similar names for completely different hardware.

    @@ -21487,7 +21487,7 @@ artec_eplus48u
    (unmaintained)

    Manufacturer: UMAX

    -Link(s): +Link(s): http://www.umax.com/, http://www.umax.com.tw/, http://www.umax.de/en, http://www.umax-europe.com, http://www.umaxjapan.co.jp, http://www.umax.com.cn, http://www.umax.com

    @@ -22384,7 +22384,7 @@ artec_eplus48u
    (unmaintained)

    Manufacturer: Visioneer

    -Link(s): +Link(s): http://www.visioneer.com/

    @@ -23085,7 +23085,7 @@ artec_eplus48u
    (unmaintained)

    Manufacturer: Vobis

    -Link(s): +Link(s): http://www.vobis.de/

    @@ -23138,7 +23138,7 @@ artec_eplus48u
    (unmaintained)

    Manufacturer: Xerox

    -Link(s): +Link(s): http://www.xerox.com/, http://www.office.xerox.com/

    @@ -23467,7 +23467,7 @@ xerox_mfp
    (1.0-13)

    Manufacturer: Yakumo

    -Link(s): +Link(s): http://www.yakumo.com/

    @@ -23492,12 +23492,12 @@ artec_eplus48u
    (unmaintained)

    Still Cameras

    -

    Manufacturers: -Kodak, +

    Manufacturers: +Kodak, Polaroid

    Manufacturer: Kodak

    -Link(s): +Link(s): http://www.kodak.com/global/en/service/digCam/dc25/dc25.shtml, http://www.kodak.com/global/en/service/digCam/dc210/dc210.shtml, http://www.kodak.com/global/en/service/products/ekn006568.jhtml

    @@ -23557,7 +23557,7 @@ artec_eplus48u
    (unmaintained)

    Manufacturer: Polaroid

    -Link(s): +Link(s): http://www.polaroid.com/

    @@ -23582,17 +23582,17 @@ dmc
    (unmaintained)

    Video Cameras

    -

    Manufacturers: -Aiptek, -Biolux, -Connectix, -Creative, -Digital Dream, -Grandtek Scopecam, +

    Manufacturers: +Aiptek, +Biolux, +Connectix, +Creative, +Digital Dream, +Grandtek Scopecam, Konica

    Manufacturer: Aiptek

    -Link(s): +Link(s): http://www.aiptek.com.tw

    @@ -23678,7 +23678,7 @@ qcam
    (unmaintained)

    Manufacturer: Creative

    -Link(s): +Link(s): http://www.creative.com/

    @@ -23705,7 +23705,7 @@ qcam
    (unmaintained)

    Manufacturer: Digital Dream

    -Link(s): +Link(s): http://www.digitaldreamco.com/en/index.shtml

    @@ -23757,7 +23757,7 @@ qcam
    (unmaintained)

    Manufacturer: Konica

    -Link(s): +Link(s): http://www.konicaminolta.com

    @@ -23783,17 +23783,17 @@ qcam
    (unmaintained)

    APIs

    -

    Backends: -gphoto2, -pint, -pnm, -test, +

    Backends: +gphoto2, +pint, +pnm, +test, v4l

    Backend: gphoto2 (0.0)

    -Link(s): +Link(s): mailto:peter@fales-lorenz.net
    Manual page: sane-gphoto2
    Description: Multiple cameras supported by the gphoto2 libraries
    @@ -23811,7 +23811,7 @@ qcam
    (unmaintained) (1.0.8)

    -Link(s): +Link(s): mailto:henning@meier-geinitz.de
    Manual page: sane-pnm
    Description: Reads PNM files
    @@ -23821,7 +23821,7 @@ qcam
    (unmaintained) (1.0-28)

    -Link(s): +Link(s): http://www.meier-geinitz.de/sane/test-backend/
    Manual page: sane-test
    Description: Frontend-tester
    @@ -23831,21 +23831,21 @@ qcam
    (unmaintained) (1.0-3)

    -Link(s): +Link(s): mailto:henning@meier-geinitz.de
    Manual page: sane-v4l
    Description: Interface to Video For Linux API
    Comment: Supports video cameras and other devices accessed by the v4l kernel API, e.g. bttv devices. Quite a lot of known bugs.

    Meta Backends

    -

    Backends: -dll, +

    Backends: +dll, net

    Backend: dll (1.0.13)

    -Link(s): +Link(s): mailto:henning@meier-geinitz.de
    Manual page: sane-dll
    Description: Dynamic loading of shared-library backends.
    @@ -23854,7 +23854,7 @@ qcam
    (unmaintained) (1.0.14)

    -Link(s): +Link(s): http://www.penguin-breeder.org/?page=sane-net
    Manual page: sane-net
    Description: Network access to saned servers
    @@ -23870,18 +23870,18 @@ qcam
    (unmaintained)

    USB id:
    The USB vendor and product ids as printed by sane-find-scanner -q (only applicable for USB devices).
    Status:
    -
    Indicates how many of the features the device provides +
    Indicates how many of the features the device provides are supported by SANE.
    • unsupported means the device is not supported at least by this backend. It may be supported by other backends, however.
    • untested means the device may be supported but couldn't be tested. Be very careful and report success/failure.
    • minimal means that the - device is detected and scans at least in one mode. But the quality + device is detected and scans at least in one mode. But the quality is bad or important features won't work. -
    • basic means it works at +
    • basic means it works at least in the most important modes but quality is not perfect. -
    • good means the device is usable +
    • good means the device is usable for day-to-day work. Some rather exotic features may be missing. -
    • complete means the backends +
    • complete means the backends supports everything the device can do.
    Comment:
    @@ -23891,8 +23891,8 @@ qcam
    (unmaintained) Version of backend/driver; newer versions may be available from their home sites.
    NEW! means brand-new to the current release of SANE.
    - UNMAINTAINED means that nobody maintains that backend. Expect no - new features or newly supported devices. You are welcome to take over + UNMAINTAINED means that nobody maintains that backend. Expect no + new features or newly supported devices. You are welcome to take over maintainership.
    Manual Page:
    diff --git a/testsuite/tools/data/testfile.desc b/testsuite/tools/data/testfile.desc index 06359b6b7..9fa227b8c 100644 --- a/testsuite/tools/data/testfile.desc +++ b/testsuite/tools/data/testfile.desc @@ -20,7 +20,7 @@ :comment "Untested, use with caution" :backend "agfafocus" :version "unmaintained" -:manpage "sane-agfafocus" +:manpage "sane-agfafocus" :devicetype :scanner @@ -66,9 +66,9 @@ ;:url "http://no.www.page.yet/" ; backend's web page :devicetype :scanner ; start of a list of devices.... - + :mfg "Apple" -:url "http://developer.apple.com/" +:url "http://developer.apple.com/" :model "Apple Scanner" :interface "SCSI" :status :good ; :alpha, :beta, :stable, :new @@ -1327,7 +1327,7 @@ ; :backend "canon_dr" ; name of backend -:url "http://www.thebility.com/canon/" +:url "http://www.thebility.com/canon/" :version "38" ; version of backend :manpage "sane-canon_dr" ; name of manpage (if it exists) :comment "Backend updated for SANE release 1.0.23, see sane-canon_dr manpage" @@ -1644,7 +1644,7 @@ ; :backend "cardscan" ; name of backend -:url "http://www.thebility.com/cardscan/" +:url "http://www.thebility.com/cardscan/" :version "2" ; version of backend :manpage "sane-cardscan" ; name of manpage (if it exists) :comment "Backend updated for SANE release 1.0.21, see sane-cardscan manpage" @@ -1835,7 +1835,7 @@ :model "LS-30" ; name models for above-specified mfg. :interface "SCSI" -:comment "alpha: only 24/30 bit RGB + 32/40 bit RGBI" +:comment "alpha: only 24/30 bit RGB + 32/40 bit RGBI" :status :basic :model "LS-2000" ; name models for above-specified mfg. @@ -1845,7 +1845,7 @@ :model "LS-1000" :interface "SCSI" -:comment "Doesn't support gamma correction" +:comment "Doesn't support gamma correction" :status :basic ; :comment and :url specifiers are optional after :mfg, :model, :desc, @@ -1858,7 +1858,7 @@ :url "mailto:peter@fales-lorenz.net" ; backend's web page :devicetype :stillcam ; start of a list of devices.... - + :mfg "Kodak" :url "http://www.kodak.com/global/en/service/digCam/dc210/dc210.shtml" :model "DC210" @@ -1872,7 +1872,7 @@ :url "mailto:peter@fales-lorenz.net" ; backend's web page :devicetype :stillcam ; start of a list of devices.... - + :mfg "Kodak" :url "http://www.kodak.com/global/en/service/products/ekn006568.jhtml" :model "DC240" @@ -1960,7 +1960,7 @@ ; :backend "epjitsu" ; name of backend -:url "http://www.thebility.com/epjitsu/" +:url "http://www.thebility.com/epjitsu/" :version "20" ; version of backend :manpage "sane-epjitsu" ; name of manpage (if it exists) :comment "Backend updated for SANE release 1.0.21, see sane-epjitsu manpage" @@ -4349,10 +4349,10 @@ :usbid "0x04b8" "0x082b" :status :good -:model "DX-6000" -:interface "USB" -:usbid "0x04b8" "0x082e" -:status :good +:model "DX-6000" +:interface "USB" +:usbid "0x04b8" "0x082e" +:status :good :model "DX-7400" :interface "USB" @@ -4397,7 +4397,7 @@ :backend "fujitsu" ; name of backend -:url "http://www.thebility.com/fujitsu/" +:url "http://www.thebility.com/fujitsu/" :version "117" ; version of backend :manpage "sane-fujitsu" ; name of manpage (if it exists) :comment "Backend updated for SANE release 1.0.23, see sane-fujitsu manpage" @@ -4412,7 +4412,7 @@ ; DISCONTINUED OLDER MODELS, SMALL :model "M3091DC" :interface "SCSI" -:url "http://www.remote.org/frederik/projects/software/sane/" +:url "http://www.remote.org/frederik/projects/software/sane/" :status :complete :comment "small, old, discontinued" @@ -5131,7 +5131,7 @@ :url "mailto:peter@fales-lorenz.net" ; backend's web page :devicetype :api ; start of a list of devices.... - + :desc "Multiple cameras supported by the gphoto2 libraries" :url "http://www.gphoto.org" ;:interface "USB, serial port" @@ -5268,7 +5268,7 @@ :mfg "Medion/Lifetec/Tevion/Cytron" :url "http://www.medion.com" :comment "Sold by Aldi and Tchibo." - + :model "MD 4394" :interface "USB" :usbid "0x05d8" "0x4002" @@ -5779,7 +5779,7 @@ :comment "8bpp color, 75/150/300/600 dpi only" ; :comment and :url specifiers are optional after :mfg, :model, :desc, -; and at the top-level. +; and at the top-level. ; Copied from hp3300 testtools - Martijn van Oosterhout 22/02/2003 ; SANE Backend specification file ; @@ -6154,7 +6154,7 @@ :status :untested :comment "Untested, please report!" :backend "kodakaio" -:url "http://sourceforge.net/projects/cupsdriverkodak/" +:url "http://sourceforge.net/projects/cupsdriverkodak/" :version "2.4.6" :manpage "sane-kodakaio" :comment "Backend for Kodak AiO ESP and Hero printers. Also possibly Advent AWL10" @@ -6334,7 +6334,7 @@ :backend "kodak" -:url "http://www.thebility.com/kodak/" +:url "http://www.thebility.com/kodak/" :version "7" :manpage "sane-kodak" :comment "New backend for SANE release 1.0.21, see sane-kodak manpage" @@ -6660,7 +6660,7 @@ :devicetype :scanner ; start of a list of devices.... :mfg "LEO" -:model "LEOScan S3" +:model "LEOScan S3" :interface "SCSI" :comment "FCC ID LUZFS1130" :status :good @@ -6694,7 +6694,7 @@ :url "http://stef.dev.free.fr/sane/lexmark" ; backend's web page -:comment "This backend supports lexmark x1100 series scanners." +:comment "This backend supports lexmark x1100 series scanners." ; comment about the backend :devicetype :scanner ; start of a list of devices.... @@ -6794,7 +6794,7 @@ :interface "USB" :usbid "0x055f" "0x0010" :status :good -:comment "Works upto 600 dpi. No support for TA and ADF yet." +:comment "Works upto 600 dpi. No support for TA and ADF yet." :mfg "Fujitsu" ; name a manufacturer :url "http://www.fujitsu.com/" @@ -7083,7 +7083,7 @@ :backend "microtek" :version "0.13.1" -:manpage "sane-microtek" +:manpage "sane-microtek" :url "http://www.mir.com/mtek/" :devicetype :scanner @@ -7682,7 +7682,7 @@ :model "PagePartner" :interface "Parport (EPP/ECP)" -:status :basic +:status :basic :comment "Sheetfed scanner, work in gray and color, but uncalibrated scans" ; :comment and :url specifiers are optional after :mfg, :model, :desc, @@ -9153,10 +9153,10 @@ :backend "rts8891" ; name of backend :version "1.0-0" ; version of backend (or "unmaintained") :manpage "sane-rts8891" ; name of manpage (if it exists) -:url "http://stef.dev.free.fr/sane/rts8891/index.html" +:url "http://stef.dev.free.fr/sane/rts8891/index.html" ; backend's web page -:comment "This backend supports Realtek RTS8891 ASIC bases scanners." +:comment "This backend supports Realtek RTS8891 ASIC bases scanners." ; comment about the backend :devicetype :scanner ; start of a list of devices.... @@ -9225,20 +9225,20 @@ :mfg "Sceptre" :url "http://www.sceptre.com/" -:model "Vividscan S1200" +:model "Vividscan S1200" :interface "SCSI" :status :basic :mfg "Komodo" :url "http://www.komodo.com/" -:model "S1200" +:model "S1200" :interface "SCSI" :status :untested :comment "rebadged Sceptre S1200" :backend "sharp" ; name of backend :version "0.32" ; version of backend ;:status :beta ; :alpha, :beta, :stable, :new -:url "http://www.satzbau-gmbh.de/staff/abel/sane-sharp.html" +:url "http://www.satzbau-gmbh.de/staff/abel/sane-sharp.html" ; backend's homepage :manpage "sane-sharp" :devicetype :scanner @@ -9344,7 +9344,7 @@ :version "1.1" ; version of backend (or "unmaintained") :manpage "sane-sm3840" ; name of manpage (if it exists) :url "http://www.ziplabel.com/sm3840/" ; backend's web page -:comment "This reverse-engineered backend supports the USB ScanMaker 3840 model" +:comment "This reverse-engineered backend supports the USB ScanMaker 3840 model" ; comment about the backend :devicetype :scanner ; start of a list of devices.... @@ -10695,41 +10695,41 @@ :mfg "UMAX" ; name a manufacturer :url "http://www.umax.com.tw/" -; These scanners are known to have the same ASIC family. +; These scanners are known to have the same ASIC family. :model "Astra 1220P" :interface "Parport (EPP/ECP)" -:status :good +:status :good :model "Astra 2000P" :interface "Parport (EPP/ECP)" -:status :good +:status :good :model "Astra 1600P" :interface "Parport (EPP/ECP)" -:status :good +:status :good :model "Astra 600P" :interface "Parport (SPP/ECP)" -:status :unsupported +:status :unsupported :comment "untested, but should be close to 610P" :model "Astra 610P" :interface "Parport (SPP/ECP)" -:status :good +:status :good :mfg "Hewlett-Packard" :model "Scanjet 3200C" :interface "Parport (EPP/ECP)" -:status :good +:status :good :comment "works (relabelled 1220P and 2000P)" :mfg "Genius" :model "ColorPage-Life Pro" :interface "Parport (EPP/ECP)" -:status :good +:status :good :comment "works (relabelled 1220P and 2000P)" ; :comment and :url specifiers are optional after :mfg, :model, :desc, @@ -11703,14 +11703,14 @@ :usbid "0x043d" "0x00bb" :status :unsupported :comment "Unsupported. See link for details." - + :model "X3450" :url "/unsupported/lexmark-x3450.html" :interface "USB" :usbid "0x043d" "0x00f6" :status :unsupported :comment "Unsupported. See link for details." - + :model "X5130" :url "/unsupported/lexmark-x5130.html" :interface "USB" @@ -13511,7 +13511,7 @@ ; :comment and :url specifiers are optional after :mfg, :model, :desc, ; and at the top-level. - + ; ; SANE Backend specification file ; diff --git a/testsuite/tools/data/xml.ref b/testsuite/tools/data/xml.ref index 822fd64f6..101488958 100644 --- a/testsuite/tools/data/xml.ref +++ b/testsuite/tools/data/xml.ref @@ -1,6 +1,6 @@ -unmaintained +unmaintained sane-abaton *none* @@ -29,7 +29,7 @@ -unmaintained +unmaintained sane-agfafocus *none* @@ -94,7 +94,7 @@ -unmaintained +unmaintained sane-apple *none* @@ -131,7 +131,7 @@ -unmaintained +unmaintained sane-artec http://www4.infi.net/~cpinkham/sane/sane-artec-doc.html @@ -216,7 +216,7 @@ -unmaintained +unmaintained sane-artec_eplus48u *none* @@ -354,7 +354,7 @@ -0.5 +0.5 sane-as6e http://as6edriver.sourceforge.net/ @@ -399,7 +399,7 @@ -Build: 296 +Build: 296 sane-avision http://skull.piratehaven.org/~mike/sane/avision.html @@ -1644,7 +1644,7 @@ -1.0-4 +1.0-4 sane-bh http://www.martoneconsulting.com/sane-bh.html @@ -1705,7 +1705,7 @@ -1.12 +1.12 sane-canon http://www.rzg.mpg.de/~mpd/sane/ @@ -1786,7 +1786,7 @@ -0.1 +0.1 sane-canon630u http://canon-fb630u.sourceforge.net/ @@ -1815,7 +1815,7 @@ -38 +38 sane-canon_dr http://www.thebility.com/canon/ @@ -2148,7 +2148,7 @@ -0.33 +0.33 sane-canon_pp http://canon-fb330p.sourceforge.net @@ -2233,7 +2233,7 @@ -2 +2 sane-cardscan http://www.thebility.com/cardscan/ @@ -2262,7 +2262,7 @@ -0.4.3 +0.4.3 sane-coolscan http://andreas.rick.free.fr/sane/ @@ -2307,7 +2307,7 @@ -0.1.8 +0.1.8 sane-coolscan2 http://coolscan2.sourceforge.net/ @@ -2384,7 +2384,7 @@ -1.0.0 +1.0.0 sane-coolscan3 *none* @@ -2477,7 +2477,7 @@ -1.2 +1.2 sane-dc25 mailto:peter@fales-lorenz.net @@ -2506,7 +2506,7 @@ -0.0 +0.0 sane-dc210 mailto:peter@fales-lorenz.net @@ -2527,7 +2527,7 @@ -0.0 +0.0 sane-dc240 mailto:peter@fales-lorenz.net @@ -2569,7 +2569,7 @@ -1.0.13 +1.0.13 sane-dll mailto:henning@meier-geinitz.de @@ -2581,7 +2581,7 @@ -unmaintained +unmaintained sane-dmc *none* @@ -2602,7 +2602,7 @@ -20 +20 sane-epjitsu http://www.thebility.com/epjitsu/ @@ -2655,7 +2655,7 @@ -unmaintained +unmaintained sane-epson http://www.khk.net/sane @@ -3196,7 +3196,7 @@ -1.0.124 +1.0.124 sane-epson2 *none* @@ -5945,7 +5945,7 @@ -117 +117 sane-fujitsu http://www.thebility.com/fujitsu/ @@ -6534,7 +6534,7 @@ -1.0-63 +1.0-63 sane-genesys http://www.meier-geinitz.de/sane/genesys-backend/ @@ -6906,7 +6906,7 @@ -0.0 +0.0 sane-gphoto2 mailto:peter@fales-lorenz.net @@ -6918,7 +6918,7 @@ -1.0-84 +1.0-84 sane-gt68xx http://www.meier-geinitz.de/sane/gt68xx-backend/ @@ -7542,7 +7542,7 @@ -1.06 +1.06 sane-hp http://www.kirchgessner.net/ @@ -7707,7 +7707,7 @@ -1.1 +1.1 sane-hp3500 http://projects.troy.rollo.name/rt-scanners/ @@ -7744,7 +7744,7 @@ -0.12 +0.12 sane-hp3900 http://sourceforge.net/projects/hp3900-series/ @@ -7837,7 +7837,7 @@ -1.0-2 +1.0-2 sane-hp4200 http://hp4200-backend.sourceforge.net @@ -7874,7 +7874,7 @@ -1.0-2 +1.0-2 sane-hp5400 http://sourceforge.net/projects/hp5400backend @@ -7911,7 +7911,7 @@ -1.0.5 +1.0.5 sane-hp5590 *none* @@ -7972,7 +7972,7 @@ -0 +0 sane-hpljm1005 *none* @@ -8009,7 +8009,7 @@ -0.03 +0.03 sane-hpsj5s http://hpsj5s.sourceforge.net/ @@ -8030,7 +8030,7 @@ -1.00 +1.00 sane-hs2p http://www.acjlaw.net:8080/~jeremy/Ricoh/ @@ -8075,7 +8075,7 @@ -1.0-4 +1.0-4 sane-ibm http://www.meier-geinitz.de/sane/ibm-backend/ @@ -8124,7 +8124,7 @@ -7 +7 sane-kodak http://www.thebility.com/kodak/ @@ -8401,7 +8401,7 @@ -2.4.6 +2.4.6 sane-kodakaio http://sourceforge.net/projects/cupsdriverkodak/ @@ -8626,7 +8626,7 @@ -unmaintained +unmaintained sane-kvs20xx *none* @@ -8687,7 +8687,7 @@ -unmaintained +unmaintained sane-kvs40xx *none* @@ -8724,7 +8724,7 @@ -unmaintained +unmaintained sane-kvs1025 *none* @@ -8761,7 +8761,7 @@ -1.0-10 +1.0-10 sane-leo http://www.zago.net/sane/#leo @@ -8806,7 +8806,7 @@ -1.0-0 +1.0-0 sane-lexmark http://stef.dev.free.fr/sane/lexmark @@ -8911,7 +8911,7 @@ -1.0-3 +1.0-3 sane-ma1509 http://www.meier-geinitz.de/sane/ma1509-backend/ @@ -8946,7 +8946,7 @@ -1.0.0 +1.0.0 sane-magicolor http://wiki.kainhofer.com/hardware/magicolor_scan @@ -8983,7 +8983,7 @@ -1.0-7 +1.0-7 sane-matsushita http://www.zago.net/sane @@ -9084,7 +9084,7 @@ -0.13.1 +0.13.1 sane-microtek http://www.mir.com/mtek/ @@ -9285,7 +9285,7 @@ -unmaintained +unmaintained sane-microtek2 http://karstenfestag.gmxhome.de/linux.html @@ -9566,7 +9566,7 @@ -1.0-138 +1.0-138 sane-mustek http://www.meier-geinitz.de/sane/mustek-backend/ @@ -9845,7 +9845,7 @@ -13 +13 sane-mustek_pp http://penguin-breeder.org/sane/mustek_pp/ @@ -10076,7 +10076,7 @@ -1.0-18 +1.0-18 sane-mustek_usb http://www.meier-geinitz.de/sane/mustek_usb-backend/ @@ -10135,7 +10135,7 @@ -1.0-10 +1.0-10 sane-mustek_usb2 http://www.meier-geinitz.de/sane/mustek_usb2-backend/ @@ -10158,7 +10158,7 @@ -0.12 +0.12 sane-nec http://www5a.biglobe.ne.jp/~saetaka/ @@ -10179,7 +10179,7 @@ -1.0.14 +1.0.14 sane-net http://www.penguin-breeder.org/?page=sane-net @@ -10191,7 +10191,7 @@ -0.3 +0.3 sane-niash http://sourceforge.net/projects/hp3300backend @@ -10260,7 +10260,7 @@ -1 +1 sane-p5 http://www.sane-project.org/ @@ -10281,7 +10281,7 @@ -1.0 +1.0 sane-pie http://www.munton.demon.co.uk/sane @@ -10438,7 +10438,7 @@ -unmaintained +unmaintained sane-pint *none* @@ -10450,7 +10450,7 @@ -0.17.3 +0.17.3 sane-pixma http://home.arcor.de/wittawat/pixma/ @@ -11568,7 +11568,7 @@ -0.52 +0.52 sane-plustek http://www.gjaeger.de/scanner/plustek/ @@ -11946,7 +11946,7 @@ -0.43 +0.43 sane-plustek_pp http://www.gjaeger.de/scanner/plustek_pp/ @@ -12184,7 +12184,7 @@ -1.0.8 +1.0.8 sane-pnm mailto:henning@meier-geinitz.de @@ -12196,7 +12196,7 @@ -unmaintained +unmaintained sane-qcam *none* @@ -12225,7 +12225,7 @@ -unmaintained +unmaintained sane-ricoh *none* @@ -12254,7 +12254,7 @@ -1.0-0 +1.0-0 sane-rts8891 http://stef.dev.free.fr/sane/rts8891/index.html @@ -12303,7 +12303,7 @@ -unmaintained +unmaintained sane-s9036 *none* @@ -12324,7 +12324,7 @@ -1.0-10 +1.0-10 sane-sceptre http://www.zago.net/sane/ @@ -12357,7 +12357,7 @@ -0.32 +0.32 sane-sharp http://www.satzbau-gmbh.de/staff/abel/sane-sharp.html @@ -12418,7 +12418,7 @@ -0.1 +0.1 sane-sm3600 http://sm3600.sourceforge.net/ @@ -12479,7 +12479,7 @@ -1.1 +1.1 sane-sm3840 http://www.ziplabel.com/sm3840/ @@ -12508,7 +12508,7 @@ -1.4 +1.4 sane-snapscan http://snapscan.sourceforge.net/ @@ -13003,7 +13003,7 @@ -unmaintained +unmaintained sane-sp15c *none* @@ -13033,7 +13033,7 @@ -1.6 +1.6 sane-st400 http://www.informatik.uni-oldenburg.de/~ingo/sane/ @@ -13062,7 +13062,7 @@ -1.0-1 +1.0-1 sane-stv680 http://gkall.hobby.nl/stv680-aiptek.html @@ -13119,7 +13119,7 @@ -unmaintained +unmaintained sane-tamarack *none* @@ -13156,7 +13156,7 @@ -1.0-10 +1.0-10 sane-teco1 http://www.zago.net/sane/#teco @@ -13330,7 +13330,7 @@ -1.0-9 +1.0-9 sane-teco2 http://gkall.hobby.nl/teco2.html @@ -13439,7 +13439,7 @@ -1.0-1 +1.0-1 sane-teco3 http://www.zago.net/sane/#teco3 @@ -13512,7 +13512,7 @@ -1.0-28 +1.0-28 sane-test http://www.meier-geinitz.de/sane/test-backend/ @@ -13524,7 +13524,7 @@ -0.02 +0.02 sane-u12 http://www.gjaeger.de/scanner/u12/ @@ -13594,7 +13594,7 @@ -1.0-41 +1.0-41 sane-umax http://www.rauch-domain.de/sane-umax/index.html @@ -14168,7 +14168,7 @@ -unmaintained +unmaintained sane-umax1220u http://sourceforge.net/projects/umax1220u-sane @@ -14213,7 +14213,7 @@ -1 +1 sane-umax_pp http://umax1220p.sourceforge.net/ @@ -14290,7 +14290,7 @@ -2010-06-09 +2010-06-09 *none* /contrib.html @@ -17578,7 +17578,7 @@ -1.0-3 +1.0-3 sane-v4l mailto:henning@meier-geinitz.de @@ -17590,7 +17590,7 @@ -1.0-13 +1.0-13 sane-xerox_mfp *none* diff --git a/tools/README b/tools/README index 10d0d9599..f58a91d8c 100644 --- a/tools/README +++ b/tools/README @@ -48,7 +48,7 @@ This directory contains various tools that may be useful: scanner protocol can be tested directly. gamma4scanimage: Creates a gamma table in the format expected by scanimage. - You can define a gamma value, shadow and highlight. + You can define a gamma value, shadow and highlight. Take a look at manual page gamma4scanimage for further information. RenSaneDlls.cmd: Convert backend-DLL-filenames according to 8.3 naming @@ -57,13 +57,13 @@ This directory contains various tools that may be useful: Maybe useful for SANE developers: sane-config: - Show SANE version, linker flags etc. Might be useful for + Show SANE version, linker flags etc. Might be useful for frontend developers. sane-desc: Generate SANE webpages (and ASCII lists) from backend .desc files. Run "sane-desc --help" for details. The default lists are generated - in doc/Makefile. + in doc/Makefile. check-po.awk: Print untranslated and fuzzy messages and their line numbers in the diff --git a/tools/RenSaneDlls.cmd b/tools/RenSaneDlls.cmd index 2973f85ec..97c6f7180 100644 --- a/tools/RenSaneDlls.cmd +++ b/tools/RenSaneDlls.cmd @@ -3,7 +3,7 @@ /* necessary for DLLs on OS/2 (C) Franz Bakan 2004,2005 */ /* */ /* 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 */ diff --git a/tools/check-po.awk b/tools/check-po.awk index 09e4d1528..e3bbf2ea4 100755 --- a/tools/check-po.awk +++ b/tools/check-po.awk @@ -30,7 +30,7 @@ # It was originaly been written for SANE backends translations, but # shall be able to check any .po file. # -# Originally writen by Yann E. MORIN +# Originally writen by Yann E. MORIN # # # Output will look like : diff --git a/tools/check-usb-chip.c b/tools/check-usb-chip.c index 50b3e88dd..ac71cb426 100644 --- a/tools/check-usb-chip.c +++ b/tools/check-usb-chip.c @@ -1,6 +1,6 @@ /* check-usb-chip.c -- Find out what USB scanner chipset is used - + Copyright (C) 2003-2005 Henning Meier-Geinitz Copyright (C) 2003 Gerhard Jaeger for LM983x tests @@ -706,7 +706,7 @@ check_ma1017 (struct usb_device *dev) finish_interface (handle); return 0; } - /* Read one byte again to work around a bug in the MA-1017 chipset that + /* Read one byte again to work around a bug in the MA-1017 chipset that appears when an odd number of bytes is read or written. */ result = usb_bulk_write (handle, 0x01, req, 2, 1000); result = usb_bulk_read (handle, 0x82, &res, 1, 1000); @@ -1727,14 +1727,14 @@ check_gl660_gl646 (struct usb_device *dev) /********** the gl841 section **********/ -/* the various incarnations could be distinguished by the +/* the various incarnations could be distinguished by the * bcdDevice entry: * 0x701 --> GL124 * 0x700 --> ? * 0x605 --> GL845 * 0x603 --> GL847 - * 0x601 --> GL846 - * 0x500 --> GL843 + * 0x601 --> GL846 + * 0x500 --> GL843 * 0x300 --> GL842 (perhaps only >= 0x303 ?) * 0x200 --> GL841 */ @@ -2239,7 +2239,7 @@ check_pv8630_lm9830 (struct usb_device *dev) if (!result) return "PV8630/LM9830?"; - result = + result = usb_control_msg (handle, 0x40, 0x01, 0x38, 0x01, NULL, 0, TIMEOUT); if (result < 0) { @@ -2261,7 +2261,7 @@ check_pv8630_lm9830 (struct usb_device *dev) return 0; } - result = + result = usb_control_msg (handle, 0x40, 0x01, 0x38, 0x01, NULL, 0, TIMEOUT); if (result < 0) { @@ -2375,7 +2375,7 @@ check_m011 (struct usb_device *dev) data = 0x63; - result = + result = usb_control_msg (handle, 0x40, 0x08, 0x34, 0x00, &data, 1, TIMEOUT); if (result < 0) { @@ -2876,13 +2876,13 @@ check_sq113 (struct usb_device *dev) result = prepare_interface (dev, &handle); if (!result) return "SQ113?"; - + buffer [0] = 0x5f; buffer [1] = 0x00; buffer [2] = 0x5f; buffer [3] = 0x00; - result = + result = usb_control_msg (handle, 0x40, 0x01, 0xb0, 0, (char *) buffer, 4, TIMEOUT); if (result < 0) { @@ -2900,7 +2900,7 @@ check_sq113 (struct usb_device *dev) buffer [2] = 0x8b; buffer [3] = data; - result = + result = usb_control_msg (handle, 0x40, 0x01, 0xb0, 0, (char *) buffer, 4, TIMEOUT); if (result < 0) { @@ -2915,7 +2915,7 @@ check_sq113 (struct usb_device *dev) buffer [1] = 0x8b; buffer [2] = 0x8b; buffer [3] = 0x8b; - result = + result = usb_control_msg (handle, 0x40, 0x01, 0x04, 0x8b, (char *) buffer, 4, TIMEOUT); if (result < 0) { @@ -2926,7 +2926,7 @@ check_sq113 (struct usb_device *dev) return 0; } - result = + result = usb_control_msg (handle, 0xc0, 0x01, 0x07, 0, (char *) buffer, 4, TIMEOUT); if (result < 0) { @@ -3240,7 +3240,7 @@ check_hp5590 (struct usb_device *dev) } /* Get confirmation for USB-in-USB command */ - result = usb_control_msg (handle, USB_ENDPOINT_IN | USB_TYPE_VENDOR, + result = usb_control_msg (handle, USB_ENDPOINT_IN | USB_TYPE_VENDOR, 0x0c, 0x8e, 0x20, (char *) &status, sizeof(status), TIMEOUT); if (result < 0) @@ -3874,14 +3874,14 @@ check_gt6816 (libusb_device_handle * handle, /** @brief check for known genesys chip * * Try to check if the scanner use a known genesys ASIC. - * The various incarnations could be distinguished by the + * The various incarnations could be distinguished by the * bcdDevice entry: * 0x701 --> GL124 * 0x700 --> ? * 0x605 --> GL845 * 0x603 --> GL847 - * 0x601 --> GL846 - * 0x500 --> GL843 + * 0x601 --> GL846 + * 0x500 --> GL843 * 0x300 --> GL842 (perhaps only >= 0x303 ?) * 0x200 --> GL841 * diff --git a/tools/epson2usb.pl b/tools/epson2usb.pl index afd6ebd97..c7f20deb4 100755 --- a/tools/epson2usb.pl +++ b/tools/epson2usb.pl @@ -32,7 +32,7 @@ use warnings; } foreach my $m (@models) { - + next unless defined $m->{'usbid'}; next if $m->{'status'} eq ':unsupported'; diff --git a/tools/sane-find-scanner.c b/tools/sane-find-scanner.c index 04f19d9b1..72241b2f3 100644 --- a/tools/sane-find-scanner.c +++ b/tools/sane-find-scanner.c @@ -225,7 +225,7 @@ scanner_do_scsi_inquiry (unsigned char *buffer, int sfd) memset (buffer, '\0', 256); /* clear buffer */ - size = 5; /* first get only 5 bytes to get size of + size = 5; /* first get only 5 bytes to get size of inquiry_return_block */ set_inquiry_return_size (inquiry.cmd, size); status = sanei_scsi_cmd (sfd, inquiry.cmd, inquiry.size, buffer, &size); @@ -433,13 +433,13 @@ get_libusb_string_descriptor (struct usb_device *dev, int index) return 0; } - if (sd->bLength < 2 + if (sd->bLength < 2 || sd->bDescriptorType != USB_DT_STRING) { usb_close (handle); return 0; } - + size = sd->bLength; buffer = calloc (1, size + 1); @@ -659,7 +659,7 @@ check_libusb_device (struct usb_device *dev, SANE_Bool from_file) ++is_scanner; break; case USB_CLASS_PER_INTERFACE: - if (dev->config[0].interface[interface_nr].num_altsetting == 0 || + if (dev->config[0].interface[interface_nr].num_altsetting == 0 || !dev->config[0].interface[interface_nr].altsetting) break; switch (dev->config[0].interface[interface_nr].altsetting[0].bInterfaceClass) @@ -782,7 +782,7 @@ get_libusb_string_descriptor (libusb_device_handle *hdl, int index) if ((short_buffer[0] < 2) /* descriptor length */ || (short_buffer[1] != LIBUSB_DT_STRING)) /* descriptor type */ return NULL; - + size = short_buffer[0]; buffer = calloc (1, size + 1); @@ -934,7 +934,7 @@ check_libusb_device (libusb_device *dev, SANE_Bool from_file) printf (" iConfiguration %d (%s)\n", c->iConfiguration, (buf) ? buf : ""); free (buf); - + printf (" bmAttributes %d (%s%s)\n", c->bmAttributes, c->bmAttributes & 64 ? "Self-powered" : "", c->bmAttributes & 32 ? "Remote Wakeup" : ""); @@ -1064,7 +1064,7 @@ check_libusb_device (libusb_device *dev, SANE_Bool from_file) if (is_scanner > 0) { char *chipset = NULL; - + if(!from_file) chipset = check_usb_chip (verbose, desc, hdl, config0); @@ -1084,7 +1084,7 @@ check_libusb_device (libusb_device *dev, SANE_Bool from_file) libusb_device_found = SANE_TRUE; device_found = SANE_TRUE; } - + libusb_free_config_descriptor (config0); out_free: @@ -1212,14 +1212,14 @@ static char **build_scsi_dev_list(void) adapter = (PSCSI_ADAPTER_BUS_INFO)buffer; - for(i = 0; i < adapter->NumberOfBuses; i++) { + for(i = 0; i < adapter->NumberOfBuses; i++) { if (adapter->BusData[i].InquiryDataOffset == 0) { /* No device here */ continue; } - inquiry = (PSCSI_INQUIRY_DATA) (buffer + + inquiry = (PSCSI_INQUIRY_DATA) (buffer + adapter->BusData[i].InquiryDataOffset); while(1) { /* Check if it is a scanner or a processor @@ -1233,7 +1233,7 @@ static char **build_scsi_dev_list(void) dev_list[dev_list_index] = strdup(device_name); dev_list_index++; } - + if (inquiry->NextInquiryDataOffset == 0) { /* No device here */ break; @@ -1300,7 +1300,7 @@ check_mustek_pp_device (void) printf ("checking %s...", devices[ctr]); result = sanei_pa4s2_open (devices[ctr], &fd); - + if (verbose > 1) { if (result != 0) @@ -1315,13 +1315,13 @@ check_mustek_pp_device (void) found++; sanei_pa4s2_close(fd); } - + /* trying scsi over pp devices */ if (verbose > 1) printf ("checking %s (SCSI emulation)...", devices[ctr]); result = sanei_pa4s2_scsi_pp_open (devices[ctr], &fd); - + if (verbose > 1) { if (result != 0) @@ -1365,7 +1365,7 @@ parse_num (char* search, const char* line, int base, long int * number) if (start_number == NULL) return SANE_FALSE; start_number += strlen (search); - + *number = strtol (start_number, NULL, base); if (verbose > 2) printf ("Found %s%ld\n", search, *number); @@ -1384,11 +1384,11 @@ parse_bcd (char* search, const char* line, long int * number) if (start_number == NULL) return SANE_FALSE; start_number += strlen (search); - + first_part = strtol (start_number, &end_number, 10); start_number = end_number + 1; /* skip colon */ second_part = strtol (start_number, NULL, 10); - *number = ((first_part / 10) << 12) + ((first_part % 10) << 8) + *number = ((first_part / 10) << 12) + ((first_part % 10) << 8) + ((second_part / 10) << 4) + (second_part % 10); if (verbose > 2) printf ("Found %s%ld\n", search, *number); @@ -1478,7 +1478,7 @@ parse_file (char *filename) } if (parse_num ("Ifs=", line, 10, &number)) dev->config[current_config].bNumInterfaces = number; - dev->config[current_config].interface + dev->config[current_config].interface = calloc (number, sizeof (struct usb_interface)); if (parse_num ("Atr=", line, 16, &number)) dev->config[current_config].bmAttributes = number; @@ -1504,24 +1504,24 @@ parse_file (char *filename) if (parse_num ("Alt=", line, 10, &number)) { current_as = number; - dev->config[current_config].interface[current_if].altsetting[current_as].bInterfaceNumber + dev->config[current_config].interface[current_if].altsetting[current_as].bInterfaceNumber = current_if; - dev->config[current_config].interface[current_if].altsetting[current_as].bAlternateSetting + dev->config[current_config].interface[current_if].altsetting[current_as].bAlternateSetting = current_as; } if (parse_num ("#EPs=", line, 10, &number)) - dev->config[current_config].interface[current_if].altsetting[current_as].bNumEndpoints + dev->config[current_config].interface[current_if].altsetting[current_as].bNumEndpoints = number; - dev->config[current_config].interface[current_if].altsetting[current_as].endpoint + dev->config[current_config].interface[current_if].altsetting[current_as].endpoint = calloc (number, sizeof (struct usb_endpoint_descriptor)); if (parse_num ("Cls=", line, 16, &number)) - dev->config[current_config].interface[current_if].altsetting[current_as].bInterfaceClass + dev->config[current_config].interface[current_if].altsetting[current_as].bInterfaceClass = number; if (parse_num ("Sub=", line, 16, &number)) - dev->config[current_config].interface[current_if].altsetting[current_as].bInterfaceSubClass + dev->config[current_config].interface[current_if].altsetting[current_as].bInterfaceSubClass = number; if (parse_num ("Prot=", line, 16, &number)) - dev->config[current_config].interface[current_if].altsetting[current_as].bInterfaceProtocol + dev->config[current_config].interface[current_if].altsetting[current_as].bInterfaceProtocol = number; break; case 'E': @@ -2069,7 +2069,7 @@ main (int argc, char **argv) "more details.\n"); #endif } - if (enable_pp_checks == SANE_TRUE) + if (enable_pp_checks == SANE_TRUE) { if (!check_mustek_pp_device() && verbose > 0) printf ("\n # No Mustek parallel port scanners found. If you expected" diff --git a/tools/xerox b/tools/xerox index 0b2a7c38a..0d04a0ce8 100755 --- a/tools/xerox +++ b/tools/xerox @@ -35,11 +35,11 @@ else WIDTH=8.27; HEIGHT=11.69 fi -SCANWIDTH=`bc <<_EOF_ +SCANWIDTH=`bc <<_EOF_ scale=3 $WIDTH-$LMARGIN-$RMARGIN _EOF_` -SCANHEIGHT=`bc <<_EOF_ +SCANHEIGHT=`bc <<_EOF_ scale=3 $HEIGHT-$TMARGIN-$BMARGIN _EOF_`