From 351b7328520c16730ceb46e5acae16038c42185e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Frings-F=C3=BCrst?= Date: Tue, 16 Feb 2021 18:24:19 +0100 Subject: New upstream version 1.0.32 --- backend/Makefile.am | 14 +- backend/abaton.c | 4 +- backend/abaton.h | 4 +- backend/agfafocus.c | 6 +- backend/agfafocus.h | 4 +- backend/apple.c | 12 +- backend/apple.h | 4 +- backend/artec.c | 6 +- backend/artec.h | 4 +- backend/artec_eplus48u.c | 14 +- backend/artec_eplus48u.conf.in | 1 + backend/artec_eplus48u.h | 16 +- backend/as6e.c | 4 +- backend/as6e.h | 4 +- backend/avision.c | 41 +- backend/avision.h | 18 +- backend/bh.c | 4 +- backend/bh.h | 4 +- backend/canon-sane.c | 4 +- backend/canon-scsi.c | 4 +- backend/canon.c | 12 +- backend/canon.h | 4 +- backend/canon630u-common.c | 6 +- backend/canon630u.c | 4 +- backend/canon_dr-cmd.h | 16 + backend/canon_dr.c | 432 +++- backend/canon_dr.conf.in | 2 +- backend/canon_dr.h | 23 +- backend/canon_lide70-common.c | 3419 +++++++++++++++++----------- backend/canon_lide70.c | 10 +- backend/canon_lide70.conf.in | 3 + backend/canon_pp-dev.c | 13 +- backend/canon_pp-dev.h | 6 +- backend/canon_pp-io.c | 11 +- backend/canon_pp-io.h | 6 +- backend/canon_pp.c | 20 +- backend/canon_pp.conf.in | 4 +- backend/canon_pp.h | 6 +- backend/cardscan.c | 10 +- backend/coolscan-scsidef.h | 6 +- backend/coolscan.c | 36 +- backend/coolscan.h | 8 +- backend/coolscan2.c | 16 +- backend/coolscan2.conf.in | 2 +- backend/coolscan3.c | 12 +- backend/coolscan3.conf.in | 2 +- backend/dc210.c | 4 +- backend/dc210.h | 4 +- backend/dc240.c | 4 +- backend/dc240.h | 4 +- backend/dc25.c | 19 +- backend/dc25.h | 6 +- backend/dell1600n_net.c | 22 +- backend/dll.c | 8 +- backend/dmc.c | 10 +- backend/dmc.h | 6 +- backend/epjitsu.c | 28 +- backend/epson.c | 44 +- backend/epson.h | 4 +- backend/epson2-ops.c | 46 +- backend/epson2.c | 141 +- backend/epson2.h | 13 +- backend/epson2_usb.c | 1 + backend/epsonds.c | 31 +- backend/epsonds.h | 3 + backend/escl.conf.in | 1 + backend/escl/escl.c | 587 ++++- backend/escl/escl.h | 120 +- backend/escl/escl_capabilities.c | 111 +- backend/escl/escl_crop.c | 4 +- backend/escl/escl_devices.c | 31 +- backend/escl/escl_jpeg.c | 4 +- backend/escl/escl_mupdf.c | 4 +- backend/escl/escl_newjob.c | 156 +- backend/escl/escl_pdf.c | 8 +- backend/escl/escl_png.c | 8 +- backend/escl/escl_reset.c | 6 +- backend/escl/escl_scan.c | 8 +- backend/escl/escl_status.c | 5 +- backend/escl/escl_tiff.c | 4 +- backend/fujitsu-scsi.h | 2 +- backend/fujitsu.c | 102 +- backend/fujitsu.h | 11 +- backend/genesys.conf.in | 3 +- backend/genesys/calibration.h | 4 +- backend/genesys/command_set.h | 4 +- backend/genesys/command_set_common.cpp | 4 +- backend/genesys/command_set_common.h | 4 +- backend/genesys/device.cpp | 4 +- backend/genesys/device.h | 6 +- backend/genesys/enums.cpp | 4 +- backend/genesys/enums.h | 4 +- backend/genesys/error.cpp | 4 +- backend/genesys/error.h | 4 +- backend/genesys/fwd.h | 4 +- backend/genesys/genesys.cpp | 34 +- backend/genesys/genesys.h | 4 +- backend/genesys/gl124.cpp | 8 +- backend/genesys/gl124.h | 4 +- backend/genesys/gl124_registers.h | 4 +- backend/genesys/gl646.cpp | 16 +- backend/genesys/gl646.h | 4 +- backend/genesys/gl646_registers.h | 4 +- backend/genesys/gl841.cpp | 8 +- backend/genesys/gl841.h | 4 +- backend/genesys/gl841_registers.h | 4 +- backend/genesys/gl842.cpp | 6 +- backend/genesys/gl842.h | 4 +- backend/genesys/gl842_registers.h | 4 +- backend/genesys/gl843.cpp | 8 +- backend/genesys/gl843.h | 4 +- backend/genesys/gl843_registers.h | 4 +- backend/genesys/gl846.cpp | 6 +- backend/genesys/gl846.h | 4 +- backend/genesys/gl846_registers.h | 4 +- backend/genesys/gl847.cpp | 4 +- backend/genesys/gl847.h | 4 +- backend/genesys/gl847_registers.h | 4 +- backend/genesys/image.cpp | 4 +- backend/genesys/image.h | 4 +- backend/genesys/image_buffer.cpp | 4 +- backend/genesys/image_buffer.h | 4 +- backend/genesys/image_pipeline.cpp | 4 +- backend/genesys/image_pipeline.h | 4 +- backend/genesys/image_pixel.cpp | 4 +- backend/genesys/image_pixel.h | 4 +- backend/genesys/low.cpp | 10 +- backend/genesys/low.h | 4 +- backend/genesys/motor.cpp | 4 +- backend/genesys/motor.h | 6 +- backend/genesys/register.h | 4 +- backend/genesys/register_cache.h | 4 +- backend/genesys/row_buffer.h | 4 +- backend/genesys/scanner_interface.cpp | 4 +- backend/genesys/scanner_interface.h | 4 +- backend/genesys/scanner_interface_usb.cpp | 4 +- backend/genesys/scanner_interface_usb.h | 4 +- backend/genesys/sensor.cpp | 4 +- backend/genesys/sensor.h | 4 +- backend/genesys/serialize.h | 4 +- backend/genesys/settings.cpp | 4 +- backend/genesys/settings.h | 4 +- backend/genesys/static_init.cpp | 4 +- backend/genesys/static_init.h | 4 +- backend/genesys/status.cpp | 4 +- backend/genesys/status.h | 4 +- backend/genesys/tables_frontend.cpp | 4 +- backend/genesys/tables_gpo.cpp | 4 +- backend/genesys/tables_memory_layout.cpp | 4 +- backend/genesys/tables_model.cpp | 6 +- backend/genesys/tables_motor.cpp | 4 +- backend/genesys/tables_sensor.cpp | 4 +- backend/genesys/test_scanner_interface.cpp | 4 +- backend/genesys/test_scanner_interface.h | 4 +- backend/genesys/test_settings.cpp | 4 +- backend/genesys/test_settings.h | 4 +- backend/genesys/test_usb_device.cpp | 4 +- backend/genesys/test_usb_device.h | 4 +- backend/genesys/usb_device.cpp | 4 +- backend/genesys/usb_device.h | 4 +- backend/genesys/utilities.h | 4 +- backend/genesys/value_filter.h | 4 +- backend/gphoto2.c | 9 +- backend/gphoto2.h | 4 +- backend/gt68xx.c | 10 +- backend/gt68xx.conf.in | 2 +- backend/gt68xx.h | 4 +- backend/gt68xx_devices.c | 4 +- backend/gt68xx_generic.c | 4 +- backend/gt68xx_generic.h | 4 +- backend/gt68xx_gt6801.c | 6 +- backend/gt68xx_gt6801.h | 4 +- backend/gt68xx_gt6816.c | 4 +- backend/gt68xx_gt6816.h | 4 +- backend/gt68xx_high.c | 16 +- backend/gt68xx_high.h | 8 +- backend/gt68xx_low.c | 24 +- backend/gt68xx_low.h | 52 +- backend/gt68xx_mid.c | 6 +- backend/gt68xx_mid.h | 6 +- backend/gt68xx_shm_channel.c | 14 +- backend/gt68xx_shm_channel.h | 4 +- backend/hp-accessor.c | 4 +- backend/hp-accessor.h | 4 +- backend/hp-device.c | 4 +- backend/hp-device.h | 4 +- backend/hp-handle.c | 6 +- backend/hp-handle.h | 4 +- backend/hp-hpmem.c | 4 +- backend/hp-option.c | 57 +- backend/hp-option.h | 7 +- backend/hp-scl.c | 9 +- backend/hp-scl.h | 4 +- backend/hp-scsi.h | 4 +- backend/hp.README | 4 +- backend/hp.TODO | 2 +- backend/hp.c | 16 +- backend/hp.h | 4 +- backend/hp3500.c | 10 +- backend/hp3900.c | 3 +- backend/hp3900_config.c | 9 +- backend/hp3900_debug.c | 5 +- backend/hp3900_rts8822.c | 61 +- backend/hp3900_sane.c | 27 +- backend/hp3900_types.c | 3 +- backend/hp3900_usb.c | 3 +- backend/hp4200.c | 3 +- backend/hp4200.h | 3 +- backend/hp4200_lm9830.c | 4 +- backend/hp4200_lm9830.h | 4 +- backend/hp5400.c | 3 +- backend/hp5400.h | 7 +- backend/hp5400_debug.c | 3 +- backend/hp5400_debug.h | 3 +- backend/hp5400_internal.c | 9 +- backend/hp5400_internal.h | 8 +- backend/hp5400_sane.c | 3 +- backend/hp5400_sanei.c | 3 +- backend/hp5400_sanei.h | 3 +- backend/hp5400_xfer.h | 3 +- backend/hp5590.c | 4 +- backend/hp5590_cmds.c | 4 +- backend/hp5590_cmds.h | 4 +- backend/hp5590_low.c | 4 +- backend/hp5590_low.h | 4 +- backend/hpljm1005.c | 6 +- backend/hpsj5s.c | 32 +- backend/hpsj5s.h | 4 +- backend/hs2p-saneopts.h | 4 +- backend/hs2p-scsi.c | 10 +- backend/hs2p-scsi.h | 8 +- backend/hs2p.c | 14 +- backend/hs2p.h | 6 +- backend/ibm-scsi.c | 4 +- backend/ibm.c | 12 +- backend/ibm.h | 4 +- backend/kodak-cmd.h | 2 +- backend/kodak.c | 20 +- backend/kodakaio.c | 60 +- backend/kvs1025_low.c | 2 +- backend/kvs1025_low.h | 4 +- backend/kvs1025_opt.c | 2 +- backend/kvs20xx.h | 2 +- backend/kvs20xx_cmd.c | 2 +- backend/kvs40xx.h | 2 +- backend/kvs40xx_cmd.c | 2 +- backend/leo.c | 5 +- backend/leo.h | 10 +- backend/lexmark.c | 8 +- backend/lexmark.h | 4 +- backend/lexmark_low.c | 28 +- backend/lexmark_models.c | 4 +- backend/lexmark_sensors.c | 4 +- backend/ma1509.c | 6 +- backend/ma1509.h | 4 +- backend/magicolor.c | 48 +- backend/matsushita.c | 7 +- backend/matsushita.h | 10 +- backend/microtek.c | 4 +- backend/microtek.h | 4 +- backend/microtek2.c | 34 +- backend/microtek2.h | 6 +- backend/mustek.c | 10 +- backend/mustek.conf.in | 2 +- backend/mustek.h | 4 +- backend/mustek_pp.c | 18 +- backend/mustek_pp.h | 10 +- backend/mustek_pp_ccd300.c | 4 +- backend/mustek_pp_ccd300.h | 4 +- backend/mustek_pp_cis.c | 6 +- backend/mustek_pp_cis.h | 4 +- backend/mustek_pp_null.c | 4 +- backend/mustek_scsi_pp.c | 4 +- backend/mustek_scsi_pp.h | 8 +- backend/mustek_usb.c | 6 +- backend/mustek_usb.h | 4 +- backend/mustek_usb2.c | 6 +- backend/mustek_usb2.h | 4 +- backend/mustek_usb2_asic.c | 14 +- backend/mustek_usb2_asic.h | 8 +- backend/mustek_usb2_high.c | 10 +- backend/mustek_usb2_high.h | 4 +- backend/mustek_usb2_reflective.c | 10 +- backend/mustek_usb2_transparent.c | 10 +- backend/mustek_usb_high.c | 16 +- backend/mustek_usb_high.h | 4 +- backend/mustek_usb_low.c | 4 +- backend/mustek_usb_low.h | 4 +- backend/mustek_usb_mid.c | 4 +- backend/mustek_usb_mid.h | 4 +- backend/nec.c | 10 +- backend/nec.h | 4 +- backend/net.c | 6 +- backend/net.h | 4 +- backend/niash.c | 9 +- backend/niash_core.c | 11 +- backend/niash_core.h | 5 +- backend/niash_xfer.c | 5 +- backend/niash_xfer.h | 5 +- backend/p5.c | 34 +- backend/p5.h | 13 +- backend/p5_device.c | 8 +- backend/p5_device.h | 12 +- backend/pie-scsidef.h | 4 +- backend/pie.c | 8 +- backend/pieusb.c | 6 +- backend/pieusb.h | 4 +- backend/pieusb_buffer.c | 6 +- backend/pieusb_buffer.h | 4 +- backend/pieusb_scancmd.c | 18 +- backend/pieusb_scancmd.h | 6 +- backend/pieusb_specific.c | 14 +- backend/pieusb_specific.h | 4 +- backend/pieusb_usb.c | 4 +- backend/pieusb_usb.h | 4 +- backend/pint.c | 4 +- backend/pint.h | 4 +- backend/pixma.conf.in | 2 +- backend/pixma/pixma.c | 57 +- backend/pixma/pixma.h | 33 +- backend/pixma/pixma_bjnp.c | 28 +- backend/pixma/pixma_bjnp.h | 16 +- backend/pixma/pixma_bjnp_private.h | 10 +- backend/pixma/pixma_common.c | 31 +- backend/pixma/pixma_common.h | 11 +- backend/pixma/pixma_imageclass.c | 10 +- backend/pixma/pixma_io.h | 8 +- backend/pixma/pixma_io_sanei.c | 4 +- backend/pixma/pixma_mp150.c | 73 +- backend/pixma/pixma_mp730.c | 4 +- backend/pixma/pixma_mp750.c | 6 +- backend/pixma/pixma_mp800.c | 21 +- backend/pixma/pixma_rename.h | 4 +- backend/plustek-pp.h | 6 +- backend/plustek-pp_dac.c | 4 +- backend/plustek-pp_dbg.h | 4 +- backend/plustek-pp_detect.c | 6 +- backend/plustek-pp_genericio.c | 6 +- backend/plustek-pp_hwdefs.h | 6 +- backend/plustek-pp_image.c | 10 +- backend/plustek-pp_io.c | 4 +- backend/plustek-pp_map.c | 6 +- backend/plustek-pp_misc.c | 8 +- backend/plustek-pp_models.c | 4 +- backend/plustek-pp_motor.c | 14 +- backend/plustek-pp_p12.c | 4 +- backend/plustek-pp_p12ccd.c | 6 +- backend/plustek-pp_p48xx.c | 4 +- backend/plustek-pp_p9636.c | 4 +- backend/plustek-pp_procfs.c | 4 +- backend/plustek-pp_procs.h | 4 +- backend/plustek-pp_ptdrv.c | 4 +- backend/plustek-pp_scale.c | 4 +- backend/plustek-pp_scan.h | 4 +- backend/plustek-pp_scandata.h | 4 +- backend/plustek-pp_sysdep.h | 4 +- backend/plustek-pp_tpa.c | 4 +- backend/plustek-pp_types.h | 4 +- backend/plustek-pp_wrapper.c | 4 +- backend/plustek-usb.c | 12 +- backend/plustek-usb.h | 12 +- backend/plustek-usbcal.c | 8 +- backend/plustek-usbcalfile.c | 6 +- backend/plustek-usbdevs.c | 6 +- backend/plustek-usbhw.c | 12 +- backend/plustek-usbimg.c | 6 +- backend/plustek-usbio.c | 6 +- backend/plustek-usbmap.c | 6 +- backend/plustek-usbscan.c | 10 +- backend/plustek-usbshading.c | 4 +- backend/plustek.c | 12 +- backend/plustek.h | 4 +- backend/plustek_pp.c | 12 +- backend/pnm.c | 4 +- backend/qcam.c | 10 +- backend/ricoh-scsi.c | 11 +- backend/ricoh.c | 13 +- backend/ricoh.h | 9 +- backend/ricoh2.c | 4 +- backend/ricoh2_buffer.c | 4 +- backend/rts8891.c | 65 +- backend/rts8891.h | 8 +- backend/rts8891_devices.c | 4 +- backend/rts8891_low.c | 12 +- backend/rts8891_low.h | 12 +- backend/rts88xx_lib.c | 8 +- backend/rts88xx_lib.h | 6 +- backend/s9036.c | 6 +- backend/s9036.h | 4 +- backend/sane_strstatus.c | 4 +- backend/sceptre.c | 5 +- backend/sceptre.h | 10 +- backend/sharp.c | 10 +- backend/sharp.h | 4 +- backend/sm3600-color.c | 12 +- backend/sm3600-gray.c | 4 +- backend/sm3600-homerun.c | 6 +- backend/sm3600-scanmtek.c | 6 +- backend/sm3600-scantool.h | 4 +- backend/sm3600-scanusb.c | 6 +- backend/sm3600-scanutil.c | 8 +- backend/sm3600.c | 8 +- backend/sm3600.h | 4 +- backend/sm3840.c | 4 +- backend/sm3840.h | 4 +- backend/sm3840_lib.c | 6 +- backend/sm3840_lib.h | 4 +- backend/sm3840_params.h | 4 +- backend/sm3840_scan.c | 4 +- backend/snapscan-data.c | 12 +- backend/snapscan-mutex.c | 4 +- backend/snapscan-options.c | 21 +- backend/snapscan-scsi.c | 24 +- backend/snapscan-sources.c | 28 +- backend/snapscan-sources.h | 18 +- backend/snapscan-usb.c | 12 +- backend/snapscan-usb.h | 12 +- backend/snapscan.c | 24 +- backend/snapscan.h | 17 +- backend/sp15c-scsi.h | 5 +- backend/sp15c.c | 9 +- backend/sp15c.h | 5 +- backend/st400.c | 4 +- backend/st400.conf.in | 2 +- backend/stv680.c | 9 +- backend/stv680.h | 10 +- backend/tamarack.c | 8 +- backend/tamarack.h | 4 +- backend/teco1.c | 7 +- backend/teco1.h | 10 +- backend/teco2.c | 13 +- backend/teco2.h | 10 +- backend/teco3.c | 9 +- backend/teco3.h | 10 +- backend/test-picture.c | 4 +- backend/test.c | 198 +- backend/test.h | 5 +- backend/u12-ccd.c | 6 +- backend/u12-hw.c | 4 +- backend/u12-hwdef.h | 4 +- backend/u12-if.c | 8 +- backend/u12-image.c | 6 +- backend/u12-io.c | 6 +- backend/u12-map.c | 6 +- backend/u12-motor.c | 6 +- backend/u12-scanner.h | 4 +- backend/u12-shading.c | 4 +- backend/u12-tpa.c | 4 +- backend/u12.c | 14 +- backend/u12.h | 4 +- backend/umax-scanner.c | 4 +- backend/umax-scanner.h | 4 +- backend/umax-scsidef.h | 6 +- backend/umax-uc1200s.c | 4 +- backend/umax-uc1200se.c | 4 +- backend/umax-uc1260.c | 4 +- backend/umax-uc630.c | 4 +- backend/umax-uc840.c | 4 +- backend/umax-ug630.c | 4 +- backend/umax-ug80.c | 4 +- backend/umax-usb.c | 8 +- backend/umax.c | 20 +- backend/umax.conf.in | 2 +- backend/umax.h | 24 +- backend/umax1220u-common.c | 12 +- backend/umax1220u.c | 4 +- backend/umax_pp.c | 11 +- backend/umax_pp.h | 4 +- backend/umax_pp_low.c | 60 +- backend/umax_pp_low.h | 4 +- backend/umax_pp_mid.c | 4 +- backend/umax_pp_mid.h | 8 +- backend/v4l.c | 6 +- backend/v4l.conf.in | 2 +- backend/xerox_mfp.c | 7 +- 475 files changed, 5244 insertions(+), 3947 deletions(-) (limited to 'backend') diff --git a/backend/Makefile.am b/backend/Makefile.am index 2ac341c..48a1393 100644 --- a/backend/Makefile.am +++ b/backend/Makefile.am @@ -185,7 +185,7 @@ be_convenience_libs = libabaton.la libagfafocus.la \ libumax1220u.la libumax_pp.la libv4l.la \ libxerox_mfp.la -# Each stand alone backend thats possible to be built should be listed +# Each stand-alone backend that's possible to be built should be listed # here. There are the libraries that are installed under $(libdir)/sane. # Format is libsane-${backend}.la. be_dlopen_libs = libsane-abaton.la libsane-agfafocus.la \ @@ -232,15 +232,15 @@ COMMON_LIBS = ../lib/liblib.la $(XML_LIBS) # Each backend should define a convenience library that compiles # 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. +# add a few support source files to convenience library. # 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 -# Each backend should define a stand alone library that gets installed. +# Each backend should define a stand-alone library that gets installed. # This will need to link in a special file ${backend}-s.c that allows -# the backend to be stand alone and contain all SANE API functions. +# the backend to be stand-alone and contain all SANE API functions. # Also, it will need to link in related convenience library as well as # any external libraries required to resolve symbols. # @@ -947,10 +947,10 @@ $(srcdir)/pixma/pixma.c: \ $(srcdir)/pixma/pixma_sane_options.h: @echo Generating $@ from $(@D)/pixma.c - @(cd $(@D); python scripts/pixma_gen_options.py h < pixma.c > $(@F)) + @(cd $(@D); $(PYTHON) scripts/pixma_gen_options.py h < pixma.c > $(@F)) $(srcdir)/pixma/pixma_sane_options.c: @echo Generating $@ from $(@D)/pixma.c - @(cd $(@D); python scripts/pixma_gen_options.py < pixma.c > $(@F)) + @(cd $(@D); $(PYTHON) scripts/pixma_gen_options.py < pixma.c > $(@F)) EXTRA_DIST += pixma/pixma_sane_options.c EXTRA_DIST += pixma/pixma_sane_options.h @@ -1262,7 +1262,7 @@ EXTRA_DIST += dll.aliases # what backends are preloaded. It should include what is needed by # those backends that are actually preloaded. if preloadable_backends_enabled -PRELOADABLE_BACKENDS_LIBS = ../sanei/sanei_config2.lo ../sanei/sanei_usb.lo ../sanei/sanei_scsi.lo ../sanei/sanei_pv8630.lo ../sanei/sanei_pp.lo ../sanei/sanei_thread.lo ../sanei/sanei_lm983x.lo ../sanei/sanei_access.lo ../sanei/sanei_net.lo ../sanei/sanei_wire.lo ../sanei/sanei_codec_bin.lo ../sanei/sanei_pa4s2.lo ../sanei/sanei_ab306.lo ../sanei/sanei_pio.lo ../sanei/sanei_tcp.lo ../sanei/sanei_udp.lo ../sanei/sanei_magic.lo $(LIBV4L_LIBS) $(MATH_LIB) $(IEEE1284_LIBS) $(TIFF_LIBS) $(JPEG_LIBS) $(GPHOTO2_LIBS) $(SOCKET_LIBS) $(USB_LIBS) $(AVAHI_LIBS) $(SCSI_LIBS) $(SANEI_THREAD_LIBS) $(RESMGR_LIBS) $(XML_LIBS) +PRELOADABLE_BACKENDS_LIBS = ../sanei/sanei_config2.lo ../sanei/sanei_usb.lo ../sanei/sanei_scsi.lo ../sanei/sanei_pv8630.lo ../sanei/sanei_pp.lo ../sanei/sanei_thread.lo ../sanei/sanei_lm983x.lo ../sanei/sanei_access.lo ../sanei/sanei_net.lo ../sanei/sanei_wire.lo ../sanei/sanei_codec_bin.lo ../sanei/sanei_pa4s2.lo ../sanei/sanei_ab306.lo ../sanei/sanei_pio.lo ../sanei/sanei_tcp.lo ../sanei/sanei_udp.lo ../sanei/sanei_magic.lo $(LIBV4L_LIBS) $(MATH_LIB) $(IEEE1284_LIBS) $(TIFF_LIBS) $(JPEG_LIBS) $(GPHOTO2_LIBS) $(SOCKET_LIBS) $(USB_LIBS) $(AVAHI_LIBS) $(SCSI_LIBS) $(SANEI_THREAD_LIBS) $(RESMGR_LIBS) $(PNG_LIBS) $(POPPLER_GLIB_LIBS) $(XML_LIBS) $(libcurl_LIBS) $(SNMP_LIBS) PRELOADABLE_BACKENDS_DEPS = ../sanei/sanei_config2.lo ../sanei/sanei_usb.lo ../sanei/sanei_scsi.lo ../sanei/sanei_pv8630.lo ../sanei/sanei_pp.lo ../sanei/sanei_thread.lo ../sanei/sanei_lm983x.lo ../sanei/sanei_access.lo ../sanei/sanei_net.lo ../sanei/sanei_wire.lo ../sanei/sanei_codec_bin.lo ../sanei/sanei_pa4s2.lo ../sanei/sanei_ab306.lo ../sanei/sanei_pio.lo ../sanei/sanei_tcp.lo ../sanei/sanei_udp.lo ../sanei/sanei_magic.lo $(SANEI_SANEI_JPEG_LO) endif nodist_libsane_la_SOURCES = dll-s.c diff --git a/backend/abaton.c b/backend/abaton.c index 3e487aa..d5968cc 100644 --- a/backend/abaton.c +++ b/backend/abaton.c @@ -18,9 +18,7 @@ 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. + along with this program. If not, see . As a special exception, the authors of SANE give permission for additional uses of the libraries contained in this release of SANE. diff --git a/backend/abaton.h b/backend/abaton.h index 1ecd867..0482d68 100644 --- a/backend/abaton.h +++ b/backend/abaton.h @@ -18,9 +18,7 @@ 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. + along with this program. If not, see . As a special exception, the authors of SANE give permission for additional uses of the libraries contained in this release of SANE. diff --git a/backend/agfafocus.c b/backend/agfafocus.c index 8177f38..71fcf30 100644 --- a/backend/agfafocus.c +++ b/backend/agfafocus.c @@ -16,8 +16,8 @@ for more details. You should have received a copy of the GNU General Public License - along with sane; see the file COPYING. If not, write to the Free - Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + along with sane; see the file COPYING. + If not, see . This file implements a SANE backend for AGFA Focus flatbed scanners. */ @@ -428,7 +428,7 @@ set_window (AgfaFocus_Scanner * s) /* ranges from 20 (little contrast) down to -20 = 235 (much contrast) */ int contr_adjust = (SANE_UNFIX (s->val[OPT_CONTRAST].w) * -20.0) / 100.0; - /* Warning ! The following structur SEEMS to be a valid SCSI-2 SET_WINDOW + /* Warning ! The following structure SEEMS to be a valid SCSI-2 SET_WINDOW command. But e.g. the limits for the window are only 2 Bytes instead of 4. The scanner was built at about 1990, so SCSI-2 wasn't available for development... */ diff --git a/backend/agfafocus.h b/backend/agfafocus.h index 036a656..e89cf87 100644 --- a/backend/agfafocus.h +++ b/backend/agfafocus.h @@ -16,8 +16,8 @@ for more details. You should have received a copy of the GNU General Public License - along with sane; see the file COPYING. If not, write to the Free - Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ + along with sane; see the file COPYING. + If not, see . */ #ifndef agfafocus_h #define agfafocus_h diff --git a/backend/apple.c b/backend/apple.c index 980edb4..328fd1e 100644 --- a/backend/apple.c +++ b/backend/apple.c @@ -16,9 +16,7 @@ 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. + along with this program. If not, see . As a special exception, the authors of SANE give permission for additional uses of the libraries contained in this release of SANE. @@ -393,7 +391,7 @@ return SANE_STATUS_GOOD; if (status == SANE_STATUS_IO_ERROR) { -/* Now we are checking for Harware and Vendor Unique Errors for all models */ +/* Now we are checking for Hardware and Vendor Unique Errors for all models */ /* First check the common Error conditions */ if (result[18] & 0x80) @@ -1010,7 +1008,7 @@ calc_parameters (Apple_Scanner * s) Looks like for two distinct val (Fixed) values we get the same double. How come ? - This hack fixed the looping situtation. Unfortunately SIGSEGV + This hack fixed the looping situation. Unfortunately SIGSEGV remains when you touch the slice bars (thouhg not all the time). But it's OK if you select scan_area from the preview window (cool). @@ -1188,7 +1186,7 @@ mode_update (SANE_Handle handle, char *val) return SANE_STATUS_INVAL; } -/* Second hand dependancies of mode option */ +/* Second hand dependencies of mode option */ /* Looks like code doubling */ @@ -1546,7 +1544,7 @@ init_options (Apple_Scanner * s) /* Use volt_ref */ s->opt[OPT_VOLT_REF].name = "volt-ref"; s->opt[OPT_VOLT_REF].title = "Volt Reference"; - s->opt[OPT_VOLT_REF].desc ="It's brightness equivalant."; + s->opt[OPT_VOLT_REF].desc ="It's brightness equivalent."; s->opt[OPT_VOLT_REF].type = SANE_TYPE_BOOL; if (s->hw->ScannerModel!=COLORONESCANNER) s->opt[OPT_VOLT_REF].cap |= SANE_CAP_INACTIVE; diff --git a/backend/apple.h b/backend/apple.h index b4a0c03..ebc7f72 100644 --- a/backend/apple.h +++ b/backend/apple.h @@ -14,9 +14,7 @@ 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. + along with this program. If not, see . As a special exception, the authors of SANE give permission for additional uses of the libraries contained in this release of SANE. diff --git a/backend/artec.c b/backend/artec.c index 395b4f1..355e78e 100644 --- a/backend/artec.c +++ b/backend/artec.c @@ -13,9 +13,7 @@ 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. + along with this program. If not, see . As a special exception, the authors of SANE give permission for additional uses of the libraries contained in this release of SANE. @@ -836,7 +834,7 @@ artec_byte_rgb_to_line_rgb (SANE_Byte * data, SANE_Int len) DBG (8, "artec_byte_rgb_to_line_rgb()\n"); - /* copy the RGBRGBRGBRGBRGB... formated data to our temp buffer */ + /* copy the RGBRGBRGBRGBRGB... formatted data to our temp buffer */ memcpy (tmp_buf, data, len * 3); /* now copy back to *data in RRRRRRRGGGGGGGBBBBBBB format */ diff --git a/backend/artec.h b/backend/artec.h index efb4bb4..4806609 100644 --- a/backend/artec.h +++ b/backend/artec.h @@ -13,9 +13,7 @@ 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. + along with this program. If not, see . As a special exception, the authors of SANE give permission for additional uses of the libraries contained in this release of SANE. diff --git a/backend/artec_eplus48u.c b/backend/artec_eplus48u.c index c5eb225..4c15673 100644 --- a/backend/artec_eplus48u.c +++ b/backend/artec_eplus48u.c @@ -42,9 +42,7 @@ Updates (C) 2001 by Henning Meier-Geinitz. 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. + along with this program. If not, see . As a special exception, the authors of SANE give permission for additional uses of the libraries contained in this release of SANE. @@ -510,7 +508,7 @@ copy_scan_line (Artec48U_Scanner * s) { /*For resolution of 1200 dpi we have to interpolate horizontally, because the optical horizontal resolution is - limited to 600 dpi. We simply use the avarage value of two pixels. */ + limited to 600 dpi. We simply use the average value of two pixels. */ int cnt, i, j; int xs = s->params.pixel_xs; int interpolate = 0; @@ -787,7 +785,7 @@ attach (const char *dev_name, Artec48U_Device ** devp) vendor_string[40] = 0; model_string[40] = 0; - /* assign all the stuff we need fo this device... */ + /* assign all the stuff we need for this device... */ dev->sane.vendor = strdup (vendor_string); XDBG ((3, "attach: setting vendor string: %s\n", vendor_string)); dev->sane.model = strdup (model_string); @@ -874,7 +872,7 @@ decodeVal (char *src, char *opt, int what, void *result, void *def) if (tmp) { - /* on success, compare wiht the given one */ + /* on success, compare with the given one */ if (0 == strcmp (tmp, opt)) { XDBG ((1, "Decoding option >%s<\n", opt)); @@ -952,7 +950,7 @@ decodeVal (char *src, char *opt, int what, void *result, void *def) } /** - * function to retrive the device name of a given string + * function to retrieve the device name of a given string * @param src - string that keeps the option name to check src for * @param dest - pointer to the string, that should receive the detected * devicename @@ -3058,7 +3056,7 @@ calculate_contrast (Artec48U_Scanner * s) Works like the white shading correction, with the difference, that the red-, green- and blue exposure time is set to 0x04 (the value is taken from the windoze driver). -Since we do this over the whole width of the image with the maximal optical resolution, - we can use the shading data for every scan, independend of the size, position or resolution, + we can use the shading data for every scan, independent of the size, position or resolution, because we have the shading values for every sensor/LED. Note: diff --git a/backend/artec_eplus48u.conf.in b/backend/artec_eplus48u.conf.in index 03c9b57..826a261 100644 --- a/backend/artec_eplus48u.conf.in +++ b/backend/artec_eplus48u.conf.in @@ -86,6 +86,7 @@ usb 0x05d8 0x4009 option artecFirmwareFile @DATADIR@/sane/artec_eplus48u/Artec48.usb option vendorString "UMAX" option modelString "AstraSlim SE" +option ePlusPro 0 # ---------------------------------------------------------------------------- diff --git a/backend/artec_eplus48u.h b/backend/artec_eplus48u.h index cc30214..4563a3c 100644 --- a/backend/artec_eplus48u.h +++ b/backend/artec_eplus48u.h @@ -226,9 +226,9 @@ typedef enum Artec48U_Scan_Action { SA_CALIBRATE_SCAN_WHITE, /**< Scan white shading buffer */ SA_CALIBRATE_SCAN_BLACK, /**< Scan black shading buffer */ - SA_CALIBRATE_SCAN_OFFSET_1, /**< First scan to determin offset */ + SA_CALIBRATE_SCAN_OFFSET_1, /**< First scan to determine offset */ SA_CALIBRATE_SCAN_OFFSET_2, /**< Second scan to determine offset */ - SA_CALIBRATE_SCAN_EXPOSURE_1, /**< First scan to determin offset */ + SA_CALIBRATE_SCAN_EXPOSURE_1, /**< First scan to determine offset */ SA_CALIBRATE_SCAN_EXPOSURE_2, /**< Second scan to determine offset */ SA_SCAN /**< Normal scan */ } @@ -399,7 +399,7 @@ static SANE_Status artec48u_device_deactivate (Artec48U_Device * dev); * * @return * - #SANE_STATUS_GOOD - success. - * - #SANE_STATUS_IO_ERROR - a communication error occured. + * - #SANE_STATUS_IO_ERROR - a communication error occurred. * * @warning * @a size must be a multiple of 64 (at least with TV9693), otherwise the @@ -418,7 +418,7 @@ artec48u_device_memory_write (Artec48U_Device * dev, SANE_Word addr, * * @return * - #SANE_STATUS_GOOD - success. - * - #SANE_STATUS_IO_ERROR - a communication error occured. + * - #SANE_STATUS_IO_ERROR - a communication error occurred. * * @warning * @a size must be a multiple of 64 (at least with TV9693), otherwise the @@ -436,7 +436,7 @@ artec48u_device_memory_read (Artec48U_Device * dev, SANE_Word addr, * * @return * - #SANE_STATUS_GOOD - success. - * - #SANE_STATUS_IO_ERROR - a communication error occured. + * - #SANE_STATUS_IO_ERROR - a communication error occurred. */ static SANE_Status artec48u_device_req (Artec48U_Device * dev, Artec48U_Packet cmd, @@ -450,7 +450,7 @@ artec48u_device_req (Artec48U_Device * dev, Artec48U_Packet cmd, * * @return * - #SANE_STATUS_GOOD - success. - * - #SANE_STATUS_IO_ERROR - a communication error occured. + * - #SANE_STATUS_IO_ERROR - a communication error occurred. */ static SANE_Status artec48u_device_small_req (Artec48U_Device * dev, Artec48U_Packet cmd, @@ -466,7 +466,7 @@ artec48u_device_small_req (Artec48U_Device * dev, Artec48U_Packet cmd, * * @return * - #SANE_STATUS_GOOD - success. - * - #SANE_STATUS_IO_ERROR - a communication error occured. + * - #SANE_STATUS_IO_ERROR - a communication error occurred. */ static SANE_Status artec48u_device_read_raw (Artec48U_Device * dev, SANE_Byte * buffer, @@ -527,7 +527,7 @@ static SANE_Status artec48u_line_reader_free (Artec48U_Line_Reader * reader); * * @return * - SANE_STATUS_GOOD - read completed successfully - * - other error value - an error occured + * - other error value - an error occurred */ static SANE_Status artec48u_line_reader_read (Artec48U_Line_Reader * reader, diff --git a/backend/as6e.c b/backend/as6e.c index 47d8c90..f7c0e81 100644 --- a/backend/as6e.c +++ b/backend/as6e.c @@ -14,9 +14,7 @@ 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. + along with this program. If not, see . As a special exception, the authors of SANE give permission for additional uses of the libraries contained in this release of SANE. diff --git a/backend/as6e.h b/backend/as6e.h index 7132d6b..8c24bb8 100644 --- a/backend/as6e.h +++ b/backend/as6e.h @@ -14,9 +14,7 @@ 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. + along with this program. If not, see . As a special exception, the authors of SANE give permission for additional uses of the libraries contained in this release of SANE. diff --git a/backend/avision.c b/backend/avision.c index 862a275..e047a7f 100644 --- a/backend/avision.c +++ b/backend/avision.c @@ -16,9 +16,7 @@ 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. + along with this program. If not, see . As a special exception, the authors of SANE give permission for additional uses of the libraries contained in this release of SANE. @@ -58,7 +56,7 @@ Copyright 2010, 2011 by "Mike Kelly" - Additional Contributers: + Additional Contributors: "Gunter Wagner" (some fixes and the transparency option) "Martin JelĂ­nek" @@ -302,6 +300,24 @@ static Avision_HWEntry Avision_Device_List [] = /* comment="duplex! sheetfed scanner" */ /* status="complete" */ + { NULL, NULL, + 0x0638, 0x1A33, + "Avision", "AV186+", + AV_INT_BUTTON | AV_CANCEL_BUTTON | AV_USE_GRAY_FILTER, + { 0, {0, 0}, {{0, 0}, {0, 0}} } + }, + /* comment="duplex! sheetfed scanner" */ + /* status="good" */ + + { NULL, NULL, + 0x0638, 0x2AD9, + "Avision", "AV188", + AV_INT_BUTTON | AV_CANCEL_BUTTON | AV_USE_GRAY_FILTER, + { 0, {0, 0}, {{0, 0}, {0, 0}} } + }, + /* comment="duplex! sheetfed scanner" */ + /* status="untested" */ + { NULL, NULL, 0x0638, 0x0A2C, "Avision", "AV220+", @@ -3619,7 +3635,7 @@ adf_reset (Avision_Scanner* s) set_triple (rcmd.transferlen, size); status = avision_cmd (&s->av_con, &rcmd, sizeof (rcmd), 0, 0, payload, &size); if (status != SANE_STATUS_GOOD || size != (4-n)) { - DBG (1, "adf_reset: read %lu failed (%s)\n", (2-n), + DBG (1, "adf_reset: read %zu failed (%s)\n", (4-n), sane_strstatus (status)); return (status); } @@ -4152,7 +4168,7 @@ attach (SANE_String_Const devname, Avision_ConnectionType con_type, av_con.usb_status = AVISION_USB_UNTESTED_STATUS; /* set known USB status type */ - if (attaching_hw && attaching_hw->feature_type & AV_INT_STATUS) + 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); @@ -4880,7 +4896,7 @@ send_tune_scan_length (Avision_Scanner* s) 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 + /* we always 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), @@ -6266,7 +6282,7 @@ set_window (Avision_Scanner* s) cmd.window.avision.highlight = 0xFF; cmd.window.avision.shadow = 0x00; - /* mode dependant settings */ + /* mode dependent settings */ switch (s->c_mode) { case AV_THRESHOLDED: @@ -6461,7 +6477,7 @@ get_background_raster (Avision_Scanner* s) } /* end line pack */ /* deinterlace? */ - if (s->avdimen.interlaced_duplex && dev->hw->feature_type & AV_2ND_LINE_INTERLACED) + if (s->avdimen.interlaced_duplex && (dev->hw->feature_type & AV_2ND_LINE_INTERLACED)) { uint8_t* deinterlaced = malloc (size * 2); if (!deinterlaced) @@ -6474,7 +6490,7 @@ get_background_raster (Avision_Scanner* s) 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) + 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; @@ -7626,7 +7642,7 @@ reader_process (void *data) /* interlaced? save the back data to the rear buffer */ if ( (deinterlace == STRIPE && absline % (lines_per_stripe*2) >= lines_per_stripe) || (deinterlace == HALF && absline >= total_size / s->avdimen.hw_bytes_per_line / 2) || - (deinterlace == LINE && absline & 0x1) ) /* last bit equals % 2 */ + (deinterlace == LINE && (absline & 0x1)) ) /* last bit equals % 2 */ { DBG (9, "reader_process: saving rear line %d to temporary file.\n", absline); fwrite (ptr, s->avdimen.hw_bytes_per_line, 1, rear_fp); @@ -7644,7 +7660,7 @@ reader_process (void *data) DBG (9, "reader_process: after deinterlacing: useful_bytes: %d, stripe_fill: %d\n", useful_bytes, stripe_fill); } - if (dev->hw->feature_type & AV_ADF_FLIPPING_DUPLEX && s->source_mode == AV_ADF_DUPLEX && !(s->page % 2) && !s->duplex_rear_valid) { + if ((dev->hw->feature_type & AV_ADF_FLIPPING_DUPLEX) && s->source_mode == AV_ADF_DUPLEX && !(s->page % 2) && !s->duplex_rear_valid) { /* Here we flip the image by writing the lines from the end of the file to the beginning. */ unsigned int absline = (processed_bytes - stripe_fill) / s->avdimen.hw_bytes_per_line; unsigned int abslines = absline + useful_bytes / s->avdimen.hw_bytes_per_line; @@ -7838,6 +7854,7 @@ reader_process (void *data) s->avdimen.hw_yres == s->avdimen.yres) /* No scaling */ { fwrite (out_data, useful_bytes, 1, fp); + line += useful_bytes / s->avdimen.hw_bytes_per_line; } else /* Software scaling - watch out - this code bites back! */ { diff --git a/backend/avision.h b/backend/avision.h index 9017bf2..0847dc8 100644 --- a/backend/avision.h +++ b/backend/avision.h @@ -16,9 +16,7 @@ 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. + along with this program. If not, see . As a special exception, the authors of SANE give permission for additional uses of the libraries contained in this release of SANE. @@ -120,7 +118,7 @@ typedef struct Avision_HWEntry { /* 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) */ + /* does not support, or very broken background (added for AV610C2) */ #define AV_NO_BACKGROUND ((uint64_t)1<<7) /* is film scanner - no detection yet */ @@ -171,7 +169,7 @@ typedef struct Avision_HWEntry { /* 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, ...) */ + /* no separate, single REAR scan (AV122, DM152, ...) */ #define AV_NO_REAR ((uint64_t)1<<24) /* only scan with some known good hardware resolutions, as the @@ -180,11 +178,11 @@ typedef struct Avision_HWEntry { 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 + /* does keep window though it does not advertise 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 */ + /* does keep gamma though it does not advertise it */ #define AV_DOES_KEEP_GAMMA ((uint64_t)1<<27) /* does the scanner contain a Cancel button? */ @@ -463,12 +461,12 @@ typedef struct Avision_Device int scsi_buffer_size; /* nice to have SCSI buffer size */ int read_stripe_size; /* stripes to be read at-a-time */ - /* film scanner atributes - maybe these should be in the scanner struct? */ + /* film scanner attributes - maybe these should be in the scanner struct? */ SANE_Range frame_range; SANE_Word current_frame; SANE_Word holder_type; - /* some versin corrections */ + /* some version corrections */ uint16_t data_dq; /* was ox0A0D - but hangs some new scanners */ Avision_HWEntry* hw; @@ -773,7 +771,7 @@ typedef struct calibration_format uint16_t g_dark_shading_target; uint16_t b_dark_shading_target; - /* not returned but usefull in some places */ + /* not returned but useful in some places */ uint8_t channels; } calibration_format; diff --git a/backend/bh.c b/backend/bh.c index 60741cc..dd5f6a0 100644 --- a/backend/bh.c +++ b/backend/bh.c @@ -16,9 +16,7 @@ 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. + along with this program. If not, see . As a special exception, the authors of SANE give permission for additional uses of the libraries contained in this release of SANE. diff --git a/backend/bh.h b/backend/bh.h index fcd833a..c96dc79 100644 --- a/backend/bh.h +++ b/backend/bh.h @@ -16,9 +16,7 @@ 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. + along with this program. If not, see . As a special exception, the authors of SANE give permission for additional uses of the libraries contained in this release of SANE. diff --git a/backend/canon-sane.c b/backend/canon-sane.c index cd75719..016ca8a 100644 --- a/backend/canon-sane.c +++ b/backend/canon-sane.c @@ -181,7 +181,7 @@ sane_open (SANE_String_Const devnam, SANE_Handle * handle) s->gamma_table[i][0] = 0; } for (j = 1; j < 4096; ++j) - { /* FS2710 needs inital gamma 2.0 */ + { /* FS2710 needs initial gamma 2.0 */ c = (int) (256.0 * pow (((double) j) / 4096.0, 0.5)); for (i = 0; i < 4; i++) { @@ -520,7 +520,7 @@ sane_control_option (SANE_Handle handle, SANE_Int option, } return SANE_STATUS_GOOD; - /* 990320, ss: switch between slider and option menue for resolution */ + /* 990320, ss: switch between slider and option menu for resolution */ case OPT_HW_RESOLUTION_ONLY: if (s->val[option].w != *(SANE_Word *) val) { diff --git a/backend/canon-scsi.c b/backend/canon-scsi.c index 0bddf51..2dbaae5 100644 --- a/backend/canon-scsi.c +++ b/backend/canon-scsi.c @@ -17,9 +17,7 @@ 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. + along with this program. If not, see . As a special exception, the authors of SANE give permission for additional uses of the libraries contained in this release of SANE. diff --git a/backend/canon.c b/backend/canon.c index 4a5a2a2..e2ef932 100644 --- a/backend/canon.c +++ b/backend/canon.c @@ -21,9 +21,7 @@ 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. + along with this program. If not, see . As a special exception, the authors of SANE give permission for additional uses of the libraries contained in this release of SANE. @@ -55,10 +53,10 @@ . - sane_open() : open a particular scanner-device and attach_scanner(devicename,&dev) . . - sane_set_io_mode : set blocking-mode . . - sane_get_select_fd : get scanner-fd - . . - sane_get_option_descriptor() : get option informations + . . - sane_get_option_descriptor() : get option information . . - sane_control_option() : change option values . . - . . - sane_start() : start image aquisition + . . - sane_start() : start image acquisition . . - sane_get_parameters() : returns actual scan-parameters . . - sane_read() : read image-data (from pipe) . . - sane_cancel() : cancel operation, kill reader_process @@ -82,9 +80,9 @@ . - init_options - sane_set_io_mode : set blocking-mode - sane_get_select_fd : get scanner-fd - - sane_get_option_descriptor() : get option informations + - sane_get_option_descriptor() : get option information - sane_control_option() : change option values - - sane_start() : start image aquisition + - sane_start() : start image acquisition - sane_get_parameters() : returns actual scan-parameters - sane_read() : read image-data (from pipe) - sane_cancel() : cancel operation, kill reader_process diff --git a/backend/canon.h b/backend/canon.h index c4dc9a8..58e93fe 100644 --- a/backend/canon.h +++ b/backend/canon.h @@ -18,9 +18,7 @@ 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. + along with this program. If not, see . As a special exception, the authors of SANE give permission for additional uses of the libraries contained in this release of SANE. diff --git a/backend/canon630u-common.c b/backend/canon630u-common.c index 5cd0fcf..e6fcf33 100644 --- a/backend/canon630u-common.c +++ b/backend/canon630u-common.c @@ -12,9 +12,7 @@ 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. + along with this program. If not, see . As a special exception, the authors of SANE give permission for additional uses of the libraries contained in this release of SANE. @@ -719,7 +717,7 @@ wait_for_return (int fd) static SANE_Status compute_ogn (char *calfilename); -/* This is the calibration rountine Win2k goes through when the scanner is +/* This is the calibration routine Win2k goes through when the scanner is first plugged in. Original usb trace from Win2k with USBSnoopy ("usb sniffer for w2k" http://benoit.papillault.free.fr/speedtouch/sniff-2000.en.php3) diff --git a/backend/canon630u.c b/backend/canon630u.c index c413253..6a76211 100644 --- a/backend/canon630u.c +++ b/backend/canon630u.c @@ -18,9 +18,7 @@ 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. + along with this program. If not, see . As a special exception, the authors of SANE give permission for additional uses of the libraries contained in this release of SANE. diff --git a/backend/canon_dr-cmd.h b/backend/canon_dr-cmd.h index 51f2a06..44751fa 100644 --- a/backend/canon_dr-cmd.h +++ b/backend/canon_dr-cmd.h @@ -70,6 +70,11 @@ putnbyte (unsigned char *pnt, unsigned int value, unsigned int nbytes) /* extended status packet */ #define get_ES_length(b) getnbyte(b+0x04, 4) +/* ==================================================================== */ +/* USB packets */ +#define set_USB_CMD_xfer_length(sb, val) putnbyte(sb + 1, val, 3) +#define set_USB_OUT_xfer_length(sb, val) putnbyte(sb + 1, val, 3) + /* ==================================================================== */ /* SCSI commands */ @@ -287,6 +292,17 @@ putnbyte (unsigned char *pnt, unsigned int value, unsigned int nbytes) /*counters*/ /*endorser*/ +/*fine calibration*/ +#define set_S_FCAL_datatype(sb, val) sb[0x00] = (unsigned char)val +/* these are offset, OR with 0x40 to get gain */ +#define S_FCAL_id_f_red 0x00 +#define S_FCAL_id_f_green 0x04 +#define S_FCAL_id_f_blue 0x08 +#define S_FCAL_id_b_red 0x01 +#define S_FCAL_id_b_green 0x05 +#define S_FCAL_id_b_blue 0x09 + + /* ==================================================================== */ /* OBJECT_POSITION */ #define OBJECT_POSITION_code 0x31 diff --git a/backend/canon_dr.c b/backend/canon_dr.c index 17ee7b6..de7ed7e 100644 --- a/backend/canon_dr.c +++ b/backend/canon_dr.c @@ -3,7 +3,7 @@ This file is part of the SANE package, and implements a SANE backend for various Canon DR-series scanners. - Copyright (C) 2008-2019 m. allan noah + Copyright (C) 2008-2020 m. allan noah Yabarana Corp. www.yabarana.com provided significant funding EvriChart, Inc. www.evrichart.com provided funding and loaned equipment @@ -25,9 +25,7 @@ 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. + along with this program. If not, see . As a special exception, the authors of SANE give permission for additional uses of the libraries contained in this release of SANE. @@ -126,9 +124,9 @@ - send_panel() can disable too - add cancel() to send d8 command - call cancel() only after final read from scanner - - stop button reqests cancel + - stop button requests cancel v12 2009-01-21, MAN - - dont export private symbols + - don't export private symbols v13 2009-03-06, MAN - new vendor ID for recent machines - add usb ids for several new machines @@ -149,7 +147,7 @@ v18 2009-03-21, MAN - rewrite config file parsing to reset options after each scanner - add config options for vendor, model, version - - dont call inquiry if those 3 options are set + - don't call inquiry if those 3 options are set - remove default config file from code - add initial gray deinterlacing code for DR-2510C - rename do_usb_reset to do_usb_clear @@ -175,8 +173,8 @@ v24 2009-04-02, MAN - fix DR-2510C duplex deinterlacing code - rewrite sane_read helpers to read until EOF - - update sane_start for scanners that dont use object_position - - dont call sanei_usb_clear_halt() if device is not open + - update sane_start for scanners that don't use object_position + - don't call sanei_usb_clear_halt() if device is not open - increase default buffer size to 4 megs - set buffermode on by default - hide modes and resolutions that DR-2510C lies about @@ -206,8 +204,8 @@ - merge x and y resolution options into single option - move scan params into two new structs, s->u and s->s - sane_get_parameters() just returns values from s->u - - dont call wait_scanner() in object_position() - - dont call ssm_*() from option handler + - don't call wait_scanner() in object_position() + - don't call ssm_*() from option handler - refactor sane_start() - read_from_buffer() can workaround missing res, modes and cropping - set most DR-2xxx machines to use the read_from_buffer workarounds @@ -318,7 +316,7 @@ v51 2015-08-25, MAN (SANE 1.0.25) - DR-C125 does not invert_tly, does need sw_lut v52 2015-11-03, MAN - - set can_color=1 by default (recent models dont have 'C' in name) + - set can_color=1 by default (recent models don't have 'C' in name) - enable jpeg for DR-6080 - add must_downsample and must_fully_buffer - improve dropout option handling @@ -340,6 +338,14 @@ - complete support for X-10, including hardware cropping v58 2019-11-10, MAN - adjust wait_scanner to set runRS only as a last resort, bug #154 + v59 2020-09-23, MAN + - restructure fine calibration code + - initial support for uploading fine calibration payloads + - improve DR-C225 support + v60 2020-11-28, MAN + - add new gray and color interlacing options for DR-C120 + - initial support for DR-C120 and C130 + - enable fine calibration for P-208 (per @sashacmc in !546) SANE FLOW DIAGRAM @@ -390,7 +396,7 @@ #include "canon_dr.h" #define DEBUG 1 -#define BUILD 58 +#define BUILD 60 /* values for SANE_DEBUG_CANON_DR env var: - errors 5 @@ -1348,7 +1354,8 @@ init_model (struct scanner *s) s->gray_interlace[SIDE_BACK] = GRAY_INTERLACE_gG; s->duplex_interlace = DUPLEX_INTERLACE_FBfb; s->need_ccal = 1; - s->need_fcal = 1; + s->fcal_src = FCAL_SRC_SCAN; + s->fcal_dest = FCAL_DEST_SW; /*s->duplex_offset = 432; now set in config file*/ s->duplex_offset_side = SIDE_BACK; @@ -1372,7 +1379,8 @@ init_model (struct scanner *s) s->duplex_interlace = DUPLEX_INTERLACE_2510; /*s->duplex_offset = 400; now set in config file*/ s->need_ccal = 1; - s->need_fcal = 1; + s->fcal_src = FCAL_SRC_SCAN; + s->fcal_dest = FCAL_DEST_SW; s->sw_lut = 1; /*s->invert_tly = 1;*/ @@ -1402,7 +1410,8 @@ init_model (struct scanner *s) s->duplex_interlace = DUPLEX_INTERLACE_2510; /*s->duplex_offset = 400; now set in config file*/ s->need_ccal = 1; - s->need_fcal = 1; + s->fcal_src = FCAL_SRC_SCAN; + s->fcal_dest = FCAL_DEST_SW; s->sw_lut = 1; s->invert_tly = 1; @@ -1427,7 +1436,8 @@ init_model (struct scanner *s) s->color_interlace[SIDE_FRONT] = COLOR_INTERLACE_RRGGBB; s->color_interlace[SIDE_BACK] = COLOR_INTERLACE_RRGGBB; s->duplex_interlace = DUPLEX_INTERLACE_FBfb; - s->need_fcal_buffer = 1; + s->fcal_src = FCAL_SRC_HW; + s->fcal_dest = FCAL_DEST_SW; s->bg_color = 0x08; /*s->duplex_offset = 840; now set in config file*/ s->sw_lut = 1; @@ -1487,6 +1497,8 @@ init_model (struct scanner *s) s->gray_interlace[SIDE_BACK] = GRAY_INTERLACE_gG; s->duplex_interlace = DUPLEX_INTERLACE_FBfb; s->need_ccal = 1; + s->fcal_src = FCAL_SRC_SCAN; + s->fcal_dest = FCAL_DEST_SW; s->invert_tly = 1; s->unknown_byte2 = 0x88; s->rgb_format = 1; @@ -1592,6 +1604,39 @@ init_model (struct scanner *s) s->can_monochrome=0; } + else if (strstr (s->model_name,"DR-C120") + || strstr (s->model_name,"DR-C130") + ){ + + /*confirmed settings*/ + s->need_ccal = 1; + s->ccal_version = 3; + + s->gray_interlace[SIDE_FRONT] = GRAY_INTERLACE_C120; + s->gray_interlace[SIDE_BACK] = GRAY_INTERLACE_C120; + s->color_interlace[SIDE_FRONT] = COLOR_INTERLACE_C120; + s->color_interlace[SIDE_BACK] = COLOR_INTERLACE_C120; + s->duplex_interlace = DUPLEX_INTERLACE_2510; + s->duplex_offset_side = SIDE_BACK; + s->unknown_byte2 = 0x88; + s->fcal_src = FCAL_SRC_SCAN; + s->fcal_dest = FCAL_DEST_SW; + s->sw_lut = 1; + s->rgb_format = 1; + /*s->duplex_offset = 400; now set in config file*/ + + /*only in Y direction, so we trash them in X*/ + s->std_res_x[DPI_100]=0; + s->std_res_x[DPI_150]=0; + s->std_res_x[DPI_200]=0; + s->std_res_x[DPI_240]=0; + s->std_res_x[DPI_400]=0; + + /*suspected settings*/ + s->always_op = 0; + s->fixed_width = 1; + s->valid_x = 8.5 * 1200; + } else if (strstr (s->model_name,"DR-C125")){ /*confirmed settings*/ @@ -1604,7 +1649,8 @@ init_model (struct scanner *s) s->unknown_byte2 = 0x88; s->need_ccal = 1; s->ccal_version = 3; - s->need_fcal = 1; + s->fcal_src = FCAL_SRC_SCAN; + s->fcal_dest = FCAL_DEST_SW; s->sw_lut = 1; s->rgb_format = 1; /*s->duplex_offset = 400; now set in config file*/ @@ -1625,14 +1671,15 @@ init_model (struct scanner *s) else if (strstr (s->model_name,"DR-C225")){ s->color_interlace[SIDE_FRONT] = COLOR_INTERLACE_RRGGBB; - s->color_interlace[SIDE_BACK] = COLOR_INTERLACE_rRgGbB; + s->color_interlace[SIDE_BACK] = COLOR_INTERLACE_RRGGBB; s->gray_interlace[SIDE_BACK] = GRAY_INTERLACE_gG; - s->duplex_interlace = DUPLEX_INTERLACE_FBfb; + s->duplex_interlace = DUPLEX_INTERLACE_PER_CHANNEL; s->unknown_byte2 = 0x88; s->need_ccal = 1; s->ccal_version = 3; - s->need_fcal = 1; + s->fcal_src = FCAL_SRC_SCAN; + s->fcal_dest = FCAL_DEST_HW; s->invert_tly = 1; s->rgb_format = 1; /*s->duplex_offset = 400; now set in config file*/ @@ -3019,7 +3066,7 @@ sane_control_option (SANE_Handle handle, SANE_Int option, DBG (20, "sane_control_option: set value for '%s' (%d)\n", s->opt[option].name,option); if ( s->started ) { - DBG (5, "sane_control_option: cant set, device busy\n"); + DBG (5, "sane_control_option: can't set, device busy\n"); return SANE_STATUS_DEVICE_BUSY; } @@ -3034,7 +3081,7 @@ sane_control_option (SANE_Handle handle, SANE_Int option, return status; } - /* may have been changed by constrain, so dont copy until now */ + /* may have been changed by constrain, so don't copy until now */ val_c = *(SANE_Word *)val; /* @@ -4259,7 +4306,7 @@ update_i_params(struct scanner *s) * * this will be called between sides of a duplex scan, * and at the start of each page of an adf batch. - * hence, we spend alot of time playing with s->started, etc. + * hence, we spend a lot of time playing with s->started, etc. */ SANE_Status sane_start (SANE_Handle handle) @@ -4314,22 +4361,19 @@ sane_start (SANE_Handle handle) } /* AFE cal */ - if((ret = calibrate_AFE(s))){ + ret = calibrate_AFE(s); + if (ret != SANE_STATUS_GOOD) { DBG (5, "sane_start: ERROR: cannot cal afe\n"); goto errors; } /* fine cal */ - if((ret = calibrate_fine(s))){ + ret = calibrate_fine(s); + if (ret != SANE_STATUS_GOOD) { DBG (5, "sane_start: ERROR: cannot cal fine\n"); goto errors; } - if((ret = calibrate_fine_buffer(s))){ - DBG (5, "sane_start: ERROR: cannot cal fine from buffer\n"); - goto errors; - } - /* reset the page counter after calibration */ s->panel_counter = 0; s->prev_page = 0; @@ -4458,10 +4502,10 @@ sane_start (SANE_Handle handle) } /* set clean defaults with new sheet of paper */ - /* dont reset the transfer vars on backside of duplex page */ + /* don't reset the transfer vars on backside of duplex page */ /* otherwise buffered back page will be lost */ /* ingest paper with adf (no-op for fb) */ - /* dont call object pos or scan on back side of duplex scan */ + /* don't call object pos or scan on back side of duplex scan */ if(s->side == SIDE_FRONT || s->s.source == SOURCE_ADF_BACK || s->s.source == SOURCE_CARD_BACK){ /* clean scan params for new scan */ @@ -5367,6 +5411,23 @@ copy_simplex(struct scanner *s, unsigned char * buf, int len, int side) line[line_next++] = 0; } break; + + case GRAY_INTERLACE_C120: + DBG (17, "copy_simplex: gray, C120\n"); + + /* first read head (third byte of every three) */ + for(j=bwidth-1;j>=0;j-=3){ + line[line_next++] = buf[i+j]; + } + /* second read head (first byte of every three) */ + for(j=bwidth-3;j>=0;j-=3){ + line[line_next++] = buf[i+j]; + } + /* third read head (second byte of every three) */ + for(j=bwidth-2;j>=0;j-=3){ + line[line_next++] = buf[i+j]; + } + break; } } @@ -5451,6 +5512,29 @@ copy_simplex(struct scanner *s, unsigned char * buf, int len, int side) line[line_next++] = 0; } break; + + case COLOR_INTERLACE_C120: + DBG (17, "copy_simplex: color, C120\n"); + + /* first read head (third byte of every three) */ + for(j=t-1;j>=0;j-=3){ + line[line_next++] = buf[i+j]; + line[line_next++] = buf[i+t+j]; + line[line_next++] = buf[i+2*t+j]; + } + /* second read head (first byte of every three) */ + for(j=t-3;j>=0;j-=3){ + line[line_next++] = buf[i+j]; + line[line_next++] = buf[i+t+j]; + line[line_next++] = buf[i+2*t+j]; + } + /* third read head (second byte of every three) */ + for(j=t-2;j>=0;j-=3){ + line[line_next++] = buf[i+j]; + line[line_next++] = buf[i+t+j]; + line[line_next++] = buf[i+2*t+j]; + } + break; } } @@ -5517,6 +5601,7 @@ copy_duplex(struct scanner *s, unsigned char * buf, int len) { SANE_Status ret=SANE_STATUS_GOOD; int i,j; + int pwidth = s->s.width; int bwidth = s->s.Bpl; int dbwidth = 2*bwidth; unsigned char * front; @@ -5568,6 +5653,21 @@ copy_duplex(struct scanner *s, unsigned char * buf, int len) } } + /* line is in 6 sections, front red, back red, front green, etc. */ + else if(s->duplex_interlace == DUPLEX_INTERLACE_PER_CHANNEL){ + + DBG (10, "copy_duplex: per channel\n"); + + for(i=0; iduplex_interlace == DUPLEX_INTERLACE_FfBb || s->duplex_interlace == DUPLEX_INTERLACE_fFBb){ for(i=0; ifcal_src == FCAL_SRC_NONE || s->fcal_dest == FCAL_DEST_NONE){ + DBG (10, "calibrate_fine: not required\n"); + goto cleanup; + } + + /* don't recalibrate if we've already done it with these params */ + if(s->f_res == s->s.dpi_x && s->f_mode == s->s.mode){ + DBG (10, "calibrate_fine: already done\n"); + goto cleanup; + } + + /* get calibration data from scanner memory */ + if(s->fcal_src == FCAL_SRC_HW){ + ret = calibrate_fine_src_hw(s); + if (ret != SANE_STATUS_GOOD) + goto cleanup; + } + + /* get calibration data by making scans */ + if(s->fcal_src == FCAL_SRC_SCAN){ + ret = calibrate_fine_src_scan(s); + if (ret != SANE_STATUS_GOOD) + goto cleanup; + } + + /* send calibration data to scanner */ + if(s->fcal_dest == FCAL_DEST_HW){ + ret = calibrate_fine_dest_hw(s); + if (ret != SANE_STATUS_GOOD) + goto cleanup; + } + + /* log current cal settings so we won't recalibrate on next scan with same params */ + s->f_res = s->s.dpi_x; + s->f_mode = s->s.mode; + + cleanup: + + DBG (10, "calibrate_fine: finish %d\n",ret); + + return ret; +} + -/* alternative version- extracts data from scanner memory */ +/* extracts fine calibration data from scanner memory */ static SANE_Status -calibrate_fine_buffer (struct scanner *s) +calibrate_fine_src_hw (struct scanner *s) { SANE_Status ret = SANE_STATUS_GOOD; int i, j, k; @@ -6138,12 +6296,7 @@ calibrate_fine_buffer (struct scanner *s) int old_br_y = s->u.br_y; int old_source = s->u.source; - DBG (10, "calibrate_fine_buffer: start\n"); - - if(!s->need_fcal_buffer){ - DBG (10, "calibrate_fine_buffer: not required\n"); - return ret; - } + DBG (10, "calibrate_fine_src_hw: start\n"); /* pretend we are doing a 1 line scan in duplex */ s->u.tl_y = 0; @@ -6153,19 +6306,14 @@ calibrate_fine_buffer (struct scanner *s) /* load our own private copy of scan params */ ret = update_params(s,1); if (ret != SANE_STATUS_GOOD) { - DBG (5, "calibrate_fine_buffer: ERROR: cannot update_params\n"); - goto cleanup; - } - - if(s->f_res == s->s.dpi_x && s->f_mode == s->s.mode){ - DBG (10, "calibrate_fine_buffer: already done\n"); + DBG (5, "calibrate_fine_src_hw: ERROR: cannot update_params\n"); goto cleanup; } /* clean scan params for new scan */ ret = clean_params(s); if (ret != SANE_STATUS_GOOD) { - DBG (5, "calibrate_fine_buffer: ERROR: cannot clean_params\n"); + DBG (5, "calibrate_fine_src_hw: ERROR: cannot clean_params\n"); goto cleanup; } @@ -6174,7 +6322,7 @@ calibrate_fine_buffer (struct scanner *s) in = malloc(reqLen); if (!in) { - DBG (5, "calibrate_fine_buffer: ERROR: cannot malloc in\n"); + DBG (5, "calibrate_fine_src_hw: ERROR: cannot malloc in\n"); ret = SANE_STATUS_NO_MEM; goto cleanup; } @@ -6182,11 +6330,11 @@ calibrate_fine_buffer (struct scanner *s) /*fine offset*/ ret = offset_buffers(s,1); if (ret != SANE_STATUS_GOOD) { - DBG (5, "calibrate_fine_buffer: ERROR: cannot load offset buffers\n"); + DBG (5, "calibrate_fine_src_hw: 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); + DBG (10, "calibrate_fine_src_hw: %d %x\n", s->s.dpi_x/10, s->s.dpi_x/10); memset(cmd,0,cmdLen); set_SCSI_opcode(cmd, READ_code); @@ -6196,8 +6344,6 @@ calibrate_fine_buffer (struct scanner *s) inLen = reqLen; - hexdump(15, "cmd:", cmd, cmdLen); - ret = do_cmd ( s, 1, 0, cmd, cmdLen, @@ -6232,14 +6378,12 @@ calibrate_fine_buffer (struct scanner *s) s->f_offset[i][j] = 1; } } - - hexdump(15, "off:", s->f_offset[i], s->s.valid_Bpl); } /*fine gain*/ ret = gain_buffers(s,1); if (ret != SANE_STATUS_GOOD) { - DBG (5, "calibrate_fine_buffer: ERROR: cannot load gain buffers\n"); + DBG (5, "calibrate_fine_src_hw: ERROR: cannot load gain buffers\n"); goto cleanup; } @@ -6259,8 +6403,6 @@ calibrate_fine_buffer (struct scanner *s) set_R_xfer_uid (cmd, codes[k]); inLen = reqLen; - hexdump(15, "cmd:", cmd, cmdLen); - ret = do_cmd ( s, 1, 0, cmd, cmdLen, @@ -6288,8 +6430,6 @@ 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 ( s, 1, 0, cmd, cmdLen, @@ -6310,14 +6450,6 @@ calibrate_fine_buffer (struct scanner *s) } } - for(i=0;i<2;i++){ - hexdump(15, "gain:", s->f_gain[i], s->s.valid_Bpl); - } - - /* log current cal type */ - s->f_res = s->s.dpi_x; - s->f_mode = s->s.mode; - cleanup: if(in){ @@ -6329,16 +6461,16 @@ calibrate_fine_buffer (struct scanner *s) s->u.br_y = old_br_y; s->u.source = old_source; - DBG (10, "calibrate_fine_buffer: finish %d\n",ret); + DBG (10, "calibrate_fine_src_hw: finish %d\n",ret); return ret; } /* - * makes several scans, adjusts fine calibration + * makes several scans, generates fine calibration data */ static SANE_Status -calibrate_fine (struct scanner *s) +calibrate_fine_src_scan (struct scanner *s) { SANE_Status ret = SANE_STATUS_GOOD; int i, j, k; @@ -6350,12 +6482,7 @@ calibrate_fine (struct scanner *s) int old_br_y = s->u.br_y; int old_source = s->u.source; - DBG (10, "calibrate_fine: start\n"); - - if(!s->need_fcal){ - DBG (10, "calibrate_fine: not required\n"); - return ret; - } + DBG (10, "calibrate_fine_src_scan: start\n"); /* always cal with a short scan in duplex */ s->u.tl_y = 0; @@ -6365,12 +6492,7 @@ calibrate_fine (struct scanner *s) /* load our own private copy of scan params */ ret = update_params(s,1); if (ret != SANE_STATUS_GOOD) { - DBG (5, "calibrate_fine: ERROR: cannot update_params\n"); - goto cleanup; - } - - if(s->f_res == s->s.dpi_x && s->f_mode == s->s.mode){ - DBG (10, "calibrate_fine: already done\n"); + DBG (5, "calibrate_fine_src_scan: ERROR: cannot update_params\n"); goto cleanup; } @@ -6384,39 +6506,39 @@ calibrate_fine (struct scanner *s) /* make buffers to hold the images */ ret = image_buffers(s,1); if (ret != SANE_STATUS_GOOD) { - DBG (5, "calibrate_fine: ERROR: cannot load buffers\n"); + DBG (5, "calibrate_fine_src_scan: ERROR: cannot load buffers\n"); goto cleanup; } - /*blast the existing fine cal data so reading code wont apply it*/ + /*blast the existing fine cal data so reading code won't apply it*/ ret = offset_buffers(s,0); ret = gain_buffers(s,0); /* need to tell it we want duplex */ ret = ssm_buffer(s); if (ret != SANE_STATUS_GOOD) { - DBG (5, "calibrate_fine: ERROR: cannot ssm buffer\n"); + DBG (5, "calibrate_fine_src_scan: 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"); + DBG (5, "calibrate_fine_src_scan: ERROR: cannot set window\n"); goto cleanup; } - /*handle fifth pass (fine offset), lamp off*/ - DBG (15, "calibrate_fine: offset\n"); + /* first pass (fine offset), lamp off */ + DBG (15, "calibrate_fine_src_scan: offset\n"); ret = calibration_scan(s,0xff); if (ret != SANE_STATUS_GOOD) { - DBG (5, "calibrate_fine: ERROR: cannot make offset cal scan\n"); + DBG (5, "calibrate_fine_src_scan: ERROR: cannot make offset cal scan\n"); goto cleanup; } ret = offset_buffers(s,1); if (ret != SANE_STATUS_GOOD) { - DBG (5, "calibrate_fine: ERROR: cannot load offset buffers\n"); + DBG (5, "calibrate_fine_src_scan: ERROR: cannot load offset buffers\n"); goto cleanup; } @@ -6431,17 +6553,17 @@ calibrate_fine (struct scanner *s) hexdump(15, "off:", s->f_offset[i], s->s.valid_Bpl); } - /*handle sixth pass (fine gain), lamp on*/ - DBG (15, "calibrate_fine: gain\n"); + /* second pass (fine gain), lamp on */ + DBG (15, "calibrate_fine_src_scan: gain\n"); ret = calibration_scan(s,0xfe); if (ret != SANE_STATUS_GOOD) { - DBG (5, "calibrate_fine: ERROR: cannot make gain cal scan\n"); + DBG (5, "calibrate_fine_src_scan: ERROR: cannot make gain cal scan\n"); goto cleanup; } ret = gain_buffers(s,1); if (ret != SANE_STATUS_GOOD) { - DBG (5, "calibrate_fine: ERROR: cannot load gain buffers\n"); + DBG (5, "calibrate_fine_src_scan: ERROR: cannot load gain buffers\n"); goto cleanup; } @@ -6459,10 +6581,6 @@ calibrate_fine (struct scanner *s) hexdump(15, "gain:", s->f_gain[i], s->s.valid_Bpl); } - /* log current cal type */ - s->f_res = s->s.dpi_x; - s->f_mode = s->s.mode; - cleanup: /* recover user settings */ @@ -6470,13 +6588,109 @@ calibrate_fine (struct scanner *s) s->u.br_y = old_br_y; s->u.source = old_source; - DBG (10, "calibrate_fine: finish %d\n",ret); + DBG (10, "calibrate_fine_src_scan: finish %d\n",ret); + + return ret; +} + +/* write calibration data to scanner memory and delete from struct */ +static SANE_Status +calibrate_fine_dest_hw (struct scanner *s) +{ + SANE_Status ret = SANE_STATUS_GOOD; + int i, j, k; + + unsigned char cmd[SEND_len]; + size_t cmdLen = SEND_len; + + unsigned char * out = NULL; + size_t outLen = 0; + + DBG (10, "calibrate_fine_dest_hw: start\n"); + + /* calibration buffers in scanner are single color channel, but 16 bit, plus 4 byte header */ + outLen = s->s.width*2 + 4; + + out = calloc(outLen,1); + if (!out) { + DBG (5, "calibrate_fine_dest_hw: ERROR: cannot calloc out\n"); + ret = SANE_STATUS_NO_MEM; + goto cleanup; + } + + // sides + for(i=0;i<2;i++){ + + // colors + for(j=0;j<3;j++){ + + int codes[] = { + S_FCAL_id_f_red, S_FCAL_id_f_green, S_FCAL_id_f_blue, + S_FCAL_id_b_red, S_FCAL_id_b_green, S_FCAL_id_b_blue}; + + // offset + memset(cmd,0,cmdLen); + set_SCSI_opcode(cmd, SEND_code); + set_S_xfer_datatype (cmd, SR_datatype_fineoffset); + set_S_xfer_length (cmd, outLen); + + set_S_FCAL_datatype (out, codes[i*3+j]); + + for(k=0; ks.valid_width; k++){ + out[4+k*2] = 0; + + // TODO: calculate this instead of hardcode + out[4+k*2+1] = 140; + } + + ret = do_cmd ( + s, 1, 0, + cmd, cmdLen, + out, outLen, + NULL, 0 + ); + if (ret != SANE_STATUS_GOOD) + goto cleanup; + + // gain + set_S_FCAL_datatype (out, codes[i*3+j] | 0x40); + + for(k=0; ks.valid_width; k++){ + out[4+k*2] = 0; + + // TODO: calculate this instead of hardcode + out[4+k*2+1] = 40; + } + + ret = do_cmd ( + s, 1, 0, + cmd, cmdLen, + out, outLen, + NULL, 0 + ); + if (ret != SANE_STATUS_GOOD) + goto cleanup; + + } + } + + cleanup: + + /*blast the fine cal data we generated above, so reading code wont apply it*/ + offset_buffers(s,0); + gain_buffers(s,0); + + if(out){ + free(out); + } + + DBG (10, "calibrate_fine_dest_hw: finish %d\n",ret); return ret; } /* - * sends AFE params, and ingests entire duplex image into buffers + * does a simple scan, ingests entire duplex image into buffers */ static SANE_Status calibration_scan (struct scanner *s, int scan) @@ -6701,7 +6915,7 @@ gain_buffers (struct scanner *s, int setup) * handle h is a valid handle) but usually affects long-running * operations only (such as image acquisition). It is safe to call * this function asynchronously (e.g., from within a signal handler). - * It is important to note that completion of this operaton does not + * It is important to note that completion of this operation does not * imply that the currently pending operation has been cancelled. It * only guarantees that cancellation has been initiated. Cancellation * completes only when the cancelled call returns (typically with a @@ -6727,7 +6941,7 @@ sane_cancel (SANE_Handle handle) /* checks started and cancelled flags in scanner struct, * sends cancel command to scanner if required. don't call - * this function asyncronously, wait for pending operation */ + * this function asynchronously, wait for pending operation */ static SANE_Status check_for_cancel(struct scanner *s) { @@ -7245,7 +7459,7 @@ do_usb_cmd(struct scanner *s, int runRS, int shortTime, } /* build a USB packet around the SCSI command */ - cmdBuffer[3] = cmdLength-4; + set_USB_CMD_xfer_length(cmdBuffer,cmdLength-4); cmdBuffer[5] = 1; cmdBuffer[6] = 0x90; memcpy(cmdBuffer+cmdOffset,cmdBuff,cmdLen); @@ -7305,7 +7519,7 @@ do_usb_cmd(struct scanner *s, int runRS, int shortTime, } /* build a USB packet around the SCSI command */ - outBuffer[3] = outLength-4; + set_USB_OUT_xfer_length(outBuffer,outLength-4); outBuffer[5] = 2; outBuffer[6] = 0xb0; memcpy(outBuffer+outOffset,outBuff,outLen); @@ -7520,7 +7734,7 @@ do_usb_clear(struct scanner *s, int clear, int runRS) DBG (15, "do_usb_clear: clear halt\n"); ret = sanei_usb_clear_halt(s->fd); if(ret != SANE_STATUS_GOOD){ - DBG(5,"do_usb_clear: cant clear halt, returning %d\n", ret); + DBG(5,"do_usb_clear: can't clear halt, returning %d\n", ret); return ret; } } @@ -7680,7 +7894,7 @@ get_page_width(struct scanner *s) return s->max_x_fb; } - /* cant overscan larger than scanner max */ + /* can't overscan larger than scanner max */ if(width > s->valid_x){ return s->valid_x; } @@ -7704,7 +7918,7 @@ get_page_height(struct scanner *s) return s->max_y_fb; } - /* cant overscan larger than scanner max */ + /* can't overscan larger than scanner max */ if(height > s->max_y){ return s->max_y; } diff --git a/backend/canon_dr.conf.in b/backend/canon_dr.conf.in index 2f9d4e4..3b72fda 100644 --- a/backend/canon_dr.conf.in +++ b/backend/canon_dr.conf.in @@ -20,7 +20,7 @@ #option buffer-size 2097152 ####################################################################### -# Most scanners dont pad their reads +# Most scanners don't pad their reads #option padded-read 0 ####################################################################### diff --git a/backend/canon_dr.h b/backend/canon_dr.h index 4ffb360..a945d00 100644 --- a/backend/canon_dr.h +++ b/backend/canon_dr.h @@ -167,11 +167,21 @@ struct scanner int max_y_fb; int can_color; /* actually might be in vpd, but which bit? */ + int need_ccal; /* scanner needs software to help with afe calibration */ - int need_fcal; /* scanner needs software to help with fine calibration */ - int need_fcal_buffer; /* software to apply calibration stored in scanner*/ int ccal_version; /* 0 in most scanners, 3 in newer ones */ + int fcal_src; /* where fine offset/gain calibration data comes from */ + int fcal_dest; /* where fine offset/gain calibration data is used */ + +#define FCAL_SRC_NONE 0 /* scanner does not require fine calibration */ +#define FCAL_SRC_SCAN 1 /* make calibration scans, store gain/offset in struct */ +#define FCAL_SRC_HW 2 /* calibration permanently stored in scanner, downloaded into struct */ + +#define FCAL_DEST_NONE 0 /* scanner does not require fine calibration */ +#define FCAL_DEST_SW 1 /* use gain/offset in struct to adjust output in software */ +#define FCAL_DEST_HW 2 /* send calibration data into scanner for use in hardware */ + int has_counter; int has_rif; int has_adf; @@ -304,7 +314,7 @@ struct scanner unsigned char lut[256]; /* --------------------------------------------------------------------- */ - /* values used by the software enhancment code (deskew, crop, etc) */ + /* values used by the software enhancement code (deskew, crop, etc) */ SANE_Status deskew_stat; int deskew_vals[2]; double deskew_slope; @@ -441,6 +451,7 @@ enum { #define GRAY_INTERLACE_NONE 0 #define GRAY_INTERLACE_2510 1 #define GRAY_INTERLACE_gG 2 +#define GRAY_INTERLACE_C120 3 #define COLOR_INTERLACE_UNK 0 #define COLOR_INTERLACE_RGB 1 @@ -450,12 +461,14 @@ enum { #define COLOR_INTERLACE_RRGGBB 5 #define COLOR_INTERLACE_rRgGbB 6 #define COLOR_INTERLACE_2510 7 +#define COLOR_INTERLACE_C120 8 #define DUPLEX_INTERLACE_NONE 0 #define DUPLEX_INTERLACE_FfBb 1 #define DUPLEX_INTERLACE_FBfb 2 #define DUPLEX_INTERLACE_2510 3 #define DUPLEX_INTERLACE_fFBb 4 +#define DUPLEX_INTERLACE_PER_CHANNEL 5 #define JPEG_INTERLACE_ALT 0 #define JPEG_INTERLACE_NONE 1 @@ -609,7 +622,9 @@ static SANE_Status gain_buffers (struct scanner *s, int setup); static SANE_Status calibrate_AFE(struct scanner *s); static SANE_Status calibrate_fine(struct scanner *s); -static SANE_Status calibrate_fine_buffer(struct scanner *s); +static SANE_Status calibrate_fine_src_scan(struct scanner *s); +static SANE_Status calibrate_fine_src_hw(struct scanner *s); +static SANE_Status calibrate_fine_dest_hw(struct scanner *s); static SANE_Status write_AFE (struct scanner *s); static SANE_Status calibration_scan (struct scanner *s, int); diff --git a/backend/canon_lide70-common.c b/backend/canon_lide70-common.c index a0eb5c0..405d693 100644 --- a/backend/canon_lide70-common.c +++ b/backend/canon_lide70-common.c @@ -17,11 +17,9 @@ 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. + along with this program. If not, see . - This file implements a SANE backend for the Canon CanoScan LiDE 70 */ + This file implements a SANE backend for the Canon CanoScan LiDE 70 and 600 */ #include #include /* open */ @@ -70,6 +68,7 @@ typedef struct CANON_Handle SANE_Word graymode; char *product; /* product name */ + int productcode; /* product code, 0x2224 or 0x2225 */ int fd; /* scanner fd */ int x1, x2, y1, y2; /* in pixels, at 600 dpi */ long width, height; /* at scan resolution */ @@ -84,43 +83,6 @@ typedef struct CANON_Handle } CANON_Handle; - -static byte cmd_buffer[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 -}; - /***************************************************** CP2155 communication primitives Provides I/O routines to Philips CP2155BE chip @@ -133,7 +95,8 @@ static SANE_Status cp2155_set (int fd, CP2155_Register reg, byte data) { SANE_Status status; - size_t count; + byte cmd_buffer[5]; + size_t count = 5 /* = sizeof(cmd_buffer) */ ; cmd_buffer[0] = (reg >> 8) & 0xff; cmd_buffer[1] = (reg) & 0xff; @@ -141,12 +104,18 @@ cp2155_set (int fd, CP2155_Register reg, byte data) cmd_buffer[3] = 0x00; cmd_buffer[4] = data; - count = 5; + DBG (1, "cp2155_set %02x %02x %02x %02x %02x\n", + cmd_buffer[0], cmd_buffer[1], cmd_buffer[2], + cmd_buffer[3], cmd_buffer[4]); +/* + usleep (100 * MSEC); +*/ status = sanei_usb_write_bulk (fd, cmd_buffer, &count); if (status != SANE_STATUS_GOOD) { DBG (1, "cp2155_set: sanei_usb_write_bulk error\n"); +/* exit(0); */ } return status; @@ -157,14 +126,14 @@ static SANE_Status cp2155_get (int fd, CP2155_Register reg, byte * data) { SANE_Status status; - size_t count; + byte cmd_buffer[4]; + size_t count = 4; /* = sizeof(cmd_buffer) */ cmd_buffer[0] = 0x01; cmd_buffer[1] = (reg) & 0xff; cmd_buffer[2] = 0x01; cmd_buffer[3] = 0x00; - count = 4; status = sanei_usb_write_bulk (fd, cmd_buffer, &count); if (status != SANE_STATUS_GOOD) @@ -186,42 +155,19 @@ cp2155_get (int fd, CP2155_Register reg, byte * data) return status; } -/* Write a block of data to CP2155 chip */ -static SANE_Status -cp2155_write (int fd, byte * data, size_t size) -{ - SANE_Status status; - size_t count = size + 4; - - cmd_buffer[0] = 0x04; - cmd_buffer[1] = 0x70; - cmd_buffer[2] = (size) & 0xff; - cmd_buffer[3] = (size >> 8) & 0xff; - memcpy (cmd_buffer + 4, data, size); - - status = sanei_usb_write_bulk (fd, cmd_buffer, &count); - - if (status != SANE_STATUS_GOOD) - { - DBG (1, "cp2155_write: sanei_usb_write_bulk error\n"); - } - - return status; -} - /* Read a block of data from CP2155 chip */ static SANE_Status cp2155_read (int fd, byte * data, size_t size) { SANE_Status status; - size_t count; + byte cmd_buffer[4]; + size_t count = 4; /* = sizeof(cmd_buffer) */ cmd_buffer[0] = 0x05; cmd_buffer[1] = 0x70; cmd_buffer[2] = (size) & 0xff; cmd_buffer[3] = (size >> 8) & 0xff; - count = 4; status = sanei_usb_write_bulk (fd, cmd_buffer, &count); if (status != SANE_STATUS_GOOD) @@ -246,9 +192,10 @@ cp2155_read (int fd, byte * data, size_t size) /*****************************************************/ static void -cp2155_block1 (int fd, byte v001, unsigned int addr, byte * data, size_t size) +cp2155_write_gamma_block (int fd, unsigned int addr, byte * data) { - size_t count = size; + byte value_71 = 0x16; + size_t count = 0x100; while ((count & 0x0f) != 0) { @@ -258,12 +205,12 @@ cp2155_block1 (int fd, byte v001, unsigned int addr, byte * data, size_t size) byte pgLO = (count) & 0xff; byte pgHI = (count >> 8) & 0xff; /* - DBG (1, "cp2155_block1 %06x %02x %04lx %04lx\n", addr, v001, (u_long) size, + DBG (1, "cp2155_write_gamma_block %06x %02x %04lx %04lx\n", addr, v001, (u_long) size, (u_long) count); */ cp2155_set (fd, 0x71, 0x01); cp2155_set (fd, 0x0230, 0x11); - cp2155_set (fd, 0x71, v001); + cp2155_set (fd, 0x71, value_71); cp2155_set (fd, 0x72, pgHI); cp2155_set (fd, 0x73, pgLO); cp2155_set (fd, 0x74, (addr >> 16) & 0xff); @@ -273,12 +220,16 @@ cp2155_block1 (int fd, byte v001, unsigned int addr, byte * data, size_t size) cp2155_set (fd, 0x0238, 0x89); cp2155_set (fd, 0x023c, 0x2f); cp2155_set (fd, 0x0264, 0x20); - cp2155_write (fd, data, count); + + count = count + 4; + sanei_usb_write_bulk (fd, data, &count); } /* size=0x0100 */ /* gamma table red*/ -static byte cp2155_gamma_red_data[] = { +static byte cp2155_gamma_red_enhanced_data[] = { + + 0x04, 0x70, 0x00, 0x01, 0x00, 0x14, 0x1c, 0x26, 0x2a, 0x2e, 0x34, 0x37, 0x3a, 0x3f, 0x42, 0x44, 0x48, 0x4a, 0x4c, 0x50, 0x52, 0x53, 0x57, 0x58, 0x5c, 0x5d, 0x5f, 0x62, 0x63, 0x64, 0x67, 0x68, @@ -315,7 +266,9 @@ static byte cp2155_gamma_red_data[] = { /* size=0x0100 */ /* gamma table */ -static byte cp2155_gamma_greenblue_data[] = { +static byte cp2155_gamma_standard_data[] = { + + 0x04, 0x70, 0x00, 0x01, 0x00, 0x14, 0x1c, 0x21, 0x26, 0x2a, 0x2e, 0x31, 0x34, 0x37, 0x3a, 0x3d, 0x3f, 0x42, 0x44, 0x46, 0x48, 0x4a, 0x4c, 0x4e, 0x50, 0x52, 0x53, 0x55, 0x57, 0x58, 0x5a, 0x5c, @@ -350,211 +303,24 @@ static byte cp2155_gamma_greenblue_data[] = { 0xfe, 0xfe, 0xff, 0xff }; -/* size=0x01f4 */ -static byte cp2155_slope09_back[] = { - 0x80, 0x25, 0x00, 0x25, 0x84, 0x24, 0x0b, 0x24, 0x96, 0x23, 0x23, 0x23, - 0xb3, 0x22, 0x46, 0x22, - 0xdb, 0x21, 0x73, 0x21, 0x0e, 0x21, 0xab, 0x20, 0x4a, 0x20, 0xeb, 0x1f, - 0x8f, 0x1f, 0x34, 0x1f, - 0xdc, 0x1e, 0x85, 0x1e, 0x31, 0x1e, 0xde, 0x1d, 0x8d, 0x1d, 0x3e, 0x1d, - 0xf0, 0x1c, 0xa4, 0x1c, - 0x59, 0x1c, 0x10, 0x1c, 0xc9, 0x1b, 0x83, 0x1b, 0x3e, 0x1b, 0xfa, 0x1a, - 0xb8, 0x1a, 0x77, 0x1a, - 0x38, 0x1a, 0xf9, 0x19, 0xbc, 0x19, 0x80, 0x19, 0x44, 0x19, 0x0a, 0x19, - 0xd1, 0x18, 0x99, 0x18, - 0x62, 0x18, 0x2c, 0x18, 0xf7, 0x17, 0xc3, 0x17, 0x8f, 0x17, 0x5d, 0x17, - 0x2b, 0x17, 0xfa, 0x16, - 0xca, 0x16, 0x9b, 0x16, 0x6c, 0x16, 0x3e, 0x16, 0x11, 0x16, 0xe5, 0x15, - 0xb9, 0x15, 0x8e, 0x15, - 0x64, 0x15, 0x3a, 0x15, 0x11, 0x15, 0xe9, 0x14, 0xc1, 0x14, 0x9a, 0x14, - 0x73, 0x14, 0x4d, 0x14, - 0x27, 0x14, 0x02, 0x14, 0xde, 0x13, 0xba, 0x13, 0x96, 0x13, 0x74, 0x13, - 0x51, 0x13, 0x2f, 0x13, - 0x0d, 0x13, 0xec, 0x12, 0xcc, 0x12, 0xab, 0x12, 0x8c, 0x12, 0x6c, 0x12, - 0x4d, 0x12, 0x2f, 0x12, - 0x11, 0x12, 0xf3, 0x11, 0xd5, 0x11, 0xb8, 0x11, 0x9c, 0x11, 0x80, 0x11, - 0x64, 0x11, 0x48, 0x11, - 0x2d, 0x11, 0x12, 0x11, 0xf7, 0x10, 0xdd, 0x10, 0xc3, 0x10, 0xa9, 0x10, - 0x90, 0x10, 0x77, 0x10, - 0x5e, 0x10, 0x46, 0x10, 0x2e, 0x10, 0x16, 0x10, 0xfe, 0x0f, 0xe7, 0x0f, - 0xd0, 0x0f, 0xb9, 0x0f, - 0xa2, 0x0f, 0x8c, 0x0f, 0x76, 0x0f, 0x60, 0x0f, 0x4b, 0x0f, 0x35, 0x0f, - 0x20, 0x0f, 0x0b, 0x0f, - 0xf7, 0x0e, 0xe2, 0x0e, 0xce, 0x0e, 0xba, 0x0e, 0xa6, 0x0e, 0x92, 0x0e, - 0x7f, 0x0e, 0x6c, 0x0e, - 0x59, 0x0e, 0x46, 0x0e, 0x33, 0x0e, 0x21, 0x0e, 0x0f, 0x0e, 0xfd, 0x0d, - 0xeb, 0x0d, 0xd9, 0x0d, - 0xc8, 0x0d, 0xb6, 0x0d, 0xa5, 0x0d, 0x94, 0x0d, 0x83, 0x0d, 0x73, 0x0d, - 0x62, 0x0d, 0x52, 0x0d, - 0x41, 0x0d, 0x31, 0x0d, 0x22, 0x0d, 0x12, 0x0d, 0x02, 0x0d, 0xf3, 0x0c, - 0xe3, 0x0c, 0xd4, 0x0c, - 0xc5, 0x0c, 0xb6, 0x0c, 0xa7, 0x0c, 0x99, 0x0c, 0x8a, 0x0c, 0x7c, 0x0c, - 0x6e, 0x0c, 0x60, 0x0c, - 0x52, 0x0c, 0x44, 0x0c, 0x36, 0x0c, 0x28, 0x0c, 0x1b, 0x0c, 0x0d, 0x0c, - 0x00, 0x0c, 0xf3, 0x0b, - 0xe6, 0x0b, 0xd9, 0x0b, 0xcc, 0x0b, 0xbf, 0x0b, 0xb3, 0x0b, 0xa6, 0x0b, - 0x9a, 0x0b, 0x8e, 0x0b, - 0x81, 0x0b, 0x75, 0x0b, 0x69, 0x0b, 0x5d, 0x0b, 0x52, 0x0b, 0x46, 0x0b, - 0x3a, 0x0b, 0x2f, 0x0b, - 0x23, 0x0b, 0x18, 0x0b, 0x0d, 0x0b, 0x02, 0x0b, 0xf6, 0x0a, 0xeb, 0x0a, - 0xe1, 0x0a, 0xd6, 0x0a, - 0xcb, 0x0a, 0xc0, 0x0a, 0xb6, 0x0a, 0xab, 0x0a, 0xa1, 0x0a, 0x97, 0x0a, - 0x8c, 0x0a, 0x82, 0x0a, - 0x78, 0x0a, 0x6e, 0x0a, 0x64, 0x0a, 0x5a, 0x0a, 0x50, 0x0a, 0x47, 0x0a, - 0x3d, 0x0a, 0x33, 0x0a, - 0x2a, 0x0a, 0x20, 0x0a, 0x17, 0x0a, 0x0e, 0x0a, 0x04, 0x0a, 0xfb, 0x09, - 0xf2, 0x09, 0xe9, 0x09, - 0xe0, 0x09, 0xd7, 0x09, 0xce, 0x09, 0xc6, 0x09, 0xbd, 0x09, 0xb4, 0x09, - 0xab, 0x09, 0xa3, 0x09, - 0x9a, 0x09, 0x92, 0x09, 0x8a, 0x09, 0x81, 0x09, 0x79, 0x09, 0x71, 0x09, - 0x69, 0x09, 0x61, 0x09, - 0x59, 0x09, 0x51, 0x09, 0x49, 0x09, 0x41, 0x09, 0x39, 0x09, 0x31, 0x09, - 0x29, 0x09, 0x22, 0x09, - 0x1a, 0x09, 0x12, 0x09, 0x0b, 0x09, 0x03, 0x09, 0xfc, 0x08, 0xf5, 0x08, - 0xed, 0x08, 0xe6, 0x08, - 0xdf, 0x08, 0xd8, 0x08, 0xd0, 0x08, 0xc9, 0x08, 0xc2, 0x08, 0xbb, 0x08, - 0xb4, 0x08, 0xad, 0x08, - 0xa6, 0x08, 0xa0, 0x08 -}; - -/* size=0x0018 */ -static byte cp2155_slope10_back[] = { - 0x80, 0x25, 0xc0, 0x1c, 0x4f, 0x17, 0x9a, 0x13, 0xe9, 0x10, 0xde, 0x0e, - 0x44, 0x0d, 0xfa, 0x0b, - 0xea, 0x0a, 0x07, 0x0a, 0x46, 0x09, 0xa0, 0x08 -}; - -static void -cp2155_block2 (int fd, unsigned int addr) -{ - DBG (1, "cp2155_block2 %06x\n", addr); - cp2155_block1 (fd, 0x16, addr, cp2155_gamma_red_data, 0x0100); -} - -static void -cp2155_block3 (int fd, unsigned int addr) -{ - DBG (1, "cp2155_block3 %06x\n", addr); - cp2155_block1 (fd, 0x16, addr, cp2155_gamma_greenblue_data, 0x0100); -} - -static void -cp2155_set_slope (int fd, unsigned int addr, byte * data, size_t size) -{ -/* - DBG (1, "cp2155_set_slope %06x %04lx\n", addr, (u_long) size); -*/ - cp2155_block1 (fd, 0x14, addr, data, size); -} - -/* size=0x0075 */ -static byte cp2155_set_regs_data6[] = { - 0x00, 0x00, 0x00, 0x69, 0x00, 0xe8, 0x1d, 0x00, 0x00, 0x70, 0x00, 0x00, - 0x00, 0x2e, 0x00, 0x04, - 0x04, 0xf8, 0x07, 0x32, 0x32, 0x32, 0x32, 0x00, 0x01, 0x00, 0x01, 0x00, - 0x01, 0x00, 0x01, 0x02, - 0x00, 0x03, 0x15, 0x15, 0x15, 0x15, 0x04, 0x07, 0x29, 0x29, 0x09, 0x09, - 0x02, 0x06, 0x12, 0x12, - 0x03, 0x05, 0x05, 0x03, 0x05, 0x41, 0x61, 0x21, 0x21, 0x25, 0x25, 0x25, - 0x40, 0x40, 0x40, 0x06, - 0x40, 0x06, 0x00, 0x36, 0xd0, 0x00, 0x00, 0x06, 0x00, 0x00, 0x02, 0x83, - 0x7c, 0x02, 0x1c, 0x9c, - 0x38, 0x28, 0x28, 0x27, 0x27, 0x25, 0x25, 0x21, 0x21, 0x1c, 0x1c, 0x16, - 0x16, 0x0f, 0x0f, 0x08, - 0x08, 0x00, 0x00, 0x08, 0x08, 0x0f, 0x0f, 0x16, 0x16, 0x1c, 0x1c, 0x21, - 0x21, 0x25, 0x25, 0x27, - 0x27, 0x02, 0x02, 0x22, 0x00 -}; - -/* size=0x0075 */ -static byte cp2155_set_regs_nr[] = { - 0x07, 0x07, 0x08, 0x09, 0x0a, 0x0b, 0xa0, 0xa1, 0xa2, 0xa3, 0x64, 0x65, - 0x61, 0x62, 0x63, 0x50, - 0x50, 0x90, 0x51, 0x5a, 0x5b, 0x5c, 0x5d, 0x52, 0x53, 0x54, 0x55, 0x56, - 0x57, 0x58, 0x59, 0x5e, - 0x5f, 0x5f, 0x60, 0x60, 0x60, 0x60, 0x50, 0x51, 0x81, 0x81, 0x82, 0x82, - 0x83, 0x84, 0x80, 0x80, - 0xb0, 0x10, 0x10, 0x9b, 0x10, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, - 0x12, 0x13, 0x16, 0x21, - 0x22, 0x20, 0x1d, 0x1e, 0x1f, 0x66, 0x67, 0x68, 0x1a, 0x1b, 0x1c, 0x15, - 0x14, 0x17, 0x43, 0x44, - 0x45, 0x23, 0x33, 0x24, 0x34, 0x25, 0x35, 0x26, 0x36, 0x27, 0x37, 0x28, - 0x38, 0x29, 0x39, 0x2a, - 0x3a, 0x2b, 0x3b, 0x2c, 0x3c, 0x2d, 0x3d, 0x2e, 0x3e, 0x2f, 0x3f, 0x30, - 0x40, 0x31, 0x41, 0x32, - 0x42, 0xca, 0xca, 0xca, 0x18 -}; - -static void -cp2155_set_regs (int fd, byte * data) -{ - DBG (1, "cp2155_set_regs\n"); - int i; - - for (i = 0; i < 0x0075; i++) - { - if (cp2155_set_regs_nr[i] != 0x90) - { - cp2155_set (fd, cp2155_set_regs_nr[i], data[i]); - } - } -} - -static void -cp2155_block5 (int fd, byte v001) -{ - DBG (1, "cp2155_block5 %02x\n", v001); - cp2155_set (fd, 0x90, 0xd8); - cp2155_set (fd, 0x90, 0xd8); - cp2155_set (fd, 0xb0, v001); -} - -static void -cp2155_block6 (int fd, byte v001, byte v002) -{ - DBG (1, "cp2155_block6 %02x %02x\n", v001, v002); - cp2155_set (fd, 0x80, v001); - cp2155_set (fd, 0x11, v002); -} - -static void -cp2155_block8 (int fd) -{ - DBG (1, "cp2155_block8\n"); - cp2155_set (fd, 0x04, 0x0c); - cp2155_set (fd, 0x05, 0x00); - cp2155_set (fd, 0x06, 0x00); -} - static void cp2155_set_gamma (int fd) { DBG (1, "cp2155_set_gamma\n"); /* gamma tables */ - cp2155_block3 (fd, 0x000000); - cp2155_block3 (fd, 0x000100); - cp2155_block3 (fd, 0x000200); + cp2155_write_gamma_block (fd, 0x000, cp2155_gamma_standard_data); + cp2155_write_gamma_block (fd, 0x100, cp2155_gamma_standard_data); + cp2155_write_gamma_block (fd, 0x200, cp2155_gamma_standard_data); } static void -cp2155_set_gamma600 (int fd) +cp2155_set_gamma_red_enhanced (int fd) { DBG (1, "cp2155_set_gamma\n"); /* gamma tables */ - cp2155_block2 (fd, 0x000000); - cp2155_block3 (fd, 0x000100); - cp2155_block3 (fd, 0x000200); -} - -static void -cp2155_motor (int fd, byte v001, byte v002) -{ - DBG (1, "cp2155_motor %02x %02x\n", v001, v002); - cp2155_set (fd, 0x10, v001); - cp2155_set (fd, 0x11, v002); - cp2155_set (fd, 0x60, 0x15); - cp2155_set (fd, 0x80, 0x12); - cp2155_set (fd, 0x03, 0x01); /* starts motor */ + cp2155_write_gamma_block (fd, 0x000, cp2155_gamma_red_enhanced_data); + cp2155_write_gamma_block (fd, 0x100, cp2155_gamma_standard_data); + cp2155_write_gamma_block (fd, 0x200, cp2155_gamma_standard_data); } void @@ -585,55 +351,78 @@ make_buf (size_t count, unsigned char *buf) } void -big_write (int fd, size_t count, unsigned char *buf) +write_buf (int fd, size_t count, unsigned char *buf, + unsigned char value_74, unsigned char value_75) { + unsigned char value_72, value_73; + value_72 = ((count - 4) >> 8) & 0xff; + value_73 = (count - 4) & 0xff; cp2155_set (fd, 0x71, 0x01); cp2155_set (fd, 0x0230, 0x11); cp2155_set (fd, 0x71, 0x14); - cp2155_set (fd, 0x72, 0x51); - cp2155_set (fd, 0x73, 0x70); - cp2155_set (fd, 0x74, 0x00); - cp2155_set (fd, 0x75, 0x00); + cp2155_set (fd, 0x72, value_72); + cp2155_set (fd, 0x73, value_73); + cp2155_set (fd, 0x74, value_74); + cp2155_set (fd, 0x75, value_75); cp2155_set (fd, 0x76, 0x00); cp2155_set (fd, 0x0239, 0x40); cp2155_set (fd, 0x0238, 0x89); cp2155_set (fd, 0x023c, 0x2f); cp2155_set (fd, 0x0264, 0x20); - make_buf (count, buf); sanei_usb_write_bulk (fd, buf, &count); +} + +void +big_write (int fd, size_t count, unsigned char *buf) +{ + make_buf (count, buf); + write_buf (fd, count, buf, 0x00, 0x00); + write_buf (fd, count, buf, 0x00, 0xb0); + write_buf (fd, count, buf, 0x01, 0x60); +} +void +general_motor_2225 (int fd) +{ + cp2155_set (fd, 0x9b, 0x02); + cp2155_set (fd, 0x10, 0x05); + cp2155_set (fd, 0x11, 0x91); + cp2155_set (fd, 0x60, 0x15); + cp2155_set (fd, 0x80, 0x12); + cp2155_set (fd, 0x03, 0x01); cp2155_set (fd, 0x71, 0x01); cp2155_set (fd, 0x0230, 0x11); - cp2155_set (fd, 0x71, 0x14); - cp2155_set (fd, 0x72, 0x51); - cp2155_set (fd, 0x73, 0x70); - cp2155_set (fd, 0x74, 0x00); - cp2155_set (fd, 0x75, 0xb0); - cp2155_set (fd, 0x76, 0x00); + cp2155_set (fd, 0x71, 0x18); + cp2155_set (fd, 0x72, 0x00); + cp2155_set (fd, 0x73, 0x10); cp2155_set (fd, 0x0239, 0x40); cp2155_set (fd, 0x0238, 0x89); cp2155_set (fd, 0x023c, 0x2f); cp2155_set (fd, 0x0264, 0x20); - sanei_usb_write_bulk (fd, buf, &count); +} +void +general_motor_2224 (int fd) +{ + cp2155_set (fd, 0x90, 0xfa); + cp2155_set (fd, 0x10, 0x05); + cp2155_set (fd, 0x11, 0x91); + cp2155_set (fd, 0x60, 0x01); + cp2155_set (fd, 0x80, 0x12); + cp2155_set (fd, 0x03, 0x01); cp2155_set (fd, 0x71, 0x01); cp2155_set (fd, 0x0230, 0x11); - cp2155_set (fd, 0x71, 0x14); - cp2155_set (fd, 0x72, 0x51); - cp2155_set (fd, 0x73, 0x70); - cp2155_set (fd, 0x74, 0x01); - cp2155_set (fd, 0x75, 0x60); - cp2155_set (fd, 0x76, 0x00); + cp2155_set (fd, 0x71, 0x18); + cp2155_set (fd, 0x72, 0x00); + cp2155_set (fd, 0x73, 0x10); cp2155_set (fd, 0x0239, 0x40); cp2155_set (fd, 0x0238, 0x89); cp2155_set (fd, 0x023c, 0x2f); cp2155_set (fd, 0x0264, 0x20); - sanei_usb_write_bulk (fd, buf, &count); - } void -startblob0075 (CANON_Handle * chndl, unsigned char *buf) +startblob_2225_0075 (CANON_Handle * chndl, unsigned char *buf) { int fd; @@ -692,7 +481,7 @@ startblob0075 (CANON_Handle * chndl, unsigned char *buf) cp2155_set (fd, 0x80, 0x12); cp2155_set (fd, 0xb0, 0x0b); - big_write (fd, 20852, buf); + big_write (fd, 0x5174, buf); cp2155_set (fd, 0x10, 0x05); cp2155_set (fd, 0x10, 0x05); @@ -762,81 +551,7 @@ startblob0075 (CANON_Handle * chndl, unsigned char *buf) cp2155_set (fd, 0xca, 0x01); cp2155_set (fd, 0xca, 0x11); cp2155_set (fd, 0x18, 0x00); - cp2155_set (fd, 0x71, 0x01); - cp2155_set (fd, 0x0230, 0x11); - cp2155_set (fd, 0x71, 0x14); - cp2155_set (fd, 0x72, 0x01); - cp2155_set (fd, 0x73, 0x00); - cp2155_set (fd, 0x74, 0x03); - cp2155_set (fd, 0x75, 0x00); - cp2155_set (fd, 0x76, 0x00); - cp2155_set (fd, 0x0239, 0x40); - cp2155_set (fd, 0x0238, 0x89); - cp2155_set (fd, 0x023c, 0x2f); - cp2155_set (fd, 0x0264, 0x20); - memcpy (buf + 0x00000000, - "\x04\x70\x00\x01\x80\x25\x80\x25\x80\x25\x80\x25\x80\x25\x80\x25", - 16); - memcpy (buf + 0x00000010, - "\x80\x25\x80\x25\x80\x25\x80\x25\x80\x25\x80\x25\x80\x25\x80\x25", - 16); - memcpy (buf + 0x00000020, - "\x80\x25\x80\x25\x80\x25\x80\x25\x80\x25\x80\x25\x80\x25\x80\x25", - 16); - memcpy (buf + 0x00000030, - "\x80\x25\x80\x25\x80\x25\x80\x25\x80\x25\x80\x25\x80\x25\x80\x25", - 16); - memcpy (buf + 0x00000040, - "\x80\x25\x80\x25\x80\x25\x80\x25\x80\x25\x80\x25\x80\x25\x80\x25", - 16); - memcpy (buf + 0x00000050, - "\x80\x25\x80\x25\x80\x25\x80\x25\x80\x25\x80\x25\x80\x25\x80\x25", - 16); - memcpy (buf + 0x00000060, - "\x80\x25\x80\x25\x80\x25\x80\x25\x80\x25\xf0\x23\x80\x22\x2c\x21", - 16); - memcpy (buf + 0x00000070, - "\xf1\x1f\xcd\x1e\xbd\x1d\xc0\x1c\xd2\x1b\xf4\x1a\x22\x1a\x5e\x19", - 16); - memcpy (buf + 0x00000080, - "\xa4\x18\xf5\x17\x4f\x17\xb2\x16\x1d\x16\x90\x15\x09\x15\x89\x14", - 16); - memcpy (buf + 0x00000090, - "\x0e\x14\x9a\x13\x2a\x13\xc0\x12\x59\x12\xf8\x11\x9a\x11\x3f\x11", - 16); - memcpy (buf + 0x000000a0, - "\xe9\x10\x96\x10\x46\x10\xf8\x0f\xae\x0f\x66\x0f\x21\x0f\xde\x0e", - 16); - memcpy (buf + 0x000000b0, - "\x9e\x0e\x60\x0e\x23\x0e\xe9\x0d\xb0\x0d\x7a\x0d\x44\x0d\x11\x0d", - 16); - memcpy (buf + 0x000000c0, - "\xdf\x0c\xaf\x0c\x80\x0c\x52\x0c\x25\x0c\xfa\x0b\xd0\x0b\xa7\x0b", - 16); - memcpy (buf + 0x000000d0, - "\x80\x0b\x59\x0b\x33\x0b\x0e\x0b\xea\x0a\xc8\x0a\xa5\x0a\x84\x0a", - 16); - memcpy (buf + 0x000000e0, - "\x64\x0a\x44\x0a\x25\x0a\x07\x0a\xe9\x09\xcd\x09\xb0\x09\x95\x09", - 16); - memcpy (buf + 0x000000f0, - "\x7a\x09\x60\x09\x46\x09\x2c\x09\x14\x09\xfc\x08\xe4\x08\xcd\x08", - 16); - memcpy (buf + 0x00000100, "\xb6\x08\xa0\x08", 4); - count = 260; - sanei_usb_write_bulk (fd, buf, &count); - cp2155_set (fd, 0x71, 0x01); - cp2155_set (fd, 0x0230, 0x11); - cp2155_set (fd, 0x71, 0x14); - cp2155_set (fd, 0x72, 0x01); - cp2155_set (fd, 0x73, 0x00); - cp2155_set (fd, 0x74, 0x03); - cp2155_set (fd, 0x75, 0x02); - cp2155_set (fd, 0x76, 0x00); - cp2155_set (fd, 0x0239, 0x40); - cp2155_set (fd, 0x0238, 0x89); - cp2155_set (fd, 0x023c, 0x2f); - cp2155_set (fd, 0x0264, 0x20); + memcpy (buf + 0x00000000, "\x04\x70\x00\x01\x80\x25\x80\x25\x80\x25\x80\x25\x80\x25\x80\x25", 16); @@ -887,19 +602,10 @@ startblob0075 (CANON_Handle * chndl, unsigned char *buf) 16); memcpy (buf + 0x00000100, "\xb6\x08\xa0\x08", 4); count = 260; - sanei_usb_write_bulk (fd, buf, &count); - cp2155_set (fd, 0x71, 0x01); - cp2155_set (fd, 0x0230, 0x11); - cp2155_set (fd, 0x71, 0x14); - cp2155_set (fd, 0x72, 0x00); - cp2155_set (fd, 0x73, 0x20); - cp2155_set (fd, 0x74, 0x03); - cp2155_set (fd, 0x75, 0x04); - cp2155_set (fd, 0x76, 0x00); - cp2155_set (fd, 0x0239, 0x40); - cp2155_set (fd, 0x0238, 0x89); - cp2155_set (fd, 0x023c, 0x2f); - cp2155_set (fd, 0x0264, 0x20); + write_buf (fd, count, buf, 0x03, 0x00); + write_buf (fd, count, buf, 0x03, 0x02); + write_buf (fd, count, buf, 0x03, 0x06); + memcpy (buf + 0x00000000, "\x04\x70\x18\x00\x80\x25\xc0\x1c\x4f\x17\x9a\x13\xe9\x10\xde\x0e", 16); @@ -908,111 +614,14 @@ startblob0075 (CANON_Handle * chndl, unsigned char *buf) 16); memcpy (buf + 0x00000020, "\x80\x25\x80\x25", 4); count = 36; - sanei_usb_write_bulk (fd, buf, &count); - cp2155_set (fd, 0x71, 0x01); - cp2155_set (fd, 0x0230, 0x11); - cp2155_set (fd, 0x71, 0x14); - cp2155_set (fd, 0x72, 0x01); - cp2155_set (fd, 0x73, 0x00); - cp2155_set (fd, 0x74, 0x03); - cp2155_set (fd, 0x75, 0x06); - cp2155_set (fd, 0x76, 0x00); - cp2155_set (fd, 0x0239, 0x40); - cp2155_set (fd, 0x0238, 0x89); - cp2155_set (fd, 0x023c, 0x2f); - cp2155_set (fd, 0x0264, 0x20); - memcpy (buf + 0x00000000, - "\x04\x70\x00\x01\x80\x25\x80\x25\x80\x25\x80\x25\x80\x25\x80\x25", - 16); - memcpy (buf + 0x00000010, - "\x80\x25\x80\x25\x80\x25\x80\x25\x80\x25\x80\x25\x80\x25\x80\x25", - 16); - memcpy (buf + 0x00000020, - "\x80\x25\x80\x25\x80\x25\x80\x25\x80\x25\x80\x25\x80\x25\x80\x25", - 16); - memcpy (buf + 0x00000030, - "\x80\x25\x80\x25\x80\x25\x80\x25\x80\x25\x80\x25\x80\x25\x80\x25", - 16); - memcpy (buf + 0x00000040, - "\x80\x25\x80\x25\x80\x25\x80\x25\x80\x25\x80\x25\x80\x25\x80\x25", - 16); - memcpy (buf + 0x00000050, - "\x80\x25\x80\x25\x80\x25\x80\x25\x80\x25\x80\x25\x80\x25\x80\x25", - 16); - memcpy (buf + 0x00000060, - "\x80\x25\x80\x25\x80\x25\x80\x25\x80\x25\xf0\x23\x80\x22\x2c\x21", - 16); - memcpy (buf + 0x00000070, - "\xf1\x1f\xcd\x1e\xbd\x1d\xc0\x1c\xd2\x1b\xf4\x1a\x22\x1a\x5e\x19", - 16); - memcpy (buf + 0x00000080, - "\xa4\x18\xf5\x17\x4f\x17\xb2\x16\x1d\x16\x90\x15\x09\x15\x89\x14", - 16); - memcpy (buf + 0x00000090, - "\x0e\x14\x9a\x13\x2a\x13\xc0\x12\x59\x12\xf8\x11\x9a\x11\x3f\x11", - 16); - memcpy (buf + 0x000000a0, - "\xe9\x10\x96\x10\x46\x10\xf8\x0f\xae\x0f\x66\x0f\x21\x0f\xde\x0e", - 16); - memcpy (buf + 0x000000b0, - "\x9e\x0e\x60\x0e\x23\x0e\xe9\x0d\xb0\x0d\x7a\x0d\x44\x0d\x11\x0d", - 16); - memcpy (buf + 0x000000c0, - "\xdf\x0c\xaf\x0c\x80\x0c\x52\x0c\x25\x0c\xfa\x0b\xd0\x0b\xa7\x0b", - 16); - memcpy (buf + 0x000000d0, - "\x80\x0b\x59\x0b\x33\x0b\x0e\x0b\xea\x0a\xc8\x0a\xa5\x0a\x84\x0a", - 16); - memcpy (buf + 0x000000e0, - "\x64\x0a\x44\x0a\x25\x0a\x07\x0a\xe9\x09\xcd\x09\xb0\x09\x95\x09", - 16); - memcpy (buf + 0x000000f0, - "\x7a\x09\x60\x09\x46\x09\x2c\x09\x14\x09\xfc\x08\xe4\x08\xcd\x08", - 16); - memcpy (buf + 0x00000100, "\xb6\x08\xa0\x08", 4); - count = 260; - sanei_usb_write_bulk (fd, buf, &count); - cp2155_set (fd, 0x71, 0x01); - cp2155_set (fd, 0x0230, 0x11); - cp2155_set (fd, 0x71, 0x14); - cp2155_set (fd, 0x72, 0x00); - cp2155_set (fd, 0x73, 0x20); - cp2155_set (fd, 0x74, 0x03); - cp2155_set (fd, 0x75, 0x08); - cp2155_set (fd, 0x76, 0x00); - cp2155_set (fd, 0x0239, 0x40); - cp2155_set (fd, 0x0238, 0x89); - cp2155_set (fd, 0x023c, 0x2f); - cp2155_set (fd, 0x0264, 0x20); - memcpy (buf + 0x00000000, - "\x04\x70\x18\x00\x80\x25\xc0\x1c\x4f\x17\x9a\x13\xe9\x10\xde\x0e", - 16); - memcpy (buf + 0x00000010, - "\x44\x0d\xfa\x0b\xea\x0a\x07\x0a\x46\x09\xa0\x08\x80\x25\x80\x25", - 16); - memcpy (buf + 0x00000020, "\x80\x25\x80\x25", 4); - count = 36; - sanei_usb_write_bulk (fd, buf, &count); - cp2155_set (fd, 0x9b, 0x02); - cp2155_set (fd, 0x10, 0x05); - cp2155_set (fd, 0x11, 0x91); - cp2155_set (fd, 0x60, 0x15); - cp2155_set (fd, 0x80, 0x12); - cp2155_set (fd, 0x03, 0x01); - cp2155_set (fd, 0x71, 0x01); - cp2155_set (fd, 0x0230, 0x11); - cp2155_set (fd, 0x71, 0x18); - cp2155_set (fd, 0x72, 0x00); - cp2155_set (fd, 0x73, 0x10); - cp2155_set (fd, 0x0239, 0x40); - cp2155_set (fd, 0x0238, 0x89); - cp2155_set (fd, 0x023c, 0x2f); - cp2155_set (fd, 0x0264, 0x20); + write_buf (fd, count, buf, 0x03, 0x04); + write_buf (fd, count, buf, 0x03, 0x08); + general_motor_2225 (fd); } void -startblob0150 (CANON_Handle * chndl, unsigned char *buf) +startblob_2225_0150 (CANON_Handle * chndl, unsigned char *buf) { int fd; @@ -1071,7 +680,7 @@ startblob0150 (CANON_Handle * chndl, unsigned char *buf) cp2155_set (fd, 0x80, 0x12); cp2155_set (fd, 0xb0, 0x0a); - big_write (fd, 20852, buf); + big_write (fd, 0x5174, buf); cp2155_set (fd, 0x10, 0x05); cp2155_set (fd, 0x10, 0x05); @@ -1203,166 +812,10 @@ startblob0150 (CANON_Handle * chndl, unsigned char *buf) 16); memcpy (buf + 0x00000100, "\x8c\x0b\x7c\x0b", 4); count = 260; - sanei_usb_write_bulk (fd, buf, &count); - cp2155_set (fd, 0x71, 0x01); - cp2155_set (fd, 0x0230, 0x11); - cp2155_set (fd, 0x71, 0x14); - cp2155_set (fd, 0x72, 0x01); - cp2155_set (fd, 0x73, 0x00); - cp2155_set (fd, 0x74, 0x03); - cp2155_set (fd, 0x75, 0x02); - cp2155_set (fd, 0x76, 0x00); - cp2155_set (fd, 0x0239, 0x40); - cp2155_set (fd, 0x0238, 0x89); - cp2155_set (fd, 0x023c, 0x2f); - cp2155_set (fd, 0x0264, 0x20); - memcpy (buf + 0x00000000, - "\x04\x70\x00\x01\x80\x25\xd7\x24\x35\x24\x98\x23\x00\x23\x6d\x22", - 16); - memcpy (buf + 0x00000010, - "\xdf\x21\x56\x21\xd1\x20\x50\x20\xd2\x1f\x59\x1f\xe3\x1e\x70\x1e", - 16); - memcpy (buf + 0x00000020, - "\x01\x1e\x95\x1d\x2c\x1d\xc6\x1c\x62\x1c\x02\x1c\xa3\x1b\x47\x1b", - 16); - memcpy (buf + 0x00000030, - "\xee\x1a\x97\x1a\x42\x1a\xef\x19\x9e\x19\x4f\x19\x02\x19\xb7\x18", - 16); - memcpy (buf + 0x00000040, - "\x6d\x18\x25\x18\xdf\x17\x9a\x17\x57\x17\x16\x17\xd6\x16\x97\x16", - 16); - memcpy (buf + 0x00000050, - "\x59\x16\x1d\x16\xe2\x15\xa8\x15\x70\x15\x38\x15\x02\x15\xcd\x14", - 16); - memcpy (buf + 0x00000060, - "\x99\x14\x66\x14\x33\x14\x02\x14\xd2\x13\xa2\x13\x74\x13\x46\x13", - 16); - memcpy (buf + 0x00000070, - "\x19\x13\xed\x12\xc2\x12\x98\x12\x6e\x12\x45\x12\x1d\x12\xf5\x11", - 16); - memcpy (buf + 0x00000080, - "\xce\x11\xa8\x11\x82\x11\x5d\x11\x39\x11\x15\x11\xf2\x10\xcf\x10", - 16); - memcpy (buf + 0x00000090, - "\xad\x10\x8b\x10\x6a\x10\x4a\x10\x2a\x10\x0a\x10\xeb\x0f\xcc\x0f", - 16); - memcpy (buf + 0x000000a0, - "\xae\x0f\x90\x0f\x73\x0f\x56\x0f\x3a\x0f\x1e\x0f\x02\x0f\xe7\x0e", - 16); - memcpy (buf + 0x000000b0, - "\xcc\x0e\xb2\x0e\x97\x0e\x7e\x0e\x64\x0e\x4b\x0e\x32\x0e\x1a\x0e", - 16); - memcpy (buf + 0x000000c0, - "\x02\x0e\xea\x0d\xd3\x0d\xbc\x0d\xa5\x0d\x8e\x0d\x78\x0d\x62\x0d", - 16); - memcpy (buf + 0x000000d0, - "\x4d\x0d\x37\x0d\x22\x0d\x0d\x0d\xf8\x0c\xe4\x0c\xd0\x0c\xbc\x0c", - 16); - memcpy (buf + 0x000000e0, - "\xa8\x0c\x95\x0c\x82\x0c\x6f\x0c\x5c\x0c\x4a\x0c\x37\x0c\x25\x0c", - 16); - memcpy (buf + 0x000000f0, - "\x14\x0c\x02\x0c\xf0\x0b\xdf\x0b\xce\x0b\xbd\x0b\xac\x0b\x9c\x0b", - 16); - memcpy (buf + 0x00000100, "\x8c\x0b\x7c\x0b", 4); - count = 260; - sanei_usb_write_bulk (fd, buf, &count); - cp2155_set (fd, 0x71, 0x01); - cp2155_set (fd, 0x0230, 0x11); - cp2155_set (fd, 0x71, 0x14); - cp2155_set (fd, 0x72, 0x00); - cp2155_set (fd, 0x73, 0x20); - cp2155_set (fd, 0x74, 0x03); - cp2155_set (fd, 0x75, 0x04); - cp2155_set (fd, 0x76, 0x00); - cp2155_set (fd, 0x0239, 0x40); - cp2155_set (fd, 0x0238, 0x89); - cp2155_set (fd, 0x023c, 0x2f); - cp2155_set (fd, 0x0264, 0x20); - memcpy (buf + 0x00000000, - "\x04\x70\x18\x00\x80\x25\x18\x1f\x8f\x1a\x2d\x17\x8f\x14\x79\x12", - 16); - memcpy (buf + 0x00000010, - "\xc6\x10\x5b\x0f\x2a\x0e\x24\x0d\x41\x0c\x7c\x0b\xe3\x1e\x70\x1e", - 16); - memcpy (buf + 0x00000020, "\x01\x1e\x95\x1d", 4); - count = 36; - sanei_usb_write_bulk (fd, buf, &count); - cp2155_set (fd, 0x71, 0x01); - cp2155_set (fd, 0x0230, 0x11); - cp2155_set (fd, 0x71, 0x14); - cp2155_set (fd, 0x72, 0x01); - cp2155_set (fd, 0x73, 0x00); - cp2155_set (fd, 0x74, 0x03); - cp2155_set (fd, 0x75, 0x06); - cp2155_set (fd, 0x76, 0x00); - cp2155_set (fd, 0x0239, 0x40); - cp2155_set (fd, 0x0238, 0x89); - cp2155_set (fd, 0x023c, 0x2f); - cp2155_set (fd, 0x0264, 0x20); - memcpy (buf + 0x00000000, - "\x04\x70\x00\x01\x80\x25\xd7\x24\x35\x24\x98\x23\x00\x23\x6d\x22", - 16); - memcpy (buf + 0x00000010, - "\xdf\x21\x56\x21\xd1\x20\x50\x20\xd2\x1f\x59\x1f\xe3\x1e\x70\x1e", - 16); - memcpy (buf + 0x00000020, - "\x01\x1e\x95\x1d\x2c\x1d\xc6\x1c\x62\x1c\x02\x1c\xa3\x1b\x47\x1b", - 16); - memcpy (buf + 0x00000030, - "\xee\x1a\x97\x1a\x42\x1a\xef\x19\x9e\x19\x4f\x19\x02\x19\xb7\x18", - 16); - memcpy (buf + 0x00000040, - "\x6d\x18\x25\x18\xdf\x17\x9a\x17\x57\x17\x16\x17\xd6\x16\x97\x16", - 16); - memcpy (buf + 0x00000050, - "\x59\x16\x1d\x16\xe2\x15\xa8\x15\x70\x15\x38\x15\x02\x15\xcd\x14", - 16); - memcpy (buf + 0x00000060, - "\x99\x14\x66\x14\x33\x14\x02\x14\xd2\x13\xa2\x13\x74\x13\x46\x13", - 16); - memcpy (buf + 0x00000070, - "\x19\x13\xed\x12\xc2\x12\x98\x12\x6e\x12\x45\x12\x1d\x12\xf5\x11", - 16); - memcpy (buf + 0x00000080, - "\xce\x11\xa8\x11\x82\x11\x5d\x11\x39\x11\x15\x11\xf2\x10\xcf\x10", - 16); - memcpy (buf + 0x00000090, - "\xad\x10\x8b\x10\x6a\x10\x4a\x10\x2a\x10\x0a\x10\xeb\x0f\xcc\x0f", - 16); - memcpy (buf + 0x000000a0, - "\xae\x0f\x90\x0f\x73\x0f\x56\x0f\x3a\x0f\x1e\x0f\x02\x0f\xe7\x0e", - 16); - memcpy (buf + 0x000000b0, - "\xcc\x0e\xb2\x0e\x97\x0e\x7e\x0e\x64\x0e\x4b\x0e\x32\x0e\x1a\x0e", - 16); - memcpy (buf + 0x000000c0, - "\x02\x0e\xea\x0d\xd3\x0d\xbc\x0d\xa5\x0d\x8e\x0d\x78\x0d\x62\x0d", - 16); - memcpy (buf + 0x000000d0, - "\x4d\x0d\x37\x0d\x22\x0d\x0d\x0d\xf8\x0c\xe4\x0c\xd0\x0c\xbc\x0c", - 16); - memcpy (buf + 0x000000e0, - "\xa8\x0c\x95\x0c\x82\x0c\x6f\x0c\x5c\x0c\x4a\x0c\x37\x0c\x25\x0c", - 16); - memcpy (buf + 0x000000f0, - "\x14\x0c\x02\x0c\xf0\x0b\xdf\x0b\xce\x0b\xbd\x0b\xac\x0b\x9c\x0b", - 16); - memcpy (buf + 0x00000100, "\x8c\x0b\x7c\x0b", 4); - count = 260; - sanei_usb_write_bulk (fd, buf, &count); - cp2155_set (fd, 0x71, 0x01); - cp2155_set (fd, 0x0230, 0x11); - cp2155_set (fd, 0x71, 0x14); - cp2155_set (fd, 0x72, 0x00); - cp2155_set (fd, 0x73, 0x20); - cp2155_set (fd, 0x74, 0x03); - cp2155_set (fd, 0x75, 0x08); - cp2155_set (fd, 0x76, 0x00); - cp2155_set (fd, 0x0239, 0x40); - cp2155_set (fd, 0x0238, 0x89); - cp2155_set (fd, 0x023c, 0x2f); - cp2155_set (fd, 0x0264, 0x20); + write_buf (fd, count, buf, 0x03, 0x00); + write_buf (fd, count, buf, 0x03, 0x02); + write_buf (fd, count, buf, 0x03, 0x06); + memcpy (buf + 0x00000000, "\x04\x70\x18\x00\x80\x25\x18\x1f\x8f\x1a\x2d\x17\x8f\x14\x79\x12", 16); @@ -1371,27 +824,14 @@ startblob0150 (CANON_Handle * chndl, unsigned char *buf) 16); memcpy (buf + 0x00000020, "\x01\x1e\x95\x1d", 4); count = 36; - sanei_usb_write_bulk (fd, buf, &count); - cp2155_set (fd, 0x9b, 0x02); - cp2155_set (fd, 0x10, 0x05); - cp2155_set (fd, 0x11, 0x91); - cp2155_set (fd, 0x60, 0x15); - cp2155_set (fd, 0x80, 0x12); - cp2155_set (fd, 0x03, 0x01); - cp2155_set (fd, 0x71, 0x01); - cp2155_set (fd, 0x0230, 0x11); - cp2155_set (fd, 0x71, 0x18); - cp2155_set (fd, 0x72, 0x00); - cp2155_set (fd, 0x73, 0x10); - cp2155_set (fd, 0x0239, 0x40); - cp2155_set (fd, 0x0238, 0x89); - cp2155_set (fd, 0x023c, 0x2f); - cp2155_set (fd, 0x0264, 0x20); + write_buf (fd, count, buf, 0x03, 0x04); + write_buf (fd, count, buf, 0x03, 0x08); + general_motor_2225 (fd); } void -startblob0300 (CANON_Handle * chndl, unsigned char *buf) +startblob_2225_0300 (CANON_Handle * chndl, unsigned char *buf) { int fd; @@ -1450,7 +890,7 @@ startblob0300 (CANON_Handle * chndl, unsigned char *buf) cp2155_set (fd, 0x80, 0x12); cp2155_set (fd, 0xb0, 0x09); - big_write (fd, 20852, buf); + big_write (fd, 0x5174, buf); cp2155_set (fd, 0x10, 0x05); cp2155_set (fd, 0x10, 0x05); @@ -1520,18 +960,7 @@ startblob0300 (CANON_Handle * chndl, unsigned char *buf) cp2155_set (fd, 0xca, 0x00); cp2155_set (fd, 0xca, 0x00); cp2155_set (fd, 0x18, 0x00); - cp2155_set (fd, 0x71, 0x01); - cp2155_set (fd, 0x0230, 0x11); - cp2155_set (fd, 0x71, 0x14); - cp2155_set (fd, 0x72, 0x00); - cp2155_set (fd, 0x73, 0x30); - cp2155_set (fd, 0x74, 0x03); - cp2155_set (fd, 0x75, 0x00); - cp2155_set (fd, 0x76, 0x00); - cp2155_set (fd, 0x0239, 0x40); - cp2155_set (fd, 0x0238, 0x89); - cp2155_set (fd, 0x023c, 0x2f); - cp2155_set (fd, 0x0264, 0x20); + memcpy (buf + 0x00000000, "\x04\x70\x30\x00\x80\x25\x36\x25\xee\x24\xa8\x24\x62\x24\x1d\x24", 16); @@ -1543,117 +972,26 @@ startblob0300 (CANON_Handle * chndl, unsigned char *buf) 16); memcpy (buf + 0x00000030, "\x15\x20\xe0\x1f", 4); count = 52; - sanei_usb_write_bulk (fd, buf, &count); - cp2155_set (fd, 0x71, 0x01); - cp2155_set (fd, 0x0230, 0x11); - cp2155_set (fd, 0x71, 0x14); - cp2155_set (fd, 0x72, 0x00); - cp2155_set (fd, 0x73, 0x30); - cp2155_set (fd, 0x74, 0x03); - cp2155_set (fd, 0x75, 0x02); - cp2155_set (fd, 0x76, 0x00); - cp2155_set (fd, 0x0239, 0x40); - cp2155_set (fd, 0x0238, 0x89); - cp2155_set (fd, 0x023c, 0x2f); - cp2155_set (fd, 0x0264, 0x20); + write_buf (fd, count, buf, 0x03, 0x00); + write_buf (fd, count, buf, 0x03, 0x02); + write_buf (fd, count, buf, 0x03, 0x06); + memcpy (buf + 0x00000000, - "\x04\x70\x30\x00\x80\x25\x36\x25\xee\x24\xa8\x24\x62\x24\x1d\x24", + "\x04\x70\x18\x00\x80\x25\xe8\x24\x55\x24\xc7\x23\x3d\x23\xb7\x22", 16); memcpy (buf + 0x00000010, - "\xd9\x23\x96\x23\x54\x23\x13\x23\xd3\x22\x94\x22\x56\x22\x19\x22", - 16); - memcpy (buf + 0x00000020, - "\xdc\x21\xa1\x21\x66\x21\x2c\x21\xf3\x20\xba\x20\x82\x20\x4b\x20", - 16); - memcpy (buf + 0x00000030, "\x15\x20\xe0\x1f", 4); - count = 52; - sanei_usb_write_bulk (fd, buf, &count); - cp2155_set (fd, 0x71, 0x01); - cp2155_set (fd, 0x0230, 0x11); - cp2155_set (fd, 0x71, 0x14); - cp2155_set (fd, 0x72, 0x00); - cp2155_set (fd, 0x73, 0x20); - cp2155_set (fd, 0x74, 0x03); - cp2155_set (fd, 0x75, 0x04); - cp2155_set (fd, 0x76, 0x00); - cp2155_set (fd, 0x0239, 0x40); - cp2155_set (fd, 0x0238, 0x89); - cp2155_set (fd, 0x023c, 0x2f); - cp2155_set (fd, 0x0264, 0x20); - memcpy (buf + 0x00000000, - "\x04\x70\x18\x00\x80\x25\xe8\x24\x55\x24\xc7\x23\x3d\x23\xb7\x22", - 16); - memcpy (buf + 0x00000010, - "\x35\x22\xb6\x21\x3c\x21\xc4\x20\x50\x20\xe0\x1f\x56\x22\x19\x22", - 16); - memcpy (buf + 0x00000020, "\xdc\x21\xa1\x21", 4); - count = 36; - sanei_usb_write_bulk (fd, buf, &count); - cp2155_set (fd, 0x71, 0x01); - cp2155_set (fd, 0x0230, 0x11); - cp2155_set (fd, 0x71, 0x14); - cp2155_set (fd, 0x72, 0x00); - cp2155_set (fd, 0x73, 0x30); - cp2155_set (fd, 0x74, 0x03); - cp2155_set (fd, 0x75, 0x06); - cp2155_set (fd, 0x76, 0x00); - cp2155_set (fd, 0x0239, 0x40); - cp2155_set (fd, 0x0238, 0x89); - cp2155_set (fd, 0x023c, 0x2f); - cp2155_set (fd, 0x0264, 0x20); - memcpy (buf + 0x00000000, - "\x04\x70\x30\x00\x80\x25\x36\x25\xee\x24\xa8\x24\x62\x24\x1d\x24", - 16); - memcpy (buf + 0x00000010, - "\xd9\x23\x96\x23\x54\x23\x13\x23\xd3\x22\x94\x22\x56\x22\x19\x22", - 16); - memcpy (buf + 0x00000020, - "\xdc\x21\xa1\x21\x66\x21\x2c\x21\xf3\x20\xba\x20\x82\x20\x4b\x20", - 16); - memcpy (buf + 0x00000030, "\x15\x20\xe0\x1f", 4); - count = 52; - sanei_usb_write_bulk (fd, buf, &count); - cp2155_set (fd, 0x71, 0x01); - cp2155_set (fd, 0x0230, 0x11); - cp2155_set (fd, 0x71, 0x14); - cp2155_set (fd, 0x72, 0x00); - cp2155_set (fd, 0x73, 0x20); - cp2155_set (fd, 0x74, 0x03); - cp2155_set (fd, 0x75, 0x08); - cp2155_set (fd, 0x76, 0x00); - cp2155_set (fd, 0x0239, 0x40); - cp2155_set (fd, 0x0238, 0x89); - cp2155_set (fd, 0x023c, 0x2f); - cp2155_set (fd, 0x0264, 0x20); - memcpy (buf + 0x00000000, - "\x04\x70\x18\x00\x80\x25\xe8\x24\x55\x24\xc7\x23\x3d\x23\xb7\x22", - 16); - memcpy (buf + 0x00000010, - "\x35\x22\xb6\x21\x3c\x21\xc4\x20\x50\x20\xe0\x1f\x56\x22\x19\x22", + "\x35\x22\xb6\x21\x3c\x21\xc4\x20\x50\x20\xe0\x1f\x56\x22\x19\x22", 16); memcpy (buf + 0x00000020, "\xdc\x21\xa1\x21", 4); count = 36; - sanei_usb_write_bulk (fd, buf, &count); - cp2155_set (fd, 0x9b, 0x00); - cp2155_set (fd, 0x10, 0x05); - cp2155_set (fd, 0x11, 0x91); - cp2155_set (fd, 0x60, 0x15); - cp2155_set (fd, 0x80, 0x12); - cp2155_set (fd, 0x03, 0x01); - cp2155_set (fd, 0x71, 0x01); - cp2155_set (fd, 0x0230, 0x11); - cp2155_set (fd, 0x71, 0x18); - cp2155_set (fd, 0x72, 0x00); - cp2155_set (fd, 0x73, 0x10); - cp2155_set (fd, 0x0239, 0x40); - cp2155_set (fd, 0x0238, 0x89); - cp2155_set (fd, 0x023c, 0x2f); - cp2155_set (fd, 0x0264, 0x20); + write_buf (fd, count, buf, 0x03, 0x04); + write_buf (fd, count, buf, 0x03, 0x08); + general_motor_2225 (fd); } void -startblob0600 (CANON_Handle * chndl, unsigned char *buf) +startblob_2225_0600 (CANON_Handle * chndl, unsigned char *buf) { int fd; @@ -1779,99 +1117,7 @@ startblob0600 (CANON_Handle * chndl, unsigned char *buf) cp2155_set (fd, 0xca, 0x00); cp2155_set (fd, 0xca, 0x00); cp2155_set (fd, 0x18, 0x00); - cp2155_set (fd, 0x71, 0x01); - cp2155_set (fd, 0x0230, 0x11); - cp2155_set (fd, 0x71, 0x14); - cp2155_set (fd, 0x72, 0x00); - cp2155_set (fd, 0x73, 0x50); - cp2155_set (fd, 0x74, 0x03); - cp2155_set (fd, 0x75, 0x00); - cp2155_set (fd, 0x76, 0x00); - cp2155_set (fd, 0x0239, 0x40); - cp2155_set (fd, 0x0238, 0x89); - cp2155_set (fd, 0x023c, 0x2f); - cp2155_set (fd, 0x0264, 0x20); - memcpy (buf + 0x0000, - "\x04\x70\x50\x00\x80\x25\x58\x25\x32\x25\x0b\x25\xe5\x24\xc0\x24", - 16); - memcpy (buf + 0x0010, - "\x9a\x24\x75\x24\x50\x24\x2b\x24\x07\x24\xe3\x23\xbf\x23\x9c\x23", - 16); - memcpy (buf + 0x0020, - "\x79\x23\x56\x23\x33\x23\x11\x23\xee\x22\xcd\x22\xab\x22\x8a\x22", - 16); - memcpy (buf + 0x0030, - "\x68\x22\x48\x22\x27\x22\x07\x22\xe6\x21\xc7\x21\xa7\x21\x87\x21", - 16); - memcpy (buf + 0x0040, - "\x68\x21\x49\x21\x2a\x21\x0c\x21\xee\x20\xd0\x20\x00\x00\x00\x00", - 16); - memcpy (buf + 0x0050, "\x00\x00\x00\x00", 4); - count = 84; - sanei_usb_write_bulk (fd, buf, &count); - cp2155_set (fd, 0x71, 0x01); - cp2155_set (fd, 0x0230, 0x11); - cp2155_set (fd, 0x71, 0x14); - cp2155_set (fd, 0x72, 0x00); - cp2155_set (fd, 0x73, 0x50); - cp2155_set (fd, 0x74, 0x03); - cp2155_set (fd, 0x75, 0x02); - cp2155_set (fd, 0x76, 0x00); - cp2155_set (fd, 0x0239, 0x40); - cp2155_set (fd, 0x0238, 0x89); - cp2155_set (fd, 0x023c, 0x2f); - cp2155_set (fd, 0x0264, 0x20); - memcpy (buf + 0x0000, - "\x04\x70\x50\x00\x80\x25\x58\x25\x32\x25\x0b\x25\xe5\x24\xc0\x24", - 16); - memcpy (buf + 0x0010, - "\x9a\x24\x75\x24\x50\x24\x2b\x24\x07\x24\xe3\x23\xbf\x23\x9c\x23", - 16); - memcpy (buf + 0x0020, - "\x79\x23\x56\x23\x33\x23\x11\x23\xee\x22\xcd\x22\xab\x22\x8a\x22", - 16); - memcpy (buf + 0x0030, - "\x68\x22\x48\x22\x27\x22\x07\x22\xe6\x21\xc7\x21\xa7\x21\x87\x21", - 16); - memcpy (buf + 0x0040, - "\x68\x21\x49\x21\x2a\x21\x0c\x21\xee\x20\xd0\x20\x00\x00\x00\x00", - 16); - memcpy (buf + 0x0050, "\x00\x00\x00\x00", 4); - count = 84; - sanei_usb_write_bulk (fd, buf, &count); - cp2155_set (fd, 0x71, 0x01); - cp2155_set (fd, 0x0230, 0x11); - cp2155_set (fd, 0x71, 0x14); - cp2155_set (fd, 0x72, 0x00); - cp2155_set (fd, 0x73, 0x20); - cp2155_set (fd, 0x74, 0x03); - cp2155_set (fd, 0x75, 0x04); - cp2155_set (fd, 0x76, 0x00); - cp2155_set (fd, 0x0239, 0x40); - cp2155_set (fd, 0x0238, 0x89); - cp2155_set (fd, 0x023c, 0x2f); - cp2155_set (fd, 0x0264, 0x20); - memcpy (buf + 0x0000, - "\x04\x70\x20\x00\x80\x25\x04\x25\x8c\x24\x18\x24\xa5\x23\x36\x23", - 16); - memcpy (buf + 0x0010, - "\xca\x22\x60\x22\xf8\x21\x93\x21\x30\x21\xd0\x20\x00\x00\x00\x00", - 16); - memcpy (buf + 0x0020, "\x00\x00\x00\x00", 4); - count = 36; - sanei_usb_write_bulk (fd, buf, &count); - cp2155_set (fd, 0x71, 0x01); - cp2155_set (fd, 0x0230, 0x11); - cp2155_set (fd, 0x71, 0x14); - cp2155_set (fd, 0x72, 0x00); - cp2155_set (fd, 0x73, 0x50); - cp2155_set (fd, 0x74, 0x03); - cp2155_set (fd, 0x75, 0x06); - cp2155_set (fd, 0x76, 0x00); - cp2155_set (fd, 0x0239, 0x40); - cp2155_set (fd, 0x0238, 0x89); - cp2155_set (fd, 0x023c, 0x2f); - cp2155_set (fd, 0x0264, 0x20); + memcpy (buf + 0x0000, "\x04\x70\x50\x00\x80\x25\x58\x25\x32\x25\x0b\x25\xe5\x24\xc0\x24", 16); @@ -1889,19 +1135,10 @@ startblob0600 (CANON_Handle * chndl, unsigned char *buf) 16); memcpy (buf + 0x0050, "\x00\x00\x00\x00", 4); count = 84; - sanei_usb_write_bulk (fd, buf, &count); - cp2155_set (fd, 0x71, 0x01); - cp2155_set (fd, 0x0230, 0x11); - cp2155_set (fd, 0x71, 0x14); - cp2155_set (fd, 0x72, 0x00); - cp2155_set (fd, 0x73, 0x20); - cp2155_set (fd, 0x74, 0x03); - cp2155_set (fd, 0x75, 0x08); - cp2155_set (fd, 0x76, 0x00); - cp2155_set (fd, 0x0239, 0x40); - cp2155_set (fd, 0x0238, 0x89); - cp2155_set (fd, 0x023c, 0x2f); - cp2155_set (fd, 0x0264, 0x20); + write_buf (fd, count, buf, 0x03, 0x00); + write_buf (fd, count, buf, 0x03, 0x02); + write_buf (fd, count, buf, 0x03, 0x06); + memcpy (buf + 0x0000, "\x04\x70\x20\x00\x80\x25\x04\x25\x8c\x24\x18\x24\xa5\x23\x36\x23", 16); @@ -1910,35 +1147,22 @@ startblob0600 (CANON_Handle * chndl, unsigned char *buf) 16); memcpy (buf + 0x0020, "\x00\x00\x00\x00", 4); count = 36; - sanei_usb_write_bulk (fd, buf, &count); - cp2155_set (fd, 0x9b, 0x00); - cp2155_set (fd, 0x10, 0x05); - cp2155_set (fd, 0x11, 0xd1); - cp2155_set (fd, 0x60, 0x15); - cp2155_set (fd, 0x80, 0x12); - cp2155_set (fd, 0x03, 0x01); - cp2155_set (fd, 0x71, 0x01); - cp2155_set (fd, 0x0230, 0x11); - cp2155_set (fd, 0x71, 0x18); - cp2155_set (fd, 0x72, 0x00); - cp2155_set (fd, 0x73, 0x10); - cp2155_set (fd, 0x0239, 0x40); - cp2155_set (fd, 0x0238, 0x89); - cp2155_set (fd, 0x023c, 0x2f); - cp2155_set (fd, 0x0264, 0x20); + write_buf (fd, count, buf, 0x03, 0x04); + write_buf (fd, count, buf, 0x03, 0x08); + general_motor_2225 (fd); } void -startblob1200 (CANON_Handle * chndl, unsigned char *buf) +startblob_2225_0600_extra (CANON_Handle * chndl, unsigned char *buf) { int fd; fd = chndl->fd; size_t count; - cp2155_set (fd, 0x90, 0xc8); - cp2155_set (fd, 0x90, 0xe8); + cp2155_set (fd, 0x90, 0xd8); + cp2155_set (fd, 0x90, 0xd8); cp2155_set (fd, 0xb0, 0x00); cp2155_set (fd, 0x07, 0x00); cp2155_set (fd, 0x07, 0x00); @@ -1948,12 +1172,12 @@ startblob1200 (CANON_Handle * chndl, unsigned char *buf) cp2155_set (fd, 0x0b, chndl->value_0b); cp2155_set (fd, 0xa0, 0x1d); cp2155_set (fd, 0xa1, 0x00); - cp2155_set (fd, 0xa2, 0x63); - cp2155_set (fd, 0xa3, 0xd0); + cp2155_set (fd, 0xa2, 0x31); + cp2155_set (fd, 0xa3, 0xf0); cp2155_set (fd, 0x64, 0x00); cp2155_set (fd, 0x65, 0x00); cp2155_set (fd, 0x61, 0x00); - cp2155_set (fd, 0x62, 0xaa); + cp2155_set (fd, 0x62, 0x55); cp2155_set (fd, 0x63, 0x00); cp2155_set (fd, 0x50, 0x04); cp2155_set (fd, 0x50, 0x04); @@ -1962,12 +1186,12 @@ startblob1200 (CANON_Handle * chndl, unsigned char *buf) cp2155_set (fd, 0x5b, 0x32); cp2155_set (fd, 0x5c, 0x32); cp2155_set (fd, 0x5d, 0x32); - cp2155_set (fd, 0x52, 0x11); - cp2155_set (fd, 0x53, 0x50); - cp2155_set (fd, 0x54, 0x0c); - cp2155_set (fd, 0x55, 0x01); - cp2155_set (fd, 0x56, 0x0a); - cp2155_set (fd, 0x57, 0xae); + cp2155_set (fd, 0x52, 0x09); + cp2155_set (fd, 0x53, 0x5a); + cp2155_set (fd, 0x54, 0x06); + cp2155_set (fd, 0x55, 0x08); + cp2155_set (fd, 0x56, 0x05); + cp2155_set (fd, 0x57, 0x5f); cp2155_set (fd, 0x58, 0xa9); cp2155_set (fd, 0x59, 0xce); cp2155_set (fd, 0x5e, 0x02); @@ -1989,49 +1213,7 @@ startblob1200 (CANON_Handle * chndl, unsigned char *buf) cp2155_set (fd, 0x80, 0x12); cp2155_set (fd, 0xb0, 0x08); - cp2155_set (fd, 0x71, 0x01); - cp2155_set (fd, 0x0230, 0x11); - cp2155_set (fd, 0x71, 0x14); - cp2155_set (fd, 0x72, 0xa1); - cp2155_set (fd, 0x73, 0xa0); - cp2155_set (fd, 0x74, 0x00); - cp2155_set (fd, 0x75, 0x00); - cp2155_set (fd, 0x76, 0x00); - cp2155_set (fd, 0x0239, 0x40); - cp2155_set (fd, 0x0238, 0x89); - cp2155_set (fd, 0x023c, 0x2f); - cp2155_set (fd, 0x0264, 0x20); - count = 41380; - make_buf (count, buf); - sanei_usb_write_bulk (fd, buf, &count); - - cp2155_set (fd, 0x71, 0x01); - cp2155_set (fd, 0x0230, 0x11); - cp2155_set (fd, 0x71, 0x14); - cp2155_set (fd, 0x72, 0xa1); - cp2155_set (fd, 0x73, 0xa0); - cp2155_set (fd, 0x74, 0x00); - cp2155_set (fd, 0x75, 0xb0); - cp2155_set (fd, 0x76, 0x00); - cp2155_set (fd, 0x0239, 0x40); - cp2155_set (fd, 0x0238, 0x89); - cp2155_set (fd, 0x023c, 0x2f); - cp2155_set (fd, 0x0264, 0x20); - sanei_usb_write_bulk (fd, buf, &count); - - cp2155_set (fd, 0x71, 0x01); - cp2155_set (fd, 0x0230, 0x11); - cp2155_set (fd, 0x71, 0x14); - cp2155_set (fd, 0x72, 0xa1); - cp2155_set (fd, 0x73, 0xa0); - cp2155_set (fd, 0x74, 0x01); - cp2155_set (fd, 0x75, 0x60); - cp2155_set (fd, 0x76, 0x00); - cp2155_set (fd, 0x0239, 0x40); - cp2155_set (fd, 0x0238, 0x89); - cp2155_set (fd, 0x023c, 0x2f); - cp2155_set (fd, 0x0264, 0x20); - sanei_usb_write_bulk (fd, buf, &count); + big_write (fd, 0x5174, buf); cp2155_set (fd, 0x10, 0x05); cp2155_set (fd, 0x10, 0x05); @@ -2054,8 +1236,8 @@ startblob1200 (CANON_Handle * chndl, unsigned char *buf) cp2155_set (fd, 0x1e, 0x00); cp2155_set (fd, 0x1f, 0x04); cp2155_set (fd, 0x66, 0x00); - cp2155_set (fd, 0x67, chndl->value_67); - cp2155_set (fd, 0x68, chndl->value_68); + cp2155_set (fd, 0x67, 0x0f); + cp2155_set (fd, 0x68, 0x39); cp2155_set (fd, 0x1a, 0x00); cp2155_set (fd, 0x1b, 0x00); cp2155_set (fd, 0x1c, 0x02); @@ -2069,26 +1251,174 @@ startblob1200 (CANON_Handle * chndl, unsigned char *buf) cp2155_set (fd, 0x33, 0x14); cp2155_set (fd, 0x24, 0x14); cp2155_set (fd, 0x34, 0x14); - cp2155_set (fd, 0x25, 0x12); - cp2155_set (fd, 0x35, 0x12); - cp2155_set (fd, 0x26, 0x11); - cp2155_set (fd, 0x36, 0x11); - cp2155_set (fd, 0x27, 0x0e); - cp2155_set (fd, 0x37, 0x0e); - cp2155_set (fd, 0x28, 0x0b); - cp2155_set (fd, 0x38, 0x0b); - cp2155_set (fd, 0x29, 0x08); - cp2155_set (fd, 0x39, 0x08); - cp2155_set (fd, 0x2a, 0x04); - cp2155_set (fd, 0x3a, 0x04); - cp2155_set (fd, 0x2b, 0x00); - cp2155_set (fd, 0x3b, 0x00); - cp2155_set (fd, 0x2c, 0x04); - cp2155_set (fd, 0x3c, 0x04); - cp2155_set (fd, 0x2d, 0x08); - cp2155_set (fd, 0x3d, 0x08); - cp2155_set (fd, 0x2e, 0x0b); - cp2155_set (fd, 0x3e, 0x0b); + cp2155_set (fd, 0x25, 0x14); + cp2155_set (fd, 0x35, 0x14); + cp2155_set (fd, 0x26, 0x14); + cp2155_set (fd, 0x36, 0x14); + cp2155_set (fd, 0x27, 0x14); + cp2155_set (fd, 0x37, 0x14); + cp2155_set (fd, 0x28, 0x14); + cp2155_set (fd, 0x38, 0x14); + cp2155_set (fd, 0x29, 0x14); + cp2155_set (fd, 0x39, 0x14); + cp2155_set (fd, 0x2a, 0x14); + cp2155_set (fd, 0x3a, 0x14); + cp2155_set (fd, 0x2b, 0x14); + cp2155_set (fd, 0x3b, 0x14); + cp2155_set (fd, 0x2c, 0x14); + cp2155_set (fd, 0x3c, 0x14); + cp2155_set (fd, 0x2d, 0x14); + cp2155_set (fd, 0x3d, 0x14); + cp2155_set (fd, 0x2e, 0x14); + cp2155_set (fd, 0x3e, 0x14); + cp2155_set (fd, 0x2f, 0x14); + cp2155_set (fd, 0x3f, 0x14); + cp2155_set (fd, 0x30, 0x14); + cp2155_set (fd, 0x40, 0x14); + cp2155_set (fd, 0x31, 0x14); + cp2155_set (fd, 0x41, 0x14); + cp2155_set (fd, 0x32, 0x14); + cp2155_set (fd, 0x42, 0x14); + cp2155_set (fd, 0xca, 0x00); + cp2155_set (fd, 0xca, 0x00); + cp2155_set (fd, 0xca, 0x00); + cp2155_set (fd, 0x18, 0x00); + + memcpy (buf + 0x00000000, + "\x04\x70\x18\x00\x80\x7f\x80\x7f\x80\x7f\x80\x7f\x80\x7f\x80\x7f", + 16); + memcpy (buf + 0x00000010, + "\x80\x7f\x80\x7f\x80\x7f\x80\x7f\x80\x7f\x80\x7f\x00\x00\x00\x00", + 16); + memcpy (buf + 0x00000020, "\x00\x00\x00\x00", 4); + count = 36; + write_buf (fd, count, buf, 0x03, 0x00); + write_buf (fd, count, buf, 0x03, 0x02); + write_buf (fd, count, buf, 0x03, 0x06); + write_buf (fd, count, buf, 0x03, 0x04); + write_buf (fd, count, buf, 0x03, 0x08); + + general_motor_2225 (fd); +} + +void +startblob_2225_1200 (CANON_Handle * chndl, unsigned char *buf) +{ + + int fd; + fd = chndl->fd; + size_t count; + + cp2155_set (fd, 0x90, 0xc8); + cp2155_set (fd, 0x90, 0xe8); + cp2155_set (fd, 0xb0, 0x00); + cp2155_set (fd, 0x07, 0x00); + cp2155_set (fd, 0x07, 0x00); + cp2155_set (fd, 0x08, chndl->value_08); + cp2155_set (fd, 0x09, chndl->value_09); + cp2155_set (fd, 0x0a, chndl->value_0a); + cp2155_set (fd, 0x0b, chndl->value_0b); + cp2155_set (fd, 0xa0, 0x1d); + cp2155_set (fd, 0xa1, 0x00); + cp2155_set (fd, 0xa2, 0x63); + cp2155_set (fd, 0xa3, 0xd0); + cp2155_set (fd, 0x64, 0x00); + cp2155_set (fd, 0x65, 0x00); + cp2155_set (fd, 0x61, 0x00); + cp2155_set (fd, 0x62, 0xaa); + cp2155_set (fd, 0x63, 0x00); + cp2155_set (fd, 0x50, 0x04); + cp2155_set (fd, 0x50, 0x04); + cp2155_set (fd, 0x51, chndl->value_51); + cp2155_set (fd, 0x5a, 0x32); + cp2155_set (fd, 0x5b, 0x32); + cp2155_set (fd, 0x5c, 0x32); + cp2155_set (fd, 0x5d, 0x32); + cp2155_set (fd, 0x52, 0x11); + cp2155_set (fd, 0x53, 0x50); + cp2155_set (fd, 0x54, 0x0c); + cp2155_set (fd, 0x55, 0x01); + cp2155_set (fd, 0x56, 0x0a); + cp2155_set (fd, 0x57, 0xae); + cp2155_set (fd, 0x58, 0xa9); + cp2155_set (fd, 0x59, 0xce); + cp2155_set (fd, 0x5e, 0x02); + cp2155_set (fd, 0x5f, 0x00); + cp2155_set (fd, 0x5f, 0x03); + cp2155_set (fd, 0x60, 0x15); + cp2155_set (fd, 0x60, 0x15); + cp2155_set (fd, 0x60, 0x15); + cp2155_set (fd, 0x60, 0x15); + cp2155_set (fd, 0x50, 0x04); + cp2155_set (fd, 0x51, chndl->value_51); + cp2155_set (fd, 0x81, 0x29); + cp2155_set (fd, 0x81, 0x29); + cp2155_set (fd, 0x82, 0x09); + cp2155_set (fd, 0x82, 0x09); + cp2155_set (fd, 0x83, 0x02); + cp2155_set (fd, 0x84, 0x06); + cp2155_set (fd, 0x80, 0x12); + cp2155_set (fd, 0x80, 0x12); + cp2155_set (fd, 0xb0, 0x08); + + big_write (fd, 0xa1a4, buf); + + cp2155_set (fd, 0x10, 0x05); + cp2155_set (fd, 0x10, 0x05); + cp2155_set (fd, 0x9b, 0x01); + cp2155_set (fd, 0x10, 0x05); + cp2155_set (fd, 0x11, 0x81); + cp2155_set (fd, 0x11, 0x81); + cp2155_set (fd, 0x11, 0x81); + cp2155_set (fd, 0x11, 0x81); + cp2155_set (fd, 0x11, 0x81); + cp2155_set (fd, 0x11, 0x81); + cp2155_set (fd, 0x11, 0x81); + cp2155_set (fd, 0x12, 0x06); + cp2155_set (fd, 0x13, 0x06); + cp2155_set (fd, 0x16, 0x06); + cp2155_set (fd, 0x21, 0x06); + cp2155_set (fd, 0x22, 0x06); + cp2155_set (fd, 0x20, 0x06); + cp2155_set (fd, 0x1d, 0x00); + cp2155_set (fd, 0x1e, 0x00); + cp2155_set (fd, 0x1f, 0x04); + cp2155_set (fd, 0x66, 0x00); + cp2155_set (fd, 0x67, chndl->value_67); + cp2155_set (fd, 0x68, chndl->value_68); + cp2155_set (fd, 0x1a, 0x00); + cp2155_set (fd, 0x1b, 0x00); + cp2155_set (fd, 0x1c, 0x02); + cp2155_set (fd, 0x15, 0x80); + cp2155_set (fd, 0x14, 0x7c); + cp2155_set (fd, 0x17, 0x01); + cp2155_set (fd, 0x43, 0x1c); + cp2155_set (fd, 0x44, 0x9c); + cp2155_set (fd, 0x45, 0x38); + cp2155_set (fd, 0x23, 0x14); + cp2155_set (fd, 0x33, 0x14); + cp2155_set (fd, 0x24, 0x14); + cp2155_set (fd, 0x34, 0x14); + cp2155_set (fd, 0x25, 0x12); + cp2155_set (fd, 0x35, 0x12); + cp2155_set (fd, 0x26, 0x11); + cp2155_set (fd, 0x36, 0x11); + cp2155_set (fd, 0x27, 0x0e); + cp2155_set (fd, 0x37, 0x0e); + cp2155_set (fd, 0x28, 0x0b); + cp2155_set (fd, 0x38, 0x0b); + cp2155_set (fd, 0x29, 0x08); + cp2155_set (fd, 0x39, 0x08); + cp2155_set (fd, 0x2a, 0x04); + cp2155_set (fd, 0x3a, 0x04); + cp2155_set (fd, 0x2b, 0x00); + cp2155_set (fd, 0x3b, 0x00); + cp2155_set (fd, 0x2c, 0x04); + cp2155_set (fd, 0x3c, 0x04); + cp2155_set (fd, 0x2d, 0x08); + cp2155_set (fd, 0x3d, 0x08); + cp2155_set (fd, 0x2e, 0x0b); + cp2155_set (fd, 0x3e, 0x0b); cp2155_set (fd, 0x2f, 0x0e); cp2155_set (fd, 0x3f, 0x0e); cp2155_set (fd, 0x30, 0x11); @@ -2101,60 +1431,7 @@ startblob1200 (CANON_Handle * chndl, unsigned char *buf) cp2155_set (fd, 0xca, 0x00); cp2155_set (fd, 0xca, 0x00); cp2155_set (fd, 0x18, 0x01); - cp2155_set (fd, 0x71, 0x01); - cp2155_set (fd, 0x0230, 0x11); - cp2155_set (fd, 0x71, 0x14); - cp2155_set (fd, 0x72, 0x00); - cp2155_set (fd, 0x73, 0x20); - cp2155_set (fd, 0x74, 0x03); - cp2155_set (fd, 0x75, 0x00); - cp2155_set (fd, 0x76, 0x00); - cp2155_set (fd, 0x0239, 0x40); - cp2155_set (fd, 0x0238, 0x89); - cp2155_set (fd, 0x023c, 0x2f); - cp2155_set (fd, 0x0264, 0x20); - memcpy (buf + 0x00000000, - "\x04\x70\x18\x00\x00\xff\x00\xff\x00\xff\x00\xff\x00\xff\x00\xff", - 16); - memcpy (buf + 0x00000010, - "\x00\xff\x00\xff\x00\xff\x00\xff\x00\xff\x00\xff\x00\x00\x00\x00", - 16); - memcpy (buf + 0x00000020, "\x00\x00\x00\x00", 4); - count = 36; - sanei_usb_write_bulk (fd, buf, &count); - cp2155_set (fd, 0x71, 0x01); - cp2155_set (fd, 0x0230, 0x11); - cp2155_set (fd, 0x71, 0x14); - cp2155_set (fd, 0x72, 0x00); - cp2155_set (fd, 0x73, 0x20); - cp2155_set (fd, 0x74, 0x03); - cp2155_set (fd, 0x75, 0x02); - cp2155_set (fd, 0x76, 0x00); - cp2155_set (fd, 0x0239, 0x40); - cp2155_set (fd, 0x0238, 0x89); - cp2155_set (fd, 0x023c, 0x2f); - cp2155_set (fd, 0x0264, 0x20); - memcpy (buf + 0x00000000, - "\x04\x70\x18\x00\x00\xff\x00\xff\x00\xff\x00\xff\x00\xff\x00\xff", - 16); - memcpy (buf + 0x00000010, - "\x00\xff\x00\xff\x00\xff\x00\xff\x00\xff\x00\xff\x00\x00\x00\x00", - 16); - memcpy (buf + 0x00000020, "\x00\x00\x00\x00", 4); - count = 36; - sanei_usb_write_bulk (fd, buf, &count); - cp2155_set (fd, 0x71, 0x01); - cp2155_set (fd, 0x0230, 0x11); - cp2155_set (fd, 0x71, 0x14); - cp2155_set (fd, 0x72, 0x00); - cp2155_set (fd, 0x73, 0x20); - cp2155_set (fd, 0x74, 0x03); - cp2155_set (fd, 0x75, 0x04); - cp2155_set (fd, 0x76, 0x00); - cp2155_set (fd, 0x0239, 0x40); - cp2155_set (fd, 0x0238, 0x89); - cp2155_set (fd, 0x023c, 0x2f); - cp2155_set (fd, 0x0264, 0x20); + memcpy (buf + 0x00000000, "\x04\x70\x18\x00\x00\xff\x00\xff\x00\xff\x00\xff\x00\xff\x00\xff", 16); @@ -2163,239 +1440,1838 @@ startblob1200 (CANON_Handle * chndl, unsigned char *buf) 16); memcpy (buf + 0x00000020, "\x00\x00\x00\x00", 4); count = 36; - sanei_usb_write_bulk (fd, buf, &count); - cp2155_set (fd, 0x71, 0x01); - cp2155_set (fd, 0x0230, 0x11); - cp2155_set (fd, 0x71, 0x14); - cp2155_set (fd, 0x72, 0x00); - cp2155_set (fd, 0x73, 0x20); - cp2155_set (fd, 0x74, 0x03); - cp2155_set (fd, 0x75, 0x06); - cp2155_set (fd, 0x76, 0x00); - cp2155_set (fd, 0x0239, 0x40); - cp2155_set (fd, 0x0238, 0x89); - cp2155_set (fd, 0x023c, 0x2f); - cp2155_set (fd, 0x0264, 0x20); - memcpy (buf + 0x00000000, - "\x04\x70\x18\x00\x00\xff\x00\xff\x00\xff\x00\xff\x00\xff\x00\xff", + write_buf (fd, count, buf, 0x03, 0x00); + write_buf (fd, count, buf, 0x03, 0x02); + write_buf (fd, count, buf, 0x03, 0x06); + write_buf (fd, count, buf, 0x03, 0x04); + write_buf (fd, count, buf, 0x03, 0x08); + + general_motor_2225 (fd); +} + +void +startblob_2224_0075 (CANON_Handle * chndl, unsigned char *buf) +{ + + int fd; + fd = chndl->fd; + size_t count; + + cp2155_set (fd, 0x90, 0xe8); + cp2155_set (fd, 0x9b, 0x06); + cp2155_set (fd, 0x9b, 0x04); + cp2155_set (fd, 0x90, 0xf8); + cp2155_set (fd, 0xb0, 0x03); + cp2155_set (fd, 0x07, 0x00); + cp2155_set (fd, 0x07, 0x00); + cp2155_set (fd, 0x08, chndl->value_08); + cp2155_set (fd, 0x09, chndl->value_09); + cp2155_set (fd, 0x0a, chndl->value_0a); + cp2155_set (fd, 0x0b, chndl->value_0b); + cp2155_set (fd, 0xa0, 0x1d); + cp2155_set (fd, 0xa1, 0x00); + cp2155_set (fd, 0xa2, 0x06); + cp2155_set (fd, 0xa3, 0x70); + cp2155_set (fd, 0x64, 0x00); + cp2155_set (fd, 0x65, 0x00); + cp2155_set (fd, 0x61, 0x00); + cp2155_set (fd, 0x62, 0x2e); + cp2155_set (fd, 0x63, 0x00); + cp2155_set (fd, 0x50, 0x04); + cp2155_set (fd, 0x50, 0x04); + cp2155_set (fd, 0x90, 0xf8); + cp2155_set (fd, 0x51, chndl->value_51); + cp2155_set (fd, 0x5a, 0xff); + cp2155_set (fd, 0x5b, 0xff); + cp2155_set (fd, 0x5c, 0xff); + cp2155_set (fd, 0x5d, 0xff); + cp2155_set (fd, 0x52, 0x0c); + cp2155_set (fd, 0x53, 0xda); + cp2155_set (fd, 0x54, 0x0c); + cp2155_set (fd, 0x55, 0x44); + cp2155_set (fd, 0x56, 0x08); + cp2155_set (fd, 0x57, 0xbb); + cp2155_set (fd, 0x58, 0x1d); + cp2155_set (fd, 0x59, 0xa1); + cp2155_set (fd, 0x5e, 0x02); + cp2155_set (fd, 0x5f, 0x00); + cp2155_set (fd, 0x5f, 0x03); + cp2155_set (fd, 0x60, 0x01); + cp2155_set (fd, 0x60, 0x01); + cp2155_set (fd, 0x60, 0x01); + cp2155_set (fd, 0x60, 0x01); + cp2155_set (fd, 0x50, 0x04); + cp2155_set (fd, 0x51, chndl->value_51); + cp2155_set (fd, 0x81, 0x31); + cp2155_set (fd, 0x81, 0x31); + cp2155_set (fd, 0x82, 0x11); + cp2155_set (fd, 0x82, 0x11); + cp2155_set (fd, 0x83, 0x01); + cp2155_set (fd, 0x84, 0x05); + cp2155_set (fd, 0x80, 0x12); + cp2155_set (fd, 0x80, 0x12); + cp2155_set (fd, 0xb0, 0x0b); + + big_write (fd, 0x5694, buf); + + cp2155_set (fd, 0x10, 0x05); + cp2155_set (fd, 0x10, 0x05); + cp2155_set (fd, 0x10, 0x05); + cp2155_set (fd, 0x10, 0x05); + cp2155_set (fd, 0x11, 0xc1); + cp2155_set (fd, 0x11, 0xc1); + cp2155_set (fd, 0x11, 0x81); + cp2155_set (fd, 0x11, 0x81); + cp2155_set (fd, 0x11, 0x81); + cp2155_set (fd, 0x11, 0x81); + cp2155_set (fd, 0x11, 0x81); + cp2155_set (fd, 0x12, 0x7d); + cp2155_set (fd, 0x13, 0x7d); + cp2155_set (fd, 0x16, 0x7d); + cp2155_set (fd, 0x21, 0x06); + cp2155_set (fd, 0x22, 0x7d); + cp2155_set (fd, 0x20, 0x06); + cp2155_set (fd, 0x1d, 0x00); + cp2155_set (fd, 0x1e, 0x00); + cp2155_set (fd, 0x1f, 0x71); + cp2155_set (fd, 0x66, 0x00); + cp2155_set (fd, 0x67, chndl->value_67); + cp2155_set (fd, 0x68, chndl->value_68); + cp2155_set (fd, 0x1a, 0x00); + cp2155_set (fd, 0x1b, 0x00); + cp2155_set (fd, 0x1c, 0x02); + cp2155_set (fd, 0x15, 0x83); + cp2155_set (fd, 0x14, 0x7c); + cp2155_set (fd, 0x17, 0x02); + cp2155_set (fd, 0x43, 0x1c); + cp2155_set (fd, 0x44, 0x9c); + cp2155_set (fd, 0x45, 0x38); + cp2155_set (fd, 0x23, 0x0f); + cp2155_set (fd, 0x33, 0x0f); + cp2155_set (fd, 0x24, 0x0f); + cp2155_set (fd, 0x34, 0x0f); + cp2155_set (fd, 0x25, 0x0f); + cp2155_set (fd, 0x35, 0x0f); + cp2155_set (fd, 0x26, 0x0f); + cp2155_set (fd, 0x36, 0x0f); + cp2155_set (fd, 0x27, 0x0f); + cp2155_set (fd, 0x37, 0x0f); + cp2155_set (fd, 0x28, 0x0f); + cp2155_set (fd, 0x38, 0x0f); + cp2155_set (fd, 0x29, 0x0f); + cp2155_set (fd, 0x39, 0x0f); + cp2155_set (fd, 0x2a, 0x0f); + cp2155_set (fd, 0x3a, 0x0f); + cp2155_set (fd, 0x2b, 0x0f); + cp2155_set (fd, 0x3b, 0x0f); + cp2155_set (fd, 0x2c, 0x0f); + cp2155_set (fd, 0x3c, 0x0f); + cp2155_set (fd, 0x2d, 0x0f); + cp2155_set (fd, 0x3d, 0x0f); + cp2155_set (fd, 0x2e, 0x0f); + cp2155_set (fd, 0x3e, 0x0f); + cp2155_set (fd, 0x2f, 0x0f); + cp2155_set (fd, 0x3f, 0x0f); + cp2155_set (fd, 0x30, 0x0f); + cp2155_set (fd, 0x40, 0x0f); + cp2155_set (fd, 0x31, 0x0f); + cp2155_set (fd, 0x41, 0x0f); + cp2155_set (fd, 0x32, 0x0f); + cp2155_set (fd, 0x42, 0x0f); + cp2155_set (fd, 0xca, 0x00); + cp2155_set (fd, 0xca, 0x00); + cp2155_set (fd, 0xca, 0x00); + cp2155_set (fd, 0x18, 0x00); + + memcpy (buf + 0x00000000, + "\x04\x70\xf4\x01\x80\x25\x80\x25\x80\x25\x80\x25\x80\x25\x80\x25", + 16); + memcpy (buf + 0x00000010, + "\x80\x25\x80\x25\x80\x25\x80\x25\x80\x25\x80\x25\x80\x25\x80\x25", + 16); + memcpy (buf + 0x00000020, + "\x80\x25\x80\x25\x80\x25\x80\x25\x80\x25\x80\x25\x80\x25\x80\x25", + 16); + memcpy (buf + 0x00000030, + "\x80\x25\x80\x25\x80\x25\x80\x25\x80\x25\x80\x25\x80\x25\x80\x25", + 16); + memcpy (buf + 0x00000040, + "\x80\x25\x80\x25\x80\x25\x80\x25\x80\x25\x80\x25\x80\x25\x80\x25", + 16); + memcpy (buf + 0x00000050, + "\x80\x25\x80\x25\x80\x25\x80\x25\x80\x25\x80\x25\x80\x25\x80\x25", + 16); + memcpy (buf + 0x00000060, + "\x80\x25\x80\x25\x80\x25\x80\x25\x80\x25\xe1\x24\x47\x24\xb2\x23", + 16); + memcpy (buf + 0x00000070, + "\x22\x23\x97\x22\x0f\x22\x8c\x21\x0d\x21\x91\x20\x19\x20\xa4\x1f", + 16); + memcpy (buf + 0x00000080, + "\x33\x1f\xc5\x1e\x59\x1e\xf1\x1d\x8b\x1d\x29\x1d\xc8\x1c\x6a\x1c", + 16); + memcpy (buf + 0x00000090, + "\x0f\x1c\xb5\x1b\x5e\x1b\x09\x1b\xb6\x1a\x65\x1a\x16\x1a\xc9\x19", + 16); + memcpy (buf + 0x000000a0, + "\x7d\x19\x34\x19\xec\x18\xa5\x18\x60\x18\x1c\x18\xda\x17\x9a\x17", + 16); + memcpy (buf + 0x000000b0, + "\x5a\x17\x1c\x17\xe0\x16\xa4\x16\x6a\x16\x31\x16\xf9\x15\xc2\x15", + 16); + memcpy (buf + 0x000000c0, + "\x8c\x15\x57\x15\x23\x15\xf1\x14\xbf\x14\x8e\x14\x5e\x14\x2e\x14", + 16); + memcpy (buf + 0x000000d0, + "\x00\x14\xd2\x13\xa6\x13\x7a\x13\x4f\x13\x24\x13\xfa\x12\xd1\x12", + 16); + memcpy (buf + 0x000000e0, + "\xa9\x12\x81\x12\x5a\x12\x34\x12\x0e\x12\xe9\x11\xc5\x11\xa1\x11", + 16); + memcpy (buf + 0x000000f0, + "\x7d\x11\x5a\x11\x38\x11\x16\x11\xf5\x10\xd4\x10\xb4\x10\x94\x10", + 16); + memcpy (buf + 0x00000100, + "\x75\x10\x56\x10\x37\x10\x19\x10\xfc\x0f\xdf\x0f\xc2\x0f\xa6\x0f", + 16); + memcpy (buf + 0x00000110, + "\x8a\x0f\x6e\x0f\x53\x0f\x38\x0f\x1e\x0f\x04\x0f\xea\x0e\xd1\x0e", + 16); + memcpy (buf + 0x00000120, + "\xb8\x0e\x9f\x0e\x86\x0e\x6e\x0e\x57\x0e\x3f\x0e\x28\x0e\x11\x0e", + 16); + memcpy (buf + 0x00000130, + "\xfa\x0d\xe4\x0d\xce\x0d\xb8\x0d\xa3\x0d\x8e\x0d\x79\x0d\x64\x0d", + 16); + memcpy (buf + 0x00000140, + "\x4f\x0d\x3b\x0d\x27\x0d\x14\x0d\x00\x0d\xed\x0c\xda\x0c\xc7\x0c", + 16); + memcpy (buf + 0x00000150, + "\xb4\x0c\xa2\x0c\x8f\x0c\x7d\x0c\x6c\x0c\x5a\x0c\x49\x0c\x37\x0c", + 16); + memcpy (buf + 0x00000160, + "\x26\x0c\x15\x0c\x05\x0c\xf4\x0b\xe4\x0b\xd4\x0b\xc4\x0b\xb4\x0b", + 16); + memcpy (buf + 0x00000170, + "\xa4\x0b\x95\x0b\x85\x0b\x76\x0b\x67\x0b\x58\x0b\x4a\x0b\x3b\x0b", + 16); + memcpy (buf + 0x00000180, + "\x2d\x0b\x1e\x0b\x10\x0b\x02\x0b\xf4\x0a\xe7\x0a\xd9\x0a\xcc\x0a", + 16); + memcpy (buf + 0x00000190, + "\xbe\x0a\xb1\x0a\xa4\x0a\x97\x0a\x8a\x0a\x7e\x0a\x71\x0a\x65\x0a", + 16); + memcpy (buf + 0x000001a0, + "\x58\x0a\x4c\x0a\x40\x0a\x34\x0a\x28\x0a\x1c\x0a\x10\x0a\x05\x0a", + 16); + memcpy (buf + 0x000001b0, + "\xf9\x09\xee\x09\xe3\x09\xd8\x09\xcc\x09\xc1\x09\xb7\x09\xac\x09", + 16); + memcpy (buf + 0x000001c0, + "\xa1\x09\x96\x09\x8c\x09\x82\x09\x77\x09\x6d\x09\x63\x09\x59\x09", + 16); + memcpy (buf + 0x000001d0, + "\x4f\x09\x45\x09\x3b\x09\x31\x09\x28\x09\x1e\x09\x14\x09\x0b\x09", + 16); + memcpy (buf + 0x000001e0, + "\x02\x09\xf8\x08\xef\x08\xe6\x08\xdd\x08\xd4\x08\xcb\x08\xc2\x08", + 16); + memcpy (buf + 0x000001f0, + "\xb9\x08\xb1\x08\xa8\x08\xa0\x08\x00\x00\x00\x00\x00\x00\x00\x00", + 16); + memcpy (buf + 0x00000200, "\x00\x00\x00\x00", 4); + count = 516; + write_buf (fd, count, buf, 0x03, 0x00); + write_buf (fd, count, buf, 0x03, 0x02); + write_buf (fd, count, buf, 0x03, 0x06); + + memcpy (buf + 0x00000000, + "\x04\x70\x18\x00\x80\x25\xc0\x1c\x4f\x17\x9a\x13\xe9\x10\xde\x0e", + 16); + memcpy (buf + 0x00000010, + "\x44\x0d\xfa\x0b\xea\x0a\x07\x0a\x46\x09\xa0\x08\x80\x25\x80\x25", + 16); + memcpy (buf + 0x00000020, "\x80\x25\x80\x25", 4); + count = 36; + write_buf (fd, count, buf, 0x03, 0x04); + write_buf (fd, count, buf, 0x03, 0x08); + + general_motor_2224 (fd); + +} + +void +startblob_2224_0150 (CANON_Handle * chndl, unsigned char *buf) +{ + + int fd; + fd = chndl->fd; + size_t count; + + cp2155_set (fd, 0x90, 0xe8); + cp2155_set (fd, 0x9b, 0x06); + cp2155_set (fd, 0x9b, 0x04); + cp2155_set (fd, 0x90, 0xf8); + cp2155_set (fd, 0xb0, 0x02); + cp2155_set (fd, 0x07, 0x00); + cp2155_set (fd, 0x07, 0x00); + cp2155_set (fd, 0x08, chndl->value_08); + cp2155_set (fd, 0x09, chndl->value_09); + cp2155_set (fd, 0x0a, chndl->value_0a); + cp2155_set (fd, 0x0b, chndl->value_0b); + cp2155_set (fd, 0xa0, 0x1d); + cp2155_set (fd, 0xa1, 0x00); + cp2155_set (fd, 0xa2, 0x0c); + cp2155_set (fd, 0xa3, 0xd0); + cp2155_set (fd, 0x64, 0x00); + cp2155_set (fd, 0x65, 0x00); + cp2155_set (fd, 0x61, 0x00); + cp2155_set (fd, 0x62, 0x1e); + cp2155_set (fd, 0x63, 0xa0); + cp2155_set (fd, 0x50, 0x04); + cp2155_set (fd, 0x50, 0x04); + cp2155_set (fd, 0x90, 0xf8); + cp2155_set (fd, 0x51, chndl->value_51); + cp2155_set (fd, 0x5a, 0xff); + cp2155_set (fd, 0x5b, 0xff); + cp2155_set (fd, 0x5c, 0xff); + cp2155_set (fd, 0x5d, 0xff); + cp2155_set (fd, 0x52, 0x0c); + cp2155_set (fd, 0x53, 0xda); + cp2155_set (fd, 0x54, 0x0c); + cp2155_set (fd, 0x55, 0x44); + cp2155_set (fd, 0x56, 0x08); + cp2155_set (fd, 0x57, 0xbb); + cp2155_set (fd, 0x58, 0x1d); + cp2155_set (fd, 0x59, 0xa1); + cp2155_set (fd, 0x5e, 0x02); + cp2155_set (fd, 0x5f, 0x00); + cp2155_set (fd, 0x5f, 0x03); + cp2155_set (fd, 0x60, 0x01); + cp2155_set (fd, 0x60, 0x01); + cp2155_set (fd, 0x60, 0x01); + cp2155_set (fd, 0x60, 0x01); + cp2155_set (fd, 0x50, 0x04); + cp2155_set (fd, 0x51, chndl->value_51); + cp2155_set (fd, 0x81, 0x31); + cp2155_set (fd, 0x81, 0x31); + cp2155_set (fd, 0x82, 0x11); + cp2155_set (fd, 0x82, 0x11); + cp2155_set (fd, 0x83, 0x01); + cp2155_set (fd, 0x84, 0x05); + cp2155_set (fd, 0x80, 0x12); + cp2155_set (fd, 0x80, 0x12); + cp2155_set (fd, 0xb0, 0x0a); + + big_write (fd, 0x5694, buf); + + cp2155_set (fd, 0x10, 0x05); + cp2155_set (fd, 0x10, 0x05); + cp2155_set (fd, 0x10, 0x05); + cp2155_set (fd, 0x10, 0x05); + cp2155_set (fd, 0x11, 0x81); + cp2155_set (fd, 0x11, 0x81); + cp2155_set (fd, 0x11, 0x81); + cp2155_set (fd, 0x11, 0x81); + cp2155_set (fd, 0x11, 0x81); + cp2155_set (fd, 0x11, 0x81); + cp2155_set (fd, 0x11, 0x81); + cp2155_set (fd, 0x12, 0x40); + cp2155_set (fd, 0x13, 0x40); + cp2155_set (fd, 0x16, 0x40); + cp2155_set (fd, 0x21, 0x06); + cp2155_set (fd, 0x22, 0x40); + cp2155_set (fd, 0x20, 0x06); + cp2155_set (fd, 0x1d, 0x00); + cp2155_set (fd, 0x1e, 0x00); + cp2155_set (fd, 0x1f, 0x04); + cp2155_set (fd, 0x66, 0x00); + cp2155_set (fd, 0x67, chndl->value_67); + cp2155_set (fd, 0x68, chndl->value_68); + cp2155_set (fd, 0x1a, 0x00); + cp2155_set (fd, 0x1b, 0x00); + cp2155_set (fd, 0x1c, 0x02); + cp2155_set (fd, 0x15, 0x84); + cp2155_set (fd, 0x14, 0x7c); + cp2155_set (fd, 0x17, 0x02); + cp2155_set (fd, 0x43, 0x1c); + cp2155_set (fd, 0x44, 0x9c); + cp2155_set (fd, 0x45, 0x38); + cp2155_set (fd, 0x23, 0x0d); + cp2155_set (fd, 0x33, 0x0d); + cp2155_set (fd, 0x24, 0x0d); + cp2155_set (fd, 0x34, 0x0d); + cp2155_set (fd, 0x25, 0x0d); + cp2155_set (fd, 0x35, 0x0d); + cp2155_set (fd, 0x26, 0x0d); + cp2155_set (fd, 0x36, 0x0d); + cp2155_set (fd, 0x27, 0x0d); + cp2155_set (fd, 0x37, 0x0d); + cp2155_set (fd, 0x28, 0x0d); + cp2155_set (fd, 0x38, 0x0d); + cp2155_set (fd, 0x29, 0x0d); + cp2155_set (fd, 0x39, 0x0d); + cp2155_set (fd, 0x2a, 0x0d); + cp2155_set (fd, 0x3a, 0x0d); + cp2155_set (fd, 0x2b, 0x0d); + cp2155_set (fd, 0x3b, 0x0d); + cp2155_set (fd, 0x2c, 0x0d); + cp2155_set (fd, 0x3c, 0x0d); + cp2155_set (fd, 0x2d, 0x0d); + cp2155_set (fd, 0x3d, 0x0d); + cp2155_set (fd, 0x2e, 0x0d); + cp2155_set (fd, 0x3e, 0x0d); + cp2155_set (fd, 0x2f, 0x0d); + cp2155_set (fd, 0x3f, 0x0d); + cp2155_set (fd, 0x30, 0x0d); + cp2155_set (fd, 0x40, 0x0d); + cp2155_set (fd, 0x31, 0x0d); + cp2155_set (fd, 0x41, 0x0d); + cp2155_set (fd, 0x32, 0x0d); + cp2155_set (fd, 0x42, 0x0d); + cp2155_set (fd, 0xca, 0x00); + cp2155_set (fd, 0xca, 0x00); + cp2155_set (fd, 0xca, 0x00); + cp2155_set (fd, 0x18, 0x00); + + memcpy (buf + 0x00000000, + "\x04\x70\x00\x01\x80\x25\x80\x25\x80\x25\x80\x25\x80\x25\x80\x25", + 16); + memcpy (buf + 0x00000010, + "\x80\x25\x80\x25\x80\x25\x80\x25\x80\x25\x80\x25\x80\x25\x80\x25", + 16); + memcpy (buf + 0x00000020, + "\x80\x25\x80\x25\x80\x25\x80\x25\x80\x25\x80\x25\x80\x25\x80\x25", + 16); + memcpy (buf + 0x00000030, + "\x80\x25\x80\x25\x80\x25\x80\x25\x80\x25\x80\x25\x80\x25\x80\x25", + 16); + memcpy (buf + 0x00000040, + "\x80\x25\x80\x25\x80\x25\x80\x25\x80\x25\x80\x25\x80\x25\x80\x25", + 16); + memcpy (buf + 0x00000050, + "\x80\x25\x80\x25\x80\x25\x80\x25\x80\x25\x80\x25\x80\x25\x80\x25", + 16); + memcpy (buf + 0x00000060, + "\x80\x25\x80\x25\x80\x25\x80\x25\x80\x25\x80\x25\x80\x25\x80\x25", + 16); + memcpy (buf + 0x00000070, + "\x80\x25\x80\x25\x80\x25\x80\x25\x80\x25\x80\x25\x80\x25\x80\x25", + 16); + memcpy (buf + 0x00000080, + "\x80\x25\x80\x25\x80\x25\x32\x24\xfb\x22\xd9\x21\xc8\x20\xc9\x1f", + 16); + memcpy (buf + 0x00000090, + "\xd8\x1e\xf5\x1d\x1f\x1d\x54\x1c\x95\x1b\xdf\x1a\x32\x1a\x8d\x19", + 16); + memcpy (buf + 0x000000a0, + "\xf1\x18\x5c\x18\xce\x17\x46\x17\xc3\x16\x47\x16\xd0\x15\x5d\x15", + 16); + memcpy (buf + 0x000000b0, + "\xef\x14\x86\x14\x21\x14\xbf\x13\x61\x13\x07\x13\xaf\x12\x5b\x12", + 16); + memcpy (buf + 0x000000c0, + "\x0a\x12\xbb\x11\x6f\x11\x26\x11\xdf\x10\x9a\x10\x57\x10\x17\x10", + 16); + memcpy (buf + 0x000000d0, + "\xd8\x0f\x9c\x0f\x61\x0f\x27\x0f\xf0\x0e\xba\x0e\x85\x0e\x52\x0e", + 16); + memcpy (buf + 0x000000e0, + "\x21\x0e\xf0\x0d\xc1\x0d\x93\x0d\x67\x0d\x3b\x0d\x11\x0d\xe7\x0c", + 16); + memcpy (buf + 0x000000f0, + "\xbf\x0c\x98\x0c\x71\x0c\x4b\x0c\x27\x0c\x03\x0c\xe0\x0b\xbe\x0b", + 16); + memcpy (buf + 0x00000100, "\x9c\x0b\x7c\x0b", 4); + count = 260; + write_buf (fd, count, buf, 0x03, 0x00); + write_buf (fd, count, buf, 0x03, 0x02); + write_buf (fd, count, buf, 0x03, 0x06); + + memcpy (buf + 0x00000000, + "\x04\x70\x18\x00\x80\x25\x18\x1f\x8f\x1a\x2d\x17\x8f\x14\x79\x12", + 16); + memcpy (buf + 0x00000010, + "\xc6\x10\x5b\x0f\x2a\x0e\x24\x0d\x41\x0c\x7c\x0b\x80\x25\x80\x25", + 16); + memcpy (buf + 0x00000020, "\x80\x25\x80\x25", 4); + count = 36; + write_buf (fd, count, buf, 0x03, 0x04); + write_buf (fd, count, buf, 0x03, 0x08); + + general_motor_2224 (fd); + +} + +void +startblob_2224_0300 (CANON_Handle * chndl, unsigned char *buf) +{ + + int fd; + fd = chndl->fd; + size_t count; + + cp2155_set (fd, 0x90, 0xe8); + cp2155_set (fd, 0x9b, 0x06); + cp2155_set (fd, 0x9b, 0x04); + cp2155_set (fd, 0x90, 0xf8); + cp2155_set (fd, 0xb0, 0x01); + cp2155_set (fd, 0x07, 0x00); + cp2155_set (fd, 0x07, 0x00); + cp2155_set (fd, 0x08, chndl->value_08); + cp2155_set (fd, 0x09, chndl->value_09); + cp2155_set (fd, 0x0a, chndl->value_0a); + cp2155_set (fd, 0x0b, chndl->value_0b); + cp2155_set (fd, 0xa0, 0x1d); + cp2155_set (fd, 0xa1, 0x00); + cp2155_set (fd, 0xa2, 0x03); + cp2155_set (fd, 0xa3, 0x10); + cp2155_set (fd, 0x64, 0x00); + cp2155_set (fd, 0x65, 0x00); + cp2155_set (fd, 0x61, 0x00); + cp2155_set (fd, 0x62, 0x15); + cp2155_set (fd, 0x63, 0xe0); + cp2155_set (fd, 0x50, 0x04); + cp2155_set (fd, 0x50, 0x04); + cp2155_set (fd, 0x90, 0xf8); + cp2155_set (fd, 0x51, chndl->value_51); + cp2155_set (fd, 0x5a, 0xff); + cp2155_set (fd, 0x5b, 0xff); + cp2155_set (fd, 0x5c, 0xff); + cp2155_set (fd, 0x5d, 0xff); + cp2155_set (fd, 0x52, 0x0a); + cp2155_set (fd, 0x53, 0xf0); + cp2155_set (fd, 0x54, 0x0a); + cp2155_set (fd, 0x55, 0xf0); + cp2155_set (fd, 0x56, 0x0a); + cp2155_set (fd, 0x57, 0xf0); + cp2155_set (fd, 0x58, 0x00); + cp2155_set (fd, 0x59, 0x01); + cp2155_set (fd, 0x5e, 0x02); + cp2155_set (fd, 0x5f, 0x00); + cp2155_set (fd, 0x5f, 0x03); + cp2155_set (fd, 0x60, 0x01); + cp2155_set (fd, 0x60, 0x01); + cp2155_set (fd, 0x60, 0x01); + cp2155_set (fd, 0x60, 0x01); + cp2155_set (fd, 0x50, 0x04); + cp2155_set (fd, 0x51, chndl->value_51); + cp2155_set (fd, 0x81, 0x31); + cp2155_set (fd, 0x81, 0x31); + cp2155_set (fd, 0x82, 0x11); + cp2155_set (fd, 0x82, 0x11); + cp2155_set (fd, 0x83, 0x01); + cp2155_set (fd, 0x84, 0x05); + cp2155_set (fd, 0x80, 0x12); + cp2155_set (fd, 0x80, 0x12); + cp2155_set (fd, 0xb0, 0x01); + cp2155_set (fd, 0x10, 0x05); + cp2155_set (fd, 0x10, 0x05); + cp2155_set (fd, 0x10, 0x05); + cp2155_set (fd, 0x10, 0x05); + cp2155_set (fd, 0x11, 0x83); + cp2155_set (fd, 0x11, 0x83); + cp2155_set (fd, 0x11, 0xc3); + cp2155_set (fd, 0x11, 0xc3); + cp2155_set (fd, 0x11, 0xc3); + cp2155_set (fd, 0x11, 0xc1); + cp2155_set (fd, 0x11, 0xc1); + cp2155_set (fd, 0x12, 0x40); + cp2155_set (fd, 0x13, 0x00); + cp2155_set (fd, 0x16, 0x40); + cp2155_set (fd, 0x21, 0x06); + cp2155_set (fd, 0x22, 0x40); + cp2155_set (fd, 0x20, 0x06); + cp2155_set (fd, 0x1d, 0x00); + cp2155_set (fd, 0x1e, 0x00); + cp2155_set (fd, 0x1f, 0x04); + cp2155_set (fd, 0x66, 0x00); + cp2155_set (fd, 0x67, chndl->value_67); + cp2155_set (fd, 0x68, chndl->value_68); + cp2155_set (fd, 0x1a, 0x00); + cp2155_set (fd, 0x1b, 0x00); + cp2155_set (fd, 0x1c, 0x02); + cp2155_set (fd, 0x15, 0x01); + cp2155_set (fd, 0x14, 0x01); + cp2155_set (fd, 0x17, 0x01); + cp2155_set (fd, 0x43, 0x1c); + cp2155_set (fd, 0x44, 0x9c); + cp2155_set (fd, 0x45, 0x38); + cp2155_set (fd, 0x23, 0x0a); + cp2155_set (fd, 0x33, 0x0a); + cp2155_set (fd, 0x24, 0x0a); + cp2155_set (fd, 0x34, 0x0a); + cp2155_set (fd, 0x25, 0x0a); + cp2155_set (fd, 0x35, 0x0a); + cp2155_set (fd, 0x26, 0x0a); + cp2155_set (fd, 0x36, 0x0a); + cp2155_set (fd, 0x27, 0x0a); + cp2155_set (fd, 0x37, 0x0a); + cp2155_set (fd, 0x28, 0x0a); + cp2155_set (fd, 0x38, 0x0a); + cp2155_set (fd, 0x29, 0x0a); + cp2155_set (fd, 0x39, 0x0a); + cp2155_set (fd, 0x2a, 0x0a); + cp2155_set (fd, 0x3a, 0x0a); + cp2155_set (fd, 0x2b, 0x0a); + cp2155_set (fd, 0x3b, 0x0a); + cp2155_set (fd, 0x2c, 0x0a); + cp2155_set (fd, 0x3c, 0x0a); + cp2155_set (fd, 0x2d, 0x0a); + cp2155_set (fd, 0x3d, 0x0a); + cp2155_set (fd, 0x2e, 0x0a); + cp2155_set (fd, 0x3e, 0x0a); + cp2155_set (fd, 0x2f, 0x0a); + cp2155_set (fd, 0x3f, 0x0a); + cp2155_set (fd, 0x30, 0x0a); + cp2155_set (fd, 0x40, 0x0a); + cp2155_set (fd, 0x31, 0x0a); + cp2155_set (fd, 0x41, 0x0a); + cp2155_set (fd, 0x32, 0x0a); + cp2155_set (fd, 0x42, 0x0a); + cp2155_set (fd, 0xca, 0x00); + cp2155_set (fd, 0xca, 0x00); + cp2155_set (fd, 0xca, 0x00); + cp2155_set (fd, 0x18, 0x00); + + memcpy (buf + 0x0000, + "\x04\x70\x00\x01\x00\x32\x00\x32\x00\x32\x00\x32\x00\x32\x00\x32", + 16); + memcpy (buf + 0x0010, + "\x00\x32\x00\x32\x00\x32\x00\x32\x00\x32\x00\x32\x00\x32\x00\x32", + 16); + memcpy (buf + 0x0020, + "\x00\x32\x00\x32\x00\x32\x00\x32\x00\x32\x00\x32\x00\x32\x00\x32", + 16); + memcpy (buf + 0x0030, + "\x00\x32\x00\x32\x00\x32\x00\x32\x00\x32\x00\x32\x00\x32\x00\x32", + 16); + memcpy (buf + 0x0040, + "\x00\x32\x00\x32\x00\x32\x00\x32\x00\x32\x00\x32\x00\x32\x00\x32", + 16); + memcpy (buf + 0x0050, + "\x00\x32\x00\x32\x00\x32\x00\x32\x00\x32\x00\x32\x00\x32\x00\x32", + 16); + memcpy (buf + 0x0060, + "\x00\x32\x00\x32\x00\x32\xbc\x30\x89\x2f\x64\x2e\x4d\x2d\x43\x2c", + 16); + memcpy (buf + 0x0070, + "\x45\x2b\x52\x2a\x69\x29\x8a\x28\xb5\x27\xe8\x26\x23\x26\x66\x25", + 16); + memcpy (buf + 0x0080, + "\xaf\x24\x00\x24\x57\x23\xb5\x22\x17\x22\x80\x21\xee\x20\x60\x20", + 16); + memcpy (buf + 0x0090, + "\xd7\x1f\x53\x1f\xd3\x1e\x57\x1e\xde\x1d\x6a\x1d\xf9\x1c\x8b\x1c", + 16); + memcpy (buf + 0x00a0, + "\x20\x1c\xb9\x1b\x54\x1b\xf3\x1a\x93\x1a\x37\x1a\xdd\x19\x85\x19", + 16); + memcpy (buf + 0x00b0, + "\x30\x19\xdd\x18\x8c\x18\x3d\x18\xf0\x17\xa5\x17\x5c\x17\x14\x17", + 16); + memcpy (buf + 0x00c0, + "\xce\x16\x8a\x16\x47\x16\x06\x16\xc7\x15\x88\x15\x4b\x15\x10\x15", + 16); + memcpy (buf + 0x00d0, + "\xd6\x14\x9d\x14\x65\x14\x2e\x14\xf9\x13\xc4\x13\x91\x13\x5f\x13", + 16); + memcpy (buf + 0x00e0, + "\x2d\x13\xfd\x12\xce\x12\x9f\x12\x72\x12\x45\x12\x19\x12\xee\x11", + 16); + memcpy (buf + 0x00f0, + "\xc4\x11\x9a\x11\x71\x11\x49\x11\x22\x11\xfb\x10\xd5\x10\xb0\x10", + 16); + memcpy (buf + 0x0100, "\x8c\x10\x68\x10", 4); + count = 260; + write_buf (fd, count, buf, 0x03, 0x00); + write_buf (fd, count, buf, 0x03, 0x02); + write_buf (fd, count, buf, 0x03, 0x06); + + memcpy (buf + 0x0000, + "\x04\x70\x20\x00\x00\x32\x27\x2a\x6f\x24\x15\x20\xa8\x1c\xe5\x19", + 16); + memcpy (buf + 0x0010, + "\x9e\x17\xb5\x15\x16\x14\xb0\x12\x79\x11\x68\x10\x00\x00\x00\x00", + 16); + memcpy (buf + 0x0020, "\x00\x00\x00\x00", 4); + count = 36; + write_buf (fd, count, buf, 0x03, 0x04); + write_buf (fd, count, buf, 0x03, 0x08); + + general_motor_2224 (fd); + +} + +void +startblob_2224_0600 (CANON_Handle * chndl, unsigned char *buf) +{ + + int fd; + fd = chndl->fd; + size_t count; + + cp2155_set (fd, 0x90, 0xe8); + cp2155_set (fd, 0x9b, 0x06); + cp2155_set (fd, 0x9b, 0x04); + cp2155_set (fd, 0x90, 0xf8); + cp2155_set (fd, 0xb0, 0x00); + cp2155_set (fd, 0x07, 0x00); + cp2155_set (fd, 0x07, 0x00); + cp2155_set (fd, 0x08, chndl->value_08); + cp2155_set (fd, 0x09, chndl->value_09); + cp2155_set (fd, 0x0a, chndl->value_0a); + cp2155_set (fd, 0x0b, chndl->value_0b); + cp2155_set (fd, 0xa0, 0x1d); + cp2155_set (fd, 0xa1, 0x00); + cp2155_set (fd, 0xa2, 0x31); + cp2155_set (fd, 0xa3, 0xf0); + cp2155_set (fd, 0x64, 0x00); + cp2155_set (fd, 0x65, 0x00); + cp2155_set (fd, 0x61, 0x00); + cp2155_set (fd, 0x62, 0x55); + cp2155_set (fd, 0x63, 0x00); + cp2155_set (fd, 0x50, 0x04); + cp2155_set (fd, 0x50, 0x04); + cp2155_set (fd, 0x90, 0xf8); + cp2155_set (fd, 0x51, chndl->value_51); + cp2155_set (fd, 0x5a, 0xff); + cp2155_set (fd, 0x5b, 0xff); + cp2155_set (fd, 0x5c, 0xff); + cp2155_set (fd, 0x5d, 0xff); + cp2155_set (fd, 0x52, 0x0c); + cp2155_set (fd, 0x53, 0xda); + cp2155_set (fd, 0x54, 0x0c); + cp2155_set (fd, 0x55, 0x44); + cp2155_set (fd, 0x56, 0x08); + cp2155_set (fd, 0x57, 0xbb); + cp2155_set (fd, 0x58, 0x1d); + cp2155_set (fd, 0x59, 0xa1); + cp2155_set (fd, 0x5e, 0x02); + cp2155_set (fd, 0x5f, 0x00); + cp2155_set (fd, 0x5f, 0x03); + cp2155_set (fd, 0x60, 0x01); + cp2155_set (fd, 0x60, 0x01); + cp2155_set (fd, 0x60, 0x01); + cp2155_set (fd, 0x60, 0x01); + cp2155_set (fd, 0x50, 0x04); + cp2155_set (fd, 0x51, chndl->value_51); + cp2155_set (fd, 0x81, 0x31); + cp2155_set (fd, 0x81, 0x31); + cp2155_set (fd, 0x82, 0x11); + cp2155_set (fd, 0x82, 0x11); + cp2155_set (fd, 0x83, 0x01); + cp2155_set (fd, 0x84, 0x05); + cp2155_set (fd, 0x80, 0x12); + cp2155_set (fd, 0x80, 0x12); + cp2155_set (fd, 0xb0, 0x08); + + big_write (fd, 0x5694, buf); + + cp2155_set (fd, 0x10, 0x05); + cp2155_set (fd, 0x10, 0x05); + cp2155_set (fd, 0x10, 0x05); + cp2155_set (fd, 0x10, 0x05); + cp2155_set (fd, 0x11, 0x81); + cp2155_set (fd, 0x11, 0x81); + cp2155_set (fd, 0x11, 0x81); + cp2155_set (fd, 0x11, 0x81); + cp2155_set (fd, 0x11, 0x81); + cp2155_set (fd, 0x11, 0x81); + cp2155_set (fd, 0x11, 0x81); + cp2155_set (fd, 0x12, 0x06); + cp2155_set (fd, 0x13, 0x06); + cp2155_set (fd, 0x16, 0x06); + cp2155_set (fd, 0x21, 0x06); + cp2155_set (fd, 0x22, 0x06); + cp2155_set (fd, 0x20, 0x06); + cp2155_set (fd, 0x1d, 0x00); + cp2155_set (fd, 0x1e, 0x00); + cp2155_set (fd, 0x1f, 0x04); + cp2155_set (fd, 0x66, 0x00); + cp2155_set (fd, 0x67, chndl->value_67); + cp2155_set (fd, 0x68, chndl->value_68); + cp2155_set (fd, 0x1a, 0x00); + cp2155_set (fd, 0x1b, 0x00); + cp2155_set (fd, 0x1c, 0x02); + cp2155_set (fd, 0x15, 0x80); + cp2155_set (fd, 0x14, 0x7a); + cp2155_set (fd, 0x17, 0x02); + cp2155_set (fd, 0x43, 0x1c); + cp2155_set (fd, 0x44, 0x9c); + cp2155_set (fd, 0x45, 0x38); + cp2155_set (fd, 0x23, 0x0c); + cp2155_set (fd, 0x33, 0x0c); + cp2155_set (fd, 0x24, 0x0c); + cp2155_set (fd, 0x34, 0x0c); + cp2155_set (fd, 0x25, 0x0c); + cp2155_set (fd, 0x35, 0x0c); + cp2155_set (fd, 0x26, 0x0c); + cp2155_set (fd, 0x36, 0x0c); + cp2155_set (fd, 0x27, 0x0c); + cp2155_set (fd, 0x37, 0x0c); + cp2155_set (fd, 0x28, 0x0c); + cp2155_set (fd, 0x38, 0x0c); + cp2155_set (fd, 0x29, 0x0c); + cp2155_set (fd, 0x39, 0x0c); + cp2155_set (fd, 0x2a, 0x0c); + cp2155_set (fd, 0x3a, 0x0c); + cp2155_set (fd, 0x2b, 0x0c); + cp2155_set (fd, 0x3b, 0x0c); + cp2155_set (fd, 0x2c, 0x0c); + cp2155_set (fd, 0x3c, 0x0c); + cp2155_set (fd, 0x2d, 0x0c); + cp2155_set (fd, 0x3d, 0x0c); + cp2155_set (fd, 0x2e, 0x0c); + cp2155_set (fd, 0x3e, 0x0c); + cp2155_set (fd, 0x2f, 0x0c); + cp2155_set (fd, 0x3f, 0x0c); + cp2155_set (fd, 0x30, 0x0c); + cp2155_set (fd, 0x40, 0x0c); + cp2155_set (fd, 0x31, 0x0c); + cp2155_set (fd, 0x41, 0x0c); + cp2155_set (fd, 0x32, 0x0c); + cp2155_set (fd, 0x42, 0x0c); + cp2155_set (fd, 0xca, 0x00); + cp2155_set (fd, 0xca, 0x00); + cp2155_set (fd, 0xca, 0x00); + cp2155_set (fd, 0x18, 0x00); + memcpy (buf + 0x00000000, + "\x04\x70\x18\x00\x80\x7f\x80\x7f\x80\x7f\x80\x7f\x80\x7f\x80\x7f", + 16); + memcpy (buf + 0x00000010, + "\x80\x7f\x80\x7f\x80\x7f\x80\x7f\x80\x7f\x80\x7f\x00\x00\x00\x00", + 16); + memcpy (buf + 0x00000020, "\x00\x00\x00\x00", 4); + count = 36; + write_buf (fd, count, buf, 0x03, 0x00); + write_buf (fd, count, buf, 0x03, 0x02); + write_buf (fd, count, buf, 0x03, 0x06); + write_buf (fd, count, buf, 0x03, 0x04); + write_buf (fd, count, buf, 0x03, 0x08); + + general_motor_2224 (fd); + +} + +void +startblob_2224_1200 (CANON_Handle * chndl, unsigned char *buf) +{ + + int fd; + fd = chndl->fd; + size_t count; + + cp2155_set (fd, 0x90, 0xe8); + cp2155_set (fd, 0x9b, 0x06); + cp2155_set (fd, 0x9b, 0x04); + cp2155_set (fd, 0x9b, 0x06); + cp2155_set (fd, 0x9b, 0x04); + cp2155_set (fd, 0x90, 0xf8); + cp2155_set (fd, 0xb0, 0x00); + cp2155_set (fd, 0x07, 0x00); + cp2155_set (fd, 0x07, 0x00); + cp2155_set (fd, 0x08, chndl->value_08); + cp2155_set (fd, 0x09, chndl->value_09); + cp2155_set (fd, 0x0a, chndl->value_0a); + cp2155_set (fd, 0x0b, chndl->value_0b); + cp2155_set (fd, 0xa0, 0x1d); + cp2155_set (fd, 0xa1, 0x00); + cp2155_set (fd, 0xa2, 0x63); + cp2155_set (fd, 0xa3, 0xd0); + cp2155_set (fd, 0x64, 0x00); + cp2155_set (fd, 0x65, 0x00); + cp2155_set (fd, 0x61, 0x00); + cp2155_set (fd, 0x62, 0xaa); + cp2155_set (fd, 0x63, 0x00); + cp2155_set (fd, 0x50, 0x04); + cp2155_set (fd, 0x50, 0x04); + cp2155_set (fd, 0x90, 0xf8); + cp2155_set (fd, 0x51, chndl->value_51); + cp2155_set (fd, 0x5a, 0xff); + cp2155_set (fd, 0x5b, 0xff); + cp2155_set (fd, 0x5c, 0xff); + cp2155_set (fd, 0x5d, 0xff); + cp2155_set (fd, 0x52, 0x19); + cp2155_set (fd, 0x53, 0x5a); + cp2155_set (fd, 0x54, 0x17); + cp2155_set (fd, 0x55, 0x98); + cp2155_set (fd, 0x56, 0x11); + cp2155_set (fd, 0x57, 0xae); + cp2155_set (fd, 0x58, 0xa9); + cp2155_set (fd, 0x59, 0x01); + cp2155_set (fd, 0x5e, 0x02); + cp2155_set (fd, 0x5f, 0x00); + cp2155_set (fd, 0x5f, 0x03); + cp2155_set (fd, 0x60, 0x01); + cp2155_set (fd, 0x60, 0x01); + cp2155_set (fd, 0x60, 0x01); + cp2155_set (fd, 0x60, 0x01); + cp2155_set (fd, 0x50, 0x04); + cp2155_set (fd, 0x51, chndl->value_51); + cp2155_set (fd, 0x81, 0x31); + cp2155_set (fd, 0x81, 0x31); + cp2155_set (fd, 0x82, 0x11); + cp2155_set (fd, 0x82, 0x11); + cp2155_set (fd, 0x83, 0x01); + cp2155_set (fd, 0x84, 0x05); + cp2155_set (fd, 0x80, 0x12); + cp2155_set (fd, 0x80, 0x12); + cp2155_set (fd, 0xb0, 0x08); + + big_write (fd, 0xa714, buf); + + cp2155_set (fd, 0x10, 0x05); + cp2155_set (fd, 0x10, 0x05); + cp2155_set (fd, 0x10, 0x05); + cp2155_set (fd, 0x10, 0x05); + cp2155_set (fd, 0x11, 0x83); + cp2155_set (fd, 0x11, 0x83); + cp2155_set (fd, 0x11, 0x83); + cp2155_set (fd, 0x11, 0x83); + cp2155_set (fd, 0x11, 0x83); + cp2155_set (fd, 0x11, 0x81); + cp2155_set (fd, 0x11, 0x81); + cp2155_set (fd, 0x12, 0x50); + cp2155_set (fd, 0x13, 0x50); + cp2155_set (fd, 0x16, 0x50); + cp2155_set (fd, 0x21, 0x06); + cp2155_set (fd, 0x22, 0x50); + cp2155_set (fd, 0x20, 0x06); + cp2155_set (fd, 0x1d, 0x00); + cp2155_set (fd, 0x1e, 0x00); + cp2155_set (fd, 0x1f, 0x04); + cp2155_set (fd, 0x66, 0x00); + cp2155_set (fd, 0x67, chndl->value_67); + cp2155_set (fd, 0x68, chndl->value_68); + cp2155_set (fd, 0x1a, 0x00); + cp2155_set (fd, 0x1b, 0x00); + cp2155_set (fd, 0x1c, 0x02); + cp2155_set (fd, 0x15, 0x80); + cp2155_set (fd, 0x14, 0x7a); + cp2155_set (fd, 0x17, 0x02); + cp2155_set (fd, 0x43, 0x1c); + cp2155_set (fd, 0x44, 0x9c); + cp2155_set (fd, 0x45, 0x38); + cp2155_set (fd, 0x23, 0x01); + cp2155_set (fd, 0x33, 0x01); + cp2155_set (fd, 0x24, 0x03); + cp2155_set (fd, 0x34, 0x03); + cp2155_set (fd, 0x25, 0x05); + cp2155_set (fd, 0x35, 0x05); + cp2155_set (fd, 0x26, 0x07); + cp2155_set (fd, 0x36, 0x07); + cp2155_set (fd, 0x27, 0x09); + cp2155_set (fd, 0x37, 0x09); + cp2155_set (fd, 0x28, 0x0a); + cp2155_set (fd, 0x38, 0x0a); + cp2155_set (fd, 0x29, 0x0b); + cp2155_set (fd, 0x39, 0x0b); + cp2155_set (fd, 0x2a, 0x0c); + cp2155_set (fd, 0x3a, 0x0c); + cp2155_set (fd, 0x2b, 0x0c); + cp2155_set (fd, 0x3b, 0x0c); + cp2155_set (fd, 0x2c, 0x0b); + cp2155_set (fd, 0x3c, 0x0b); + cp2155_set (fd, 0x2d, 0x0a); + cp2155_set (fd, 0x3d, 0x0a); + cp2155_set (fd, 0x2e, 0x09); + cp2155_set (fd, 0x3e, 0x09); + cp2155_set (fd, 0x2f, 0x07); + cp2155_set (fd, 0x3f, 0x07); + cp2155_set (fd, 0x30, 0x05); + cp2155_set (fd, 0x40, 0x05); + cp2155_set (fd, 0x31, 0x03); + cp2155_set (fd, 0x41, 0x03); + cp2155_set (fd, 0x32, 0x01); + cp2155_set (fd, 0x42, 0x01); + cp2155_set (fd, 0xca, 0x00); + cp2155_set (fd, 0xca, 0x00); + cp2155_set (fd, 0xca, 0x00); + cp2155_set (fd, 0x18, 0x00); + + memcpy (buf + 0x00000000, + "\x04\x70\x40\x01\x80\x7f\x80\x7f\x80\x7f\x80\x7f\x80\x7f\x80\x7f", + 16); + memcpy (buf + 0x00000010, + "\x80\x7f\x80\x7f\x80\x7f\x80\x7f\x80\x7f\x80\x7f\x80\x7f\x80\x7f", + 16); + memcpy (buf + 0x00000020, + "\x80\x7f\x80\x7f\x80\x7f\x80\x7f\x80\x7f\x80\x7f\x80\x7f\x80\x7f", + 16); + memcpy (buf + 0x00000030, + "\x80\x7f\x80\x7f\x80\x7f\x80\x7f\x80\x7f\x80\x7f\x80\x7f\x80\x7f", + 16); + memcpy (buf + 0x00000040, + "\x80\x7f\x80\x7f\x80\x7f\x80\x7f\x80\x7f\x80\x7f\x80\x7f\x80\x7f", + 16); + memcpy (buf + 0x00000050, + "\x80\x7f\x80\x7f\x80\x7f\x80\x7f\x80\x7f\x80\x7f\x80\x7f\x80\x7f", + 16); + memcpy (buf + 0x00000060, + "\x80\x7f\x80\x7f\x80\x7f\x80\x7f\x80\x7f\x80\x7f\x80\x7f\x80\x7f", + 16); + memcpy (buf + 0x00000070, + "\x80\x7f\x80\x7f\x80\x7f\x80\x7f\x80\x7f\x80\x7f\x80\x7f\x80\x7f", + 16); + memcpy (buf + 0x00000080, + "\x80\x7f\x80\x7f\x80\x7f\x80\x7f\x80\x7f\x80\x7f\x80\x7f\x80\x7f", + 16); + memcpy (buf + 0x00000090, + "\x80\x7f\x80\x7f\x80\x7f\x80\x7f\x80\x7f\x80\x7f\x80\x7f\x80\x7f", + 16); + memcpy (buf + 0x000000a0, + "\x80\x7f\x80\x7f\x80\x7f\x80\x7f\x80\x7f\x80\x7f\x80\x7f\x80\x7f", + 16); + memcpy (buf + 0x000000b0, + "\x80\x7f\x80\x7f\x80\x7f\x80\x7f\x80\x7f\x80\x7f\x80\x7f\x80\x7f", + 16); + memcpy (buf + 0x000000c0, + "\x80\x7f\x80\x7f\x80\x7f\x80\x7f\x80\x7f\x80\x7f\x80\x7f\x80\x7f", + 16); + memcpy (buf + 0x000000d0, + "\x80\x7f\x80\x7f\x80\x7f\x80\x7f\x80\x7f\x80\x7f\x80\x7f\x80\x7f", + 16); + memcpy (buf + 0x000000e0, + "\x80\x7f\x80\x7f\x80\x7f\x80\x7f\x80\x7f\x80\x7f\x80\x7f\x80\x7f", + 16); + memcpy (buf + 0x000000f0, + "\x80\x7f\x80\x7f\x80\x7f\x80\x7f\x80\x7f\x80\x7f\x80\x7f\x80\x7f", + 16); + memcpy (buf + 0x00000100, + "\x80\x7f\x80\x7f\x80\x7f\x80\x7f\x80\x7f\x80\x7f\x80\x7f\x80\x7f", + 16); + memcpy (buf + 0x00000110, + "\x80\x7f\x80\x7f\x80\x7f\x80\x7f\x80\x7f\x80\x7f\x80\x7f\x80\x7f", + 16); + memcpy (buf + 0x00000120, + "\x80\x7f\x80\x7f\x80\x7f\x80\x7f\x80\x7f\x80\x7f\x80\x7f\x80\x7f", + 16); + memcpy (buf + 0x00000130, + "\x80\x7f\x80\x7f\x80\x7f\x80\x7f\x80\x7f\x80\x7f\x80\x7f\x80\x7f", + 16); + memcpy (buf + 0x00000140, "\x80\x7f\x80\x7f", 4); + count = 324; + + write_buf (fd, count, buf, 0x03, 0x00); + write_buf (fd, count, buf, 0x03, 0x02); + write_buf (fd, count, buf, 0x03, 0x06); + + memcpy (buf + 0x00000000, + "\x04\x70\x18\x00\x80\x7f\x80\x7f\x80\x7f\x80\x7f\x80\x7f\x80\x7f", + 16); + memcpy (buf + 0x00000010, + "\x80\x7f\x80\x7f\x80\x7f\x80\x7f\x80\x7f\x80\x7f\x80\x7f\x80\x7f", + 16); + memcpy (buf + 0x00000020, "\x80\x7f\x80\x7f", 4); + count = 36; + + write_buf (fd, count, buf, 0x03, 0x04); + write_buf (fd, count, buf, 0x03, 0x08); + + general_motor_2224 (fd); + +} + +void +send_start_blob (CANON_Handle * chndl) +{ + unsigned char buf[0xf000]; + + int fd; + fd = chndl->fd; + +/* value_51: lamp colors + bit 0 set: red on, bit 1 set: green on, bit 2 set: blue on + all bits off: no scan is made +*/ + chndl->value_51 = 0x07; + + switch (chndl->val[opt_resolution].w) + { + case 75: + chndl->value_67 = 0x0a; /* 3*7300/8 */ + chndl->value_68 = 0xb1; + break; + case 150: + chndl->value_67 = 0x15; /* 3*7300/4 */ + chndl->value_68 = 0x63; + break; + case 300: + chndl->value_67 = 0x2a; /* 3*7300/2 */ + chndl->value_68 = 0xc6; + break; + case 600: + chndl->value_67 = 0x55; /* 3*7300 */ + chndl->value_68 = 0x8c; + break; + case 1200: + chndl->value_67 = 0xab; /* 6*7300 */ + chndl->value_68 = 0x18; + } + + cp2155_set (fd, 0x80, 0x12); + cp2155_set (fd, 0x11, 0xc1); + cp2155_set (fd, 0x80, 0x12); + cp2155_set (fd, 0x11, 0xc1); + cp2155_set (fd, 0x90, 0xf8); + cp2155_set (fd, 0x80, 0x12); + cp2155_set (fd, 0x11, 0xc1); + cp2155_set (fd, 0x01, 0x29); + cp2155_set (fd, 0x04, 0x0c); + cp2155_set (fd, 0x05, 0x00); + cp2155_set (fd, 0x06, 0x00); + cp2155_set (fd, 0x01, 0x29); + cp2155_set_gamma (fd); + + switch (chndl->val[opt_resolution].w) + { + case 75: + if (chndl->productcode == 0x2225) + { + startblob_2225_0075 (chndl, buf); + } + else + { + startblob_2224_0075 (chndl, buf); + } + break; + case 150: + if (chndl->productcode == 0x2225) + { + startblob_2225_0150 (chndl, buf); + } + else + { + startblob_2224_0150 (chndl, buf); + } + break; + case 300: + if (chndl->productcode == 0x2225) + { + startblob_2225_0300 (chndl, buf); + } + else + { + cp2155_set_gamma_red_enhanced (fd); + startblob_2224_0300 (chndl, buf); + } + break; + case 600: + if (chndl->productcode == 0x2225) + { + cp2155_set_gamma_red_enhanced (fd); + startblob_2225_0600 (chndl, buf); +/* + startblob_2225_0600_extra (chndl, buf); +*/ + } + else + { + startblob_2224_0600 (chndl, buf); + } + break; + case 1200: + if (chndl->productcode == 0x2225) + { + startblob_2225_1200 (chndl, buf); + } + else + { + startblob_2224_1200 (chndl, buf); + } + break; + } +} + +/* Wait until data ready */ +static long +wait_for_data (CANON_Handle * chndl) +{ + int fd; + fd = chndl->fd; + time_t start_time = time (NULL); + long size; + byte value; + + DBG (12, "waiting...\n"); + + while (1) + { + size = 0; + cp2155_get (fd, 0x46, &value); + DBG (1, "home sensor: %02x\n", value); + if (value == 0) + { + send_start_blob (chndl); + cp2155_get (fd, 0x46, &value); + DBG (1, "home sensor: %02x\n", value); + } + + if (cp2155_get (fd, 0xa5, &value) != SANE_STATUS_GOOD) + { + return -1; + } + + size += value; + + if (cp2155_get (fd, 0xa6, &value) != SANE_STATUS_GOOD) + { + return -1; + } + + size <<= 8; + size += value; + + if (cp2155_get (fd, 0xa7, &value) != SANE_STATUS_GOOD) + { + return -1; + } + + size <<= 8; + size += value; + + if (size != 0) + { + return 2 * size; + } + + /* Give it 5 seconds */ + if ((time (NULL) - start_time) > 5) + { + DBG (1, "wait_for_data: timed out (%ld)\n", size); + return -1; + } + + usleep (1 * MSEC); + } +} + +static int +init_2225 (CANON_Handle * chndl) +{ + int fd = chndl->fd; + byte value; + int result = 0; + + cp2155_get (fd, 0xd0, &value); + /* Detect if scanner is plugged in */ + if (value != 0x81 && value != 0x40) + { + DBG (0, "INIT: unexpected value: %x\n", value); + } + + if (value == 0x00) + { + return -1; + } + + cp2155_set (fd, 0x02, 0x01); + cp2155_set (fd, 0x02, 0x00); + cp2155_set (fd, 0x01, 0x00); + cp2155_set (fd, 0x01, 0x28); + cp2155_set (fd, 0x90, 0x4f); + cp2155_set (fd, 0x92, 0xff); + cp2155_set (fd, 0x93, 0x00); + cp2155_set (fd, 0x91, 0x1f); + cp2155_set (fd, 0x95, 0x1f); + cp2155_set (fd, 0x97, 0x1f); + cp2155_set (fd, 0x9b, 0x00); + cp2155_set (fd, 0x9c, 0x07); + cp2155_set (fd, 0x90, 0x4d); + cp2155_set (fd, 0x90, 0xcd); + cp2155_set (fd, 0x90, 0xcc); + cp2155_set (fd, 0x9b, 0x01); + cp2155_set (fd, 0xa0, 0x04); + cp2155_set (fd, 0xa0, 0x05); + cp2155_set (fd, 0x01, 0x28); + cp2155_set (fd, 0x04, 0x0c); + cp2155_set (fd, 0x05, 0x00); + cp2155_set (fd, 0x06, 0x00); + cp2155_set (fd, 0x98, 0x00); + cp2155_set (fd, 0x98, 0x00); + cp2155_set (fd, 0x98, 0x02); + cp2155_set (fd, 0x99, 0x28); + cp2155_set (fd, 0x9a, 0x03); + cp2155_set (fd, 0x80, 0x10); + cp2155_set (fd, 0x8d, 0x00); + cp2155_set (fd, 0x8d, 0x04); + + cp2155_set (fd, 0x85, 0x00); + cp2155_set (fd, 0x87, 0x00); + cp2155_set (fd, 0x88, 0x70); + + cp2155_set (fd, 0x85, 0x03); + cp2155_set (fd, 0x87, 0x00); + cp2155_set (fd, 0x88, 0x28); + + cp2155_set (fd, 0x85, 0x06); + cp2155_set (fd, 0x87, 0x00); + cp2155_set (fd, 0x88, 0x28); + + + DBG (1, "INIT state: %0d\n", result); + return result; +} + +static int +init_2224 (CANON_Handle * chndl) +{ + int fd = chndl->fd; + byte value; + int result = 0; + + cp2155_get (fd, 0xd0, &value); + /* Detect if scanner is plugged in */ + if (value != 0x81 && value != 0x40) + { + DBG (1, "INIT: unexpected value: %x\n", value); + } + + if (value == 0x00) + { + return -1; + } + + cp2155_set (fd, 0x02, 0x01); + cp2155_set (fd, 0x02, 0x00); + cp2155_set (fd, 0x01, 0x00); + cp2155_set (fd, 0x01, 0x28); + cp2155_set (fd, 0xa0, 0x04); + cp2155_set (fd, 0xa0, 0x05); + cp2155_set (fd, 0x01, 0x28); + cp2155_set (fd, 0x04, 0x0c); + cp2155_set (fd, 0x05, 0x00); + cp2155_set (fd, 0x06, 0x00); + cp2155_set (fd, 0x90, 0x27); + cp2155_set (fd, 0x92, 0xf7); + cp2155_set (fd, 0x94, 0xf7); + cp2155_set (fd, 0x93, 0x00); + cp2155_set (fd, 0x91, 0x1f); + cp2155_set (fd, 0x95, 0x0f); + cp2155_set (fd, 0x97, 0x0f); + cp2155_set (fd, 0x9b, 0x00); + cp2155_set (fd, 0x9c, 0x07); + cp2155_set (fd, 0x90, 0xf0); + cp2155_set (fd, 0x9b, 0x04); + cp2155_set (fd, 0x98, 0x00); + cp2155_set (fd, 0x98, 0x00); + cp2155_set (fd, 0x98, 0x02); + cp2155_set (fd, 0x99, 0x3b); + cp2155_set (fd, 0x9a, 0x03); + cp2155_set (fd, 0x80, 0x10); + cp2155_set (fd, 0x8d, 0x00); + cp2155_set (fd, 0x8d, 0x04); + + DBG (1, "INIT state: %0d\n", result); + + return result; +} + +static int +init (CANON_Handle * chndl) +{ + int result; + if (chndl->productcode == 0x2225) + { + result = init_2225 (chndl); + } + else + { + result = init_2224 (chndl); + } + return result; +} + +void +back2225 (int fd, unsigned char *buf) +{ + size_t count; + cp2155_set (fd, 0x90, 0xc8); + cp2155_set (fd, 0x90, 0xc8); + cp2155_set (fd, 0xb0, 0x03); + cp2155_set (fd, 0x07, 0x00); + cp2155_set (fd, 0x07, 0x00); + cp2155_set (fd, 0x08, 0x00); + cp2155_set (fd, 0x09, 0x69); + cp2155_set (fd, 0x0a, 0x00); + cp2155_set (fd, 0x0b, 0xe8); + cp2155_set (fd, 0xa0, 0x1d); + cp2155_set (fd, 0xa1, 0x00); + cp2155_set (fd, 0xa2, 0x00); + cp2155_set (fd, 0xa3, 0x70); + cp2155_set (fd, 0x64, 0x00); + cp2155_set (fd, 0x65, 0x00); + cp2155_set (fd, 0x61, 0x00); + cp2155_set (fd, 0x62, 0x2e); + cp2155_set (fd, 0x63, 0x00); + cp2155_set (fd, 0x50, 0x04); + cp2155_set (fd, 0x50, 0x04); + cp2155_set (fd, 0x51, 0x07); + cp2155_set (fd, 0x5a, 0x32); + cp2155_set (fd, 0x5b, 0x32); + cp2155_set (fd, 0x5c, 0x32); + cp2155_set (fd, 0x5d, 0x32); + cp2155_set (fd, 0x52, 0x00); + cp2155_set (fd, 0x53, 0x01); + cp2155_set (fd, 0x54, 0x00); + cp2155_set (fd, 0x55, 0x01); + cp2155_set (fd, 0x56, 0x00); + cp2155_set (fd, 0x57, 0x01); + cp2155_set (fd, 0x58, 0x00); + cp2155_set (fd, 0x59, 0x01); + cp2155_set (fd, 0x5e, 0x02); + cp2155_set (fd, 0x5f, 0x00); + cp2155_set (fd, 0x5f, 0x03); + cp2155_set (fd, 0x60, 0x15); + cp2155_set (fd, 0x60, 0x15); + cp2155_set (fd, 0x60, 0x15); + cp2155_set (fd, 0x60, 0x15); + cp2155_set (fd, 0x50, 0x04); + cp2155_set (fd, 0x51, 0x07); + cp2155_set (fd, 0x81, 0x29); + cp2155_set (fd, 0x81, 0x29); + cp2155_set (fd, 0x82, 0x09); + cp2155_set (fd, 0x82, 0x09); + cp2155_set (fd, 0x83, 0x02); + cp2155_set (fd, 0x84, 0x06); + cp2155_set (fd, 0x80, 0x12); + cp2155_set (fd, 0x80, 0x12); + cp2155_set (fd, 0xb0, 0x03); + cp2155_set (fd, 0x10, 0x05); + cp2155_set (fd, 0x10, 0x05); + cp2155_set (fd, 0x9b, 0x03); + cp2155_set (fd, 0x10, 0x05); + cp2155_set (fd, 0x11, 0x41); + cp2155_set (fd, 0x11, 0x61); + cp2155_set (fd, 0x11, 0x21); + cp2155_set (fd, 0x11, 0x21); + cp2155_set (fd, 0x11, 0x25); + cp2155_set (fd, 0x11, 0x25); + cp2155_set (fd, 0x11, 0x25); + cp2155_set (fd, 0x12, 0x40); + cp2155_set (fd, 0x13, 0x40); + cp2155_set (fd, 0x16, 0x40); + cp2155_set (fd, 0x21, 0x06); + cp2155_set (fd, 0x22, 0x40); + cp2155_set (fd, 0x20, 0x06); + cp2155_set (fd, 0x1d, 0x00); + cp2155_set (fd, 0x1e, 0x36); + cp2155_set (fd, 0x1f, 0xd0); + cp2155_set (fd, 0x66, 0x00); + cp2155_set (fd, 0x67, 0x00); + cp2155_set (fd, 0x68, 0x06); + cp2155_set (fd, 0x1a, 0x00); + cp2155_set (fd, 0x1b, 0x00); + cp2155_set (fd, 0x1c, 0x02); + cp2155_set (fd, 0x15, 0x83); + cp2155_set (fd, 0x14, 0x7c); + cp2155_set (fd, 0x17, 0x02); + cp2155_set (fd, 0x43, 0x1c); + cp2155_set (fd, 0x44, 0x9c); + cp2155_set (fd, 0x45, 0x38); + cp2155_set (fd, 0x23, 0x28); + cp2155_set (fd, 0x33, 0x28); + cp2155_set (fd, 0x24, 0x27); + cp2155_set (fd, 0x34, 0x27); + cp2155_set (fd, 0x25, 0x25); + cp2155_set (fd, 0x35, 0x25); + cp2155_set (fd, 0x26, 0x21); + cp2155_set (fd, 0x36, 0x21); + cp2155_set (fd, 0x27, 0x1c); + cp2155_set (fd, 0x37, 0x1c); + cp2155_set (fd, 0x28, 0x16); + cp2155_set (fd, 0x38, 0x16); + cp2155_set (fd, 0x29, 0x0f); + cp2155_set (fd, 0x39, 0x0f); + cp2155_set (fd, 0x2a, 0x08); + cp2155_set (fd, 0x3a, 0x08); + cp2155_set (fd, 0x2b, 0x00); + cp2155_set (fd, 0x3b, 0x00); + cp2155_set (fd, 0x2c, 0x08); + cp2155_set (fd, 0x3c, 0x08); + cp2155_set (fd, 0x2d, 0x0f); + cp2155_set (fd, 0x3d, 0x0f); + cp2155_set (fd, 0x2e, 0x16); + cp2155_set (fd, 0x3e, 0x16); + cp2155_set (fd, 0x2f, 0x1c); + cp2155_set (fd, 0x3f, 0x1c); + cp2155_set (fd, 0x30, 0x21); + cp2155_set (fd, 0x40, 0x21); + cp2155_set (fd, 0x31, 0x25); + cp2155_set (fd, 0x41, 0x25); + cp2155_set (fd, 0x32, 0x27); + cp2155_set (fd, 0x42, 0x27); + cp2155_set (fd, 0xca, 0x02); + cp2155_set (fd, 0xca, 0x02); + cp2155_set (fd, 0xca, 0x22); + cp2155_set (fd, 0x18, 0x00); + + memcpy (buf + 0x00000000, + "\x04\x70\x00\x01\x80\x25\x80\x25\x80\x25\x80\x25\x80\x25\x80\x25", + 16); + memcpy (buf + 0x00000010, + "\x80\x25\x80\x25\x80\x25\x80\x25\x80\x25\x80\x25\x80\x25\x80\x25", + 16); + memcpy (buf + 0x00000020, + "\x80\x25\x80\x25\x80\x25\x80\x25\x80\x25\x80\x25\x80\x25\x80\x25", + 16); + memcpy (buf + 0x00000030, + "\x80\x25\x80\x25\x80\x25\x80\x25\x80\x25\x80\x25\x80\x25\x80\x25", + 16); + memcpy (buf + 0x00000040, + "\x80\x25\x80\x25\x80\x25\x80\x25\x80\x25\x80\x25\x80\x25\x80\x25", + 16); + memcpy (buf + 0x00000050, + "\x80\x25\x80\x25\x80\x25\x80\x25\x80\x25\x80\x25\x80\x25\x80\x25", + 16); + memcpy (buf + 0x00000060, + "\x80\x25\x80\x25\x80\x25\x80\x25\x80\x25\xf0\x23\x80\x22\x2c\x21", + 16); + memcpy (buf + 0x00000070, + "\xf1\x1f\xcd\x1e\xbd\x1d\xc0\x1c\xd2\x1b\xf4\x1a\x22\x1a\x5e\x19", + 16); + memcpy (buf + 0x00000080, + "\xa4\x18\xf5\x17\x4f\x17\xb2\x16\x1d\x16\x90\x15\x09\x15\x89\x14", + 16); + memcpy (buf + 0x00000090, + "\x0e\x14\x9a\x13\x2a\x13\xc0\x12\x59\x12\xf8\x11\x9a\x11\x3f\x11", + 16); + memcpy (buf + 0x000000a0, + "\xe9\x10\x96\x10\x46\x10\xf8\x0f\xae\x0f\x66\x0f\x21\x0f\xde\x0e", + 16); + memcpy (buf + 0x000000b0, + "\x9e\x0e\x60\x0e\x23\x0e\xe9\x0d\xb0\x0d\x7a\x0d\x44\x0d\x11\x0d", + 16); + memcpy (buf + 0x000000c0, + "\xdf\x0c\xaf\x0c\x80\x0c\x52\x0c\x25\x0c\xfa\x0b\xd0\x0b\xa7\x0b", + 16); + memcpy (buf + 0x000000d0, + "\x80\x0b\x59\x0b\x33\x0b\x0e\x0b\xea\x0a\xc8\x0a\xa5\x0a\x84\x0a", + 16); + memcpy (buf + 0x000000e0, + "\x64\x0a\x44\x0a\x25\x0a\x07\x0a\xe9\x09\xcd\x09\xb0\x09\x95\x09", + 16); + memcpy (buf + 0x000000f0, + "\x7a\x09\x60\x09\x46\x09\x2c\x09\x14\x09\xfc\x08\xe4\x08\xcd\x08", + 16); + memcpy (buf + 0x00000100, "\xb6\x08\xa0\x08", 4); + count = 260; + write_buf (fd, count, buf, 0x03, 0x00); + write_buf (fd, count, buf, 0x03, 0x02); + write_buf (fd, count, buf, 0x03, 0x06); + + memcpy (buf + 0x00000000, + "\x04\x70\x18\x00\x80\x25\xc0\x1c\x4f\x17\x9a\x13\xe9\x10\xde\x0e", + 16); + memcpy (buf + 0x00000010, + "\x44\x0d\xfa\x0b\xea\x0a\x07\x0a\x46\x09\xa0\x08\x80\x25\x80\x25", + 16); + memcpy (buf + 0x00000020, "\x80\x25\x80\x25", 4); + count = 36; + write_buf (fd, count, buf, 0x03, 0x04); + write_buf (fd, count, buf, 0x03, 0x08); + + cp2155_set (fd, 0x10, 0x05); + cp2155_set (fd, 0x11, 0x35); + cp2155_set (fd, 0x60, 0x15); + cp2155_set (fd, 0x80, 0x12); + cp2155_set (fd, 0x03, 0x01); + +} + +void +back2224 (int fd, unsigned char *buf) +{ + size_t count; + +/* cp2155_set (fd, 0x90, 0xe8); */ + cp2155_set (fd, 0x9b, 0x06); + cp2155_set (fd, 0x9b, 0x04); +/* cp2155_set (fd, 0x90, 0xf8); */ + cp2155_set (fd, 0xb0, 0x03); + cp2155_set (fd, 0x07, 0x00); + cp2155_set (fd, 0x07, 0x00); + cp2155_set (fd, 0x08, 0x01); + cp2155_set (fd, 0x09, 0xb3); + cp2155_set (fd, 0x0a, 0x02); + cp2155_set (fd, 0x0b, 0x32); + cp2155_set (fd, 0xa0, 0x1d); + cp2155_set (fd, 0xa1, 0x00); + cp2155_set (fd, 0xa2, 0x00); + cp2155_set (fd, 0xa3, 0x70); + cp2155_set (fd, 0x64, 0x00); + cp2155_set (fd, 0x65, 0x00); + cp2155_set (fd, 0x61, 0x00); + cp2155_set (fd, 0x62, 0x2e); + cp2155_set (fd, 0x63, 0x00); + cp2155_set (fd, 0x50, 0x04); + cp2155_set (fd, 0x50, 0x04); +/* cp2155_set (fd, 0x90, 0xf8); */ + cp2155_set (fd, 0x51, 0x07); + cp2155_set (fd, 0x5a, 0xff); + cp2155_set (fd, 0x5b, 0xff); + cp2155_set (fd, 0x5c, 0xff); + cp2155_set (fd, 0x5d, 0xff); + cp2155_set (fd, 0x52, 0x00); + cp2155_set (fd, 0x53, 0x01); + cp2155_set (fd, 0x54, 0x00); + cp2155_set (fd, 0x55, 0x01); + cp2155_set (fd, 0x56, 0x00); + cp2155_set (fd, 0x57, 0x01); + cp2155_set (fd, 0x58, 0x00); + cp2155_set (fd, 0x59, 0x01); + cp2155_set (fd, 0x5e, 0x02); + cp2155_set (fd, 0x5f, 0x00); + cp2155_set (fd, 0x5f, 0x03); + cp2155_set (fd, 0x60, 0x01); + cp2155_set (fd, 0x60, 0x01); + cp2155_set (fd, 0x60, 0x01); + cp2155_set (fd, 0x60, 0x01); + cp2155_set (fd, 0x50, 0x04); + cp2155_set (fd, 0x51, 0x07); + cp2155_set (fd, 0x81, 0x31); + cp2155_set (fd, 0x81, 0x31); + cp2155_set (fd, 0x82, 0x11); + cp2155_set (fd, 0x82, 0x11); + cp2155_set (fd, 0x83, 0x01); + cp2155_set (fd, 0x84, 0x05); + cp2155_set (fd, 0x80, 0x12); + cp2155_set (fd, 0x80, 0x12); + cp2155_set (fd, 0xb0, 0x03); + cp2155_set (fd, 0x10, 0x05); + cp2155_set (fd, 0x10, 0x05); + cp2155_set (fd, 0x10, 0x05); + cp2155_set (fd, 0x10, 0x05); + cp2155_set (fd, 0x11, 0x41); + cp2155_set (fd, 0x11, 0x61); + cp2155_set (fd, 0x11, 0x21); + cp2155_set (fd, 0x11, 0x21); + cp2155_set (fd, 0x11, 0x25); + cp2155_set (fd, 0x11, 0x25); + cp2155_set (fd, 0x11, 0x25); + cp2155_set (fd, 0x12, 0x7d); + cp2155_set (fd, 0x13, 0x7d); + cp2155_set (fd, 0x16, 0x7d); + cp2155_set (fd, 0x21, 0x06); + cp2155_set (fd, 0x22, 0x7d); + cp2155_set (fd, 0x20, 0x06); + cp2155_set (fd, 0x1d, 0x00); + cp2155_set (fd, 0x1e, 0x36); + cp2155_set (fd, 0x1f, 0xd0); + cp2155_set (fd, 0x66, 0x00); + cp2155_set (fd, 0x67, 0x00); + cp2155_set (fd, 0x68, 0x06); + cp2155_set (fd, 0x1a, 0x00); + cp2155_set (fd, 0x1b, 0x00); + cp2155_set (fd, 0x1c, 0x02); + cp2155_set (fd, 0x15, 0x83); + cp2155_set (fd, 0x14, 0x7c); + cp2155_set (fd, 0x17, 0x02); + cp2155_set (fd, 0x43, 0x1c); + cp2155_set (fd, 0x44, 0x9c); + cp2155_set (fd, 0x45, 0x38); + cp2155_set (fd, 0x23, 0x0d); + cp2155_set (fd, 0x33, 0x0d); + cp2155_set (fd, 0x24, 0x0d); + cp2155_set (fd, 0x34, 0x0d); + cp2155_set (fd, 0x25, 0x0d); + cp2155_set (fd, 0x35, 0x0d); + cp2155_set (fd, 0x26, 0x0d); + cp2155_set (fd, 0x36, 0x0d); + cp2155_set (fd, 0x27, 0x0d); + cp2155_set (fd, 0x37, 0x0d); + cp2155_set (fd, 0x28, 0x0d); + cp2155_set (fd, 0x38, 0x0d); + cp2155_set (fd, 0x29, 0x0d); + cp2155_set (fd, 0x39, 0x0d); + cp2155_set (fd, 0x2a, 0x0d); + cp2155_set (fd, 0x3a, 0x0d); + cp2155_set (fd, 0x2b, 0x0d); + cp2155_set (fd, 0x3b, 0x0d); + cp2155_set (fd, 0x2c, 0x0d); + cp2155_set (fd, 0x3c, 0x0d); + cp2155_set (fd, 0x2d, 0x0d); + cp2155_set (fd, 0x3d, 0x0d); + cp2155_set (fd, 0x2e, 0x0d); + cp2155_set (fd, 0x3e, 0x0d); + cp2155_set (fd, 0x2f, 0x0d); + cp2155_set (fd, 0x3f, 0x0d); + cp2155_set (fd, 0x30, 0x0d); + cp2155_set (fd, 0x40, 0x0d); + cp2155_set (fd, 0x31, 0x0d); + cp2155_set (fd, 0x41, 0x0d); + cp2155_set (fd, 0x32, 0x0d); + cp2155_set (fd, 0x42, 0x0d); + cp2155_set (fd, 0xca, 0x00); + cp2155_set (fd, 0xca, 0x00); + cp2155_set (fd, 0xca, 0x00); + cp2155_set (fd, 0x18, 0x00); + + memcpy (buf + 0x0000, + "\x04\x70\xf4\x01\x80\x25\x00\x25\x84\x24\x0b\x24\x96\x23\x23\x23", + 16); + memcpy (buf + 0x0010, + "\xb3\x22\x46\x22\xdb\x21\x73\x21\x0e\x21\xab\x20\x4a\x20\xeb\x1f", + 16); + memcpy (buf + 0x0020, + "\x8f\x1f\x34\x1f\xdc\x1e\x85\x1e\x31\x1e\xde\x1d\x8d\x1d\x3e\x1d", + 16); + memcpy (buf + 0x0030, + "\xf0\x1c\xa4\x1c\x59\x1c\x10\x1c\xc9\x1b\x83\x1b\x3e\x1b\xfa\x1a", + 16); + memcpy (buf + 0x0040, + "\xb8\x1a\x77\x1a\x38\x1a\xf9\x19\xbc\x19\x80\x19\x44\x19\x0a\x19", + 16); + memcpy (buf + 0x0050, + "\xd1\x18\x99\x18\x62\x18\x2c\x18\xf7\x17\xc3\x17\x8f\x17\x5d\x17", + 16); + memcpy (buf + 0x0060, + "\x2b\x17\xfa\x16\xca\x16\x9b\x16\x6c\x16\x3e\x16\x11\x16\xe5\x15", + 16); + memcpy (buf + 0x0070, + "\xb9\x15\x8e\x15\x64\x15\x3a\x15\x11\x15\xe9\x14\xc1\x14\x9a\x14", + 16); + memcpy (buf + 0x0080, + "\x73\x14\x4d\x14\x27\x14\x02\x14\xde\x13\xba\x13\x96\x13\x74\x13", + 16); + memcpy (buf + 0x0090, + "\x51\x13\x2f\x13\x0d\x13\xec\x12\xcc\x12\xab\x12\x8c\x12\x6c\x12", + 16); + memcpy (buf + 0x00a0, + "\x4d\x12\x2f\x12\x11\x12\xf3\x11\xd5\x11\xb8\x11\x9c\x11\x80\x11", + 16); + memcpy (buf + 0x00b0, + "\x64\x11\x48\x11\x2d\x11\x12\x11\xf7\x10\xdd\x10\xc3\x10\xa9\x10", + 16); + memcpy (buf + 0x00c0, + "\x90\x10\x77\x10\x5e\x10\x46\x10\x2e\x10\x16\x10\xfe\x0f\xe7\x0f", + 16); + memcpy (buf + 0x00d0, + "\xd0\x0f\xb9\x0f\xa2\x0f\x8c\x0f\x76\x0f\x60\x0f\x4b\x0f\x35\x0f", + 16); + memcpy (buf + 0x00e0, + "\x20\x0f\x0b\x0f\xf7\x0e\xe2\x0e\xce\x0e\xba\x0e\xa6\x0e\x92\x0e", + 16); + memcpy (buf + 0x00f0, + "\x7f\x0e\x6c\x0e\x59\x0e\x46\x0e\x33\x0e\x21\x0e\x0f\x0e\xfd\x0d", + 16); + memcpy (buf + 0x0100, + "\xeb\x0d\xd9\x0d\xc8\x0d\xb6\x0d\xa5\x0d\x94\x0d\x83\x0d\x73\x0d", + 16); + memcpy (buf + 0x0110, + "\x62\x0d\x52\x0d\x41\x0d\x31\x0d\x22\x0d\x12\x0d\x02\x0d\xf3\x0c", + 16); + memcpy (buf + 0x0120, + "\xe3\x0c\xd4\x0c\xc5\x0c\xb6\x0c\xa7\x0c\x99\x0c\x8a\x0c\x7c\x0c", + 16); + memcpy (buf + 0x0130, + "\x6e\x0c\x60\x0c\x52\x0c\x44\x0c\x36\x0c\x28\x0c\x1b\x0c\x0d\x0c", + 16); + memcpy (buf + 0x0140, + "\x00\x0c\xf3\x0b\xe6\x0b\xd9\x0b\xcc\x0b\xbf\x0b\xb3\x0b\xa6\x0b", + 16); + memcpy (buf + 0x0150, + "\x9a\x0b\x8e\x0b\x81\x0b\x75\x0b\x69\x0b\x5d\x0b\x52\x0b\x46\x0b", 16); - memcpy (buf + 0x00000010, - "\x00\xff\x00\xff\x00\xff\x00\xff\x00\xff\x00\xff\x00\x00\x00\x00", + memcpy (buf + 0x0160, + "\x3a\x0b\x2f\x0b\x23\x0b\x18\x0b\x0d\x0b\x02\x0b\xf6\x0a\xeb\x0a", 16); - memcpy (buf + 0x00000020, "\x00\x00\x00\x00", 4); - count = 36; - sanei_usb_write_bulk (fd, buf, &count); - cp2155_set (fd, 0x71, 0x01); - cp2155_set (fd, 0x0230, 0x11); - cp2155_set (fd, 0x71, 0x14); - cp2155_set (fd, 0x72, 0x00); - cp2155_set (fd, 0x73, 0x20); - cp2155_set (fd, 0x74, 0x03); - cp2155_set (fd, 0x75, 0x08); - cp2155_set (fd, 0x76, 0x00); - cp2155_set (fd, 0x0239, 0x40); - cp2155_set (fd, 0x0238, 0x89); - cp2155_set (fd, 0x023c, 0x2f); - cp2155_set (fd, 0x0264, 0x20); + memcpy (buf + 0x0170, + "\xe1\x0a\xd6\x0a\xcb\x0a\xc0\x0a\xb6\x0a\xab\x0a\xa1\x0a\x97\x0a", + 16); + memcpy (buf + 0x0180, + "\x8c\x0a\x82\x0a\x78\x0a\x6e\x0a\x64\x0a\x5a\x0a\x50\x0a\x47\x0a", + 16); + memcpy (buf + 0x0190, + "\x3d\x0a\x33\x0a\x2a\x0a\x20\x0a\x17\x0a\x0e\x0a\x04\x0a\xfb\x09", + 16); + memcpy (buf + 0x01a0, + "\xf2\x09\xe9\x09\xe0\x09\xd7\x09\xce\x09\xc6\x09\xbd\x09\xb4\x09", + 16); + memcpy (buf + 0x01b0, + "\xab\x09\xa3\x09\x9a\x09\x92\x09\x8a\x09\x81\x09\x79\x09\x71\x09", + 16); + memcpy (buf + 0x01c0, + "\x69\x09\x61\x09\x59\x09\x51\x09\x49\x09\x41\x09\x39\x09\x31\x09", + 16); + memcpy (buf + 0x01d0, + "\x29\x09\x22\x09\x1a\x09\x12\x09\x0b\x09\x03\x09\xfc\x08\xf5\x08", + 16); + memcpy (buf + 0x01e0, + "\xed\x08\xe6\x08\xdf\x08\xd8\x08\xd0\x08\xc9\x08\xc2\x08\xbb\x08", + 16); + memcpy (buf + 0x01f0, + "\xb4\x08\xad\x08\xa6\x08\xa0\x08\x00\x00\x00\x00\x00\x00\x00\x00", + 16); + memcpy (buf + 0x0200, "\x00\x00\x00\x00", 4); + count = 516; + write_buf (fd, count, buf, 0x03, 0x00); + write_buf (fd, count, buf, 0x03, 0x02); + write_buf (fd, count, buf, 0x03, 0x06); + memcpy (buf + 0x00000000, - "\x04\x70\x18\x00\x00\xff\x00\xff\x00\xff\x00\xff\x00\xff\x00\xff", + "\x04\x70\x18\x00\x80\x25\xc0\x1c\x4f\x17\x9a\x13\xe9\x10\xde\x0e", 16); memcpy (buf + 0x00000010, - "\x00\xff\x00\xff\x00\xff\x00\xff\x00\xff\x00\xff\x00\x00\x00\x00", + "\x44\x0d\xfa\x0b\xea\x0a\x07\x0a\x46\x09\xa0\x08\x80\x25\x80\x25", 16); - memcpy (buf + 0x00000020, "\x00\x00\x00\x00", 4); + memcpy (buf + 0x00000020, "\x80\x25\x80\x25", 4); count = 36; - sanei_usb_write_bulk (fd, buf, &count); - cp2155_set (fd, 0x9b, 0x00); + write_buf (fd, count, buf, 0x03, 0x04); + write_buf (fd, count, buf, 0x03, 0x08); + cp2155_set (fd, 0x10, 0x05); - cp2155_set (fd, 0x11, 0x91); - cp2155_set (fd, 0x60, 0x15); + cp2155_set (fd, 0x11, 0x35); + cp2155_set (fd, 0x60, 0x01); cp2155_set (fd, 0x80, 0x12); cp2155_set (fd, 0x03, 0x01); - cp2155_set (fd, 0x71, 0x01); - cp2155_set (fd, 0x0230, 0x11); - cp2155_set (fd, 0x71, 0x18); - cp2155_set (fd, 0x72, 0x00); - cp2155_set (fd, 0x73, 0x10); - cp2155_set (fd, 0x0239, 0x40); - cp2155_set (fd, 0x0238, 0x89); - cp2155_set (fd, 0x023c, 0x2f); - cp2155_set (fd, 0x0264, 0x20); - -} - -void -send_start_blob (CANON_Handle * chndl) -{ - unsigned char buf[0xf000]; - - int fd; - fd = chndl->fd; - -/* value_51: lamp colors - bit 0 set: red on, bit 1 set: green on, bit 2 set: blue on - all bits off: no scan is made -*/ - chndl->value_51 = 0x07; - - switch (chndl->val[opt_resolution].w) - { - case 75: - chndl->value_67 = 0x0a; /* 3*7300/8 */ - chndl->value_68 = 0xb1; - break; - case 150: - chndl->value_67 = 0x15; /* 3*7300/4 */ - chndl->value_68 = 0x63; - break; - case 300: - chndl->value_67 = 0x2a; /* 3*7300/2 */ - chndl->value_68 = 0xc6; - break; - case 600: - chndl->value_67 = 0x55; /* 3*7300 */ - chndl->value_68 = 0x8c; - break; - case 1200: - chndl->value_67 = 0xab; /* 6*7300 */ - chndl->value_68 = 0x18; - } - - cp2155_block6 (fd, 0x12, 0x83); - cp2155_set (fd, 0x90, 0xf8); - cp2155_block6 (fd, 0x12, 0x83); -/* start preparing real scan */ - cp2155_set (fd, 0x01, 0x29); - cp2155_block8 (fd); - cp2155_set (fd, 0x01, 0x29); - cp2155_set_gamma (fd); - - switch (chndl->val[opt_resolution].w) - { - case 75: - startblob0075 (chndl, buf); - break; - case 150: - startblob0150 (chndl, buf); - break; - case 300: - startblob0300 (chndl, buf); - break; - case 600: - cp2155_set_gamma600 (fd); - startblob0600 (chndl, buf); - break; - case 1200: - startblob1200 (chndl, buf); - } -} - -/* Wait until data ready */ -static long -wait_for_data (CANON_Handle * chndl) -{ - int fd; - fd = chndl->fd; - time_t start_time = time (NULL); - long size; - byte value; - - DBG (12, "waiting...\n"); - - while (1) - { - size = 0; - cp2155_get (fd, 0x46, &value); - DBG (1, "home sensor: %02x\n", value); - if (value == 0) - { - send_start_blob (chndl); - cp2155_get (fd, 0x46, &value); - DBG (1, "home sensor: %02x\n", value); - } - - if (cp2155_get (fd, 0xa5, &value) != SANE_STATUS_GOOD) - { - return -1; - } - - size += value; - - if (cp2155_get (fd, 0xa6, &value) != SANE_STATUS_GOOD) - { - return -1; - } - - size <<= 8; - size += value; - - if (cp2155_get (fd, 0xa7, &value) != SANE_STATUS_GOOD) - { - return -1; - } - - size <<= 8; - size += value; - - if (size != 0) - { - return 2 * size; - } - - /* Give it 5 seconds */ - if ((time (NULL) - start_time) > 5) - { - DBG (1, "wait_for_data: timed out (%ld)\n", size); - return -1; - } - usleep (1 * MSEC); - } } static void -go_home_without_wait (int fd) +go_home_without_wait (CANON_Handle * chndl) { + unsigned char buf[0x400]; + int fd = chndl->fd; byte value; cp2155_get (fd, 0x46, &value); if (value == 0x08) { return; } - cp2155_block6 (fd, 0x12, 0xc1); - cp2155_set (fd, 0x01, 0x29); - cp2155_block8 (fd); - cp2155_set (fd, 0x01, 0x29); - cp2155_set_gamma (fd); - cp2155_block5 (fd, 0x03); - cp2155_set_regs (fd, cp2155_set_regs_data6); - cp2155_set_slope (fd, 0x030000, cp2155_slope09_back, 0x01f4); - cp2155_set_slope (fd, 0x030200, cp2155_slope09_back, 0x01f4); - cp2155_set_slope (fd, 0x030400, cp2155_slope10_back, 0x0018); - cp2155_set_slope (fd, 0x030600, cp2155_slope09_back, 0x01f4); - cp2155_set_slope (fd, 0x030800, cp2155_slope10_back, 0x0018); - - cp2155_motor (fd, 0x05, 0x35); + + DBG (1, "go_home_without_wait: product code: %x\n", chndl->productcode); + if (chndl->productcode == 0x2225) + { + back2225 (fd, buf); + } + else + { + back2224 (fd, buf); + } } static int -go_home (int fd) +go_home (CANON_Handle * chndl) { + int fd = chndl->fd; byte value; cp2155_get (fd, 0x46, &value); + DBG (1, "state sensor: %02x\n", value); if (value == 0x08) { return 0; } - go_home_without_wait (fd); + go_home_without_wait (chndl); while (1) { usleep (200 * MSEC); cp2155_get (fd, 0x46, &value); - DBG (1, "home sensor: %02x\n", value); + DBG (1, "state sensor: %02x\n", value); if (value == 0x08) { @@ -2412,72 +3288,6 @@ go_home (int fd) 0 afterward, and -1 on error. */ -static int -init (CANON_Handle * chndl) -{ - int fd = chndl->fd; - byte value; - int result = 0; - - cp2155_get (fd, 0xd0, &value); - /* Detect if scanner is plugged in */ - if (value != 0x81 && value != 0x40) - { - DBG (0, "INIT: unexpected value: %x\n", value); - } - - if (value == 0x00) - { - return -1; - } - - cp2155_set (fd, 0x02, 0x01); - cp2155_set (fd, 0x02, 0x00); - cp2155_set (fd, 0x01, 0x00); - cp2155_set (fd, 0x01, 0x28); - cp2155_set (fd, 0x90, 0x4f); - cp2155_set (fd, 0x92, 0xff); - cp2155_set (fd, 0x93, 0x00); - cp2155_set (fd, 0x91, 0x1f); - cp2155_set (fd, 0x95, 0x1f); - cp2155_set (fd, 0x97, 0x1f); - cp2155_set (fd, 0x9b, 0x00); - cp2155_set (fd, 0x9c, 0x07); - cp2155_set (fd, 0x90, 0x4d); - cp2155_set (fd, 0x90, 0xcd); - cp2155_set (fd, 0x90, 0xcc); - cp2155_set (fd, 0x9b, 0x01); - cp2155_set (fd, 0xa0, 0x04); - cp2155_set (fd, 0xa0, 0x05); - cp2155_set (fd, 0x01, 0x28); - cp2155_set (fd, 0x04, 0x0c); - cp2155_set (fd, 0x05, 0x00); - cp2155_set (fd, 0x06, 0x00); - cp2155_set (fd, 0x98, 0x00); - cp2155_set (fd, 0x98, 0x00); - cp2155_set (fd, 0x98, 0x02); - cp2155_set (fd, 0x99, 0x28); - cp2155_set (fd, 0x9a, 0x03); - cp2155_set (fd, 0x80, 0x10); - cp2155_set (fd, 0x8d, 0x00); - cp2155_set (fd, 0x8d, 0x04); - - cp2155_set (fd, 0x85, 0x00); - cp2155_set (fd, 0x87, 0x00); - cp2155_set (fd, 0x88, 0x70); - - cp2155_set (fd, 0x85, 0x03); - cp2155_set (fd, 0x87, 0x00); - cp2155_set (fd, 0x88, 0x28); - - cp2155_set (fd, 0x85, 0x06); - cp2155_set (fd, 0x87, 0x00); - cp2155_set (fd, 0x88, 0x28); - - - DBG (1, "INIT state: %0d\n", result); - return result; -} /* Scan and save the resulting image as r,g,b non-interleaved PPM file */ static SANE_Status @@ -2645,7 +3455,6 @@ do_scan (CANON_Handle * chndl) DBG (1, "err:%s when opening %s\n", strerror (errno), chndl->fname); return SANE_STATUS_IO_ERROR; } - int fd = chndl->fd; long width = chndl->params.pixels_per_line; if (chndl->val[opt_resolution].w < 600) { @@ -2666,10 +3475,24 @@ do_scan (CANON_Handle * chndl) case 150: case 300: case 600: - left_edge = 0x69; + if (chndl->productcode == 0x2224) + { + left_edge = 0x1b3; + } + else + { + left_edge = 0x69; + } break; case 1200: - left_edge = 0x87; + if (chndl->productcode == 0x2224) + { + left_edge = 0x1e3; + } + else + { + left_edge = 0x87; + } } x_start = left_edge + chndl->x1 * chndl->val[opt_resolution].w / 600; if (chndl->val[opt_resolution].w < 600) @@ -2696,7 +3519,7 @@ do_scan (CANON_Handle * chndl) { status = preread (chndl, outbuf, fp); } - go_home_without_wait (fd); + go_home_without_wait (chndl); if (status == SANE_STATUS_EOF) { @@ -2873,11 +3696,11 @@ CANON_open_device (CANON_Handle * scan, const char *dev) if (vendor == 0x04a9) { scan->product = "Canon"; - + scan->productcode = product; if (product == 0x2224) - { - scan->product = "CanoScan LiDE 600F"; - } + { + scan->product = "CanoScan LiDE 600F"; + } else if (product == 0x2225) { scan->product = "CanoScan LiDE 70"; @@ -2957,7 +3780,7 @@ CANON_start_scan (CANON_Handle * chndl) return SANE_STATUS_IO_ERROR; } - go_home (chndl->fd); + go_home (chndl); /* scan */ if ((status = scan (chndl)) != SANE_STATUS_GOOD) diff --git a/backend/canon_lide70.c b/backend/canon_lide70.c index 100a45f..8f18ed9 100644 --- a/backend/canon_lide70.c +++ b/backend/canon_lide70.c @@ -17,11 +17,9 @@ 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. + along with this program. If not, see . - This file implements a SANE backend for the Canon CanoScan LiDE 70 */ + This file implements a SANE backend for the Canon CanoScan LiDE 70 and 600 */ #define BUILD 0 #define MM_IN_INCH 25.4 @@ -391,6 +389,10 @@ init_options (CANON_Handle * chndl) od->size = sizeof (SANE_Word); od->cap = SANE_CAP_SOFT_DETECT | SANE_CAP_SOFT_SELECT; od->constraint_type = SANE_CONSTRAINT_WORD_LIST; + if (chndl->productcode == 0x2224) + { + resolution_list[0] = 4; + } od->constraint.word_list = resolution_list; chndl->val[opt_resolution].w = init_resolution; diff --git a/backend/canon_lide70.conf.in b/backend/canon_lide70.conf.in index 97b551c..af5126e 100644 --- a/backend/canon_lide70.conf.in +++ b/backend/canon_lide70.conf.in @@ -3,6 +3,9 @@ # Autodetect the Canon CanoScan LiDE 70 usb 0x04a9 0x2225 +# Autodetect the Canon CanoScan LiDE 600 +usb 0x04a9 0x2224 + # device list for non-linux-systems (enable if autodetect fails): #/dev/scanner #/dev/usb/scanner0 diff --git a/backend/canon_pp-dev.c b/backend/canon_pp-dev.c index df7c4aa..7d7f7c1 100644 --- a/backend/canon_pp-dev.c +++ b/backend/canon_pp-dev.c @@ -13,9 +13,7 @@ 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. + along with this program. If not, see . As a special exception, the authors of SANE give permission for additional uses of the libraries contained in this release of SANE. @@ -43,8 +41,6 @@ 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 functions. @@ -84,11 +80,6 @@ static void DBG(int level, const char *format, ...) } #else -/* Definitions which only apply to SANE compiles */ -#ifndef VERSION -#define VERSION "$Revision$" -#endif - #define DEBUG_DECLARE_ONLY #include "canon_pp.h" #include "../include/sane/sanei_config.h" @@ -770,7 +761,7 @@ 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 bizarre 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 diff --git a/backend/canon_pp-dev.h b/backend/canon_pp-dev.h index 4ad2e45..a4cd2a1 100644 --- a/backend/canon_pp-dev.h +++ b/backend/canon_pp-dev.h @@ -13,9 +13,7 @@ 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. + along with this program. If not, see . As a special exception, the authors of SANE give permission for additional uses of the libraries contained in this release of SANE. @@ -40,8 +38,6 @@ ----- - canon_pp-dev.h: $Revision$ - This file is part of the canon_pp backend, supporting Canon FBX30P and NX40P scanners and also part of the stand-alone driver. diff --git a/backend/canon_pp-io.c b/backend/canon_pp-io.c index 97ee526..0b92b11 100644 --- a/backend/canon_pp-io.c +++ b/backend/canon_pp-io.c @@ -13,9 +13,7 @@ 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. + along with this program. If not, see . As a special exception, the authors of SANE give permission for additional uses of the libraries contained in this release of SANE. @@ -43,8 +41,6 @@ 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-io.c: $Revision$ - Low Level Function library for Canon CanoScan Parallel Scanners by Simon Krix */ @@ -74,11 +70,6 @@ static void DBG(int level, const char *format, ...) } #else -/* Definitions which only apply to SANE compiles */ -#ifndef VERSION -#define VERSION "$Revision$" -#endif - /* Fix problem with DBG macro definition having a - in the name */ #define DEBUG_DECLARE_ONLY #include "canon_pp.h" diff --git a/backend/canon_pp-io.h b/backend/canon_pp-io.h index ad04180..193305f 100644 --- a/backend/canon_pp-io.h +++ b/backend/canon_pp-io.h @@ -13,9 +13,7 @@ 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. + along with this program. If not, see . As a special exception, the authors of SANE give permission for additional uses of the libraries contained in this release of SANE. @@ -40,8 +38,6 @@ ----- - canon_pp-io.h: $Revision$ - 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. diff --git a/backend/canon_pp.c b/backend/canon_pp.c index 822eaf1..5a23892 100644 --- a/backend/canon_pp.c +++ b/backend/canon_pp.c @@ -13,9 +13,7 @@ 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. + along with this program. If not, see . As a special exception, the authors of SANE give permission for additional uses of the libraries contained in this release of SANE. @@ -40,8 +38,6 @@ ----- - canon_pp.c: $Revision$ - This file is part of the canon_pp backend, supporting Canon FBX30P and NX40P scanners */ @@ -60,10 +56,6 @@ #include "../include/sane/config.h" #endif -#ifndef VERSION -#define VERSION "$Revision$" -#endif - #include #include #include @@ -367,7 +359,7 @@ sane_init (SANE_Int *vc, SANE_Auth_Callback cb) continue; } - /* detect_mode suceeded, so the port is open. This beholdens + /* detect_mode succeeded, so the port is open. This beholdens * us to call ieee1284_close in any of the remaining error * cases in this loop. */ #if 0 @@ -456,7 +448,7 @@ sane_init (SANE_Int *vc, SANE_Auth_Callback cb) * * sane_get_devices() * - * Gives a list of devices avaialable. In our case, that's the linked + * Gives a list of devices available. In our case, that's the linked * list produced by sane_init. * *************************************************************************/ @@ -1222,7 +1214,7 @@ sane_read (SANE_Handle h, SANE_Byte *buf, SANE_Int maxlen, SANE_Int *lenp) /* 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 */ + * to leave the scanner consistent */ /* Decide how many lines we can fit into this buffer */ if (cs->vals[OPT_DEPTH] == 0) @@ -1464,7 +1456,7 @@ sane_exit (void) /* Should normally nullify pointers after freeing, but in * this case we're about to free the whole structure so - * theres not a lot of point. */ + * there's not a lot of point. */ /* Constraints (mostly) allocated when the scanner is opened */ if(dev->opt[OPT_TL_X].constraint.range) @@ -1701,7 +1693,7 @@ static SANE_Status init_device(struct parport *pp) /* * NOTE: Ranges and lists are actually set when scanner is opened, - * becase that's when we find out what sort of scanner it is + * because that's when we find out what sort of scanner it is */ DBG(100, "init_device: done opts\n"); diff --git a/backend/canon_pp.conf.in b/backend/canon_pp.conf.in index c12d763..439537c 100644 --- a/backend/canon_pp.conf.in +++ b/backend/canon_pp.conf.in @@ -11,9 +11,9 @@ ieee1284 parport0 # Parameters are: # calibrate /path/to/calibration-file port-name # -# The format of port-name is dependant on your OS version. +# The format of port-name is dependent on your OS version. # -# If a file isn't speficied, the default name will be +# If a file isn't specified, the default name will be # ~/.sane/canon_pp-calibration-[port-name] calibrate ~/.sane/canon_pp-calibration-pp0 parport0 diff --git a/backend/canon_pp.h b/backend/canon_pp.h index 2dfee98..90cd0b7 100644 --- a/backend/canon_pp.h +++ b/backend/canon_pp.h @@ -13,9 +13,7 @@ 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. + along with this program. If not, see . As a special exception, the authors of SANE give permission for additional uses of the libraries contained in this release of SANE. @@ -40,8 +38,6 @@ ----- - canon_pp.h: $Revision$ - This file is part of the canon_pp backend, supporting Canon FBX30P and NX40P scanners diff --git a/backend/cardscan.c b/backend/cardscan.c index ec776d1..8090006 100644 --- a/backend/cardscan.c +++ b/backend/cardscan.c @@ -18,9 +18,7 @@ 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. + along with this program. If not, see . As a special exception, the authors of SANE give permission for additional uses of the libraries contained in this release of SANE. @@ -167,7 +165,7 @@ many times { 14/94 and 22/a2 -########### discarge capacitor? ########### +########### discharge capacitor? ########### four times { >> 21 02 00 0a 00 << a1 00 02 00 0a 00 @@ -879,7 +877,7 @@ sane_control_option (SANE_Handle handle, SANE_Int option, DBG (20, "sane_control_option: set value for '%s' (%d)\n", s->opt[option].name,option); if ( s->started ) { - DBG (5, "sane_control_option: cant set, device busy\n"); + DBG (5, "sane_control_option: can't set, device busy\n"); return SANE_STATUS_DEVICE_BUSY; } @@ -1366,7 +1364,7 @@ read_from_scanner_color(struct scanner *s) * handle h is a valid handle) but usually affects long-running * operations only (such as image is acquisition). It is safe to call * this function asynchronously (e.g., from within a signal handler). - * It is important to note that completion of this operaton does not + * It is important to note that completion of this operation does not * imply that the currently pending operation has been cancelled. It * only guarantees that cancellation has been initiated. Cancellation * completes only when the cancelled call returns (typically with a diff --git a/backend/coolscan-scsidef.h b/backend/coolscan-scsidef.h index da7eaa6..ddf8880 100644 --- a/backend/coolscan-scsidef.h +++ b/backend/coolscan-scsidef.h @@ -14,9 +14,7 @@ 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. + along with this program. If not, see . As a special exception, the authors of SANE give permission for additional uses of the libraries contained in this release of SANE. @@ -279,7 +277,7 @@ static scsiblk window_parameter_data_block = static unsigned char window_descriptor_blockC[] = { -/* Any field maked with 'R' (e.g. R0x55) indicate a filed provided for +/* Any field marked with 'R' (e.g. R0x55) indicate a field provided for * development. In normal operation, 0 is set here. If any other value is set, * operationis not guaranteed! */ diff --git a/backend/coolscan.c b/backend/coolscan.c index 4904afc..a7760c3 100644 --- a/backend/coolscan.c +++ b/backend/coolscan.c @@ -15,9 +15,7 @@ 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. + along with this program. If not, see . As a special exception, the authors of SANE give permission for additional uses of the libraries contained in this release of SANE. @@ -52,10 +50,10 @@ . - sane_open() : open a particular scanner-device . . - sane_set_io_mode : set blocking-mode . . - sane_get_select_fd : get scanner-fd - . . - sane_get_option_descriptor() : get option informations + . . - sane_get_option_descriptor() : get option information . . - sane_control_option() : change option values . . - . . - sane_start() : start image aquisition + . . - sane_start() : start image acquisition . . - sane_get_parameters() : returns actual scan-parameters . . - sane_read() : read image-data (from pipe) . . @@ -380,7 +378,7 @@ resValToDiv (int res_val) } } /* - * use mode select to force a mesurement divisor of 2700 + * use mode select to force a measurement divisor of 2700 */ static unsigned char mode_select[] = { @@ -615,9 +613,9 @@ coolscan_set_window_param_LS20 (Coolscan_t * s, int prescan) } else { - /* Quote spec: "It is recomended that analog gamma bits 5, 4 and 3 be + /* Quote spec: "It is recommended that analog gamma bits 5, 4 and 3 be * set to 1 (OFF) when the object type of byte 48 is positive and the - * gamma specificateion of byte 51 is linear, and to 0 (ON) in all + * gamma specification of byte 51 is linear, and to 0 (ON) in all * other cases." */ /* int foo; @@ -771,7 +769,7 @@ coolscan_set_window_param_LS30 (Coolscan_t * s, int wid, int prescan) else set_WD_composition (buffer_r, WD_comp_rgb_full); /* RGB composition */ - set_WD_composition (buffer_r, WD_comp_rgb_full); /* allways RGB composition */ + set_WD_composition (buffer_r, WD_comp_rgb_full); /* always RGB composition */ /* Bits per pixel */ set_WD_bitsperpixel(buffer_r, s->bits_per_color); @@ -838,7 +836,7 @@ coolscan_set_window_param (Coolscan_t * s, int prescan) ret=0; DBG (10, "set_window_param\n"); - if(s->LS<2) /* distinquish between old and new scanners */ + if(s->LS<2) /* distinguish between old and new scanners */ { ret=coolscan_set_window_param_LS20 (s,prescan); } else @@ -993,7 +991,7 @@ coolscan_get_window_param (Coolscan_t * s, int prescanok) DBG (10, "get_window_param\n"); ret=0; - if(s->LS<2) /* distinquish between old and new scanners */ + if(s->LS<2) /* distinguish between old and new scanners */ { ret=coolscan_get_window_param_LS20 (s); } else @@ -1466,7 +1464,7 @@ get_inquiery_part_LS30 (Coolscan_t * s, unsigned char part) { int size; - /* Get length of reponse */ + /* Get length of response */ inquiry.cmd[1]=0x01; inquiry.cmd[2]=part; size=4; @@ -1686,7 +1684,7 @@ get_internal_info (Coolscan_t * s) DBG (10, "get_internal_info\n"); - if(s->LS<2) /* distinquish between old and new scanners */ + if(s->LS<2) /* distinguish between old and new scanners */ { ret=get_internal_info_LS20 (s); } else @@ -2178,7 +2176,7 @@ typedef struct Color_correct_s function: RGBIfix - taks: Correct the infrared channel + task: Correct the infrared channel import: unsigned char * rgbimat - RGBI - matrix from scanner int size - number of pixels to correct @@ -2265,7 +2263,7 @@ static int Calc_fix_LUT(Coolscan_t * s) function: RGBIfix - taks: Correct the infrared channel + task: Correct the infrared channel import: unsigned char * rgbimat - RGBI - matrix from scanner int size - number of pixels to correct @@ -2332,7 +2330,7 @@ static int RGBIfix(Coolscan_t * scanner, function: RGBIfix16 - taks: Correct the infrared channel for 16 bit images + task: Correct the infrared channel for 16 bit images (doesn't do anything for now) import: unsigned char * rgbimat - RGBI - matrix from scanner @@ -2387,7 +2385,7 @@ static int RGBIfix16(Coolscan_t * scanner, function: rgb2g - taks: Convert RGB data to grey + task: Convert RGB data to grey import: unsigned char * rgbimat - RGB - matrix from scanner int size - size of input data (num pixel) @@ -2426,8 +2424,8 @@ static int rgb2g(unsigned char* rgbimat,unsigned char* gomat, function: RGBIfix1 - taks: Correct the infrared channel. - The input image data is the output of scaning + task: Correct the infrared channel. + The input image data is the output of scanning with LUT. To calculate the original values the lutr and luti is applied. The infrared values is corrected by: diff --git a/backend/coolscan.h b/backend/coolscan.h index 4f40aa4..b154743 100644 --- a/backend/coolscan.h +++ b/backend/coolscan.h @@ -13,9 +13,7 @@ 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. + along with this program. If not, see . As a special exception, the authors of SANE give permission for additional uses of the libraries contained in this release of SANE. @@ -147,7 +145,7 @@ typedef struct Coolscan int LS; /* index in scanner_str */ int cont; /* continue although scanner is unknown */ - int verbose; /* 1,2=output informations */ + int verbose; /* 1,2=output information */ int asf; /* Automatic Slide Feeder enabled? */ int MUD; /* Measurement Unit Divisor (1200 or 2700) */ @@ -317,7 +315,7 @@ static char *scanner_str[] = #define known_scanners 4 -/* Comment this line if you havn't patched sane.h to include +/* Comment this line if you haven't patched sane.h to include SANE_FRAME_RGBA */ /* #define HAS_IRED 1 */ diff --git a/backend/coolscan2.c b/backend/coolscan2.c index 04c4d10..9b1f570 100644 --- a/backend/coolscan2.c +++ b/backend/coolscan2.c @@ -16,9 +16,7 @@ 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. + along with this program. If not, see . As a special exception, the authors of SANE give permission for additional uses of the libraries contained in this release of SANE. @@ -924,9 +922,9 @@ sane_open (SANE_String_Const name, SANE_Handle * h) o.cap = SANE_CAP_SOFT_SELECT | SANE_CAP_SOFT_DETECT; break; case CS2_OPTION_FOCUS: - o.name = "focus"; - o.title = "Focus position"; - o.desc = "Focus position for manual focus"; + o.name = SANE_NAME_FOCUS; + o.title = SANE_TITLE_FOCUS; + o.desc = SANE_DESC_FOCUS; o.type = SANE_TYPE_INT; o.unit = SANE_UNIT_NONE; o.size = WSIZE; @@ -944,9 +942,9 @@ sane_open (SANE_String_Const name, SANE_Handle * h) } break; case CS2_OPTION_AUTOFOCUS: - o.name = "autofocus"; - o.title = "Autofocus now"; - o.desc = "Autofocus now"; + o.name = SANE_NAME_AUTOFOCUS; + o.title = SANE_TITLE_AUTOFOCUS; + o.desc = SANE_DESC_AUTOFOCUS; o.type = SANE_TYPE_BUTTON; o.cap = SANE_CAP_SOFT_SELECT | SANE_CAP_SOFT_DETECT; break; diff --git a/backend/coolscan2.conf.in b/backend/coolscan2.conf.in index 45b9a7d..0e5ff0b 100644 --- a/backend/coolscan2.conf.in +++ b/backend/coolscan2.conf.in @@ -1,6 +1,6 @@ # coolscan2.conf: sample configuration file for coolscan2 backend # -# The following entrie checks for your scanner by manufacturer (SCSI) +# The following entry checks for your scanner by manufacturer (SCSI) # and by vendor and product ID (USB). This is what the backend does when # no configuration file can be found. # diff --git a/backend/coolscan3.c b/backend/coolscan3.c index 6163ec9..5bc5b5e 100644 --- a/backend/coolscan3.c +++ b/backend/coolscan3.c @@ -911,9 +911,9 @@ sane_open(SANE_String_Const name, SANE_Handle * h) o.cap = SANE_CAP_SOFT_SELECT | SANE_CAP_SOFT_DETECT; break; case CS3_OPTION_FOCUS: - o.name = "focus"; - o.title = "Focus position"; - o.desc = "Focus position for manual focus"; + o.name = SANE_NAME_FOCUS; + o.title = SANE_TITLE_FOCUS; + o.desc = SANE_DESC_FOCUS; o.type = SANE_TYPE_INT; o.unit = SANE_UNIT_NONE; o.size = WSIZE; @@ -931,9 +931,9 @@ sane_open(SANE_String_Const name, SANE_Handle * h) } break; case CS3_OPTION_AUTOFOCUS: - o.name = "autofocus"; - o.title = "Autofocus"; - o.desc = "Perform autofocus before scan"; + o.name = SANE_NAME_AUTOFOCUS; + o.title = SANE_TITLE_AUTOFOCUS; + o.desc = SANE_DESC_AUTOFOCUS; o.type = SANE_TYPE_BOOL; o.size = WSIZE; o.cap = SANE_CAP_SOFT_SELECT | SANE_CAP_SOFT_DETECT; diff --git a/backend/coolscan3.conf.in b/backend/coolscan3.conf.in index 5150d33..cadcd4f 100644 --- a/backend/coolscan3.conf.in +++ b/backend/coolscan3.conf.in @@ -1,6 +1,6 @@ # coolscan3.conf: sample configuration file for coolscan3 backend # -# The following entrie checks for your scanner by manufacturer (SCSI) +# The following entry checks for your scanner by manufacturer (SCSI) # and by vendor and product ID (USB). This is what the backend does when # no configuration file can be found. # diff --git a/backend/dc210.c b/backend/dc210.c index 85ffb20..f2d1ec3 100644 --- a/backend/dc210.c +++ b/backend/dc210.c @@ -20,9 +20,7 @@ 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. + along with this program. If not, see . As a special exception, the authors of SANE give permission for additional uses of the libraries contained in this release of SANE. diff --git a/backend/dc210.h b/backend/dc210.h index 2cbbf46..075cd00 100644 --- a/backend/dc210.h +++ b/backend/dc210.h @@ -20,9 +20,7 @@ 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. + along with this program. If not, see . As a special exception, the authors of SANE give permission for additional uses of the libraries contained in this release of SANE. diff --git a/backend/dc240.c b/backend/dc240.c index 0a53405..47aeab9 100644 --- a/backend/dc240.c +++ b/backend/dc240.c @@ -23,9 +23,7 @@ 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. + along with this program. If not, see . As a special exception, the authors of SANE give permission for additional uses of the libraries contained in this release of SANE. diff --git a/backend/dc240.h b/backend/dc240.h index 27e2ee9..39e0ac4 100644 --- a/backend/dc240.h +++ b/backend/dc240.h @@ -23,9 +23,7 @@ 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. + along with this program. If not, see . As a special exception, the authors of SANE give permission for additional uses of the libraries contained in this release of SANE. diff --git a/backend/dc25.c b/backend/dc25.c index 6188608..1d9032d 100644 --- a/backend/dc25.c +++ b/backend/dc25.c @@ -3,8 +3,6 @@ dc25.c - $Id$ - This file (C) 1998 Peter Fales This file is part of the SANE package. @@ -20,9 +18,7 @@ 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. + along with this program. If not, see . As a special exception, the authors of SANE give permission for additional uses of the libraries contained in this release of SANE. @@ -69,7 +65,7 @@ * /pub/hakimian directory. The complete URL is: * ftp://ftp.eecs.wsu.edu/pub/hakimian/dc20.tar.gz * - * This package also includes a sligthly modified version of the Comet to ppm + * This package also includes a slightly modified version of the Comet to ppm * conversion routine written by YOSHIDA Hideki * * This program is free software; you can redistribute it and/or modify @@ -1107,7 +1103,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 + * The original dc20ctrl program used a default gamma of 0.35, but I thought * 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. @@ -1389,7 +1385,7 @@ convert_pic (char *base_name, int format) if (format & SAVE_ADJASPECT) { /* - * Strech image + * Stretch image */ if (res) @@ -1764,7 +1760,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 + * takes long enough that the read may timeout without returning * any data before the erase is complete. We let this happen * up to 4 times, then give up. */ @@ -1841,8 +1837,7 @@ sane_init (SANE_Int * version_code, SANE_Auth_Callback __sane_unused__ authorize fp = sanei_config_open (DC25_CONFIG_FILE); - DBG (127, - "sane_init() $Id$\n"); + DBG (127, "sane_init()\n"); if (!fp) { @@ -2632,7 +2627,7 @@ sane_read (SANE_Handle __sane_unused__ handle, SANE_Byte * data, * 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 - * following prooperties: + * following properties: * 1) It's a smooth curve that provides the effect I wanted * (bright pixels are made brighter, dim pixels are made * dimmer) diff --git a/backend/dc25.h b/backend/dc25.h index b323835..7d10446 100644 --- a/backend/dc25.h +++ b/backend/dc25.h @@ -20,9 +20,7 @@ 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. + along with this program. If not, see . As a special exception, the authors of SANE give permission for additional uses of the libraries contained in this release of SANE. @@ -69,7 +67,7 @@ * /pub/hakimian directory. The complete URL is: * ftp://ftp.eecs.wsu.edu/pub/hakimian/dc20.tar.gz * - * This package also includes a sligthly modified version of the Comet to ppm + * This package also includes a slightly modified version of the Comet to ppm * conversion routine written by YOSHIDA Hideki * * This program is free software; you can redistribute it and/or modify diff --git a/backend/dell1600n_net.c b/backend/dell1600n_net.c index c8717d4..2436dd4 100644 --- a/backend/dell1600n_net.c +++ b/backend/dell1600n_net.c @@ -15,9 +15,7 @@ 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. + along with this program. If not, see . As a special exception, the authors of SANE give permission for additional uses of the libraries contained in this release of SANE. @@ -122,7 +120,7 @@ struct ScannerState int m_numPages; /* number of complete pages (host byte order) */ struct ComBuf m_pageInfo; /* "array" of numPages PageInfo structs */ int m_bFinish; /* set non-0 to signal that we are finished */ - int m_bCancelled; /* set non-0 that bFinish state arose from cancelation */ + int m_bCancelled; /* set non-0 that bFinish state arose from cancellation */ char m_regName[REG_NAME_SIZE]; /* name with which to register */ unsigned short m_xres; /* x resolution (network byte order) */ unsigned short m_yres; /* y resolution (network byte order) */ @@ -233,6 +231,9 @@ static void JpegDecompTermSource (j_decompress_ptr cinfo); /* Results of last call to sane_get_devices */ static struct DeviceRecord *gKnownDevices[MAX_SCANNERS]; +/* Empty list for when network devices are not wanted */ +static const SANE_Device *gEmptyDeviceList[1]; + /* Array of open scanner device states. :NOTE: (int)SANE_Handle is an offset into this array */ static struct ScannerState *gOpenScanners[MAX_SCANNERS]; @@ -288,8 +289,7 @@ sane_exit (void) /***********************************************************/ SANE_Status -sane_get_devices (const SANE_Device *** device_list, - SANE_Bool __sane_unused__ local_only) +sane_get_devices (const SANE_Device *** device_list, SANE_Bool local_only) { int ret; @@ -307,11 +307,17 @@ sane_get_devices (const SANE_Device *** device_list, const char *pVal; int valLen; + if (local_only) { + *device_list = gEmptyDeviceList; + return SANE_STATUS_GOOD; + } + /* init variables */ ret = SANE_STATUS_GOOD; sock = 0; pDevice = NULL; optYes = 1; + InitComBuf (&queryPacket); /* clear previous results */ @@ -694,7 +700,7 @@ sane_start (SANE_Handle handle) if (!ValidScannerNumber (iHandle)) return SANE_STATUS_INVAL; - /* check if we still have oustanding pages of data on this handle */ + /* check if we still have outstanding pages of data on this handle */ if (gOpenScanners[iHandle]->m_imageData.m_used){ /* remove empty page */ @@ -1748,7 +1754,7 @@ cleanup: /***********************************************************/ /* remove data from the front of a ComBuf struct - \return 0 if sucessful, >0 otherwise + \return 0 if successful, >0 otherwise */ int PopFromComBuf (struct ComBuf *pBuf, size_t datSize) diff --git a/backend/dll.c b/backend/dll.c index d78d409..a3233e8 100644 --- a/backend/dll.c +++ b/backend/dll.c @@ -13,9 +13,7 @@ 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. + along with this program. If not, see . As a special exception, the authors of SANE give permission for additional uses of the libraries contained in this release of SANE. @@ -477,9 +475,6 @@ load (struct backend *be) DBG (1, "load: malloc failed: %s\n", strerror (errno)); return SANE_STATUS_NO_MEM; } - if (orig_src) - free (orig_src); - orig_src = src; snprintf (src, src_len, "%s%s%s", path, DIR_SEP, LIBDIR); } else @@ -494,6 +489,7 @@ load (struct backend *be) } DBG (3, "load: searching backend `%s' in `%s'\n", be->name, src); + orig_src = src; dir = strsep (&src, DIR_SEP); while (dir) diff --git a/backend/dmc.c b/backend/dmc.c index 363a33f..5edb417 100644 --- a/backend/dmc.c +++ b/backend/dmc.c @@ -16,9 +16,7 @@ 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. + along with this program. If not, see . As a special exception, the authors of SANE give permission for additional uses of the libraries contained in this release of SANE. @@ -44,8 +42,6 @@ This file implements a SANE backend for the Polaroid Digital Microscope Camera. */ -/* $Id$ */ - #include "../include/sane/config.h" #include @@ -113,7 +109,7 @@ static SANE_Word ValidASAs[] = { 3, 25, 50, 100 }; // fd -- file descriptor // typecode -- data type code // qualifier -- data type qualifier -// maxlen -- tranfer length +// maxlen -- transfer length // buf -- buffer to store data in // len -- set to actual length of data //%RETURNS: @@ -153,7 +149,7 @@ DMCRead(int fd, unsigned int typecode, unsigned int qualifier, // fd -- file descriptor // typecode -- data type code // qualifier -- data type qualifier -// maxlen -- tranfer length +// maxlen -- transfer length // buf -- buffer to store data in //%RETURNS: // A SANE status code diff --git a/backend/dmc.h b/backend/dmc.h index aa866bc..6c2fc26 100644 --- a/backend/dmc.h +++ b/backend/dmc.h @@ -13,9 +13,7 @@ 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. + along with this program. If not, see . As a special exception, the authors of SANE give permission for additional uses of the libraries contained in this release of SANE. @@ -38,8 +36,6 @@ whether to permit this exception to apply to your modifications. If you do not wish that, delete this exception notice. */ -/* $Id$ */ - #ifndef polaroid_dmc_h #define polaroid_dmc_h diff --git a/backend/epjitsu.c b/backend/epjitsu.c index 714bc0b..90ef148 100644 --- a/backend/epjitsu.c +++ b/backend/epjitsu.c @@ -21,9 +21,7 @@ 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. + along with this program. If not, see . As a special exception, the authors of SANE give permission for additional uses of the libraries contained in this release of SANE. @@ -118,7 +116,7 @@ - increase scan height ~1/2 inch due to head offset - change page length autodetection condition v18 2009-01-21, MAN - - dont export private symbols + - don't export private symbols v19 2009-08-31, RG - rewritten calibration routines v20 2010-02-09, MAN (SANE 1.0.21 to 1.0.24) @@ -1615,7 +1613,7 @@ sane_control_option (SANE_Handle handle, SANE_Int option, DBG (20, "sane_control_option: set value for '%s' (%d)\n", s->opt[option].name,option); if ( s->started ) { - DBG (5, "sane_control_option: cant set, device busy\n"); + DBG (5, "sane_control_option: can't set, device busy\n"); return SANE_STATUS_DEVICE_BUSY; } @@ -1630,7 +1628,7 @@ sane_control_option (SANE_Handle handle, SANE_Int option, return status; } - /* may have been changed by constrain, so dont copy until now */ + /* may have been changed by constraints, so don't copy until now */ val_c = *(SANE_Word *)val; /* @@ -2392,7 +2390,7 @@ sane_get_parameters (SANE_Handle handle, SANE_Parameters * params) /* * Called by SANE when a page acquisition operation is to be started. - * FIXME: wont handle SOURCE_ADF_BACK + * FIXME: won't handle SOURCE_ADF_BACK */ SANE_Status sane_start (SANE_Handle handle) @@ -2741,7 +2739,7 @@ coarsecal_get_line(struct scanner *s, struct image *img) while(!s->cal_image.done){ ret = read_from_scanner(s,&s->cal_image); if(ret){ - DBG (5, "coarsecal_get_line: cant read from scanner\n"); + DBG (5, "coarsecal_get_line: can't read from scanner\n"); return ret; } } @@ -3218,7 +3216,7 @@ finecal_get_line(struct scanner *s, struct image *img) while(!s->cal_image.done){ ret = read_from_scanner(s,&s->cal_image); if(ret){ - DBG (5, "finecal_get_line: cant read from scanner\n"); + DBG (5, "finecal_get_line: can't read from scanner\n"); return ret; } } @@ -3243,7 +3241,7 @@ finecal_get_line(struct scanner *s, struct image *img) return ret; } -/* roundf() is c99, so we provide our own, though this version wont return -0 */ +/* roundf() is c99, so we provide our own, though this version won't return -0 */ static float round2(float x) { @@ -3992,7 +3990,7 @@ sane_read (SANE_Handle handle, SANE_Byte * buf, SANE_Int max_len, SANE_Int * len ret = read_from_scanner(s, &s->block_xfr); if(ret){ - DBG (5, "sane_read: cant read from scanner\n"); + DBG (5, "sane_read: can't read from scanner\n"); return ret; } @@ -4036,7 +4034,7 @@ sane_read (SANE_Handle handle, SANE_Byte * buf, SANE_Int max_len, SANE_Int * len ret = copy_block_to_page(s, SIDE_FRONT); if(ret){ - DBG (5, "sane_read: cant copy to front/back\n"); + DBG (5, "sane_read: can't copy to front/back\n"); return ret; } @@ -4061,7 +4059,7 @@ sane_read (SANE_Handle handle, SANE_Byte * buf, SANE_Int max_len, SANE_Int * len else { /*fi-60f*/ ret = copy_block_to_page(s, SIDE_FRONT); if(ret){ - DBG (5, "sane_read: cant copy to front/back\n"); + DBG (5, "sane_read: can't copy to front/back\n"); return ret; } @@ -4539,7 +4537,7 @@ copy_block_to_page(struct scanner *s,int side) p_in += page->image->x_offset_bytes; /* for MODE_LINEART, binarize the gray line stored in the temp image buffer(dt) */ - /* bacause dt.width = page_width, we pass page_width */ + /* because dt.width = page_width, we pass page_width */ if (s->mode == MODE_LINEART) binarize_line(s, lineStart, page_width); @@ -4616,7 +4614,7 @@ binarize_line(struct scanner *s, unsigned char *lineOut, int width) * handle h is a valid handle) but usually affects long-running * operations only (such as image is acquisition). It is safe to call * this function asynchronously (e.g., from within a signal handler). - * It is important to note that completion of this operaton does not + * It is important to note that completion of this operation does not * imply that the currently pending operation has been cancelled. It * only guarantees that cancellation has been initiated. Cancellation * completes only when the cancelled call returns (typically with a diff --git a/backend/epson.c b/backend/epson.c index 20cafc4..8c1a41d 100644 --- a/backend/epson.c +++ b/backend/epson.c @@ -34,9 +34,7 @@ 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. + along with this program. If not, see . As a special exception, the authors of SANE give permission for additional uses of the libraries contained in this release of SANE. @@ -94,7 +92,7 @@ 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-09-01 USB scanners are now using libsane-usb functions 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 @@ -115,7 +113,7 @@ 2001-11-13 Version 0.2.16 Do not call access() for parallel port scanners. 2001-11-11 Version 0.2.15 - Fixed "wait-for-button" functionality, accidentially merged back wrong + Fixed "wait-for-button" functionality, accidentally merged back wrong version after code freeze. Corrected "need-strange-reorder" recognition. Added IOCTL support to header file. @@ -201,10 +199,10 @@ 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-01 Threshhold should only be active when scan depth + 2000-06-01 Threshold should only be active when scan depth is 1 and halftoning is off. (mjp) 2000-05-28 Turned on scanner based color correction. - Dependancies between many options are now + Dependencies between many options are now being enforced. For instance, auto area seg (AAS) should only be on when scan depth == 1. Added some routines to active and deactivate @@ -247,7 +245,7 @@ 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 + a more elegant solution to distinguish between different function levels. The level > n does not work anymore with D1. Added support for "set threshold" and "set zoom". @@ -272,7 +270,7 @@ 2000-02-02 "Brown Paper Bag Release" Put the USB fix finally into the CVS repository. 2000-02-01 Fixed problem with USB scanner not being recognized - because of hte changes to attach a few days ago. (KHK) + because of the 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 @@ -395,7 +393,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 ignoring 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 */ @@ -641,7 +639,7 @@ static const SANE_String_Const color_list[] = { * Gamma correction: * The A and B level scanners work differently than the D level scanners, 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. + * the actually used params and list arrays at runtime. */ static int gamma_params_ab[] = { @@ -2496,9 +2494,9 @@ attach (const char *dev_name, Epson_Device * *devp, int type) /* * Check for Perfection 4990 photo/GT-X800 scanner. * This scanner only report 3200 dpi back. - * The scanner fysical supports 4800 dpi. + * The scanner physically supports 4800 dpi. * This is simulated here... - * Futher details read: + * Further details read: * EPSON Programming guide for EPSON Color Image Scanner Perfection 4990 */ if (strncmp((char *) buf + 0x1A,"GT-X800",7) == 0) @@ -4277,7 +4275,7 @@ sane_get_parameters (SANE_Handle handle, SANE_Parameters * params) /* * Make sure that the number of lines is correct for color shuffling: - * The shuffling alghorithm produces 2xline_distance lines at the + * The shuffling algorithm produces 2xline_distance lines at the * beginning and the same amount at the end of the scan that are not * useable. If s->params.lines gets negative, 0 lines are reported * back to the frontend. @@ -4796,7 +4794,7 @@ sane_start (SANE_Handle handle) } else { - /* we run into an eror condition, just continue */ + /* we ran into an error condition, just continue */ s->hw->wait_for_button = SANE_FALSE; } } @@ -4853,7 +4851,7 @@ sane_start (SANE_Handle handle) /* * 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. + * due to the color shuffling algorithm. * At this time we add two times the line distance to the number of scan lines if * this is possible - if not, then we try to calculate the number of additional * lines according to the selected scan area. @@ -5778,7 +5776,7 @@ color_shuffle (SANE_Handle handle, int *new_length) /* - * The ouput buffer ist still "buf", but because we are + * The output buffer is still "buf", but because we are * only overwriting from the beginning of the memory area * we are not interfering with the "still to shuffle" data * in the same area. @@ -5951,7 +5949,7 @@ get_identity_information (SANE_Handle handle) } s->hw->level = dev->cmd->level[1] - '0'; - } /* set comand type and level */ + } /* set command type and level */ /* * Setting available resolutions and xy ranges for sane frontend. @@ -6011,9 +6009,9 @@ get_identity_information (SANE_Handle handle) /* * Check for Perfection 4990 photo/GT-X800 scanner. * This scanner only report 3200 dpi back. - * The scanner fysical supports 4800 dpi. + * The scanner physically supports 4800 dpi. * This is simulated here... - * Futher details read: + * Further details read: * EPSON Programming guide for EPSON Color Image Scanner Perfection 4990 */ if (s->hw->cmd->request_extended_status != 0) @@ -6148,7 +6146,7 @@ get_identity2_information (SANE_Handle handle) len = result[3] << 8 | result[2]; buf = alloca (len); - receive (s, buf, len, &status); /* reveive actual status data */ + receive (s, buf, len, &status); /* receive actual status data */ /* the first two bytes of the buffer contain the optical resolution */ s->hw->optical_res = buf[1] << 8 | buf[0]; @@ -6250,7 +6248,7 @@ request_focus_position (SANE_Handle handle, u_char * position) len = result[3] << 8 | result[2]; buf = alloca (len); - receive (s, buf, len, &status); /* reveive actual status data */ + receive (s, buf, len, &status); /* receive actual status data */ *position = buf[1]; DBG (1, "Focus position = 0x%x\n", buf[1]); @@ -6306,7 +6304,7 @@ request_push_button_status (SANE_Handle handle, SANE_Bool * theButtonStatus) len = result[3] << 8 | result[2]; /* this should be 1 for scanners with one button */ buf = alloca (len); - receive (s, buf, len, &status); /* reveive actual status data */ + receive (s, buf, len, &status); /* receive actual status data */ DBG (1, "Push button status = %d\n", buf[0] & 0x01); *theButtonStatus = ((buf[0] & 0x01) != 0); diff --git a/backend/epson.h b/backend/epson.h index cacfc80..45a84b1 100644 --- a/backend/epson.h +++ b/backend/epson.h @@ -25,9 +25,7 @@ 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. + along with this program. If not, see . As a special exception, the authors of SANE give permission for additional uses of the libraries contained in this release of SANE. diff --git a/backend/epson2-ops.c b/backend/epson2-ops.c index ba0d9cb..83a0169 100644 --- a/backend/epson2-ops.c +++ b/backend/epson2-ops.c @@ -302,6 +302,9 @@ e2_dev_post_init(struct Epson_Device *dev) dev->need_reset_on_source_change = SANE_TRUE; } + if (e2_dev_model(dev, "DS-G20000")) + dev->cmd->bright_range.min = -3; + return SANE_STATUS_GOOD; } @@ -822,24 +825,15 @@ e2_discover_capabilities(Epson_Scanner *s) if (esci_request_focus_position(s, &s->currentFocusPosition) == SANE_STATUS_GOOD) { - DBG(1, "setting focus is supported\n"); + DBG(1, "setting focus is supported, current focus: %u\n", s->currentFocusPosition); dev->focusSupport = SANE_TRUE; - s->opt[OPT_FOCUS].cap &= ~SANE_CAP_INACTIVE; - - /* reflect the current focus position in the GUI */ - if (s->currentFocusPosition < 0x4C) { - /* focus on glass */ - s->val[OPT_FOCUS].w = 0; - } else { - /* focus 2.5mm above glass */ - s->val[OPT_FOCUS].w = 1; - } - + s->opt[OPT_FOCUS_POS].cap &= ~SANE_CAP_INACTIVE; + s->val[OPT_FOCUS_POS].w = s->currentFocusPosition; } else { DBG(1, "setting focus is not supported\n"); dev->focusSupport = SANE_FALSE; - s->opt[OPT_FOCUS].cap |= SANE_CAP_INACTIVE; - s->val[OPT_FOCUS].w = 0; /* on glass - just in case */ + s->opt[OPT_FOCUS_POS].cap |= SANE_CAP_INACTIVE; + s->val[OPT_FOCUS_POS].w = FOCUS_ON_GLASS; /* just in case */ } /* Set defaults for no extension. */ @@ -948,8 +942,6 @@ e2_set_extended_scanning_parameters(Epson_Scanner * s) /* ESC e */ buf[26] = extensionCtrl; - - /* XXX focus */ } /* ESC g, scanning mode (normal or high speed) */ @@ -1063,24 +1055,6 @@ e2_set_scanning_parameters(Epson_Scanner * s) * buffer to set the scan area for * ES-9000H and GT-30000 */ - - /* - * 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 - * this feature, will just ignore these calls. - */ - - if (s->hw->focusSupport == SANE_TRUE) { - if (s->val[OPT_FOCUS].w == 0) { - DBG(1, "setting focus to glass surface\n"); - esci_set_focus_position(s, 0x40); - } else { - DBG(1, - "setting focus to 2.5mm above glass\n"); - esci_set_focus_position(s, 0x59); - } - } } /* ESC C, Set color */ @@ -1496,7 +1470,7 @@ e2_wait_button(Epson_Scanner * s) else sleep(1); } else { - /* we run into an error condition, just continue */ + /* we ran into an error condition, just continue */ s->hw->wait_for_button = SANE_FALSE; } } @@ -1997,7 +1971,7 @@ color_shuffle(SANE_Handle handle, int *new_length) * We just finished the line in line_buffer[0] - write it to the * output buffer and continue. * - * The ouput buffer ist still "buf", but because we are + * The output buffer is still "buf", but because we are * only overwriting from the beginning of the memory area * we are not interfering with the "still to shuffle" data * in the same area. diff --git a/backend/epson2.c b/backend/epson2.c index e6f6786..a15a620 100644 --- a/backend/epson2.c +++ b/backend/epson2.c @@ -138,12 +138,6 @@ static const SANE_String_Const film_list[] = { NULL }; -static const SANE_String_Const focus_list[] = { - SANE_I18N("Focus on glass"), - SANE_I18N("Focus 2.5mm above glass"), - NULL -}; - #define HALFTONE_NONE 0x01 #define HALFTONE_TET 0x03 @@ -239,7 +233,7 @@ enum { * Gamma correction: * The A and B level scanners work differently than the D level scanners, * 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. + * variables that get set to the actually used params and list arrays at runtime. */ static int gamma_params_ab[] = { @@ -302,12 +296,11 @@ static const SANE_String_Const bay_list[] = { }; /* minimum, maximum, quantization */ +static const SANE_Range focus_range = { 0, 254, 0 }; static const SANE_Range u8_range = { 0, 255, 0 }; static const SANE_Range fx_range = { SANE_FIX(-2.0), SANE_FIX(2.0), 0 }; - static const SANE_Range outline_emphasis_range = { -2, 2, 0 }; - /* * List of pointers to devices - will be dynamically allocated depending * on the number of devices found. @@ -813,10 +806,11 @@ attach_one_pio(const char *dev) } static SANE_Status -attach_one_config(SANEI_Config __sane_unused__ *config, const char *line) +attach_one_config(SANEI_Config __sane_unused__ *config, const char *line, + void *data) { int vendor, product; - + SANE_Bool local_only = *(SANE_Bool*) data; int len = strlen(line); DBG(7, "%s: len = %d, line = %s\n", __func__, len, line); @@ -847,13 +841,16 @@ attach_one_config(SANEI_Config __sane_unused__ *config, const char *line) } else if (strncmp(line, "net", 3) == 0) { - /* remove the "net" sub string */ - const char *name = sanei_config_skip_whitespace(line + 3); + if (!local_only) { + /* remove the "net" sub string */ + const char *name = + sanei_config_skip_whitespace(line + 3); - if (strncmp(name, "autodiscovery", 13) == 0) - e2_network_discovery(); - else - attach_one_net(name); + if (strncmp(name, "autodiscovery", 13) == 0) + e2_network_discovery(); + else + attach_one_net(name); + } } else if (strncmp(line, "pio", 3) == 0) { @@ -889,14 +886,14 @@ free_devices(void) } static void -probe_devices(void) +probe_devices(SANE_Bool local_only) { DBG(5, "%s\n", __func__); free_devices(); sanei_configure_attach(EPSON2_CONFIG_FILE, NULL, - attach_one_config); + attach_one_config, &local_only); } SANE_Status @@ -926,14 +923,14 @@ sane_exit(void) } SANE_Status -sane_get_devices(const SANE_Device ***device_list, SANE_Bool __sane_unused__ local_only) +sane_get_devices(const SANE_Device ***device_list, SANE_Bool local_only) { Epson_Device *dev; int i; DBG(5, "%s\n", __func__); - probe_devices(); + probe_devices(local_only); devlist = malloc((num_devices + 1) * sizeof(devlist[0])); if (!devlist) { @@ -1336,6 +1333,39 @@ init_options(Epson_Scanner *s) s->opt[OPT_BR_Y].constraint.range = s->hw->y_range; s->val[OPT_BR_Y].w = s->hw->y_range->max; + /* "Focus" group: */ + s->opt[OPT_FOCUS_GROUP].title = SANE_I18N("Focus"); + s->opt[OPT_FOCUS_GROUP].desc = ""; + s->opt[OPT_FOCUS_GROUP].type = SANE_TYPE_GROUP; + s->opt[OPT_FOCUS_GROUP].cap = SANE_CAP_ADVANCED; + + /* autofocus */ + s->opt[OPT_AUTOFOCUS].name = SANE_NAME_AUTOFOCUS; + s->opt[OPT_AUTOFOCUS].title = SANE_TITLE_AUTOFOCUS; + s->opt[OPT_AUTOFOCUS].desc = SANE_DESC_AUTOFOCUS; + s->opt[OPT_AUTOFOCUS].type = SANE_TYPE_BOOL; + s->val[OPT_AUTOFOCUS].w = SANE_FALSE; + s->opt[OPT_AUTOFOCUS].cap |= SANE_CAP_ADVANCED; + + /* focus position */ + s->opt[OPT_FOCUS_POS].name = SANE_NAME_FOCUS; + s->opt[OPT_FOCUS_POS].title = SANE_TITLE_FOCUS; + s->opt[OPT_FOCUS_POS].desc = SANE_DESC_FOCUS; + s->opt[OPT_FOCUS_POS].type = SANE_TYPE_INT; + s->opt[OPT_FOCUS_POS].unit = SANE_UNIT_NONE; + s->opt[OPT_FOCUS_POS].constraint_type = SANE_CONSTRAINT_RANGE; + s->opt[OPT_FOCUS_POS].constraint.range = &focus_range; + s->val[OPT_FOCUS_POS].w = FOCUS_ON_GLASS; + s->opt[OPT_FOCUS_POS].cap |= SANE_CAP_ADVANCED; + + if (s->hw->focusSupport == SANE_TRUE) { + s->opt[OPT_FOCUS_POS].cap &= ~SANE_CAP_INACTIVE; + s->opt[OPT_AUTOFOCUS].cap &= ~SANE_CAP_INACTIVE; + } else { + s->opt[OPT_FOCUS_POS].cap |= SANE_CAP_INACTIVE; + s->opt[OPT_AUTOFOCUS].cap |= SANE_CAP_INACTIVE; + } + /* "Optional equipment" group: */ s->opt[OPT_EQU_GROUP].title = SANE_I18N("Optional equipment"); s->opt[OPT_EQU_GROUP].desc = ""; @@ -1372,22 +1402,6 @@ init_options(Epson_Scanner *s) if (!s->hw->cmd->set_bay) s->opt[OPT_FILM_TYPE].cap |= SANE_CAP_INACTIVE; - /* focus position */ - s->opt[OPT_FOCUS].name = SANE_EPSON_FOCUS_NAME; - s->opt[OPT_FOCUS].title = SANE_EPSON_FOCUS_TITLE; - s->opt[OPT_FOCUS].desc = SANE_EPSON_FOCUS_DESC; - s->opt[OPT_FOCUS].type = SANE_TYPE_STRING; - s->opt[OPT_FOCUS].size = max_string_size(focus_list); - s->opt[OPT_FOCUS].constraint_type = SANE_CONSTRAINT_STRING_LIST; - s->opt[OPT_FOCUS].constraint.string_list = focus_list; - s->val[OPT_FOCUS].w = 0; - s->opt[OPT_FOCUS].cap |= SANE_CAP_ADVANCED; - - if (s->hw->focusSupport == SANE_TRUE) - s->opt[OPT_FOCUS].cap &= ~SANE_CAP_INACTIVE; - else - s->opt[OPT_FOCUS].cap |= SANE_CAP_INACTIVE; - /* forward feed / eject */ s->opt[OPT_EJECT].name = "eject"; s->opt[OPT_EJECT].title = SANE_I18N("Eject"); @@ -1470,7 +1484,7 @@ sane_open(SANE_String_Const name, SANE_Handle *handle) /* probe if empty device name provided */ if (l == 0) { - probe_devices(); + probe_devices(SANE_FALSE); if (first_dev == NULL) { DBG(1, "no device detected\n"); @@ -1507,7 +1521,7 @@ sane_open(SANE_String_Const name, SANE_Handle *handle) */ if (first_dev == NULL) - probe_devices(); + probe_devices(SANE_FALSE); s = device_detect(name, SANE_EPSON_NODEV, 0, &status); if (s == NULL) { @@ -1646,6 +1660,8 @@ getvalue(SANE_Handle handle, SANE_Int option, void *value) case OPT_THRESHOLD: case OPT_BIT_DEPTH: case OPT_WAIT_FOR_BUTTON: + case OPT_AUTOFOCUS: + case OPT_FOCUS_POS: *((SANE_Word *) value) = sval->w; break; @@ -1659,7 +1675,6 @@ getvalue(SANE_Handle handle, SANE_Int option, void *value) case OPT_GAMMA_CORRECTION: case OPT_COLOR_CORRECTION: case OPT_BAY: - case OPT_FOCUS: strcpy((char *) value, sopt->constraint.string_list[sval->w]); break; @@ -1730,8 +1745,6 @@ change_source(Epson_Scanner *s, SANE_Int optindex, char *value) if (s->hw->need_reset_on_source_change) esci_reset(s); - s->focusOnGlass = SANE_TRUE; /* this is the default */ - if (s->val[OPT_SOURCE].w == optindex) return; @@ -1750,7 +1763,7 @@ change_source(Epson_Scanner *s, SANE_Int optindex, char *value) s->hw->use_extension = SANE_TRUE; /* disable film type option */ deactivateOption(s, OPT_FILM_TYPE, &dummy); - s->val[OPT_FOCUS].w = 0; + s->val[OPT_FOCUS_POS].w = FOCUS_ON_GLASS; if (s->hw->duplex) { activateOption(s, OPT_ADF_MODE, &dummy); } else { @@ -1782,10 +1795,8 @@ change_source(Epson_Scanner *s, SANE_Int optindex, char *value) deactivateOption(s, OPT_FILM_TYPE, &dummy); /* enable focus position if the scanner supports it */ - if (s->hw->cmd->set_focus_position != 0) { - s->val[OPT_FOCUS].w = 1; - s->focusOnGlass = SANE_FALSE; - } + if (s->hw->focusSupport) + s->val[OPT_FOCUS_POS].w = FOCUS_ABOVE_25MM; deactivateOption(s, OPT_ADF_MODE, &dummy); deactivateOption(s, OPT_EJECT, &dummy); @@ -1798,7 +1809,7 @@ change_source(Epson_Scanner *s, SANE_Int optindex, char *value) /* disable film type option */ deactivateOption(s, OPT_FILM_TYPE, &dummy); - s->val[OPT_FOCUS].w = 0; + s->val[OPT_FOCUS_POS].w = FOCUS_ON_GLASS; deactivateOption(s, OPT_ADF_MODE, &dummy); } @@ -1872,7 +1883,6 @@ setvalue(SANE_Handle handle, SANE_Int option, void *value, SANE_Int *info) case OPT_DROPOUT: case OPT_FILM_TYPE: case OPT_BAY: - case OPT_FOCUS: sval->w = optindex; /* Simple lists */ break; @@ -1981,6 +1991,11 @@ setvalue(SANE_Handle handle, SANE_Int option, void *value, SANE_Int *info) break; } + case OPT_AUTOFOCUS: + sval->w = *((SANE_Word *) value); + setOptionState(s, !sval->w, OPT_FOCUS_POS, &reload); + break; + case OPT_MIRROR: case OPT_AAS: case OPT_PREVIEW: /* needed? */ @@ -1989,6 +2004,7 @@ setvalue(SANE_Handle handle, SANE_Int option, void *value, SANE_Int *info) case OPT_AUTO_EJECT: case OPT_THRESHOLD: case OPT_WAIT_FOR_BUTTON: + case OPT_FOCUS_POS: sval->w = *((SANE_Word *) value); break; @@ -2122,6 +2138,27 @@ sane_start(SANE_Handle handle) if (status != SANE_STATUS_GOOD) return status; + /* + * set focus after we set scanning parameters because the scanner will + * use the middle of the scanning area for autofocus. If we want to + * support a defined x,y position for autofocus, we'd need to send + * specific scanning paramters just for autofocus. + */ + if (s->hw->focusSupport == SANE_TRUE) { + if (s->val[OPT_AUTOFOCUS].w) { + DBG(1, "setting autofocus\n"); + status = esci_set_focus_position(s, 0xff); + } else { + DBG(1, "setting focus to %u\n", s->val[OPT_FOCUS_POS].w); + status = esci_set_focus_position(s, s->val[OPT_FOCUS_POS].w); + } + + if (status != SANE_STATUS_GOOD) { + DBG(1, "setting focus failed\n"); + return status; + } + } + /* ESC z, user defined gamma table */ if (dev->cmd->set_gamma_table && gamma_userdefined[s->val[OPT_GAMMA_CORRECTION].w]) { @@ -2227,6 +2264,12 @@ sane_start(SANE_Handle handle) if (status != SANE_STATUS_GOOD) return status; + if (s->hw->focusSupport == SANE_TRUE && s->val[OPT_AUTOFOCUS].w) { + status = esci_request_focus_position(s, &s->currentFocusPosition); + if (status == SANE_STATUS_GOOD) + s->val[OPT_FOCUS_POS].w = s->currentFocusPosition; + } + /* start scanning */ DBG(1, "%s: scanning...\n", __func__); diff --git a/backend/epson2.h b/backend/epson2.h index 773c7de..7fa8f53 100644 --- a/backend/epson2.h +++ b/backend/epson2.h @@ -22,6 +22,9 @@ #define BACKEND_NAME epson2 #define DEBUG_NOT_STATIC +#define mode_params epson2_mode_params +#define source_list epson2_source_list + #ifdef HAVE_SYS_IOCTL_H #include #endif @@ -80,6 +83,9 @@ #define SANE_EPSON_MAX_RETRIES 14 /* warmup max retry */ #define CMD_SIZE_EXT_STATUS 42 +#define FOCUS_ON_GLASS 64 +#define FOCUS_ABOVE_25MM (64 + 25) + /* NOTE: you can find these codes with "man ascii". */ #define STX 0x02 #define ACK 0x06 @@ -172,7 +178,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 ignoring 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 @@ -253,11 +259,13 @@ enum { OPT_TL_Y, OPT_BR_X, OPT_BR_Y, + OPT_FOCUS_GROUP, + OPT_AUTOFOCUS, + OPT_FOCUS_POS, OPT_EQU_GROUP, OPT_SOURCE, OPT_AUTO_EJECT, OPT_FILM_TYPE, - OPT_FOCUS, OPT_BAY, OPT_EJECT, OPT_ADF_MODE, @@ -387,7 +395,6 @@ struct Epson_Scanner SANE_Int lines_written; /* debug variable */ SANE_Int left, top, lcount; - SANE_Bool focusOnGlass; SANE_Byte currentFocusPosition; /* network buffers */ diff --git a/backend/epson2_usb.c b/backend/epson2_usb.c index 87830c6..3977ee3 100644 --- a/backend/epson2_usb.c +++ b/backend/epson2_usb.c @@ -21,6 +21,7 @@ SANE_Word sanei_epson_usb_product_ids[] = { 0x112, /* GT-9700F, Perfection 2450 PHOTO */ 0x1120, /* L380 */ 0x1121, /* ET-2650, L495 */ + 0x1122, /* ET-2600 */ 0x113d, /* XP-255 */ 0x11b, /* GT-9300UF, Perfection 2400 PHOTO */ 0x11c, /* GT-9800F, Perfection 3200 PHOTO */ diff --git a/backend/epsonds.c b/backend/epsonds.c index f2af220..1d557c9 100644 --- a/backend/epsonds.c +++ b/backend/epsonds.c @@ -481,10 +481,11 @@ attach_one_net(const char *dev) static SANE_Status -attach_one_config(SANEI_Config __sane_unused__ *config, const char *line) +attach_one_config(SANEI_Config __sane_unused__ *config, const char *line, + void *data) { int vendor, product; - + SANE_Bool local_only = *(SANE_Bool*) data; int len = strlen(line); DBG(7, "%s: len = %d, line = %s\n", __func__, len, line); @@ -513,13 +514,16 @@ attach_one_config(SANEI_Config __sane_unused__ *config, const char *line) } else if (strncmp(line, "net", 3) == 0) { - /* remove the "net" sub string */ - const char *name = sanei_config_skip_whitespace(line + 3); + if (!local_only) { + /* remove the "net" sub string */ + const char *name = + sanei_config_skip_whitespace(line + 3); - if (strncmp(name, "autodiscovery", 13) == 0) - e2_network_discovery(); - else - attach_one_net(name); + if (strncmp(name, "autodiscovery", 13) == 0) + e2_network_discovery(); + else + attach_one_net(name); + } } else { DBG(0, "unable to parse config line: %s\n", line); @@ -545,12 +549,13 @@ free_devices(void) } static void -probe_devices(void) +probe_devices(SANE_Bool local_only) { DBG(5, "%s\n", __func__); free_devices(); - sanei_configure_attach(EPSONDS_CONFIG_FILE, NULL, attach_one_config); + sanei_configure_attach(EPSONDS_CONFIG_FILE, NULL, + attach_one_config, &local_only); } /**** SANE API ****/ @@ -581,14 +586,14 @@ sane_exit(void) } SANE_Status -sane_get_devices(const SANE_Device ***device_list, SANE_Bool __sane_unused__ local_only) +sane_get_devices(const SANE_Device ***device_list, SANE_Bool local_only) { int i; epsonds_device *dev; DBG(5, "** %s\n", __func__); - probe_devices(); + probe_devices(local_only); devlist = malloc((num_devices + 1) * sizeof(devlist[0])); if (!devlist) { @@ -793,7 +798,7 @@ sane_open(SANE_String_Const name, SANE_Handle *handle) /* probe if empty device name provided */ if (name[0] == '\0') { - probe_devices(); + probe_devices(SANE_FALSE); if (first_dev == NULL) { DBG(1, "no devices detected\n"); diff --git a/backend/epsonds.h b/backend/epsonds.h index 401b0f3..04cb724 100644 --- a/backend/epsonds.h +++ b/backend/epsonds.h @@ -18,6 +18,9 @@ #define BACKEND_NAME epsonds #define DEBUG_NOT_STATIC +#define mode_params epsonds_mode_params +#define source_list epsonds_source_list + #ifdef HAVE_SYS_IOCTL_H #include #endif diff --git a/backend/escl.conf.in b/backend/escl.conf.in index 9c482b5..18ea516 100644 --- a/backend/escl.conf.in +++ b/backend/escl.conf.in @@ -13,6 +13,7 @@ #device http://123.456.789.10:8080 OptionalModel1 #device https://123.456.789.10:443 "Optional Model 2" +#device https://123.456.789.10:443 "HP Color LaserJet FlowMFP M578" "hack=localhost" #device unix:/run/proxy.sock:http://123.456.789.10:80 #[device] diff --git a/backend/escl/escl.c b/backend/escl/escl.c index c40fd98..bb62219 100644 --- a/backend/escl/escl.c +++ b/backend/escl/escl.c @@ -16,8 +16,8 @@ for more details. You should have received a copy of the GNU General Public License - along with sane; see the file COPYING. If not, write to the Free - Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + along with sane; see the file COPYING. + If not, see . This file implements a SANE backend for eSCL scanners. */ @@ -29,15 +29,32 @@ #include -#include - #include "../include/sane/saneopts.h" #include "../include/sane/sanei.h" #include "../include/sane/sanei_backend.h" #include "../include/sane/sanei_config.h" + +#ifndef SANE_NAME_SHARPEN +# define SANE_NAME_SHARPEN "sharpen" +# define SANE_TITLE_SHARPEN SANE_I18N("Sharpen") +# define SANE_DESC_SHARPEN SANE_I18N("Set sharpen value.") +#endif + +#ifndef SANE_NAME_THRESHOLD +# define SANE_NAME_THRESHOLD "threshold" +#endif +#ifndef SANE_TITLE_THRESHOLD +# define SANE_TITLE_THRESHOLD SANE_I18N("Threshold") +#endif +#ifndef SANE_DESC_THRESHOLD +# define SANE_DESC_THRESHOLD \ + SANE_I18N("Set threshold for line-art scans.") +#endif + #define min(A,B) (((A)<(B)) ? (A) : (B)) #define max(A,B) (((A)>(B)) ? (A) : (B)) +#define IS_ACTIVE(OPTION) (((handler->opt[OPTION].cap) & SANE_CAP_INACTIVE) == 0) #define INPUT_BUFFER_SIZE 4096 static const SANE_Device **devlist = NULL; @@ -56,6 +73,10 @@ typedef struct Handled { SANE_Range x_range2; SANE_Range y_range1; SANE_Range y_range2; + SANE_Range brightness_range; + SANE_Range contrast_range; + SANE_Range sharpen_range; + SANE_Range thresold_range; SANE_Bool cancel; SANE_Bool write_scan_data; SANE_Bool decompress_scan_data; @@ -70,7 +91,10 @@ escl_free_device(ESCL_Device *current) free((void*)current->ip_address); free((void*)current->model_name); free((void*)current->type); - free(current->unix_socket); + free((void*)current->is); + free((void*)current->uuid); + free((void*)current->unix_socket); + curl_slist_free_all(current->hack); free(current); return NULL; } @@ -110,6 +134,10 @@ escl_check_and_add_device(ESCL_Device *current) DBG (10, "Scanner Type allocation failure.\n"); return (SANE_STATUS_NO_MEM); } + if (!current->is) { + DBG (10, "Scanner Is allocation failure.\n"); + return (SANE_STATUS_NO_MEM); + } ++num_devices; current->next = list_devices_primary; list_devices_primary = current; @@ -150,14 +178,20 @@ escl_add_in_list(ESCL_Device *current) * \return escl_add_in_list(current) */ SANE_Status -escl_device_add(int port_nb, const char *model_name, char *ip_address, char *type) +escl_device_add(int port_nb, + const char *model_name, + char *ip_address, + const char *is, + const char *uuid, + char *type) { char tmp[PATH_MAX] = { 0 }; char *model = NULL; ESCL_Device *current = NULL; DBG (10, "escl_device_add\n"); for (current = list_devices_primary; current; current = current->next) { - if (strcmp(current->ip_address, ip_address) == 0) + if ((strcmp(current->ip_address, ip_address) == 0) || + (uuid && current->uuid && !strcmp(current->uuid, uuid))) { if (strcmp(current->type, type)) { @@ -166,6 +200,10 @@ escl_device_add(int port_nb, const char *model_name, char *ip_address, char *typ { free (current->type); current->type = strdup(type); + if (strcmp(current->ip_address, ip_address)) { + free (current->ip_address); + current->ip_address = strdup(ip_address); + } current->port_nb = port_nb; current->https = SANE_TRUE; } @@ -191,7 +229,12 @@ escl_device_add(int port_nb, const char *model_name, char *ip_address, char *typ model = (char*)(tmp[0] != 0 ? tmp : model_name); current->model_name = strdup(model); current->ip_address = strdup(ip_address); + memset(tmp, 0, PATH_MAX); + snprintf(tmp, sizeof(tmp), "%s scanner", (is ? is : "flatbed or ADF")); + current->is = strdup(tmp); current->type = strdup(type); + if (uuid) + current->uuid = strdup(uuid); return escl_add_in_list(current); } @@ -259,7 +302,7 @@ get_vendor(char *search) * \brief Function that checks if the url of the received scanner is secured or not (http / https). * --> if the url is not secured, our own url will be composed like "http://'ip':'port'". * --> else, our own url will be composed like "https://'ip':'port'". - * AND, it's in this function that we gather all the informations of the url (that were in our list) : + * AND, it's in this function that we gather all the information of the url (that were in our list) : * the model_name, the port, the ip, and the type of url. * SO, leaving this function, we have in memory the complete url. * @@ -308,7 +351,7 @@ convertFromESCLDev(ESCL_Device *cdev) DBG (10, "Model allocation failure.\n"); goto freename; } - sdev->type = strdup("flatbed scanner"); + sdev->type = strdup(cdev->is); if (!sdev->type) { DBG (10, "Scanner Type allocation failure.\n"); goto freevendor; @@ -383,7 +426,8 @@ sane_exit(void) * \return escl_add_in_list(escl_device) if the parsing worked, SANE_STATUS_GOOD otherwise. */ static SANE_Status -attach_one_config(SANEI_Config __sane_unused__ *config, const char *line) +attach_one_config(SANEI_Config __sane_unused__ *config, const char *line, + void __sane_unused__ *data) { int port = 0; SANE_Status status; @@ -392,6 +436,7 @@ attach_one_config(SANEI_Config __sane_unused__ *config, const char *line) if (strncmp(line, "device", 6) == 0) { char *name_str = NULL; char *opt_model = NULL; + char *opt_hack = NULL; line = sanei_config_get_string(line + 6, &name_str); DBG (10, "New Escl_Device URL [%s].\n", (name_str ? name_str : "VIDE")); @@ -403,6 +448,10 @@ attach_one_config(SANEI_Config __sane_unused__ *config, const char *line) line = sanei_config_get_string(line, &opt_model); DBG (10, "New Escl_Device model [%s].\n", opt_model); } + if (*line) { + line = sanei_config_get_string(line, &opt_hack); + DBG (10, "New Escl_Device hack [%s].\n", opt_hack); + } escl_free_device(escl_device); escl_device = (ESCL_Device*)calloc(1, sizeof(ESCL_Device)); @@ -419,7 +468,9 @@ attach_one_config(SANEI_Config __sane_unused__ *config, const char *line) return status; } escl_device->model_name = opt_model ? opt_model : strdup("Unknown model"); - escl_device->type = strdup("flatbed scanner"); + escl_device->is = strdup("flatbed or ADF scanner"); + escl_device->type = strdup("In url"); + escl_device->uuid = NULL; } if (strncmp(line, "[device]", 8) == 0) { @@ -430,7 +481,7 @@ attach_one_config(SANEI_Config __sane_unused__ *config, const char *line) return (SANE_STATUS_NO_MEM); } } - if (strncmp(line, "ip", 2) == 0) { + else if (strncmp(line, "ip", 2) == 0) { const char *ip_space = sanei_config_skip_whitespace(line + 2); DBG (10, "New Escl_Device IP [%s].", (ip_space ? ip_space : "VIDE")); if (escl_device != NULL && ip_space != NULL) { @@ -438,14 +489,14 @@ attach_one_config(SANEI_Config __sane_unused__ *config, const char *line) escl_device->ip_address = strdup(ip_space); } } - if (sscanf(line, "port %i", &port) == 1 && port != 0) { + else if (sscanf(line, "port %i", &port) == 1 && port != 0) { DBG (10, "New Escl_Device PORT [%d].", port); if (escl_device != NULL) { DBG (10, "New Escl_Device PORT Affected."); escl_device->port_nb = port; } } - if (strncmp(line, "model", 5) == 0) { + else if (strncmp(line, "model", 5) == 0) { const char *model_space = sanei_config_skip_whitespace(line + 5); DBG (10, "New Escl_Device MODEL [%s].", (model_space ? model_space : "VIDE")); if (escl_device != NULL && model_space != NULL) { @@ -453,7 +504,7 @@ attach_one_config(SANEI_Config __sane_unused__ *config, const char *line) escl_device->model_name = strdup(model_space); } } - if (strncmp(line, "type", 4) == 0) { + else if (strncmp(line, "type", 4) == 0) { const char *type_space = sanei_config_skip_whitespace(line + 4); DBG (10, "New Escl_Device TYPE [%s].", (type_space ? type_space : "VIDE")); if (escl_device != NULL && type_space != NULL) { @@ -461,6 +512,8 @@ attach_one_config(SANEI_Config __sane_unused__ *config, const char *line) escl_device->type = strdup(type_space); } } + escl_device->is = strdup("flatbed or ADF scanner"); + escl_device->uuid = NULL; status = escl_check_and_add_device(escl_device); if (status == SANE_STATUS_GOOD) escl_device = NULL; @@ -487,7 +540,8 @@ sane_get_devices(const SANE_Device ***device_list, SANE_Bool local_only) if (device_list == NULL) return (SANE_STATUS_INVAL); - status = sanei_configure_attach(ESCL_CONFIG_FILE, NULL, attach_one_config); + status = sanei_configure_attach(ESCL_CONFIG_FILE, NULL, + attach_one_config, NULL); if (status != SANE_STATUS_GOOD) return (status); escl_devices(&status); @@ -526,10 +580,156 @@ _source_size_max (SANE_String_Const * sources) return size; } +static int +_get_resolution(escl_sane_t *handler, int resol) +{ + int x = 1; + int n = handler->scanner->caps[handler->scanner->source].SupportedResolutions[0] + 1; + int old = -1; + for (; x < n; x++) { + DBG(10, "SEARCH RESOLUTION [ %d | %d]\n", resol, (int)handler->scanner->caps[handler->scanner->source].SupportedResolutions[x]); + if (resol == handler->scanner->caps[handler->scanner->source].SupportedResolutions[x]) + return resol; + else if (resol < handler->scanner->caps[handler->scanner->source].SupportedResolutions[x]) + { + if (old == -1) + return handler->scanner->caps[handler->scanner->source].SupportedResolutions[1]; + else + return old; + } + else + old = handler->scanner->caps[handler->scanner->source].SupportedResolutions[x]; + } + return old; +} + + +/** + * \fn static SANE_Status init_options(SANE_String_Const name, escl_sane_t *s) + * \brief Function thzt initializes all the needed options of the received scanner + * (the resolution / the color / the margins) thanks to the information received with + * the 'escl_capabilities' function, called just before. + * + * \return status (if everything is OK, status = SANE_STATUS_GOOD) + */ +static SANE_Status +init_options_small(SANE_String_Const name_source, escl_sane_t *s) +{ + int found = 0; + DBG (10, "escl init_options\n"); + + SANE_Status status = SANE_STATUS_GOOD; + if (!s->scanner) return SANE_STATUS_INVAL; + if (name_source) { + int source = s->scanner->source; + if (!strcmp(name_source, SANE_I18N ("ADF Duplex"))) + s->scanner->source = ADFDUPLEX; + else if (!strncmp(name_source, "A", 1) || + !strcmp(name_source, SANE_I18N ("ADF"))) + s->scanner->source = ADFSIMPLEX; + else + s->scanner->source = PLATEN; + if (source == s->scanner->source) return status; + s->scanner->caps[s->scanner->source].default_color = + strdup(s->scanner->caps[source].default_color); + s->scanner->caps[s->scanner->source].default_resolution = + _get_resolution(s, s->scanner->caps[source].default_resolution); + } + if (s->scanner->caps[s->scanner->source].ColorModes == NULL) { + if (s->scanner->caps[PLATEN].ColorModes) + s->scanner->source = PLATEN; + else if (s->scanner->caps[ADFSIMPLEX].ColorModes) + s->scanner->source = ADFSIMPLEX; + else if (s->scanner->caps[ADFDUPLEX].ColorModes) + s->scanner->source = ADFDUPLEX; + else + return SANE_STATUS_INVAL; + } + if (s->scanner->source == PLATEN) { + DBG (10, "SOURCE PLATEN.\n"); + } + else if (s->scanner->source == ADFDUPLEX) { + DBG (10, "SOURCE ADFDUPLEX.\n"); + } + else if (s->scanner->source == ADFSIMPLEX) { + DBG (10, "SOURCE ADFSIMPLEX.\n"); + } + s->x_range1.min = 0; + s->x_range1.max = + PIXEL_TO_MM((s->scanner->caps[s->scanner->source].MaxWidth - + s->scanner->caps[s->scanner->source].MinWidth), + 300.0); + s->x_range1.quant = 0; + s->x_range2.min = PIXEL_TO_MM(s->scanner->caps[s->scanner->source].MinWidth, 300.0); + s->x_range2.max = PIXEL_TO_MM(s->scanner->caps[s->scanner->source].MaxWidth, 300.0); + s->x_range2.quant = 0; + s->y_range1.min = 0; + s->y_range1.max = + PIXEL_TO_MM((s->scanner->caps[s->scanner->source].MaxHeight - + s->scanner->caps[s->scanner->source].MinHeight), + 300.0); + s->y_range1.quant = 0; + s->y_range2.min = PIXEL_TO_MM(s->scanner->caps[s->scanner->source].MinHeight, 300.0); + s->y_range2.max = PIXEL_TO_MM(s->scanner->caps[s->scanner->source].MaxHeight, 300.0); + s->y_range2.quant = 0; + + s->opt[OPT_MODE].constraint.string_list = s->scanner->caps[s->scanner->source].ColorModes; + if (s->val[OPT_MODE].s) + free(s->val[OPT_MODE].s); + s->val[OPT_MODE].s = NULL; + + if (s->scanner->caps[s->scanner->source].default_color) { + int x = 0; + if (!strcmp(s->scanner->caps[s->scanner->source].default_color, "Grayscale8")) + s->val[OPT_MODE].s = (char *)strdup(SANE_VALUE_SCAN_MODE_GRAY); + else if (!strcmp(s->scanner->caps[s->scanner->source].default_color, "BlackAndWhite1")) + s->val[OPT_MODE].s = (char *)strdup(SANE_VALUE_SCAN_MODE_LINEART); + else + s->val[OPT_MODE].s = (char *)strdup(SANE_VALUE_SCAN_MODE_COLOR); + for (x = 0; s->scanner->caps[s->scanner->source].ColorModes[x]; x++) { + if (s->scanner->caps[s->scanner->source].ColorModes[x] && + !strcasecmp(s->scanner->caps[s->scanner->source].ColorModes[x], s->val[OPT_MODE].s)) { + found = 1; + break; + } + } + } + if (!s->scanner->caps[s->scanner->source].default_color || found == 0) { + if (s->scanner->caps[s->scanner->source].default_color) + free(s->scanner->caps[s->scanner->source].default_color); + s->val[OPT_MODE].s = strdup(s->scanner->caps[s->scanner->source].ColorModes[0]); + if (!strcasecmp(s->val[OPT_MODE].s, SANE_VALUE_SCAN_MODE_GRAY)) + s->scanner->caps[s->scanner->source].default_color = strdup("Grayscale8"); + else if (!strcasecmp(s->val[OPT_MODE].s, SANE_VALUE_SCAN_MODE_LINEART)) + s->scanner->caps[s->scanner->source].default_color = strdup("BlackAndWhite1"); + else + s->scanner->caps[s->scanner->source].default_color = strdup("RGB24"); + } + if (!s->val[OPT_MODE].s) { + DBG (10, "Color Mode Default allocation failure.\n"); + return (SANE_STATUS_NO_MEM); + } + if (!s->scanner->caps[s->scanner->source].default_color) { + DBG (10, "Color Mode Default allocation failure.\n"); + return (SANE_STATUS_NO_MEM); + } + s->val[OPT_RESOLUTION].w = s->scanner->caps[s->scanner->source].default_resolution; + s->opt[OPT_TL_X].constraint.range = &s->x_range1; + s->opt[OPT_TL_Y].constraint.range = &s->y_range1; + s->opt[OPT_BR_X].constraint.range = &s->x_range2; + s->opt[OPT_BR_Y].constraint.range = &s->y_range2; + + if (s->val[OPT_SCAN_SOURCE].s) + free (s->val[OPT_SCAN_SOURCE].s); + s->val[OPT_SCAN_SOURCE].s = strdup (s->scanner->Sources[s->scanner->source]); + + return (SANE_STATUS_GOOD); +} + /** * \fn static SANE_Status init_options(SANE_String_Const name, escl_sane_t *s) * \brief Function thzt initializes all the needed options of the received scanner - * (the resolution / the color / the margins) thanks to the informations received with + * (the resolution / the color / the margins) thanks to the information received with * the 'escl_capabilities' function, called just before. * * \return status (if everything is OK, status = SANE_STATUS_GOOD) @@ -554,8 +754,25 @@ init_options(SANE_String_Const name_source, escl_sane_t *s) s->scanner->source = PLATEN; if (source == s->scanner->source) return status; } - else - s->scanner->source = PLATEN; + if (s->scanner->caps[s->scanner->source].ColorModes == NULL) { + if (s->scanner->caps[PLATEN].ColorModes) + s->scanner->source = PLATEN; + else if (s->scanner->caps[ADFSIMPLEX].ColorModes) + s->scanner->source = ADFSIMPLEX; + else if (s->scanner->caps[ADFDUPLEX].ColorModes) + s->scanner->source = ADFDUPLEX; + else + return SANE_STATUS_INVAL; + } + if (s->scanner->source == PLATEN) { + DBG (10, "SOURCE PLATEN.\n"); + } + else if (s->scanner->source == ADFDUPLEX) { + DBG (10, "SOURCE ADFDUPLEX.\n"); + } + else if (s->scanner->source == ADFSIMPLEX) { + DBG (10, "SOURCE ADFSIMPLEX.\n"); + } memset (s->opt, 0, sizeof (s->opt)); memset (s->val, 0, sizeof (s->val)); for (i = 0; i < NUM_OPTIONS; ++i) { @@ -590,6 +807,7 @@ init_options(SANE_String_Const name_source, escl_sane_t *s) s->opt[OPT_MODE_GROUP].desc = ""; s->opt[OPT_MODE_GROUP].type = SANE_TYPE_GROUP; s->opt[OPT_MODE_GROUP].cap = 0; + s->opt[OPT_MODE_GROUP].size = 0; s->opt[OPT_MODE_GROUP].constraint_type = SANE_CONSTRAINT_NONE; s->opt[OPT_MODE].name = SANE_NAME_SCAN_MODE; @@ -599,17 +817,39 @@ init_options(SANE_String_Const name_source, escl_sane_t *s) s->opt[OPT_MODE].unit = SANE_UNIT_NONE; s->opt[OPT_MODE].constraint_type = SANE_CONSTRAINT_STRING_LIST; s->opt[OPT_MODE].constraint.string_list = s->scanner->caps[s->scanner->source].ColorModes; - s->val[OPT_MODE].s = (char *)strdup(s->scanner->caps[s->scanner->source].ColorModes[0]); + if (s->scanner->caps[s->scanner->source].default_color) { + if (!strcasecmp(s->scanner->caps[s->scanner->source].default_color, "Grayscale8")) + s->val[OPT_MODE].s = (char *)strdup(SANE_VALUE_SCAN_MODE_GRAY); + else if (!strcasecmp(s->scanner->caps[s->scanner->source].default_color, "BlackAndWhite1")) + s->val[OPT_MODE].s = (char *)strdup(SANE_VALUE_SCAN_MODE_LINEART); + else + s->val[OPT_MODE].s = (char *)strdup(SANE_VALUE_SCAN_MODE_COLOR); + } + else { + s->val[OPT_MODE].s = (char *)strdup(s->scanner->caps[s->scanner->source].ColorModes[0]); + if (!strcasecmp(s->val[OPT_MODE].s, SANE_VALUE_SCAN_MODE_GRAY)) { + s->scanner->caps[s->scanner->source].default_color = strdup("Grayscale8"); + } + else if (!strcasecmp(s->val[OPT_MODE].s, SANE_VALUE_SCAN_MODE_LINEART)) { + s->scanner->caps[s->scanner->source].default_color = + strdup("BlackAndWhite1"); + } + else { + s->scanner->caps[s->scanner->source].default_color = + strdup("RGB24"); + } + } if (!s->val[OPT_MODE].s) { DBG (10, "Color Mode Default allocation failure.\n"); return (SANE_STATUS_NO_MEM); } + DBG (10, "++ Color Mode Default allocation [%s].\n", s->scanner->caps[s->scanner->source].default_color); s->opt[OPT_MODE].size = max_string_size(s->scanner->caps[s->scanner->source].ColorModes); - s->scanner->caps[s->scanner->source].default_color = (char *)strdup(s->scanner->caps[s->scanner->source].ColorModes[0]); if (!s->scanner->caps[s->scanner->source].default_color) { DBG (10, "Color Mode Default allocation failure.\n"); return (SANE_STATUS_NO_MEM); } + DBG (10, "Color Mode Default allocation (%s).\n", s->scanner->caps[s->scanner->source].default_color); s->opt[OPT_RESOLUTION].name = SANE_NAME_SCAN_RESOLUTION; s->opt[OPT_RESOLUTION].title = SANE_TITLE_SCAN_RESOLUTION; @@ -638,6 +878,7 @@ init_options(SANE_String_Const name_source, escl_sane_t *s) s->opt[OPT_GEOMETRY_GROUP].desc = SANE_DESC_GEOMETRY; s->opt[OPT_GEOMETRY_GROUP].type = SANE_TYPE_GROUP; s->opt[OPT_GEOMETRY_GROUP].cap = SANE_CAP_ADVANCED; + s->opt[OPT_GEOMETRY_GROUP].size = 0; s->opt[OPT_GEOMETRY_GROUP].constraint_type = SANE_CONSTRAINT_NONE; s->opt[OPT_TL_X].name = SANE_NAME_SCAN_TL_X; @@ -696,6 +937,113 @@ init_options(SANE_String_Const name_source, escl_sane_t *s) if (s->val[OPT_SCAN_SOURCE].s) free (s->val[OPT_SCAN_SOURCE].s); s->val[OPT_SCAN_SOURCE].s = strdup (s->scanner->Sources[s->scanner->source]); + + /* "Enhancement" group: */ + s->opt[OPT_ENHANCEMENT_GROUP].title = SANE_I18N ("Enhancement"); + s->opt[OPT_ENHANCEMENT_GROUP].desc = ""; /* not valid for a group */ + s->opt[OPT_ENHANCEMENT_GROUP].type = SANE_TYPE_GROUP; + s->opt[OPT_ENHANCEMENT_GROUP].cap = SANE_CAP_ADVANCED; + s->opt[OPT_ENHANCEMENT_GROUP].size = 0; + s->opt[OPT_ENHANCEMENT_GROUP].constraint_type = SANE_CONSTRAINT_NONE; + + + s->opt[OPT_BRIGHTNESS].name = SANE_NAME_BRIGHTNESS; + s->opt[OPT_BRIGHTNESS].title = SANE_TITLE_BRIGHTNESS; + s->opt[OPT_BRIGHTNESS].desc = SANE_DESC_BRIGHTNESS; + s->opt[OPT_BRIGHTNESS].type = SANE_TYPE_INT; + s->opt[OPT_BRIGHTNESS].unit = SANE_UNIT_NONE; + s->opt[OPT_BRIGHTNESS].constraint_type = SANE_CONSTRAINT_RANGE; + if (s->scanner->brightness) { + s->opt[OPT_BRIGHTNESS].constraint.range = &s->brightness_range; + s->val[OPT_BRIGHTNESS].w = s->scanner->brightness->normal; + s->brightness_range.quant=1; + s->brightness_range.min=s->scanner->brightness->min; + s->brightness_range.max=s->scanner->brightness->max; + } + else{ + SANE_Range range = { 0, 255, 0 }; + s->opt[OPT_BRIGHTNESS].constraint.range = ⦥ + s->val[OPT_BRIGHTNESS].w = 0; + s->opt[OPT_BRIGHTNESS].cap |= SANE_CAP_INACTIVE; + } + s->opt[OPT_CONTRAST].name = SANE_NAME_CONTRAST; + s->opt[OPT_CONTRAST].title = SANE_TITLE_CONTRAST; + s->opt[OPT_CONTRAST].desc = SANE_DESC_CONTRAST; + s->opt[OPT_CONTRAST].type = SANE_TYPE_INT; + s->opt[OPT_CONTRAST].unit = SANE_UNIT_NONE; + s->opt[OPT_CONTRAST].constraint_type = SANE_CONSTRAINT_RANGE; + if (s->scanner->contrast) { + s->opt[OPT_CONTRAST].constraint.range = &s->contrast_range; + s->val[OPT_CONTRAST].w = s->scanner->contrast->normal; + s->contrast_range.quant=1; + s->contrast_range.min=s->scanner->contrast->min; + s->contrast_range.max=s->scanner->contrast->max; + } + else{ + SANE_Range range = { 0, 255, 0 }; + s->opt[OPT_CONTRAST].constraint.range = ⦥ + s->val[OPT_CONTRAST].w = 0; + s->opt[OPT_CONTRAST].cap |= SANE_CAP_INACTIVE; + } + s->opt[OPT_SHARPEN].name = SANE_NAME_SHARPEN; + s->opt[OPT_SHARPEN].title = SANE_TITLE_SHARPEN; + s->opt[OPT_SHARPEN].desc = SANE_DESC_SHARPEN; + s->opt[OPT_SHARPEN].type = SANE_TYPE_INT; + s->opt[OPT_SHARPEN].unit = SANE_UNIT_NONE; + s->opt[OPT_SHARPEN].constraint_type = SANE_CONSTRAINT_RANGE; + if (s->scanner->sharpen) { + s->opt[OPT_SHARPEN].constraint.range = &s->sharpen_range; + s->val[OPT_SHARPEN].w = s->scanner->sharpen->normal; + s->sharpen_range.quant=1; + s->sharpen_range.min=s->scanner->sharpen->min; + s->sharpen_range.max=s->scanner->sharpen->max; + } + else{ + SANE_Range range = { 0, 255, 0 }; + s->opt[OPT_SHARPEN].constraint.range = ⦥ + s->val[OPT_SHARPEN].w = 0; + s->opt[OPT_SHARPEN].cap |= SANE_CAP_INACTIVE; + } + /*threshold*/ + s->opt[OPT_THRESHOLD].name = SANE_NAME_THRESHOLD; + s->opt[OPT_THRESHOLD].title = SANE_TITLE_THRESHOLD; + s->opt[OPT_THRESHOLD].desc = SANE_DESC_THRESHOLD; + s->opt[OPT_THRESHOLD].type = SANE_TYPE_INT; + s->opt[OPT_THRESHOLD].unit = SANE_UNIT_NONE; + s->opt[OPT_THRESHOLD].constraint_type = SANE_CONSTRAINT_RANGE; + if (s->scanner->threshold) { + s->opt[OPT_THRESHOLD].constraint.range = &s->thresold_range; + s->val[OPT_THRESHOLD].w = s->scanner->threshold->normal; + s->thresold_range.quant=1; + s->thresold_range.min= s->scanner->threshold->min; + s->thresold_range.max=s->scanner->threshold->max; + } + else{ + SANE_Range range = { 0, 255, 0 }; + s->opt[OPT_THRESHOLD].constraint.range = ⦥ + s->val[OPT_THRESHOLD].w = 0; + s->opt[OPT_THRESHOLD].cap |= SANE_CAP_INACTIVE; + } + if (!strcasecmp(s->val[OPT_MODE].s, SANE_VALUE_SCAN_MODE_LINEART)) { + if (s->scanner->threshold) + s->opt[OPT_THRESHOLD].cap &= ~SANE_CAP_INACTIVE; + if (s->scanner->brightness) + s->opt[OPT_BRIGHTNESS].cap |= SANE_CAP_INACTIVE; + if (s->scanner->contrast) + s->opt[OPT_CONTRAST].cap |= SANE_CAP_INACTIVE; + if (s->scanner->sharpen) + s->opt[OPT_SHARPEN].cap |= SANE_CAP_INACTIVE; + } + else { + if (s->scanner->threshold) + s->opt[OPT_THRESHOLD].cap |= SANE_CAP_INACTIVE; + if (s->scanner->brightness) + s->opt[OPT_BRIGHTNESS].cap &= ~SANE_CAP_INACTIVE; + if (s->scanner->contrast) + s->opt[OPT_CONTRAST].cap &= ~SANE_CAP_INACTIVE; + if (s->scanner->sharpen) + s->opt[OPT_SHARPEN].cap &= ~SANE_CAP_INACTIVE; + } return (status); } @@ -745,6 +1093,50 @@ escl_parse_name(SANE_String_Const name, ESCL_Device *device) return SANE_STATUS_GOOD; } +static void +_get_hack(SANE_String_Const name, ESCL_Device *device) +{ + FILE *fp; + SANE_Char line[PATH_MAX]; + DBG (3, "_get_hack: start\n"); + if (device->model_name && + (strcasestr(device->model_name, "LaserJet FlowMFP M578") || + strcasestr(device->model_name, "LaserJet MFP M630"))) { + device->hack = curl_slist_append(NULL, "Host: localhost"); + DBG (3, "_get_hack: finish\n"); + return; + } + + /* open configuration file */ + fp = sanei_config_open (ESCL_CONFIG_FILE); + if (!fp) + { + DBG (2, "_get_hack: couldn't access %s\n", ESCL_CONFIG_FILE); + DBG (3, "_get_hack: exit\n"); + } + + /* loop reading the configuration file, all line beginning by "option " 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)) + { + if (strstr(line, name)) { + DBG (3, "_get_hack: idevice found\n"); + if (strstr(line, "hack=localhost")) { + DBG (3, "_get_hack: device found\n"); + device->hack = curl_slist_append(NULL, "Host: localhost"); + } + goto finish_hack; + } + } +finish_hack: + DBG (3, "_get_hack: finish\n"); + fclose(fp); +} + + + /** * \fn SANE_Status sane_open(SANE_String_Const name, SANE_Handle *h) * \brief Function that establishes a connection with the device named by 'name', @@ -786,6 +1178,8 @@ sane_open(SANE_String_Const name, SANE_Handle *h) escl_free_handler(handler); return (status); } + _get_hack(name, device); + status = init_options(NULL, handler); if (status != SANE_STATUS_GOOD) { escl_free_handler(handler); @@ -897,9 +1291,12 @@ sane_control_option(SANE_Handle h, SANE_Int n, SANE_Action a, void *v, SANE_Int case OPT_BR_X: case OPT_BR_Y: case OPT_NUM_OPTS: - case OPT_RESOLUTION: case OPT_PREVIEW: case OPT_GRAY_PREVIEW: + case OPT_RESOLUTION: + case OPT_BRIGHTNESS: + case OPT_CONTRAST: + case OPT_SHARPEN: *(SANE_Word *) v = handler->val[n].w; break; case OPT_SCAN_SOURCE: @@ -919,16 +1316,18 @@ sane_control_option(SANE_Handle h, SANE_Int n, SANE_Action a, void *v, SANE_Int case OPT_BR_X: case OPT_BR_Y: case OPT_NUM_OPTS: - case OPT_RESOLUTION: case OPT_PREVIEW: case OPT_GRAY_PREVIEW: + case OPT_BRIGHTNESS: + case OPT_CONTRAST: + case OPT_SHARPEN: handler->val[n].w = *(SANE_Word *) v; if (i) *i |= SANE_INFO_RELOAD_PARAMS | SANE_INFO_RELOAD_OPTIONS | SANE_INFO_INEXACT; break; case OPT_SCAN_SOURCE: DBG(10, "SET OPT_SCAN_SOURCE(%s)\n", (SANE_String_Const)v); - init_options((SANE_String_Const)v, handler); + init_options_small((SANE_String_Const)v, handler); if (i) *i |= SANE_INFO_RELOAD_PARAMS | SANE_INFO_RELOAD_OPTIONS | SANE_INFO_INEXACT; break; @@ -940,6 +1339,48 @@ sane_control_option(SANE_Handle h, SANE_Int n, SANE_Action a, void *v, SANE_Int DBG (10, "OPT_MODE allocation failure.\n"); return (SANE_STATUS_NO_MEM); } + DBG(10, "SET OPT_MODE(%s)\n", (SANE_String_Const)v); + + if (!strcasecmp(handler->val[n].s, SANE_VALUE_SCAN_MODE_GRAY)) { + handler->scanner->caps[handler->scanner->source].default_color = strdup("Grayscale8"); + DBG(10, "SET OPT_MODE(Grayscale8)\n"); + } + else if (!strcasecmp(handler->val[n].s, SANE_VALUE_SCAN_MODE_LINEART)) { + handler->scanner->caps[handler->scanner->source].default_color = + strdup("BlackAndWhite1"); + DBG(10, "SET OPT_MODE(BlackAndWhite1)\n"); + } + else { + handler->scanner->caps[handler->scanner->source].default_color = + strdup("RGB24"); + DBG(10, "SET OPT_MODE(RGB24)\n"); + } + DBG (10, "Color Mode allocation (%s).\n", handler->scanner->caps[handler->scanner->source].default_color); + if (i) + *i |= SANE_INFO_RELOAD_PARAMS | SANE_INFO_RELOAD_OPTIONS | SANE_INFO_INEXACT; + if (handler->scanner->brightness) + handler->opt[OPT_BRIGHTNESS].cap |= SANE_CAP_INACTIVE; + if (handler->scanner->contrast) + handler->opt[OPT_CONTRAST].cap |= SANE_CAP_INACTIVE; + if (handler->scanner->threshold) + handler->opt[OPT_THRESHOLD].cap |= SANE_CAP_INACTIVE; + if (handler->scanner->sharpen) + handler->opt[OPT_SHARPEN].cap |= SANE_CAP_INACTIVE; + if (!strcasecmp(handler->val[n].s, SANE_VALUE_SCAN_MODE_LINEART)) { + if (handler->scanner->threshold) + handler->opt[OPT_THRESHOLD].cap &= ~SANE_CAP_INACTIVE; + } + else { + if (handler->scanner->brightness) + handler->opt[OPT_BRIGHTNESS].cap &= ~SANE_CAP_INACTIVE; + if (handler->scanner->contrast) + handler->opt[OPT_CONTRAST].cap &= ~SANE_CAP_INACTIVE; + if (handler->scanner->sharpen) + handler->opt[OPT_SHARPEN].cap &= ~SANE_CAP_INACTIVE; + } + break; + case OPT_RESOLUTION: + handler->val[n].w = _get_resolution(handler, (int)(*(SANE_Word *) v)); if (i) *i |= SANE_INFO_RELOAD_PARAMS | SANE_INFO_RELOAD_OPTIONS | SANE_INFO_INEXACT; break; @@ -975,7 +1416,7 @@ _go_next_page(SANE_Status status, /** * \fn SANE_Status sane_start(SANE_Handle h) - * \brief Function that initiates aquisition of an image from the device represented by handle 'h'. + * \brief Function that initiates acquisition of an image from the device represented by handle 'h'. * This function calls the "escl_newjob" function and the "escl_scan" function. * * \return status (if everything is OK, status = SANE_STATUS_GOOD, otherwise, SANE_STATUS_NO_MEM/SANE_STATUS_INVAL) @@ -1005,11 +1446,13 @@ sane_start(SANE_Handle h) NULL); if (st != SANE_STATUS_GOOD) return st; - if(handler->scanner->caps[handler->scanner->source].default_color) - free(handler->scanner->caps[handler->scanner->source].default_color); if (handler->val[OPT_PREVIEW].w == SANE_TRUE) { - int i = 0, val = 9999;; + int i = 0, val = 9999; + + if(handler->scanner->caps[handler->scanner->source].default_color) + free(handler->scanner->caps[handler->scanner->source].default_color); + if (handler->val[OPT_GRAY_PREVIEW].w == SANE_TRUE || !strcasecmp(handler->val[OPT_MODE].s, SANE_VALUE_SCAN_MODE_GRAY)) handler->scanner->caps[handler->scanner->source].default_color = @@ -1032,15 +1475,18 @@ sane_start(SANE_Handle h) { handler->scanner->caps[handler->scanner->source].default_resolution = handler->val[OPT_RESOLUTION].w; - if (!strcasecmp(handler->val[OPT_MODE].s, SANE_VALUE_SCAN_MODE_GRAY)) - handler->scanner->caps[handler->scanner->source].default_color = strdup("Grayscale8"); - else if (!strcasecmp(handler->val[OPT_MODE].s, SANE_VALUE_SCAN_MODE_LINEART)) - handler->scanner->caps[handler->scanner->source].default_color = - strdup("BlackAndWhite1"); - else - handler->scanner->caps[handler->scanner->source].default_color = - strdup("RGB24"); + if (!handler->scanner->caps[handler->scanner->source].default_color) { + if (!strcasecmp(handler->val[OPT_MODE].s, SANE_VALUE_SCAN_MODE_GRAY)) + handler->scanner->caps[handler->scanner->source].default_color = strdup("Grayscale8"); + else if (!strcasecmp(handler->val[OPT_MODE].s, SANE_VALUE_SCAN_MODE_LINEART)) + handler->scanner->caps[handler->scanner->source].default_color = + strdup("BlackAndWhite1"); + else + handler->scanner->caps[handler->scanner->source].default_color = + strdup("RGB24"); + } } + DBG (10, "Before newjob Color Mode allocation (%s).\n", handler->scanner->caps[handler->scanner->source].default_color); handler->scanner->caps[handler->scanner->source].height = MM_TO_PIXEL(handler->val[OPT_BR_Y].w, 300.0); handler->scanner->caps[handler->scanner->source].width = @@ -1066,6 +1512,67 @@ sane_start(SANE_Handle h) DBG (10, "Default Color allocation failure.\n"); return (SANE_STATUS_NO_MEM); } + + if (handler->scanner->threshold) { + DBG(10, "Have Thresold\n"); + if (IS_ACTIVE(OPT_THRESHOLD)) { + DBG(10, "Use Thresold [%d]\n", handler->val[OPT_THRESHOLD].w); + handler->scanner->val_threshold = handler->val[OPT_THRESHOLD].w; + handler->scanner->use_threshold = 1; + } + else { + DBG(10, "Not use Thresold\n"); + handler->scanner->use_threshold = 0; + } + } + else + DBG(10, "Don't have Thresold\n"); + + if (handler->scanner->sharpen) { + DBG(10, "Have Sharpen\n"); + if (IS_ACTIVE(OPT_SHARPEN)) { + DBG(10, "Use Sharpen [%d]\n", handler->val[OPT_SHARPEN].w); + handler->scanner->val_sharpen = handler->val[OPT_SHARPEN].w; + handler->scanner->use_sharpen = 1; + } + else { + DBG(10, "Not use Sharpen\n"); + handler->scanner->use_sharpen = 0; + } + } + else + DBG(10, "Don't have Sharpen\n"); + + if (handler->scanner->contrast) { + DBG(10, "Have Contrast\n"); + if (IS_ACTIVE(OPT_CONTRAST)) { + DBG(10, "Use Contrast [%d]\n", handler->val[OPT_CONTRAST].w); + handler->scanner->val_contrast = handler->val[OPT_CONTRAST].w; + handler->scanner->use_contrast = 1; + } + else { + DBG(10, "Not use Contrast\n"); + handler->scanner->use_contrast = 0; + } + } + else + DBG(10, "Don't have Contrast\n"); + + if (handler->scanner->brightness) { + DBG(10, "Have Brightness\n"); + if (IS_ACTIVE(OPT_BRIGHTNESS)) { + DBG(10, "Use Brightness [%d]\n", handler->val[OPT_BRIGHTNESS].w); + handler->scanner->val_brightness = handler->val[OPT_BRIGHTNESS].w; + handler->scanner->use_brightness = 1; + } + else { + DBG(10, "Not use Brightness\n"); + handler->scanner->use_brightness = 0; + } + } + else + DBG(10, "Don't have Brightness\n"); + handler->result = escl_newjob(handler->scanner, handler->device, &status); if (status != SANE_STATUS_GOOD) return (status); @@ -1104,7 +1611,7 @@ sane_start(SANE_Handle h) status = get_PDF_data(handler->scanner, &w, &he, &bps); } else { - DBG(10, "Unknow image format\n"); + DBG(10, "Unknown image format\n"); return SANE_STATUS_INVAL; } @@ -1257,6 +1764,12 @@ escl_curl_url(CURL *handle, const ESCL_Device *device, SANE_String_Const path) DBG( 1, "escl_curl_url: URL: %s\n", url ); curl_easy_setopt(handle, CURLOPT_URL, url); free(url); + DBG( 1, "Before use hack\n"); + if (device->hack) { + DBG( 1, "Use hack\n"); + curl_easy_setopt(handle, CURLOPT_HTTPHEADER, device->hack); + } + DBG( 1, "After use hack\n"); if (device->https) { DBG( 1, "Ignoring safety certificates, use https\n"); curl_easy_setopt(handle, CURLOPT_SSL_VERIFYPEER, 0L); diff --git a/backend/escl/escl.h b/backend/escl/escl.h index 53ce7c7..67b11c7 100644 --- a/backend/escl/escl.h +++ b/backend/escl/escl.h @@ -16,8 +16,8 @@ for more details. You should have received a copy of the GNU General Public License - along with sane; see the file COPYING. If not, write to the Free - Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + along with sane; see the file COPYING. + If not, see . This file implements a SANE backend for eSCL scanners. */ @@ -27,10 +27,13 @@ #include "../include/sane/config.h" + #if !(HAVE_LIBCURL && defined(WITH_AVAHI) && defined(HAVE_LIBXML2)) #error "The escl backend requires libcurl, libavahi and libxml2" #endif + + #ifndef HAVE_LIBJPEG /* FIXME: Make JPEG support optional. Support for PNG and PDF is to be added later but currently only @@ -45,6 +48,8 @@ #include #include +#include + #ifndef BACKEND_NAME #define BACKEND_NAME escl #endif @@ -87,12 +92,15 @@ typedef struct { typedef struct ESCL_Device { struct ESCL_Device *next; - char *model_name; - int port_nb; - char *ip_address; - char *type; + char *model_name; + int port_nb; + char *ip_address; + char *is; + char *uuid; + char *type; SANE_Bool https; - char *unix_socket; + struct curl_slist *hack; + char *unix_socket; } ESCL_Device; typedef struct capst @@ -127,8 +135,20 @@ typedef struct capst int RiskyTopMargin; int RiskyBottomMargin; int duplex; + int have_jpeg; + int have_png; + int have_tiff; + int have_pdf; } caps_t; +typedef struct support +{ + int min; + int max; + int normal; + int step; +} support_t; + typedef struct capabilities { caps_t caps[3]; @@ -141,6 +161,18 @@ typedef struct capabilities long img_read; size_t real_read; SANE_Bool work; + support_t *brightness; + support_t *contrast; + support_t *sharpen; + support_t *threshold; + int use_brightness; + int val_brightness; + int use_contrast; + int val_contrast; + int use_sharpen; + int val_sharpen; + int use_threshold; + int val_threshold; } capabilities_t; typedef struct { @@ -162,8 +194,7 @@ enum OPT_MODE_GROUP, OPT_MODE, OPT_RESOLUTION, - OPT_PREVIEW, - OPT_GRAY_PREVIEW, + OPT_SCAN_SOURCE, OPT_GEOMETRY_GROUP, OPT_TL_X, @@ -171,7 +202,13 @@ enum OPT_BR_X, OPT_BR_Y, - OPT_SCAN_SOURCE, + OPT_ENHANCEMENT_GROUP, + OPT_PREVIEW, + OPT_GRAY_PREVIEW, + OPT_BRIGHTNESS, + OPT_CONTRAST, + OPT_SHARPEN, + OPT_THRESHOLD, NUM_OPTIONS }; @@ -180,35 +217,68 @@ enum #define MM_TO_PIXEL(millimeters, dpi) (SANE_Word)round(SANE_UNFIX(millimeters) * (dpi) / 25.4) ESCL_Device *escl_devices(SANE_Status *status); -SANE_Status escl_device_add(int port_nb, const char *model_name, - char *ip_address, char *type); +SANE_Status escl_device_add(int port_nb, + const char *model_name, + char *ip_address, + const char *is, + const char *uuid, + char *type); + SANE_Status escl_status(const ESCL_Device *device, int source, const char* jobId, SANE_Status *job); -capabilities_t *escl_capabilities(const ESCL_Device *device, SANE_Status *status); -char *escl_newjob(capabilities_t *scanner, const ESCL_Device *device, - SANE_Status *status); -SANE_Status escl_scan(capabilities_t *scanner, const ESCL_Device *device, - char *result); -void escl_scanner(const ESCL_Device *device, char *result); + +capabilities_t *escl_capabilities(ESCL_Device *device, + SANE_Status *status); + +char *escl_newjob(capabilities_t *scanner, + const ESCL_Device *device, + SANE_Status *status); + +SANE_Status escl_scan(capabilities_t *scanner, + const ESCL_Device *device, + char *result); + +void escl_scanner(const ESCL_Device *device, + char *result); typedef void CURL; -void escl_curl_url(CURL *handle, const ESCL_Device *device, SANE_String_Const path); -unsigned char *escl_crop_surface(capabilities_t *scanner, unsigned char *surface, - int w, int h, int bps, int *width, int *height); +void escl_curl_url(CURL *handle, + const ESCL_Device *device, + SANE_String_Const path); + +unsigned char *escl_crop_surface(capabilities_t *scanner, + unsigned char *surface, + int w, + int h, + int bps, + int *width, + int *height); // JPEG -SANE_Status get_JPEG_data(capabilities_t *scanner, int *width, int *height, int *bps); +SANE_Status get_JPEG_data(capabilities_t *scanner, + int *width, + int *height, + int *bps); // PNG -SANE_Status get_PNG_data(capabilities_t *scanner, int *width, int *height, int *bps); +SANE_Status get_PNG_data(capabilities_t *scanner, + int *width, + int *height, + int *bps); // TIFF -SANE_Status get_TIFF_data(capabilities_t *scanner, int *width, int *height, int *bps); +SANE_Status get_TIFF_data(capabilities_t *scanner, + int *width, + int *height, + int *bps); // PDF -SANE_Status get_PDF_data(capabilities_t *scanner, int *width, int *height, int *bps); +SANE_Status get_PDF_data(capabilities_t *scanner, + int *width, + int *height, + int *bps); #endif diff --git a/backend/escl/escl_capabilities.c b/backend/escl/escl_capabilities.c index fdd5cfe..db194f9 100644 --- a/backend/escl/escl_capabilities.c +++ b/backend/escl/escl_capabilities.c @@ -16,8 +16,8 @@ for more details. You should have received a copy of the GNU General Public License - along with sane; see the file COPYING. If not, write to the Free - Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + along with sane; see the file COPYING. + If not, see . This file implements a SANE backend for eSCL scanners. */ @@ -30,7 +30,6 @@ #include #include -#include #include #include "../include/sane/saneopts.h" @@ -90,9 +89,9 @@ char_to_array(SANE_String_Const *tab, int *tabsize, SANE_String_Const mode, int } (*tabsize)++; if (*tabsize == 1) - board = (SANE_String_Const *)malloc(sizeof(SANE_String_Const) * (*tabsize) + 1); + board = (SANE_String_Const *)malloc(sizeof(SANE_String_Const) * ((*tabsize) + 1)); else - board = (SANE_String_Const *)realloc(tab, sizeof(SANE_String_Const) * (*tabsize) + 1); + board = (SANE_String_Const *)realloc(tab, sizeof(SANE_String_Const) * ((*tabsize) + 1)); board[*tabsize - 1] = (SANE_String_Const)strdup(convert); board[*tabsize] = NULL; return (board); @@ -173,7 +172,7 @@ find_nodes_c(xmlNode *node) /** * \fn static int find_valor_of_array_variables(xmlNode *node, capabilities_t *scanner) - * \brief Function that searchs in the xml file if a scanner capabilitie stocked + * \brief Function that searches in the xml file if a scanner capabilitie stocked * in one of the created array (character/integer array) is found. * * \return 0 @@ -194,32 +193,40 @@ find_valor_of_array_variables(xmlNode *node, capabilities_t *scanner, int type) int i = 0; SANE_Bool have_jpeg = SANE_FALSE, have_png = SANE_FALSE, have_tiff = SANE_FALSE, have_pdf = SANE_FALSE; scanner->caps[type].DocumentFormats = char_to_array(scanner->caps[type].DocumentFormats, &scanner->caps[type].DocumentFormatsSize, (SANE_String_Const)xmlNodeGetContent(node), 0); + scanner->caps[type].have_jpeg = -1; + scanner->caps[type].have_png = -1; + scanner->caps[type].have_tiff = -1; + scanner->caps[type].have_pdf = -1; for(; i < scanner->caps[type].DocumentFormatsSize; i++) { if (!strcmp(scanner->caps[type].DocumentFormats[i], "image/jpeg")) { have_jpeg = SANE_TRUE; + scanner->caps[type].have_jpeg = i; } #if(defined HAVE_LIBPNG) else if(!strcmp(scanner->caps[type].DocumentFormats[i], "image/png")) { have_png = SANE_TRUE; + scanner->caps[type].have_png = i; } #endif #if(defined HAVE_TIFFIO_H) else if(type == PLATEN && !strcmp(scanner->caps[type].DocumentFormats[i], "image/tiff")) { have_tiff = SANE_TRUE; + scanner->caps[type].have_tiff = i; } #endif #if(defined HAVE_POPPLER_GLIB) else if(type == PLATEN && !strcmp(scanner->caps[type].DocumentFormats[i], "application/pdf")) { have_pdf = SANE_TRUE; + scanner->caps[type].have_pdf = i; } #endif } - if (have_pdf) + if (have_pdf) scanner->caps[type].default_format = strdup("application/pdf"); else if (have_tiff) scanner->caps[type].default_format = strdup("image/tiff"); @@ -239,7 +246,7 @@ find_valor_of_array_variables(xmlNode *node, capabilities_t *scanner, int type) /** * \fn static int find_value_of_int_variables(xmlNode *node, capabilities_t *scanner) - * \brief Function that searchs in the xml file if a integer scanner capabilitie is found. + * \brief Function that searches in the xml file if a integer scanner capabilitie is found. * The integer scanner capabilities that are interesting are : * MinWidth, MaxWidth, MaxHeight, MinHeight, MaxScanRegions, MaxOpticalXResolution, * RiskyLeftMargin, RiskyRightMargin, RiskyTopMargin, RiskyBottomMargin. @@ -283,11 +290,74 @@ find_value_of_int_variables(xmlNode *node, capabilities_t *scanner, int type) return (0); } +static support_t* +print_support(xmlNode *node) +{ + support_t *sup = (support_t*)calloc(1, sizeof(support_t)); + int cpt = 0; + int have_norm = 0; + while (node) { + if (!strcmp((const char *)node->name, "Min")){ + sup->min = atoi((const char *)xmlNodeGetContent(node)); + cpt++; + } + else if (!strcmp((const char *)node->name, "Max")) { + sup->max = atoi((const char *)xmlNodeGetContent(node)); + cpt++; + } + else if (!strcmp((const char *)node->name, "Normal")) { + sup->normal = atoi((const char *)xmlNodeGetContent(node)); + cpt++; + have_norm = 1; + } + else if (!strcmp((const char *)node->name, "Step")) { + sup->step = atoi((const char *)xmlNodeGetContent(node)); + cpt++; + } + node = node->next; + } + if (cpt == 4) + return sup; + if (cpt == 3 && have_norm == 0) { + sup->normal = (sup->max / 2 ); + return sup; + } + free(sup); + return NULL; +} + +static int +find_struct_variables(xmlNode *node, capabilities_t *scanner) +{ + const char *name = (const char *)node->name; + if (strcmp(name, "BrightnessSupport") == 0) { + scanner->brightness = + print_support(node->children); + return 1; + } + else if (strcmp(name, "ContrastSupport") == 0) { + scanner->contrast = + print_support(node->children); + return 1; + } + else if (strcmp(name, "SharpenSupport") == 0) { + scanner->sharpen = + print_support(node->children); + return 1; + } + else if (strcmp(name, "ThresholdSupport") == 0) { + scanner->threshold = + print_support(node->children); + return 1; + } + return (0); +} + /** * \fn static int find_true_variables(xmlNode *node, capabilities_t *scanner) - * \brief Function that searchs in the xml file if we find a scanner capabilitie stocked + * \brief Function that searches in the xml file if we find a scanner capability stored * in one of the created array (character/integer array), - * or, if we find a integer scanner capabilitie. + * or, if we find a integer scanner capability. * * \return 0 */ @@ -322,36 +392,39 @@ find_true_variables(xmlNode *node, capabilities_t *scanner, int type) * \return 0 */ static int -print_xml_c(xmlNode *node, capabilities_t *scanner, int type) +print_xml_c(xmlNode *node, ESCL_Device *device, capabilities_t *scanner, int type) { while (node) { if (node->type == XML_ELEMENT_NODE) { if (find_nodes_c(node) && type != -1) find_true_variables(node, scanner, type); } - if (!strcmp((const char *)node->name, "PlatenInputCaps")) { + if (!strcmp((const char *)node->name, "MakeAndModel")){ + device->model_name = strdup((const char *)xmlNodeGetContent(node)); + } + else if (!strcmp((const char *)node->name, "PlatenInputCaps")) { scanner->Sources[PLATEN] = (SANE_String_Const)strdup(SANE_I18N ("Flatbed")); scanner->SourcesSize++; scanner->source = PLATEN; - print_xml_c(node->children, scanner, PLATEN); + print_xml_c(node->children, device, scanner, PLATEN); scanner->caps[PLATEN].duplex = 0; } else if (!strcmp((const char *)node->name, "AdfSimplexInputCaps")) { scanner->Sources[ADFSIMPLEX] = (SANE_String_Const)strdup(SANE_I18N("ADF")); scanner->SourcesSize++; if (scanner->source == -1) scanner->source = ADFSIMPLEX; - print_xml_c(node->children, scanner, ADFSIMPLEX); + print_xml_c(node->children, device, scanner, ADFSIMPLEX); scanner->caps[ADFSIMPLEX].duplex = 0; } else if (!strcmp((const char *)node->name, "AdfDuplexInputCaps")) { scanner->Sources[ADFDUPLEX] = (SANE_String_Const)strdup(SANE_I18N ("ADF Duplex")); scanner->SourcesSize++; if (scanner->source == -1) scanner->source = ADFDUPLEX; - print_xml_c(node->children, scanner, ADFDUPLEX); + print_xml_c(node->children, device, scanner, ADFDUPLEX); scanner->caps[ADFDUPLEX].duplex = 1; } - else - print_xml_c(node->children, scanner, type); + else if (find_struct_variables(node, scanner) == 0) + print_xml_c(node->children, device, scanner, type); node = node->next; } return (0); @@ -390,7 +463,7 @@ _reduce_color_modes(capabilities_t *scanner) * \return scanner (the structure that stocks all the capabilities elements) */ capabilities_t * -escl_capabilities(const ESCL_Device *device, SANE_Status *status) +escl_capabilities(ESCL_Device *device, SANE_Status *status) { capabilities_t *scanner = (capabilities_t*)calloc(1, sizeof(capabilities_t)); CURL *curl_handle = NULL; @@ -434,7 +507,7 @@ escl_capabilities(const ESCL_Device *device, SANE_Status *status) scanner->Sources = (SANE_String_Const *)malloc(sizeof(SANE_String_Const) * 4); for (i = 0; i < 4; i++) scanner->Sources[i] = NULL; - print_xml_c(node, scanner, -1); + print_xml_c(node, device, scanner, -1); _reduce_color_modes(scanner); clean: xmlFreeDoc(data); diff --git a/backend/escl/escl_crop.c b/backend/escl/escl_crop.c index 8740d22..59284ac 100644 --- a/backend/escl/escl_crop.c +++ b/backend/escl/escl_crop.c @@ -15,8 +15,8 @@ for more details. You should have received a copy of the GNU General Public License - along with sane; see the file COPYING. If not, write to the Free - Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + along with sane; see the file COPYING. + If not, see . This file implements a SANE backend for eSCL scanners. */ diff --git a/backend/escl/escl_devices.c b/backend/escl/escl_devices.c index 7ecbe31..3ca28de 100644 --- a/backend/escl/escl_devices.c +++ b/backend/escl/escl_devices.c @@ -16,8 +16,8 @@ for more details. You should have received a copy of the GNU General Public License - along with sane; see the file COPYING. If not, write to the Free - Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + along with sane; see the file COPYING. + If not, see . This file implements a SANE backend for eSCL scanners. */ @@ -38,6 +38,7 @@ #include "../include/sane/sanei.h" static AvahiSimplePoll *simple_poll = NULL; +static int count_finish = 0; /** * \fn static void resolve_callback(AvahiServiceResolver *r, AVAHI_GCC_UNUSED @@ -62,6 +63,9 @@ resolve_callback(AvahiServiceResolver *r, AVAHI_GCC_UNUSED AvahiIfIndex interfac void __sane_unused__ *userdata) { char a[AVAHI_ADDRESS_STR_MAX], *t; + const char *is; + const char *uuid; + AvahiStringList *s; assert(r); switch (event) { case AVAHI_RESOLVER_FAILURE: @@ -69,8 +73,19 @@ resolve_callback(AvahiServiceResolver *r, AVAHI_GCC_UNUSED AvahiIfIndex interfac case AVAHI_RESOLVER_FOUND: avahi_address_snprint(a, sizeof(a), address); t = avahi_string_list_to_string(txt); - if (strstr(t, "\"rs=eSCL\"") || strstr(t, "\"rs=/eSCL\"")) - escl_device_add(port, name, a, (char*)type); + if (strstr(t, "\"rs=eSCL\"") || strstr(t, "\"rs=/eSCL\"")) { + s = avahi_string_list_find(txt, "is"); + if (s && s->size > 3) + is = (const char*)s->text + 3; + else + is = (const char*)NULL; + s = avahi_string_list_find(txt, "uuid"); + if (s && s->size > 5) + uuid = (const char*)s->text + 5; + else + uuid = (const char*)NULL; + escl_device_add(port, name, a, is, uuid, (char*)type); + } } } @@ -107,7 +122,11 @@ browse_callback(AvahiServiceBrowser *b, AvahiIfIndex interface, case AVAHI_BROWSER_ALL_FOR_NOW: case AVAHI_BROWSER_CACHE_EXHAUSTED: if (event != AVAHI_BROWSER_CACHE_EXHAUSTED) - avahi_simple_poll_quit(simple_poll); + { + count_finish++; + if (count_finish == 2) + avahi_simple_poll_quit(simple_poll); + } break; } } @@ -143,6 +162,8 @@ escl_devices(SANE_Status *status) AvahiServiceBrowser *sb = NULL; int error; + count_finish = 0; + *status = SANE_STATUS_GOOD; if (!(simple_poll = avahi_simple_poll_new())) { DBG( 1, "Failed to create simple poll object.\n"); diff --git a/backend/escl/escl_jpeg.c b/backend/escl/escl_jpeg.c index 8d6b6b6..651e7c5 100644 --- a/backend/escl/escl_jpeg.c +++ b/backend/escl/escl_jpeg.c @@ -16,8 +16,8 @@ for more details. You should have received a copy of the GNU General Public License - along with sane; see the file COPYING. If not, write to the Free - Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + along with sane; see the file COPYING. + If not, see . This file implements a SANE backend for eSCL scanners. */ diff --git a/backend/escl/escl_mupdf.c b/backend/escl/escl_mupdf.c index 9399218..dd23482 100644 --- a/backend/escl/escl_mupdf.c +++ b/backend/escl/escl_mupdf.c @@ -15,8 +15,8 @@ for more details. You should have received a copy of the GNU General Public License - along with sane; see the file COPYING. If not, write to the Free - Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + along with sane; see the file COPYING. + If not, see . This file implements a SANE backend for eSCL scanners. */ diff --git a/backend/escl/escl_newjob.c b/backend/escl/escl_newjob.c index ee8c03c..24bfbc9 100644 --- a/backend/escl/escl_newjob.c +++ b/backend/escl/escl_newjob.c @@ -16,8 +16,8 @@ for more details. You should have received a copy of the GNU General Public License - along with sane; see the file COPYING. If not, write to the Free - Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + along with sane; see the file COPYING. + If not, see . This file implements a SANE backend for eSCL scanners. */ @@ -29,8 +29,7 @@ #include #include #include - -#include +#include #ifdef PATH_MAX # undef PATH_MAX @@ -38,12 +37,6 @@ #define PATH_MAX 4096 -struct uploading -{ - const char *read_data; - size_t size; -}; - struct downloading { char *memory; @@ -71,6 +64,7 @@ static const char settings[] = " %s" \ " %s" \ "%s" \ + "%s" \ ""; /** @@ -114,6 +108,15 @@ download_callback(void *str, size_t size, size_t nmemb, void *userp) return (realsize); } +static char* +add_support_option(char *key, int val) +{ + int size = (strlen(key) * 3) + 10; + char *tmp = (char*)calloc(1, size); + snprintf (tmp, size, "%d\n", key, val, key); + return tmp; +} + /** * \fn char *escl_newjob (capabilities_t *scanner, const ESCL_Device *device, SANE_Status *status) * \brief Function that, using curl, uploads the data (composed by the scanner capabilities) to the @@ -128,7 +131,7 @@ escl_newjob (capabilities_t *scanner, const ESCL_Device *device, SANE_Status *st { CURL *curl_handle = NULL; int off_x = 0, off_y = 0; - struct uploading *upload = NULL; + struct downloading *upload = NULL; struct downloading *download = NULL; const char *scan_jobs = "/eSCL/ScanJobs"; char cap_data[PATH_MAX] = { 0 }; @@ -138,6 +141,7 @@ escl_newjob (capabilities_t *scanner, const ESCL_Device *device, SANE_Status *st char *f_ext = ""; char *format_ext = NULL; char duplex_mode[1024] = { 0 }; + int wakup_count = 0; *status = SANE_STATUS_GOOD; if (device == NULL || scanner == NULL) { @@ -145,7 +149,7 @@ escl_newjob (capabilities_t *scanner, const ESCL_Device *device, SANE_Status *st DBG( 1, "Create NewJob : the name or the scan are invalid.\n"); return (NULL); } - upload = (struct uploading *)calloc(1, sizeof(struct uploading)); + upload = (struct downloading *)calloc(1, sizeof(struct downloading)); if (upload == NULL) { *status = SANE_STATUS_NO_MEM; DBG( 1, "Create NewJob : memory allocation failure\n"); @@ -158,7 +162,33 @@ escl_newjob (capabilities_t *scanner, const ESCL_Device *device, SANE_Status *st *status = SANE_STATUS_NO_MEM; return (NULL); } - curl_handle = curl_easy_init(); + if (scanner->caps[scanner->source].default_format) + free(scanner->caps[scanner->source].default_format); + scanner->caps[scanner->source].default_format = NULL; + int have_png = scanner->caps[scanner->source].have_png; + int have_jpeg = scanner->caps[scanner->source].have_jpeg; + int have_tiff = scanner->caps[scanner->source].have_tiff; + int have_pdf = scanner->caps[scanner->source].have_pdf; + + if ((scanner->source == PLATEN && have_pdf == -1) || + (scanner->source > PLATEN)) { + if (have_tiff != -1) { + scanner->caps[scanner->source].default_format = + strdup(scanner->caps[scanner->source].DocumentFormats[have_tiff]); + } + else if (have_png != -1) { + scanner->caps[scanner->source].default_format = + strdup(scanner->caps[scanner->source].DocumentFormats[have_png]); + } + else if (have_jpeg != -1) { + scanner->caps[scanner->source].default_format = + strdup(scanner->caps[scanner->source].DocumentFormats[have_jpeg]); + } + } + else { + scanner->caps[scanner->source].default_format = + strdup(scanner->caps[scanner->source].DocumentFormats[have_pdf]); + } if (scanner->caps[scanner->source].format_ext == 1) { char f_ext_tmp[1024]; @@ -179,29 +209,71 @@ escl_newjob (capabilities_t *scanner, const ESCL_Device *device, SANE_Status *st off_x = (scanner->caps[scanner->source].pos_x > scanner->caps[scanner->source].width) / 2; if (scanner->caps[scanner->source].pos_y > scanner->caps[scanner->source].height) off_y = (scanner->caps[scanner->source].pos_y > scanner->caps[scanner->source].height) / 2; + + char support_options[1024]; + memset(support_options, 0, 1024); + char *source = (scanner->source == PLATEN ? "Platen" : "Feeder"); + if (scanner->use_threshold) + { + char *tmp = add_support_option("ThresholdSupport", scanner->val_threshold); + if (support_options[0]) + strcat(support_options, tmp); + else + strcpy(support_options, tmp); + free(tmp); + } + if (scanner->use_sharpen) + { + char *tmp = add_support_option("SharpenSupport", scanner->val_sharpen); + if (support_options[0]) + strcat(support_options, tmp); + else + strcpy(support_options, tmp); + free(tmp); + } + if (scanner->use_contrast) + { + char *tmp = add_support_option("ContrastSupport", scanner->val_contrast); + if (support_options[0]) + strcat(support_options, tmp); + else + strcpy(support_options, tmp); + free(tmp); + } + if (scanner->use_brightness) + { + char *tmp = add_support_option("BrightnessSupport", scanner->val_brightness); + if (support_options[0]) + strcat(support_options, tmp); + else + strcpy(support_options, tmp); + free(tmp); + } + snprintf(cap_data, sizeof(cap_data), settings, + scanner->caps[scanner->source].height, + scanner->caps[scanner->source].width, + off_x, + off_y, + scanner->caps[scanner->source].default_format, + format_ext, + scanner->caps[scanner->source].default_color, + scanner->caps[scanner->source].default_resolution, + scanner->caps[scanner->source].default_resolution, + source, + source, + duplex_mode[0] == 0 ? " " : duplex_mode, + support_options[0] == 0 ? " " : support_options); + upload->memory = strdup(cap_data); + upload->size = strlen(cap_data); +wake_up_device: + DBG( 1, "Create NewJob : %s\n", cap_data); + download->memory = malloc(1); + download->size = 0; + curl_handle = curl_easy_init(); if (curl_handle != NULL) { - char *source = (scanner->source == PLATEN ? "Platen" : "Feeder"); - snprintf(cap_data, sizeof(cap_data), settings, - scanner->caps[scanner->source].height, - scanner->caps[scanner->source].width, - off_x, - off_y, - scanner->caps[scanner->source].default_format, - format_ext, - scanner->caps[scanner->source].default_color, - scanner->caps[scanner->source].default_resolution, - scanner->caps[scanner->source].default_resolution, - source, - source, - duplex_mode[0] == 0 ? "" : duplex_mode); - DBG( 1, "Create NewJob : %s\n", cap_data); - upload->read_data = strdup(cap_data); - upload->size = strlen(cap_data); - download->memory = malloc(1); - download->size = 0; escl_curl_url(curl_handle, device, scan_jobs); curl_easy_setopt(curl_handle, CURLOPT_POST, 1L); - curl_easy_setopt(curl_handle, CURLOPT_POSTFIELDS, upload->read_data); + curl_easy_setopt(curl_handle, CURLOPT_POSTFIELDS, (const char*)upload->memory); curl_easy_setopt(curl_handle, CURLOPT_POSTFIELDSIZE, upload->size); curl_easy_setopt(curl_handle, CURLOPT_HEADERFUNCTION, download_callback); curl_easy_setopt(curl_handle, CURLOPT_HEADERDATA, (void *)download); @@ -224,6 +296,7 @@ escl_newjob (capabilities_t *scanner, const ESCL_Device *device, SANE_Status *st result = strdup(location); DBG( 1, "Create NewJob : %s\n", result); *temporary = '\n'; + wakup_count = 0; } } if (result == NULL) { @@ -231,6 +304,7 @@ escl_newjob (capabilities_t *scanner, const ESCL_Device *device, SANE_Status *st *status = SANE_STATUS_INVAL; } free(download->memory); + download->memory = NULL; } else { DBG( 1, "Create NewJob : The creation of the failed job: %s\n", download->memory); @@ -238,8 +312,10 @@ escl_newjob (capabilities_t *scanner, const ESCL_Device *device, SANE_Status *st if (strstr(download->memory, "409 Conflict") != NULL) *status = SANE_STATUS_NO_DOCS; // If "503 Service Unavailable" appear, it means that device is busy (scanning in progress) - else if (strstr(download->memory, "503 Service Unavailable") != NULL) + else if (strstr(download->memory, "503 Service Unavailable") != NULL) { + wakup_count += 1; *status = SANE_STATUS_DEVICE_BUSY; + } else *status = SANE_STATUS_INVAL; } @@ -252,8 +328,18 @@ escl_newjob (capabilities_t *scanner, const ESCL_Device *device, SANE_Status *st } curl_easy_cleanup(curl_handle); } - if (upload != NULL) + if (wakup_count > 0 && wakup_count < 4) { + free(download->memory); + download->memory = NULL; + download->size = 0; + *status = SANE_STATUS_GOOD; + usleep(250); + goto wake_up_device; + } + if (upload != NULL) { + free(upload->memory); free(upload); + } if (download != NULL) free(download); return (result); diff --git a/backend/escl/escl_pdf.c b/backend/escl/escl_pdf.c index ae85a3a..02dce66 100644 --- a/backend/escl/escl_pdf.c +++ b/backend/escl/escl_pdf.c @@ -15,8 +15,8 @@ for more details. You should have received a copy of the GNU General Public License - along with sane; see the file COPYING. If not, write to the Free - Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + along with sane; see the file COPYING. + If not, see . This file implements a SANE backend for eSCL scanners. */ @@ -35,14 +35,14 @@ #include -#if(defined HAVE_POPPLER_GLIB) +#if HAVE_POPPLER_GLIB #include #endif #include -#if(defined HAVE_POPPLER_GLIB) +#if HAVE_POPPLER_GLIB #define INPUT_BUFFER_SIZE 4096 diff --git a/backend/escl/escl_png.c b/backend/escl/escl_png.c index cf92449..294ec00 100644 --- a/backend/escl/escl_png.c +++ b/backend/escl/escl_png.c @@ -16,8 +16,8 @@ for more details. You should have received a copy of the GNU General Public License - along with sane; see the file COPYING. If not, write to the Free - Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + along with sane; see the file COPYING. + If not, see . This file implements a SANE backend for eSCL scanners. */ @@ -87,7 +87,7 @@ get_PNG_data(capabilities_t *scanner, int *width, int *height, int *bps) goto close_file; } // initialize the setjmp for returning properly after a libpng - // error occured + // error occurred if (setjmp (png_jmpbuf (png_ptr))) { png_destroy_read_struct (&png_ptr, &info_ptr, NULL); @@ -107,7 +107,7 @@ get_PNG_data(capabilities_t *scanner, int *width, int *height, int *bps) png_read_info (png_ptr, info_ptr); int bit_depth, color_type; - // get some usefull information from header + // get some useful information from header bit_depth = png_get_bit_depth (png_ptr, info_ptr); color_type = png_get_color_type (png_ptr, info_ptr); // convert index color images to RGB images diff --git a/backend/escl/escl_reset.c b/backend/escl/escl_reset.c index 64d779a..7494dda 100644 --- a/backend/escl/escl_reset.c +++ b/backend/escl/escl_reset.c @@ -16,8 +16,8 @@ for more details. You should have received a copy of the GNU General Public License - along with sane; see the file COPYING. If not, write to the Free - Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + along with sane; see the file COPYING. + If not, see . This file implements a SANE backend for eSCL scanners. */ @@ -29,8 +29,6 @@ #include #include -#include - static size_t write_callback(void __sane_unused__*str, size_t __sane_unused__ size, diff --git a/backend/escl/escl_scan.c b/backend/escl/escl_scan.c index 9fce801..53bd438 100644 --- a/backend/escl/escl_scan.c +++ b/backend/escl/escl_scan.c @@ -16,8 +16,8 @@ for more details. You should have received a copy of the GNU General Public License - along with sane; see the file COPYING. If not, write to the Free - Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + along with sane; see the file COPYING. + If not, see . This file implements a SANE backend for eSCL scanners. */ @@ -30,15 +30,13 @@ #include #include -#include - #include "../include/sane/sanei.h" /** * \fn static size_t write_callback(void *str, size_t size, size_t nmemb, void *userp) * \brief Callback function that writes the image scanned into the temporary file. * - * \return to_write (the result of the fwrite fonction) + * \return to_write (the result of the fwrite function) */ static size_t write_callback(void *str, size_t size, size_t nmemb, void *userp) diff --git a/backend/escl/escl_status.c b/backend/escl/escl_status.c index 7b98566..a68f6ea 100644 --- a/backend/escl/escl_status.c +++ b/backend/escl/escl_status.c @@ -16,8 +16,8 @@ for more details. You should have received a copy of the GNU General Public License - along with sane; see the file COPYING. If not, write to the Free - Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + along with sane; see the file COPYING. + If not, see . This file implements a SANE backend for eSCL scanners. */ @@ -30,7 +30,6 @@ #include #include -#include #include struct idle diff --git a/backend/escl/escl_tiff.c b/backend/escl/escl_tiff.c index 98bc5f3..e33498c 100644 --- a/backend/escl/escl_tiff.c +++ b/backend/escl/escl_tiff.c @@ -16,8 +16,8 @@ for more details. You should have received a copy of the GNU General Public License - along with sane; see the file COPYING. If not, write to the Free - Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + along with sane; see the file COPYING. + If not, see . This file implements a SANE backend for eSCL scanners. */ diff --git a/backend/fujitsu-scsi.h b/backend/fujitsu-scsi.h index c2b28dd..3d3cf07 100644 --- a/backend/fujitsu-scsi.h +++ b/backend/fujitsu-scsi.h @@ -931,7 +931,7 @@ putnbyte (unsigned char *pnt, unsigned int value, unsigned int nbytes) * 3091 0x00 = use floating slice; 0x01..0xff fixed slice * with 0x01=brightest, 0x80=medium, 0xff=darkest; * only effective for line art mode. - * 3096 0x00 = use "simplified dynamic treshold", otherwise + * 3096 0x00 = use "simplified dynamic threshold", otherwise * same as above but resolution is only 64 steps. */ #define set_WD_threshold(sb, val) sb[0x17] = val diff --git a/backend/fujitsu.c b/backend/fujitsu.c index d24975e..6c1c8f6 100644 --- a/backend/fujitsu.c +++ b/backend/fujitsu.c @@ -30,9 +30,7 @@ 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. + along with this program. If not, see . As a special exception, the authors of SANE give permission for additional uses of the libraries contained in this release of SANE. @@ -172,11 +170,11 @@ - use sanei_scsi_open_extended() to set buffer size - fix some compiler warns: 32&64 bit gcc v26 2006-05-23, MAN - - dont send scanner control (F1) if unsupported + - don't send scanner control (F1) if unsupported v27 2006-05-30, MAN - speed up hexdump (adeuring A T gmx D O T net) - duplex request same size block from both sides - - dont #include or call sanei_thread + - don't #include or call sanei_thread - split usb/scsi command DBG into 25 and 30 v28 2006-06-01, MAN - sane_read() usleep if scanner is busy @@ -201,10 +199,10 @@ - add error msg if VPD missing or non-extended - remove references to color_lineart and ht units - rework init_model to support more known models - - dont send paper size data if using flatbed + - don't send paper size data if using flatbed v31 2006-06-13, MAN - add 5220C usb id - - dont show ink level buttons if no imprinter + - don't show ink level buttons if no imprinter - run ghs/rs every second instead of every other v32 2006-06-14, MAN - add 4220C2 usb id @@ -299,7 +297,7 @@ - proper async sane_cancel support - re-enable JPEG support - replace s->img_count with s->side - - sane_get_parameters(): dont round up larger than current paper size + - sane_get_parameters(): don't round up larger than current paper size - sane_start() rewritten, shorter, more clear - return values are SANE_Status, not int - hide unused functions @@ -386,7 +384,7 @@ - set SANE_CAP_INACTIVE on all disabled options - fix bug in mode_select page for sleep timer v78 2008-08-26, MAN - - recent model names (fi-6xxx) dont end in 'C' + - recent model names (fi-6xxx) don't end in 'C' - simplify flatbed area overrides - call scanner_control to change source during sane_start v79 2008-10-01, MAN @@ -423,7 +421,7 @@ - track frontend reading sensor/button values to reload - deactivate double feed options if df-action == default v88 2009-01-21, MAN - - dont export private symbols + - don't export private symbols v89 2009-02-20, MAN - fi-4750 returns random garbage to serial number queries v90 2009-02-23, MAN @@ -482,7 +480,7 @@ - cache software crop/deskew parameters for use on backside of duplex - fi-6110 does not support bgcolor or prepick v106 2011-01-30, MAN (SANE 1.0.22) - - dont call mode_select with a page code the scanner does not support + - don't call mode_select with a page code the scanner does not support v107 2011-11-03, MAN - M3091 does not support scanner_control(adf) - Correct buffer overflow in read_from_3091duplex() @@ -609,6 +607,10 @@ - add support for fi-800R - add support for card scanning slot (Return Path) - fix bug with reading hardware sensors on first invocation + v137 2020-09-23, MAN + - fix JPEG duplex memory corruption + - change window_gamma init (fixes bright/contrast for iX1500) + - only call send_lut after set_window (remove late_lut) SANE FLOW DIAGRAM @@ -658,7 +660,7 @@ #include "fujitsu.h" #define DEBUG 1 -#define BUILD 136 +#define BUILD 137 /* values for SANE_DEBUG_FUJITSU env var: - errors 5 @@ -1217,7 +1219,7 @@ init_inquire (struct fujitsu *s) s->color_raster_offset = get_IN_color_offset(in); DBG (15, " color offset: %d lines\n",s->color_raster_offset); - /* FIXME: we dont store all of these? */ + /* FIXME: we don't store all of these? */ DBG (15, " long gray scan: %d\n",get_IN_long_gray(in)); DBG (15, " long color scan: %d\n",get_IN_long_color(in)); @@ -1701,7 +1703,7 @@ init_vpd (struct fujitsu *s) s->has_comp_JPG3 = get_IN_compression_JPG_INDEP (in); DBG (15, " compression JPG3: %d\n", s->has_comp_JPG3); - /* FIXME: we dont store these? */ + /* FIXME: we don't store these? */ DBG (15, " back endorser mech: %d\n", get_IN_endorser_b_mech(in)); DBG (15, " back endorser stamp: %d\n", get_IN_endorser_b_stamp(in)); DBG (15, " back endorser elec: %d\n", get_IN_endorser_b_elec(in)); @@ -2105,11 +2107,9 @@ init_model (struct fujitsu *s) s->ppl_mod_by_mode[MODE_GRAYSCALE] = 1; s->ppl_mod_by_mode[MODE_COLOR] = 1; - /* if scanner has built-in gamma tables, we use the first one (0) */ - /* otherwise, we use the first downloaded one (0x80) */ - /* note that you may NOT need to send the table to use it, */ - /* the scanner will fall back to the brightness/contrast LUT */ - if (!s->num_internal_gamma && s->num_download_gamma){ + /* we prefer to use the downloaded (LUT) gamma table (0x80) if possible. + * but if scanner has only built-in gamma tables, we use the first one (0) */ + if (s->num_download_gamma){ s->window_gamma = 0x80; } @@ -2365,7 +2365,6 @@ init_model (struct fujitsu *s) /* weirdness */ s->need_q_table = 1; - s->late_lut = 1; s->need_diag_preread = 1; s->ppl_mod_by_mode[MODE_COLOR] = 2; s->hopper_before_op = 1; @@ -2378,7 +2377,7 @@ init_model (struct fujitsu *s) s->can_mode[MODE_LINEART] = 2; s->can_mode[MODE_GRAYSCALE] = 2; - /* dont bother with this one */ + /* don't bother with this one */ s->can_mode[MODE_HALFTONE] = 0; } @@ -2389,7 +2388,6 @@ init_model (struct fujitsu *s) /* weirdness */ s->need_q_table = 1; - s->late_lut = 1; s->need_diag_preread = 1; s->ppl_mod_by_mode[MODE_COLOR] = 2; s->hopper_before_op = 1; @@ -2398,7 +2396,7 @@ init_model (struct fujitsu *s) /* lies */ s->adbits = 8; - /* dont bother with this one */ + /* don't bother with this one */ s->can_mode[MODE_HALFTONE] = 0; } @@ -4202,7 +4200,7 @@ sane_get_option_descriptor (SANE_Handle handle, SANE_Int option) opt->unit = SANE_UNIT_NONE; opt->size = sizeof(SANE_Word); - /*old type cant do this?*/ + /*old type can't do this?*/ if ((s->has_endorser_f && s->endorser_type_f != ET_OLD) || (s->has_endorser_b && s->endorser_type_b != ET_OLD)){ opt->cap=SANE_CAP_SOFT_SELECT | SANE_CAP_SOFT_DETECT | SANE_CAP_ADVANCED; @@ -5336,7 +5334,7 @@ sane_control_option (SANE_Handle handle, SANE_Int option, DBG (20, "sane_control_option: set value for '%s' (%d)\n", s->opt[option].name,option); if ( s->started ) { - DBG (5, "sane_control_option: cant set, device busy\n"); + DBG (5, "sane_control_option: can't set, device busy\n"); return SANE_STATUS_DEVICE_BUSY; } @@ -5351,7 +5349,7 @@ sane_control_option (SANE_Handle handle, SANE_Int option, return status; } - /* may have been changed by constrain, so dont copy until now */ + /* may have been changed by constrain, so don't copy until now */ val_c = *(SANE_Word *)val; /* @@ -6429,7 +6427,7 @@ diag_preread (struct fujitsu *s) set_SD_preread_yres(out,s->resolution_y); /* call helper function, scanner wants lies about paper width */ set_SD_preread_paper_width(out, get_page_width(s)); - /* dont call helper function, scanner wants actual length? */ + /* don't call helper function, scanner wants actual length? */ set_SD_preread_paper_length(out, s->page_height); set_SD_preread_composition(out, s->s_mode); @@ -6789,7 +6787,7 @@ sane_get_parameters (SANE_Handle handle, SANE_Parameters * params) params->pixels_per_line = s->u_params.pixels_per_line; params->bytes_per_line = s->u_params.bytes_per_line; - /* we wont know the end until we get to it */ + /* we won't know the end until we get to it */ if(s->ald && !must_fully_buffer(s)){ DBG (15, "sane_get_parameters: hand-scanner mode\n"); params->lines = -1; @@ -6941,7 +6939,7 @@ update_u_params (struct fujitsu * s) * * this will be called between sides of a duplex scan, * and at the start of each page of an adf batch. - * hence, we spend alot of time playing with s->started, etc. + * hence, we spend a lot of time playing with s->started, etc. */ SANE_Status sane_start (SANE_Handle handle) @@ -7050,14 +7048,6 @@ sane_start (SANE_Handle handle) if (ret != SANE_STATUS_GOOD) DBG (5, "sane_start: WARNING: cannot send_endorser %d\n", ret); - /* 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)){ - ret = send_lut(s); - 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) { @@ -7067,7 +7057,7 @@ sane_start (SANE_Handle handle) /* 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)){ + if (!s->brightness_steps || !s->contrast_steps || s->window_gamma & 0x80){ ret = send_lut(s); if (ret != SANE_STATUS_GOOD) DBG (5, "sane_start: WARNING: cannot late send_lut %d\n", ret); @@ -7110,10 +7100,10 @@ sane_start (SANE_Handle handle) } /* set clean defaults with new sheet of paper */ - /* dont reset the transfer vars on backside of duplex page */ + /* don't reset the transfer vars on backside of duplex page */ /* otherwise buffered back page will be lost */ /* ingest paper with adf (no-op for fb) */ - /* dont call object pos or scan on back side of duplex scan */ + /* don't call object pos or scan on back side of duplex scan */ if(s->side == SIDE_FRONT || s->source == SOURCE_ADF_BACK || s->source == SOURCE_CARD_BACK){ s->bytes_rx[0]=0; @@ -7187,7 +7177,7 @@ sane_start (SANE_Handle handle) s->buff_tot[SIDE_BACK] = s->bytes_tot[SIDE_BACK]; /* the back buffer is normally very large, but some scanners or - * option combinations dont need it, so we make a small one */ + * option combinations don't need it, so we make a small one */ if(s->low_mem || s->source == SOURCE_ADF_BACK || s->source == SOURCE_CARD_BACK || s->duplex_interlace == DUPLEX_INTERLACE_NONE) s->buff_tot[SIDE_BACK] = s->buffer_size; @@ -7739,7 +7729,7 @@ set_window (struct fujitsu *s) /* call helper function, scanner wants lies about paper width */ set_WD_paper_width_X (desc1, get_page_width(s)); - /* dont call helper function, scanner wants actual length? */ + /* don't call helper function, scanner wants actual length? */ set_WD_paper_length_Y (desc1, s->page_height); } @@ -7974,7 +7964,7 @@ start_scan (struct fujitsu *s) /* checks started and cancelled flags in scanner struct, * sends cancel command to scanner if required. don't call - * this function asyncronously, wait for pending operation */ + * this function asynchronously, wait for pending operation */ static SANE_Status check_for_cancel(struct fujitsu *s) { @@ -8166,7 +8156,7 @@ sane_read (SANE_Handle handle, SANE_Byte * buf, SANE_Int max_len, SANE_Int * len return ret; } -/* bare jpeg images dont contain resolution, but JFIF APP0 does, so we add */ +/* bare jpeg images don't contain resolution, but JFIF APP0 does, so we add */ static SANE_Status inject_jfif_header(struct fujitsu *s, int side) { @@ -8220,21 +8210,21 @@ read_from_JPEGduplex(struct fujitsu *s) int avail = s->buff_tot[SIDE_FRONT] - s->buff_rx[SIDE_FRONT]; if(bytes > avail){ bytes = avail; - /* leave space for JFIF header at start of image */ - if(s->bytes_rx[SIDE_FRONT] < 2) - bytes -= JFIF_APP0_LENGTH; } } if(!s->eof_rx[SIDE_BACK]){ int avail = s->buff_tot[SIDE_BACK] - s->buff_rx[SIDE_BACK]; if(bytes > avail){ bytes = avail; - /* leave space for JFIF header at start of image */ - if(s->bytes_rx[SIDE_BACK] < 2) - bytes -= JFIF_APP0_LENGTH; } } + /* leave space for JFIF header in the small front side buffer, + * if we are at the beginning of the image */ + if(s->bytes_rx[SIDE_FRONT] < 3){ + 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], @@ -8378,7 +8368,7 @@ read_from_JPEGduplex(struct fujitsu *s) } /* unknown, warn */ - else if(in[i] != 0xff){ + else if(in[i] != 0x00){ DBG(15, "read_from_JPEGduplex: unknown %02x\n", in[i]); } } @@ -8415,7 +8405,7 @@ read_from_JPEGduplex(struct fujitsu *s) s->bytes_rx[SIDE_FRONT]++; } - /* image is interlaced afterall, continue */ + /* image is interlaced after all, continue */ else{ DBG(15, "read_from_JPEGduplex: wrong width, req:%d got:%d\n", s->s_params.pixels_per_line,width); @@ -8484,7 +8474,7 @@ read_from_JPEGduplex(struct fujitsu *s) free(in); - /* jpeg uses in-band EOI marker, so this is ususally redundant */ + /* jpeg uses in-band EOI marker, so this is usually redundant */ if(ret == SANE_STATUS_EOF){ DBG(15, "read_from_JPEGduplex: got EOF, finishing\n"); s->eof_rx[SIDE_FRONT] = 1; @@ -9157,7 +9147,7 @@ downsample_from_buffer(struct fujitsu *s, SANE_Byte * buf, * handle h is a valid handle) but usually affects long-running * operations only (such as image is acquisition). It is safe to call * this function asynchronously (e.g., from within a signal handler). - * It is important to note that completion of this operaton does not + * It is important to note that completion of this operation does not * imply that the currently pending operation has been cancelled. It * only guarantees that cancellation has been initiated. Cancellation * completes only when the cancelled call returns (typically with a @@ -9963,7 +9953,7 @@ get_page_width(struct fujitsu *s) return s->page_width; } - /* cant overscan larger than scanner max */ + /* can't overscan larger than scanner max */ if(width > s->max_x){ return s->max_x; } @@ -9992,7 +9982,7 @@ get_page_height(struct fujitsu *s) return s->page_height; } - /* cant overscan larger than scanner max */ + /* can't overscan larger than scanner max */ if(height > s->max_y){ return s->max_y; } diff --git a/backend/fujitsu.h b/backend/fujitsu.h index 3b3ce54..98278eb 100644 --- a/backend/fujitsu.h +++ b/backend/fujitsu.h @@ -323,7 +323,7 @@ struct fujitsu int color_interlace; /* different models interlace colors differently */ int duplex_interlace; /* different models interlace sides differently */ int jpeg_interlace; /* different models interlace jpeg sides differently */ - int cropping_mode; /* lower-end scanners dont crop from paper size */ + int cropping_mode; /* lower-end scanners don't crop from paper size */ int ghs_in_rs; int window_gamma; int endorser_string_len; @@ -331,11 +331,10 @@ struct fujitsu int has_short_pixelsize; /* m3091/2 put weird stuff at end, ignore it */ int broken_diag_serial; /* some scanners are just plain borked */ - int need_q_table; /* some scanners wont work without these */ + int need_q_table; /* some scanners won't work without these */ 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 */ + int hopper_before_op; /* some scanners don't like OP when hopper empty */ + int no_wait_after_op; /* some scanners don't like TUR after OP */ int has_vuid_mono; /* mono set window data */ int has_vuid_3091; /* 3091/2 set window data */ @@ -567,7 +566,7 @@ struct fujitsu int req_driv_lut; /* --------------------------------------------------------------------- */ - /* values used by the software enhancment code (deskew, crop, etc) */ + /* values used by the software enhancement code (deskew, crop, etc) */ SANE_Status deskew_stat; int deskew_vals[2]; double deskew_slope; diff --git a/backend/genesys.conf.in b/backend/genesys.conf.in index 8268da3..21506f6 100644 --- a/backend/genesys.conf.in +++ b/backend/genesys.conf.in @@ -43,7 +43,8 @@ usb 0x04a9 0x2214 usb 0x04a9 0x1900 # Canon 4400F -usb 0x04a9 0x2228 +# Disabled to prevent possible physical damage due to overheating (#436) +#usb 0x04a9 0x2228 # Canon LiDE 100 usb 0x04a9 0x1904 diff --git a/backend/genesys/calibration.h b/backend/genesys/calibration.h index 81d94ea..fc82850 100644 --- a/backend/genesys/calibration.h +++ b/backend/genesys/calibration.h @@ -15,9 +15,7 @@ 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. + along with this program. If not, see . As a special exception, the authors of SANE give permission for additional uses of the libraries contained in this release of SANE. diff --git a/backend/genesys/command_set.h b/backend/genesys/command_set.h index 056cba8..47bdfbd 100644 --- a/backend/genesys/command_set.h +++ b/backend/genesys/command_set.h @@ -15,9 +15,7 @@ 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. + along with this program. If not, see . As a special exception, the authors of SANE give permission for additional uses of the libraries contained in this release of SANE. diff --git a/backend/genesys/command_set_common.cpp b/backend/genesys/command_set_common.cpp index 381404e..7afc3ff 100644 --- a/backend/genesys/command_set_common.cpp +++ b/backend/genesys/command_set_common.cpp @@ -15,9 +15,7 @@ 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. + along with this program. If not, see . */ #define DEBUG_DECLARE_ONLY diff --git a/backend/genesys/command_set_common.h b/backend/genesys/command_set_common.h index 784fcd7..3b6de86 100644 --- a/backend/genesys/command_set_common.h +++ b/backend/genesys/command_set_common.h @@ -15,9 +15,7 @@ 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. + along with this program. If not, see . */ #ifndef BACKEND_GENESYS_COMMAND_SET_COMMON_H diff --git a/backend/genesys/device.cpp b/backend/genesys/device.cpp index 95bede8..4b1940b 100644 --- a/backend/genesys/device.cpp +++ b/backend/genesys/device.cpp @@ -15,9 +15,7 @@ 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. + along with this program. If not, see . As a special exception, the authors of SANE give permission for additional uses of the libraries contained in this release of SANE. diff --git a/backend/genesys/device.h b/backend/genesys/device.h index ded6a48..f998714 100644 --- a/backend/genesys/device.h +++ b/backend/genesys/device.h @@ -15,9 +15,7 @@ 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. + along with this program. If not, see . As a special exception, the authors of SANE give permission for additional uses of the libraries contained in this release of SANE. @@ -311,7 +309,7 @@ struct Genesys_Device bool already_initialized = false; bool read_active = false; - // signal wether the park command has been issued + // signal whether the park command has been issued bool parking = false; // for sheetfed scanner's, is TRUE when there is a document in the scanner diff --git a/backend/genesys/enums.cpp b/backend/genesys/enums.cpp index cd4be7d..ce0ad10 100644 --- a/backend/genesys/enums.cpp +++ b/backend/genesys/enums.cpp @@ -15,9 +15,7 @@ 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. + along with this program. If not, see . As a special exception, the authors of SANE give permission for additional uses of the libraries contained in this release of SANE. diff --git a/backend/genesys/enums.h b/backend/genesys/enums.h index 0e16ba4..ae5dedd 100644 --- a/backend/genesys/enums.h +++ b/backend/genesys/enums.h @@ -15,9 +15,7 @@ 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. + along with this program. If not, see . As a special exception, the authors of SANE give permission for additional uses of the libraries contained in this release of SANE. diff --git a/backend/genesys/error.cpp b/backend/genesys/error.cpp index 46d79c9..e302e22 100644 --- a/backend/genesys/error.cpp +++ b/backend/genesys/error.cpp @@ -15,9 +15,7 @@ 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. + along with this program. If not, see . As a special exception, the authors of SANE give permission for additional uses of the libraries contained in this release of SANE. diff --git a/backend/genesys/error.h b/backend/genesys/error.h index 26235dd..e95313f 100644 --- a/backend/genesys/error.h +++ b/backend/genesys/error.h @@ -15,9 +15,7 @@ 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. + along with this program. If not, see . As a special exception, the authors of SANE give permission for additional uses of the libraries contained in this release of SANE. diff --git a/backend/genesys/fwd.h b/backend/genesys/fwd.h index ea335f7..89ca150 100644 --- a/backend/genesys/fwd.h +++ b/backend/genesys/fwd.h @@ -15,9 +15,7 @@ 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. + along with this program. If not, see . As a special exception, the authors of SANE give permission for additional uses of the libraries contained in this release of SANE. diff --git a/backend/genesys/genesys.cpp b/backend/genesys/genesys.cpp index 9d80cfa..9552fa9 100644 --- a/backend/genesys/genesys.cpp +++ b/backend/genesys/genesys.cpp @@ -28,9 +28,7 @@ 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. + along with this program. If not, see . As a special exception, the authors of SANE give permission for additional uses of the libraries contained in this release of SANE. @@ -389,7 +387,7 @@ void sanei_genesys_create_default_gamma_table(Genesys_Device* dev, TODO: Should also consider maximum transfer rate: ~6.5MB/s. Note: The enhance option of the scanners does _not_ help. It only halves - the amount of pixels transfered. + the amount of pixels transferred. */ SANE_Int sanei_genesys_exposure_time2(Genesys_Device * dev, const MotorProfile& profile, float ydpi, int endpixel, int exposure_by_led) @@ -3204,7 +3202,7 @@ compute_shifted_coefficients (Genesys_Device * dev, unsigned int coeff, unsigned int target_dark, unsigned int target_bright, - unsigned int patch_size) /* contigous extent */ + unsigned int patch_size) /* contiguous extent */ { unsigned int x, avgpixels, basepixels, i, j, val1, val2; unsigned int br_tmp [3], dk_tmp [3]; @@ -3573,7 +3571,7 @@ static void genesys_send_shading_coefficient(Genesys_Device* dev, const Genesys_ coeff, 0x0001, /* target_dark */ 0xf900, /* target_bright */ - 256); /* patch_size: contigous extent */ + 256); /* patch_size: contiguous extent */ break; default: throw SaneException(SANE_STATUS_UNSUPPORTED, "sensor %d not supported", @@ -3598,7 +3596,7 @@ genesys_restore_calibration(Genesys_Device * dev, Genesys_Sensor& sensor) { DBG_HELPER(dbg); - // if no cache or no function to evaluate cache entry ther can be no match/ + // if no cache or no function to evaluate cache entry there can be no match/ if (dev->calibration_cache.empty()) { return false; } @@ -4061,7 +4059,7 @@ static void genesys_start_scan(Genesys_Device* dev, bool lamp_off) unsigned int steps, expected; - /* since not all scanners are set ot wait for head to park + /* since not all scanners are set to wait for head to park * we check we are not still parking before starting a new scan */ if (dev->parking) { sanei_genesys_wait_for_home(dev); @@ -4166,7 +4164,7 @@ static void genesys_start_scan(Genesys_Device* dev, bool lamp_off) return; } - /*do we really need this? the valid data check should be sufficent -- pierre*/ + /*do we really need this? the valid data check should be sufficient -- pierre*/ /* waits for head to reach scanning position */ expected = dev->reg.get8(0x3d) * 65536 + dev->reg.get8(0x3e) * 256 @@ -4214,7 +4212,7 @@ static void genesys_read_ordered_data(Genesys_Device* dev, SANE_Byte* destinatio /* is there data left to scan */ if (dev->total_bytes_read >= dev->total_bytes_to_read) { - /* issue park command immediatly in case scanner can handle it + /* issue park command immediately in case scanner can handle it * so we save time */ if (!dev->model->is_sheetfed && !has_flag(dev->model->flags, ModelFlag::MUST_WAIT) && !dev->parking) @@ -4374,7 +4372,7 @@ static Genesys_Settings calculate_scan_settings(Genesys_Scanner* s) settings.true_gray = 0; } - // brigthness and contrast only for for 8 bit scans + // brightness and contrast only for for 8 bit scans if (s->bit_depth == 8) { settings.contrast = (s->contrast * 127) / 100; settings.brightness = (s->brightness * 127) / 100; @@ -4479,7 +4477,7 @@ static SANE_Range create_range(float size) /** @brief generate calibration cache file nam * Generates the calibration cache file name to use. - * Tries to store the chache in $HOME/.sane or + * Tries to store the cache in $HOME/.sane or * then fallbacks to $TMPDIR or TMP. The filename * uses the model name if only one scanner is plugged * else is uses the device name when several identical @@ -4864,7 +4862,7 @@ static void init_options(Genesys_Scanner* s) s->opt[OPT_CALIBRATION_FILE].cap = SANE_CAP_SOFT_DETECT | SANE_CAP_SOFT_SELECT | SANE_CAP_ADVANCED; s->opt[OPT_CALIBRATION_FILE].constraint_type = SANE_CONSTRAINT_NONE; s->calibration_file.clear(); - /* disable option if ran as root */ + /* disable option if run as root */ #ifdef HAVE_GETUID if(geteuid()==0) { @@ -5186,7 +5184,8 @@ static SANE_Status attach_one_device(SANE_String_Const devname) noexcept // this function is passed to C API, it must not throw static SANE_Status -config_attach_genesys(SANEI_Config __sane_unused__ *config, const char *devname) noexcept +config_attach_genesys(SANEI_Config __sane_unused__ *config, const char *devname, + void __sane_unused__ *data) noexcept { /* the devname has been processed and is ready to be used * directly. Since the backend is an USB only one, we can @@ -5214,7 +5213,8 @@ static void probe_genesys_devices() config.values = nullptr; config.count = 0; - auto status = sanei_configure_attach(GENESYS_CONFIG_FILE, &config, config_attach_genesys); + auto status = sanei_configure_attach(GENESYS_CONFIG_FILE, &config, + config_attach_genesys, NULL); if (status == SANE_STATUS_ACCESS_DENIED) { dbg.vlog(DBG_error0, "Critical error: Couldn't access configuration file '%s'", GENESYS_CONFIG_FILE); @@ -5346,7 +5346,7 @@ void sane_init_impl(SANE_Int * version_code, SANE_Auth_Callback authorize) #endif ); - // cold-plug case :detection of allready connected scanners + // cold-plug case :detection of already connected scanners s_attach_device_by_name_evaluate_bcd_device = false; probe_genesys_devices(); } @@ -6333,7 +6333,7 @@ SANE_Status sane_read_impl(SANE_Handle handle, SANE_Byte * buf, SANE_Int max_len { DBG(DBG_proc, "%s: nothing more to scan: EOF\n", __func__); - /* issue park command immediatly in case scanner can handle it + /* issue park command immediately in case scanner can handle it * so we save time */ if (!dev->model->is_sheetfed && !has_flag(dev->model->flags, ModelFlag::MUST_WAIT) && !dev->parking) diff --git a/backend/genesys/genesys.h b/backend/genesys/genesys.h index 9b1a087..19d6feb 100644 --- a/backend/genesys/genesys.h +++ b/backend/genesys/genesys.h @@ -18,9 +18,7 @@ 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. + along with this program. If not, see . As a special exception, the authors of SANE give permission for additional uses of the libraries contained in this release of SANE. diff --git a/backend/genesys/gl124.cpp b/backend/genesys/gl124.cpp index d3fc1bc..ed733b8 100644 --- a/backend/genesys/gl124.cpp +++ b/backend/genesys/gl124.cpp @@ -16,9 +16,7 @@ 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. + along with this program. If not, see . As a special exception, the authors of SANE give permission for additional uses of the libraries contained in this release of SANE. @@ -567,7 +565,7 @@ static void gl124_init_motor_regs_scan(Genesys_Device* dev, reg->set16(REG_FSHDEC, fast_table.table.size()); reg->set16(REG_FMOVNO, fast_table.table.size()); - /* substract acceleration distance from feedl */ + /* subtract acceleration distance from feedl */ feedl=feed_steps; feedl <<= static_cast(motor_profile.step_type); @@ -1058,7 +1056,7 @@ void CommandSetGl124::send_shading_data(Genesys_Device* dev, const Genesys_Senso for(i=0;i<3;i++) { /* copy data to work buffer and process it */ - /* coefficent destination */ + /* coefficient destination */ ptr = buffer.data(); /* iterate on both sensor segment */ diff --git a/backend/genesys/gl124.h b/backend/genesys/gl124.h index ea7041e..b722e67 100644 --- a/backend/genesys/gl124.h +++ b/backend/genesys/gl124.h @@ -15,9 +15,7 @@ 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. + along with this program. If not, see . As a special exception, the authors of SANE give permission for additional uses of the libraries contained in this release of SANE. diff --git a/backend/genesys/gl124_registers.h b/backend/genesys/gl124_registers.h index 9b42084..66c5fda 100644 --- a/backend/genesys/gl124_registers.h +++ b/backend/genesys/gl124_registers.h @@ -15,9 +15,7 @@ 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. + along with this program. If not, see . As a special exception, the authors of SANE give permission for additional uses of the libraries contained in this release of SANE. diff --git a/backend/genesys/gl646.cpp b/backend/genesys/gl646.cpp index 61fa1e0..acc1a4b 100644 --- a/backend/genesys/gl646.cpp +++ b/backend/genesys/gl646.cpp @@ -22,9 +22,7 @@ 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. + along with this program. If not, see . As a special exception, the authors of SANE give permission for additional uses of the libraries contained in this release of SANE. @@ -98,7 +96,7 @@ struct Motor_Master /** * master motor settings, for a given motor and dpi, - * it gives steps and speed informations + * it gives steps and speed information */ static Motor_Master motor_master[] = { /* HP3670 motor settings */ @@ -1040,7 +1038,7 @@ gl646_init_regs (Genesys_Device * dev) dev->reg.find_reg(0x6d).value = 0x01; /* select deceleration steps whenever go home (0), accel/decel stop time (31 * LPeriod) */ break; } - dev->reg.find_reg(0x6c).value = 0x00; /* peroid times for LPeriod, expR,expG,expB, Z1MODE, Z2MODE (one period time) */ + dev->reg.find_reg(0x6c).value = 0x00; /* period times for LPeriod, expR,expG,expB, Z1MODE, Z2MODE (one period time) */ } // Set values of Analog Device type frontend @@ -1480,7 +1478,7 @@ void CommandSetGl646::detect_document_end(Genesys_Device* dev) const * eject document from the feeder * currently only used by XP200 * TODO we currently rely on AGOHOME not being set for sheetfed scanners, - * maybe check this flag in eject to let the document being eject automaticaly + * maybe check this flag in eject to let the document being eject automatically */ void CommandSetGl646::eject_document(Genesys_Device* dev) const { @@ -1491,7 +1489,7 @@ void CommandSetGl646::eject_document(Genesys_Device* dev) const unsigned count; std::uint8_t gpio; - /* at the end there will be noe more document */ + /* at the end there will be no more document */ dev->document = false; // first check for document event @@ -2512,7 +2510,7 @@ void CommandSetGl646::init_regs_for_warmup(Genesys_Device* dev, const Genesys_Se /* * * initialize ASIC : registers, motor tables, and gamma tables * then ensure scanner's head is at home - * @param dev device description of the scanner to initailize + * @param dev device description of the scanner to initialize */ void CommandSetGl646::init(Genesys_Device* dev) const { @@ -2739,7 +2737,7 @@ static void simple_scan(Genesys_Device* dev, const Genesys_Sensor& sensor, /** * update the status of the required sensor in the scanner session - * the button fileds are used to make events 'sticky' + * the button fields are used to make events 'sticky' */ void CommandSetGl646::update_hardware_sensors(Genesys_Scanner* session) const { diff --git a/backend/genesys/gl646.h b/backend/genesys/gl646.h index 8ab2c96..e4c8d6b 100644 --- a/backend/genesys/gl646.h +++ b/backend/genesys/gl646.h @@ -18,9 +18,7 @@ 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. + along with this program. If not, see . As a special exception, the authors of SANE give permission for additional uses of the libraries contained in this release of SANE. diff --git a/backend/genesys/gl646_registers.h b/backend/genesys/gl646_registers.h index 6ee9549..1c50888 100644 --- a/backend/genesys/gl646_registers.h +++ b/backend/genesys/gl646_registers.h @@ -15,9 +15,7 @@ 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. + along with this program. If not, see . As a special exception, the authors of SANE give permission for additional uses of the libraries contained in this release of SANE. diff --git a/backend/genesys/gl841.cpp b/backend/genesys/gl841.cpp index 731354f..62e0e9d 100644 --- a/backend/genesys/gl841.cpp +++ b/backend/genesys/gl841.cpp @@ -24,9 +24,7 @@ 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. + along with this program. If not, see . As a special exception, the authors of SANE give permission for additional uses of the libraries contained in this release of SANE. @@ -999,7 +997,7 @@ void CommandSetGl841::init_regs_for_scan_session(Genesys_Device* dev, const Gene int dummy = 0; /* dummy */ - /* dummy lines: may not be usefull, for instance 250 dpi works with 0 or 1 + /* dummy lines: may not be useful, for instance 250 dpi works with 0 or 1 dummy line. Maybe the dummy line adds correctness since the motor runs slower (higher dpi) */ @@ -2256,7 +2254,7 @@ void CommandSetGl841::send_shading_data(Genesys_Device* dev, const Genesys_Senso for(i=0;i<3;i++) { /* copy data to work buffer and process it */ - /* coefficent destination */ + /* coefficient destination */ ptr=buffer.data(); /* iterate on both sensor segment, data has been averaged, diff --git a/backend/genesys/gl841.h b/backend/genesys/gl841.h index c9f15ee..dbe2e59 100644 --- a/backend/genesys/gl841.h +++ b/backend/genesys/gl841.h @@ -15,9 +15,7 @@ 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. + along with this program. If not, see . As a special exception, the authors of SANE give permission for additional uses of the libraries contained in this release of SANE. diff --git a/backend/genesys/gl841_registers.h b/backend/genesys/gl841_registers.h index 2fac278..a8d924d 100644 --- a/backend/genesys/gl841_registers.h +++ b/backend/genesys/gl841_registers.h @@ -15,9 +15,7 @@ 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. + along with this program. If not, see . As a special exception, the authors of SANE give permission for additional uses of the libraries contained in this release of SANE. diff --git a/backend/genesys/gl842.cpp b/backend/genesys/gl842.cpp index d5bebe5..9d3da67 100644 --- a/backend/genesys/gl842.cpp +++ b/backend/genesys/gl842.cpp @@ -16,9 +16,7 @@ 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. + along with this program. If not, see . As a special exception, the authors of SANE give permission for additional uses of the libraries contained in this release of SANE. @@ -362,7 +360,7 @@ static void gl842_init_motor_regs_scan(Genesys_Device* dev, reg->set8(REG_0x80, vref); } - // substract acceleration distance from feedl + // subtract acceleration distance from feedl unsigned feedl = feed_steps; feedl <<= static_cast(motor_profile.step_type); diff --git a/backend/genesys/gl842.h b/backend/genesys/gl842.h index 288d29c..b20ef5e 100644 --- a/backend/genesys/gl842.h +++ b/backend/genesys/gl842.h @@ -15,9 +15,7 @@ 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. + along with this program. If not, see . As a special exception, the authors of SANE give permission for additional uses of the libraries contained in this release of SANE. diff --git a/backend/genesys/gl842_registers.h b/backend/genesys/gl842_registers.h index b6934ce..ceb540b 100644 --- a/backend/genesys/gl842_registers.h +++ b/backend/genesys/gl842_registers.h @@ -15,9 +15,7 @@ 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. + along with this program. If not, see . As a special exception, the authors of SANE give permission for additional uses of the libraries contained in this release of SANE. diff --git a/backend/genesys/gl843.cpp b/backend/genesys/gl843.cpp index 8233bde..e768ac0 100644 --- a/backend/genesys/gl843.cpp +++ b/backend/genesys/gl843.cpp @@ -16,9 +16,7 @@ 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. + along with this program. If not, see . As a special exception, the authors of SANE give permission for additional uses of the libraries contained in this release of SANE. @@ -781,7 +779,7 @@ static void gl843_init_motor_regs_scan(Genesys_Device* dev, reg->set8(REG_0x80, vref); } - /* substract acceleration distance from feedl */ + /* subtract acceleration distance from feedl */ feedl=feed_steps; feedl <<= static_cast(motor_profile.step_type); @@ -872,7 +870,7 @@ static void gl843_init_motor_regs_scan(Genesys_Device* dev, * scan's one * @param start logical start pixel coordinate * @param pixels logical number of pixels to use - * @param channels number of color channles used (1 or 3) + * @param channels number of color channels used (1 or 3) * @param depth bit depth of the scan (1, 8 or 16 bits) * @param color_filter to choose the color channel used in gray scans * @param flags to drive specific settings such no calibration, XPA use ... diff --git a/backend/genesys/gl843.h b/backend/genesys/gl843.h index 5326a2d..fe2814d 100644 --- a/backend/genesys/gl843.h +++ b/backend/genesys/gl843.h @@ -15,9 +15,7 @@ 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. + along with this program. If not, see . As a special exception, the authors of SANE give permission for additional uses of the libraries contained in this release of SANE. diff --git a/backend/genesys/gl843_registers.h b/backend/genesys/gl843_registers.h index cbc38c0..ab1f4c7 100644 --- a/backend/genesys/gl843_registers.h +++ b/backend/genesys/gl843_registers.h @@ -15,9 +15,7 @@ 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. + along with this program. If not, see . As a special exception, the authors of SANE give permission for additional uses of the libraries contained in this release of SANE. diff --git a/backend/genesys/gl846.cpp b/backend/genesys/gl846.cpp index cae7414..c8907b2 100644 --- a/backend/genesys/gl846.cpp +++ b/backend/genesys/gl846.cpp @@ -16,9 +16,7 @@ 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. + along with this program. If not, see . As a special exception, the authors of SANE give permission for additional uses of the libraries contained in this release of SANE. @@ -823,7 +821,7 @@ void CommandSetGl846::end_scan(Genesys_Device* dev, Genesys_Register_Set* reg, } } -// Moves the slider to the home (top) postion slowly +// Moves the slider to the home (top) position slowly void CommandSetGl846::move_back_home(Genesys_Device* dev, bool wait_until_home) const { scanner_move_back_home(*dev, wait_until_home); diff --git a/backend/genesys/gl846.h b/backend/genesys/gl846.h index f794a01..d06b337 100644 --- a/backend/genesys/gl846.h +++ b/backend/genesys/gl846.h @@ -15,9 +15,7 @@ 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. + along with this program. If not, see . As a special exception, the authors of SANE give permission for additional uses of the libraries contained in this release of SANE. diff --git a/backend/genesys/gl846_registers.h b/backend/genesys/gl846_registers.h index e4a8ac5..df45e4f 100644 --- a/backend/genesys/gl846_registers.h +++ b/backend/genesys/gl846_registers.h @@ -15,9 +15,7 @@ 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. + along with this program. If not, see . As a special exception, the authors of SANE give permission for additional uses of the libraries contained in this release of SANE. diff --git a/backend/genesys/gl847.cpp b/backend/genesys/gl847.cpp index f8f6b1c..91ac4eb 100644 --- a/backend/genesys/gl847.cpp +++ b/backend/genesys/gl847.cpp @@ -16,9 +16,7 @@ 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. + along with this program. If not, see . As a special exception, the authors of SANE give permission for additional uses of the libraries contained in this release of SANE. diff --git a/backend/genesys/gl847.h b/backend/genesys/gl847.h index aa4fb85..2cb3a9f 100644 --- a/backend/genesys/gl847.h +++ b/backend/genesys/gl847.h @@ -15,9 +15,7 @@ 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. + along with this program. If not, see . As a special exception, the authors of SANE give permission for additional uses of the libraries contained in this release of SANE. diff --git a/backend/genesys/gl847_registers.h b/backend/genesys/gl847_registers.h index aa3d43b..66fda4b 100644 --- a/backend/genesys/gl847_registers.h +++ b/backend/genesys/gl847_registers.h @@ -15,9 +15,7 @@ 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. + along with this program. If not, see . As a special exception, the authors of SANE give permission for additional uses of the libraries contained in this release of SANE. diff --git a/backend/genesys/image.cpp b/backend/genesys/image.cpp index 793a209..3ea6ef6 100644 --- a/backend/genesys/image.cpp +++ b/backend/genesys/image.cpp @@ -15,9 +15,7 @@ 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. + along with this program. If not, see . As a special exception, the authors of SANE give permission for additional uses of the libraries contained in this release of SANE. diff --git a/backend/genesys/image.h b/backend/genesys/image.h index 798594e..0ad344e 100644 --- a/backend/genesys/image.h +++ b/backend/genesys/image.h @@ -15,9 +15,7 @@ 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. + along with this program. If not, see . As a special exception, the authors of SANE give permission for additional uses of the libraries contained in this release of SANE. diff --git a/backend/genesys/image_buffer.cpp b/backend/genesys/image_buffer.cpp index c4f8019..46ca292 100644 --- a/backend/genesys/image_buffer.cpp +++ b/backend/genesys/image_buffer.cpp @@ -15,9 +15,7 @@ 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. + along with this program. If not, see . As a special exception, the authors of SANE give permission for additional uses of the libraries contained in this release of SANE. diff --git a/backend/genesys/image_buffer.h b/backend/genesys/image_buffer.h index 1910244..516e828 100644 --- a/backend/genesys/image_buffer.h +++ b/backend/genesys/image_buffer.h @@ -15,9 +15,7 @@ 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. + along with this program. If not, see . As a special exception, the authors of SANE give permission for additional uses of the libraries contained in this release of SANE. diff --git a/backend/genesys/image_pipeline.cpp b/backend/genesys/image_pipeline.cpp index 8d67be9..4161e95 100644 --- a/backend/genesys/image_pipeline.cpp +++ b/backend/genesys/image_pipeline.cpp @@ -15,9 +15,7 @@ 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. + along with this program. If not, see . As a special exception, the authors of SANE give permission for additional uses of the libraries contained in this release of SANE. diff --git a/backend/genesys/image_pipeline.h b/backend/genesys/image_pipeline.h index d4aef49..3632b36 100644 --- a/backend/genesys/image_pipeline.h +++ b/backend/genesys/image_pipeline.h @@ -15,9 +15,7 @@ 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. + along with this program. If not, see . As a special exception, the authors of SANE give permission for additional uses of the libraries contained in this release of SANE. diff --git a/backend/genesys/image_pixel.cpp b/backend/genesys/image_pixel.cpp index 1b83e12..011a086 100644 --- a/backend/genesys/image_pixel.cpp +++ b/backend/genesys/image_pixel.cpp @@ -15,9 +15,7 @@ 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. + along with this program. If not, see . As a special exception, the authors of SANE give permission for additional uses of the libraries contained in this release of SANE. diff --git a/backend/genesys/image_pixel.h b/backend/genesys/image_pixel.h index aa9980e..4b16083 100644 --- a/backend/genesys/image_pixel.h +++ b/backend/genesys/image_pixel.h @@ -15,9 +15,7 @@ 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. + along with this program. If not, see . As a special exception, the authors of SANE give permission for additional uses of the libraries contained in this release of SANE. diff --git a/backend/genesys/low.cpp b/backend/genesys/low.cpp index 05ef46b..ddd2c88 100644 --- a/backend/genesys/low.cpp +++ b/backend/genesys/low.cpp @@ -16,9 +16,7 @@ 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. + along with this program. If not, see . As a special exception, the authors of SANE give permission for additional uses of the libraries contained in this release of SANE. @@ -761,7 +759,7 @@ void sanei_genesys_send_gamma_table(Genesys_Device* dev, const Genesys_Sensor& s val &= ~(0x01 << i); dev->interface->write_register(0xbe, val); - // FIXME: currently the last word of each gamma table is not initialied, so to work around + // FIXME: currently the last word of each gamma table is not initialized, so to work around // unstable data, just set it to 0 which is the most likely value of uninitialized memory // (proper value is probably 0xff) gamma[size * 2 * i + size * 2 - 2] = 0; @@ -1789,7 +1787,7 @@ int sanei_genesys_get_lowest_dpi(Genesys_Device *dev) * true if they are compatible. * A calibration cache is compatible if color mode and x dpi match the user * requested scan. In the case of CIS scanners, dpi isn't a criteria. - * flatbed cache entries are considred too old and then expires if they + * flatbed cache entries are considered too old and then expires if they * are older than the expiration time option, forcing calibration at least once * then given time. */ bool sanei_genesys_is_compatible_calibration(Genesys_Device* dev, @@ -1853,7 +1851,7 @@ bool sanei_genesys_is_compatible_calibration(Genesys_Device* dev, return false; } - /* a cache entry expires after afetr expiration time for non sheetfed scanners */ + /* a cache entry expires after after expiration time for non sheetfed scanners */ /* this is not taken into account when overwriting cache entries */ #ifdef HAVE_SYS_TIME_H if (!for_overwrite && dev->settings.expiration_time >=0) diff --git a/backend/genesys/low.h b/backend/genesys/low.h index d67b427..ac149b5 100644 --- a/backend/genesys/low.h +++ b/backend/genesys/low.h @@ -22,9 +22,7 @@ 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. + along with this program. If not, see . As a special exception, the authors of SANE give permission for additional uses of the libraries contained in this release of SANE. diff --git a/backend/genesys/motor.cpp b/backend/genesys/motor.cpp index a18d6e1..8450fea 100644 --- a/backend/genesys/motor.cpp +++ b/backend/genesys/motor.cpp @@ -15,9 +15,7 @@ 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. + along with this program. If not, see . As a special exception, the authors of SANE give permission for additional uses of the libraries contained in this release of SANE. diff --git a/backend/genesys/motor.h b/backend/genesys/motor.h index c433c0e..e5fd695 100644 --- a/backend/genesys/motor.h +++ b/backend/genesys/motor.h @@ -15,9 +15,7 @@ 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. + along with this program. If not, see . As a special exception, the authors of SANE give permission for additional uses of the libraries contained in this release of SANE. @@ -62,7 +60,7 @@ namespace genesys { s - distance travelled in steps t - time in pixeltime - The physical mode defines the curve in physical quantities. We asssume that the scanner head + The physical mode defines the curve in physical quantities. We assume that the scanner head accelerates from standstill to the target speed uniformly. Then: v(t) = v(0) + a * t (2) diff --git a/backend/genesys/register.h b/backend/genesys/register.h index 51aab90..cee9adf 100644 --- a/backend/genesys/register.h +++ b/backend/genesys/register.h @@ -15,9 +15,7 @@ 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. + along with this program. If not, see . As a special exception, the authors of SANE give permission for additional uses of the libraries contained in this release of SANE. diff --git a/backend/genesys/register_cache.h b/backend/genesys/register_cache.h index dce701a..c7e5c41 100644 --- a/backend/genesys/register_cache.h +++ b/backend/genesys/register_cache.h @@ -15,9 +15,7 @@ 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. + along with this program. If not, see . As a special exception, the authors of SANE give permission for additional uses of the libraries contained in this release of SANE. diff --git a/backend/genesys/row_buffer.h b/backend/genesys/row_buffer.h index e1a0c82..a4b9e42 100644 --- a/backend/genesys/row_buffer.h +++ b/backend/genesys/row_buffer.h @@ -15,9 +15,7 @@ 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. + along with this program. If not, see . As a special exception, the authors of SANE give permission for additional uses of the libraries contained in this release of SANE. diff --git a/backend/genesys/scanner_interface.cpp b/backend/genesys/scanner_interface.cpp index 0b60b66..5363f0e 100644 --- a/backend/genesys/scanner_interface.cpp +++ b/backend/genesys/scanner_interface.cpp @@ -15,9 +15,7 @@ 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. + along with this program. If not, see . As a special exception, the authors of SANE give permission for additional uses of the libraries contained in this release of SANE. diff --git a/backend/genesys/scanner_interface.h b/backend/genesys/scanner_interface.h index 70413d1..8258117 100644 --- a/backend/genesys/scanner_interface.h +++ b/backend/genesys/scanner_interface.h @@ -15,9 +15,7 @@ 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. + along with this program. If not, see . As a special exception, the authors of SANE give permission for additional uses of the libraries contained in this release of SANE. diff --git a/backend/genesys/scanner_interface_usb.cpp b/backend/genesys/scanner_interface_usb.cpp index d405ede..117297c 100644 --- a/backend/genesys/scanner_interface_usb.cpp +++ b/backend/genesys/scanner_interface_usb.cpp @@ -15,9 +15,7 @@ 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. + along with this program. If not, see . As a special exception, the authors of SANE give permission for additional uses of the libraries contained in this release of SANE. diff --git a/backend/genesys/scanner_interface_usb.h b/backend/genesys/scanner_interface_usb.h index 33fb8fe..569d634 100644 --- a/backend/genesys/scanner_interface_usb.h +++ b/backend/genesys/scanner_interface_usb.h @@ -15,9 +15,7 @@ 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. + along with this program. If not, see . As a special exception, the authors of SANE give permission for additional uses of the libraries contained in this release of SANE. diff --git a/backend/genesys/sensor.cpp b/backend/genesys/sensor.cpp index ce51403..b09745f 100644 --- a/backend/genesys/sensor.cpp +++ b/backend/genesys/sensor.cpp @@ -15,9 +15,7 @@ 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. + along with this program. If not, see . As a special exception, the authors of SANE give permission for additional uses of the libraries contained in this release of SANE. diff --git a/backend/genesys/sensor.h b/backend/genesys/sensor.h index ca6fef7..6f87607 100644 --- a/backend/genesys/sensor.h +++ b/backend/genesys/sensor.h @@ -15,9 +15,7 @@ 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. + along with this program. If not, see . As a special exception, the authors of SANE give permission for additional uses of the libraries contained in this release of SANE. diff --git a/backend/genesys/serialize.h b/backend/genesys/serialize.h index ed40a4e..138ff08 100644 --- a/backend/genesys/serialize.h +++ b/backend/genesys/serialize.h @@ -15,9 +15,7 @@ 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. + along with this program. If not, see . As a special exception, the authors of SANE give permission for additional uses of the libraries contained in this release of SANE. diff --git a/backend/genesys/settings.cpp b/backend/genesys/settings.cpp index c2b54dc..7f64798 100644 --- a/backend/genesys/settings.cpp +++ b/backend/genesys/settings.cpp @@ -15,9 +15,7 @@ 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. + along with this program. If not, see . As a special exception, the authors of SANE give permission for additional uses of the libraries contained in this release of SANE. diff --git a/backend/genesys/settings.h b/backend/genesys/settings.h index f78845b..4c834fa 100644 --- a/backend/genesys/settings.h +++ b/backend/genesys/settings.h @@ -15,9 +15,7 @@ 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. + along with this program. If not, see . As a special exception, the authors of SANE give permission for additional uses of the libraries contained in this release of SANE. diff --git a/backend/genesys/static_init.cpp b/backend/genesys/static_init.cpp index c0f3748..5ed3b50 100644 --- a/backend/genesys/static_init.cpp +++ b/backend/genesys/static_init.cpp @@ -15,9 +15,7 @@ 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. + along with this program. If not, see . As a special exception, the authors of SANE give permission for additional uses of the libraries contained in this release of SANE. diff --git a/backend/genesys/static_init.h b/backend/genesys/static_init.h index 3ffa62c..e0b39c8 100644 --- a/backend/genesys/static_init.h +++ b/backend/genesys/static_init.h @@ -15,9 +15,7 @@ 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. + along with this program. If not, see . As a special exception, the authors of SANE give permission for additional uses of the libraries contained in this release of SANE. diff --git a/backend/genesys/status.cpp b/backend/genesys/status.cpp index 7f883b0..170bcd7 100644 --- a/backend/genesys/status.cpp +++ b/backend/genesys/status.cpp @@ -15,9 +15,7 @@ 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. + along with this program. If not, see . As a special exception, the authors of SANE give permission for additional uses of the libraries contained in this release of SANE. diff --git a/backend/genesys/status.h b/backend/genesys/status.h index 91f4692..f1a3695 100644 --- a/backend/genesys/status.h +++ b/backend/genesys/status.h @@ -15,9 +15,7 @@ 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. + along with this program. If not, see . As a special exception, the authors of SANE give permission for additional uses of the libraries contained in this release of SANE. diff --git a/backend/genesys/tables_frontend.cpp b/backend/genesys/tables_frontend.cpp index 5eb6e3c..02e9998 100644 --- a/backend/genesys/tables_frontend.cpp +++ b/backend/genesys/tables_frontend.cpp @@ -15,9 +15,7 @@ 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. + along with this program. If not, see . As a special exception, the authors of SANE give permission for additional uses of the libraries contained in this release of SANE. diff --git a/backend/genesys/tables_gpo.cpp b/backend/genesys/tables_gpo.cpp index 5c1c54f..075cafb 100644 --- a/backend/genesys/tables_gpo.cpp +++ b/backend/genesys/tables_gpo.cpp @@ -15,9 +15,7 @@ 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. + along with this program. If not, see . As a special exception, the authors of SANE give permission for additional uses of the libraries contained in this release of SANE. diff --git a/backend/genesys/tables_memory_layout.cpp b/backend/genesys/tables_memory_layout.cpp index 3eaedd4..77c7ce7 100644 --- a/backend/genesys/tables_memory_layout.cpp +++ b/backend/genesys/tables_memory_layout.cpp @@ -15,9 +15,7 @@ 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. + along with this program. If not, see . */ #define DEBUG_DECLARE_ONLY diff --git a/backend/genesys/tables_model.cpp b/backend/genesys/tables_model.cpp index 2c5e6a3..6998a51 100644 --- a/backend/genesys/tables_model.cpp +++ b/backend/genesys/tables_model.cpp @@ -26,9 +26,7 @@ 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. + along with this program. If not, see . As a special exception, the authors of SANE give permission for additional uses of the libraries contained in this release of SANE. @@ -65,7 +63,7 @@ void genesys_init_usb_device_tables() /* Guidelines on calibration area sizes ------------------------------------ - on many scanners scanning a single line takes aroung 10ms. In order not to take excessive + on many scanners scanning a single line takes around 10ms. In order not to take excessive amount of time, the sizes of the calibration area are limited as follows: 2400 dpi or less: 4mm (would take ~4 seconds on 2400 dpi) 4800 dpi or less: 3mm (would take ~6 seconds on 4800 dpi) diff --git a/backend/genesys/tables_motor.cpp b/backend/genesys/tables_motor.cpp index a452fe5..e8e89c5 100644 --- a/backend/genesys/tables_motor.cpp +++ b/backend/genesys/tables_motor.cpp @@ -15,9 +15,7 @@ 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. + along with this program. If not, see . As a special exception, the authors of SANE give permission for additional uses of the libraries contained in this release of SANE. diff --git a/backend/genesys/tables_sensor.cpp b/backend/genesys/tables_sensor.cpp index b90355c..8383287 100644 --- a/backend/genesys/tables_sensor.cpp +++ b/backend/genesys/tables_sensor.cpp @@ -15,9 +15,7 @@ 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. + along with this program. If not, see . As a special exception, the authors of SANE give permission for additional uses of the libraries contained in this release of SANE. diff --git a/backend/genesys/test_scanner_interface.cpp b/backend/genesys/test_scanner_interface.cpp index e8af494..5d0dcd3 100644 --- a/backend/genesys/test_scanner_interface.cpp +++ b/backend/genesys/test_scanner_interface.cpp @@ -15,9 +15,7 @@ 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. + along with this program. If not, see . As a special exception, the authors of SANE give permission for additional uses of the libraries contained in this release of SANE. diff --git a/backend/genesys/test_scanner_interface.h b/backend/genesys/test_scanner_interface.h index fc8128c..c1a3b76 100644 --- a/backend/genesys/test_scanner_interface.h +++ b/backend/genesys/test_scanner_interface.h @@ -15,9 +15,7 @@ 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. + along with this program. If not, see . As a special exception, the authors of SANE give permission for additional uses of the libraries contained in this release of SANE. diff --git a/backend/genesys/test_settings.cpp b/backend/genesys/test_settings.cpp index f328709..ba50f36 100644 --- a/backend/genesys/test_settings.cpp +++ b/backend/genesys/test_settings.cpp @@ -15,9 +15,7 @@ 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. + along with this program. If not, see . As a special exception, the authors of SANE give permission for additional uses of the libraries contained in this release of SANE. diff --git a/backend/genesys/test_settings.h b/backend/genesys/test_settings.h index 38cc3b3..90c6e50 100644 --- a/backend/genesys/test_settings.h +++ b/backend/genesys/test_settings.h @@ -15,9 +15,7 @@ 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. + along with this program. If not, see . As a special exception, the authors of SANE give permission for additional uses of the libraries contained in this release of SANE. diff --git a/backend/genesys/test_usb_device.cpp b/backend/genesys/test_usb_device.cpp index 1612eae..46cd4e5 100644 --- a/backend/genesys/test_usb_device.cpp +++ b/backend/genesys/test_usb_device.cpp @@ -15,9 +15,7 @@ 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. + along with this program. If not, see . As a special exception, the authors of SANE give permission for additional uses of the libraries contained in this release of SANE. diff --git a/backend/genesys/test_usb_device.h b/backend/genesys/test_usb_device.h index 03b49cc..6fd0ff3 100644 --- a/backend/genesys/test_usb_device.h +++ b/backend/genesys/test_usb_device.h @@ -15,9 +15,7 @@ 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. + along with this program. If not, see . As a special exception, the authors of SANE give permission for additional uses of the libraries contained in this release of SANE. diff --git a/backend/genesys/usb_device.cpp b/backend/genesys/usb_device.cpp index d6cbaed..63afb09 100644 --- a/backend/genesys/usb_device.cpp +++ b/backend/genesys/usb_device.cpp @@ -15,9 +15,7 @@ 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. + along with this program. If not, see . As a special exception, the authors of SANE give permission for additional uses of the libraries contained in this release of SANE. diff --git a/backend/genesys/usb_device.h b/backend/genesys/usb_device.h index aa8b89a..72f7017 100644 --- a/backend/genesys/usb_device.h +++ b/backend/genesys/usb_device.h @@ -15,9 +15,7 @@ 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. + along with this program. If not, see . As a special exception, the authors of SANE give permission for additional uses of the libraries contained in this release of SANE. diff --git a/backend/genesys/utilities.h b/backend/genesys/utilities.h index fdab770..6e637d0 100644 --- a/backend/genesys/utilities.h +++ b/backend/genesys/utilities.h @@ -15,9 +15,7 @@ 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. + along with this program. If not, see . As a special exception, the authors of SANE give permission for additional uses of the libraries contained in this release of SANE. diff --git a/backend/genesys/value_filter.h b/backend/genesys/value_filter.h index ba55567..4fdc9ca 100644 --- a/backend/genesys/value_filter.h +++ b/backend/genesys/value_filter.h @@ -15,9 +15,7 @@ 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. + along with this program. If not, see . */ #ifndef BACKEND_GENESYS_VALUE_FILTER_H diff --git a/backend/gphoto2.c b/backend/gphoto2.c index 973257c..0ea5b48 100644 --- a/backend/gphoto2.c +++ b/backend/gphoto2.c @@ -5,7 +5,7 @@ * particular, the current incarnation will only support cameras * that directly generate jpeg files. * - * Please report sucesses or failures using this backend! + * Please report successes 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 @@ -38,9 +38,7 @@ 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. + along with this program. If not, see . As a special exception, the authors of SANE give permission for additional uses of the libraries contained in this release of SANE. @@ -671,8 +669,7 @@ sane_init (SANE_Int * version_code, SANE_Auth_Callback __sane_unused__ authorize DBG_INIT (); - DBG (1, - "GPHOTO2 Backend $Id$\n"); + DBG (1, "GPHOTO2 Backend\n"); if (getenv ("GP_DEBUG")) { diff --git a/backend/gphoto2.h b/backend/gphoto2.h index b792875..2349709 100644 --- a/backend/gphoto2.h +++ b/backend/gphoto2.h @@ -23,9 +23,7 @@ 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. + along with this program. If not, see . As a special exception, the authors of SANE give permission for diff --git a/backend/gt68xx.c b/backend/gt68xx.c index f657d42..6e43765 100644 --- a/backend/gt68xx.c +++ b/backend/gt68xx.c @@ -18,9 +18,7 @@ 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. + along with this program. If not, see . As a special exception, the authors of SANE give permission for additional uses of the libraries contained in this release of SANE. @@ -124,7 +122,7 @@ static const SANE_Device **devlist = 0; static GT68xx_Device **new_dev = 0; /* Length of new_dev array */ static SANE_Int new_dev_len = 0; -/* Number of entries alloced for new_dev */ +/* Number of entries allocated for new_dev */ static SANE_Int new_dev_alloced = 0; /* Is this computer little-endian ?*/ SANE_Bool little_endian; @@ -1527,7 +1525,7 @@ sane_open (SANE_String_Const devicename, SANE_Handle * handle) } /* The firmware check is disabled by default because it may confuse - some scanners: So the firmware is loaded everytime. */ + some scanners: So the firmware is loaded every time. */ #if 0 RIE (gt68xx_device_check_firmware (dev, &firmware_loaded)); firmware_loaded = SANE_FALSE; @@ -2030,7 +2028,7 @@ sane_start (SANE_Handle handle) } while ((i<5) && (document==SANE_FALSE)); if(document==SANE_FALSE) { - DBG (4, "sane_start: no doucment detected after %d s\n",i); + DBG (4, "sane_start: no document detected after %d s\n",i); return SANE_STATUS_NO_DOCS; } } diff --git a/backend/gt68xx.conf.in b/backend/gt68xx.conf.in index af5ebe3..5e54f8f 100644 --- a/backend/gt68xx.conf.in +++ b/backend/gt68xx.conf.in @@ -5,7 +5,7 @@ # Put the firmware file into "@DATADIR@/sane/gt68xx/". # Manual configuration is necessary for some scanners. Please uncomment the -# override line and optinally the vendor and product lines that apply to your +# override line and optionally 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. diff --git a/backend/gt68xx.h b/backend/gt68xx.h index 96ad418..2f8bc2b 100644 --- a/backend/gt68xx.h +++ b/backend/gt68xx.h @@ -15,9 +15,7 @@ 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. + along with this program. If not, see . As a special exception, the authors of SANE give permission for additional uses of the libraries contained in this release of SANE. diff --git a/backend/gt68xx_devices.c b/backend/gt68xx_devices.c index 2df24f6..19ea97e 100644 --- a/backend/gt68xx_devices.c +++ b/backend/gt68xx_devices.c @@ -16,9 +16,7 @@ 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. + along with this program. If not, see . As a special exception, the authors of SANE give permission for additional uses of the libraries contained in this release of SANE. diff --git a/backend/gt68xx_generic.c b/backend/gt68xx_generic.c index 9fd8006..189d79c 100644 --- a/backend/gt68xx_generic.c +++ b/backend/gt68xx_generic.c @@ -16,9 +16,7 @@ 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. + along with this program. If not, see . As a special exception, the authors of SANE give permission for additional uses of the libraries contained in this release of SANE. diff --git a/backend/gt68xx_generic.h b/backend/gt68xx_generic.h index 2008974..b1fa3ef 100644 --- a/backend/gt68xx_generic.h +++ b/backend/gt68xx_generic.h @@ -15,9 +15,7 @@ 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. + along with this program. If not, see . As a special exception, the authors of SANE give permission for additional uses of the libraries contained in this release of SANE. diff --git a/backend/gt68xx_gt6801.c b/backend/gt68xx_gt6801.c index c0a6288..db1d274 100644 --- a/backend/gt68xx_gt6801.c +++ b/backend/gt68xx_gt6801.c @@ -17,9 +17,7 @@ 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. + along with this program. If not, see . As a special exception, the authors of SANE give permission for additional uses of the libraries contained in this release of SANE. @@ -103,7 +101,7 @@ gt6801_check_plustek_firmware (GT68xx_Device * dev, SANE_Bool * loaded) *loaded = SANE_FALSE; /* Until I find out if testing for req[3] & 0x80 is save, load the firmware - everytime */ + every time */ *loaded = SANE_FALSE; return SANE_STATUS_GOOD; diff --git a/backend/gt68xx_gt6801.h b/backend/gt68xx_gt6801.h index d6d1ceb..d84ac02 100644 --- a/backend/gt68xx_gt6801.h +++ b/backend/gt68xx_gt6801.h @@ -16,9 +16,7 @@ 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. + along with this program. If not, see . As a special exception, the authors of SANE give permission for additional uses of the libraries contained in this release of SANE. diff --git a/backend/gt68xx_gt6816.c b/backend/gt68xx_gt6816.c index a7880bd..866a043 100644 --- a/backend/gt68xx_gt6816.c +++ b/backend/gt68xx_gt6816.c @@ -16,9 +16,7 @@ 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. + along with this program. If not, see . As a special exception, the authors of SANE give permission for additional uses of the libraries contained in this release of SANE. diff --git a/backend/gt68xx_gt6816.h b/backend/gt68xx_gt6816.h index f941811..ea0ab76 100644 --- a/backend/gt68xx_gt6816.h +++ b/backend/gt68xx_gt6816.h @@ -15,9 +15,7 @@ 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. + along with this program. If not, see . As a special exception, the authors of SANE give permission for additional uses of the libraries contained in this release of SANE. diff --git a/backend/gt68xx_high.c b/backend/gt68xx_high.c index 563323c..f077e5e 100644 --- a/backend/gt68xx_high.c +++ b/backend/gt68xx_high.c @@ -19,9 +19,7 @@ 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. + along with this program. If not, see . As a special exception, the authors of SANE give permission for additional uses of the libraries contained in this release of SANE. @@ -979,9 +977,11 @@ gt68xx_scanner_read_line (GT68xx_Scanner * scanner, SANE_Status gt68xx_scanner_stop_scan (GT68xx_Scanner * scanner) { - gt68xx_line_reader_free (scanner->reader); - scanner->reader = NULL; - + if (scanner->reader) + { + gt68xx_line_reader_free (scanner->reader); + scanner->reader = NULL; + } return gt68xx_device_stop_scan (scanner->dev); } @@ -1015,7 +1015,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 + * This function is used for CCD scanners. The black mark to the left is used * for the calculation of average black. The remaining calibration strip * is used for searching the segment whose white average is the highest. * @@ -2664,7 +2664,7 @@ gt68xx_read_calibration (GT68xx_Scanner * scanner) return SANE_STATUS_IO_ERROR; } - /* TODO we should check endiannes and word alignment in case of a home + /* TODO we should check endianness and word alignment in case of a home * directory used trough different archs */ /* TODO check for errors */ diff --git a/backend/gt68xx_high.h b/backend/gt68xx_high.h index da4ab6a..a4db59f 100644 --- a/backend/gt68xx_high.h +++ b/backend/gt68xx_high.h @@ -16,9 +16,7 @@ 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. + along with this program. If not, see . As a special exception, the authors of SANE give permission for additional uses of the libraries contained in this release of SANE. @@ -356,7 +354,7 @@ static SANE_Status gt68xx_scanner_stop_scan (GT68xx_Scanner * scanner); * This function stores in memory calibration data created at calibration * time into file * @param scanner Scanner object. - * @return SANE_STATUS_GOOD when succesfull + * @return SANE_STATUS_GOOD when successful */ static SANE_Status gt68xx_write_calibration (GT68xx_Scanner * scanner); @@ -365,7 +363,7 @@ static SANE_Status gt68xx_write_calibration (GT68xx_Scanner * scanner); * This function sets in memory calibration data from data saved into file. * * @param scanner Scanner object. - * @return SANE_STATUS_GOOD when succesfull + * @return SANE_STATUS_GOOD when successful */ static SANE_Status gt68xx_read_calibration (GT68xx_Scanner * scanner); diff --git a/backend/gt68xx_low.c b/backend/gt68xx_low.c index 3ea4590..5aa84ac 100644 --- a/backend/gt68xx_low.c +++ b/backend/gt68xx_low.c @@ -16,9 +16,7 @@ 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. + along with this program. If not, see . As a special exception, the authors of SANE give permission for additional uses of the libraries contained in this release of SANE. @@ -176,6 +174,8 @@ gt68xx_device_new (GT68xx_Device ** dev_return) dev->manual_selection = SANE_FALSE; + dev->scan_started = SANE_FALSE; + #ifdef USE_FORK dev->shm_channel = NULL; #endif /* USE_FORK */ @@ -626,7 +626,14 @@ gt68xx_device_start_scan (GT68xx_Device * dev) { CHECK_DEV_ACTIVE (dev, "gt68xx_device_start_scan"); if (dev->model->command_set->start_scan) - return (*dev->model->command_set->start_scan) (dev); + { + if (!dev->scan_started) + { + dev->scan_started = SANE_TRUE; + return (*dev->model->command_set->start_scan) (dev); + } + return SANE_STATUS_DEVICE_BUSY; + } else return SANE_STATUS_UNSUPPORTED; } @@ -681,7 +688,14 @@ gt68xx_device_stop_scan (GT68xx_Device * dev) { CHECK_DEV_ACTIVE (dev, "gt68xx_device_stop_scan"); if (dev->model->command_set->stop_scan) - return (*dev->model->command_set->stop_scan) (dev); + { + if (dev->scan_started) + { + dev->scan_started = SANE_FALSE; + return (*dev->model->command_set->stop_scan) (dev); + } + return SANE_STATUS_GOOD; // Essentially a NOP. + } else return SANE_STATUS_UNSUPPORTED; } diff --git a/backend/gt68xx_low.h b/backend/gt68xx_low.h index 89bd365..51dd256 100644 --- a/backend/gt68xx_low.h +++ b/backend/gt68xx_low.h @@ -16,9 +16,7 @@ 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. + along with this program. If not, see . As a special exception, the authors of SANE give permission for additional uses of the libraries contained in this release of SANE. @@ -71,7 +69,7 @@ #define LOBYTE(w) ((SANE_Byte)(w)) -/* return if an error occured while the function was called */ +/* return if an error occurred while the function was called */ #ifdef MAX_DEBUG # define RIE(function) \ @@ -219,7 +217,7 @@ struct GT68xx_Command_Set /*@{ */ SANE_Byte request_type; /**< Request type (should be 0x40, vendor spec) */ - SANE_Byte request; /**< Vendor spec resquest (0x01 or 0x04) */ + SANE_Byte request; /**< Vendor spec request (0x01 or 0x04) */ SANE_Word memory_read_value; /**< Memory read - wValue */ SANE_Word memory_write_value; /**< Memory write - wValue */ SANE_Word send_cmd_value; /**< Send normal command - wValue */ @@ -504,7 +502,7 @@ struct GT68xx_Device SANE_Bool active; /** Device missing to flag devices that are unplugged - * after sane_init and befor sane_exit */ + * after sane_init and before sane_exit */ SANE_Bool missing; /** Scanner model data. */ @@ -527,6 +525,8 @@ struct GT68xx_Device size_t read_bytes_left; SANE_Byte gray_mode_color; SANE_Bool manual_selection; + SANE_Bool scan_started; + #ifdef USE_FORK Shm_Channel *shm_channel; pid_t reader_pid; @@ -588,7 +588,7 @@ struct GT68xx_Scan_Parameters SANE_Int ld_shift_b; SANE_Int ld_shift_double; SANE_Int double_column; - SANE_Int pixel_x0; /**< x start postion */ + SANE_Int pixel_x0; /**< x start position */ }; @@ -763,7 +763,7 @@ static SANE_Status gt68xx_device_deactivate (GT68xx_Device * dev); * * @return * - #SANE_STATUS_GOOD - success. - * - #SANE_STATUS_IO_ERROR - a communication error occured. + * - #SANE_STATUS_IO_ERROR - a communication error occurred. * * @warning * @a size must be a multiple of 64 (at least with GT6816), otherwise the @@ -782,7 +782,7 @@ gt68xx_device_memory_write (GT68xx_Device * dev, SANE_Word addr, * * @return * - #SANE_STATUS_GOOD - success. - * - #SANE_STATUS_IO_ERROR - a communication error occured. + * - #SANE_STATUS_IO_ERROR - a communication error occurred. * * @warning * @a size must be a multiple of 64 (at least with GT6816), otherwise the @@ -800,7 +800,7 @@ gt68xx_device_memory_read (GT68xx_Device * dev, SANE_Word addr, * * @return * - #SANE_STATUS_GOOD - success. - * - #SANE_STATUS_IO_ERROR - a communication error occured. + * - #SANE_STATUS_IO_ERROR - a communication error occurred. */ static SANE_Status gt68xx_device_req (GT68xx_Device * dev, GT68xx_Packet cmd, GT68xx_Packet res); @@ -813,7 +813,7 @@ gt68xx_device_req (GT68xx_Device * dev, GT68xx_Packet cmd, GT68xx_Packet res); * * @return * - #SANE_STATUS_GOOD - success. - * - #SANE_STATUS_IO_ERROR - a communication error occured. + * - #SANE_STATUS_IO_ERROR - a communication error occurred. */ static SANE_Status gt68xx_device_small_req (GT68xx_Device * dev, GT68xx_Packet cmd, @@ -829,7 +829,7 @@ gt68xx_device_small_req (GT68xx_Device * dev, GT68xx_Packet cmd, * * @return * - #SANE_STATUS_GOOD - success. - * - #SANE_STATUS_IO_ERROR - a communication error occured. + * - #SANE_STATUS_IO_ERROR - a communication error occurred. */ static SANE_Status gt68xx_device_check_firmware (GT68xx_Device * dev, SANE_Bool * loaded); @@ -850,7 +850,7 @@ gt68xx_device_download_firmware (GT68xx_Device * dev, * * @return * - #SANE_STATUS_GOOD - success. - * - #SANE_STATUS_IO_ERROR - a communication error occured. + * - #SANE_STATUS_IO_ERROR - a communication error occurred. */ static SANE_Status gt68xx_device_get_power_status (GT68xx_Device * dev, SANE_Bool * power_ok); @@ -865,7 +865,7 @@ gt68xx_device_get_power_status (GT68xx_Device * dev, SANE_Bool * power_ok); * @return * - #SANE_STATUS_GOOD - success. * - #SANE_STATUS_UNSUPPORTED - the scanner does not support TA connection. - * - #SANE_STATUS_IO_ERROR - a communication error occured. + * - #SANE_STATUS_IO_ERROR - a communication error occurred. */ static SANE_Status gt68xx_device_get_ta_status (GT68xx_Device * dev, SANE_Bool * ta_attached); @@ -878,7 +878,7 @@ gt68xx_device_get_ta_status (GT68xx_Device * dev, SANE_Bool * ta_attached); * * @return * - #SANE_STATUS_GOOD - success. - * - #SANE_STATUS_IO_ERROR - a communication error occured. + * - #SANE_STATUS_IO_ERROR - a communication error occurred. * - #SANE_STATUS_UNSUPPORTED - unsupported request was made (like attempt to * turn on the TA lamp on a scanner which does not support TA). */ @@ -895,7 +895,7 @@ gt68xx_device_lamp_control (GT68xx_Device * dev, SANE_Bool fb_lamp, * * @return * - #SANE_STATUS_GOOD - success; the status in @a *moving is valid. - * - #SANE_STATUS_IO_ERROR - a communication error occured. + * - #SANE_STATUS_IO_ERROR - a communication error occurred. */ static SANE_Status gt68xx_device_is_moving (GT68xx_Device * dev, SANE_Bool * moving); @@ -912,7 +912,7 @@ gt68xx_device_is_moving (GT68xx_Device * dev, SANE_Bool * moving); * - #SANE_STATUS_GOOD - success; the movement is started. Call * gt68xx_device_is_moving() periodically to determine when the movement is * complete. - * - #SANE_STATUS_IO_ERROR - a communication error occured. + * - #SANE_STATUS_IO_ERROR - a communication error occurred. */ static SANE_Status gt68xx_device_move_relative (GT68xx_Device * dev, SANE_Int distance); @@ -929,7 +929,7 @@ gt68xx_device_move_relative (GT68xx_Device * dev, SANE_Int distance); * * @return * - #SANE_STATUS_GOOD - success; the movement is started. - * - #SANE_STATUS_IO_ERROR - a communication error occured. + * - #SANE_STATUS_IO_ERROR - a communication error occurred. */ static SANE_Status gt68xx_device_carriage_home (GT68xx_Device * dev); @@ -940,7 +940,7 @@ static SANE_Status gt68xx_device_carriage_home (GT68xx_Device * dev); * * @return * - #SANE_STATUS_GOOD - success; the movement is started. - * - #SANE_STATUS_IO_ERROR - a communication error occured. + * - #SANE_STATUS_IO_ERROR - a communication error occurred. */ static SANE_Status gt68xx_device_paperfeed (GT68xx_Device * dev); @@ -958,7 +958,7 @@ static SANE_Status gt68xx_device_paperfeed (GT68xx_Device * dev); * * @return * - #SANE_STATUS_GOOD - success. - * - #SANE_STATUS_IO_ERROR - a communication error occured. + * - #SANE_STATUS_IO_ERROR - a communication error occurred. */ static SANE_Status gt68xx_device_start_scan (GT68xx_Device * dev); @@ -977,7 +977,7 @@ static SANE_Status gt68xx_device_start_scan (GT68xx_Device * dev); * * @return * - #SANE_STATUS_GOOD - success; the value in @a *ready is valid. - * - #SANE_STATUS_IO_ERROR - a communication error occured. + * - #SANE_STATUS_IO_ERROR - a communication error occurred. */ static SANE_Status gt68xx_device_read_scanned_data (GT68xx_Device * dev, SANE_Bool * ready); @@ -991,7 +991,7 @@ gt68xx_device_read_scanned_data (GT68xx_Device * dev, SANE_Bool * ready); * * @return * - #SANE_STATUS_GOOD - success. - * - #SANE_STATUS_IO_ERROR - a communication error occured. + * - #SANE_STATUS_IO_ERROR - a communication error occurred. */ static SANE_Status gt68xx_device_stop_scan (GT68xx_Device * dev); @@ -1014,7 +1014,7 @@ static SANE_Status gt68xx_device_stop_scan (GT68xx_Device * dev); * are not supported by hardware. * - #SANE_STATUS_INVAL - some of the parameters in @a request, or the @a * action code, are completely invalid. - * - #SANE_STATUS_IO_ERROR - a communication error occured. + * - #SANE_STATUS_IO_ERROR - a communication error occurred. */ static SANE_Status gt68xx_device_setup_scan (GT68xx_Device * dev, @@ -1029,7 +1029,7 @@ gt68xx_device_setup_scan (GT68xx_Device * dev, * * @return * - #SANE_STATUS_GOOD - success. - * - #SANE_STATUS_IO_ERROR - a communication error occured. + * - #SANE_STATUS_IO_ERROR - a communication error occurred. */ static SANE_Status gt68xx_device_set_afe (GT68xx_Device * dev, GT68xx_AFE_Parameters * params); @@ -1048,7 +1048,7 @@ gt68xx_device_set_exposure_time (GT68xx_Device * dev, * * @return * - #SANE_STATUS_GOOD - success. - * - #SANE_STATUS_IO_ERROR - a communication error occured. + * - #SANE_STATUS_IO_ERROR - a communication error occurred. */ static SANE_Status gt68xx_device_read_raw (GT68xx_Device * dev, SANE_Byte * buffer, @@ -1085,7 +1085,7 @@ gt68xx_device_get_id (GT68xx_Device * dev); /** Read the device descriptor of the scanner. * * This function should be called before closing the device to make sure - * that the device descriptor is propperly stored in the scanner's memory. + * that the device descriptor is properly stored in the scanner's memory. * If that's not done, the next try to get the config descriptor will * result in a corrupted descriptor. * diff --git a/backend/gt68xx_mid.c b/backend/gt68xx_mid.c index 1d6a5c6..f35e5a8 100644 --- a/backend/gt68xx_mid.c +++ b/backend/gt68xx_mid.c @@ -16,9 +16,7 @@ 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. + along with this program. If not, see . As a special exception, the authors of SANE give permission for additional uses of the libraries contained in this release of SANE. @@ -81,7 +79,7 @@ gt68xx_delay_buffer_init (GT68xx_Delay_Buffer * delay, DBG (3, "gt68xx_delay_buffer_init: no memory for delay block\n"); return SANE_STATUS_NO_MEM; } - /* make sure that we will see if one of the unitialized lines get displayed */ + /* make sure that we will see if one of the uninitialized lines get displayed */ for (i = 0; i < bytes_per_line * line_count; i++) delay->mem_block[i] = i % 256; diff --git a/backend/gt68xx_mid.h b/backend/gt68xx_mid.h index 2bbaac2..942211a 100644 --- a/backend/gt68xx_mid.h +++ b/backend/gt68xx_mid.h @@ -15,9 +15,7 @@ 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. + along with this program. If not, see . As a special exception, the authors of SANE give permission for additional uses of the libraries contained in this release of SANE. @@ -143,7 +141,7 @@ static SANE_Status gt68xx_line_reader_free (GT68xx_Line_Reader * reader); * * @return * - SANE_STATUS_GOOD - read completed successfully - * - other error value - an error occured + * - other error value - an error occurred */ static SANE_Status gt68xx_line_reader_read (GT68xx_Line_Reader * reader, diff --git a/backend/gt68xx_shm_channel.c b/backend/gt68xx_shm_channel.c index 496a959..99ce240 100644 --- a/backend/gt68xx_shm_channel.c +++ b/backend/gt68xx_shm_channel.c @@ -15,9 +15,7 @@ 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. + along with this program. If not, see . As a special exception, the authors of SANE give permission for additional uses of the libraries contained in this release of SANE. @@ -342,7 +340,7 @@ shm_channel_writer_init (Shm_Channel * shm_channel) * This function may block waiting for a free buffer (if the reader process * does not process the data fast enough). * - * After successfull call to this function the writer process should fill the + * After successful call to this function the writer process should fill the * buffer with the data and pass the buffer identifier from @a buffer_id_return * to shm_channel_writer_put_buffer() to give the buffer to the reader process. * @@ -355,7 +353,7 @@ shm_channel_writer_init (Shm_Channel * shm_channel) * waiting for it); @a buffer_id_return and @a buffer_addr_return are filled * with valid values. * - SANE_STATUS_EOF - the reader process has closed its half of the channel. - * - SANE_STATUS_IO_ERROR - an I/O error occured. + * - SANE_STATUS_IO_ERROR - an I/O error occurred. */ SANE_Status shm_channel_writer_get_buffer (Shm_Channel * shm_channel, @@ -399,7 +397,7 @@ shm_channel_writer_get_buffer (Shm_Channel * shm_channel, * @return * - SANE_STATUS_GOOD - the buffer was successfully queued. * - SANE_STATUS_IO_ERROR - the reader process has closed its half of the - * channel, or another I/O error occured. + * channel, or another I/O error occurred. */ SANE_Status shm_channel_writer_put_buffer (Shm_Channel * shm_channel, @@ -573,7 +571,7 @@ shm_channel_reader_start (Shm_Channel * shm_channel) * Otherwise, @a *buffer_id_return, @a *buffer_addr_return and @a * *buffer_bytes return are filled with valid values. * - SANE_STATUS_EOF - the writer process has closed its half of the channel. - * - SANE_STATUS_IO_ERROR - an I/O error occured. + * - SANE_STATUS_IO_ERROR - an I/O error occurred. */ SANE_Status shm_channel_reader_get_buffer (Shm_Channel * shm_channel, @@ -627,7 +625,7 @@ shm_channel_reader_get_buffer (Shm_Channel * shm_channel, * @return * - SANE_STATUS_GOOD - the buffer was successfully released. * - SANE_STATUS_IO_ERROR - the writer process has closed its half of the - * channel, or an unexpected I/O error occured. + * channel, or an unexpected I/O error occurred. */ SANE_Status shm_channel_reader_put_buffer (Shm_Channel * shm_channel, SANE_Int buffer_id) diff --git a/backend/gt68xx_shm_channel.h b/backend/gt68xx_shm_channel.h index 54b5eca..129ea75 100644 --- a/backend/gt68xx_shm_channel.h +++ b/backend/gt68xx_shm_channel.h @@ -15,9 +15,7 @@ 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. + along with this program. If not, see . As a special exception, the authors of SANE give permission for additional uses of the libraries contained in this release of SANE. diff --git a/backend/hp-accessor.c b/backend/hp-accessor.c index 8b79ad4..ddb85de 100644 --- a/backend/hp-accessor.c +++ b/backend/hp-accessor.c @@ -13,9 +13,7 @@ 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. + along with this program. If not, see . As a special exception, the authors of SANE give permission for additional uses of the libraries contained in this release of SANE. diff --git a/backend/hp-accessor.h b/backend/hp-accessor.h index f043c3f..6d0cc6f 100644 --- a/backend/hp-accessor.h +++ b/backend/hp-accessor.h @@ -13,9 +13,7 @@ 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. + along with this program. If not, see . As a special exception, the authors of SANE give permission for additional uses of the libraries contained in this release of SANE. diff --git a/backend/hp-device.c b/backend/hp-device.c index 30e7a79..36706ee 100644 --- a/backend/hp-device.c +++ b/backend/hp-device.c @@ -13,9 +13,7 @@ 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. + along with this program. If not, see . As a special exception, the authors of SANE give permission for additional uses of the libraries contained in this release of SANE. diff --git a/backend/hp-device.h b/backend/hp-device.h index 272a78a..a67df8d 100644 --- a/backend/hp-device.h +++ b/backend/hp-device.h @@ -13,9 +13,7 @@ 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. + along with this program. If not, see . As a special exception, the authors of SANE give permission for additional uses of the libraries contained in this release of SANE. diff --git a/backend/hp-handle.c b/backend/hp-handle.c index 63e9fcb..d7f7817 100644 --- a/backend/hp-handle.c +++ b/backend/hp-handle.c @@ -13,9 +13,7 @@ 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. + along with this program. If not, see . As a special exception, the authors of SANE give permission for additional uses of the libraries contained in this release of SANE. @@ -173,7 +171,7 @@ hp_handle_startReader (HpHandle this, HpScsi scsi) this->pipe_write_fd = fds[1]; this->pipe_read_fd = fds[0]; - /* Will childs be forked ? */ + /* Will child be forked ? */ this->child_forked = sanei_thread_is_forked (); /* Start a thread or fork a child. None of them will return here. */ diff --git a/backend/hp-handle.h b/backend/hp-handle.h index f1fac9a..a16d1b1 100644 --- a/backend/hp-handle.h +++ b/backend/hp-handle.h @@ -13,9 +13,7 @@ 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. + along with this program. If not, see . As a special exception, the authors of SANE give permission for additional uses of the libraries contained in this release of SANE. diff --git a/backend/hp-hpmem.c b/backend/hp-hpmem.c index d082bda..e51c78b 100644 --- a/backend/hp-hpmem.c +++ b/backend/hp-hpmem.c @@ -13,9 +13,7 @@ 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. + along with this program. If not, see . As a special exception, the authors of SANE give permission for additional uses of the libraries contained in this release of SANE. diff --git a/backend/hp-option.c b/backend/hp-option.c index f4d23f8..6aed680 100644 --- a/backend/hp-option.c +++ b/backend/hp-option.c @@ -13,9 +13,7 @@ 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. + along with this program. If not, see . As a special exception, the authors of SANE give permission for additional uses of the libraries contained in this release of SANE. @@ -43,14 +41,11 @@ */ /* - $Log$ Revision 1.13 2005/04/13 12:50:07 ellert-guest Add missing SANE_I18N, Regenerate .po files accordingly, Update Swedish translations Revision 1.12 2003/10/09 19:32:50 kig-guest - Bug #300241: fix invers image on 3c/4c/6100C at 10 bit depth - - + Bug #300241: fix inverse image on 3c/4c/6100C at 10 bit depth */ /* pwd.h not available ? */ @@ -60,7 +55,7 @@ #endif #endif -/* To be done: dont reallocate choice accessors */ +/* To be done: don't reallocate choice accessors */ /* #define HP_ALLOC_CHOICEACC_ONCE 1 */ /* #define HP_EXPERIMENTAL @@ -276,7 +271,7 @@ hp_probed_choice_isSupported (HpScsi scsi, HpScl scl, /* Not in the support table. Try to inquire */ /* Fix me: It seems that the scanner does not raise a parameter error */ - /* after specifiying an unsupported command-value. */ + /* after specifying an unsupported command-value. */ sanei_hp_scl_clearErrors (scsi); sanei_hp_scl_set (scsi, scl, choice->val); @@ -757,7 +752,7 @@ _probe_int (_HpOption this, HpScsi scsi, HpOptSet __sane_unused__ optset, HpData if (minval >= maxval) return SANE_STATUS_UNSUPPORTED; - /* If we dont have an accessor, get one */ + /* If we don't have an accessor, get one */ if (!this->data_acsr) { if (!(this->data_acsr = sanei_hp_accessor_int_new(data))) @@ -798,7 +793,7 @@ _probe_int_brightness (_HpOption this, HpScsi scsi, HpOptSet __sane_unused__ opt if (minval >= maxval) return SANE_STATUS_UNSUPPORTED; - /* If we dont have an accessor, get one */ + /* If we don't have an accessor, get one */ if (!this->data_acsr) { if (!(this->data_acsr = sanei_hp_accessor_int_new(data))) @@ -829,7 +824,7 @@ _probe_resolution (_HpOption this, HpScsi scsi, HpOptSet __sane_unused__ optset, if (minval >= maxval) return SANE_STATUS_UNSUPPORTED; - /* If we dont have an accessor, get one */ + /* If we don't have an accessor, get one */ if (!this->data_acsr) { if (!(this->data_acsr = sanei_hp_accessor_int_new(data))) @@ -880,7 +875,7 @@ _probe_bool (_HpOption this, HpScsi scsi, HpOptSet __sane_unused__ optset, if (scl) RETURN_IF_FAIL( sanei_hp_scl_inquire(scsi, scl, &val, 0, 0) ); - /* If we dont have an accessor, get one */ + /* If we don't have an accessor, get one */ if (!this->data_acsr) { if (!(this->data_acsr = sanei_hp_accessor_bool_new(data))) @@ -912,7 +907,7 @@ _probe_change_doc (_HpOption this, HpScsi scsi, HpOptSet __sane_unused__ optset, if ( status != SANE_STATUS_GOOD ) return SANE_STATUS_UNSUPPORTED; - /* If we dont have an accessor, get one */ + /* If we don't have an accessor, get one */ if (!this->data_acsr) { if (!(this->data_acsr = sanei_hp_accessor_bool_new(data))) @@ -948,7 +943,7 @@ _probe_unload (_HpOption this, HpScsi scsi, HpOptSet __sane_unused__ optset, if ( status != SANE_STATUS_GOOD ) return SANE_STATUS_UNSUPPORTED; - /* If we dont have an accessor, get one */ + /* If we don't have an accessor, get one */ if (!this->data_acsr) { if (!(this->data_acsr = sanei_hp_accessor_bool_new(data))) @@ -994,7 +989,7 @@ _probe_calibrate (_HpOption this, HpScsi scsi, HpOptSet __sane_unused__ optset, /* And the desired ID of 10963 does not work. So we have to trust */ /* the evaluated HP model number. */ - /* If we dont have an accessor, get one */ + /* If we don't have an accessor, get one */ if (!this->data_acsr) { if (!(this->data_acsr = sanei_hp_accessor_bool_new(data))) @@ -1175,7 +1170,7 @@ _probe_each_choice (_HpOption this, HpScsi scsi, HpOptSet __sane_unused__ optset if (!choices) return SANE_STATUS_UNSUPPORTED; - /* If we dont have an accessor, get one */ + /* If we don't have an accessor, get one */ #ifdef HP_ALLOC_CHOICEACC_ONCE if (!this->data_acsr) #endif @@ -1210,7 +1205,7 @@ _probe_ps_exposure_time (_HpOption this, HpScsi scsi, HpOptSet __sane_unused__ o info = sanei_hp_device_info_get ( sanei_hp_scsi_devicename (scsi) ); - /* If we dont have an accessor, get one */ + /* If we don't have an accessor, get one */ #ifdef HP_ALLOC_CHOICEACC_ONCE if (!this->data_acsr) #endif @@ -1262,7 +1257,7 @@ _probe_scan_type (_HpOption this, HpScsi scsi, HpOptSet __sane_unused__ optset, } /* Inquire XPA capability is supported only by IIcx and 6100c/4c/3c. */ - /* But more devices support XPA scan window. So dont inquire XPA cap. */ + /* But more devices support XPA scan window. So don't inquire XPA cap. */ if ( compat & ( HP_COMPAT_2CX | HP_COMPAT_4C | HP_COMPAT_4P | HP_COMPAT_5P | HP_COMPAT_5100C | HP_COMPAT_6200C) && !(compat&HP_COMPAT_OJ_1150C) ) @@ -1282,7 +1277,7 @@ _probe_scan_type (_HpOption this, HpScsi scsi, HpOptSet __sane_unused__ optset, info = sanei_hp_device_info_get ( sanei_hp_scsi_devicename (scsi) ); - /* If we dont have an accessor, get one */ + /* If we don't have an accessor, get one */ #ifdef HP_ALLOC_CHOICEACC_ONCE if (!this->data_acsr) #endif @@ -1327,7 +1322,7 @@ _probe_mirror_horiz (_HpOption this, HpScsi scsi, HpOptSet __sane_unused__ optse if (!choices) return SANE_STATUS_UNSUPPORTED; - /* If we dont have an accessor, get one */ + /* If we don't have an accessor, get one */ #ifdef HP_ALLOC_CHOICEACC_ONCE if (!this->data_acsr) #endif @@ -1371,7 +1366,7 @@ _probe_mirror_vert (_HpOption this, HpScsi scsi, HpOptSet __sane_unused__ optset if (!choices) return SANE_STATUS_UNSUPPORTED; - /* If we dont have an accessor, get one */ + /* If we don't have an accessor, get one */ #ifdef HP_ALLOC_CHOICEACC_ONCE if (!this->data_acsr) #endif @@ -1403,7 +1398,7 @@ static SANE_Status _probe_front_button(_HpOption this, HpScsi scsi, _set_size(this, data, sizeof(SANE_Bool)); - /* If we dont have an accessor, get one */ + /* If we don't have an accessor, get one */ if (!this->data_acsr) { if ( !(this->data_acsr = sanei_hp_accessor_bool_new(data)) ) @@ -1529,7 +1524,7 @@ _probe_custom_gamma (_HpOption this, HpScsi scsi, HpOptSet __sane_unused__ optse RETURN_IF_FAIL( sanei_hp_scl_inquire(scsi, scl, &val, 0, 0) ); } - /* If we dont have an accessor, get one */ + /* If we don't have an accessor, get one */ if (!this->data_acsr) { if (!(this->data_acsr = sanei_hp_accessor_bool_new(data))) @@ -1591,7 +1586,7 @@ _probe_vector (_HpOption this, HpScsi scsi, HpOptSet optset, HpData data) assert(type->scl); RETURN_IF_FAIL ( _probe_download_type (scl, scsi) ); - /* If we dont have an accessor, get one */ + /* If we don't have an accessor, get one */ #ifdef HP_ALLOC_CHOICEACC_ONCE if (!this->data_acsr) #endif @@ -1612,7 +1607,7 @@ _probe_vector (_HpOption this, HpScsi scsi, HpOptSet optset, HpData data) super = hp_optset_get(optset, type->super); assert(super); - /* If we dont have an accessor, get one */ + /* If we don't have an accessor, get one */ #ifdef HP_ALLOC_CHOICEACC_ONCE if (!this->data_acsr) #endif @@ -1700,7 +1695,7 @@ static SANE_Status _probe_num_options (_HpOption this, HpScsi __sane_unused__ scsi, HpOptSet __sane_unused__ optset, HpData data) { - /* If we dont have an accessor, get one */ + /* If we don't have an accessor, get one */ if (!this->data_acsr) { if (!(this->data_acsr = sanei_hp_accessor_int_new(data))) @@ -2125,7 +2120,7 @@ _program_resolution (HpOption this, HpScsi scsi, HpOptSet __sane_unused__ optset /* xres = next higher multiple of 300, xscale < 100 */ /* yres = next lower multiple of 300, yscale > 100 */ /* yres = next higher multiple of 300, yscale < 100 */ - /* The image extent was ok, but the content was streched in y-direction */ + /* The image extent was ok, but the content was stretched in y-direction */ if (xresolution > 300) { @@ -2417,7 +2412,7 @@ _program_scan_type (HpOption this, HpScsi scsi, HpOptSet optset, HpData data) 0xfc,0x02,0x7c,0x01,0xfc,0x01,0x7c,0x00,0xfc,0x00,0x7c,0x00,0x00 }; - sanei_hp_scl_set(scsi, SCL_RESERVED1, 0); /* dont know */ + sanei_hp_scl_set(scsi, SCL_RESERVED1, 0); /* don't know */ sanei_hp_scl_set(scsi, SCL_10952, 0); /* Calibration mode */ if ( sanei_hp_is_active_xpa (scsi) @@ -2549,7 +2544,7 @@ _program_ps_exposure_time (HpOption this, HpScsi scsi, /* Negatives get some extra blue to penetrate the orange mask and less red to not saturate the red channel; R:G:B = 100:200:300 */ - /* We dont use the 100% case. It may cause mechanical problems */ + /* We don't use the 100% case. It may cause mechanical problems */ if ((option < 1) || (option > 9)) return 0; RETURN_IF_FAIL ( sanei_hp_scl_upload_binary (scsi, SCL_CALIB_MAP, &calib_size, &calib_buf) ); @@ -2837,7 +2832,7 @@ _enable_calibrate (HpOption __sane_unused__ this, HpOptSet optset, HpData data, { HpOption media = hp_optset_get(optset, MEDIA); - /* If we dont have the media button, we should have calibrate */ + /* If we don't have the media button, we should have calibrate */ if ( !media ) return 1; return hp_option_getint(media, data) == HP_MEDIA_PRINT; diff --git a/backend/hp-option.h b/backend/hp-option.h index a6da585..74fa333 100644 --- a/backend/hp-option.h +++ b/backend/hp-option.h @@ -13,9 +13,7 @@ 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. + along with this program. If not, see . As a special exception, the authors of SANE give permission for additional uses of the libraries contained in this release of SANE. @@ -42,9 +40,6 @@ HP Scanner Control Language (SCL). */ -/* - $Id$ -*/ #ifndef HP_OPTION_H_INCLUDED #define HP_OPTION_H_INCLUDED #include "hp.h" diff --git a/backend/hp-scl.c b/backend/hp-scl.c index fae7f97..37a01e8 100644 --- a/backend/hp-scl.c +++ b/backend/hp-scl.c @@ -13,9 +13,7 @@ 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. + along with this program. If not, see . As a special exception, the authors of SANE give permission for additional uses of the libraries contained in this release of SANE. @@ -43,7 +41,6 @@ */ /* - $Log$ Revision 1.15 2008/03/28 14:37:36 kitno-guest add usleep to improve usb performance, from jim a t meyering d o t net @@ -56,8 +53,6 @@ Revision 1.12 2003/10/09 19:34:57 kig-guest Redo when TEST UNIT READY failed Redo when read returns with 0 bytes (non-SCSI only) - - */ /* @@ -1083,7 +1078,7 @@ is_lowbyte_first_byteorder (void) /* The SANE standard defines that 2-byte data must use the full 16 bit range. * Byte order returned by the backend must be native byte order. - * Scaling to 16 bit and byte order is achived by hp_scale_to_16bit. + * Scaling to 16 bit and byte order is achieved by hp_scale_to_16bit. * for >8 bits data, take the two data bytes and scale their content * to the full 16 bit range, using * scaled = unscaled << (newlen - oldlen) + diff --git a/backend/hp-scl.h b/backend/hp-scl.h index 7954492..a842360 100644 --- a/backend/hp-scl.h +++ b/backend/hp-scl.h @@ -13,9 +13,7 @@ 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. + along with this program. If not, see . As a special exception, the authors of SANE give permission for additional uses of the libraries contained in this release of SANE. diff --git a/backend/hp-scsi.h b/backend/hp-scsi.h index 0e12185..2bf9d00 100644 --- a/backend/hp-scsi.h +++ b/backend/hp-scsi.h @@ -13,9 +13,7 @@ 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. + along with this program. If not, see . As a special exception, the authors of SANE give permission for additional uses of the libraries contained in this release of SANE. diff --git a/backend/hp.README b/backend/hp.README index 0727221..b5357fd 100644 --- a/backend/hp.README +++ b/backend/hp.README @@ -49,13 +49,13 @@ to xhp just to get a better acceptance. Uses SCSI-flushing more often because otherwise the scanner did not accept all of the commands. - Test support of commands to be independant from inquired + Test support of commands to be independent 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 -licence informations to the files as long as noone has to pay for the code. +licence information to the files as long as no one has to pay for the code. Sun Jun 07 15:00:00 UT+1 1998 diff --git a/backend/hp.TODO b/backend/hp.TODO index b9c1fd2..520bcab 100644 --- a/backend/hp.TODO +++ b/backend/hp.TODO @@ -31,7 +31,7 @@ These are Geoffreys TODOs: * * check return values (of maybe others)? * get rid of overly verbose DBG's - * add som DBG's + * add some DBG's */ New TODOs: diff --git a/backend/hp.c b/backend/hp.c index f6a3637..2358d1f 100644 --- a/backend/hp.c +++ b/backend/hp.c @@ -14,9 +14,7 @@ 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. + along with this program. If not, see . As a special exception, the authors of SANE give permission for additional uses of the libraries contained in this release of SANE. @@ -44,11 +42,9 @@ */ static char *hp_backend_version = "1.06"; -static char *hp_backend_revision = "$Revision$"; /* Changes: V 1.06: - $Log$ Revision 1.22 2008/11/26 21:21:25 kitno-guest * backend/ *.[ch]: nearly every backend used V_MAJOR instead of SANE_CURRENT_MAJOR in sane_init() @@ -69,7 +65,7 @@ static char *hp_backend_revision = "$Revision$"; Revision 1.18 2003/10/09 19:37:29 kig-guest Redo when TEST UNIT READY failed Redo when read returns with 0 bytes (non-SCSI only) - Bug #300241: fix invers image on 3c/4c/6100C at 10 bit depth + Bug #300241: fix inverse image on 3c/4c/6100C at 10 bit depth Revision 1.17 2003/10/06 19:54:07 kig-guest Bug #300248: correct "Negatives" to "Negative" in option description @@ -132,7 +128,7 @@ static char *hp_backend_revision = "$Revision$"; - remove inlines V 0.88, 20-Jul-2000, PK: - Use sanei_config_read() - - dont write chars < 32 to DBG + - don't write chars < 32 to DBG V 0.88, 09-Jul-2000, PK: - Add front button support by Chris S. Cowles, Houston, Texas, c_cowles@ieee.org @@ -146,7 +142,7 @@ static char *hp_backend_revision = "$Revision$"; (Jens Heise, ) - add option enable-image-buffering V 0.85, 30-Jan-2000, PK: - - correct and enhace data widths > 8 (Ewald de Wit ) + - correct and enhance data widths > 8 (Ewald de Wit ) - enable data width for all scanners - PhotoSmart: exposure "Off" changed to "Default" - PhotoSmart: even if max. datawidth 24 is reported, allow 30 bits. @@ -654,8 +650,8 @@ hp_read_config (void) is_df_config = 1; cu_device[0] = '\0'; - DBG(1, "hp_read_config: hp backend v%s/%s starts reading config file\n", - hp_backend_version, hp_backend_revision); + DBG(1, "hp_read_config: hp backend v%s starts reading config file\n", + hp_backend_version); if ((fp = sanei_config_open(HP_CONFIG_FILE)) != 0) { diff --git a/backend/hp.h b/backend/hp.h index 42b3be5..81ec962 100644 --- a/backend/hp.h +++ b/backend/hp.h @@ -13,9 +13,7 @@ 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. + along with this program. If not, see . As a special exception, the authors of SANE give permission for additional uses of the libraries contained in this release of SANE. diff --git a/backend/hp3500.c b/backend/hp3500.c index fc2c6b5..b7a2d59 100644 --- a/backend/hp3500.c +++ b/backend/hp3500.c @@ -13,9 +13,7 @@ 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. + along with this program. If not, see . As a special exception, the authors of SANE give permission for additional uses of the libraries contained in this release of SANE. @@ -332,7 +330,7 @@ sane_get_devices (const SANE_Device *** device_list, SANE_Bool local_only) /** * Called to establish connection with the scanner. This function will - * also establish meaningful defauls and initialize the options. + * also establish meaningful defaults and initialize the options. * * From the SANE spec: * This function is used to establish a connection to a particular @@ -873,7 +871,7 @@ sane_read (SANE_Handle handle, SANE_Byte * buf, * handle h is a valid handle) but usually affects long-running * operations only (such as image is acquisition). It is safe to call * this function asynchronously (e.g., from within a signal handler). - * It is important to note that completion of this operaton does not + * It is important to note that completion of this operation does not * imply that the currently pending operation has been cancelled. It * only guarantees that cancellation has been initiated. Cancellation * completes only when the cancelled call returns (typically with a @@ -1290,7 +1288,7 @@ rt_queue_command (int command, unsigned char *buffer; unsigned char const *data = data_; - /* We add "bytes" here to account for the possiblity that all of the + /* We add "bytes" here to account for the possibility that all of the * data bytes are 0xaa and hence require a following 0x00 byte. */ if (command_bytes_outstanding + len + bytes > MAX_COMMANDS_BYTES || diff --git a/backend/hp3900.c b/backend/hp3900.c index 46ec673..134bbd9 100644 --- a/backend/hp3900.c +++ b/backend/hp3900.c @@ -15,8 +15,7 @@ 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. + along with this program. If not, see . As a special exception, the authors of SANE give permission for additional uses of the libraries contained in this release of SANE. diff --git a/backend/hp3900_config.c b/backend/hp3900_config.c index dba5302..daeb583 100644 --- a/backend/hp3900_config.c +++ b/backend/hp3900_config.c @@ -15,8 +15,7 @@ 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. + along with this program. If not, see . As a special exception, the authors of SANE give permission for additional uses of the libraries contained in this release of SANE. @@ -52,7 +51,7 @@ static SANE_Int cfg_chipset_model_get(SANE_Int device); /* buttons for each scanner */ static SANE_Int cfg_buttons_get(struct st_buttons *reg); -/* area constrains for each scanner */ +/* area constraints for each scanner */ static SANE_Int cfg_constrains_get(struct st_constrains *constrain); /* spectrum clock generator for each scanner */ @@ -989,7 +988,7 @@ static void cfg_offset_get(SANE_Int sensortype, SANE_Int resolution, SANE_Int sc } } -/** SEC: Device constrains ---------- */ +/** SEC: Device constraints ---------- */ static SANE_Int cfg_constrains_get(struct st_constrains *constrain) { @@ -1003,7 +1002,7 @@ static SANE_Int cfg_constrains_get(struct st_constrains *constrain) struct st_reg reg[] = { - /* constrains are set in milimeters */ + /* constraints are set in millimeters */ /*device , reflective , negative , transparent */ /* , {{left, width, top, height}, {left, width, top, height}, {left, width, top, height}}}, */ { BQ5550 , {{ 0, 220, 0, 300}, { 88, 42, 0, 83}, { 88, 42, 0, 83}}}, diff --git a/backend/hp3900_debug.c b/backend/hp3900_debug.c index 7b21c8d..25254db 100644 --- a/backend/hp3900_debug.c +++ b/backend/hp3900_debug.c @@ -15,8 +15,7 @@ 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. + along with this program. If not, see . As a special exception, the authors of SANE give permission for additional uses of the libraries contained in this release of SANE. @@ -1421,7 +1420,7 @@ dbg_registers (SANE_Byte * buffer) DBG(DBG_FNC, " bit[0..3] = %02x : Scanner buttons ", iValue & 0x0f); if ((iValue & 0x0f) == 0x0f) DBG(DBG_FNC, "enabled\n"); - else DBG(DBG_FNC, "dissabled\n"); + else DBG(DBG_FNC, "disabled\n"); DBG(DBG_FNC, " bit[4..7] = ? : 0x%02x\n", (iValue >> 4) & 0x0f); dbg_buffer(DBG_FNC, "\n0x0159", &buffer[0x159], 11, 0x159); diff --git a/backend/hp3900_rts8822.c b/backend/hp3900_rts8822.c index d76763d..c818b89 100644 --- a/backend/hp3900_rts8822.c +++ b/backend/hp3900_rts8822.c @@ -15,8 +15,7 @@ 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. + along with this program. If not, see . As a special exception, the authors of SANE give permission for additional uses of the libraries contained in this release of SANE. @@ -555,11 +554,11 @@ static void Split_into_12bit_channels (SANE_Byte * destino, static SANE_Int Scan_Read_BufferA (struct st_device *dev, SANE_Int buffer_size, SANE_Int arg2, SANE_Byte * pBuffer, - SANE_Int * bytes_transfered); + SANE_Int * bytes_transferred); static SANE_Int Bulk_Operation (struct st_device *dev, SANE_Byte op, SANE_Int buffer_size, SANE_Byte * buffer, - SANE_Int * transfered); + SANE_Int * transferred); static SANE_Int Get_PAG_Value (SANE_Byte scantype, SANE_Byte color); static SANE_Int GetOneLineInfo (struct st_device *dev, SANE_Int resolution, SANE_Int * maximus, SANE_Int * minimus, @@ -909,7 +908,7 @@ Motor_Curve_Parse (SANE_Int * mtc_count, SANE_Int * buffer) if (*buffer == -2) { /* end of motorcurve */ - /* complete any openned phase */ + /* complete any opened phase */ /* close phase */ phase = -1; } @@ -1597,7 +1596,7 @@ RTS_Scanner_SetParams (struct st_device *dev, struct params *param) data_bitset (&dev->init_regs[0x146], 0x40, ((dev->sensorcfg->type == CIS_SENSOR) ? 0 : 1)); - /* turn on appropiate lamp */ + /* turn on appropriate lamp */ if (scan.scantype == ST_NORMAL) Lamp_Status_Set (dev, NULL, TRUE, FLB_LAMP); else @@ -2729,7 +2728,7 @@ Motor_Move (struct st_device *dev, SANE_Byte * Regs, /* unknown data */ data_bitset (&cpRegs[0x1cf], 0x80, 1); /*x------- */ - /* sets one chanel per color */ + /* sets one channel per color */ data_bitset (&cpRegs[0x12], 0x3f, 0); /* channel */ data_bitset (&cpRegs[0x12], 0xc0, 1); /* 1 channel */ @@ -2924,7 +2923,7 @@ Load_MotorCurves (struct st_device *dev) DBG (DBG_FNC, "> Load_MotorCurves\n"); - /* get motor setttings buffer for this device */ + /* get motor settings buffer for this device */ mtc = cfg_motorcurve_get (); if (mtc != NULL) { @@ -4342,7 +4341,7 @@ RTS_DMA_Write (struct st_device *dev, SANE_Int dmacs, SANE_Int options, } else { - /* for some reason it's not posible to allocate space to check + /* for some reason it's not possible to allocate space to check sent buffer so we just write data */ Bulk_Operation (dev, BLK_WRITE, size, buffer, &transferred); rst = OK; @@ -4401,7 +4400,7 @@ RTS_DMA_CheckType (struct st_device *dev, SANE_Byte * Regs) if (RTS_DMA_SetType (dev, Regs, a) != OK) break; - /* wait 1500 miliseconds */ + /* wait 1500 milliseconds */ if (RTS_DMA_WaitReady (dev, 1500) == OK) { /* reset dma */ @@ -7693,7 +7692,7 @@ arrangeline2 = 1 static SANE_Int Scan_Read_BufferA (struct st_device *dev, SANE_Int buffer_size, SANE_Int arg2, - SANE_Byte * pBuffer, SANE_Int * bytes_transfered) + SANE_Byte * pBuffer, SANE_Int * bytes_transferred) { SANE_Int rst = OK; SANE_Byte *ptBuffer = NULL; @@ -7701,11 +7700,11 @@ Scan_Read_BufferA (struct st_device *dev, SANE_Int buffer_size, SANE_Int arg2, struct st_readimage *rd = dev->Reading; DBG (DBG_FNC, - "+ Scan_Read_BufferA(buffer_size=%i, arg2, *pBuffer, *bytes_transfered):\n", + "+ Scan_Read_BufferA(buffer_size=%i, arg2, *pBuffer, *bytes_transferred):\n", buffer_size); arg2 = arg2; /* silence gcc */ - *bytes_transfered = 0; + *bytes_transferred = 0; if (pBuffer != NULL) { @@ -7841,7 +7840,7 @@ Scan_Read_BufferA (struct st_device *dev, SANE_Int buffer_size, SANE_Int arg2, } else { - *bytes_transfered += iAmount; + *bytes_transferred += iAmount; buffer_size -= iAmount; } @@ -7867,7 +7866,7 @@ Scan_Read_BufferA (struct st_device *dev, SANE_Int buffer_size, SANE_Int arg2, /* is there any data read from scanner? */ if (rd->RDSize > 0) { - /* Add to the given buffer so many bytes as posible */ + /* Add to the given buffer as many bytes as possible */ SANE_Int iAmount; iAmount = min (buffer_size, rd->RDSize); @@ -7889,16 +7888,16 @@ Scan_Read_BufferA (struct st_device *dev, SANE_Int buffer_size, SANE_Int arg2, ptBuffer += iAmount; rd->RDSize -= iAmount; buffer_size -= iAmount; - *bytes_transfered += iAmount; + *bytes_transferred += iAmount; /* if there isn't any data in DMABuffer we can point RDStart - to the begining of DMABuffer */ + to the beginning of DMABuffer */ if (rd->RDSize == 0) rd->RDStart = rd->DMABuffer; } - /* in case of all data is read we return OK with bytes_transfered = 0 */ - if ((*bytes_transfered == 0) + /* in case of all data is read we return OK with bytes_transferred = 0 */ + if ((*bytes_transferred == 0) || ((rd->RDSize == 0) && (rd->ImageSize == 0))) break; } @@ -7907,7 +7906,7 @@ Scan_Read_BufferA (struct st_device *dev, SANE_Int buffer_size, SANE_Int arg2, RTS_DMA_Cancel (dev); } - DBG (DBG_FNC, "-> *bytes_transfered=%i\n", *bytes_transfered); + DBG (DBG_FNC, "-> *bytes_transferred=%i\n", *bytes_transferred); DBG (DBG_FNC, "-> Reading->ImageSize=%i\n", rd->ImageSize); DBG (DBG_FNC, "-> Reading->DMAAmount=%i\n", rd->DMAAmount); DBG (DBG_FNC, "-> Reading->RDSize =%i\n", rd->RDSize); @@ -7921,7 +7920,7 @@ static SANE_Int Reading_BufferSize_Get (struct st_device *dev, SANE_Byte channels_per_dot, SANE_Int channel_size) { - /* returns the ammount of bytes in scanner's buffer ready to be read */ + /* returns the amount of bytes in scanner's buffer ready to be read */ SANE_Int rst; @@ -10039,7 +10038,7 @@ Shading_apply (struct st_device *dev, SANE_Byte * Regs, static SANE_Int Bulk_Operation (struct st_device *dev, SANE_Byte op, SANE_Int buffer_size, - SANE_Byte * buffer, SANE_Int * transfered) + SANE_Byte * buffer, SANE_Int * transferred) { SANE_Int iTransferSize, iBytesToTransfer, iPos, rst, iBytesTransfered; @@ -10051,8 +10050,8 @@ Bulk_Operation (struct st_device *dev, SANE_Byte op, SANE_Int buffer_size, rst = OK; iBytesTransfered = 0; - if (transfered != NULL) - *transfered = 0; + if (transferred != NULL) + *transferred = 0; iTransferSize = min (buffer_size, RTS_Debug->dmatransfersize); @@ -10072,8 +10071,8 @@ Bulk_Operation (struct st_device *dev, SANE_Byte op, SANE_Int buffer_size, } else { - if (transfered != NULL) - *transfered += iBytesTransfered; + if (transferred != NULL) + *transferred += iBytesTransfered; } iPos += iTransferSize; iBytesToTransfer -= iTransferSize; @@ -10095,8 +10094,8 @@ Bulk_Operation (struct st_device *dev, SANE_Byte op, SANE_Int buffer_size, } else { - if (transfered != NULL) - *transfered += iTransferSize; + if (transferred != NULL) + *transferred += iTransferSize; } iPos += iTransferSize; iBytesToTransfer -= iTransferSize; @@ -10763,7 +10762,7 @@ Lamp_Status_Set (struct st_device *dev, SANE_Byte * Regs, SANE_Int turn_on, switch (dev->chipset->model) { case RTS8822BL_03A: - /* register 0xe946 has 2 bits and each one referres one lamp + /* register 0xe946 has 2 bits and each one refers one lamp 0x40: FLB_LAMP | 0x20 : TMA_LAMP if both were enabled both lamps would be switched on */ data_bitset (&Regs[0x146], 0x20, ((lamp == TMA_LAMP) && (turn_on == TRUE)) ? 1 : 0); /* TMA */ @@ -14005,7 +14004,7 @@ Free_Constrains (struct st_device *dev) static void RTS_DebugInit () { - /* Default vaules */ + /* Default values */ RTS_Debug->dev_model = HP3970; RTS_Debug->DumpShadingData = FALSE; @@ -14428,7 +14427,7 @@ WShading_Emulate (SANE_Byte * buffer, SANE_Int * chnptr, SANE_Int size, /* get channel color */ chncolor = data_lsb_get (buffer + pos, chnsize); - /* apply shading coeficient */ + /* apply shading coefficient */ chncolor *= wshading->rates[*chnptr]; /* care about limits */ diff --git a/backend/hp3900_sane.c b/backend/hp3900_sane.c index f8ed139..c717d4d 100644 --- a/backend/hp3900_sane.c +++ b/backend/hp3900_sane.c @@ -14,8 +14,7 @@ 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. + along with this program. If not, see . As a special exception, the authors of SANE give permission for additional uses of the libraries contained in this release of SANE. @@ -157,7 +156,7 @@ typedef struct SANE_Int rest_amount; SANE_Int mylin; - /* convertion settings */ + /* conversion settings */ struct st_convert cnv; /* ranges */ @@ -188,7 +187,7 @@ static SANE_Status bknd_models (TScanner * scanner); static SANE_Status bknd_resolutions (TScanner * scanner, SANE_Int model); static SANE_Status bknd_sources (TScanner * scanner, SANE_Int model); -/* convertions */ +/* conversions */ static void Color_Negative (SANE_Byte * buffer, SANE_Int size, SANE_Int depth); static void Color_to_Gray (SANE_Byte * buffer, SANE_Int size, SANE_Int depth); @@ -894,7 +893,7 @@ gamma_create (TScanner * s, double gamma) /* default result */ rst = OK; - /* destroy previus gamma tables */ + /* destroy previous gamma tables */ gamma_free (s); /* check gamma value */ @@ -1161,7 +1160,7 @@ options_init (TScanner * scanner) /* set gamma */ gamma_create (scanner, 1.0); - /* color convertion */ + /* color conversion */ scanner->cnv.colormode = -1; scanner->cnv.negative = FALSE; scanner->cnv.threshold = 40; @@ -1178,12 +1177,12 @@ options_init (TScanner * scanner) scanner->rng_gamma.max = 65535; scanner->rng_gamma.quant = 0; - /* setting default horizontal constrain in milimeters */ + /* setting default horizontal constraint in millimeters */ scanner->rng_horizontal.min = 0; scanner->rng_horizontal.max = 220; scanner->rng_horizontal.quant = 1; - /* setting default vertical constrain in milimeters */ + /* setting default vertical constraint in millimeters */ scanner->rng_vertical.min = 0; scanner->rng_vertical.max = 300; scanner->rng_vertical.quant = 1; @@ -2261,7 +2260,7 @@ sane_get_parameters (SANE_Handle h, SANE_Parameters * p) /* resolution */ res = s->aValues[opt_resolution].w; - /* image coordinates in milimeters */ + /* image coordinates in millimeters */ coords.left = s->aValues[opt_tlx].w; coords.top = s->aValues[opt_tly].w; coords.width = s->aValues[opt_brx].w; @@ -2384,7 +2383,7 @@ sane_start (SANE_Handle h) RTS_Debug->SaveCalibFile = (s->aValues[opt_dbgimages].w == SANE_TRUE) ? TRUE : FALSE; - /* Get image coordinates in milimeters */ + /* Get image coordinates in millimeters */ coords.left = s->aValues[opt_tlx].w; coords.top = s->aValues[opt_tly].w; coords.width = s->aValues[opt_brx].w; @@ -2583,7 +2582,7 @@ sane_read (SANE_Handle h, SANE_Byte * buf, SANE_Int maxlen, SANE_Int * len) buf : will contain postprocessed image len : will contain size in bytes of postprocessed image */ - /* apply gamma if neccesary */ + /* apply gamma if necessary */ if (RTS_Debug->EnableGamma == TRUE) gamma_apply (s, buffer, emul_len, s->ScanParams.depth); @@ -2623,7 +2622,7 @@ sane_read (SANE_Handle h, SANE_Byte * buf, SANE_Int maxlen, SANE_Int * len) { /* I didn't see any scanner supporting lineart mode. Windows drivers scan in grayscale and then convert image to lineart - so let's perform convertion */ + so let's perform conversion */ SANE_Int rest = emul_len % 8; Gray_to_Lineart (buffer, emul_len, s->cnv.threshold); @@ -2691,7 +2690,7 @@ sane_close (SANE_Handle h) DBG (DBG_FNC, "- sane_close...\n"); - /* stop previus scans */ + /* stop previous scans */ RTS_Scanner_StopScan (device, TRUE); /* close usb */ @@ -2700,7 +2699,7 @@ sane_close (SANE_Handle h) /* free scanner internal variables */ RTS_Scanner_End (device); - /* free RTS enviroment */ + /* free RTS environment */ RTS_Free (device); /* free backend variables */ diff --git a/backend/hp3900_types.c b/backend/hp3900_types.c index 4a1f7e9..bcfe087 100644 --- a/backend/hp3900_types.c +++ b/backend/hp3900_types.c @@ -15,8 +15,7 @@ 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. + along with this program. If not, see . As a special exception, the authors of SANE give permission for additional uses of the libraries contained in this release of SANE. diff --git a/backend/hp3900_usb.c b/backend/hp3900_usb.c index 99623b4..3900449 100644 --- a/backend/hp3900_usb.c +++ b/backend/hp3900_usb.c @@ -15,8 +15,7 @@ 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. + along with this program. If not, see . As a special exception, the authors of SANE give permission for additional uses of the libraries contained in this release of SANE. diff --git a/backend/hp4200.c b/backend/hp4200.c index d4d4f64..c080fcb 100644 --- a/backend/hp4200.c +++ b/backend/hp4200.c @@ -12,8 +12,7 @@ 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. + along with this program. If not, see . */ /* Developers: diff --git a/backend/hp4200.h b/backend/hp4200.h index 1547847..e13724e 100644 --- a/backend/hp4200.h +++ b/backend/hp4200.h @@ -12,8 +12,7 @@ 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. + along with this program. If not, see . */ #ifndef _HP4200_H diff --git a/backend/hp4200_lm9830.c b/backend/hp4200_lm9830.c index f2d9475..ae2466d 100644 --- a/backend/hp4200_lm9830.c +++ b/backend/hp4200_lm9830.c @@ -15,9 +15,7 @@ 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. + along with this program. If not, see . As a special exception, the authors of SANE give permission for additional uses of the libraries contained in this release of SANE. diff --git a/backend/hp4200_lm9830.h b/backend/hp4200_lm9830.h index 4cf44eb..769baea 100644 --- a/backend/hp4200_lm9830.h +++ b/backend/hp4200_lm9830.h @@ -15,9 +15,7 @@ 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. + along with this program. If not, see . As a special exception, the authors of SANE give permission for additional uses of the libraries contained in this release of SANE. diff --git a/backend/hp5400.c b/backend/hp5400.c index 58d01f8..1787b01 100644 --- a/backend/hp5400.c +++ b/backend/hp5400.c @@ -20,8 +20,7 @@ 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. + along with this program. If not, see . As a special exception, the authors of SANE give permission for additional uses of the libraries contained in this release of SANE. diff --git a/backend/hp5400.h b/backend/hp5400.h index 78244e0..88cb084 100644 --- a/backend/hp5400.h +++ b/backend/hp5400.h @@ -20,8 +20,7 @@ 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. + along with this program. If not, see . As a special exception, the authors of SANE give permission for additional uses of the libraries contained in this release of SANE. @@ -43,8 +42,6 @@ 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. - - $Id$ */ @@ -112,7 +109,7 @@ THWParams; /* The scanner needs a Base DPI off which all it's calibration and * offset/size parameters are based. For the time being this is the same as - * the iDpi but maybe we want it seperate. This is because while this field + * the iDpi but maybe we want it separate. This is because while this field * would have limited values (300,600,1200,2400) the x/y dpi can vary. The * windows interface seems to allow 200dpi (though I've never tried it). We * need to decide how these values are related to the HW coordinates. */ diff --git a/backend/hp5400_debug.c b/backend/hp5400_debug.c index ad2e4fb..8795cf3 100644 --- a/backend/hp5400_debug.c +++ b/backend/hp5400_debug.c @@ -19,8 +19,7 @@ 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. + along with this program. If not, see . As a special exception, the authors of SANE give permission for additional uses of the libraries contained in this release of SANE. diff --git a/backend/hp5400_debug.h b/backend/hp5400_debug.h index c743045..df094ea 100644 --- a/backend/hp5400_debug.h +++ b/backend/hp5400_debug.h @@ -22,8 +22,7 @@ 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. + along with this program. If not, see . As a special exception, the authors of SANE give permission for additional uses of the libraries contained in this release of SANE. diff --git a/backend/hp5400_internal.c b/backend/hp5400_internal.c index 1d81358..322359a 100644 --- a/backend/hp5400_internal.c +++ b/backend/hp5400_internal.c @@ -21,8 +21,7 @@ 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. + along with this program. If not, see . As a special exception, the authors of SANE give permission for additional uses of the libraries contained in this release of SANE. @@ -385,7 +384,7 @@ SetCalibration (int iHandle, int numPixels, unsigned int *low_vals[3], i = j / numLoop; /* This is obviously not quite right. The values on - * the right are approximatly what windows sends */ + * the right are approximately what windows sends */ k = (high_vals[0][i] > 0x4000) ? 1000000000 / high_vals[0][i] : 0; /* 0x6700 */ pixel->highr[0] = k; pixel->highr[1] = k >> 8; @@ -781,7 +780,7 @@ DoAverageScan (int iHandle, struct ScanRequest *req, int code, HWParams.iXferHandle = iHandle; if (InitScan2 (SCAN_TYPE_CALIBRATION, req, &HWParams, &res, 0, code) != 0) - return -1; /* No colour offseting, we want raw */ + return -1; /* No colour offsetting, we want raw */ length = htonl (res.xsize) / 6; @@ -1204,7 +1203,7 @@ InitScan2 (enum ScanType scantype, struct ScanRequest *req, /* Protect scanner from damage. This stops stpuid errors. It basically * limits you to the scanner glass. Stuff like calibrations which need - * more access do it safely by fiddling other paramters. Note you can + * more access do it safely by fiddling other parameters. Note you can * still break things by fiddling the ScanOffset, but that is not yet * under user control */ diff --git a/backend/hp5400_internal.h b/backend/hp5400_internal.h index aa40da0..28bde28 100644 --- a/backend/hp5400_internal.h +++ b/backend/hp5400_internal.h @@ -20,9 +20,7 @@ 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. + along with this program. If not, see . As a special exception, the authors of SANE give permission for additional uses of the libraries contained in this release of SANE. @@ -112,7 +110,7 @@ struct ScanRequest */ uint8_t zero; /* Seems to always be zero */ uint16_t gamma[3]; /* Set to 100 in network order. Gamma? */ - uint16_t pad[3]; /* Zero padding ot 32 bytes??? */ + uint16_t pad[3]; /* Zero padding to 32 bytes??? */ } PACKED; @@ -154,7 +152,7 @@ PACKED; * what we wish change and SET it back otherwise goodness knows what evil * we will unleash. * - * Note that for setting, different values in the buffer seem to apply betwen the copy count + * Note that for setting, different values in the buffer seem to apply between the copy count * and the colour/BW switch setting. I don't know what that means at the moment. * * I'm calling it PanelInfo because I can't think of anything better. diff --git a/backend/hp5400_sane.c b/backend/hp5400_sane.c index b6fa6da..8413568 100644 --- a/backend/hp5400_sane.c +++ b/backend/hp5400_sane.c @@ -20,8 +20,7 @@ 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. + along with this program. If not, see . As a special exception, the authors of SANE give permission for additional uses of the libraries contained in this release of SANE. diff --git a/backend/hp5400_sanei.c b/backend/hp5400_sanei.c index 10c90ef..3d13940 100644 --- a/backend/hp5400_sanei.c +++ b/backend/hp5400_sanei.c @@ -20,8 +20,7 @@ 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. + along with this program. If not, see . As a special exception, the authors of SANE give permission for additional uses of the libraries contained in this release of SANE. diff --git a/backend/hp5400_sanei.h b/backend/hp5400_sanei.h index 3c8e337..058ad22 100644 --- a/backend/hp5400_sanei.h +++ b/backend/hp5400_sanei.h @@ -23,8 +23,7 @@ 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. + along with this program. If not, see . As a special exception, the authors of SANE give permission for additional uses of the libraries contained in this release of SANE. diff --git a/backend/hp5400_xfer.h b/backend/hp5400_xfer.h index b3a1cc6..e52813a 100644 --- a/backend/hp5400_xfer.h +++ b/backend/hp5400_xfer.h @@ -22,8 +22,7 @@ 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. + along with this program. If not, see . As a special exception, the authors of SANE give permission for additional uses of the libraries contained in this release of SANE. diff --git a/backend/hp5590.c b/backend/hp5590.c index b206406..1c164e4 100644 --- a/backend/hp5590.c +++ b/backend/hp5590.c @@ -16,9 +16,7 @@ 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. + along with this program. If not, see . As a special exception, the authors of SANE give permission for additional uses of the libraries contained in this release of SANE. diff --git a/backend/hp5590_cmds.c b/backend/hp5590_cmds.c index 1eb96d3..495daef 100644 --- a/backend/hp5590_cmds.c +++ b/backend/hp5590_cmds.c @@ -16,9 +16,7 @@ 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. + along with this program. If not, see . As a special exception, the authors of SANE give permission for additional uses of the libraries contained in this release of SANE. diff --git a/backend/hp5590_cmds.h b/backend/hp5590_cmds.h index 7179853..6d74464 100644 --- a/backend/hp5590_cmds.h +++ b/backend/hp5590_cmds.h @@ -14,9 +14,7 @@ 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. + along with this program. If not, see . As a special exception, the authors of SANE give permission for additional uses of the libraries contained in this release of SANE. diff --git a/backend/hp5590_low.c b/backend/hp5590_low.c index 4936c58..29e2136 100644 --- a/backend/hp5590_low.c +++ b/backend/hp5590_low.c @@ -13,9 +13,7 @@ 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. + along with this program. If not, see . As a special exception, the authors of SANE give permission for additional uses of the libraries contained in this release of SANE. diff --git a/backend/hp5590_low.h b/backend/hp5590_low.h index 4882860..41f3615 100644 --- a/backend/hp5590_low.h +++ b/backend/hp5590_low.h @@ -13,9 +13,7 @@ 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. + along with this program. If not, see . As a special exception, the authors of SANE give permission for additional uses of the libraries contained in this release of SANE. diff --git a/backend/hpljm1005.c b/backend/hpljm1005.c index be3b8f4..95ddd8e 100644 --- a/backend/hpljm1005.c +++ b/backend/hpljm1005.c @@ -15,9 +15,7 @@ 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. + along with this program. If not, see . As a special exception, the authors of SANE give permission for additional uses of the libraries contained in this release of SANE. @@ -181,7 +179,7 @@ static int devlist_count; /* Number of element in the list */ */ static SANE_Device **devlist = NULL; -/* round() is c99, so we provide our own, though this version wont return -0 */ +/* round() is c99, so we provide our own, though this version won't return -0 */ static double round2(double x) { diff --git a/backend/hpsj5s.c b/backend/hpsj5s.c index 77fcc46..ea58433 100644 --- a/backend/hpsj5s.c +++ b/backend/hpsj5s.c @@ -13,9 +13,7 @@ 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. + along with this program. If not, see . As a special exception, the authors of SANE give permission for additional uses of the libraries contained in this release of SANE. @@ -106,7 +104,7 @@ static SANE_Option_Descriptor sod[] = { {NULL} /*No constraints required */ } , - { /*Width of scaned area */ + { /*Width of scanned area */ "width", "Width", "Width of area to scan", @@ -115,7 +113,7 @@ static SANE_Option_Descriptor sod[] = { sizeof (SANE_Word), SANE_CAP_SOFT_SELECT | SANE_CAP_SOFT_DETECT, SANE_CONSTRAINT_RANGE, - {NULL} /*Range constrain setted in sane_init */ + {NULL} /*Range constraint set in sane_init */ } , { /*Resolution for scan */ @@ -127,13 +125,13 @@ static SANE_Option_Descriptor sod[] = { sizeof (SANE_Word), SANE_CAP_SOFT_SELECT | SANE_CAP_SOFT_DETECT, SANE_CONSTRAINT_WORD_LIST, - {NULL} /*Word list constrain setted in sane_init */ + {NULL} /*Word list constraint set in sane_init */ } }; static SANE_Parameters parms; -/*Recalculate Lenght in dependace of resolution*/ +/*Recalculate Length in dependence of resolution*/ static SANE_Word LengthForRes (SANE_Word Resolution, SANE_Word Length) { @@ -223,7 +221,7 @@ sane_exit (void) scanner_d = -1; } - /*Free alocated ports information: */ + /*Free allocated ports information: */ ieee1284_free_ports (&pl); DBG (2, "sane_exit\n"); @@ -386,7 +384,7 @@ sane_control_option (SANE_Handle handle, SANE_Int option, case SANE_ACTION_GET_VALUE: *((SANE_Word *) value) = wWidth; return SANE_STATUS_GOOD; - case SANE_ACTION_SET_VALUE: /*info should be setted */ + case SANE_ACTION_SET_VALUE: /*info should be set */ wWidth = *((SANE_Word *) value); if (info != NULL) *info = SANE_INFO_RELOAD_PARAMS; @@ -400,7 +398,7 @@ sane_control_option (SANE_Handle handle, SANE_Int option, case SANE_ACTION_GET_VALUE: *((SANE_Word *) value) = wResolution; return SANE_STATUS_GOOD; - case SANE_ACTION_SET_VALUE: /*info should be setted */ + case SANE_ACTION_SET_VALUE: /*info should be set */ wResolution = *((SANE_Word *) value); if (info != NULL) *info = 0; @@ -455,7 +453,7 @@ sane_start (SANE_Handle handle) bCalibration = GetCalibration (); if (bLastCalibration - bCalibration > 16) - { /*Lamp is not warm enouth */ + { /*Lamp is not warm enough */ DBG (1, "sane_start: warming lamp for 30 sec.\n"); for (i = 0; i < 30; i++) sleep (1); @@ -472,7 +470,7 @@ sane_start (SANE_Handle handle) /*Turn on indicator and prepare engine. */ SwitchHardwareState (FLAGS_HW_INDICATOR_OFF | FLAGS_HW_MOTOR_READY, 1); /*Feed paper */ - if (PaperFeed (LINES_TO_FEED) == 0) /*Feed only for fixel lenght. Change it */ + if (PaperFeed (LINES_TO_FEED) == 0) /*Feed only for fixel length. Change it */ { DBG (1, "sane_start: paper feed failed."); SwitchHardwareState (FLAGS_HW_INDICATOR_OFF | FLAGS_HW_MOTOR_READY, 0); @@ -512,7 +510,7 @@ sane_read (SANE_Handle handle, SANE_Byte * data, } /*While end of paper sheet was not reached */ - /*Wait for scaned line ready */ + /*Wait for scanned line ready */ timeout = 0; while (((bFuncResult = CallFunctionWithRetVal (0xB2)) & 0x20) == 0) { @@ -794,7 +792,7 @@ TransferScanParameters (enumColorDepth enColor, SANE_Word wResolution, break; case GrayScale: case TrueColor: - CallFunctionWithParameter (0x90, 0); /*Not suppoted correctly. FIX ME!!! */ + CallFunctionWithParameter (0x90, 0); /*Not supported correctly. FIX ME!!! */ break; }; CallFunctionWithParameter (0xA1, 2); @@ -882,7 +880,7 @@ TurnOffPaperPulling () } /* - Returns avarage value of scaned row. + Returns average value of scanned row. While paper not loaded this is base "white point". */ static SANE_Byte @@ -1140,7 +1138,7 @@ CalibrateScanElements () CallFunctionWithParameter (0x91, arSpeeds[Index]); - /*waiting for scaned line... */ + /*waiting for scanned line... */ timeout = 0; do { @@ -1205,7 +1203,7 @@ CalibrateScanElements () CallFunctionWithParameter (0x91, CurrentSpeed2); usleep(10); - /*waiting for scaned line... */ + /*waiting for scanned line... */ for(j = 0; j < 5; j++) { timeout = 0; diff --git a/backend/hpsj5s.h b/backend/hpsj5s.h index 0361acd..206438e 100644 --- a/backend/hpsj5s.h +++ b/backend/hpsj5s.h @@ -10,7 +10,7 @@ #define ADDRESS_RESULT 0x20 /*Here we get result */ -/*Scanner functions (not all - some of them I cann't identify)*/ +/*Scanner functions (not all - some of them I can't identify)*/ #define FUNCTION_SETUP_HARDWARE 0xA0 /*Scanner hardware control flags:*/ @@ -83,7 +83,7 @@ static SANE_Byte CallFunctionWithRetVal (SANE_Byte Function); static SANE_Byte ReadDataByte (void); -static void ReadDataBlock (SANE_Byte * Buffer, int lenght); +static void ReadDataBlock (SANE_Byte * Buffer, int length); /*Daisy chaining API: (should be moved to ieee1284 library in future)*/ diff --git a/backend/hs2p-saneopts.h b/backend/hs2p-saneopts.h index 938c7da..d5d6143 100644 --- a/backend/hs2p-saneopts.h +++ b/backend/hs2p-saneopts.h @@ -16,9 +16,7 @@ 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. + along with this program. If not, see . As a special exception, the authors of SANE give permission for additional uses of the libraries contained in this release of SANE. diff --git a/backend/hs2p-scsi.c b/backend/hs2p-scsi.c index 6063acd..4924c19 100644 --- a/backend/hs2p-scsi.c +++ b/backend/hs2p-scsi.c @@ -16,9 +16,7 @@ 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. + along with this program. If not, see . As a special exception, the authors of SANE give permission for additional uses of the libraries contained in this release of SANE. @@ -609,7 +607,7 @@ sense_handler (int __sane_unused__ scsi_fd, u_char * sense_buffer, void *sd) case 0x2C02: /* Invalid combination of windows specified */ status = SANE_STATUS_INVAL; break; - case 0x3700: /* (Rounded paramter) */ + case 0x3700: /* (Rounded parameter) */ status = SANE_STATUS_INVAL; break; case 0x3900: /* (Saving parameters not supported) */ @@ -928,7 +926,7 @@ mode_sense (int fd, MP * buf, SANE_Byte page_code) cmd.dbd &= ~(1 << 3); /* Disable Block Description (bit3) is set to 0 */ cmd.pc = (page_code & 0x3F); /* bits 5-0 */ cmd.pc &= ~(0x03 << 6); /* unset PC Field (bits7-6) - * 00 Curent Value is the only effective value + * 00 Current Value is the only effective value * 01 Changeable Value * 10 Default Value * 11 Saved Value */ @@ -1014,7 +1012,7 @@ set_window (int fd, SWD * swd) DBG (DBG_error, "set_window: error with memcpy\n"); } - /* Set Window Data Header: 0-5:reserved; 6-7:Window Descriptor Lenght=640 */ + /* Set Window Data Header: 0-5:reserved; 6-7:Window Descriptor Length=640 */ wdl = sizeof (win.swd) - sizeof (win.swd.hdr); _lto2b (wdl, &win.swd.hdr.len[0]); DBG (DBG_info, diff --git a/backend/hs2p-scsi.h b/backend/hs2p-scsi.h index cdf227e..25122d5 100644 --- a/backend/hs2p-scsi.h +++ b/backend/hs2p-scsi.h @@ -16,9 +16,7 @@ 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. + along with this program. If not, see . As a special exception, the authors of SANE give permission for additional uses of the libraries contained in this release of SANE. @@ -623,7 +621,7 @@ typedef struct mode_page_service typedef struct scsi_mode_sense_cmd { SANE_Byte opcode; /* 1AH */ - SANE_Byte dbd; /* 7-5:LUN; 4:Reserved; 3:DBD (Disable Block Desciption) set to "0"; 2-0:Reserved */ + SANE_Byte dbd; /* 7-5:LUN; 4:Reserved; 3:DBD (Disable Block Description) set to "0"; 2-0:Reserved */ SANE_Byte pc; /* 7-6:PC; 5-0:Page Code * PC field indicates the type of data to be returned (bit7,bit6): * 00 Current Value (THIS IS THE ONLY VALUE WHICH WORKS!) @@ -919,7 +917,7 @@ struct hs2p_window_data * 0: 0=>output from bit0 of each byte; 1=>output from bit7 * 1: 0=>output from LSB; 1=>output from MSB * 2: 0=>unpacked 4 bits gray; 1=>Packed 4 bits gray - * 3: 1=>Bits arrangment from LSB in grayscale; 0=>from MSB + * 3: 1=>Bits arrangement from LSB in grayscale; 0=>from MSB * 4-6: reserved * 7: 1=>Mirroring; 0=>Normal output * 8-15: reserved diff --git a/backend/hs2p.c b/backend/hs2p.c index deee3b0..ec9eec9 100644 --- a/backend/hs2p.c +++ b/backend/hs2p.c @@ -16,9 +16,7 @@ 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. + along with this program. If not, see . As a special exception, the authors of SANE give permission for additional uses of the libraries contained in this release of SANE. @@ -51,10 +49,10 @@ . . . init_options : initialize SANE_OPTIONS array . . - sane_set_io_mode : set blocking-mode . . - sane_get_select_fd : get scanner-fd - . . - sane_get_option_descriptor() : get option informations + . . - sane_get_option_descriptor() : get option information . . - sane_control_option() : change option values . . - . . - sane_start() : start image aquisition + . . - sane_start() : start image acquisition . . - sane_get_parameters() : returns actual scan-parameters . . - sane_read() : read image-data (from pipe) . . @@ -1535,7 +1533,7 @@ do_cancel (HS2P_Scanner * s) object_position (s->fd, OBJECT_POSITION_UNLOAD)) != SANE_STATUS_GOOD) { - DBG (DBG_error, "cancel: OBJECT POSTITION failed\n"); + DBG (DBG_error, "cancel: OBJECT POSITION failed\n"); } sanei_scsi_req_flush_all (); release_unit (s->fd); @@ -1588,7 +1586,7 @@ sane_init (SANE_Int * version_code, } #if 0 - /* avision.c: search for all supported scanners on all scsi busses & channels */ + /* avision.c: search for all supported scanners on all scsi buses & channels */ for (hw = &HS2P_Device_List[0]; hw->mfg != NULL; hw++) { sanei_scsi_find_devices (hw->mfg, /*vendor */ @@ -3252,7 +3250,7 @@ pad: /* * 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) + * sense data buffer (which apparently clears the error condition) * so the following doesn't work: get_sense_data (s->fd, &(s->hw->sense_data)); print_sense_data (&(s->hw->sense_data)); diff --git a/backend/hs2p.h b/backend/hs2p.h index 6270154..c3080d6 100644 --- a/backend/hs2p.h +++ b/backend/hs2p.h @@ -16,9 +16,7 @@ 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. + along with this program. If not, see . As a special exception, the authors of SANE give permission for additional uses of the libraries contained in this release of SANE. @@ -342,7 +340,7 @@ static const HS2P_Paper paper_sizes[] = { /* Name, Width, Height in mm */ {"Full", 0.0, 0.0}, }; -#define PORTRAIT "Portait" +#define PORTRAIT "Portrait" #define LANDSCAPE "Landscape" static SANE_String_Const orientation_list[] = { PORTRAIT, diff --git a/backend/ibm-scsi.c b/backend/ibm-scsi.c index b6436bd..9e0b12d 100644 --- a/backend/ibm-scsi.c +++ b/backend/ibm-scsi.c @@ -13,9 +13,7 @@ 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. + along with this program. If not, see . As a special exception, the authors of SANE give permission for additional uses of the libraries contained in this release of SANE. diff --git a/backend/ibm.c b/backend/ibm.c index 1f26226..91a09ee 100644 --- a/backend/ibm.c +++ b/backend/ibm.c @@ -13,9 +13,7 @@ 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. + along with this program. If not, see . As a special exception, the authors of SANE give permission for additional uses of the libraries contained in this release of SANE. @@ -192,7 +190,7 @@ attach (const char *devnam, Ibm_Device ** devp) status = object_position (fd, OBJECT_POSITION_UNLOAD); if (status != SANE_STATUS_GOOD) { - DBG (1, "attach: OBJECT POSTITION failed\n"); + DBG (1, "attach: OBJECT POSITION failed\n"); sanei_scsi_close (fd); return (SANE_STATUS_INVAL); } @@ -269,7 +267,7 @@ attach (const char *devnam, Ibm_Device ** devp) dev->info.yres_default = _2btol(wbuf.y_res); dev->info.image_mode_default = wbuf.image_comp; - /* if you throw the MRIF bit the brighness control reverses too */ + /* if you throw the MRIF bit the brightness control reverses too */ /* so I reverse the reversal in software for symmetry's sake */ /* I should make this into an option */ @@ -521,7 +519,7 @@ do_cancel (Ibm_Scanner * s) status = object_position (s->fd, OBJECT_POSITION_UNLOAD); if (status != SANE_STATUS_GOOD) { - DBG (1, "cancel: OBJECT POSTITION failed\n"); + DBG (1, "cancel: OBJECT POSITION failed\n"); } s->scanning = SANE_FALSE; @@ -996,7 +994,7 @@ sane_start (SANE_Handle handle) _lto4b(s->length, wbuf.length); wbuf.image_comp = s->image_composition; - /* if you throw the MRIF bit the brighness control reverses too */ + /* if you throw the MRIF bit the brightness 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) { diff --git a/backend/ibm.h b/backend/ibm.h index 742ebeb..3493cbc 100644 --- a/backend/ibm.h +++ b/backend/ibm.h @@ -13,9 +13,7 @@ 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. + along with this program. If not, see . As a special exception, the authors of SANE give permission for additional uses of the libraries contained in this release of SANE. diff --git a/backend/kodak-cmd.h b/backend/kodak-cmd.h index 995d622..7d5d506 100644 --- a/backend/kodak-cmd.h +++ b/backend/kodak-cmd.h @@ -111,7 +111,7 @@ putnbyte (unsigned char *pnt, unsigned int value, unsigned int nbytes) #define I_periph_devtype_scanner 0x06 #define I_periph_devtype_unknown 0x1f -/* dont use these, until vendor */ +/* don't use these, until vendor */ #define get_I_rmb(in) getbitfield(in + 1, 7, 1) #define get_I_devtype_qual(in) getbitfield(in + 1, 0, 0x7f) diff --git a/backend/kodak.c b/backend/kodak.c index 845ad11..39c91e6 100644 --- a/backend/kodak.c +++ b/backend/kodak.c @@ -20,9 +20,7 @@ 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. + along with this program. If not, see . As a special exception, the authors of SANE give permission for additional uses of the libraries contained in this release of SANE. @@ -61,7 +59,7 @@ v0 through v5 2008-01-15, MAN - development versions v6 2009-06-22, MAN - - improved set_window() to build desciptor from scratch + - improved set_window() to build descriptor from scratch - initial release v7 2010-02-10, MAN - add SANE_I18N to static strings @@ -1376,7 +1374,7 @@ sane_control_option (SANE_Handle handle, SANE_Int option, DBG (20, "sane_control_option: set value for '%s' (%d)\n", s->opt[option].name,option); if ( s->started ) { - DBG (5, "sane_control_option: cant set, device busy\n"); + DBG (5, "sane_control_option: can't set, device busy\n"); return SANE_STATUS_DEVICE_BUSY; } @@ -1391,7 +1389,7 @@ sane_control_option (SANE_Handle handle, SANE_Int option, return status; } - /* may have been changed by constrain, so dont copy until now */ + /* may have been changed by constrain, so don't copy until now */ val_c = *(SANE_Word *)val; /* @@ -1682,7 +1680,7 @@ sane_get_parameters (SANE_Handle handle, SANE_Parameters * params) * * 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. + * hence, we spend a lot of time playing with s->started, etc. */ SANE_Status sane_start (SANE_Handle handle) @@ -1795,7 +1793,7 @@ sane_start (SANE_Handle handle) s->bytes_buf = 0; } - /* grab new buffer if dont have one */ + /* grab new buffer if don't have one */ if (!s->buffer) { DBG (15, "sane_start: calloc buffer.\n"); s->buffer = calloc (1,s->i_bytes); @@ -1817,7 +1815,7 @@ sane_start (SANE_Handle handle) * This routine issues a SCSI SET WINDOW command to the scanner, using the * values currently in the scanner data structure. * the scanner has 4 separate windows, and all must be set similarly, - * even if you dont intend to aquire images from all of them. + * even if you don't intend to acquire images from all of them. */ static SANE_Status set_window (struct scanner *s) @@ -2202,7 +2200,7 @@ read_imageheader (struct scanner *s) 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?*/ + /*FIXME: there are a lot more of these?*/ } DBG (10, "read_imageheader: finish %d\n", ret); @@ -2424,7 +2422,7 @@ read_from_buffer(struct scanner *s, SANE_Byte * buf, * handle h is a valid handle) but usually affects long-running * operations only (such as image is acquisition). It is safe to call * this function asynchronously (e.g., from within a signal handler). - * It is important to note that completion of this operaton does not + * It is important to note that completion of this operation does not * imply that the currently pending operation has been cancelled. It * only guarantees that cancellation has been initiated. Cancellation * completes only when the cancelled call returns (typically with a diff --git a/backend/kodakaio.c b/backend/kodakaio.c index 9a7a8b4..73dd58b 100644 --- a/backend/kodakaio.c +++ b/backend/kodakaio.c @@ -51,10 +51,10 @@ If you want to use the test backend, for example with sane-troubleshoot, you sho . - sane_open() : open a particular scanner-device and attach_scanner(devicename,&dev) . . - sane_set_io_mode : set blocking-mode . . - sane_get_select_fd : get scanner-fd - . . - sane_get_option_descriptor() : get option informations + . . - sane_get_option_descriptor() : get option information . . - sane_control_option() : change option values . . - . . - sane_start() : start image aquisition [V,L,F,S,C,D,O,Z] first time or after cancel. [(F),E,G] every time + . . - sane_start() : start image acquisition [V,L,F,S,C,D,O,Z] first time or after cancel. [(F),E,G] every time . . - sane_get_parameters() : returns actual scan-parameters . . - sane_read() : read image-data (from pipe) . . - sane_cancel() : cancel operation, kill reader_process [(F), U] @@ -1299,7 +1299,7 @@ int cmparray (unsigned char *array1, unsigned char *array2, size_t len) { /* compares len bytes of the arrays returns 0 if they match -returns the first missmatch position if they don't match */ +returns the first mismatch position if they don't match */ unsigned int i; for(i=0; ival[OPT_MODE].w = MODE_COLOR; /* default */ DBG(20, "%s: mode_list has first entry %s, default mode is %s\n", __func__, mode_list[0],mode_list[s->val[OPT_MODE].w]); - /* theshold the sane std says should be SANE_TYPE_FIXED 0..100 but all other backends seem to use INT 0..255 */ + /* threshold the sane std says should be SANE_TYPE_FIXED 0..100 but all other backends seem to use INT 0..255 */ s->opt[OPT_THRESHOLD].name = SANE_NAME_THRESHOLD; s->opt[OPT_THRESHOLD].title = SANE_TITLE_THRESHOLD; s->opt[OPT_THRESHOLD].desc = SANE_DESC_THRESHOLD; @@ -2768,7 +2772,7 @@ init_options(KodakAio_Scanner *s) s->val[OPT_THRESHOLD].w = SANE_FIX(50.0); DBG(20, "%s: threshold initialised to fixed %f\n", __func__, SANE_UNFIX(s->val[OPT_THRESHOLD].w)); - /* theshold the sane std says should be SANE_TYPE_FIXED 0..100 but all other backends seem to use INT 0..255 + /* threshold the sane std says should be SANE_TYPE_FIXED 0..100 but all other backends seem to use INT 0..255 s->opt[OPT_THRESHOLD].name = SANE_NAME_THRESHOLD; s->opt[OPT_THRESHOLD].title = SANE_TITLE_THRESHOLD; s->opt[OPT_THRESHOLD].desc = SANE_DESC_THRESHOLD; diff --git a/backend/kvs1025_low.c b/backend/kvs1025_low.c index 98cf3be..d185fb3 100644 --- a/backend/kvs1025_low.c +++ b/backend/kvs1025_low.c @@ -1043,7 +1043,7 @@ buffer_crop(PKV_DEV s, int side) 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]); - /* we dont listen to the 'top' value, since the top is not padded */ + /* we don't listen to the 'top' value, since the top is not padded */ /*s->crop_vals[0] = 0;*/ } /* backside images can use a 'flipped' version of frontside data */ diff --git a/backend/kvs1025_low.h b/backend/kvs1025_low.h index 9c92832..ba8da24 100644 --- a/backend/kvs1025_low.h +++ b/backend/kvs1025_low.h @@ -99,7 +99,7 @@ typedef enum OPT_RESOLUTION, /* X and Y resolution */ OPT_DUPLEX, /* Duplex mode */ OPT_SCAN_SOURCE, /* Scan source, fixed to ADF */ - OPT_FEEDER_MODE, /* Feeder mode, fixed to Continous */ + OPT_FEEDER_MODE, /* Feeder mode, fixed to Continuous */ OPT_LONGPAPER, /* Long paper mode */ OPT_LENGTHCTL, /* Length control mode */ OPT_MANUALFEED, /* Manual feed mode */ @@ -190,7 +190,7 @@ typedef struct kv_scanner_dev int bytes_to_read[2]; /* bytes to read */ /* --------------------------------------------------------------------- */ - /* values used by the software enhancment code (deskew, crop, etc) */ + /* values used by the software enhancement code (deskew, crop, etc) */ SANE_Status deskew_stat; int deskew_vals[2]; double deskew_slope; diff --git a/backend/kvs1025_opt.c b/backend/kvs1025_opt.c index 628f056..3006a25 100644 --- a/backend/kvs1025_opt.c +++ b/backend/kvs1025_opt.c @@ -269,7 +269,7 @@ static const char *go_option_name[] = { "OPT_RESOLUTION", /* X and Y resolution */ "OPT_DUPLEX", /* Duplex mode */ "OPT_SCAN_SOURCE", /* Scan source, fixed to ADF */ - "OPT_FEEDER_MODE", /* Feeder mode, fixed to Continous */ + "OPT_FEEDER_MODE", /* Feeder mode, fixed to Continuous */ "OPT_LONGPAPER", /* Long paper mode */ "OPT_LENGTHCTL", /* Length control mode */ "OPT_MANUALFEED", /* Manual feed mode */ diff --git a/backend/kvs20xx.h b/backend/kvs20xx.h index 442f1c7..c619118 100644 --- a/backend/kvs20xx.h +++ b/backend/kvs20xx.h @@ -50,7 +50,7 @@ typedef enum RESOLUTION, /* X and Y resolution */ DUPLEX, /* Duplex mode */ - FEEDER_MODE, /* Feeder mode, fixed to Continous */ + FEEDER_MODE, /* Feeder mode, fixed to Continuous */ LENGTHCTL, /* Length control mode */ MANUALFEED, /* Manual feed mode */ FEED_TIMEOUT, /* Feed timeout */ diff --git a/backend/kvs20xx_cmd.c b/backend/kvs20xx_cmd.c index d0f18ee..c21201b 100644 --- a/backend/kvs20xx_cmd.c +++ b/backend/kvs20xx_cmd.c @@ -99,7 +99,7 @@ kvs20xx_sense_handler (int __sane_unused__ fd, if (i == sizeof (s_errors) / sizeof (s_errors[0])) st = SANE_STATUS_IO_ERROR; DBG (DBG_ERR, - "send_command: CHECK_CONDITION: sence:0x%x ASC:0x%x ASCQ:0x%x\n", + "send_command: CHECK_CONDITION: sense:0x%x ASC:0x%x ASCQ:0x%x\n", sense_buffer[2], sense_buffer[12], sense_buffer[13]); return st; diff --git a/backend/kvs40xx.h b/backend/kvs40xx.h index 7fdebe6..161dc59 100644 --- a/backend/kvs40xx.h +++ b/backend/kvs40xx.h @@ -60,7 +60,7 @@ typedef enum SOURCE, DUPLEX, /* Duplex mode */ - FEEDER_MODE, /* Feeder mode, fixed to Continous */ + FEEDER_MODE, /* Feeder mode, fixed to Continuous */ LENGTHCTL, /* Length control mode */ LONG_PAPER, MANUALFEED, /* Manual feed mode */ diff --git a/backend/kvs40xx_cmd.c b/backend/kvs40xx_cmd.c index 52ccc38..e2f4fd6 100644 --- a/backend/kvs40xx_cmd.c +++ b/backend/kvs40xx_cmd.c @@ -275,7 +275,7 @@ kvs40xx_sense_handler (int __sane_unused__ fd, } DBG (DBG_ERR, - "send_command: CHECK_CONDITION: sence:0x%x ASC:0x%x ASCQ:0x%x\n", + "send_command: CHECK_CONDITION: sense:0x%x ASC:0x%x ASCQ:0x%x\n", sense_buffer[2], sense_buffer[12], sense_buffer[13]); return st; diff --git a/backend/leo.c b/backend/leo.c index e0200de..3c97daa 100644 --- a/backend/leo.c +++ b/backend/leo.c @@ -15,9 +15,7 @@ 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. + along with this program. If not, see . As a special exception, the authors of SANE give permission for additional uses of the libraries contained in this release of SANE. @@ -42,7 +40,6 @@ */ /* - $Id$ Across FS-1130 */ diff --git a/backend/leo.h b/backend/leo.h index d9595bf..c9b7981 100644 --- a/backend/leo.h +++ b/backend/leo.h @@ -15,9 +15,7 @@ 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. + along with this program. If not, see . As a special exception, the authors of SANE give permission for additional uses of the libraries contained in this release of SANE. @@ -41,10 +39,6 @@ If you do not wish that, delete this exception notice. */ -/* - $Id$ -*/ - /* Commands supported by the scanner. */ #define SCSI_TEST_UNIT_READY 0x00 #define SCSI_INQUIRY 0x12 @@ -262,7 +256,7 @@ struct scanners_supported /*--------------------------------------------------------------------------*/ -/* Define a scanner occurence. */ +/* Define a scanner occurrence. */ typedef struct Leo_Scanner { struct Leo_Scanner *next; diff --git a/backend/lexmark.c b/backend/lexmark.c index 36c33f3..2c9287a 100644 --- a/backend/lexmark.c +++ b/backend/lexmark.c @@ -18,9 +18,7 @@ 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. + along with this program. If not, see . As a special exception, the authors of SANE give permission for additional uses of the libraries contained in this release of SANE. @@ -624,7 +622,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. + * useful when several scanners handled by the backend have been detected. * However, special case empty string "" and "lexmark" pick the first * available handle. */ @@ -649,7 +647,7 @@ sane_open (SANE_String_Const devicename, SANE_Handle * handle) return SANE_STATUS_INVAL; } - /* walk the linked list of scanner device until ther is a match + /* walk the linked list of scanner device until there is a match * with the device name */ for (lexmark_device = first_lexmark_device; lexmark_device; lexmark_device = lexmark_device->next) diff --git a/backend/lexmark.h b/backend/lexmark.h index 9b7de98..ced277f 100644 --- a/backend/lexmark.h +++ b/backend/lexmark.h @@ -18,9 +18,7 @@ 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. + along with this program. If not, see . As a special exception, the authors of SANE give permission for additional uses of the libraries contained in this release of SANE. diff --git a/backend/lexmark_low.c b/backend/lexmark_low.c index db1dab5..052ae4d 100644 --- a/backend/lexmark_low.c +++ b/backend/lexmark_low.c @@ -17,9 +17,7 @@ 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. + along with this program. If not, see . As a special exception, the authors of SANE give permission for additional uses of the libraries contained in this release of SANE. @@ -295,7 +293,7 @@ rts88xx_write_regs (SANE_Int devnum, SANE_Int start, SANE_Byte * source, /* * reads 'needed' bytes of scanned data into 'data'. Actual number of bytes get - * is retruned in 'size' + * is returned in 'size' */ static SANE_Status rts88xx_read_data (SANE_Int devnum, size_t needed, SANE_Byte * data, @@ -1010,7 +1008,7 @@ low_poll_data (SANE_Int devnum) if (status != SANE_STATUS_GOOD) return status; size = 4; - /* read availbale data size again */ + /* read available data size again */ status = low_usb_bulk_write (devnum, command4_block, &size); if (status != SANE_STATUS_GOOD) return status; @@ -1223,7 +1221,7 @@ sanei_lexmark_low_open_device (Lexmark_Device * dev) } /* if find a case where default model given is inappropriate, reassign it - * since we have now the informations to get the real one. + * since we have now the information to get the real one. * We could avoid this if attach() did open and read registers, not init */ if (variant != 0) { @@ -1327,7 +1325,7 @@ low_is_home_line (Lexmark_Device * dev, unsigned char *buffer) 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 + plus or minus the tolerance. 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 @@ -1952,9 +1950,9 @@ sanei_lexmark_low_search_home_bwd (Lexmark_Device * dev) 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. + coordinates 0x6a and 0x13f2. - The scan is set to read between vertical co-ordinates from 0x0a to 0x0f46, + The scan is set to read between vertical coordinates from 0x0a to 0x0f46, or 3900 lines. This equates to 13" at 300dpi, so we must stop the scan before it bangs against the end. A line limit is set so that a maximum of 0x0F3C (13"*300dpi) lines can be read. @@ -2227,7 +2225,7 @@ sanei_lexmark_low_search_home_bwd (Lexmark_Device * dev) no_of_buffers = size_returned * 3; no_of_buffers = no_of_buffers / 2500; no_of_buffers = no_of_buffers >> 1; - /* force 1 buffer at a time to improve accuray, which slow downs search */ + /* force 1 buffer at a time to improve accuracy, which slow downs search */ no_of_buffers = 1; if (no_of_buffers < 1) @@ -5558,7 +5556,7 @@ sanei_lexmark_low_offset_calibration (Lexmark_Device * dev) we start with the highest one and decrease until overall offset is ok First loop may have such an high offset that scanned data overflow - and gives a low average. So we allways skip its results + and gives a low average. So we always skip its results */ /* minimal gains */ @@ -5691,7 +5689,7 @@ sanei_lexmark_low_gain_calibration (Lexmark_Device * dev) pixels = (ex - sx) / regs[0x7a]; - /* set up inital gains */ + /* set up initial gains */ red = 6; green = 6; blue = 6; @@ -5707,7 +5705,7 @@ sanei_lexmark_low_gain_calibration (Lexmark_Device * dev) if (status != SANE_STATUS_GOOD) return status; - /* we do a simple scan all 3 averages give the choosen level */ + /* we do a simple scan all 3 averages give the chosen level */ while (((rts88xx_is_color (regs) && ((ra < dev->sensor->red_gain_target) || (ga < dev->sensor->green_gain_target) @@ -5756,7 +5754,7 @@ sanei_lexmark_low_gain_calibration (Lexmark_Device * dev) * We do it by scanning a pure white area which is before scanning area. Then * we compute per pixel coefficient to move the scanned value to the target * value. These coefficients are used later to correct scanned data. - * The scan is done with all the final scan settings but the heigth and vertical + * The scan is done with all the final scan settings but the height and vertical * start position. */ SANE_Status @@ -5934,7 +5932,7 @@ sanei_lexmark_low_shading_calibration (Lexmark_Device * dev) /* do the scan backward to go back to start position */ regs[0xc6] &= 0xF7; lines = (8 * 8) / regs[0x7a]; - /* it shoud use linetotal to account for the lineoffset */ + /* it should use linetotal to account for the lineoffset */ if (dev->model.sensor_type == X74_SENSOR) lines = linetotal; diff --git a/backend/lexmark_models.c b/backend/lexmark_models.c index 4ca675d..e84fc8d 100644 --- a/backend/lexmark_models.c +++ b/backend/lexmark_models.c @@ -16,9 +16,7 @@ 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. + along with this program. If not, see . As a special exception, the authors of SANE give permission for additional uses of the libraries contained in this release of SANE. diff --git a/backend/lexmark_sensors.c b/backend/lexmark_sensors.c index 4b63d7d..76a05ac 100644 --- a/backend/lexmark_sensors.c +++ b/backend/lexmark_sensors.c @@ -16,9 +16,7 @@ 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. + along with this program. If not, see . As a special exception, the authors of SANE give permission for additional uses of the libraries contained in this release of SANE. diff --git a/backend/ma1509.c b/backend/ma1509.c index e38ddc5..37bbefb 100644 --- a/backend/ma1509.c +++ b/backend/ma1509.c @@ -16,9 +16,7 @@ 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. + along with this program. If not, see . As a special exception, the authors of SANE give permission for additional uses of the libraries contained in this release of SANE. @@ -94,7 +92,7 @@ static Ma1509_Device **new_dev; /* Length of new_dev array */ static SANE_Int new_dev_len; -/* Number of entries alloced for new_dev */ +/* Number of entries allocated for new_dev */ static SANE_Int new_dev_alloced; static SANE_String_Const mode_list[] = { diff --git a/backend/ma1509.h b/backend/ma1509.h index 455ca9c..55d5631 100644 --- a/backend/ma1509.h +++ b/backend/ma1509.h @@ -16,9 +16,7 @@ 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. + along with this program. If not, see . As a special exception, the authors of SANE give permission for additional uses of the libraries contained in this release of SANE. diff --git a/backend/magicolor.c b/backend/magicolor.c index 0b079fa..886dbab 100644 --- a/backend/magicolor.c +++ b/backend/magicolor.c @@ -2157,10 +2157,11 @@ attach_one_net(const char *dev, unsigned int model) } static SANE_Status -attach_one_config(SANEI_Config __sane_unused__ *config, const char *line) +attach_one_config(SANEI_Config __sane_unused__ *config, const char *line, + void *data) { int vendor, product, timeout; - + SANE_Bool local_only = *(SANE_Bool*) data; int len = strlen(line); DBG(7, "%s: len = %d, line = %s\n", __func__, len, line); @@ -2189,24 +2190,27 @@ attach_one_config(SANEI_Config __sane_unused__ *config, const char *line) } else if (strncmp(line, "net", 3) == 0) { - /* remove the "net" sub string */ - const char *name = sanei_config_skip_whitespace(line + 3); - char IP[1024]; - unsigned int model = 0; - - if (strncmp(name, "autodiscovery", 13) == 0) { - DBG (50, "%s: Initiating network autodiscovervy via SNMP\n", __func__); - mc_network_discovery(NULL); - } else if (sscanf(name, "%s %x", IP, &model) == 2) { - DBG(50, "%s: Using network device on IP %s, forcing model 0x%x\n", __func__, IP, model); - attach_one_net(IP, model); - } else { - /* use SNMP to detect the type. If not successful, - * add the host with model type 0 */ - DBG(50, "%s: Using network device on IP %s, trying to autodetect model\n", __func__, IP); - if (mc_network_discovery(name)==0) { - DBG(1, "%s: Autodetecting device model failed, using default model\n", __func__); - attach_one_net(name, 0); + if (!local_only) { + /* remove the "net" sub string */ + const char *name = + sanei_config_skip_whitespace(line + 3); + char IP[1024]; + unsigned int model = 0; + + if (strncmp(name, "autodiscovery", 13) == 0) { + DBG (50, "%s: Initiating network autodiscovervy via SNMP\n", __func__); + mc_network_discovery(NULL); + } else if (sscanf(name, "%s %x", IP, &model) == 2) { + DBG(50, "%s: Using network device on IP %s, forcing model 0x%x\n", __func__, IP, model); + attach_one_net(IP, model); + } else { + /* use SNMP to detect the type. If not successful, + * add the host with model type 0 */ + DBG(50, "%s: Using network device on IP %s, trying to autodetect model\n", __func__, IP); + if (mc_network_discovery(name)==0) { + DBG(1, "%s: Autodetecting device model failed, using default model\n", __func__); + attach_one_net(name, 0); + } } } @@ -2279,7 +2283,7 @@ sane_exit(void) } SANE_Status -sane_get_devices(const SANE_Device ***device_list, SANE_Bool __sane_unused__ local_only) +sane_get_devices(const SANE_Device ***device_list, SANE_Bool local_only) { Magicolor_Device *dev, *s, *prev=0; int i; @@ -2295,7 +2299,7 @@ sane_get_devices(const SANE_Device ***device_list, SANE_Bool __sane_unused__ loc /* Read the config, mark each device as found, possibly add new devs */ sanei_configure_attach(MAGICOLOR_CONFIG_FILE, NULL, - attach_one_config); + attach_one_config, &local_only); /*delete missing scanners from list*/ for (s = first_dev; s;) { diff --git a/backend/matsushita.c b/backend/matsushita.c index 62bfb06..d982f50 100644 --- a/backend/matsushita.c +++ b/backend/matsushita.c @@ -16,9 +16,7 @@ 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. + along with this program. If not, see . As a special exception, the authors of SANE give permission for additional uses of the libraries contained in this release of SANE. @@ -43,7 +41,6 @@ */ /* - $Id$ Matsushita/Panasonic KV-SS25, KV-SS50, KV-SS55, KV-SS50EX, KV-SS55EX, KV-SS850, KV-SS855 SCSI scanners. @@ -934,7 +931,7 @@ matsushita_sense_handler (int scsi_fd, unsigned char *result, void __sane_unused case 0x06: if (asc == 0x29) { - /* Reset occured. May be the backend should retry the + /* Reset occurred. May be the backend should retry the * command. */ return SANE_STATUS_GOOD; } diff --git a/backend/matsushita.h b/backend/matsushita.h index bff7a04..7a2b786 100644 --- a/backend/matsushita.h +++ b/backend/matsushita.h @@ -14,9 +14,7 @@ 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. + along with this program. If not, see . As a special exception, the authors of SANE give permission for additional uses of the libraries contained in this release of SANE. @@ -40,10 +38,6 @@ If you do not wish that, delete this exception notice. */ -/* - $Id$ -*/ - /* Commands supported by the KV-SS 25 scanner. */ #define SCSI_TEST_UNIT_READY 0x00 #define SCSI_INQUIRY 0x12 @@ -271,7 +265,7 @@ struct paper_sizes /*--------------------------------------------------------------------------*/ -/* Define a scanner occurence. */ +/* Define a scanner occurrence. */ typedef struct Matsushita_Scanner { struct Matsushita_Scanner *next; diff --git a/backend/microtek.c b/backend/microtek.c index c3b87ec..200a69c 100644 --- a/backend/microtek.c +++ b/backend/microtek.c @@ -18,9 +18,7 @@ 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. + along with this program. If not, see . As a special exception, the authors of SANE give permission for additional uses of the libraries contained in this release of SANE. diff --git a/backend/microtek.h b/backend/microtek.h index 880dc3c..664b48f 100644 --- a/backend/microtek.h +++ b/backend/microtek.h @@ -18,9 +18,7 @@ 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. + along with this program. If not, see . As a special exception, the authors of SANE give permission for additional uses of the libraries contained in this release of SANE. diff --git a/backend/microtek2.c b/backend/microtek2.c index f7c63d6..72c1b20 100644 --- a/backend/microtek2.c +++ b/backend/microtek2.c @@ -19,9 +19,7 @@ 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. + along with this program. If not, see . As a special exception, the authors of SANE give permission for additional uses of the libraries contained in this release of SANE. @@ -574,8 +572,8 @@ sane_open(SANE_String_Const name, SANE_Handle *handle) *handle = ms; #ifdef HAVE_AUTHORIZATION - /* check whether the file with the passwords exists. If it doesnt */ - /* exist, we dont use any authorization */ + /* check whether the file with the passwords exists. If it doesn't */ + /* exist, we don't use any authorization */ rc = stat(PASSWD_FILE, &st); if ( rc == -1 && errno == ENOENT ) @@ -1420,15 +1418,15 @@ cleanup_scanner(Microtek2_Scanner *ms) /*---------- do_authorization() ----------------------------------------------*/ static SANE_Status -do_authorization(char *ressource) +do_authorization(char *resource) { /* This function implements a simple authorization function. It looks */ /* up an entry in the file SANE_PATH_CONFIG_DIR/auth. Such an entry */ /* must be of the form device:user:password where password is a crypt() */ /* encrypted password. If several users are allowed to access a device */ /* an entry must be created for each user. If no entry exists for device */ - /* or the file does not exist no authentication is neccessary. If the */ - /* file exists, but cant be opened the authentication fails */ + /* or the file does not exist no authentication is necessary. If the */ + /* file exists, but can't be opened the authentication fails */ SANE_Status status; FILE *fp; @@ -1443,12 +1441,12 @@ do_authorization(char *ressource) char *p; - DBG(30, "do_authorization: ressource=%s\n", ressource); + DBG(30, "do_authorization: resource=%s\n", resource); if ( auth_callback == NULL ) /* frontend does not require authorization */ return SANE_STATUS_GOOD; - /* first check if an entry exists in for this device. If not, we dont */ + /* first check if an entry exists in for this device. If not, we don't */ /* use authorization */ fp = fopen(PASSWD_FILE, "r"); @@ -1475,7 +1473,7 @@ do_authorization(char *ressource) { *p = '\0'; device = linep; - if ( strcmp(device, ressource) == 0 ) + if ( strcmp(device, resource) == 0 ) { DBG(2, "equal\n"); device_found = 1; @@ -1492,7 +1490,7 @@ do_authorization(char *ressource) fseek(fp, 0L, SEEK_SET); - (*auth_callback) (ressource, username, password); + (*auth_callback) (resource, username, password); status = SANE_STATUS_ACCESS_DENIED; do @@ -1506,7 +1504,7 @@ do_authorization(char *ressource) continue; *p = '\0'; device = linep; - if ( strcmp( device, ressource) != 0 ) /* not a matching entry */ + if ( strcmp( device, resource) != 0 ) /* not a matching entry */ continue; linep = ++p; @@ -1517,7 +1515,7 @@ do_authorization(char *ressource) *p = '\0'; user = linep; if ( strncmp(user, username, SANE_MAX_USERNAME_LEN) != 0 ) - continue; /* username doesnt match */ + continue; /* username doesn't match */ linep = ++p; /* rest of the line is considered to be the password */ @@ -3573,7 +3571,7 @@ restore_gamma_options(SANE_Option_Descriptor *sod, Option_Value *val) { DBG(40, "restore_gamma_options: val=%p, sod=%p\n", (void *) val, (void *) sod); - /* if we dont have a gamma table return immediately */ + /* if we don't have a gamma table return immediately */ if ( ! val[OPT_GAMMA_MODE].s ) return SANE_STATUS_GOOD; @@ -5122,7 +5120,7 @@ scsi_sense_handler (int fd, u_char *sense, void *arg) DBG(5, "scsi_sense_handler: Gain error\n"); break; case RQS_ASCQ_POS: - DBG(5, "scsi_sense_handler: Positoning error\n"); + DBG(5, "scsi_sense_handler: Positioning error\n"); break; default: DBG(5, "scsi_sense_handler: Unknown combination of ASC" @@ -5545,7 +5543,7 @@ prepare_buffers(Microtek2_Scanner *ms) if ( ms->mode == MS_MODE_COLOR && mi->data_format == MI_DATAFMT_LPLSEGREG ) { - /* In this case the data is not neccessarily in the order RGB */ + /* In this case the data is not necessarily 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 */ @@ -6752,7 +6750,7 @@ calc_cx_shading_line(Microtek2_Scanner *ms) accu = *current_byte; /* word shading data: the lower bytes per line and color are */ - /* transfered first in one block and then the high bytes */ + /* transferred first in one block and then the high bytes */ /* in one block */ /* the dark shading data is also 10 bit, but only the */ /* low byte is transferred (ms->word = 0) */ diff --git a/backend/microtek2.h b/backend/microtek2.h index 326eac8..3cd1365 100644 --- a/backend/microtek2.h +++ b/backend/microtek2.h @@ -19,9 +19,7 @@ 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. + along with this program. If not, see . As a special exception, the authors of SANE give permission for additional uses of the libraries contained in this release of SANE. @@ -392,7 +390,7 @@ #define SW_CMD_L 10 #define SW_HEADER_L 8 #define SW_BODY_L 61 -#define SW_CMD_P 0 /* command at postion 0 */ +#define SW_CMD_P 0 /* command at position 0 */ #define SW_HEADER_P SW_CMD_L #define SW_BODY_P(n) SW_CMD_L + SW_HEADER_L + (n) * SW_BODY_L diff --git a/backend/mustek.c b/backend/mustek.c index 6a9aa86..48bcfd9 100644 --- a/backend/mustek.c +++ b/backend/mustek.c @@ -17,9 +17,7 @@ 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. + along with this program. If not, see . As a special exception, the authors of SANE give permission for additional uses of the libraries contained in this release of SANE. @@ -114,7 +112,7 @@ static Mustek_Device **new_dev; /* Length of new_dev array */ static SANE_Int new_dev_len; -/* Number of entries alloced for new_dev */ +/* Number of entries allocated for new_dev */ static SANE_Int new_dev_alloced; static SANE_Int lamp_off_time = 60; @@ -4910,7 +4908,7 @@ reader_process (void *data) s->total_lines = 0; bpl = s->hw->bpl; - /* buffer size is scanner dependant */ + /* buffer size is scanner dependent */ lines_per_buffer = s->hw->buffer_size / bpl / 2; if (strip_height > 0.0) @@ -6305,7 +6303,7 @@ sane_start (SANE_Handle handle) else if (strcmp (mode, SANE_VALUE_SCAN_MODE_COLOR) == 0) s->mode = MUSTEK_MODE_COLOR; - /* scanner dependant specials */ + /* scanner dependent specials */ s->one_pass_color_scan = SANE_FALSE; if ((s->mode & MUSTEK_MODE_COLOR) && !(s->hw->flags & MUSTEK_FLAG_THREE_PASS)) diff --git a/backend/mustek.conf.in b/backend/mustek.conf.in index 3868d0e..d247a01 100644 --- a/backend/mustek.conf.in +++ b/backend/mustek.conf.in @@ -33,7 +33,7 @@ scsi SCANNER #0x2eb # For the 600 II N try one of 0x26b, 0x2ab, # 0x2eb, 0x22b, 0x32b, 0x36b, 0x3ab, 0x3eb. -# option linedistance-fix # only neccessary with firmware 2.x +# option linedistance-fix # only necessary with firmware 2.x #-------------------------- 600 II EP --------------------------------------- #parport0 diff --git a/backend/mustek.h b/backend/mustek.h index ca7aa2e..3a4a41e 100644 --- a/backend/mustek.h +++ b/backend/mustek.h @@ -15,9 +15,7 @@ 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. + along with this program. If not, see . As a special exception, the authors of SANE give permission for additional uses of the libraries contained in this release of SANE. diff --git a/backend/mustek_pp.c b/backend/mustek_pp.c index bb97f86..26dc0e4 100644 --- a/backend/mustek_pp.c +++ b/backend/mustek_pp.c @@ -13,9 +13,7 @@ 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. + along with this program. If not, see . As a special exception, the authors of SANE give permission for additional uses of the libraries contained in this release of SANE. @@ -669,7 +667,7 @@ attach_device(SANE_String *driver, SANE_String *name, *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 + should have been transferred to the device, but this function can deal with that. */ free_cfg_options(&numcfgoptions, &cfgoptions); } @@ -694,7 +692,7 @@ attach_device(SANE_String *driver, SANE_String *name, * is the name of the driver to use * * if the optional argument "option_ta" is present the driver uses special - * parameters fitting for a trasparency adapter. + * parameters fitting for a transparency adapter. */ SANE_Status @@ -1080,7 +1078,7 @@ sane_get_devices (const SANE_Device *** device_list, * * open is called for the selected device. * - * The handel is set up with default values, and the + * The handle is set up with default values, and the * option descriptors are initialized */ @@ -1189,7 +1187,7 @@ sane_open (SANE_String_Const devicename, SANE_Handle * handle) * Then the backend makes sure, the lamp was at least * 2 seconds on. * - * Afterwards the selected handel is closed + * Afterwards the selected handle is closed */ void sane_close (SANE_Handle handle) @@ -1259,7 +1257,7 @@ sane_get_option_descriptor (SANE_Handle handle, SANE_Int option) /* sane_control_option: * Reads or writes an option * - * Desription: + * Description: * If a pointer to info is given, the value is initialized to zero * while scanning options cannot be read or written. next a basic * check whether the request is valid is done. @@ -1502,7 +1500,7 @@ sane_control_option (SANE_Handle handle, SANE_Int option, * * sane_get_parameters not only returns the parameters for * the next scan, it also sets them, i.e. converts the - * options in actuall parameters. + * options in actually parameters. * * The following parameters are set: * @@ -1684,7 +1682,7 @@ sane_get_parameters (SANE_Handle handle, SANE_Parameters * params) /* sane_start: - * starts the scan. data aquisition will start immedially + * starts the scan. data acquisition will start immediately * * Description: * diff --git a/backend/mustek_pp.h b/backend/mustek_pp.h index 09b4ceb..ac4d91e 100644 --- a/backend/mustek_pp.h +++ b/backend/mustek_pp.h @@ -13,9 +13,7 @@ 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. + along with this program. If not, see . As a special exception, the authors of SANE give permission for additional uses of the libraries contained in this release of SANE. @@ -52,7 +50,7 @@ #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 + * output a message when ASSERT fails. So if "cond" does anything, it will * be executed, even if NDEBUG is defined... */ #define ASSERT(cond, retval) do { \ @@ -90,7 +88,7 @@ typedef struct { SANE_String_Const port, SANE_String_Const name, SANE_Attach_Callback attach); - /* this function returns the informationen needed to set up + /* this function returns the information needed to set up * the device entry. the info parameter is passed from * init to the attach_callback to this function, to * help to identify the device, before it is registered @@ -119,7 +117,7 @@ typedef struct { /* stop scanning session */ void (*close)(SANE_Handle hndl); - /* start actuall scan */ + /* start actual scan */ SANE_Status (*start)(SANE_Handle hndl); /* read data (one line) */ diff --git a/backend/mustek_pp_ccd300.c b/backend/mustek_pp_ccd300.c index 2bf06b3..5f27cb3 100644 --- a/backend/mustek_pp_ccd300.c +++ b/backend/mustek_pp_ccd300.c @@ -13,9 +13,7 @@ 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. + along with this program. If not, see . As a special exception, the authors of SANE give permission for additional uses of the libraries contained in this release of SANE. diff --git a/backend/mustek_pp_ccd300.h b/backend/mustek_pp_ccd300.h index a8cf009..4aec014 100644 --- a/backend/mustek_pp_ccd300.h +++ b/backend/mustek_pp_ccd300.h @@ -13,9 +13,7 @@ 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. + along with this program. If not, see . As a special exception, the authors of SANE give permission for additional uses of the libraries contained in this release of SANE. diff --git a/backend/mustek_pp_cis.c b/backend/mustek_pp_cis.c index e95c6cf..9f0ea3a 100644 --- a/backend/mustek_pp_cis.c +++ b/backend/mustek_pp_cis.c @@ -14,9 +14,7 @@ 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. + along with this program. If not, see . As a special exception, the authors of SANE give permission for additional uses of the libraries contained in this release of SANE. @@ -198,7 +196,7 @@ /****************************************************************************** * High-level logging: traces the flow of the driver in a hierarchical way - * up to the level of register acccesses. + * up to the level of register accesses. *****************************************************************************/ #ifdef M1015_LOG_HL diff --git a/backend/mustek_pp_cis.h b/backend/mustek_pp_cis.h index fcbdfa6..0e9d072 100644 --- a/backend/mustek_pp_cis.h +++ b/backend/mustek_pp_cis.h @@ -14,9 +14,7 @@ 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. + along with this program. If not, see . As a special exception, the authors of SANE give permission for additional uses of the libraries contained in this release of SANE. diff --git a/backend/mustek_pp_null.c b/backend/mustek_pp_null.c index 06045cb..1f72ebc 100644 --- a/backend/mustek_pp_null.c +++ b/backend/mustek_pp_null.c @@ -13,9 +13,7 @@ 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. + along with this program. If not, see . As a special exception, the authors of SANE give permission for additional uses of the libraries contained in this release of SANE. diff --git a/backend/mustek_scsi_pp.c b/backend/mustek_scsi_pp.c index 304afce..98e3f20 100644 --- a/backend/mustek_scsi_pp.c +++ b/backend/mustek_scsi_pp.c @@ -13,9 +13,7 @@ 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. + along with this program. If not, see . As a special exception, the authors of SANE give permission for additional uses of the libraries contained in this release of SANE. diff --git a/backend/mustek_scsi_pp.h b/backend/mustek_scsi_pp.h index 363f2c0..f722fff 100644 --- a/backend/mustek_scsi_pp.h +++ b/backend/mustek_scsi_pp.h @@ -13,9 +13,7 @@ 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. + along with this program. If not, see . As a special exception, the authors of SANE give permission for additional uses of the libraries contained in this release of SANE. @@ -96,7 +94,7 @@ static SANE_Status mustek_scsi_pp_test_ready (int fd); * * @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 occurred during the dialog with the * device */ static SANE_Status mustek_scsi_pp_cmd (int fd, const void *src, size_t src_size, @@ -113,7 +111,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 occurred 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 d048fef..6bd3390 100644 --- a/backend/mustek_usb.c +++ b/backend/mustek_usb.c @@ -18,9 +18,7 @@ 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. + along with this program. If not, see . As a special exception, the authors of SANE give permission for additional uses of the libraries contained in this release of SANE. @@ -95,7 +93,7 @@ static Mustek_Usb_Device **new_dev; /* Length of new_dev array */ static SANE_Int new_dev_len; -/* Number of entries alloced for new_dev */ +/* Number of entries allocated for new_dev */ static SANE_Int new_dev_alloced; static SANE_String_Const mode_list[6]; diff --git a/backend/mustek_usb.h b/backend/mustek_usb.h index b5a7518..0607569 100644 --- a/backend/mustek_usb.h +++ b/backend/mustek_usb.h @@ -18,9 +18,7 @@ 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. + along with this program. If not, see . As a special exception, the authors of SANE give permission for additional uses of the libraries contained in this release of SANE. diff --git a/backend/mustek_usb2.c b/backend/mustek_usb2.c index bc112e6..aa4d797 100644 --- a/backend/mustek_usb2.c +++ b/backend/mustek_usb2.c @@ -18,9 +18,7 @@ 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. + along with this program. If not, see . As a special exception, the authors of SANE give permission for additional uses of the libraries contained in this release of SANE. @@ -635,7 +633,7 @@ Author: Jack Date: 2005/05/13 Routine Description: set scan parameters Parameters: - pSetParameters: the information of scaning + pSetParameters: the information of scanning Return value: if the operation success return TRUE diff --git a/backend/mustek_usb2.h b/backend/mustek_usb2.h index 9dc3a2b..238a4b6 100644 --- a/backend/mustek_usb2.h +++ b/backend/mustek_usb2.h @@ -18,9 +18,7 @@ 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. + along with this program. If not, see . As a special exception, the authors of SANE give permission for additional uses of the libraries contained in this release of SANE. diff --git a/backend/mustek_usb2_asic.c b/backend/mustek_usb2_asic.c index b31c749..039ffa1 100644 --- a/backend/mustek_usb2_asic.c +++ b/backend/mustek_usb2_asic.c @@ -17,9 +17,7 @@ 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. + along with this program. If not, see . As a special exception, the authors of SANE give permission for additional uses of the libraries contained in this release of SANE. @@ -1674,7 +1672,7 @@ LLFMotorMove (PAsic chip, LLF_MOTORMOVE * LLF_MotorMove) MotorMoveUnit); /*Set motor speed unit, for all motor mode, - //inclue uniform, acc, motor speed of scan */ + //include uniform, acc, motor speed of scan */ Mustek_SendData (chip, ES01_F6_MorotControl1, LLF_MotorMove->MotorSpeedUnit | LLF_MotorMove-> MotorSyncUnit); @@ -1996,7 +1994,7 @@ LLFCalculateMotorTable (LLF_CALCULATEMOTORTABLE * LLF_CalculateMotorTable) for (i = 0; i < 512; i++) { - /* befor scan acc table */ + /* before scan acc table */ *(LLF_CalculateMotorTable->lpMotorTable + i) = (unsigned short) ((LLF_CalculateMotorTable->StartSpeed - LLF_CalculateMotorTable->EndSpeed) * pow (0.09, @@ -2773,7 +2771,7 @@ SetAFEGainOffset (PAsic chip) chip->AD.OffsetR); } else - { /* Postive */ + { /* Positive */ Mustek_SendData (chip, ES01_60_AFE_AUTO_GAIN_OFFSET_RED_LB, (chip->AD.GainR << 1)); Mustek_SendData (chip, ES01_61_AFE_AUTO_GAIN_OFFSET_RED_HB, @@ -4315,7 +4313,7 @@ Asic_SetSource (PAsic chip, LIGHTSOURCE lsLightSource) DBG (DBG_ASIC, "Asic_SetSource: Source is Position\n"); break; case 4: - DBG (DBG_ASIC, "Asic_SetSource: Source is Negtive\n"); + DBG (DBG_ASIC, "Asic_SetSource: Source is Negative\n"); break; default: DBG (DBG_ASIC, "Asic_SetSource: Source error\n"); @@ -4726,7 +4724,7 @@ Asic_SetShadingTable (PAsic chip, unsigned short * lpWhiteShading, DBG (DBG_ASIC, "wValidPixelNumber = %d\n", wValidPixelNumber); /* clear old Shading table, if it has. */ - /* first 4 element and lastest 5 of Shading table can't been used */ + /* first 4 element and latest 5 of Shading table can't been used */ wShadingTableSize = (ShadingTableSize (wValidPixelNumber)) * sizeof (unsigned short); if (chip->lpShadingTable != NULL) { diff --git a/backend/mustek_usb2_asic.h b/backend/mustek_usb2_asic.h index 1a55903..34ebba7 100644 --- a/backend/mustek_usb2_asic.h +++ b/backend/mustek_usb2_asic.h @@ -17,9 +17,7 @@ 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. + along with this program. If not, see . As a special exception, the authors of SANE give permission for additional uses of the libraries contained in this release of SANE. @@ -308,7 +306,7 @@ RGBColor; #define DBG_DET 4 /* more detailed information */ #define DBG_FUNC 5 /* start and exits of high level functions */ #define DBG_ASIC 6 /* starts and exits of low level functions */ -#define DBG_DBG 10 /* usefull only for tracing bugs */ +#define DBG_DBG 10 /* useful only for tracing bugs */ #define DPI_2400 0x8000 @@ -1295,7 +1293,7 @@ static STATUS Asic_ReadCalibrationData (PAsic chip, void * pBuffer, unsigned int dwXferBytes, SANE_Byte bScanBits); /* Set motor move or not */ static STATUS Asic_SetMotorType (PAsic chip, SANE_Bool isMotorMove, SANE_Bool isUniformSpeed); -/* Move Motor Forward or Backword */ +/* Move Motor Forward or Backward */ static STATUS Asic_MotorMove (PAsic chip, SANE_Bool isForward, unsigned int dwTotalSteps); /* Move Motor to Home. */ /* If isTA is TRUE, move TA to home, else move Lamp to home */ diff --git a/backend/mustek_usb2_high.c b/backend/mustek_usb2_high.c index b1ba65e..5119d55 100644 --- a/backend/mustek_usb2_high.c +++ b/backend/mustek_usb2_high.c @@ -17,9 +17,7 @@ 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. + along with this program. If not, see . As a special exception, the authors of SANE give permission for additional uses of the libraries contained in this release of SANE. @@ -3034,7 +3032,7 @@ MustScanner_ReadDataFromScanner (void * dummy) return NULL; } - /*has read in memroy Buffer */ + /*has read in memory Buffer */ wReadImageLines += wScanLinesThisBlock; AddScannedLines (wScanLinesThisBlock); @@ -3203,10 +3201,10 @@ ModifyLinePoint (SANE_Byte * lpImageData, /********************************************************************** Author: Jack Date: 2005/05/15 Routine Description: - Modifiy the image data + Modify the image data Parameters: A: the input the image data - B: the input the iamge data + B: the input the image data Return value: the modified data ***********************************************************************/ diff --git a/backend/mustek_usb2_high.h b/backend/mustek_usb2_high.h index aec79bb..71d770f 100644 --- a/backend/mustek_usb2_high.h +++ b/backend/mustek_usb2_high.h @@ -17,9 +17,7 @@ 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. + along with this program. If not, see . As a special exception, the authors of SANE give permission for additional uses of the libraries contained in this release of SANE. diff --git a/backend/mustek_usb2_reflective.c b/backend/mustek_usb2_reflective.c index aa95e5b..baf80e4 100644 --- a/backend/mustek_usb2_reflective.c +++ b/backend/mustek_usb2_reflective.c @@ -17,9 +17,7 @@ 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. + along with this program. If not, see . As a special exception, the authors of SANE give permission for additional uses of the libraries contained in this release of SANE. @@ -141,10 +139,10 @@ Reflective_Reset () /********************************************************************** Author: Jack Date: 2005/05/13 Routine Description: - get the suggest parameter of scaning + get the suggest parameter of scanning Parameters: - pTarget: the information of scaning - pSuggest: suggest parameter of scaning + pTarget: the information of scanning + pSuggest: suggest parameter of scanning Return value: if the operation is success return TRUE diff --git a/backend/mustek_usb2_transparent.c b/backend/mustek_usb2_transparent.c index 74f7b52..21c7734 100644 --- a/backend/mustek_usb2_transparent.c +++ b/backend/mustek_usb2_transparent.c @@ -17,9 +17,7 @@ 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. + along with this program. If not, see . As a special exception, the authors of SANE give permission for additional uses of the libraries contained in this release of SANE. @@ -133,10 +131,10 @@ Transparent_Reset () /********************************************************************** Author: Jack Date: 2005/05/13 Routine Description: - get suggest parameter of scaning + get suggest parameter of scanning Parameters: - pTarget: the information of scaning - pSuggest: the suggest parameter of scaning + pTarget: the information of scanning + pSuggest: the suggest parameter of scanning Return value: if operation is success return TRUE diff --git a/backend/mustek_usb_high.c b/backend/mustek_usb_high.c index bf7807e..7b03475 100644 --- a/backend/mustek_usb_high.c +++ b/backend/mustek_usb_high.c @@ -18,9 +18,7 @@ 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. + along with this program. If not, see . As a special exception, the authors of SANE give permission for additional uses of the libraries contained in this release of SANE. @@ -279,7 +277,7 @@ usb_high_cal_setup (Calibrator * cal, SANE_Word major_average, SANE_Status usb_high_cal_evaluate_white (Calibrator * cal, double factor) { - /* Caculate white_line */ + /* Calculate white_line */ double loop_division; double average; SANE_Int *buffer; @@ -328,7 +326,7 @@ usb_high_cal_evaluate_dark (Calibrator * cal, double factor) double loop_division; DBG (5, "usb_high_cal_evaluate_dark: start\n"); - /* Caculate dark_line */ + /* Calculate dark_line */ factor *= 16.0; loop_division = (double) (cal->major_average * cal->minor_average); for (i = 0; i < cal->width; i++) @@ -2179,7 +2177,7 @@ usb_high_scan_calibration_rgb_24 (Mustek_Usb_Device * dev) dev->skips_per_row))); } RIE (usb_low_stop_rowing (dev->chip)); - /* Caculate average */ + /* Calculate average */ RIE (usb_high_cal_evaluate_white (dev->green_calibrator, dev->init_green_factor)); RIE (usb_high_cal_evaluate_white (dev->blue_calibrator, @@ -2275,7 +2273,7 @@ usb_high_scan_calibration_mono_8 (Mustek_Usb_Device * dev) dev->skips_per_row))); } RIE (usb_low_stop_rowing (dev->chip)); - /* Caculate average */ + /* Calculate average */ RIE (usb_high_cal_evaluate_white (dev->mono_calibrator, dev->init_gray_factor)); @@ -2295,10 +2293,10 @@ usb_high_scan_calibration_mono_8 (Mustek_Usb_Device * dev) } RIE (usb_low_stop_rowing (dev->chip)); RIE (usb_low_turn_lamp_power (dev->chip, SANE_TRUE)); - /* Caculate Green Black */ + /* Calculate Green Black */ RIE (usb_high_cal_evaluate_dark (dev->mono_calibrator, dev->init_gray_black_factor)); - /* Caculate Mapping */ + /* Calculate Mapping */ RIE (usb_high_cal_evaluate_calibrator (dev->mono_calibrator)); DBG (5, "usb_high_scan_calibration_mono_8: exit\n"); return SANE_STATUS_GOOD; diff --git a/backend/mustek_usb_high.h b/backend/mustek_usb_high.h index 916ecb7..bd12994 100644 --- a/backend/mustek_usb_high.h +++ b/backend/mustek_usb_high.h @@ -18,9 +18,7 @@ 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. + along with this program. If not, see . As a special exception, the authors of SANE give permission for additional uses of the libraries contained in this release of SANE. diff --git a/backend/mustek_usb_low.c b/backend/mustek_usb_low.c index 3e4c760..97f3e54 100644 --- a/backend/mustek_usb_low.c +++ b/backend/mustek_usb_low.c @@ -18,9 +18,7 @@ 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. + along with this program. If not, see . As a special exception, the authors of SANE give permission for additional uses of the libraries contained in this release of SANE. diff --git a/backend/mustek_usb_low.h b/backend/mustek_usb_low.h index 46637e8..34f98da 100644 --- a/backend/mustek_usb_low.h +++ b/backend/mustek_usb_low.h @@ -18,9 +18,7 @@ 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. + along with this program. If not, see . As a special exception, the authors of SANE give permission for additional uses of the libraries contained in this release of SANE. diff --git a/backend/mustek_usb_mid.c b/backend/mustek_usb_mid.c index 5935cb7..6e53276 100644 --- a/backend/mustek_usb_mid.c +++ b/backend/mustek_usb_mid.c @@ -18,9 +18,7 @@ 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. + along with this program. If not, see . As a special exception, the authors of SANE give permission for additional uses of the libraries contained in this release of SANE. diff --git a/backend/mustek_usb_mid.h b/backend/mustek_usb_mid.h index 23e9c32..e4b1e26 100644 --- a/backend/mustek_usb_mid.h +++ b/backend/mustek_usb_mid.h @@ -18,9 +18,7 @@ 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. + along with this program. If not, see . As a special exception, the authors of SANE give permission for additional uses of the libraries contained in this release of SANE. diff --git a/backend/nec.c b/backend/nec.c index d123be0..b61bb37 100644 --- a/backend/nec.c +++ b/backend/nec.c @@ -16,9 +16,7 @@ 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. + along with this program. If not, see . As a special exception, the authors of SANE give permission for additional uses of the libraries contained in this release of SANE. @@ -57,7 +55,7 @@ - change some #include <> to "" Version 0.10 - First release! - - suppoted scanner + - supported scanner PC-IN500/4C available MultiReder 300U/300S series not available MultiReder 600U/600S series not available @@ -1317,7 +1315,7 @@ set_gamma_caps(NEC_Scanner *s) /* The next function is a slightly modified version of sanei_constrain_value Instead of returning status information like STATUS_INVAL, it adjusts - an invaild value to the nearest allowed one. + an invalid value to the nearest allowed one. */ static void clip_value (const SANE_Option_Descriptor * opt, void * value) @@ -1667,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: + /* xxx the titles and descriptions are confusing: "set white point (red)" Any idea? maybe "threshold to get the red component on" */ diff --git a/backend/nec.h b/backend/nec.h index d7848e4..b029192 100644 --- a/backend/nec.h +++ b/backend/nec.h @@ -15,9 +15,7 @@ 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. + along with this program. If not, see . As a special exception, the authors of SANE give permission for additional uses of the libraries contained in this release of SANE. diff --git a/backend/net.c b/backend/net.c index 4ad2e1b..7c4aae9 100644 --- a/backend/net.c +++ b/backend/net.c @@ -16,9 +16,7 @@ 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. + along with this program. If not, see . As a special exception, the authors of SANE give permission for additional uses of the libraries contained in this release of SANE. @@ -2251,7 +2249,7 @@ sane_read (SANE_Handle handle, SANE_Byte * data, SANE_Int max_length, *length = nread; /* Check whether we are scanning with a depth of 16 bits/pixel and whether server and client have different byte order. If this is true, then it's - neccessary to check whether read returned an odd number. If an odd number + necessary to check whether read returned an odd number. If an odd number has been returned, we must save the last byte. */ if ((depth == 16) && (server_big_endian != client_big_endian)) diff --git a/backend/net.h b/backend/net.h index 7d72fdd..dab6019 100644 --- a/backend/net.h +++ b/backend/net.h @@ -16,9 +16,7 @@ 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. + along with this program. If not, see . As a special exception, the authors of SANE give permission for additional uses of the libraries contained in this release of SANE. diff --git a/backend/niash.c b/backend/niash.c index b62bdba..03faa36 100644 --- a/backend/niash.c +++ b/backend/niash.c @@ -12,10 +12,7 @@ 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. - - $Id$ + along with this program. If not, see . */ /* @@ -223,7 +220,7 @@ static const char lineartStr[] = { SANE_VALUE_SCAN_MODE_LINEART }; #define MODE_GRAY 1 #define MODE_LINEART 2 -/* lineart treshold range */ +/* lineart threshold range */ static const SANE_Range rangeThreshold = { 0, 100, @@ -660,7 +657,7 @@ _InitOptions (TScanner * s) pDesc->constraint_type = SANE_CONSTRAINT_RANGE; pDesc->constraint.range = &rangeYmm; pDesc->cap = SANE_CAP_SOFT_SELECT | SANE_CAP_SOFT_DETECT; - pVal->w = 290 /* have a bit reserve instaed of rangeYmm.max */ ; + pVal->w = 290 /* have a bit reserve instead of rangeYmm.max */ ; break; case optDPI: diff --git a/backend/niash_core.c b/backend/niash_core.c index 951ad67..6ed3c27 100644 --- a/backend/niash_core.c +++ b/backend/niash_core.c @@ -12,10 +12,7 @@ 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. - - $Id$ + along with this program. If not, see . */ /* @@ -877,7 +874,7 @@ _UnscrambleLine (unsigned char *pabLine, else { int i, j; /* loop variables */ - int c; /* color buffer accumulator for horizontal avarage */ + int c; /* color buffer accumulator for horizontal average */ /* initialize for incremental color buffer access */ int iInc = 1; @@ -1052,7 +1049,7 @@ CircBufferInit (int iHandle, TDataPipe * p, #define SAFETY_LINES 0 #define MAX_LINES_PER_XFERBUF 800 /* estimate of number of unsigned chars to transfer at all via the USB */ - /* add some lines for securtiy */ + /* add some lines for security */ p->iLinesLeft = iHeight + p->iSkipLines + p->iLinesPerCircBuf + SAFETY_LINES; @@ -1216,7 +1213,7 @@ SimpleCalibExt (THWParams * pHWPar, unsigned char *pabCalibTable, TScanParams Params; unsigned char abGamma[4096]; int i, j; - static unsigned char abBuf[HW_PIXELS * 3 * 71]; /* Carefull : see startWhite and endWhite below */ + static unsigned char abBuf[HW_PIXELS * 3 * 71]; /* Careful : see startWhite and endWhite below */ static unsigned char abLine[HW_PIXELS * 3]; static unsigned char abWhite[HW_PIXELS * 3]; unsigned char *pabWhite; diff --git a/backend/niash_core.h b/backend/niash_core.h index fc0adbd..a7a7891 100644 --- a/backend/niash_core.h +++ b/backend/niash_core.h @@ -12,10 +12,7 @@ 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. - - $Id$ + along with this program. If not, see . */ /* diff --git a/backend/niash_xfer.c b/backend/niash_xfer.c index a3d0ea2..a00e7f8 100644 --- a/backend/niash_xfer.c +++ b/backend/niash_xfer.c @@ -12,10 +12,7 @@ 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. - - $Id$ + along with this program. If not, see . */ /* diff --git a/backend/niash_xfer.h b/backend/niash_xfer.h index b325240..114293c 100644 --- a/backend/niash_xfer.h +++ b/backend/niash_xfer.h @@ -12,10 +12,7 @@ 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. - - $Id$ + along with this program. If not, see . */ /* diff --git a/backend/p5.c b/backend/p5.c index d4b5724..7e25cc1 100644 --- a/backend/p5.c +++ b/backend/p5.c @@ -13,9 +13,7 @@ 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. + along with this program. If not, see . */ /* -------------------------------------------------------------------------- @@ -203,7 +201,7 @@ sane_init (SANE_Int * version_code, SANE_Auth_Callback authorize) * undesirable to call this function first. * @param device_list pointer where to store the device list * @param local_only SANE_TRUE if only local devices are required. - * @return SANE_STATUS_GOOD when successfull + * @return SANE_STATUS_GOOD when successful */ SANE_Status sane_get_devices (const SANE_Device *** device_list, SANE_Bool local_only) @@ -358,7 +356,7 @@ sane_open (SANE_String_Const name, SANE_Handle * handle) } } - /* check wether we have found a match or reach the end of the device list */ + /* check whether we have found a match or reach the end of the device list */ if (!device) { DBG (DBG_info, "sane_open: no device found\n"); @@ -408,7 +406,7 @@ sane_open (SANE_String_Const name, SANE_Handle * handle) return SANE_STATUS_NO_MEM; } - /* initalize session */ + /* initialize session */ session->dev = device; session->scanning = SANE_FALSE; session->non_blocking = SANE_FALSE; @@ -430,8 +428,8 @@ sane_open (SANE_String_Const name, SANE_Handle * handle) /** - * Set non blocking mode. In this mode, read return immediatly when - * no data is available whithin sane_read(), instead of polling the scanner. + * Set non blocking mode. In this mode, read return immediately when + * no data is available within sane_read(), instead of polling the scanner. */ SANE_Status sane_set_io_mode (SANE_Handle handle, SANE_Bool non_blocking) @@ -769,7 +767,7 @@ sane_control_option (SANE_Handle handle, SANE_Int option, return status; } - /* return immediatly if no change */ + /* return immediately if no change */ if (s->options[option].descriptor.type == SANE_TYPE_INT && *(SANE_Word *) val == s->options[option].value.w) { @@ -1340,7 +1338,7 @@ sane_read (SANE_Handle handle, SANE_Byte * buf, * handle h is a valid handle) but usually affects long-running * operations only (such as image is acquisition). It is safe to call * this function asynchronously (e.g., from within a signal handler). - * It is important to note that completion of this operaton does not + * It is important to note that completion of this operation does not * imply that the currently pending operation has been cancelled. It * only guarantees that cancellation has been initiated. Cancellation * completes only when the cancelled call returns (typically with a @@ -1566,7 +1564,8 @@ probe_p5_devices (void) config.count = NUM_CFG_OPTIONS; /* generic configure and attach function */ - status = sanei_configure_attach (P5_CONFIG_FILE, &config, config_attach); + status = sanei_configure_attach (P5_CONFIG_FILE, &config, + config_attach, NULL); /* free allocated options */ for (i = 0; i < NUM_CFG_OPTIONS; i++) { @@ -1590,7 +1589,8 @@ probe_p5_devices (void) * SANE_STATUS_INVAL in case of error */ static SANE_Status -config_attach (SANEI_Config * config, const char *devname) +config_attach (SANEI_Config __sane_unused__ * config, const char *devname, + void __sane_unused__ *data) { /* currently, the config is a global variable so config is useless here */ /* the correct thing would be to have a generic sanei_attach_matching_devices @@ -1599,7 +1599,7 @@ config_attach (SANEI_Config * config, const char *devname) /* 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 + * the corresponding device. Since there is no resources common to each * backends regarding parallel port, we can directly call the attach * function. */ attach_p5 (devname, config); @@ -1684,7 +1684,7 @@ attach_p5 (const char *devicename, SANEI_Config * config) device->next = devices; devices = device; - /* intialization is done at sane_open */ + /* initialization is done at sane_open */ device->initialized = SANE_FALSE; device->calibrated = SANE_FALSE; @@ -1694,7 +1694,7 @@ attach_p5 (const char *devicename, SANEI_Config * config) /** @brief set initial value for the scanning options - * for each sessions, control options are initalized based on the capability + * for each sessions, control options are initialized based on the capability * of the model of the physical device. * @param session scanner session to initialize options * @return SANE_STATUS_GOOD on success @@ -1763,7 +1763,7 @@ init_options (struct P5_Session *session) /** @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 + * pixels. The SANE API allow to control x and y dpi independently, but this is * rarely done and may confuse both frontends and users. In case a dpi value exists * for one but not for the other, the backend will have to crop data so that the * frontend is unaffected. A common case is that motor resolution (ydpi) is higher @@ -2023,7 +2023,7 @@ probe (const char *devicename) /* check for document presence 0xC6: present, 0xC3 no document */ test_document (fd); - /* release device nd parport for next uses */ + /* release device and parport for next uses */ disconnect (fd); close_pp (fd); diff --git a/backend/p5.h b/backend/p5.h index eae62f7..14e953a 100644 --- a/backend/p5.h +++ b/backend/p5.h @@ -13,9 +13,7 @@ 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. + along with this program. If not, see . */ @@ -140,8 +138,8 @@ typedef struct P5_Option } P5_Option; /** - * Frontend session. This struct holds informations usefull for - * the functions defined in SANE's standard. Informations closer + * Frontend session. This struct holds information useful for + * the functions defined in SANE's standard. Information closer * to the hardware are in the P5_Device structure. There is * as many session structure than frontends using the backend. */ @@ -169,7 +167,7 @@ typedef struct P5_Session SANE_Bool scanning; /** @brief non blocking flag - * SANE_TRUE if sane_read are non-blocking, ie returns immediatly if there + * SANE_TRUE if sane_read are non-blocking, ie returns immediately if there * is no data available from the scanning device. Modified by sane_set_io_mode() */ SANE_Bool non_blocking; @@ -195,7 +193,8 @@ typedef struct P5_Session static SANE_Status probe_p5_devices (void); static P5_Model *probe (const char *devicename); -static SANE_Status config_attach (SANEI_Config * config, const char *devname); +static SANE_Status config_attach (SANEI_Config * config, const char *devname, + void *data); static SANE_Status attach_p5 (const char *name, SANEI_Config * config); static SANE_Status init_options (struct P5_Session *session); static SANE_Status compute_parameters (struct P5_Session *session); diff --git a/backend/p5_device.c b/backend/p5_device.c index 4a257a7..a9026f0 100644 --- a/backend/p5_device.c +++ b/backend/p5_device.c @@ -280,7 +280,7 @@ write_reg2 (int fd, uint8_t index, uint16_t value) * to check the scanner is correctly working. * @param fd file descriptor used to access hardware * @param addr address where to write and read - * @return SANE_TRUE on succes, SANE_FALSE otherwise + * @return SANE_TRUE on success, SANE_FALSE otherwise */ static int memtest (int fd, uint16_t addr) @@ -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 available byte number */ static int available_bytes (int fd) @@ -1122,7 +1122,7 @@ cleanup_calibration (P5_Device * dev) } /** detect a black scan line - * parses the given buffer and retrun SANE_TRUE if the line is an + * parses the given buffer and return SANE_TRUE if the line is an * acceptable black line for calibration * @param buffer data line to parse * @param pixels number of pixels @@ -1171,7 +1171,7 @@ is_black_line (uint8_t * buffer, unsigned int pixels, int mode) } /** detect a white scan line - * parses the given buffer and retrun SANE_TRUE if the line is an + * parses the given buffer and return SANE_TRUE if the line is an * acceptable white line for calibration * @param buffer data line to parse * @param pixels number of pixels diff --git a/backend/p5_device.h b/backend/p5_device.h index 744fe1c..c914279 100644 --- a/backend/p5_device.h +++ b/backend/p5_device.h @@ -13,9 +13,7 @@ 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. + along with this program. If not, see . */ /** @file p5_device.h @@ -85,7 +83,7 @@ typedef struct P5_Calibration_Data /** * This structure describes a particular model which is handled by the backend. - * Contained data is immutable and is used to initalize the P5_Device + * Contained data is immutable and is used to initialize the P5_Device * structure. */ typedef struct P5_Model @@ -178,7 +176,7 @@ typedef struct P5_Device struct P5_Device *next; /** - * Points to a structure that decribes model capabilities, geometry + * Points to a structure that describes model capabilities, geometry * and default settings. */ P5_Model *model; @@ -197,7 +195,7 @@ typedef struct P5_Device SANE_Bool local; /** - * True if device has been intialized. + * True if device has been initialized. */ SANE_Bool initialized; @@ -211,7 +209,7 @@ typedef struct P5_Device /** @brief scan parameters * The scan done by the hardware can be different from the one at the SANE * frontend session. For instance: - * - xdpy and ydpi may be different to accomodate hardware capabilites. + * - xdpy and ydpi may be different to accommodate hardware capabilities. * - 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 f80e1da..05aa18f 100644 --- a/backend/pie-scsidef.h +++ b/backend/pie-scsidef.h @@ -19,9 +19,7 @@ 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. + along with this program. If not, see . As a special exception, the authors of SANE give permission for additional uses of the libraries contained in this release of SANE. diff --git a/backend/pie.c b/backend/pie.c index 0e56a5a..b5be0a2 100644 --- a/backend/pie.c +++ b/backend/pie.c @@ -17,9 +17,7 @@ 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. + along with this program. If not, see . As a special exception, the authors of SANE give permission for additional uses of the libraries contained in this release of SANE. @@ -60,7 +58,7 @@ * 11-11-2000 eliminated some warnings about signed/unsigned comparisons * removed #undef NDEBUG and C++ style comments * - * 1-10-2000 force gamma table to one to one mappping if lineart or halftone selected + * 1-10-2000 force gamma table to one to one mapping if lineart or halftone selected * * 30-9-2000 added ADLIB devices to scanner_str[] * @@ -1689,7 +1687,7 @@ pie_perform_cal (Pie_Scanner * scanner, int cal_index) send_length += 4; /* space for header at start of data */ - /* alllocate buffers for the receive data, the result buffers, and for the send data */ + /* allocate buffers for the receive data, the result buffers, and for the send data */ rcv_buffer = (unsigned char *) malloc (rcv_length); red_result = (long *) calloc (pixels_per_line, sizeof (long)); diff --git a/backend/pieusb.c b/backend/pieusb.c index 9730888..a070fc0 100644 --- a/backend/pieusb.c +++ b/backend/pieusb.c @@ -17,9 +17,7 @@ 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. + along with this program. If not, see . As a special exception, the authors of SANE give permission for additional uses of the libraries contained in this release of SANE. @@ -853,7 +851,7 @@ sane_get_parameters (SANE_Handle handle, SANE_Parameters * params) } /** - * Initiates aquisition of an image from the scanner. + * Initiates acquisition of an image from the scanner. * SCAN Phase 1: initialization and calibration * (SCAN Phase 2: line-by-line scan & read is not implemented) * SCAN Phase 3: get CCD-mask diff --git a/backend/pieusb.h b/backend/pieusb.h index dc4cda7..1c614c7 100644 --- a/backend/pieusb.h +++ b/backend/pieusb.h @@ -17,9 +17,7 @@ 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. + along with this program. If not, see . As a special exception, the authors of SANE give permission for additional uses of the libraries contained in this release of SANE. diff --git a/backend/pieusb_buffer.c b/backend/pieusb_buffer.c index 8c67a65..76e99f2 100644 --- a/backend/pieusb_buffer.c +++ b/backend/pieusb_buffer.c @@ -17,9 +17,7 @@ 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. + along with this program. If not, see . As a special exception, the authors of SANE give permission for additional uses of the libraries contained in this release of SANE. @@ -548,7 +546,7 @@ sanei_pieusb_buffer_get(struct Pieusb_Read_Buffer* buffer, SANE_Byte* data, SANE } } else { /* not implemented */ - DBG(DBG_error, "buffer_put(): paccket size & density of %d/%d not implementd\n", buffer->packet_size_bytes, buffer->packing_density); + DBG(DBG_error, "buffer_put(): paccket size & density of %d/%d not implemented\n", buffer->packet_size_bytes, buffer->packing_density); return; } *len = n; diff --git a/backend/pieusb_buffer.h b/backend/pieusb_buffer.h index 282595a..8c37918 100644 --- a/backend/pieusb_buffer.h +++ b/backend/pieusb_buffer.h @@ -17,9 +17,7 @@ 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. + along with this program. If not, see . As a special exception, the authors of SANE give permission for additional uses of the libraries contained in this release of SANE. diff --git a/backend/pieusb_scancmd.c b/backend/pieusb_scancmd.c index 672716f..583c4ac 100644 --- a/backend/pieusb_scancmd.c +++ b/backend/pieusb_scancmd.c @@ -17,9 +17,7 @@ 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. + along with this program. If not, see . As a special exception, the authors of SANE give permission for additional uses of the libraries contained in this release of SANE. @@ -47,7 +45,7 @@ * Pieusb scanner commands * * Each scanner command has its own function. - * See the sort description preceeding each function. + * See the sort description preceding each function. * * ========================================================================= */ @@ -245,7 +243,7 @@ sanei_pieusb_cmd_slide(SANE_Int device_number, slide_action action, struct Pieus * @param device_number Device number * @param sense Sense data * @param status Command result status - * @see struc Pieusb_Sense + * @see struct Pieusb_Sense */ void sanei_pieusb_cmd_get_sense(SANE_Int device_number, struct Pieusb_Sense* sense, struct Pieusb_Command_Status *status, PIEUSB_Status *ret) @@ -269,7 +267,7 @@ sanei_pieusb_cmd_get_sense(SANE_Int device_number, struct Pieusb_Sense* sense, s return; } - /* Decode data recieved */ + /* Decode data received */ sense->errorCode = _get_byte (data, 0); sense->segment = _get_byte (data, 1); sense->senseKey = _get_byte (data, 2); @@ -622,7 +620,7 @@ sanei_pieusb_cmd_get_parameters(SANE_Int device_number, struct Pieusb_Scan_Param * e: d7 00 available lines 215 * 10:00 00 */ - /* Decode data recieved */ + /* Decode data received */ parameters->width = _get_short(data, 0); parameters->lines = _get_short(data, 2); parameters->bytes = _get_short(data, 4); @@ -675,7 +673,7 @@ sanei_pieusb_cmd_inquiry(SANE_Int device_number, struct Pieusb_Scanner_Propertie return; } - /* Decode data recieved */ + /* Decode data received */ inq->deviceType = _get_byte(data, 0); inq->additionalLength = _get_byte(data, 4); _copy_bytes((SANE_Byte*)(inq->vendor), data+8, 8); /* Note: not 0-terminated */ @@ -859,7 +857,7 @@ sanei_pieusb_cmd_get_mode(SANE_Int device_number, struct Pieusb_Mode* mode, stru return; } - /* Decode data recieved */ + /* Decode data received */ mode->resolution = _get_short (data, 2); mode->passes = _get_byte (data, 4); mode->colorDepth = _get_byte (data, 5); @@ -1185,7 +1183,7 @@ sanei_pieusb_cmd_read_state(SANE_Int device_number, struct Pieusb_Scanner_State* data[5] = 1; status->pieusb_status = PIEUSB_STATUS_GOOD; } - /* Decode data recieved */ + /* Decode data received */ state->buttonPushed = _get_byte(data, 0); state->warmingUp = _get_byte(data, 5); state->scanning = _get_byte(data, 6); diff --git a/backend/pieusb_scancmd.h b/backend/pieusb_scancmd.h index 5eefa55..4f24aec 100644 --- a/backend/pieusb_scancmd.h +++ b/backend/pieusb_scancmd.h @@ -17,9 +17,7 @@ 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. + along with this program. If not, see . As a special exception, the authors of SANE give permission for additional uses of the libraries contained in this release of SANE. @@ -167,7 +165,7 @@ struct Pieusb_Mode { SANE_Byte colorFormat; /* 0x04 = index, cf. INQUIRY * bit 7-3 : 0 (unused) - * bit 2 : Index = scanned data are lines preceeded by a two-byte index, 'RR', 'GG', 'BB', or 'II' + * bit 2 : Index = scanned data are lines preceded by a two-byte index, 'RR', 'GG', 'BB', or 'II' * bit 1 : Line = scanned data are (probably) lines in RGBI order (needs testing) * bit 0 : Pixel = scanned data are always RGB-pixels, i.e. 3x2 bytes at depth = 16 bits, 3 bytes * at depth = 8 bits, and 3 packed bytes at depth = 1. This is also the case in diff --git a/backend/pieusb_specific.c b/backend/pieusb_specific.c index 1b5f0f4..033ad03 100644 --- a/backend/pieusb_specific.c +++ b/backend/pieusb_specific.c @@ -17,9 +17,7 @@ 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. + along with this program. If not, see . As a special exception, the authors of SANE give permission for additional uses of the libraries contained in this release of SANE. @@ -82,7 +80,7 @@ static void pieusb_calculate_shading(struct Pieusb_Scanner *scanner, SANE_Byte* /* sub to sanei_pieusb_post() */ static SANE_Status pieusb_write_pnm_file (char *filename, uint16_t *data, int depth, int channels, int pixels_per_line, int lines); -/* Auxilary */ +/* Auxiliary */ static size_t max_string_size (SANE_String_Const const strings[]); static double getGain(int gain); static int getGainSetting(double gain); @@ -1171,7 +1169,7 @@ sanei_pieusb_on_cancel (Pieusb_Scanner * scanner) } /** - * Determine maximum lengt of a set of strings. + * Determine maximum length of a set of strings. * * @param strings Set of strings * @return maximum length @@ -1672,7 +1670,7 @@ static void pieusb_calculate_shading(struct Pieusb_Scanner *scanner, SANE_Byte* SANE_Int shading_width = scanner->device->shading_parameters[0].pixelsPerLine; SANE_Int shading_height = scanner->device->shading_parameters[0].nLines; - /* Initialze all to 0 */ + /* Initialize all to 0 */ for (k = 0; k < SHADING_PARAMETERS_INFO_COUNT; k++) { scanner->shading_max[k] = 0; scanner->shading_mean[k] = 0; @@ -1862,7 +1860,7 @@ sanei_pieusb_set_mode_from_options(Pieusb_Scanner * scanner) * - values default (pieusb_set_default_gain_offset) * - values set by options * - values set by auto-calibration procedure - * - values determined from preceeding preview + * - values determined from preceding preview * * @param scanner * @return @@ -1897,7 +1895,7 @@ sanei_pieusb_set_gain_offset(Pieusb_Scanner * scanner, const char *calibration_m status.pieusb_status = PIEUSB_STATUS_GOOD; } else if ((strcmp(calibration_mode, SCAN_CALIBRATION_PREVIEW) == 0) && scanner->preview_done) { - /* If no preview data availble, do the auto-calibration. */ + /* If no preview data available, do the auto-calibration. */ double dg, dgi; DBG (DBG_info, "sanei_pieusb_set_gain_offset(): get calibration data from preview. scanner->mode.passes %d\n", scanner->mode.passes); switch (scanner->mode.passes) { diff --git a/backend/pieusb_specific.h b/backend/pieusb_specific.h index f516960..483e8b4 100644 --- a/backend/pieusb_specific.h +++ b/backend/pieusb_specific.h @@ -17,9 +17,7 @@ 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. + along with this program. If not, see . As a special exception, the authors of SANE give permission for additional uses of the libraries contained in this release of SANE. diff --git a/backend/pieusb_usb.c b/backend/pieusb_usb.c index 31008fa..dc646af 100644 --- a/backend/pieusb_usb.c +++ b/backend/pieusb_usb.c @@ -17,9 +17,7 @@ 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. + along with this program. If not, see . As a special exception, the authors of SANE give permission for additional uses of the libraries contained in this release of SANE. diff --git a/backend/pieusb_usb.h b/backend/pieusb_usb.h index dee3212..08fc348 100644 --- a/backend/pieusb_usb.h +++ b/backend/pieusb_usb.h @@ -17,9 +17,7 @@ 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. + along with this program. If not, see . As a special exception, the authors of SANE give permission for additional uses of the libraries contained in this release of SANE. diff --git a/backend/pint.c b/backend/pint.c index f0cc697..7ab53e5 100644 --- a/backend/pint.c +++ b/backend/pint.c @@ -14,9 +14,7 @@ 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. + along with this program. If not, see . As a special exception, the authors of SANE give permission for additional uses of the libraries contained in this release of SANE. diff --git a/backend/pint.h b/backend/pint.h index 773dcee..dfc76d7 100644 --- a/backend/pint.h +++ b/backend/pint.h @@ -13,9 +13,7 @@ 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. + along with this program. If not, see . As a special exception, the authors of SANE give permission for additional uses of the libraries contained in this release of SANE. diff --git a/backend/pixma.conf.in b/backend/pixma.conf.in index d6184b4..dcf88d3 100644 --- a/backend/pixma.conf.in +++ b/backend/pixma.conf.in @@ -6,7 +6,7 @@ # networking=no # # bjnp-timeout=5000 -# Specify the timeout (in ms) to be used for all the folllowing +# Specify the timeout (in ms) to be used for all the following # scanners. # May be specified multiple times. # The last value (if any) will be used for auto-detection diff --git a/backend/pixma/pixma.c b/backend/pixma/pixma.c index c32907c..b4e423d 100644 --- a/backend/pixma/pixma.c +++ b/backend/pixma/pixma.c @@ -17,9 +17,7 @@ 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. + along with this program. If not, see . As a special exception, the authors of SANE give permission for additional uses of the libraries contained in this release of SANE. @@ -116,6 +114,8 @@ typedef struct pixma_sane_t uint8_t gamma_table[4096]; SANE_String_Const source_list[4]; pixma_paper_source_t source_map[4]; + SANE_String_Const calibrate_list[PIXMA_CALIBRATE_NUM_OPTS + 1]; + pixma_calibrate_option_t calibrate_map[PIXMA_CALIBRATE_NUM_OPTS + 1]; unsigned byte_pos_in_line, output_line_size; uint64_t image_bytes_read; @@ -159,10 +159,11 @@ static void mark_all_button_options_cached ( struct pixma_sane_t * ss ) ss -> button_option_is_cached[i] = 1; } -static SANE_Status config_attach_pixma(SANEI_Config * config, const char *devname) +static SANE_Status config_attach_pixma(SANEI_Config __sane_unused__ * config, + const char *devname, + void __sane_unused__ *data) { int i; - UNUSED(config); for (i=0; i < (MAX_CONF_DEVICES -1); i++) { if(conf_devices[i] == NULL) @@ -504,6 +505,22 @@ create_dpi_list (pixma_sane_t * ss) /*PDBG (pixma_dbg (4, "*create_dpi_list***** min_dpi = %d, max_dpi = %d\n", min_dpi, max_dpi));*/ } + +static void +create_calibrate_list (pixma_sane_t * ss) +{ + int i = 0; + ss->calibrate_list[i] = SANE_I18N ("Once"); + ss->calibrate_map[i] = PIXMA_CALIBRATE_ONCE; + i++; + ss->calibrate_list[i] = SANE_I18N ("Always"); + ss->calibrate_map[i] = PIXMA_CALIBRATE_ALWAYS; + i++; + ss->calibrate_list[i] = SANE_I18N ("Never"); + ss->calibrate_map[i] = PIXMA_CALIBRATE_NEVER; + i++; +} + static void select_value_from_list (pixma_sane_t * ss, SANE_Int n, void *v, SANE_Int * info) @@ -935,6 +952,7 @@ calc_scan_param (pixma_sane_t * ss, pixma_scan_param_t * sp) sp->threshold = 2.55 * OVAL (opt_threshold).w; sp->threshold_curve = OVAL (opt_threshold_curve).w; sp->adf_wait = OVAL (opt_adf_wait).w; + sp->calibrate = ss->calibrate_map[OVAL (opt_calibrate).w]; error = pixma_check_scan_param (ss->s, sp); if (error < 0) @@ -997,6 +1015,8 @@ init_option_descriptors (pixma_sane_t * ss) i++; } + create_calibrate_list (ss); + build_option_descriptors (ss); /* Enable options that are available only in some scanners. */ @@ -1433,8 +1453,8 @@ static void pixma_jpeg_read(pixma_sane_t *ss, SANE_Byte *data, SANE_Int max_length, SANE_Int *length) { - struct jpeg_decompress_struct cinfo = ss->jpeg_cinfo; - pixma_jpeg_src_mgr *src = (pixma_jpeg_src_mgr *)ss->jpeg_cinfo.src; + struct jpeg_decompress_struct *cinfo = &ss->jpeg_cinfo; + pixma_jpeg_src_mgr *src = (pixma_jpeg_src_mgr *)cinfo->src; int l; @@ -1454,7 +1474,7 @@ pixma_jpeg_read(pixma_sane_t *ss, SANE_Byte *data, return; } - if (cinfo.output_scanline >= cinfo.output_height) + if (cinfo->output_scanline >= cinfo->output_height) { *length = 0; return; @@ -1464,7 +1484,7 @@ pixma_jpeg_read(pixma_sane_t *ss, SANE_Byte *data, * only one line at time is supported */ - l = jpeg_read_scanlines(&cinfo, ss->jdst->buffer, 1); + l = jpeg_read_scanlines(cinfo, ss->jdst->buffer, 1); if (l == 0) return; @@ -1472,7 +1492,7 @@ pixma_jpeg_read(pixma_sane_t *ss, SANE_Byte *data, * linebuffer holds width * bytesperpixel */ - (*ss->jdst->put_pixel_rows)(&cinfo, ss->jdst, 1, (char *)src->linebuffer); + (*ss->jdst->put_pixel_rows)(cinfo, ss->jdst, 1, (char *)src->linebuffer); *length = ss->sp.w * ss->sp.channels; /* Convert RGB into grayscale */ @@ -1505,9 +1525,9 @@ pixma_jpeg_read(pixma_sane_t *ss, SANE_Byte *data, b = (b << 1) | 0; else b = (b << 1) | 1; + if ((i % 8) == 0) + *(d++) = b; } - if ((i % 8) == 0) - *(d++) = b; } src->linebuffer_size = *length; @@ -1656,8 +1676,8 @@ sane_init (SANE_Int * version_code, SANE_Auth_Callback authorize) config.descriptors = NULL; config.values = NULL; - if (sanei_configure_attach(PIXMA_CONFIG_FILE, &config, config_attach_pixma) != - SANE_STATUS_GOOD) + if (sanei_configure_attach(PIXMA_CONFIG_FILE, &config, + config_attach_pixma, NULL) != SANE_STATUS_GOOD) PDBG(pixma_dbg(2, "Could not read pixma configuration file: %s\n", PIXMA_CONFIG_FILE)); @@ -2255,9 +2275,16 @@ type int adf-wait default 0 constraint (0,3600,1) title ADF Waiting Time - desc When set, the scanner waits upto the specified time in seconds for a new document inserted into the automatic document feeder. + desc When set, the scanner waits up to the specified time in seconds for a new document inserted into the automatic document feeder. cap soft_select soft_detect automatic inactive +type string calibrate[30] + constraint @string_list = ss->calibrate_list + title Calibration + desc When to perform scanner calibration. If you choose \"Once\" it will be performed a single time per driver init for single page scans, and for the first page for each ADF scan. + default Once + cap soft_select soft_detect automatic + rem ------------------------------------------- END SANE_Option_Descriptor */ diff --git a/backend/pixma/pixma.h b/backend/pixma/pixma.h index c9026a7..dc07cfa 100644 --- a/backend/pixma/pixma.h +++ b/backend/pixma/pixma.h @@ -17,9 +17,7 @@ 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. + along with this program. If not, see . As a special exception, the authors of SANE give permission for additional uses of the libraries contained in this release of SANE. @@ -120,7 +118,7 @@ typedef uint32_t uint32_t; /**@{*/ #define PIXMA_VERSION_MAJOR 0 #define PIXMA_VERSION_MINOR 28 -#define PIXMA_VERSION_BUILD 5 +#define PIXMA_VERSION_BUILD 6 /**@}*/ /** \name Error codes */ @@ -157,8 +155,9 @@ typedef uint32_t uint32_t; #define PIXMA_CAP_NEGATIVE (1 << 10) #define PIXMA_CAP_TPUIR ((1 << 11) | PIXMA_CAP_TPU) #define PIXMA_CAP_ADF_WAIT (1 << 12) -#define PIXMA_CAP_ADF_JPEG (1 << 13) -#define PIXMA_CAP_GT_4096 (1 << 14) /* gamma table has 4096 8-bit values +#define PIXMA_CAP_ADF_JPEG (1 << 13) /* scanner returns image as jpeg from ADF */ +#define PIXMA_CAP_JPEG (1 << 14) /* scanner always returns image as jpeg */ +#define PIXMA_CAP_GT_4096 (1 << 15) /* gamma table has 4096 8-bit values * only generation 1 scanners * usually gamma table has 1024 16-bit values */ @@ -224,7 +223,8 @@ typedef enum pixma_paper_source_t PIXMA_SOURCE_FLATBED, PIXMA_SOURCE_ADF, PIXMA_SOURCE_TPU, - PIXMA_SOURCE_ADFDUP /* duplex */ + PIXMA_SOURCE_ADFDUP, /* duplex */ + PIXMA_SOURCE_NONE } pixma_paper_source_t; /** Scan modes */ @@ -276,6 +276,14 @@ typedef enum pixma_calibration_status_t PIXMA_CALIBRATION_ERROR } pixma_calibration_status_t; +typedef enum pixma_calibrate_option_t +{ + PIXMA_CALIBRATE_ONCE, + PIXMA_CALIBRATE_ALWAYS, + PIXMA_CALIBRATE_NEVER, + PIXMA_CALIBRATE_NUM_OPTS +} pixma_calibrate_option_t; + /** Device status. */ struct pixma_device_status_t { @@ -305,7 +313,7 @@ struct pixma_scan_param_t * 1 = 1 bit B/W lineart (flatbed) * 8 = 8 bit grayscale, * 24 bit color (both flatbed) - * 16 = 16 bit grayscale (TPU, flatbed not implemeted), + * 16 = 16 bit grayscale (TPU, flatbed not implemented), * 48 bit color (TPU, flatbed not implemented) */ unsigned depth; @@ -359,6 +367,9 @@ struct pixma_scan_param_t /** \see #pixma_scan_mode_t */ pixma_scan_mode_t mode; + /** \see #pixma_calibrate_option_t */ + pixma_calibrate_option_t calibrate; + /** The current page # in the same ADF scan session, 0 in non ADF */ unsigned adf_pageid; @@ -510,6 +521,12 @@ int pixma_enable_background (pixma_t *, int enabled); */ int pixma_get_device_status (pixma_t *, pixma_device_status_t * status); +/** Decide whether to run calibration or not. + * Decision takes into account scan_param, source and last_source. + * \return 0x01 for calibration and 0x00 for no calibration + */ +unsigned pixma_calc_calibrate (pixma_t *); + const char *pixma_get_string (pixma_t *, pixma_string_index_t); const pixma_config_t *pixma_get_config (pixma_t *); void pixma_fill_gamma_table (double gamma, uint8_t * table, unsigned n); diff --git a/backend/pixma/pixma_bjnp.c b/backend/pixma/pixma_bjnp.c index 4e83714..63dd56d 100644 --- a/backend/pixma/pixma_bjnp.c +++ b/backend/pixma/pixma_bjnp.c @@ -15,8 +15,8 @@ License for more details. You should have received a copy of the GNU General Public License - along with sane; see the file COPYING. If not, write to the Free - Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + along with sane; see the file COPYING. + If not, see . As a special exception, the authors of SANE give permission for additional uses of the libraries contained in this release of SANE. @@ -661,8 +661,8 @@ 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 + * send udp command to given device and receive the response` + * returns: the length of the response or -1 */ int sockfd; struct timeval timeout; @@ -958,7 +958,7 @@ prepare_socket(const char *if_name, const bjnp_sockaddr_t *local_sa, * local_sa: local address to use * broadcast_sa: broadcast address to use, if NULL we use all hosts * dest_sa: (write) where to return destination address of broadcast - * retuns: open socket or -1 + * returns: open socket or -1 */ int socket = -1; @@ -1831,7 +1831,7 @@ bjnp_allocate_device (SANE_String_Const devname, /* 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 - * an IPv6 host can have multiple adresses */ + * an IPv6 host can have multiple addresses */ if ( strcmp( device[i].mac_address, device[bjnp_no_devices].mac_address ) == 0 ) { @@ -2392,9 +2392,9 @@ sanei_bjnp_set_timeout (SANE_Int devno, SANE_Int timeout) * @param size size of the data * * @return - * - SANE_STATUS_GOOD - on succes + * - SANE_STATUS_GOOD - on success * - SANE_STATUS_EOF - if zero bytes have been read - * - SANE_STATUS_IO_ERROR - if an error occured during the read + * - SANE_STATUS_IO_ERROR - if an error occurred during the read * - SANE_STATUS_INVAL - on every other error * */ @@ -2456,7 +2456,7 @@ sanei_bjnp_read_bulk (SANE_Int dn, SANE_Byte * buffer, size_t * size) if ( device[dn].scanner_data_left < device[dn].blocksize) { /* 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 */ + /* we now determine end of data by comparing the payload size to the maximum blocksize */ /* this block is shorter than blocksize, so after this block we are done */ device[dn].last_block = 1; @@ -2493,7 +2493,7 @@ sanei_bjnp_read_bulk (SANE_Int dn, SANE_Byte * buffer, size_t * 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 expects %ld\n", (recvd == *size)? "OK": "NOTICE",recvd, *size ) ); *size = recvd; if ( *size == 0 ) @@ -2511,8 +2511,8 @@ sanei_bjnp_read_bulk (SANE_Int dn, SANE_Byte * buffer, size_t * size) * @param size size of the data * * @return - * - SANE_STATUS_GOOD - on succes - * - SANE_STATUS_IO_ERROR - if an error occured during the write + * - SANE_STATUS_GOOD - on success + * - SANE_STATUS_IO_ERROR - if an error occurred during the write * - SANE_STATUS_INVAL - on every other error */ @@ -2584,9 +2584,9 @@ sanei_bjnp_write_bulk (SANE_Int dn, const SANE_Byte * buffer, size_t * size) * @param size size of the data * * @return - * - SANE_STATUS_GOOD - on succes + * - SANE_STATUS_GOOD - on success * - SANE_STATUS_EOF - if zero bytes have been read - * - SANE_STATUS_IO_ERROR - if an error occured during the read + * - SANE_STATUS_IO_ERROR - if an error occurred during the read * - SANE_STATUS_INVAL - on every other error * */ diff --git a/backend/pixma/pixma_bjnp.h b/backend/pixma/pixma_bjnp.h index 79e084e..3f4ab53 100644 --- a/backend/pixma/pixma_bjnp.h +++ b/backend/pixma/pixma_bjnp.h @@ -18,8 +18,8 @@ License for more details. You should have received a copy of the GNU General Public License - along with sane; see the file COPYING. If not, write to the Free - Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + along with sane; see the file COPYING. + If not, see . As a special exception, the authors of SANE give permission for additional uses of the libraries contained in this release of SANE. @@ -151,9 +151,9 @@ extern void sanei_bjnp_set_timeout (SANE_Int devno, SANE_Int timeout); * @param size size of the data * * @return - * - SANE_STATUS_GOOD - on succes + * - SANE_STATUS_GOOD - on success * - SANE_STATUS_EOF - if zero bytes have been read - * - SANE_STATUS_IO_ERROR - if an error occured during the read + * - SANE_STATUS_IO_ERROR - if an error occurred during the read * - SANE_STATUS_INVAL - on every other error * */ @@ -170,8 +170,8 @@ sanei_bjnp_read_bulk (SANE_Int dn, SANE_Byte * buffer, size_t * size); * @param size size of the data * * @return - * - SANE_STATUS_GOOD - on succes - * - SANE_STATUS_IO_ERROR - if an error occured during the write + * - SANE_STATUS_GOOD - on success + * - SANE_STATUS_IO_ERROR - if an error occurred during the write * - SANE_STATUS_INVAL - on every other error */ extern SANE_Status @@ -187,9 +187,9 @@ sanei_bjnp_write_bulk (SANE_Int dn, const SANE_Byte * buffer, size_t * size); * @param size size of the data * * @return - * - SANE_STATUS_GOOD - on succes + * - SANE_STATUS_GOOD - on success * - SANE_STATUS_EOF - if zero bytes have been read - * - SANE_STATUS_IO_ERROR - if an error occured during the read + * - SANE_STATUS_IO_ERROR - if an error occurred during the read * - SANE_STATUS_INVAL - on every other error * */ diff --git a/backend/pixma/pixma_bjnp_private.h b/backend/pixma/pixma_bjnp_private.h index 19ba496..c759fc7 100644 --- a/backend/pixma/pixma_bjnp_private.h +++ b/backend/pixma/pixma_bjnp_private.h @@ -26,8 +26,8 @@ License for more details. You should have received a copy of the GNU General Public License - along with sane; see the file COPYING. If not, write to the Free - Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + along with sane; see the file COPYING. + If not, see . As a special exception, the authors of SANE give permission for additional uses of the libraries contained in this release of SANE. @@ -80,7 +80,7 @@ /* timers */ #define BJNP_BROADCAST_INTERVAL 10 /* ms between broadcasts */ #define BJNP_BC_RESPONSE_TIMEOUT 500 /* waiting time for broadc. responses */ -#define BJNP_TIMEOUT_DEFAULT 10000 /* minimum tiemout value for network operations */ +#define BJNP_TIMEOUT_DEFAULT 10000 /* minimum timeout value for network operations */ #define BJNP_TIMEOUT_TCP_CONNECT 2000 /* timeout for tcp connect attempts in ms */ #define BJNP_USLEEP_MS 1000 /* sleep for 1 msec */ #define BJNP_TCP_CONNECT_INTERVAL 100 /* TCP retry interval in ms */ @@ -187,7 +187,7 @@ struct __attribute__ ((__packed__)) BJNP_command struct __attribute__ ((__packed__)) DISCOVER_RESPONSE { - struct BJNP_command response; /* reponse header */ + struct BJNP_command response; /* response header */ char unknown1[4]; /* 00 01 08 00 */ char mac_len; /* length of mac address */ char addr_len; /* length of address field */ @@ -354,7 +354,7 @@ typedef struct device_s /* sockets */ - int tcp_socket; /* open tcp socket for communcation to scannner */ + int tcp_socket; /* open tcp socket for communication to scannner */ int16_t serial; /* sequence number of command */ /* communication state */ diff --git a/backend/pixma/pixma_common.c b/backend/pixma/pixma_common.c index 436311a..6bce4bc 100644 --- a/backend/pixma/pixma_common.c +++ b/backend/pixma/pixma_common.c @@ -17,9 +17,7 @@ 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. + along with this program. If not, see . As a special exception, the authors of SANE give permission for additional uses of the libraries contained in this release of SANE. @@ -56,8 +54,6 @@ #if defined(HAVE_LIBXML2) # include -#else -# error "The pixma backend requires libxml2" #endif #include "pixma_rename.h" @@ -682,7 +678,7 @@ pixma_cmd_transaction (pixma_t * s, const void *cmd, unsigned cmdlen, going back to the home position after the last scan session has been cancelled, you won't get the response before it arrives home. This takes about 5 seconds. If the last session was succeeded, the scanner will - immediatly answer with PIXMA_STATUS_BUSY. + immediately answer with PIXMA_STATUS_BUSY. Is 8 seconds timeout enough? This affects ALL commands that use pixma_cmd_transaction(). Default value set in pixma_open(). */ @@ -814,6 +810,7 @@ pixma_open (unsigned devnr, pixma_t ** handle) strncpy (s->id, pixma_get_device_id (devnr), sizeof (s->id) - 1); s->ops = s->cfg->ops; s->scanning = 0; + s->last_source = PIXMA_SOURCE_NONE; error = s->ops->open (s); if (error < 0) goto rollback; @@ -967,6 +964,8 @@ pixma_read_image (pixma_t * s, void *buf, unsigned len) if (result == 0) { /* end of image? */ s->ops->finish_scan (s); + /* set last source after successful scan */ + s->last_source = s->param->source; if ((s->cur_image_size != s->param->image_size) && !s->param->mode_jpeg) { pixma_dbg (1, "WARNING:image size mismatches\n"); @@ -1140,6 +1139,9 @@ pixma_check_scan_param (pixma_t * s, pixma_scan_param_t * sp) sp->source)); } break; + case PIXMA_SOURCE_NONE: + /* this source can not be selected */ + break; } if (sp->depth == 0) @@ -1241,6 +1243,22 @@ pixma_get_device_status (pixma_t * s, pixma_device_status_t * status) return s->ops->get_status (s, status); } +unsigned +pixma_calc_calibrate (pixma_t * p) +{ + pixma_scan_param_t * sp = p->param; + if (sp->calibrate == PIXMA_CALIBRATE_ALWAYS) + return 0x01; + if (sp->calibrate == PIXMA_CALIBRATE_NEVER) + return 0x00; + /* sp->calibrate == PIXMA_CALIBRATE_ONCE */ + if (sp->source == PIXMA_SOURCE_ADF || sp->source == PIXMA_SOURCE_ADFDUP) + return sp->adf_pageid == 0 ? 0x01 : 0x00; + /* sp->source == PIXMA_SOURCE_FLATBED | TPU */ + return sp->source == p->last_source ? 0x00 : 0x01; +} + +#if defined(HAVE_LIBXML2) static const char * format_xml_response(const char *resp_details) { @@ -1334,3 +1352,4 @@ clean: xmlFreeDoc(doc); return status; } +#endif diff --git a/backend/pixma/pixma_common.h b/backend/pixma/pixma_common.h index 3e4e5bd..5b393dc 100644 --- a/backend/pixma/pixma_common.h +++ b/backend/pixma/pixma_common.h @@ -16,9 +16,7 @@ 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. + along with this program. If not, see . As a special exception, the authors of SANE give permission for additional uses of the libraries contained in this release of SANE. @@ -119,6 +117,7 @@ struct pixma_t uint32_t events; void *subdriver; /* can be used by model driver. */ int rec_tmo; /* receive timeout [s] */ + pixma_paper_source_t last_source; /* used for calibrate=once */ /* private */ uint64_t cur_image_size; @@ -162,7 +161,7 @@ struct pixma_scan_ops_t void (*finish_scan) (pixma_t *); /** [Optional] Wait for a user's event, e.g. button event. \a timeout is - * in milliseconds. If an event occured before it's timed out, flags in + * in milliseconds. If an event occurred before it's timed out, flags in * \a s->events should be set accordingly. * \see PIXMA_EV_* */ void (*wait_event) (pixma_t * s, int timeout); @@ -176,7 +175,7 @@ struct pixma_scan_ops_t }; -/** \name Funtions for read and write big-endian integer values */ +/** \name Functions for read and write big-endian integer values */ /**@{*/ void pixma_set_be16 (uint16_t x, uint8_t * buf); void pixma_set_be32 (uint32_t x, uint8_t * buf); @@ -205,7 +204,9 @@ uint8_t *pixma_newcmd (pixma_cmdbuf_t *, unsigned cmd, int pixma_exec (pixma_t *, pixma_cmdbuf_t *); int pixma_exec_short_cmd (pixma_t *, pixma_cmdbuf_t *, unsigned cmd); int pixma_map_status_errno (unsigned status); +#if defined(HAVE_LIBXML2) int pixma_parse_xml_response(const char *xml_message); +#endif /**@}*/ #define pixma_fill_checksum(start, end) do { \ diff --git a/backend/pixma/pixma_imageclass.c b/backend/pixma/pixma_imageclass.c index be483b2..ae06180 100644 --- a/backend/pixma/pixma_imageclass.c +++ b/backend/pixma/pixma_imageclass.c @@ -17,9 +17,7 @@ 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. + along with this program. If not, see . As a special exception, the authors of SANE give permission for additional uses of the libraries contained in this release of SANE. @@ -461,7 +459,7 @@ step1 (pixma_t * s) iclass_t *mf = (iclass_t *) s->subdriver; /* don't wait full timeout for 1st command */ - rec_tmo = s->rec_tmo; /* save globel timeout */ + rec_tmo = s->rec_tmo; /* save global timeout */ s->rec_tmo = 2; /* set timeout to 2 seconds */ error = query_status (s); s->rec_tmo = rec_tmo; /* restore global timeout */ @@ -622,6 +620,8 @@ iclass_check_param (pixma_t * s, pixma_scan_param_t * sp) if ((s->cfg->cap & PIXMA_CAP_ADF) && sp->source == PIXMA_SOURCE_FLATBED) sp->h = MIN (sp->h, 877 * sp->xdpi / 75); + sp->mode_jpeg = (s->cfg->cap & PIXMA_CAP_JPEG); + /* PDBG (pixma_dbg (4, "*iclass_check_param***** Finally: channels=%u, depth=%u, x=%u, y=%u, w=%u, line_size=%" PRIu64 " , h=%u*****\n", sp->channels, sp->depth, sp->x, sp->y, sp->w, sp->line_size, sp->h)); */ @@ -979,7 +979,7 @@ const pixma_config_t pixma_iclass_devices[] = { DEV ("Canon i-SENSYS MF110/910 Series", "MF110", MF110_PID, 600, 0, 640, 1050, 0), DEV ("Canon i-SENSYS MF520 Series", "MF520", MF520_PID, 600, 0, 640, 1050, PIXMA_CAP_ADFDUP), DEV ("Canon i-SENSYS MF420 Series", "MF420", MF420_PID, 600, 0, 640, 1050, PIXMA_CAP_ADFDUP), - DEV ("Canon i-SENSYS MF260 Series", "MF260", MF260_PID, 600, 0, 640, 1050, PIXMA_CAP_ADFDUP), + DEV ("Canon i-SENSYS MF260 Series", "MF260", MF260_PID, 600, 0, 640, 1050, PIXMA_CAP_JPEG | PIXMA_CAP_ADFDUP), DEV ("Canon i-SENSYS MF740 Series", "MF740", MF740_PID, 600, 0, 640, 1050, PIXMA_CAP_ADFDUP), DEV ("Canon i-SENSYS MF741C/743C", "MF741C/743C", MF743_PID, 600, 300, 640, 1050, PIXMA_CAP_ADFDUP), /* ADFDUP restricted to 300dpi */ DEV ("Canon i-SENSYS MF640 Series", "MF642C/643C/644C", MF640_PID, 600, 0, 640, 1050, PIXMA_CAP_ADFDUP), diff --git a/backend/pixma/pixma_io.h b/backend/pixma/pixma_io.h index 715bab5..71202e4 100644 --- a/backend/pixma/pixma_io.h +++ b/backend/pixma/pixma_io.h @@ -15,9 +15,7 @@ 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. + along with this program. If not, see . As a special exception, the authors of SANE give permission for additional uses of the libraries contained in this release of SANE. @@ -128,7 +126,7 @@ int pixma_reset_device (pixma_io_t *); /** Write data to the device. This function may not be interrupted by signals. * It will return iff * - \a len bytes have been successfully written or - * - an error (inclusive timeout) occured. + * - an error (inclusive timeout) occurred. * . * \note Calling pixma_write(io, buf, n1) and pixma(io, buf+n1, n2) may * not be the same as pixma_write(io, buf, n1+n2) if n1 is not @@ -146,7 +144,7 @@ int pixma_write (pixma_io_t *, const void *cmd, unsigned len); * It will return iff * - \a size bytes have been successfully read, * - a short packet has been read or - * - an error (inclusive timeout) occured. + * - an error (inclusive timeout) occurred. * . * \param[out] buf * \param[in] size of the buffer diff --git a/backend/pixma/pixma_io_sanei.c b/backend/pixma/pixma_io_sanei.c index c7b7a29..ae780b3 100644 --- a/backend/pixma/pixma_io_sanei.c +++ b/backend/pixma/pixma_io_sanei.c @@ -17,9 +17,7 @@ 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. + along with this program. If not, see . As a special exception, the authors of SANE give permission for additional uses of the libraries contained in this release of SANE. diff --git a/backend/pixma/pixma_mp150.c b/backend/pixma/pixma_mp150.c index b438c1b..f3d5934 100644 --- a/backend/pixma/pixma_mp150.c +++ b/backend/pixma/pixma_mp150.c @@ -17,9 +17,7 @@ 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. + along with this program. If not, see . As a special exception, the authors of SANE give permission for additional uses of the libraries contained in this release of SANE. @@ -299,6 +297,25 @@ #define TS3300_PID 0x18a2 #define E3300_PID 0x18a3 +/* 2020 new devices (untested) */ +#define G7080_PID 0x1864 +#define GM4080_PID 0x186A +#define TS3400_PID 0x18B7 +#define E3400_PID 0x18B8 +#define TR7000_PID 0x18B9 +#define G2020_PID 0x18BD +#define G3060_PID 0x18C3 +#define G2060_PID 0x18C1 +#define G3020_PID 0x18BF +#define TS7430_PID 0x18B2 +#define XK90_PID 0x18B6 +#define TS8430_PID 0x18B5 +#define TR7600_PID 0x18AA +#define TR8600_PID 0x18AD +#define TR8630_PID 0x18AF +#define TS6400_PID 0x18D3 +#define TS7400_PID 0x18D7 + /* Generation 4 XML messages that encapsulates the Pixma protocol messages */ #define XML_START_1 \ "\ @@ -322,6 +339,10 @@ 00000001\ " +#if !defined(HAVE_LIBXML2) +#define XML_OK "OK" +#endif + enum mp150_state_t { state_idle, @@ -459,7 +480,11 @@ send_xml_dialog (pixma_t * s, const char * xml_message) PDBG (pixma_dbg (10, "XML message sent to scanner:\n%s\n", xml_message)); PDBG (pixma_dbg (10, "XML response back from scanner:\n%s\n", mp->cb.buf)); +#if defined(HAVE_LIBXML2) return pixma_parse_xml_response((const char*)mp->cb.buf) == PIXMA_STATUS_OK; +#else + return (strcasestr ((const char *) mp->cb.buf, XML_OK) != NULL); +#endif } static int @@ -614,7 +639,7 @@ static unsigned calc_raw_width (const mp150_t * mp, const pixma_scan_param_t * param) { unsigned raw_width; - /* NOTE: Actually, we can send arbitary width to MP150. Lines returned + /* NOTE: Actually, we can send arbitrary width to MP150. Lines returned are always padded to multiple of 4 or 12 pixels. Is this valid for other models, too? */ if (mp->generation >= 2) @@ -705,10 +730,7 @@ send_scan_param (pixma_t * s) { data[0x03] = 0x01; } - else - { - data[0x05] = 0x01; /* This one also seen at 0. Don't know yet what's used for */ - } + data[0x05] = pixma_calc_calibrate (s); pixma_set_be16 (xdpi | 0x8000, data + 0x08); pixma_set_be16 (ydpi | 0x8000, data + 0x0a); pixma_set_be32 (x - xs, data + 0x0c); @@ -909,6 +931,7 @@ handle_interrupt (pixma_t * s, int timeout) || s->cfg->pid == MG5400_PID || s->cfg->pid == MG6200_PID || s->cfg->pid == MG6300_PID + || s->cfg->pid == MX340_PID || s->cfg->pid == MX520_PID || s->cfg->pid == MX720_PID || s->cfg->pid == MX920_PID @@ -938,8 +961,11 @@ handle_interrupt (pixma_t * s, int timeout) /* some scanners provide additional information: * document type in buf[6] 01=Document; 02=Photo; 03=Auto Scan * ADF status in buf[8] 01 = ADF empty; 02 = ADF filled - * ADF orientation in buf[16] 01=Portrait; 02=Landscape */ - if (s->cfg->pid == TR4500_PID) + * ADF orientation in buf[16] 01=Portrait; 02=Landscape + * + * ToDo: maybe this if isn't needed + */ + if (s->cfg->pid == TR4500_PID || s->cfg->pid == MX340_PID) { s->events |= (buf[6] & 0x0f) << 12; s->events |= (buf[8] & 0x0f) << 20; @@ -1029,7 +1055,7 @@ reorder_pixels (uint8_t * linebuf, uint8_t * sptr, unsigned c, unsigned n, memcpy (sptr, linebuf, line_size); } -/* the scanned image must be shrinked by factor "scale" +/* the scanned image must be shrunk by factor "scale" * the image can be formatted as rgb (c=3) or gray (c=1) * we need to crop the left side (xs) * we ignore more pixels inside scanned line (wx), behind needed line (w) @@ -1069,7 +1095,7 @@ shrink_image (uint8_t * dptr, uint8_t * sptr, unsigned xs, unsigned w, pixel = 0; /* sum shrink pixels */ - for (unsigned m = 0; m < scale; m++) /* get pixels from shrinked lines */ + for (unsigned m = 0; m < scale; m++) /* get pixels from shrunk lines */ { for (unsigned n = 0; n < scale; n++) /* get pixels from same line */ { @@ -1080,7 +1106,7 @@ shrink_image (uint8_t * dptr, uint8_t * sptr, unsigned xs, unsigned w, #endif } - /* jump over shrinked data */ + /* jump over shrunk data */ src += c * scale; /* next pixel */ dst += c; @@ -1715,7 +1741,7 @@ const pixma_config_t pixma_mp150_devices[] = { DEVICE ("Canon PIXMA MP190", "MP190", MP190_PID, 0, 600, 0, 0, 638, 877, PIXMA_CAP_CIS), /* PIXMA 2009 vintage */ - DEVICE ("Canon PIXMA MX320", "MX320", MX320_PID, 0, 1200, 0, 0, 638, 1050, PIXMA_CAP_CIS | PIXMA_CAP_ADF), + DEVICE ("Canon PIXMA MX320", "MX320", MX320_PID, 0, 1200, 0, 600, 638, 1050, PIXMA_CAP_CIS | PIXMA_CAP_ADF), DEVICE ("Canon PIXMA MX330", "MX330", MX330_PID, 0, 1200, 0, 0, 638, 1050, PIXMA_CAP_CIS | PIXMA_CAP_ADF), DEVICE ("Canon PIXMA MX860", "MX860", MX860_PID, 0, 2400, 0, 0, 638, 1050, PIXMA_CAP_CIS | PIXMA_CAP_ADFDUP), /* width and height adjusted to flatbed size 21.8 x 30.2 cm^2 respective @@ -1805,7 +1831,7 @@ const pixma_config_t pixma_mp150_devices[] = { DEVICE ("Canon PIXMA E460 Series", "E460", E460_PID, 0, 600, 0, 0, 638, 877, PIXMA_CAP_CIS), /* Latest devices (2015) Generation 5 CIS */ - DEVICE ("Canon PIXMA MX490 Series", "MX490", MX490_PID, 0, 600, 0, 0, 638, 1050, PIXMA_CAP_CIS | PIXMA_CAP_ADF), + DEVICE ("Canon PIXMA MX490 Series", "MX490", MX490_PID, 0, 600, 0, 0, 638, 1050, PIXMA_CAP_CIS | PIXMA_CAP_ADF | PIXMA_CAP_ADF_JPEG), DEVICE ("Canon PIXMA E480 Series", "E480", E480_PID, 0, 600, 0, 0, 638, 1050, PIXMA_CAP_CIS | PIXMA_CAP_ADF), DEVICE ("Canon PIXMA MG3600 Series", "MG3600", MG3600_PID, 0, 1200, 0, 0, 638, 877, PIXMA_CAP_CIS), DEVICE ("Canon PIXMA MG7700 Series", "MG7700", MG7700_PID, 0, 2400, 0, 0, 638, 877, PIXMA_CAP_CIS), @@ -1882,6 +1908,23 @@ const pixma_config_t pixma_mp150_devices[] = { DEVICE ("Canon PIXMA TS6330 Series", "TS6330", TS6330_PID, 0, 1200, 0, 0, 638, 877, PIXMA_CAP_CIS), DEVICE ("Canon PIXMA TS3300 Series", "TS3300", TS3300_PID, 0, 1200, 0, 0, 638, 877, PIXMA_CAP_CIS), DEVICE ("Canon PIXMA E3300 Series", "E3300", E3300_PID, 0, 600, 0, 0, 638, 877, PIXMA_CAP_CIS), + DEVICE ("Canon PIXMA TS3400 Series", "TS3400", TS3400_PID, 0, 1200, 0, 0, 638, 877, PIXMA_CAP_CIS), + DEVICE ("Canon PIXMA E3400 Series", "E3400", E3400_PID, 0, 600, 0, 0, 638, 877, PIXMA_CAP_CIS | PIXMA_CAP_ADF), + DEVICE ("Canon PIXMA TR7000 Series", "TR7000", TR7000_PID, 0, 1200, 0, 0, 638, 877, PIXMA_CAP_CIS | PIXMA_CAP_ADF), + DEVICE ("Canon PIXMA G2020", "G2020", G2020_PID, 0, 600, 0, 0, 638, 877, PIXMA_CAP_CIS), + DEVICE ("Canon PIXMA G3060", "G3060", G3060_PID, 0, 600, 0, 0, 638, 877, PIXMA_CAP_CIS), + DEVICE ("Canon PIXMA G2060", "G2060", G2060_PID, 0, 600, 0, 0, 638, 877, PIXMA_CAP_CIS), + DEVICE ("Canon PIXMA G3020", "G3020", G3020_PID, 0, 600, 0, 0, 638, 877, PIXMA_CAP_CIS), + DEVICE ("Canon PIXMA TS7430 Series", "TS7430", TS7430_PID, 0, 1200, 0, 0, 638, 877, PIXMA_CAP_CIS), + DEVICE ("Canon PIXUS XK90 Series", "XK90", XK90_PID, 0, 1200, 0, 0, 638, 877, PIXMA_CAP_CIS), + DEVICE ("Canon PIXMA TS8430 Series", "TS8430", TS8430_PID, 0, 1200, 0, 0, 638, 877, PIXMA_CAP_CIS), + DEVICE ("Canon PIXMA TR7600 Series", "TR7600", TR7600_PID, 0, 1200, 0, 0, 638, 877, PIXMA_CAP_CIS | PIXMA_CAP_ADF), + DEVICE ("Canon PIXMA TR8600 Series", "TR8600", TR8600_PID, 0, 1200, 0, 0, 638, 877, PIXMA_CAP_CIS | PIXMA_CAP_ADF), + DEVICE ("Canon PIXMA TR8630 Series", "TR8630", TR8630_PID, 0, 1200, 0, 0, 638, 877, PIXMA_CAP_CIS | PIXMA_CAP_ADF), + DEVICE ("Canon PIXMA TS6400 Series", "TS6400", TS6400_PID, 0, 1200, 0, 0, 638, 877, PIXMA_CAP_CIS), + DEVICE ("Canon PIXMA TS7400 Series", "TS7400", TS7400_PID, 0, 1200, 0, 0, 638, 877, PIXMA_CAP_CIS), + DEVICE ("Canon PIXMA G7080 Series", "G7080", G7080_PID, 0, 600, 0, 0, 638, 877, PIXMA_CAP_CIS), + DEVICE ("Canon PIXMA GM4080", "GM4080", GM4080_PID, 0, 600, 0, 0, 638, 877, PIXMA_CAP_CIS | PIXMA_CAP_ADF), END_OF_DEVICE_LIST }; diff --git a/backend/pixma/pixma_mp730.c b/backend/pixma/pixma_mp730.c index fcc9ae8..3a436d7 100644 --- a/backend/pixma/pixma_mp730.c +++ b/backend/pixma/pixma_mp730.c @@ -17,9 +17,7 @@ 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. + along with this program. If not, see . As a special exception, the authors of SANE give permission for additional uses of the libraries contained in this release of SANE. diff --git a/backend/pixma/pixma_mp750.c b/backend/pixma/pixma_mp750.c index cc1c3ad..80ccfd2 100644 --- a/backend/pixma/pixma_mp750.c +++ b/backend/pixma/pixma_mp750.c @@ -16,9 +16,7 @@ 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. + along with this program. If not, see . As a special exception, the authors of SANE give permission for additional uses of the libraries contained in this release of SANE. @@ -827,7 +825,7 @@ mp750_fill_buffer (pixma_t * s, pixma_imagebuf_t * ib) n = mp->rawimg_left / 3; /* n = number of pixels in the buffer? */ - /* Color to Grayscale converion for CCD sensor */ + /* Color to Grayscale conversion 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); diff --git a/backend/pixma/pixma_mp800.c b/backend/pixma/pixma_mp800.c index 905c246..fba7553 100644 --- a/backend/pixma/pixma_mp800.c +++ b/backend/pixma/pixma_mp800.c @@ -17,9 +17,7 @@ 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. + along with this program. If not, see . As a special exception, the authors of SANE give permission for additional uses of the libraries contained in this release of SANE. @@ -152,6 +150,10 @@ 00000001\ " +#if !defined(HAVE_LIBXML2) +#define XML_OK "OK" +#endif + enum mp810_state_t { state_idle, @@ -291,7 +293,11 @@ static int send_xml_dialog (pixma_t * s, const char * xml_message) PDBG(pixma_dbg (10, "XML message sent to scanner:\n%s\n", xml_message)); PDBG(pixma_dbg (10, "XML response back from scanner:\n%s\n", mp->cb.buf)); +#if defined(HAVE_LIBXML2) return pixma_parse_xml_response((const char*)mp->cb.buf) == PIXMA_STATUS_OK; +#else + return (strcasestr ((const char *) mp->cb.buf, XML_OK) != NULL); +#endif } static void new_cmd_tpu_msg (pixma_t *s, pixma_cmdbuf_t * cb, uint16_t cmd) @@ -401,6 +407,10 @@ static int select_source (pixma_t * s) data[0] = 4; data[1] = 2; break; + + case PIXMA_SOURCE_NONE: + /* this source can not be selected */ + break; } return pixma_exec (s, &mp->cb); } @@ -483,7 +493,7 @@ static unsigned calc_raw_width (const mp810_t * mp, const pixma_scan_param_t * param) { unsigned raw_width; - /* NOTE: Actually, we can send arbitary width to MP810. Lines returned + /* NOTE: Actually, we can send arbitrary width to MP810. Lines returned are always padded to multiple of 4 or 12 pixels. Is this valid for other models, too? */ if (mp->generation >= 2) @@ -929,8 +939,7 @@ static int send_scan_param (pixma_t * s) data[0x02] = 0x03; data[0x03] = 0x03; } - if (s->cfg->pid != MG8200_PID) - data[0x05] = 0x01; /* This one also seen at 0. Don't know yet what's used for */ + data[0x05] = pixma_calc_calibrate (s); /* the scanner controls the scan */ /* no software control needed */ pixma_set_be16 (s->param->xdpi | 0x8000, data + 0x08); diff --git a/backend/pixma/pixma_rename.h b/backend/pixma/pixma_rename.h index ad3d960..7feb962 100644 --- a/backend/pixma/pixma_rename.h +++ b/backend/pixma/pixma_rename.h @@ -15,9 +15,7 @@ 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. + along with this program. If not, see . As a special exception, the authors of SANE give permission for additional uses of the libraries contained in this release of SANE. diff --git a/backend/plustek-pp.h b/backend/plustek-pp.h index 5a1c453..447065b 100644 --- a/backend/plustek-pp.h +++ b/backend/plustek-pp.h @@ -29,9 +29,7 @@ * 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. + * along with this program. If not, see . * * As a special exception, the authors of SANE give permission for * additional uses of the libraries contained in this release of SANE. @@ -534,7 +532,7 @@ enum { NUM_OPTIONS }; -/** for compatiblity to version 0x0102 drivers +/** for compatibility to version 0x0102 drivers */ typedef struct { diff --git a/backend/plustek-pp_dac.c b/backend/plustek-pp_dac.c index f0cfe40..4293528 100644 --- a/backend/plustek-pp_dac.c +++ b/backend/plustek-pp_dac.c @@ -41,9 +41,7 @@ * 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. + * along with this program. If not, see . * * As a special exception, the authors of SANE give permission for * additional uses of the libraries contained in this release of SANE. diff --git a/backend/plustek-pp_dbg.h b/backend/plustek-pp_dbg.h index c53d6e6..71315bd 100644 --- a/backend/plustek-pp_dbg.h +++ b/backend/plustek-pp_dbg.h @@ -16,9 +16,7 @@ * 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. + * along with this program. If not, see . * * As a special exception, the authors of SANE give permission for * additional uses of the libraries contained in this release of SANE. diff --git a/backend/plustek-pp_detect.c b/backend/plustek-pp_detect.c index b7527c3..2cc6f1a 100644 --- a/backend/plustek-pp_detect.c +++ b/backend/plustek-pp_detect.c @@ -41,9 +41,7 @@ * 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. + * along with this program. If not, see . * * As a special exception, the authors of SANE give permission for * additional uses of the libraries contained in this release of SANE. @@ -108,7 +106,7 @@ static int detectScannerConnection( pScanData ps ) /* * as we're called during InitPorts, we can be sure - * to operate in EPP-mode (hopefuly ;-) + * to operate in EPP-mode (hopefully ;-) */ control = _INB_CTRL( ps ); diff --git a/backend/plustek-pp_genericio.c b/backend/plustek-pp_genericio.c index 1a1ebf4..bc6181f 100644 --- a/backend/plustek-pp_genericio.c +++ b/backend/plustek-pp_genericio.c @@ -47,9 +47,7 @@ * 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. + * along with this program. If not, see . * * As a special exception, the authors of SANE give permission for * additional uses of the libraries contained in this release of SANE. @@ -1109,7 +1107,7 @@ _LOC Byte IOGetScanState( pScanData ps, Bool fOpenned ) } /*............................................................................. - * ASIC 98003 specific function to read status 2 regiser + * ASIC 98003 specific function to read status 2 register */ _LOC Byte IOGetExtendedStatus( pScanData ps ) { diff --git a/backend/plustek-pp_hwdefs.h b/backend/plustek-pp_hwdefs.h index 2672380..51599f2 100644 --- a/backend/plustek-pp_hwdefs.h +++ b/backend/plustek-pp_hwdefs.h @@ -43,9 +43,7 @@ * 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. + * along with this program. If not, see . * * As a special exception, the authors of SANE give permission for * additional uses of the libraries contained in this release of SANE. @@ -264,7 +262,7 @@ typedef struct { UShort thresholdColor; } ThreshDef, *pThreshDef; -/* for decription of the DAC specific stuff*/ +/* for description of the DAC specific stuff*/ typedef struct { ColorWord GainResize; ColorWord DarkCmpHi; diff --git a/backend/plustek-pp_image.c b/backend/plustek-pp_image.c index c7d2db2..63f1f88 100644 --- a/backend/plustek-pp_image.c +++ b/backend/plustek-pp_image.c @@ -12,7 +12,7 @@ * - 0.32 - no changes * - 0.33 - no changes * - 0.34 - reactivated code in imageP96WaitLineData() to recover from - * loosing data + * losing data * - 0.35 - no changes * - 0.36 - removed comment * - added wDither exchange to imageP9xSetupScanSettings @@ -30,7 +30,7 @@ * these I/O timeouts... * - 0.40 - no changes * - 0.41 - no changes - * - 0.42 - fixed a problem for the 12bit modes fo ASIC9800x based devices + * - 0.42 - fixed a problem for the 12bit modes for ASIC9800x based devices * - changed include names * - 0.43 - removed floating point stuff * - cleanup @@ -51,9 +51,7 @@ * 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. + * along with this program. If not, see . * * As a special exception, the authors of SANE give permission for * additional uses of the libraries contained in this release of SANE. @@ -1508,7 +1506,7 @@ static int imageP98003SetupScanSettings( pScanData ps, pScanInfo pInf ) } /* - * now assign the buffer pointers for image aquisition + * now assign the buffer pointers for image acquisition */ ps->Scan.p48BitBuf.pb = NULL; diff --git a/backend/plustek-pp_io.c b/backend/plustek-pp_io.c index d6e99b9..af3e8c4 100644 --- a/backend/plustek-pp_io.c +++ b/backend/plustek-pp_io.c @@ -37,9 +37,7 @@ * 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. + * along with this program. If not, see . * * As a special exception, the authors of SANE give permission for * additional uses of the libraries contained in this release of SANE. diff --git a/backend/plustek-pp_map.c b/backend/plustek-pp_map.c index 00b52a3..333e58f 100644 --- a/backend/plustek-pp_map.c +++ b/backend/plustek-pp_map.c @@ -41,9 +41,7 @@ * 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. + * along with this program. If not, see . * * As a special exception, the authors of SANE give permission for * additional uses of the libraries contained in this release of SANE. @@ -212,7 +210,7 @@ _LOC void MapSetupDither( pScanData ps ) } } -/** adjust acording to brightness and contrast +/** adjust according to brightness and contrast */ _LOC void MapAdjust( pScanData ps, int which ) { diff --git a/backend/plustek-pp_misc.c b/backend/plustek-pp_misc.c index a0ce200..ec2f129 100644 --- a/backend/plustek-pp_misc.c +++ b/backend/plustek-pp_misc.c @@ -49,9 +49,7 @@ * 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. + * along with this program. If not, see . * * As a special exception, the authors of SANE give permission for * additional uses of the libraries contained in this release of SANE. @@ -152,7 +150,7 @@ static struct parport_driver pt_drv = { }; #endif -/** display the avaialable port-modes +/** display the available port-modes */ #ifdef DEBUG static void miscShowPortModes( int modes ) @@ -307,7 +305,7 @@ static int miscSetFastMode( pScanData ps ) /* * Some BIOS/cards have only a Bi-directional/PS2 mode (no EPP). - * Make one last attemp to set to PS2 mode. + * Make one last attempt to set to PS2 mode. */ if ( port_feature & PARPORT_MODE_PCPS2 ){ diff --git a/backend/plustek-pp_models.c b/backend/plustek-pp_models.c index 1d29686..584dec8 100644 --- a/backend/plustek-pp_models.c +++ b/backend/plustek-pp_models.c @@ -49,9 +49,7 @@ * 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. + * along with this program. If not, see . * * As a special exception, the authors of SANE give permission for * additional uses of the libraries contained in this release of SANE. diff --git a/backend/plustek-pp_motor.c b/backend/plustek-pp_motor.c index c48710e..ac6d458 100644 --- a/backend/plustek-pp_motor.c +++ b/backend/plustek-pp_motor.c @@ -53,9 +53,7 @@ * 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. + * along with this program. If not, see . * * As a special exception, the authors of SANE give permission for * additional uses of the libraries contained in this release of SANE. @@ -81,7 +79,7 @@ */ #include "plustek-pp_scan.h" -/*************************** some definitons *********************************/ +/*************************** some definitions *********************************/ /* #define _A3I_EN */ @@ -203,7 +201,7 @@ static void motorP96GetStartStopGap( pScanData ps, Bool fCheckState ) /*............................................................................. - * wait for the ScanState stop or ScanState reachs the dwScanStateCount + * wait for the ScanState stop or ScanState reaches the dwScanStateCount */ static Bool motorCheckMotorPresetLength( pScanData ps ) { @@ -2040,7 +2038,7 @@ static void motorGoHalfStep1( pScanData ps ) } /*............................................................................. - * when loosing data, we use this function to go back some lines and read them + * when losing data, we use this function to go back some lines and read them * again... */ static void motorP96WaitBack( pScanData ps ) @@ -2126,7 +2124,7 @@ static void motorP96WaitBack( pScanData ps ) } /*............................................................................. - * when loosing data, we use this function to go back some lines and read them + * when losing data, we use this function to go back some lines and read them * again... */ static void motorP98WaitBack( pScanData ps ) @@ -2523,7 +2521,7 @@ static void motorP98SetSpeed( pScanData ps, Byte bSpeed, Bool fSetRunState ) if((lastFifoState > _P96_FIFOOVERFLOWTHRESH) && (bData < lastFifoState)) { - DBG( DBG_HIGH, "FIFO OVERFLOW, loosing data !!\n" ); + DBG( DBG_HIGH, "FIFO OVERFLOW, losing data !!\n" ); overflow = _TRUE; } lastFifoState = bData; diff --git a/backend/plustek-pp_p12.c b/backend/plustek-pp_p12.c index 2dc4e45..e78c682 100644 --- a/backend/plustek-pp_p12.c +++ b/backend/plustek-pp_p12.c @@ -29,9 +29,7 @@ * 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. + * along with this program. If not, see . * * As a special exception, the authors of SANE give permission for * additional uses of the libraries contained in this release of SANE. diff --git a/backend/plustek-pp_p12ccd.c b/backend/plustek-pp_p12ccd.c index 1b64b46..232e3e7 100644 --- a/backend/plustek-pp_p12ccd.c +++ b/backend/plustek-pp_p12ccd.c @@ -1,5 +1,5 @@ /* @file plustek-pp_p12ccd.c - * @brief here we have the whole code to intialize the CCD and DAC stuff + * @brief here we have the whole code to initialize the CCD and DAC stuff * * based on sources acquired from Plustek Inc. * Copyright (C) 2000 Plustek Inc. @@ -29,9 +29,7 @@ * 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. + * along with this program. If not, see . * * As a special exception, the authors of SANE give permission for * additional uses of the libraries contained in this release of SANE. diff --git a/backend/plustek-pp_p48xx.c b/backend/plustek-pp_p48xx.c index 749005b..3c28357 100644 --- a/backend/plustek-pp_p48xx.c +++ b/backend/plustek-pp_p48xx.c @@ -52,9 +52,7 @@ * 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. + * along with this program. If not, see . * * As a special exception, the authors of SANE give permission for * additional uses of the libraries contained in this release of SANE. diff --git a/backend/plustek-pp_p9636.c b/backend/plustek-pp_p9636.c index 62da325..4993cff 100644 --- a/backend/plustek-pp_p9636.c +++ b/backend/plustek-pp_p9636.c @@ -47,9 +47,7 @@ * 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. + * along with this program. If not, see . * * As a special exception, the authors of SANE give permission for * additional uses of the libraries contained in this release of SANE. diff --git a/backend/plustek-pp_procfs.c b/backend/plustek-pp_procfs.c index 0cbb999..af8507c 100644 --- a/backend/plustek-pp_procfs.c +++ b/backend/plustek-pp_procfs.c @@ -30,9 +30,7 @@ * 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. + * along with this program. If not, see . * * As a special exception, the authors of SANE give permission for * additional uses of the libraries contained in this release of SANE. diff --git a/backend/plustek-pp_procs.h b/backend/plustek-pp_procs.h index cc84d13..96666ea 100644 --- a/backend/plustek-pp_procs.h +++ b/backend/plustek-pp_procs.h @@ -44,9 +44,7 @@ * 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. + * along with this program. If not, see . * * As a special exception, the authors of SANE give permission for * additional uses of the libraries contained in this release of SANE. diff --git a/backend/plustek-pp_ptdrv.c b/backend/plustek-pp_ptdrv.c index cb0eeb3..bf3a389 100644 --- a/backend/plustek-pp_ptdrv.c +++ b/backend/plustek-pp_ptdrv.c @@ -70,9 +70,7 @@ * 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. + * along with this program. If not, see . * * As a special exception, the authors of SANE give permission for * additional uses of the libraries contained in this release of SANE. diff --git a/backend/plustek-pp_scale.c b/backend/plustek-pp_scale.c index 6879d66..38805ab 100644 --- a/backend/plustek-pp_scale.c +++ b/backend/plustek-pp_scale.c @@ -31,9 +31,7 @@ * 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. + * along with this program. If not, see . * * As a special exception, the authors of SANE give permission for * additional uses of the libraries contained in this release of SANE. diff --git a/backend/plustek-pp_scan.h b/backend/plustek-pp_scan.h index 1764c79..ccc9b97 100644 --- a/backend/plustek-pp_scan.h +++ b/backend/plustek-pp_scan.h @@ -36,9 +36,7 @@ * 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. + * along with this program. If not, see . * * As a special exception, the authors of SANE give permission for * additional uses of the libraries contained in this release of SANE. diff --git a/backend/plustek-pp_scandata.h b/backend/plustek-pp_scandata.h index 1fb987c..1ba0fc5 100644 --- a/backend/plustek-pp_scandata.h +++ b/backend/plustek-pp_scandata.h @@ -62,9 +62,7 @@ * 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. + * along with this program. If not, see . * * As a special exception, the authors of SANE give permission for * additional uses of the libraries contained in this release of SANE. diff --git a/backend/plustek-pp_sysdep.h b/backend/plustek-pp_sysdep.h index 73d00a4..59208b5 100644 --- a/backend/plustek-pp_sysdep.h +++ b/backend/plustek-pp_sysdep.h @@ -30,9 +30,7 @@ * 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. + * along with this program. If not, see . * * As a special exception, the authors of SANE give permission for * additional uses of the libraries contained in this release of SANE. diff --git a/backend/plustek-pp_tpa.c b/backend/plustek-pp_tpa.c index f2ca1f0..efa198c 100644 --- a/backend/plustek-pp_tpa.c +++ b/backend/plustek-pp_tpa.c @@ -40,9 +40,7 @@ * 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. + * along with this program. If not, see . * * As a special exception, the authors of SANE give permission for * additional uses of the libraries contained in this release of SANE. diff --git a/backend/plustek-pp_types.h b/backend/plustek-pp_types.h index 8cc1f8b..1e416ad 100644 --- a/backend/plustek-pp_types.h +++ b/backend/plustek-pp_types.h @@ -41,9 +41,7 @@ * 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. + * along with this program. If not, see . * * As a special exception, the authors of SANE give permission for * additional uses of the libraries contained in this release of SANE. diff --git a/backend/plustek-pp_wrapper.c b/backend/plustek-pp_wrapper.c index c41d340..646354e 100644 --- a/backend/plustek-pp_wrapper.c +++ b/backend/plustek-pp_wrapper.c @@ -26,9 +26,7 @@ * 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. + * along with this program. If not, see . * * As a special exception, the authors of SANE give permission for * additional uses of the libraries contained in this release of SANE. diff --git a/backend/plustek-usb.c b/backend/plustek-usb.c index 107bf9e..8425269 100644 --- a/backend/plustek-usb.c +++ b/backend/plustek-usb.c @@ -63,9 +63,7 @@ * 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. + * along with this program. If not, see . * * As a special exception, the authors of SANE give permission for * additional uses of the libraries contained in this release of SANE. @@ -435,10 +433,10 @@ static void usbDev_shutdown( Plustek_Device *dev ) } /** - * This function checks wether a device, described by a given + * This function checks whether a device, described by a given * string(vendor and product ID), is support by this backend or not * - * @param usbIdStr - sting consisting out of product and vendor ID + * @param usbIdStr - string consisting out of product and vendor ID * format: "0xVVVVx0xPPPP" VVVV = Vendor ID, PPP = Product ID * @returns; SANE_TRUE if supported, SANE_FALSE if not */ @@ -902,7 +900,7 @@ usbDev_setScanEnv( Plustek_Device *dev, ScanInfo *si ) scan->sParam.dMCLK = dMCLK_ADF; } - /* Save necessary informations */ + /* Save necessary information */ scan->fGrayFromColor = 0; /* for some devices and settings, we tweak the physical settings @@ -1346,7 +1344,7 @@ usbDev_Prepare( Plustek_Device *dev, SANE_Byte *buf ) } } - /* set a funtion to process the RAW data... */ + /* set a function to process the RAW data... */ usb_GetImageProc( dev ); if( scan->sParam.bSource == SOURCE_ADF ) diff --git a/backend/plustek-usb.h b/backend/plustek-usb.h index d989749..9ac1e2e 100644 --- a/backend/plustek-usb.h +++ b/backend/plustek-usb.h @@ -48,7 +48,7 @@ * - added MODEL_QSCAN_A6 (thanks to Hiroshi Miura) * - changed DCapsDef, lamp -> misc_io * - bPCB is now ushort to be "missused" by non Plustek - * devices (as threshhold for resetting sensor order) + * devices (as threshold for resetting sensor order) * - added _WAF_LOFF_ON_START and _WAF_ONLY_8BIT * - added MODEL_TSCAN_A4 * - added attribute packed for data access structs @@ -68,9 +68,7 @@ * 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. + * along with this program. If not, see . * * As a special exception, the authors of SANE give permission for * additional uses of the libraries contained in this release of SANE. @@ -426,7 +424,7 @@ typedef struct DevCaps } DCapsDef; /** - * for keeping intial illumination settings + * for keeping initial illumination settings */ typedef struct { @@ -569,7 +567,7 @@ typedef struct /** Driver Info */ u_long dwValidPixels; /**< only valid pixels, not incl. pad pix(B/W,Gray)*/ - u_long dwPhyPixels; /**< inlcude pad pixels for ASIC (B/W, Gray) */ + u_long dwPhyPixels; /**< include pad pixels for ASIC (B/W, Gray) */ u_long dwPhyBytes; /**< bytes to read from ASIC */ u_long dwPhyLines; /**< should include the extra lines accord to the */ /* request dpi (CCD lines distance) */ @@ -616,7 +614,7 @@ typedef struct struct Plustek_Device; -/** structure to hold all necessary buffer informations for current scan +/** structure to hold all necessary buffer information for current scan */ typedef struct ScanDef { diff --git a/backend/plustek-usbcal.c b/backend/plustek-usbcal.c index 84a4105..36c7968 100644 --- a/backend/plustek-usbcal.c +++ b/backend/plustek-usbcal.c @@ -14,7 +14,7 @@ * The basic premise: The stock Plustek-usbshading.c in the plustek * driver is effectively nonfunctional for Canon CanoScan scanners. * These scanners rely heavily on all calibration steps, especially - * fine white, to produce acceptible scan results. However, to make + * fine white, to produce acceptable scan results. However, to make * autocalibration work and make it work well involves some * substantial mucking aobut in code that supports thirty other * scanners with widely varying characteristics... none of which I own @@ -63,9 +63,7 @@ * 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. + * along with this program. If not, see . * * As a special exception, the authors of SANE give permission for * additional uses of the libraries contained in this release of SANE. @@ -102,7 +100,7 @@ static int strip_state = 0; /** depending on the strip state, the sensor is moved to the shading position - * and the lamp ist switched on + * and the lamp is switched on */ static int cano_PrepareToReadWhiteCal( Plustek_Device *dev, SANE_Bool mv2shading_pos ) diff --git a/backend/plustek-usbcalfile.c b/backend/plustek-usbcalfile.c index 6f5a364..c79d65e 100644 --- a/backend/plustek-usbcalfile.c +++ b/backend/plustek-usbcalfile.c @@ -32,9 +32,7 @@ * 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. + * along with this program. If not, see . * * As a special exception, the authors of SANE give permission for * additional uses of the libraries contained in this release of SANE. @@ -94,7 +92,7 @@ static u_short a_wDarkShading[_SHADING_BUF] = {0}; /** function to read a text file and returns the string which starts which * 'id' string. - * no duplicate entries where detected, always the first occurance will be + * no duplicate entries where detected, always the first occurrence will be * red. * @param fp - file pointer of file to read * @param id - what to search for diff --git a/backend/plustek-usbdevs.c b/backend/plustek-usbdevs.c index 8698e54..119cf6d 100644 --- a/backend/plustek-usbdevs.c +++ b/backend/plustek-usbdevs.c @@ -89,9 +89,7 @@ * 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. + * along with this program. If not, see . * * As a special exception, the authors of SANE give permission for * additional uses of the libraries contained in this release of SANE. @@ -2835,7 +2833,7 @@ static SetDef Settings[] = * it's used by the driver to select the device settings. For other devices * than those of Plustek, you'll not need to add the second '-' part * - * The second entry decribes the capabilities of the device, you may find + * The second entry describes the capabilities of the device, you may find * one suitable for your scanner, for a better description of the entries * have a look at the beginning of this file at Cap0x07B3_0x0017_0 for * the UT12 diff --git a/backend/plustek-usbhw.c b/backend/plustek-usbhw.c index 05d3cc7..0a65866 100644 --- a/backend/plustek-usbhw.c +++ b/backend/plustek-usbhw.c @@ -71,9 +71,7 @@ * 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. + * along with this program. If not, see . * * As a special exception, the authors of SANE give permission for * additional uses of the libraries contained in this release of SANE. @@ -1451,6 +1449,14 @@ usb_ResetRegisters( Plustek_Device *dev ) * CanoScan devices to work properly after power-up */ sanei_lm983x_write_byte( dev->fd, 0x5b, regs[0x5b] ); + + /* At least CanoScan N650U can have a problem with writing + * to register 0x59 due XHCI USB controller is too + * fast for him. Simulate EHCI USB controller's + * behavior here - wait 1ms. + */ + usleep(1000); + sanei_lm983x_write_byte( dev->fd, 0x59, regs[0x59] ); sanei_lm983x_write_byte( dev->fd, 0x5a, regs[0x5a] ); } else { diff --git a/backend/plustek-usbimg.c b/backend/plustek-usbimg.c index 0c28491..bcd266f 100644 --- a/backend/plustek-usbimg.c +++ b/backend/plustek-usbimg.c @@ -48,9 +48,7 @@ * 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. + * along with this program. If not, see . * * As a special exception, the authors of SANE give permission for * additional uses of the libraries contained in this release of SANE. @@ -1693,7 +1691,7 @@ static void usb_GrayScalePseudo16( Plustek_Device *dev ) } } -/** function to select the apropriate pixel copy function +/** function to select the appropriate pixel copy function */ static void usb_GetImageProc( Plustek_Device *dev ) { diff --git a/backend/plustek-usbio.c b/backend/plustek-usbio.c index 9677456..105e6a1 100644 --- a/backend/plustek-usbio.c +++ b/backend/plustek-usbio.c @@ -16,7 +16,7 @@ * - 0.42 - no changes * - 0.43 - no changes * - 0.44 - added dump registers and dumpPic functions - * - beautyfied output of ASIC detection + * - beautified output of ASIC detection * - 0.45 - fixed dumpRegs * - added dimension stuff to dumpPic * - 0.46 - disabled reset prior to the detection of Merlin @@ -43,9 +43,7 @@ * 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. + * along with this program. If not, see . * * As a special exception, the authors of SANE give permission for * additional uses of the libraries contained in this release of SANE. diff --git a/backend/plustek-usbmap.c b/backend/plustek-usbmap.c index c979345..7f2a406 100644 --- a/backend/plustek-usbmap.c +++ b/backend/plustek-usbmap.c @@ -38,9 +38,7 @@ * 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. + * along with this program. If not, see . * * As a special exception, the authors of SANE give permission for * additional uses of the libraries contained in this release of SANE. @@ -69,7 +67,7 @@ static SANE_Byte a_bMap[_MAP_SIZE * 3]; -/** adjust acording to brightness and contrast +/** adjust according to brightness and contrast */ static void usb_MapAdjust( Plustek_Device *dev ) { diff --git a/backend/plustek-usbscan.c b/backend/plustek-usbscan.c index bafc86a..ecac4e0 100644 --- a/backend/plustek-usbscan.c +++ b/backend/plustek-usbscan.c @@ -45,9 +45,7 @@ * 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. + * along with this program. If not, see . * * As a special exception, the authors of SANE give permission for * additional uses of the libraries contained in this release of SANE. @@ -348,7 +346,7 @@ usb_GetPhyPixels( Plustek_Device *dev, ScanParam *sp ) sp->Size.dwPhyPixels = (sp->Size.dwValidPixels + 1UL) & 0xfffffffeUL; sp->Size.dwPhyBytes = sp->Size.dwPhyPixels * sp->bChannels + 2UL; - /* need to be adjusted fo CIS devices in color mode */ + /* need to be adjusted for CIS devices in color mode */ if(usb_IsCISDevice( dev ) && (sp->bDataType == SCANDATATYPE_Color)) { sp->Size.dwPhyBytes *= 3; } @@ -358,7 +356,7 @@ usb_GetPhyPixels( Plustek_Device *dev, ScanParam *sp ) sp->Size.dwPhyPixels = sp->Size.dwValidPixels; sp->Size.dwPhyBytes = sp->Size.dwPhyPixels * 2 * sp->bChannels + 2UL; - /* need to be adjusted fo CIS devices in color mode */ + /* need to be adjusted for CIS devices in color mode */ if(usb_IsCISDevice( dev ) && (sp->bDataType == SCANDATATYPE_Color)) { sp->Size.dwPhyBytes *= 3; } @@ -1443,7 +1441,7 @@ usb_IsDataAvailableInDRAM( Plustek_Device *dev ) { /* Compute polling timeout * Height (Inches) / MaxScanSpeed (Inches/Second) = Seconds to move the - * module from top to bottom. Then convert the seconds to miliseconds + * module from top to bottom. Then convert the seconds to milliseconds * by multiply 1000. We add extra 2 seconds to get some tolerance. */ u_char a_bBand[3]; diff --git a/backend/plustek-usbshading.c b/backend/plustek-usbshading.c index e789b43..c585c8b 100644 --- a/backend/plustek-usbshading.c +++ b/backend/plustek-usbshading.c @@ -49,9 +49,7 @@ * 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. + * along with this program. If not, see . * * As a special exception, the authors of SANE give permission for * additional uses of the libraries contained in this release of SANE. diff --git a/backend/plustek.c b/backend/plustek.c index eaddbd3..10458a0 100644 --- a/backend/plustek.c +++ b/backend/plustek.c @@ -99,9 +99,7 @@ * 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. + * along with this program. If not, see . * * As a special exception, the authors of SANE give permission for * additional uses of the libraries contained in this release of SANE. @@ -1188,7 +1186,7 @@ decodeVal( char *src, char *opt, int what, void *result, void *def ) if( tmp ) { - /* on success, compare wiht the given one */ + /* on success, compare with the given one */ if( 0 == strcmp( tmp, opt )) { DBG( _DBG_SANE_INIT, "Decoding option >%s<\n", opt ); @@ -1235,7 +1233,7 @@ decodeVal( char *src, char *opt, int what, void *result, void *def ) return SANE_FALSE; } -/** function to retrive the device name of a given string +/** function to retrieve the device name of a given string * @param src - string that keeps the option name to check src for * @param dest - pointer to the string, that should receive the detected * devicename @@ -1296,7 +1294,7 @@ attach( const char *dev_name, CnfDef *cnf, Plustek_Device **devp ) if( NULL == dev ) return SANE_STATUS_NO_MEM; - /* assign all the stuff we need fo this device... */ + /* assign all the stuff we need for this device... */ memset(dev, 0, sizeof (*dev)); @@ -1429,7 +1427,7 @@ init_config_struct( CnfDef *cnf ) cnf->adj.bgamma = 1.0; } -/** intialize the backend +/** initialize the backend */ SANE_Status sane_init( SANE_Int *version_code, SANE_Auth_Callback authorize ) diff --git a/backend/plustek.h b/backend/plustek.h index cc38f13..9f1a674 100644 --- a/backend/plustek.h +++ b/backend/plustek.h @@ -75,9 +75,7 @@ * 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. + * along with this program. If not, see . * * As a special exception, the authors of SANE give permission for * additional uses of the libraries contained in this release of SANE. diff --git a/backend/plustek_pp.c b/backend/plustek_pp.c index fdcc6b6..76a8789 100644 --- a/backend/plustek_pp.c +++ b/backend/plustek_pp.c @@ -28,9 +28,7 @@ * 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. + * along with this program. If not, see . * * As a special exception, the authors of SANE give permission for * additional uses of the libraries contained in this release of SANE. @@ -887,7 +885,7 @@ static SANE_Bool decodeVal( char *src, char *opt, if( tmp ) { - /* on success, compare wiht the given one */ + /* on success, compare with the given one */ if( 0 == strcmp( tmp, opt )) { DBG( _DBG_SANE_INIT, "Decoding option >%s<\n", opt ); @@ -935,7 +933,7 @@ static SANE_Bool decodeVal( char *src, char *opt, return SANE_FALSE; } -/** function to retrive the device name of a given string +/** function to retrieve the device name of a given string * @param src - string that keeps the option name to check src for * @param dest - pointer to the string, that should receive the detected * devicename @@ -997,7 +995,7 @@ static SANE_Status attach( const char *dev_name, pCnfDef cnf, if( NULL == dev ) return SANE_STATUS_NO_MEM; - /* assign all the stuff we need fo this device... */ + /* assign all the stuff we need for this device... */ memset(dev, 0, sizeof (*dev)); @@ -1128,7 +1126,7 @@ static void init_config_struct( pCnfDef cnf, SANE_Bool direct_io ) cnf->adj.bgamma = 1.0; } -/** intialize the backend +/** initialize the backend */ SANE_Status sane_init( SANE_Int *version_code, SANE_Auth_Callback authorize ) { diff --git a/backend/pnm.c b/backend/pnm.c index 1d1f4fd..ccc6f64 100644 --- a/backend/pnm.c +++ b/backend/pnm.c @@ -16,9 +16,7 @@ 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. + along with this program. If not, see . As a special exception, the authors of SANE give permission for additional uses of the libraries contained in this release of SANE. diff --git a/backend/qcam.c b/backend/qcam.c index 4c46fa7..9b1d7a3 100644 --- a/backend/qcam.c +++ b/backend/qcam.c @@ -13,9 +13,7 @@ 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. + along with this program. If not, see . As a special exception, the authors of SANE give permission for additional uses of the libraries contained in this release of SANE. @@ -234,7 +232,7 @@ disable_ports (QC_Device * q) return SANE_STATUS_GOOD; } -/* We need a short delay loop -- somthing well under a millisecond. +/* We need a short delay loop -- something well under a millisecond. Unfortunately, adding 2 usleep(1)'s to qc_command slowed it down by a factor of over 1000 over the same loop with 2 usleep(0)'s, and that's too slow -- qc_start was taking over a second to run. This @@ -258,7 +256,7 @@ qc_wait (QC_Device * q) termination, so "dead locks" are not a problem. (FYI, the lock file will remain after process termination, but this is actually desired so that the next process need not re-creat(2)e it... just - lock it.) The wait argument indicates whether or not this funciton + lock it.) The wait argument indicates whether or not this function should "block" waiting for the previous lock to be relinquished. This is ideal so that multiple processes (eg. qcam) taking "snapshots" can peacefully coexist. @@ -1944,7 +1942,7 @@ sane_start (SANE_Handle handle) } s->read_fd = dup (s->from_child); - sane_get_parameters (s, 0); /* ensure uptodate parameters */ + sane_get_parameters (s, 0); /* ensure up-to-date parameters */ qc_lock (q); s->holding_lock = SANE_TRUE; diff --git a/backend/ricoh-scsi.c b/backend/ricoh-scsi.c index 73bd4fa..ec65455 100644 --- a/backend/ricoh-scsi.c +++ b/backend/ricoh-scsi.c @@ -14,9 +14,7 @@ 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. + along with this program. If not, see . As a special exception, the authors of SANE give permission for additional uses of the libraries contained in this release of SANE. @@ -37,16 +35,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. +*/ /* - $Id$ This file implements the low-level scsi-commands. */ - - - /* SCSI commands that the Ricoh scanners understand: */ #define RICOH_SCSI_TEST_UNIT_READY 0x00 #define RICOH_SCSI_SET_WINDOW 0x24 diff --git a/backend/ricoh.c b/backend/ricoh.c index fbe5c58..eb692c9 100644 --- a/backend/ricoh.c +++ b/backend/ricoh.c @@ -13,9 +13,7 @@ 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. + along with this program. If not, see . As a special exception, the authors of SANE give permission for additional uses of the libraries contained in this release of SANE. @@ -40,7 +38,6 @@ */ /* - $Id$ This file implements a SANE backend for Ricoh flatbed scanners. */ @@ -167,7 +164,7 @@ attach (const char *devnam, Ricoh_Device ** devp) status = object_position (fd); if (status != SANE_STATUS_GOOD) { - DBG (1, "attach: OBJECT POSTITION failed\n"); + DBG (1, "attach: OBJECT POSITION failed\n"); sanei_scsi_close (fd); return (SANE_STATUS_INVAL); } @@ -243,7 +240,7 @@ attach (const char *devnam, Ricoh_Device ** devp) dev->info.yres_default = _2btol(wbuf.y_res); dev->info.image_mode_default = wbuf.image_comp; - /* if you throw the MRIF bit the brighness control reverses too */ + /* if you throw the MRIF bit the brightness control reverses too */ /* so I reverse the reversal in software for symmetry's sake */ /* I should make this into an option */ @@ -467,7 +464,7 @@ do_cancel (Ricoh_Scanner * s) status = object_position (s->fd); if (status != SANE_STATUS_GOOD) { - DBG (1, "cancel: OBJECT POSTITION failed\n"); + DBG (1, "cancel: OBJECT POSITION failed\n"); } s->scanning = SANE_FALSE; @@ -849,7 +846,7 @@ sane_start (SANE_Handle handle) _lto4b(s->length, wbuf.length); wbuf.image_comp = s->image_composition; - /* if you throw the MRIF bit the brighness control reverses too */ + /* if you throw the MRIF bit the brightness 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) { diff --git a/backend/ricoh.h b/backend/ricoh.h index 8771297..fcf9eec 100644 --- a/backend/ricoh.h +++ b/backend/ricoh.h @@ -13,9 +13,7 @@ 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. + along with this program. If not, see . As a special exception, the authors of SANE give permission for additional uses of the libraries contained in this release of SANE. @@ -36,10 +34,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. */ - -/* - $Id$ + If you do not wish that, delete this exception notice. */ #ifndef ricoh_h diff --git a/backend/ricoh2.c b/backend/ricoh2.c index f719268..e8f8604 100644 --- a/backend/ricoh2.c +++ b/backend/ricoh2.c @@ -16,9 +16,7 @@ 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. + along with this program. If not, see . As a special exception, the authors of SANE give permission for additional uses of the libraries contained in this release of SANE. diff --git a/backend/ricoh2_buffer.c b/backend/ricoh2_buffer.c index 8cf86f3..a0ef624 100644 --- a/backend/ricoh2_buffer.c +++ b/backend/ricoh2_buffer.c @@ -16,9 +16,7 @@ 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. + along with this program. If not, see . As a special exception, the authors of SANE give permission for additional uses of the libraries contained in this release of SANE. diff --git a/backend/rts8891.c b/backend/rts8891.c index 93018ab..e8d57b8 100644 --- a/backend/rts8891.c +++ b/backend/rts8891.c @@ -15,9 +15,7 @@ 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. + along with this program. If not, see . As a special exception, the authors of SANE give permission for additional uses of the libraries contained in this release of SANE. @@ -217,7 +215,7 @@ static Rts8891_Config rtscfg; /* ------------------------------------------------------------------------- */ static SANE_Status probe_rts8891_devices (void); static SANE_Status config_attach_rts8891 (SANEI_Config * config, - const char *devname); + const char *devname, void *data); static SANE_Status attach_rts8891 (const char *name); static SANE_Status set_lamp_brightness (struct Rts8891_Device *dev, int level); @@ -448,7 +446,7 @@ sane_open (SANE_String_Const name, SANE_Handle * handle) } } - /* check wether we have found a match or reach the end of the device list */ + /* check whether we have found a match or reach the end of the device list */ if (!device) { DBG (DBG_info, "sane_open: no device found\n"); @@ -539,7 +537,7 @@ sane_open (SANE_String_Const name, SANE_Handle * handle) /** - * Set non blocking mode. In this mode, read return immediatly when + * Set non blocking mode. In this mode, read return immediately when * no data is available, instead of polling the scanner. */ SANE_Status @@ -997,7 +995,7 @@ sane_control_option (SANE_Handle handle, SANE_Int option, return status; } - /* return immediatly if no change */ + /* return immediately if no change */ if (s->opt[option].type == SANE_TYPE_INT && *(SANE_Word *) val == s->val[option].w) { @@ -1554,7 +1552,7 @@ compute_parameters (Rts8891_Session * session) dev->lds_max = dev->lds_b; /* since the extra lines for reordering are before data */ - /* we substract lds_max */ + /* we subtract lds_max */ dev->lds_r -= dev->lds_max; dev->lds_g -= dev->lds_max; dev->lds_b -= dev->lds_max; @@ -1564,7 +1562,7 @@ compute_parameters (Rts8891_Session * session) /* decrease y start to take these extra lines into account */ dev->lines += (dev->lds_max + dev->ripple) / dev->bytes_per_line; - /* shading calibration is allways 66 lines regardless of ydpi, so */ + /* shading calibration is always 66 lines regardless of ydpi, so */ /* we take this into account to compute ystart */ if (dev->ydpi > dev->model->min_ydpi) { @@ -1864,7 +1862,7 @@ sane_read (SANE_Handle handle, SANE_Byte * buf, { /* at max xdpi, data received is distorted and ydpi is half of xdpi */ if (session->emulated_gray == SANE_TRUE) { - /* in emulated gray mode we are allways reading 3 bytes of raw data */ + /* in emulated gray mode we are always reading 3 bytes of raw data */ /* at a time */ switch (((session->sent * 3) % dev->bytes_per_line) % 6) { @@ -1945,7 +1943,7 @@ sane_read (SANE_Handle handle, SANE_Byte * buf, { if (session->emulated_gray == SANE_TRUE) { - /* in emulated gray mode we are allways reading 3 bytes of raw data */ + /* in emulated gray mode we are always reading 3 bytes of raw data */ /* at a time, so we know where we are */ val = dev->current[dev->lds_g]; if (session->params.depth == 1) @@ -1996,7 +1994,7 @@ sane_read (SANE_Handle handle, SANE_Byte * buf, /* we currently handle ydi=2*dpi */ if (session->emulated_gray == SANE_TRUE) { - /* in emulated gray mode we are allways reading 3 bytes of raw data */ + /* in emulated gray mode we are always reading 3 bytes of raw data */ /* at a time, so we know where we are */ val = (dev->current[dev->lds_g] + dev->current[dev->lds_g + @@ -2086,7 +2084,7 @@ sane_read (SANE_Handle handle, SANE_Byte * buf, * handle h is a valid handle) but usually affects long-running * operations only (such as image is acquisition). It is safe to call * this function asynchronously (e.g., from within a signal handler). - * It is important to note that completion of this operaton does not + * It is important to note that completion of this operation does not * imply that the currently pending operation has been cancelled. It * only guarantees that cancellation has been initiated. Cancellation * completes only when the cancelled call returns (typically with a @@ -2131,7 +2129,7 @@ sane_cancel (SANE_Handle handle) } } - /* free ressources used by scanning */ + /* free resources used by scanning */ if (dev->scanned_data != NULL) { free (dev->scanned_data); @@ -2374,7 +2372,7 @@ probe_rts8891_devices (void) /* generic configure and attach function */ status = sanei_configure_attach (RTS8891_CONFIG_FILE, &config, - config_attach_rts8891); + config_attach_rts8891, NULL); /* free allocated options */ for (i = 0; i < NUM_CFG_OPTIONS; i++) { @@ -2398,7 +2396,8 @@ probe_rts8891_devices (void) * SANE_STATUS_INVAL in case of error */ static SANE_Status -config_attach_rts8891 (SANEI_Config * config, const char *devname) +config_attach_rts8891 (SANEI_Config * config, const char *devname, + void __sane_unused__ *data) { /* currently, the config is a global variable so config is useless here */ /* the correct thing would be to have a generic sanei_attach_matching_devices @@ -2419,7 +2418,7 @@ config_attach_rts8891 (SANEI_Config * config, const char *devname) /** * The attach tries to open the given usb device and match it * with devices handled by the backend. The configuration parameter - * contains the values of the allready parsed configuration options + * contains the values of the already parsed configuration options * from the conf file. * @param config configuration structure filled with values read * from configuration file @@ -2533,7 +2532,7 @@ attach_rts8891 (const char *devicename) first_device = device; device->reg_count = 244; - /* intialization is done at sane_open */ + /* initialization is done at sane_open */ device->initialized = SANE_FALSE; device->needs_warming = SANE_TRUE; device->parking = SANE_FALSE; @@ -3029,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 - * once sensor is correctly set up, we are allways park here, + * once sensor is correctly set up, we are always park here, * but in case sensor has just changed, we are not so we park head */ sanei_rts88xx_read_reg (dev->devnum, CONTROLER_REG, ®); if ((reg & 0x02) == 0) @@ -3254,7 +3253,7 @@ find_origin (struct Rts8891_Device *dev, SANE_Bool * changed) { for (y = 1; y < height - 2; y++) { - /* egde detection on each line */ + /* edge detection on each line */ if (image[x + (y + 1) * width] - image[x + y * width] >= 20) { sum += y; @@ -3505,7 +3504,7 @@ find_margin (struct Rts8891_Device *dev) #ifdef FAST_INIT /* - * This function intializes the device: + * This function initializes the device: * - initial registers values * - test if at home * - head parking if needed @@ -3548,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 - * than those sold bare, for this model we allways start with xpa type sensor, + * than those sold bare, for this model we always 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 */ if (dev->sensor == -1) @@ -4016,7 +4015,7 @@ int i; } /* - * This function intializes the device: + * This function initializes the device: * - initial registers values * - test if at home * - head parking if needed @@ -4031,7 +4030,7 @@ init_device (struct Rts8891_Device *dev) char message[256 * 6]; SANE_Int val; - /* these commands are used to acces NVRAM through a serial manner */ + /* these commands are used to access NVRAM through a serial manner */ /* we ignore NVRAM settingsd for now */ SANE_Byte nv_cmd1[21] = { 0x28, 0x38, 0x28, 0x38, 0x08, 0x18, 0x28, 0x38, 0x28, 0x38, 0x28, 0x38, @@ -4097,7 +4096,7 @@ init_device (struct Rts8891_Device *dev) sanei_rts88xx_get_lamp_status (dev->devnum, dev->regs); DBG (DBG_io, "init_device: lamp status=0x%02x\n", dev->regs[0x8e]); - /* initalize sensor with default from model */ + /* initialize sensor with default from model */ dev->sensor = dev->model->sensor; DBG (DBG_info, "init_device: reg[8e]=0x%02x\n", dev->regs[0x8e]); @@ -4230,7 +4229,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 useful at first glance */ reg = 0x06; sanei_rts88xx_write_reg (dev->devnum, 0x93, ®); @@ -4421,14 +4420,14 @@ 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 deactivated * 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); sanei_rts88xx_setup_nvram (dev->devnum, 21, nv_cmd3); sanei_rts88xx_set_status (dev->devnum, dev->regs, 0x28, 0x28); - /* second occurence of this block */ + /* second occurrence of this block */ sanei_rts88xx_read_reg (dev->devnum, CONTROL_REG, &control); if (control != 0) { @@ -6292,7 +6291,7 @@ send_calibration_data (struct Rts8891_Session *session) /* 675 pixels at 75 DPI, 16 bits values, 3 color channels */ /* 5400 pixels at max sensor 600 dpi */ /* 3 16bits 256 value gamma tables plus start/end markers */ - /* must multple of 32 */ + /* must multiple of 32 */ data_size = (675 * dev->xdpi) / 75; width = dev->pixels; @@ -6363,7 +6362,7 @@ send_calibration_data (struct Rts8891_Session *session) fill_gamma (calibration, &idx, gamma_b); /* compute calibration coefficients */ - /* real witdh != 675 --> 637 + /* real width != 675 --> 637 * shading data calibration starts at 1542. There are 3 rows of 16 bits values * first row is green calibration */ @@ -6545,7 +6544,7 @@ move_to_scan_area (struct Rts8891_Session *session) /* the ultimate goal is to have no direct access to registers, but to */ /* set them through helper functions */ /* NOTE : I couldn't manage to get scans that really uses gray settings. */ -/* The windows driver is allways scanning in color, so we do the same. */ +/* The windows driver is always scanning in color, so we do the same. */ /* For now, the only mode that could be done would be 300 dpi gray scan, */ /* based on the register settings of find_origin() */ static SANE_Status @@ -7610,7 +7609,7 @@ setup_scan_registers (struct Rts8891_Session *session, SANE_Byte *status1, SANE_ /* the ultimate goal is to have no direct access to registers, but to */ /* set them through helper functions */ /* NOTE : I couldn't manage to get scans that really uses gray settings. */ -/* The windows driver is allways scanning in color, so we do the same. */ +/* The windows driver is always scanning in color, so we do the same. */ /* For now, the only mode that could be done would be 300 dpi gray scan, */ /* based on the register settings of find_origin() */ static SANE_Status @@ -7708,7 +7707,7 @@ park_head (struct Rts8891_Device *dev, SANE_Bool wait) } /* update button status - * button access is allowed during scan, which is usefull for 'cancel' button + * button access is allowed during scan, which is useful for 'cancel' button */ static SANE_Status update_button_status (struct Rts8891_Session *session) diff --git a/backend/rts8891.h b/backend/rts8891.h index fa3feb6..374e1cc 100644 --- a/backend/rts8891.h +++ b/backend/rts8891.h @@ -15,9 +15,7 @@ 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. + along with this program. If not, see . As a special exception, the authors of SANE give permission for additional uses of the libraries contained in this release of SANE. @@ -118,8 +116,8 @@ enum Rts8891_Configure_Option NUM_CFG_OPTIONS /* MUST be last */ }; -/** Scanner object. This struct holds informations usefull for - * the functions defined in SANE's standard. Informations closer +/** Scanner object. This struct holds information useful for + * the functions defined in SANE's standard. Information 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 a46f98b..8216a0a 100644 --- a/backend/rts8891_devices.c +++ b/backend/rts8891_devices.c @@ -15,9 +15,7 @@ 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. + along with this program. If not, see . As a special exception, the authors of SANE give permission for additional uses of the libraries contained in this release of SANE. diff --git a/backend/rts8891_low.c b/backend/rts8891_low.c index 4fc5666..535f6d5 100644 --- a/backend/rts8891_low.c +++ b/backend/rts8891_low.c @@ -15,9 +15,7 @@ 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. + along with this program. If not, see . As a special exception, the authors of SANE give permission for additional uses of the libraries contained in this release of SANE. @@ -129,7 +127,7 @@ rts8891_write_all (SANE_Int devnum, SANE_Byte * regs, SANE_Int count) return SANE_STATUS_IO_ERROR; } - size = count - 0xb4; /* we need to substract one reg since b3 won't be written */ + size = count - 0xb4; /* we need to subtract one reg since b3 won't be written */ buffer[0] = 0x88; buffer[1] = 0xb4; buffer[2] = 0x00; @@ -531,7 +529,7 @@ rts8891_move (struct Rts8891_Device *device, SANE_Byte * regs, regs[0x36] = regs[0x36] & 0xf7; } - /* write regiters values */ + /* write registers values */ status = rts8891_write_all (device->devnum, regs, RTS8891_MAX_REGISTERS); /* commit it */ @@ -616,7 +614,7 @@ rts8891_park (struct Rts8891_Device *device, SANE_Byte *regs, SANE_Bool wait) /* reads data from scanner. * First we wait for some data to be available and then loop reading * from scanner until the required amount is reached. - * We handle non blocking I/O by returning immediatly (with SANE_STATUS_BUSY) + * We handle non blocking I/O by returning immediately (with SANE_STATUS_BUSY) * if there is no data available from scanner. But once read is started, * all the required amount is read. Once wait for data succeeded, we still poll * for data in order no to read it too fast, but we don' take care of non blocking @@ -667,7 +665,7 @@ read_data (struct Rts8891_Session *session, SANE_Byte * dest, SANE_Int length) dev->regs[LAMP_REG] = 0x8d; sanei_rts88xx_write_reg (dev->devnum, LAMP_REG, &(dev->regs[LAMP_REG])); - DBG (DBG_io, "read_data: no data vailable\n"); + DBG (DBG_io, "read_data: no data available\n"); DBG (DBG_proc, "read_data: end\n"); return SANE_STATUS_DEVICE_BUSY; } diff --git a/backend/rts8891_low.h b/backend/rts8891_low.h index 6b12316..453800c 100644 --- a/backend/rts8891_low.h +++ b/backend/rts8891_low.h @@ -15,9 +15,7 @@ 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. + along with this program. If not, see . As a special exception, the authors of SANE give permission for additional uses of the libraries contained in this release of SANE. @@ -60,7 +58,7 @@ /* Flags */ #define RTS8891_FLAG_UNTESTED (1 << 0) /* Print a warning for these scanners */ -#define RTS8891_FLAG_EMULATED_GRAY_MODE (2 << 0) /* gray scans are emulated using comor modes */ +#define RTS8891_FLAG_EMULATED_GRAY_MODE (2 << 0) /* gray scans are emulated using color modes */ #define LOWORD(x) ((uint16_t)(x & 0xffff)) #define HIWORD(x) ((uint16_t)(x >> 16)) @@ -98,7 +96,7 @@ typedef struct Rts8891_Device Rts8891_Device; #define TIMING2_REG 0x8a /* holds REG8180+2 */ -/* this struc describes a particular model which is handled by the backend */ +/* this struct describes a particular model which is handled by the backend */ /* available resolutions, physical goemetry, scanning area, ... */ typedef struct Rts8891_Model { @@ -168,11 +166,11 @@ struct Rts8891_Device /**< USB device number for libusb */ SANE_Int devnum; SANE_String file_name; - Rts8891_Model *model; /* points to a structure that decribes model specifics */ + Rts8891_Model *model; /* points to a structure that describes model specifics */ SANE_Int sensor; /* sensor id */ - SANE_Bool initialized; /* true if device has been intialized */ + SANE_Bool initialized; /* true if device has been initialized */ SANE_Bool needs_warming; /* true if device needs warming up */ SANE_Bool parking; /* true if device is parking head */ diff --git a/backend/rts88xx_lib.c b/backend/rts88xx_lib.c index f19ceef..16727ef 100644 --- a/backend/rts88xx_lib.c +++ b/backend/rts88xx_lib.c @@ -15,9 +15,7 @@ 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. + along with this program. If not, see . As a special exception, the authors of SANE give permission for additional uses of the libraries contained in this release of SANE. @@ -327,7 +325,7 @@ sanei_rts88xx_set_status (SANE_Int devnum, SANE_Byte * regs, } /* - * get lamp status by reading registers 0x84 to 0x8f, only 0x8F is currently usefull + * get lamp status by reading registers 0x84 to 0x8f, only 0x8F is currently useful * 0x84 and following could "on" timers */ SANE_Status @@ -596,7 +594,7 @@ sanei_rts88xx_get_mem (SANE_Int devnum, SANE_Byte ctrl1, } /* - * write to the nvram controler + * write to the nvram controller */ SANE_Status sanei_rts88xx_nvram_ctrl (SANE_Int devnum, SANE_Int length, SANE_Byte * value) diff --git a/backend/rts88xx_lib.h b/backend/rts88xx_lib.h index fa7abbd..9e3fc61 100644 --- a/backend/rts88xx_lib.h +++ b/backend/rts88xx_lib.h @@ -15,9 +15,7 @@ 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. + along with this program. If not, see . As a special exception, the authors of SANE give permission for additional uses of the libraries contained in this release of SANE. @@ -196,7 +194,7 @@ SANE_Status sanei_rts88xx_get_mem (SANE_Int devnum, SANE_Byte ctrl1, SANE_Byte * value); /* - * write to the nvram controler + * write to the nvram controller */ SANE_Status sanei_rts88xx_nvram_ctrl (SANE_Int devnum, SANE_Int length, SANE_Byte * value); diff --git a/backend/s9036.c b/backend/s9036.c index 4124b7b..b3734ed 100644 --- a/backend/s9036.c +++ b/backend/s9036.c @@ -15,8 +15,8 @@ for more details. You should have received a copy of the GNU General Public License - along with sane; see the file COPYING. If not, write to the Free - Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + along with sane; see the file COPYING. + If not, see . This file implements a SANE backend for Siemens 9036 flatbed scanners. */ @@ -295,7 +295,7 @@ set_window (S9036_Scanner * s) /* ranges from 20 (little contrast) down to -20 = 235 (much contrast) */ int contr_adjust = auto_contr ? (256 - s->val[OPT_CONTR_ADJUST]) % 256 : 0; - /* Warning ! The following structur SEEMS to be an valid SCSI-2 + /* Warning ! The following structure SEEMS to be an valid SCSI-2 SET_WINDOW command. But e.g. the limits for the window are only 2 Bytes instead of 4. The scanner was built at about 1990, so SCSI-2 wasn't available for development... diff --git a/backend/s9036.h b/backend/s9036.h index 094f94e..97292ac 100644 --- a/backend/s9036.h +++ b/backend/s9036.h @@ -15,8 +15,8 @@ for more details. You should have received a copy of the GNU General Public License - along with sane; see the file COPYING. If not, write to the Free - Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ + along with sane; see the file COPYING. + If not, see . */ #ifndef s9036_h #define s9036_h diff --git a/backend/sane_strstatus.c b/backend/sane_strstatus.c index c76d305..fb3c170 100644 --- a/backend/sane_strstatus.c +++ b/backend/sane_strstatus.c @@ -13,9 +13,7 @@ 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. + along with this program. If not, see . As a special exception, the authors of SANE give permission for additional uses of the libraries contained in this release of SANE. diff --git a/backend/sceptre.c b/backend/sceptre.c index 3670f3c..62f28ff 100644 --- a/backend/sceptre.c +++ b/backend/sceptre.c @@ -16,9 +16,7 @@ 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. + along with this program. If not, see . As a special exception, the authors of SANE give permission for additional uses of the libraries contained in this release of SANE. @@ -43,7 +41,6 @@ */ /* - $Id$ Sceptre S1200 SCSI scanner (sometimes also called S120) */ diff --git a/backend/sceptre.h b/backend/sceptre.h index 8ba5cd8..02438e3 100644 --- a/backend/sceptre.h +++ b/backend/sceptre.h @@ -14,9 +14,7 @@ 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. + along with this program. If not, see . As a special exception, the authors of SANE give permission for additional uses of the libraries contained in this release of SANE. @@ -40,10 +38,6 @@ If you do not wish that, delete this exception notice. */ -/* - $Id$ -*/ - /* Commands supported by the Sceptre S1200 scanner. */ #define SCSI_TEST_UNIT_READY 0x00 #define SCSI_GET_STATUS 0x02 @@ -292,7 +286,7 @@ struct scanners_supported /*--------------------------------------------------------------------------*/ -/* Define a scanner occurence. */ +/* Define a scanner occurrence. */ typedef struct Sceptre_Scanner { struct Sceptre_Scanner *next; diff --git a/backend/sharp.c b/backend/sharp.c index 701b179..d533103 100644 --- a/backend/sharp.c +++ b/backend/sharp.c @@ -18,9 +18,7 @@ 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. + along with this program. If not, see . As a special exception, the authors of SANE give permission for additional uses of the libraries contained in this release of SANE. @@ -1678,7 +1676,7 @@ set_gamma_caps(SHARP_Scanner *s) /* The next function is a slightly modified version of sanei_constrain_value Instead of returning status information like STATUS_INVAL, it adjusts - an invaild value to the nearest allowed one. + an invalid value to the nearest allowed one. */ static void clip_value (const SANE_Option_Descriptor * opt, void * value) @@ -2096,7 +2094,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: + /* xxx the titles and descriptions are confusing: "set white point (red)" Any idea? maybe "threshold to get the red component on" */ @@ -3145,7 +3143,7 @@ sprint_gamma(Option_Value val, SANE_Byte *dst) 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 */ + /* val.wa[i] is over 255, so val.wa[i] is limited to 255 */ for (i = 1; i < 256; i++) p += sprintf((char *) p, ",%i", val.wa[i] > 255 ? 255 : val.wa[i]); return p - dst; diff --git a/backend/sharp.h b/backend/sharp.h index c5dad27..ba5e37f 100644 --- a/backend/sharp.h +++ b/backend/sharp.h @@ -15,9 +15,7 @@ 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. + along with this program. If not, see . As a special exception, the authors of SANE give permission for additional uses of the libraries contained in this release of SANE. diff --git a/backend/sm3600-color.c b/backend/sm3600-color.c index 2e42ada..3a73735 100644 --- a/backend/sm3600-color.c +++ b/backend/sm3600-color.c @@ -13,9 +13,7 @@ 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. + along with this program. If not, see . As a special exception, the authors of SANE give permission for additional uses of the libraries contained in this release of SANE. @@ -221,13 +219,13 @@ TState StartScanColor(TInstance *this) case 75: RegWrite(this,R_XRES,1, 0x20); /* ups, can do only 100 dpi horizontal */ RegWrite(this,R_SWID, 2, 0xC000 | this->state.cxWindow); - RegWrite(this,0x34, 1, 0x83); /* halfs the vertical resolution */ + RegWrite(this,0x34, 1, 0x83); /* halves the vertical resolution */ RegWrite(this,0x47,1,0xC0); /* reduces the speed a bit */ break; case 100: RegWrite(this,R_XRES,1, 0x20); RegWrite(this,R_SWID, 2, 0xC000 | this->state.cxWindow); - RegWrite(this,0x34, 1, 0x63); /* halfs the vertical resolution */ + RegWrite(this,0x34, 1, 0x63); /* halves the vertical resolution */ RegWrite(this,0x47,1,0xC0); /* reduces the speed a bit */ /* I have no idea, what these differences are good for. The seem to produce a slight blue presence. @@ -243,14 +241,14 @@ TState StartScanColor(TInstance *this) RegWrite(this,0x08,2, 0x6A6A); RegWrite(this,R_XRES,1, 0x2A); RegWrite(this,R_SWID, 2, 0x4000 | this->state.cxWindow); - RegWrite(this,0x34, 1, 0x03); /* halfs the vertical resolution */ + RegWrite(this,0x34, 1, 0x03); /* halves the vertical resolution */ RegWrite(this,0x47,1,0xC0); /* reduces the speed a bit */ this->state.szOrder=ORDER_RGB; break; case 600: RegWrite(this,R_XRES,1, 0x3F); RegWrite(this,R_SWID, 2, 0xC000 | this->state.cxWindow); - RegWrite(this,0x34, 1, 0x03); /* halfs the vertical resolution */ + RegWrite(this,0x34, 1, 0x03); /* halves the vertical resolution */ RegWrite(this,0x47,1,0xC2); /* reduces the speed a bit */ break; case 1200: diff --git a/backend/sm3600-gray.c b/backend/sm3600-gray.c index c5efe55..0c36d09 100644 --- a/backend/sm3600-gray.c +++ b/backend/sm3600-gray.c @@ -13,9 +13,7 @@ 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. + along with this program. If not, see . As a special exception, the authors of SANE give permission for additional uses of the libraries contained in this release of SANE. diff --git a/backend/sm3600-homerun.c b/backend/sm3600-homerun.c index b77a76e..33771aa 100644 --- a/backend/sm3600-homerun.c +++ b/backend/sm3600-homerun.c @@ -13,9 +13,7 @@ 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. + along with this program. If not, see . As a special exception, the authors of SANE give permission for additional uses of the libraries contained in this release of SANE. @@ -181,7 +179,7 @@ static TLineType GetLineType(TInstance *this) else bHolesOk=false; lMedian=lSum/cchBulk; - /* this is *definitly* dirty style. We should pass the information + /* this is *definitely* dirty style. We should pass the information by other means... */ if (bHolesOk) { diff --git a/backend/sm3600-scanmtek.c b/backend/sm3600-scanmtek.c index 4aa4f1b..521db9c 100644 --- a/backend/sm3600-scanmtek.c +++ b/backend/sm3600-scanmtek.c @@ -13,9 +13,7 @@ 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. + along with this program. If not, see . As a special exception, the authors of SANE give permission for additional uses of the libraries contained in this release of SANE. @@ -43,8 +41,6 @@ Userspace scan tool for the Microtek 3600 scanner -$Id$ - ====================================================================== */ #include "sm3600-scantool.h" diff --git a/backend/sm3600-scantool.h b/backend/sm3600-scantool.h index 94a4875..16181f1 100644 --- a/backend/sm3600-scantool.h +++ b/backend/sm3600-scantool.h @@ -13,9 +13,7 @@ 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. + along with this program. If not, see . As a special exception, the authors of SANE give permission for additional uses of the libraries contained in this release of SANE. diff --git a/backend/sm3600-scanusb.c b/backend/sm3600-scanusb.c index 7ae90d3..dc9b8d5 100644 --- a/backend/sm3600-scanusb.c +++ b/backend/sm3600-scanusb.c @@ -13,9 +13,7 @@ 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. + along with this program. If not, see . As a special exception, the authors of SANE give permission for additional uses of the libraries contained in this release of SANE. @@ -43,8 +41,6 @@ Userspace scan tool for the Microtek 3600 scanner -$Id$ - (C) Marian Eichholz 2001 26.4.2001: Added an abstraction layer for TransferControlMsg. diff --git a/backend/sm3600-scanutil.c b/backend/sm3600-scanutil.c index 022984e..6fe67ed 100644 --- a/backend/sm3600-scanutil.c +++ b/backend/sm3600-scanutil.c @@ -13,9 +13,7 @@ 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. + along with this program. If not, see . As a special exception, the authors of SANE give permission for additional uses of the libraries contained in this release of SANE. @@ -43,8 +41,6 @@ Userspace scan tool for the Microtek 3600 scanner -$Id$ - ====================================================================== */ #include @@ -85,7 +81,7 @@ void debug_printf(unsigned long ulType, const char *szFormat, ...) SetError(error, format, ...) -The program is aborted, all handles and ressources are freed (this +The program is aborted, all handles and resources are freed (this being global) and the user gets a nice panic screen :-) ********************************************************************** */ diff --git a/backend/sm3600.c b/backend/sm3600.c index 8f8adfc..8542e3e 100644 --- a/backend/sm3600.c +++ b/backend/sm3600.c @@ -14,9 +14,7 @@ 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. + along with this program. If not, see . As a special exception, the authors of SANE give permission for additional uses of the libraries contained in this release of SANE. @@ -672,7 +670,7 @@ SetupInternalParameters(TInstance *this) SANE_Status sane_get_parameters (SANE_Handle handle, SANE_Parameters *p) { - /* extremly important for xscanimage */ + /* extremely important for xscanimage */ TInstance *this; this=(TInstance*)handle; SetupInternalParameters(this); @@ -714,7 +712,7 @@ sane_start (SANE_Handle handle) if (this->state.bScanning) return SANE_STATUS_DEVICE_BUSY; rc=SetupInternalParameters(this); this->state.bCanceled=false; - if (!rc) rc=DoInit(this); /* oopsi, we should initalise :-) */ + if (!rc) rc=DoInit(this); /* oopsi, we should initialise :-) */ if (!rc && !this->bOptSkipOriginate) rc=DoOriginate(this,true); if (!rc) rc=DoJog(this,this->calibration.yMargin); if (rc) return rc; diff --git a/backend/sm3600.h b/backend/sm3600.h index 58e6907..2ecbeb2 100644 --- a/backend/sm3600.h +++ b/backend/sm3600.h @@ -13,9 +13,7 @@ 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. + along with this program. If not, see . As a special exception, the authors of SANE give permission for additional uses of the libraries contained in this release of SANE. diff --git a/backend/sm3840.c b/backend/sm3840.c index 41b72ec..b728128 100644 --- a/backend/sm3840.c +++ b/backend/sm3840.c @@ -15,9 +15,7 @@ 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. + along with this program. If not, see . As a special exception, the authors of SANE give permission for additional uses of the libraries contained in this release of SANE. diff --git a/backend/sm3840.h b/backend/sm3840.h index abcd1b7..d742e07 100644 --- a/backend/sm3840.h +++ b/backend/sm3840.h @@ -15,9 +15,7 @@ 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. + along with this program. If not, see . As a special exception, the authors of SANE give permission for additional uses of the libraries contained in this release of SANE. diff --git a/backend/sm3840_lib.c b/backend/sm3840_lib.c index 163b356..46d9910 100644 --- a/backend/sm3840_lib.c +++ b/backend/sm3840_lib.c @@ -15,9 +15,7 @@ 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. + along with this program. If not, see . As a special exception, the authors of SANE give permission for additional uses of the libraries contained in this release of SANE. @@ -996,7 +994,7 @@ fix_endian_short (unsigned short *data, int count) if (*firstbyte == 255) return; /* INTC endianness */ - DBG (2, "swapping endiannes...\n"); + DBG (2, "swapping endianness...\n"); for (i = 0; i < count; i++) data[i] = ((data[i] >> 8) & 0x00ff) | ((data[i] << 8) & 0xff00); } diff --git a/backend/sm3840_lib.h b/backend/sm3840_lib.h index 2ca65a8..cbbc6d3 100644 --- a/backend/sm3840_lib.h +++ b/backend/sm3840_lib.h @@ -15,9 +15,7 @@ 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. + along with this program. If not, see . As a special exception, the authors of SANE give permission for additional uses of the libraries contained in this release of SANE. diff --git a/backend/sm3840_params.h b/backend/sm3840_params.h index 78640a9..ae86e3a 100644 --- a/backend/sm3840_params.h +++ b/backend/sm3840_params.h @@ -15,9 +15,7 @@ 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. + along with this program. If not, see . As a special exception, the authors of SANE give permission for additional uses of the libraries contained in this release of SANE. diff --git a/backend/sm3840_scan.c b/backend/sm3840_scan.c index 148e37b..b7ffa92 100644 --- a/backend/sm3840_scan.c +++ b/backend/sm3840_scan.c @@ -15,9 +15,7 @@ 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. + along with this program. If not, see . As a special exception, the authors of SANE give permission for additional uses of the libraries contained in this release of SANE. diff --git a/backend/snapscan-data.c b/backend/snapscan-data.c index 6a20499..b3f1802 100644 --- a/backend/snapscan-data.c +++ b/backend/snapscan-data.c @@ -15,9 +15,7 @@ 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. + along with this program. If not, see . As a special exception, the authors of SANE give permission for additional uses of the libraries contained in this release of SANE. @@ -43,11 +41,11 @@ This file contains static calibration data for the Benq 5150C scanner. Once it is known how calibration for this scanner works this file becomes obsolete. - */ +*/ - -/* $Id$ - SANE SnapScan backend */ +/* + SANE SnapScan backend +*/ static const SANE_Byte calibration_data_5150[] = { diff --git a/backend/snapscan-mutex.c b/backend/snapscan-mutex.c index 72b8fe1..2da7d79 100644 --- a/backend/snapscan-mutex.c +++ b/backend/snapscan-mutex.c @@ -14,9 +14,7 @@ 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. + along with this program. If not, see . As a special exception, the authors of SANE give permission for additional uses of the libraries contained in this release of SANE. diff --git a/backend/snapscan-options.c b/backend/snapscan-options.c index 999b312..6bccf38 100644 --- a/backend/snapscan-options.c +++ b/backend/snapscan-options.c @@ -18,9 +18,7 @@ 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. + along with this program. If not, see . As a special exception, the authors of SANE give permission for additional uses of the libraries contained in this release of SANE. @@ -44,10 +42,12 @@ 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. */ + of the AGFA SnapScan and Acer Vuego/Prisa flatbed scanners. +*/ -/* $Id$ - SANE SnapScan backend */ +/* + SANE SnapScan backend +*/ /* default option values */ @@ -1805,7 +1805,6 @@ SANE_Status sane_control_option (SANE_Handle h, } /* - * $Log$ * Revision 1.35 2006/01/06 20:59:17 oliver-guest * Some fixes for the Epson Stylus CX 1500 * @@ -1837,7 +1836,7 @@ SANE_Status sane_control_option (SANE_Handle h, * Fixes for Epson 3490 and 16 bit scan mode * * Revision 1.25 2005/09/28 22:09:26 oliver-guest - * Reenabled enhanced inquiry command for Epson scanners (duh\!) + * Re-enabled enhanced inquiry command for Epson scanners (duh\!) * * Revision 1.24 2005/09/28 21:33:10 oliver-guest * Added 16 bit option for Epson scanners (untested) @@ -1849,7 +1848,7 @@ SANE_Status sane_control_option (SANE_Handle h, * Added support for Epson 3490/3590 (thanks to Matt Judge) * * Revision 1.21 2005/07/20 21:37:29 oliver-guest - * Changed TPO scanning area for 2480/2580, reenabled 2400 DPI for 2480/2580 + * Changed TPO scanning area for 2480/2580, re-enabled 2400 DPI for 2480/2580 * * Revision 1.20 2005/05/22 11:50:24 oliver-guest * Disabled 2400 DPI for Epson 2480 @@ -1867,7 +1866,7 @@ SANE_Status sane_control_option (SANE_Handle h, * Use sanei_thread in snapscan backend * * Revision 1.15 2004/04/02 20:19:23 oliver-guest - * Various bugfixes for gamma corretion (thanks to Robert Tsien) + * Various bugfixes for gamma correction (thanks to Robert Tsien) * * Revision 1.14 2004/02/01 13:32:26 oliver-guest * Fixed resolutions for Epson 1670 @@ -1903,7 +1902,7 @@ SANE_Status sane_control_option (SANE_Handle h, * Disable quality calibration for 5300 * * Revision 1.5 2002/06/06 20:40:00 oliverschwartz - * Changed default scan area for transparancy unit of SnapScan e50 + * Changed default scan area for transparency unit of SnapScan e50 * * Revision 1.4 2002/05/02 18:28:44 oliverschwartz * Added ADF support diff --git a/backend/snapscan-scsi.c b/backend/snapscan-scsi.c index b6e43a1..d223f6a 100644 --- a/backend/snapscan-scsi.c +++ b/backend/snapscan-scsi.c @@ -18,9 +18,7 @@ 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. + along with this program. If not, see . As a special exception, the authors of SANE give permission for additional uses of the libraries contained in this release of SANE. @@ -44,11 +42,12 @@ 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. */ - + of the AGFA SnapScan and Acer Vuego/Prisa flatbed scanners. +*/ -/* $Id$ - SnapScan backend scsi command functions */ +/* + SnapScan backend scsi command functions +*/ /* scanner scsi commands */ @@ -1710,7 +1709,6 @@ static SANE_Status download_firmware(SnapScan_Scanner * pss) } /* - * $Log$ * Revision 1.58 2006/09/03 10:00:11 oliver-guest * Bugfix for firmware download by Paul Smedley * @@ -1766,7 +1764,7 @@ static SANE_Status download_firmware(SnapScan_Scanner * pss) * Fixes for Epson 3490 and 16 bit scan mode * * Revision 1.40 2005/09/28 22:09:26 oliver-guest - * Reenabled enhanced inquiry command for Epson scanners (duh\!) + * Re-enabled enhanced inquiry command for Epson scanners (duh\!) * * Revision 1.39 2005/09/28 21:33:10 oliver-guest * Added 16 bit option for Epson scanners (untested) @@ -1805,7 +1803,7 @@ static SANE_Status download_firmware(SnapScan_Scanner * pss) * Added support for Epson 2480 * * Revision 1.27 2004/04/02 20:19:24 oliver-guest - * Various bugfixes for gamma corretion (thanks to Robert Tsien) + * Various bugfixes for gamma correction (thanks to Robert Tsien) * * Revision 1.26 2003/11/07 23:26:49 oliver-guest * Final bugfixes for bascic support of Epson 1670 @@ -1838,7 +1836,7 @@ static SANE_Status download_firmware(SnapScan_Scanner * pss) * Added support for Benq 5000 * * Revision 1.32 2002/06/06 20:40:01 oliverschwartz - * Changed default scan area for transparancy unit of SnapScan e50 + * Changed default scan area for transparency unit of SnapScan e50 * * Revision 1.31 2002/05/02 18:28:44 oliverschwartz * Added ADF support @@ -1900,7 +1898,7 @@ static SANE_Status download_firmware(SnapScan_Scanner * pss) * * Revision 1.15 2001/09/18 15:01:07 oliverschwartz * - Read scanner id string again after firmware upload - * to indentify correct model + * to identify correct model * - Make firmware upload work for AGFA scanners * - Change copyright notice * @@ -1943,6 +1941,6 @@ static SANE_Status download_firmware(SnapScan_Scanner * pss) * changes. * * Revision 1.2 2000/10/13 03:50:27 cbagwell - * Updating to source from SANE 1.0.3. Calling this versin 1.1 + * Updating to source from SANE 1.0.3. Calling this version 1.1 * * */ diff --git a/backend/snapscan-sources.c b/backend/snapscan-sources.c index e8bbb90..45ad6b7 100644 --- a/backend/snapscan-sources.c +++ b/backend/snapscan-sources.c @@ -18,9 +18,7 @@ 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. + along with this program. If not, see . As a special exception, the authors of SANE give permission for additional uses of the libraries contained in this release of SANE. @@ -44,11 +42,12 @@ 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. */ - + of the AGFA SnapScan and Acer Vuego/Prisa flatbed scanners. +*/ -/* $Id$ - SnapScan backend data sources (implementation) */ +/* + SnapScan backend data sources (implementation) +*/ /************************************************************************************** If you get confused from all the structs (like I did when I first saw them), @@ -689,7 +688,7 @@ typedef struct SANE_Bool ch_lineart; SANE_Int ch_offset; /* The number of lines to be shifted */ SANE_Bool ch_past_init; /* flag indicating if we have enough data to shift pixels down */ - SANE_Bool ch_shift_even; /* flag indicating wether even or odd pixels are shifted */ + SANE_Bool ch_shift_even; /* flag indicating whether even or odd pixels are shifted */ } Deinterlacer; static SANE_Int Deinterlacer_remaining (Source *pself) @@ -1086,7 +1085,7 @@ static SANE_Status RGBRouter_init (RGBRouter *pself, { SANE_Int lines_in_buffer = 0; - /* Size the buffer to accomodate the necessary number of scan + /* Size the buffer to accommodate the necessary number of scan lines to cater for the offset between R, G and B */ lines_in_buffer = pss->chroma + 1; pself->cb_line_size = pself->bytesPerLine((Source *) pself); @@ -1216,7 +1215,7 @@ 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 + /* We only have the interlace problems on some scanners like the Epson Perfection 2480/2580 at 2400 dpi. */ if (status == SANE_STATUS_GOOD && @@ -1261,7 +1260,6 @@ static SANE_Status create_source_chain (SnapScan_Scanner *pss, } /* - * $Log$ * Revision 1.21 2005/12/02 19:12:54 oliver-guest * Another fix for lineart mode for the Epson 3490 @ 3200 DPI * @@ -1334,7 +1332,7 @@ static SANE_Status create_source_chain (SnapScan_Scanner *pss, * * Revision 1.13 2001/09/18 15:01:07 oliverschwartz * - Read scanner id string again after firmware upload - * to indentify correct model + * to identify correct model * - Make firmware upload work for AGFA scanners * - Change copyright notice * @@ -1353,7 +1351,7 @@ static SANE_Status create_source_chain (SnapScan_Scanner *pss, * * Revision 1.8 2000/11/28 03:55:07 cbagwell * Reverting a fix to RGBRouter_remaining to original fix. This allows - * most scanners to scan at 600 dpi by ignoring insufficent data in + * most scanners to scan at 600 dpi by ignoring insufficient data in * the RGB circular buffer and always returning size = 1 in those cases. * This should probably be fixed at a higher level. * @@ -1363,7 +1361,7 @@ static SANE_Status create_source_chain (SnapScan_Scanner *pss, * value. * * Revision 1.6 2000/11/04 01:53:58 cbagwell - * Commiting some needed USB updates. Added extra test logic to detect + * Committing some needed USB updates. Added extra test logic to detect * bad bytes_expected values. Just to help debug faster on scanners * that tickle the bug. * @@ -1377,5 +1375,5 @@ static SANE_Status create_source_chain (SnapScan_Scanner *pss, * Add support for Acer300f * * Revision 1.2 2000/10/13 03:50:27 cbagwell - * Updating to source from SANE 1.0.3. Calling this versin 1.1 + * Updating to source from SANE 1.0.3. Calling this version 1.1 * */ diff --git a/backend/snapscan-sources.h b/backend/snapscan-sources.h index 595b48b..aa10e9d 100644 --- a/backend/snapscan-sources.h +++ b/backend/snapscan-sources.h @@ -18,9 +18,7 @@ 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. + along with this program. If not, see . As a special exception, the authors of SANE give permission for additional uses of the libraries contained in this release of SANE. @@ -44,11 +42,12 @@ 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. */ + of the AGFA SnapScan and Acer Vuego/Prisa flatbed scanners. +*/ - -/* $Id$ - SnapScan backend scan data sources */ +/* + SnapScan backend scan data sources +*/ #ifndef SNAPSCAN_SOURCES_H #define SNAPSCAN_SOURCES_H @@ -87,7 +86,6 @@ static SANE_Status Source_init (Source *pself, #endif /* - * $Log$ * Revision 1.5 2001/12/17 22:51:50 oliverschwartz * Update to snapscan-20011212 (snapscan 1.4.3) * @@ -96,7 +94,7 @@ static SANE_Status Source_init (Source *pself, * * Revision 1.4 2001/09/18 15:01:07 oliverschwartz * - Read scanner id string again after firmware upload - * to indentify correct model + * to identify correct model * - Make firmware upload work for AGFA scanners * - Change copyright notice * @@ -105,5 +103,5 @@ static SANE_Status Source_init (Source *pself, * Support for 1212U_2 * * Revision 1.2 2000/10/13 03:50:27 cbagwell - * Updating to source from SANE 1.0.3. Calling this versin 1.1 + * Updating to source from SANE 1.0.3. Calling this version 1.1 * */ diff --git a/backend/snapscan-usb.c b/backend/snapscan-usb.c index 116f9db..49cca1a 100644 --- a/backend/snapscan-usb.c +++ b/backend/snapscan-usb.c @@ -16,9 +16,7 @@ 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. + along with this program. If not, see . As a special exception, the authors of SANE give permission for additional uses of the libraries contained in this release of SANE. @@ -68,8 +66,9 @@ So far this strategy has worked flawlessly. Thanks Dmitri! */ -/* $Id$ - SnapScan backend scan data sources */ +/* + SnapScan backend scan data sources +*/ #include "snapscan-usb.h" #include "snapscan-mutex.c" @@ -579,7 +578,6 @@ static void snapscani_usb_shm_exit(void) } #endif /* - * $Log$ * Revision 1.22 2006/01/26 17:42:30 hmg-guest * Added #defines for SHM_R/W for cygwin (patch from Philip Aston ). * @@ -648,7 +646,7 @@ static void snapscani_usb_shm_exit(void) * * Revision 1.12 2001/09/18 15:01:07 oliverschwartz * - Read scanner id string again after firmware upload - * to indentify correct model + * to identify correct model * - Make firmware upload work for AGFA scanners * - Change copyright notice * diff --git a/backend/snapscan-usb.h b/backend/snapscan-usb.h index c222d3f..9f6d93c 100644 --- a/backend/snapscan-usb.h +++ b/backend/snapscan-usb.h @@ -16,9 +16,7 @@ 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. + along with this program. If not, see . As a special exception, the authors of SANE give permission for additional uses of the libraries contained in this release of SANE. @@ -45,8 +43,9 @@ backend. */ -/* $Id$ - SnapScan backend scan data sources */ +/* + SnapScan backend scan data sources +*/ #ifndef snapscan_usb_h #define snapscan_usb_h @@ -104,7 +103,6 @@ static SANE_Status usb_cmd(int fd, const void *src, size_t src_size, #endif /* - * $Log$ * Revision 1.6 2003/07/26 17:16:55 oliverschwartz * Changed licence to GPL + SANE exception for snapscan-usb.[ch] * @@ -121,7 +119,7 @@ static SANE_Status usb_cmd(int fd, const void *src, size_t src_size, * * Revision 1.8 2001/09/18 15:01:07 oliverschwartz * - Read scanner id string again after firmware upload - * to indentify correct model + * to identify correct model * - Make firmware upload work for AGFA scanners * - Change copyright notice * diff --git a/backend/snapscan.c b/backend/snapscan.c index b93f1f7..1298858 100644 --- a/backend/snapscan.c +++ b/backend/snapscan.c @@ -19,9 +19,7 @@ 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. + along with this program. If not, see . As a special exception, the authors of SANE give permission for additional uses of the libraries contained in this release of SANE. @@ -45,11 +43,12 @@ 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. */ + of the AGFA SnapScan and Acer Vuego/Prisa flatbed scanners. +*/ - -/* $Id$ - SANE SnapScan backend */ +/* + SANE SnapScan backend +*/ #include "../include/sane/config.h" @@ -1977,7 +1976,6 @@ SANE_Status sane_get_select_fd (SANE_Handle h, SANE_Int * fd) } /* - * $Log$ * Revision 1.73 2008/11/26 21:21:29 kitno-guest * * backend/ *.[ch]: nearly every backend used V_MAJOR * instead of SANE_CURRENT_MAJOR in sane_init() @@ -2155,7 +2153,7 @@ SANE_Status sane_get_select_fd (SANE_Handle h, SANE_Int * fd) * Set backend version to 1.4.14 * * Revision 1.46 2002/06/06 20:40:01 oliverschwartz - * Changed default scan area for transparancy unit of SnapScan e50 + * Changed default scan area for transparency unit of SnapScan e50 * * Revision 1.45 2002/05/02 18:29:34 oliverschwartz * - Added ADF support @@ -2247,7 +2245,7 @@ SANE_Status sane_get_select_fd (SANE_Handle h, SANE_Int * fd) * * Revision 1.20 2001/09/18 15:01:07 oliverschwartz * - Read scanner id string again after firmware upload - * to indentify correct model + * to identify correct model * - Make firmware upload work for AGFA scanners * - Change copyright notice * @@ -2311,7 +2309,7 @@ SANE_Status sane_get_select_fd (SANE_Handle h, SANE_Int * fd) * changes. * * Revision 1.4 2000/10/13 03:50:27 cbagwell - * Updating to source from SANE 1.0.3. Calling this versin 1.1 + * Updating to source from SANE 1.0.3. Calling this version 1.1 * * Revision 1.3 2000/08/12 15:09:35 pere * Merge devel (v1.0.3) into head branch. @@ -2550,13 +2548,13 @@ SANE_Status sane_get_select_fd (SANE_Handle h, SANE_Int * fd) * Revision 1.16 1998/01/23 07:40:23 charter * Reindented using GNU convention at David Mosberger-Tang's request. * Also applied David's patch fixing problems on 64-bit architectures. - * Now using scanner's reported speed to guage amount of data to request + * Now using scanner's reported speed to gauge amount of data to request * in a read on the scsi fd---nonblocking mode operates better now. * Fixed stupid bug I introduced in preview mode data transfer. * * Revision 1.15 1998/01/22 06:18:57 charter * Raised the priority of a couple of DBG messages in reserve_unit() - * and release_unit(), and got rid of some unecessary ones. + * and release_unit(), and got rid of some unnecessary ones. * * Revision 1.14 1998/01/22 05:15:35 charter * Have replaced the bit depth option with a mode option; various diff --git a/backend/snapscan.h b/backend/snapscan.h index 19a9fb5..02d8bf9 100644 --- a/backend/snapscan.h +++ b/backend/snapscan.h @@ -18,9 +18,7 @@ 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. + along with this program. If not, see . As a special exception, the authors of SANE give permission for additional uses of the libraries contained in this release of SANE. @@ -44,10 +42,12 @@ 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. */ + of the AGFA SnapScan and Acer Vuego/Prisa flatbed scanners. +*/ -/* $Id$ - SANE SnapScan backend */ +/* + SANE SnapScan backend +*/ #ifndef snapscan_h #define snapscan_h @@ -437,7 +437,6 @@ struct snapscan_scanner #endif /* - * $Log$ * Revision 1.42 2008/05/15 12:50:24 ellert-guest * Fix for bug #306751: sanei-thread with pthreads on 64 bit * @@ -586,7 +585,7 @@ struct snapscan_scanner * * Revision 1.15 2001/09/18 15:01:07 oliverschwartz * - Read scanner id string again after firmware upload - * to indentify correct model + * to identify correct model * - Make firmware upload work for AGFA scanners * - Change copyright notice * @@ -622,7 +621,7 @@ struct snapscan_scanner * Adding USB files for optional USB compiles. * * Revision 1.4 2000/10/13 03:50:27 cbagwell - * Updating to source from SANE 1.0.3. Calling this versin 1.1 + * Updating to source from SANE 1.0.3. Calling this version 1.1 * * Revision 1.3 2000/08/12 15:09:37 pere * Merge devel (v1.0.3) into head branch. diff --git a/backend/sp15c-scsi.h b/backend/sp15c-scsi.h index 13553a2..1d3e0a1 100644 --- a/backend/sp15c-scsi.h +++ b/backend/sp15c-scsi.h @@ -16,9 +16,7 @@ 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. + along with this program. If not, see . As a special exception, the authors of SANE give permission for additional uses of the libraries contained in this release of SANE. @@ -47,7 +45,6 @@ /* ------------------------------------------------------------------------- */ /* - * $Log$ * Revision 1.6 2005/09/19 19:57:48 fzago-guest * Replaced __unused__ with __sane_unused__ to avoid a namespace conflict. * diff --git a/backend/sp15c.c b/backend/sp15c.c index 20b2c80..6feada5 100644 --- a/backend/sp15c.c +++ b/backend/sp15c.c @@ -13,9 +13,7 @@ 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. + along with this program. If not, see . As a special exception, the authors of SANE give permission for additional uses of the libraries contained in this release of SANE. @@ -43,7 +41,6 @@ Written by Randolph Bentson */ /* - * $Log$ * Revision 1.17 2008/11/26 21:21:30 kitno-guest * * backend/ *.[ch]: nearly every backend used V_MAJOR * instead of SANE_CURRENT_MAJOR in sane_init() @@ -192,10 +189,10 @@ . - sane_open() : open a particular scanner-device . . - sane_set_io_mode : set blocking-mode . . - sane_get_select_fd : get scanner-fd - . . - sane_get_option_descriptor() : get option informations + . . - sane_get_option_descriptor() : get option information . . - sane_control_option() : change option values . . - . . - sane_start() : start image aquisition + . . - sane_start() : start image acquisition . . - sane_get_parameters() : returns actual scan-parameters . . - sane_read() : read image-data (from pipe) . . diff --git a/backend/sp15c.h b/backend/sp15c.h index f4b0b7f..7188f2a 100644 --- a/backend/sp15c.h +++ b/backend/sp15c.h @@ -16,9 +16,7 @@ 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. + along with this program. If not, see . As a special exception, the authors of SANE give permission for additional uses of the libraries contained in this release of SANE. @@ -47,7 +45,6 @@ /* ------------------------------------------------------------------------- */ /* - * $Log$ * Revision 1.8 2008/05/15 12:50:24 ellert-guest * Fix for bug #306751: sanei-thread with pthreads on 64 bit * diff --git a/backend/st400.c b/backend/st400.c index 16c7f9f..487dbd1 100644 --- a/backend/st400.c +++ b/backend/st400.c @@ -19,9 +19,7 @@ vim: ts=4 sw=4 noexpandtab 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. + along with this program. If not, see . As a special exception, the authors of SANE give permission for additional uses of the libraries contained in this release of SANE. diff --git a/backend/st400.conf.in b/backend/st400.conf.in index 5e29226..5783cb8 100644 --- a/backend/st400.conf.in +++ b/backend/st400.conf.in @@ -42,7 +42,7 @@ scsi SIEMENS "ST 800" Scanner * * 3 * # Maximum bytes to read in a single SCSI command (see also maxread above). #option scanner_maxread 65536 -# Supported resolutions (upto 15 different values). If you specify an +# Supported resolutions (up to 15 different values). If you specify an # illegal value here, most likely the scanner will not report an error, # but only scan a small sub-area of the requested area (at least my ST400 # does this). diff --git a/backend/stv680.c b/backend/stv680.c index 473def0..cab59b4 100644 --- a/backend/stv680.c +++ b/backend/stv680.c @@ -30,14 +30,11 @@ 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. + along with this program. If not, see . ------------------------------------------------------------------ */ -/* $Id$ - +/* stv680 vidcam driver Gerard Klaver */ @@ -296,7 +293,7 @@ stv680_init_2 (Stv680_Vidcam * dev) dev->buffer_size = 356 * 292; if (dev->VGA) dev->buffer_size = 644 * 484; - DBG (DBG_proc, "stv680_init_2: dev->bufffer = 0x%lx\n", (unsigned long) (size_t) dev->buffer_size); + DBG (DBG_proc, "stv680_init_2: dev->buffer = 0x%lx\n", (unsigned long) (size_t) dev->buffer_size); dev->buffer = malloc (dev->buffer_size); diff --git a/backend/stv680.h b/backend/stv680.h index a4f5fbe..eefa8f0 100644 --- a/backend/stv680.h +++ b/backend/stv680.h @@ -30,16 +30,10 @@ 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. + along with this program. If not, see . --------------------------------------------------------------------- */ -/* - $Id$ - update 20-04-2006*/ - /* Commands supported by the vidcam. */ /*--------------------------------------------------------------------------*/ @@ -117,7 +111,7 @@ struct vidcam_hardware #define COLOR_RGB_TEXT_STR SANE_I18N("Color RGB TEXT") /*--------------------------------------------------------------------------*/ -/* Define a vidcam occurence. */ +/* Define a vidcam occurrence. */ typedef struct Stv680_Vidcam { struct Stv680_Vidcam *next; diff --git a/backend/tamarack.c b/backend/tamarack.c index feb9ee1..38e0aad 100644 --- a/backend/tamarack.c +++ b/backend/tamarack.c @@ -14,9 +14,7 @@ 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. + along with this program. If not, see . Note: The exception that is mentioned in the other source files is not here. If a case arises where you need the rights that that @@ -30,8 +28,8 @@ This file implements a SANE backend for Tamarack flatbed scanners. */ /* - This driver was written initially by changing all occurances of - "mustek" to "tamarack". This actuall worked without modification + This driver was written initially by changing all occurrences of + "mustek" to "tamarack". This actually worked without modification for the manufacturer detection code! :-) */ diff --git a/backend/tamarack.h b/backend/tamarack.h index 3b1e1c5..7325657 100644 --- a/backend/tamarack.h +++ b/backend/tamarack.h @@ -15,9 +15,7 @@ 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. + along with this program. If not, see . */ diff --git a/backend/teco1.c b/backend/teco1.c index 136f537..6462ac2 100644 --- a/backend/teco1.c +++ b/backend/teco1.c @@ -15,9 +15,7 @@ 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. + along with this program. If not, see . As a special exception, the authors of SANE give permission for additional uses of the libraries contained in this release of SANE. @@ -42,7 +40,6 @@ */ /* - $Id$ Some Relisys scanners AVEC and RELI series */ @@ -1005,7 +1002,7 @@ attach_scanner (const char *devicename, Teco_Scanner ** devp) return SANE_STATUS_INVAL; } - /* Get the page 0x82. It doesn't appear to be usefull yet. */ + /* Get the page 0x82. It doesn't appear to be useful yet. */ teco_get_inquiry_82 (dev); teco_close (dev); diff --git a/backend/teco1.h b/backend/teco1.h index 528613f..0d1b009 100644 --- a/backend/teco1.h +++ b/backend/teco1.h @@ -15,9 +15,7 @@ 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. + along with this program. If not, see . As a special exception, the authors of SANE give permission for additional uses of the libraries contained in this release of SANE. @@ -41,10 +39,6 @@ If you do not wish that, delete this exception notice. */ -/* - $Id$ -*/ - /* Commands supported by the scanner. */ #define SCSI_TEST_UNIT_READY 0x00 #define SCSI_REQUEST_SENSE 0x03 @@ -293,7 +287,7 @@ struct scanners_supported /*--------------------------------------------------------------------------*/ -/* Define a scanner occurence. */ +/* Define a scanner occurrence. */ typedef struct Teco_Scanner { struct Teco_Scanner *next; diff --git a/backend/teco2.c b/backend/teco2.c index a104189..01fb667 100644 --- a/backend/teco2.c +++ b/backend/teco2.c @@ -16,9 +16,7 @@ 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. + along with this program. If not, see . As a special exception, the authors of SANE give permission for additional uses of the libraries contained in this release of SANE. @@ -43,7 +41,6 @@ */ /* - $Id$ TECO scanner VM3575, VM656A, VM6575, VM6586, VM356A, VM3564 update 2003/02/14, Patch for VM356A Gerard Klaver update 2003/03/19, traces, tests VM356A Gerard Klaver, Michael Hoeller @@ -1368,7 +1365,7 @@ teco_do_calibration (Teco_Scanner * dev) { tmp_min_buf[3 * j + 1] = dev->buffer[3 * j + 1]; } - /* get hightest value */ + /* get highest value */ if (tmp_max_buf[3 * j + 1] < dev->buffer[3 * j + 1]) { tmp_max_buf[3 * j + 1] = dev->buffer[3 * j + 1]; @@ -2141,7 +2138,7 @@ teco_wait_scanner (Teco_Scanner * dev) * sane is waiting for a group of 3 bytes per color. To make things * funnier, the rasters are shifted. As a result, color planes appear to be shifted be a few pixels. * - * The order of the color is dependant on each scanners. Also the same + * The order of the color is dependent 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: @@ -2149,7 +2146,7 @@ teco_wait_scanner (Teco_Scanner * dev) * then red in added - BRBR * then green - BRG ... (most of the picture) * then blue is removed - RGRG - * and finaly only green stays - GG + * and finally 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, @@ -3192,7 +3189,7 @@ sane_start (SANE_Handle handle) return SANE_STATUS_NO_MEM; } - /* Rasters are meaningfull only in color mode. */ + /* Rasters are meaningful only in color mode. */ dev->raster_size = dev->params.pixels_per_line; dev->raster_real = dev->params.lines * 3; dev->raster_num = 0; diff --git a/backend/teco2.h b/backend/teco2.h index ead4525..df70752 100644 --- a/backend/teco2.h +++ b/backend/teco2.h @@ -16,9 +16,7 @@ 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. + along with this program. If not, see . As a special exception, the authors of SANE give permission for additional uses of the libraries contained in this release of SANE. @@ -42,10 +40,6 @@ If you do not wish that, delete this exception notice. */ -/* - $Id$ -*/ - /* Commands supported by the scanner. */ #define SCSI_TEST_UNIT_READY 0x00 #define SCSI_REQUEST_SENSE 0x03 @@ -347,7 +341,7 @@ struct scanners_supported /*--------------------------------------------------------------------------*/ -/* Define a scanner occurence. */ +/* Define a scanner occurrence. */ typedef struct Teco_Scanner { struct Teco_Scanner *next; diff --git a/backend/teco3.c b/backend/teco3.c index b58312a..6a0c61f 100644 --- a/backend/teco3.c +++ b/backend/teco3.c @@ -15,9 +15,7 @@ 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. + along with this program. If not, see . As a special exception, the authors of SANE give permission for additional uses of the libraries contained in this release of SANE. @@ -42,7 +40,6 @@ */ /* - $Id$ VM3552 (and maybe VM4552 and VM6552) */ @@ -1946,7 +1943,7 @@ sane_get_parameters (SANE_Handle handle, SANE_Parameters * params) /* If the scanner does not have enough memory, it will * send the raw rasters instead of returning a full - * interleaved line. Unfortunatly this does not work well, + * interleaved line. Unfortunately this does not work well, * because I don't know how to compute the color * shifting. So here is the result of some trial and error * process. This is ignored if the scanner has a RAM @@ -2036,7 +2033,7 @@ sane_start (SANE_Handle handle) return SANE_STATUS_NO_MEM; } - /* Rasters are meaningfull only in color mode. */ + /* Rasters are meaningful only in color mode. */ dev->raster_size = dev->params.pixels_per_line; dev->raster_real = dev->params.lines * 3; dev->raster_num = 0; diff --git a/backend/teco3.h b/backend/teco3.h index 4c0e1af..35f3d30 100644 --- a/backend/teco3.h +++ b/backend/teco3.h @@ -15,9 +15,7 @@ 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. + along with this program. If not, see . As a special exception, the authors of SANE give permission for additional uses of the libraries contained in this release of SANE. @@ -41,10 +39,6 @@ If you do not wish that, delete this exception notice. */ -/* - $Id$ -*/ - /* Commands supported by the scanner. */ #define SCSI_TEST_UNIT_READY 0x00 #define SCSI_REQUEST_SENSE 0x03 @@ -296,7 +290,7 @@ struct scanners_supported /*--------------------------------------------------------------------------*/ -/* Define a scanner occurence. */ +/* Define a scanner occurrence. */ typedef struct Teco_Scanner { struct Teco_Scanner *next; diff --git a/backend/test-picture.c b/backend/test-picture.c index 66374c7..d9549ec 100644 --- a/backend/test-picture.c +++ b/backend/test-picture.c @@ -13,9 +13,7 @@ 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. + along with this program. If not, see . As a special exception, the authors of SANE give permission for additional uses of the libraries contained in this release of SANE. diff --git a/backend/test.c b/backend/test.c index a1e186e..075fdfa 100644 --- a/backend/test.c +++ b/backend/test.c @@ -17,9 +17,7 @@ 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. + along with this program. If not, see . As a special exception, the authors of SANE give permission for additional uses of the libraries contained in this release of SANE. @@ -237,35 +235,34 @@ static SANE_String_Const source_list[] = { static double random_factor; /* use for fuzzyness of parameters */ -/* initial values */ +/* initial values. Initial string values are set in sane_init() */ static SANE_Word init_number_of_devices = 2; static SANE_Fixed init_tl_x = SANE_FIX (0.0); static SANE_Fixed init_tl_y = SANE_FIX (0.0); static SANE_Fixed init_br_x = SANE_FIX (80.0); static SANE_Fixed init_br_y = SANE_FIX (100.0); static SANE_Word init_resolution = 50; -static SANE_String init_mode =SANE_VALUE_SCAN_MODE_GRAY; +static SANE_String init_mode = NULL; static SANE_Word init_depth = 8; static SANE_Bool init_hand_scanner = SANE_FALSE; static SANE_Bool init_three_pass = SANE_FALSE; -static SANE_String init_three_pass_order = "RGB"; -static SANE_String init_scan_source = "Flatbed"; -static SANE_String init_test_picture = "Solid black"; +static SANE_String init_three_pass_order = NULL; +static SANE_String init_scan_source = NULL; +static SANE_String init_test_picture = NULL; static SANE_Bool init_invert_endianess = SANE_FALSE; static SANE_Bool init_read_limit = SANE_FALSE; static SANE_Word init_read_limit_size = 1; static SANE_Bool init_read_delay = SANE_FALSE; static SANE_Word init_read_delay_duration = 1000; -static SANE_String init_read_status_code = "Default"; +static SANE_String init_read_status_code = NULL; static SANE_Bool init_fuzzy_parameters = SANE_FALSE; static SANE_Word init_ppl_loss = 0; static SANE_Bool init_non_blocking = SANE_FALSE; static SANE_Bool init_select_fd = SANE_FALSE; static SANE_Bool init_enable_test_options = SANE_FALSE; -static SANE_String init_string = "This is the contents of the string option. " - "Fill some more words to see how the frontend behaves."; -static SANE_String init_string_constraint_string_list = "First entry"; -static SANE_String init_string_constraint_long_string_list = "First entry"; +static SANE_String init_string = NULL; +static SANE_String init_string_constraint_string_list = NULL; +static SANE_String init_string_constraint_long_string_list = NULL; /* Test if this machine is little endian (from coolscan.c) */ static SANE_Bool @@ -320,6 +317,38 @@ check_handle (SANE_Handle handle) return SANE_FALSE; } +static void +cleanup_options (Test_Device * test_device) +{ + DBG (2, "cleanup_options: test_device=%p\n", (void *) test_device); + + free(test_device->val[opt_mode].s); + test_device->val[opt_mode].s = NULL; + + free(test_device->val[opt_three_pass_order].s); + test_device->val[opt_three_pass_order].s = NULL; + + free(test_device->val[opt_scan_source].s); + test_device->val[opt_scan_source].s = NULL; + + free(test_device->val[opt_test_picture].s); + test_device->val[opt_test_picture].s = NULL; + + free(test_device->val[opt_read_status_code].s); + test_device->val[opt_read_status_code].s = NULL; + + free(test_device->val[opt_string].s); + test_device->val[opt_string].s = NULL; + + free(test_device->val[opt_string_constraint_string_list].s); + test_device->val[opt_string_constraint_string_list].s = NULL; + + free(test_device->val[opt_string_constraint_long_string_list].s); + test_device->val[opt_string_constraint_long_string_list].s = NULL; + + test_device->options_initialized = SANE_FALSE; +} + static SANE_Status init_options (Test_Device * test_device) { @@ -368,7 +397,7 @@ init_options (Test_Device * test_device) od->constraint.string_list = mode_list; test_device->val[opt_mode].s = malloc (od->size); if (!test_device->val[opt_mode].s) - return SANE_STATUS_NO_MEM; + goto fail; strcpy (test_device->val[opt_mode].s, init_mode); /* opt_depth */ @@ -435,7 +464,7 @@ init_options (Test_Device * test_device) od->constraint.string_list = order_list; test_device->val[opt_three_pass_order].s = malloc (od->size); if (!test_device->val[opt_three_pass_order].s) - return SANE_STATUS_NO_MEM; + goto fail; strcpy (test_device->val[opt_three_pass_order].s, init_three_pass_order); /* opt_resolution */ @@ -464,7 +493,7 @@ init_options (Test_Device * test_device) od->constraint.string_list = source_list; test_device->val[opt_scan_source].s = malloc (od->size); if (!test_device->val[opt_scan_source].s) - return SANE_STATUS_NO_MEM; + goto fail; strcpy (test_device->val[opt_scan_source].s, init_scan_source); /* opt_special_group */ @@ -500,7 +529,7 @@ init_options (Test_Device * test_device) od->constraint.string_list = test_picture_list; test_device->val[opt_test_picture].s = malloc (od->size); if (!test_device->val[opt_test_picture].s) - return SANE_STATUS_NO_MEM; + goto fail; strcpy (test_device->val[opt_test_picture].s, init_test_picture); /* opt_invert_endianness */ @@ -595,7 +624,7 @@ init_options (Test_Device * test_device) od->constraint.string_list = read_status_code_list; test_device->val[opt_read_status_code].s = malloc (od->size); if (!test_device->val[opt_read_status_code].s) - return SANE_STATUS_NO_MEM; + goto fail; strcpy (test_device->val[opt_read_status_code].s, init_read_status_code); /* opt_ppl_loss */ @@ -1129,7 +1158,7 @@ init_options (Test_Device * test_device) od->constraint.string_list = 0; test_device->val[opt_string].s = malloc (od->size); if (!test_device->val[opt_string].s) - return SANE_STATUS_NO_MEM; + goto fail; strcpy (test_device->val[opt_string].s, init_string); /* opt_string_constraint_string_list */ @@ -1148,7 +1177,7 @@ init_options (Test_Device * test_device) od->constraint.string_list = string_constraint_string_list; test_device->val[opt_string_constraint_string_list].s = malloc (od->size); if (!test_device->val[opt_string_constraint_string_list].s) - return SANE_STATUS_NO_MEM; + goto fail; strcpy (test_device->val[opt_string_constraint_string_list].s, init_string_constraint_string_list); @@ -1169,7 +1198,7 @@ init_options (Test_Device * test_device) test_device->val[opt_string_constraint_long_string_list].s = malloc (od->size); if (!test_device->val[opt_string_constraint_long_string_list].s) - return SANE_STATUS_NO_MEM; + goto fail; strcpy (test_device->val[opt_string_constraint_long_string_list].s, init_string_constraint_long_string_list); @@ -1202,6 +1231,43 @@ init_options (Test_Device * test_device) test_device->val[opt_button].w = 0; return SANE_STATUS_GOOD; + +fail: + cleanup_options (test_device); + return SANE_STATUS_NO_MEM; +} + +static void +cleanup_initial_string_values () +{ + // Cleanup backing memory for initial values of string options. + free (init_mode); + init_mode = NULL; + free (init_three_pass_order); + init_three_pass_order = NULL; + free (init_scan_source); + init_scan_source = NULL; + free (init_test_picture); + init_test_picture = NULL; + free (init_read_status_code); + init_read_status_code = NULL; + free (init_string); + init_string = NULL; + free (init_string_constraint_string_list); + init_string_constraint_string_list = NULL; + free (init_string_constraint_long_string_list); + init_string_constraint_long_string_list = NULL; +} + +static void +cleanup_test_device (Test_Device * test_device) +{ + DBG (2, "cleanup_test_device: test_device=%p\n", (void *) test_device); + if (test_device->options_initialized) + cleanup_options (test_device); + if (test_device->name) + free (test_device->name); + free (test_device); } static SANE_Status @@ -1331,7 +1397,11 @@ read_option (SANE_String line, SANE_String option_string, { DBG (3, "read_option: set option `%s' to `%s'\n", option_string, word); + if (*(SANE_String *) value) + free (*(SANE_String *) value); *(SANE_String *) value = strdup (word); + if (!*(SANE_String *) value) + return SANE_STATUS_NO_MEM; } break; } @@ -1575,6 +1645,49 @@ sane_init (SANE_Int * __sane_unused__ version_code, SANE_Auth_Callback __sane_un if (inited) DBG (3, "sane_init: warning: already inited\n"); + // Setup initial values of string options. Call free initially in case we've + // already called sane_init and these values are already non-null. + free (init_mode); + init_mode = strdup (SANE_VALUE_SCAN_MODE_GRAY); + if (!init_mode) + goto fail; + + free (init_three_pass_order); + init_three_pass_order = strdup ("RGB"); + if (!init_three_pass_order) + goto fail; + + free (init_scan_source); + init_scan_source = strdup ("Flatbed"); + if (!init_scan_source) + goto fail; + + free (init_test_picture); + init_test_picture = strdup ("Solid black"); + if (!init_test_picture) + goto fail; + + free (init_read_status_code); + init_read_status_code = strdup ("Default"); + if (!init_read_status_code) + goto fail; + + free (init_string); + init_string = strdup ("This is the contents of the string option. " + "Fill some more words to see how the frontend behaves."); + if (!init_string) + goto fail; + + free (init_string_constraint_string_list); + init_string_constraint_string_list = strdup ("First entry"); + if (!init_string_constraint_string_list) + goto fail; + + free (init_string_constraint_long_string_list); + init_string_constraint_long_string_list = strdup ("First entry"); + if (!init_string_constraint_long_string_list) + goto fail; + fp = sanei_config_open (TEST_CONFIG_FILE); if (fp) { @@ -1713,14 +1826,14 @@ sane_init (SANE_Int * __sane_unused__ version_code, SANE_Auth_Callback __sane_un sane_device_list = malloc ((init_number_of_devices + 1) * sizeof (sane_device)); if (!sane_device_list) - return SANE_STATUS_NO_MEM; + goto fail; for (num = 0; num < init_number_of_devices; num++) { SANE_Char number_string[PATH_MAX]; - test_device = malloc (sizeof (*test_device)); + test_device = calloc (sizeof (*test_device), 1); if (!test_device) - return SANE_STATUS_NO_MEM; + goto fail_device; test_device->sane.vendor = "Noname"; test_device->sane.type = "virtual device"; test_device->sane.model = "frontend-tester"; @@ -1728,7 +1841,7 @@ sane_init (SANE_Int * __sane_unused__ version_code, SANE_Auth_Callback __sane_un number_string[sizeof (number_string) - 1] = '\0'; test_device->name = strdup (number_string); if (!test_device->name) - return SANE_STATUS_NO_MEM; + goto fail_name; test_device->sane.name = test_device->name; if (previous_device) previous_device->next = test_device; @@ -1740,6 +1853,7 @@ sane_init (SANE_Int * __sane_unused__ version_code, SANE_Auth_Callback __sane_un test_device->eof = SANE_FALSE; test_device->scanning = SANE_FALSE; test_device->cancelled = SANE_FALSE; + test_device->options_initialized = SANE_FALSE; sanei_thread_initialize (test_device->reader_pid); test_device->pipe = -1; DBG (4, "sane_init: new device: `%s' is a %s %s %s\n", @@ -1752,6 +1866,25 @@ sane_init (SANE_Int * __sane_unused__ version_code, SANE_Auth_Callback __sane_un random_factor = ((double) rand ()) / RAND_MAX + 0.5; inited = SANE_TRUE; return SANE_STATUS_GOOD; + +fail_name: + // test_device refers to the last device we were creating, which has not + // yet been added to the linked list of devices. + free (test_device); +fail_device: + // Now, iterate through the linked list of devices to clean up any successful + // devices. + test_device = first_test_device; + while (test_device) + { + previous_device = test_device; + test_device = test_device->next; + cleanup_test_device (previous_device); + } + free (sane_device_list); +fail: + cleanup_initial_string_values (); + return SANE_STATUS_NO_MEM; } void @@ -1772,15 +1905,15 @@ sane_exit (void) DBG (4, "sane_exit: freeing device %s\n", test_device->name); previous_device = test_device; test_device = test_device->next; - if (previous_device->name) - free (previous_device->name); - free (previous_device); + cleanup_test_device (previous_device); } DBG (4, "sane_exit: freeing device list\n"); if (sane_device_list) free (sane_device_list); sane_device_list = NULL; first_test_device = NULL; + + cleanup_initial_string_values (); inited = SANE_FALSE; return; } @@ -1855,9 +1988,12 @@ sane_open (SANE_String_Const devicename, SANE_Handle * handle) test_device->open = SANE_TRUE; *handle = test_device; - status = init_options (test_device); - if (status != SANE_STATUS_GOOD) - return status; + if (!test_device->options_initialized) { + status = init_options (test_device); + if (status != SANE_STATUS_GOOD) + return status; + test_device->options_initialized = SANE_TRUE; + } test_device->open = SANE_TRUE; test_device->scanning = SANE_FALSE; diff --git a/backend/test.h b/backend/test.h index 5b1b82b..3e7a6aa 100644 --- a/backend/test.h +++ b/backend/test.h @@ -15,9 +15,7 @@ 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. + along with this program. If not, see . As a special exception, the authors of SANE give permission for additional uses of the libraries contained in this release of SANE. @@ -143,6 +141,7 @@ typedef struct Test_Device SANE_Bool scanning; SANE_Bool cancelled; SANE_Bool eof; + SANE_Bool options_initialized; SANE_Int number_of_scans; } Test_Device; diff --git a/backend/u12-ccd.c b/backend/u12-ccd.c index fdbb54e..cfac256 100644 --- a/backend/u12-ccd.c +++ b/backend/u12-ccd.c @@ -1,5 +1,5 @@ /* @file u12-ccd.c - * @brief here we have the whole code to intialize the CCD and DAC stuff + * @brief here we have the whole code to initialize the CCD and DAC stuff * * based on sources acquired from Plustek Inc. * Copyright (c) 2003-2004 Gerhard Jaeger @@ -22,9 +22,7 @@ * 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. + * along with this program. If not, see . * * As a special exception, the authors of SANE give permission for * additional uses of the libraries contained in this release of SANE. diff --git a/backend/u12-hw.c b/backend/u12-hw.c index fb81ee6..c45ca2c 100644 --- a/backend/u12-hw.c +++ b/backend/u12-hw.c @@ -24,9 +24,7 @@ * 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. + * along with this program. If not, see . * * As a special exception, the authors of SANE give permission for * additional uses of the libraries contained in this release of SANE. diff --git a/backend/u12-hwdef.h b/backend/u12-hwdef.h index 43ea64f..4c07624 100644 --- a/backend/u12-hwdef.h +++ b/backend/u12-hwdef.h @@ -21,9 +21,7 @@ * 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. + * along with this program. If not, see . * * As a special exception, the authors of SANE give permission for * additional uses of the libraries contained in this release of SANE. diff --git a/backend/u12-if.c b/backend/u12-if.c index 91a8c1f..1a53cc6 100644 --- a/backend/u12-if.c +++ b/backend/u12-if.c @@ -24,9 +24,7 @@ * 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. + * along with this program. If not, see . * * As a special exception, the authors of SANE give permission for * additional uses of the libraries contained in this release of SANE. @@ -185,10 +183,10 @@ static void u12if_shutdown( U12_Device *dev ) DBG( _DBG_INFO, "Shutdown done.\n" ); } -/** This function checks wether a device, described by a given +/** This function checks whether a device, described by a given * string(vendor and product ID), is supported by this backend or not * - * @param usbIdStr - sting consisting out of product and vendor ID + * @param usbIdStr - string consisting out of product and vendor ID * format: "0xVVVV-0xPPPP" VVVV = Vendor ID, PPP = Product ID * @returns; SANE_TRUE if supported, SANE_FALSE if not */ diff --git a/backend/u12-image.c b/backend/u12-image.c index df721db..d8dc46f 100644 --- a/backend/u12-image.c +++ b/backend/u12-image.c @@ -24,9 +24,7 @@ * 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. + * along with this program. If not, see . * * As a special exception, the authors of SANE give permission for * additional uses of the libraries contained in this release of SANE. @@ -589,7 +587,7 @@ static SANE_Status u12image_SetupScanSettings( U12_Device *dev, ImgDef *img ) } } - /* now assign the buffer pointers for image aquisition + /* now assign the buffer pointers for image acquisition */ dev->scan.p48BitBuf.pb = NULL; diff --git a/backend/u12-io.c b/backend/u12-io.c index 3c5bcb8..b0ece9c 100644 --- a/backend/u12-io.c +++ b/backend/u12-io.c @@ -24,9 +24,7 @@ * 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. + * along with this program. If not, see . * * As a special exception, the authors of SANE give permission for * additional uses of the libraries contained in this release of SANE. @@ -402,7 +400,7 @@ static SANE_Byte u12io_DataFromRegister( U12_Device *dev, SANE_Byte reg ) static void u12io_CloseScanPath( U12_Device *dev ) { DBG( _DBG_INFO, "u12io_CloseScanPath()\n" ); -/* FIXME: Probaly not needed */ +/* FIXME: Probably not needed */ #if 0 u12io_RegisterToScanner( dev, 0xff ); #endif diff --git a/backend/u12-map.c b/backend/u12-map.c index 7d2f84a..9b0aa2f 100644 --- a/backend/u12-map.c +++ b/backend/u12-map.c @@ -22,9 +22,7 @@ * 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. + * along with this program. If not, see . * * As a special exception, the authors of SANE give permission for * additional uses of the libraries contained in this release of SANE. @@ -108,7 +106,7 @@ static void u12map_CheckGammaSettings( U12_Device *dev ) } } -/** adjust acording to brightness and contrast +/** adjust according to brightness and contrast */ static void u12map_Adjust( U12_Device *dev, int which, SANE_Byte *buf ) { diff --git a/backend/u12-motor.c b/backend/u12-motor.c index 5f28236..f3d2205 100644 --- a/backend/u12-motor.c +++ b/backend/u12-motor.c @@ -22,9 +22,7 @@ * 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. + * along with this program. If not, see . * * As a special exception, the authors of SANE give permission for * additional uses of the libraries contained in this release of SANE. @@ -49,7 +47,7 @@ *
*/ -/*************************** some definitons *********************************/ +/*************************** some definitions *********************************/ #define _BACKSTEPS 120 #define _FORWARDSTEPS 120 diff --git a/backend/u12-scanner.h b/backend/u12-scanner.h index c2e9cc8..1f81fa0 100644 --- a/backend/u12-scanner.h +++ b/backend/u12-scanner.h @@ -21,9 +21,7 @@ * 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. + * along with this program. If not, see . * * As a special exception, the authors of SANE give permission for * additional uses of the libraries contained in this release of SANE. diff --git a/backend/u12-shading.c b/backend/u12-shading.c index 76cc690..61d555f 100644 --- a/backend/u12-shading.c +++ b/backend/u12-shading.c @@ -22,9 +22,7 @@ * 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. + * along with this program. If not, see . * * As a special exception, the authors of SANE give permission for * additional uses of the libraries contained in this release of SANE. diff --git a/backend/u12-tpa.c b/backend/u12-tpa.c index 5a8e164..39cf427 100644 --- a/backend/u12-tpa.c +++ b/backend/u12-tpa.c @@ -22,9 +22,7 @@ * 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. + * along with this program. If not, see . * * As a special exception, the authors of SANE give permission for * additional uses of the libraries contained in this release of SANE. diff --git a/backend/u12.c b/backend/u12.c index 57e1f63..7434552 100644 --- a/backend/u12.c +++ b/backend/u12.c @@ -2,7 +2,7 @@ * @brief SANE backend for USB scanner, based on Plusteks' ASIC P98003 and * the GeneSys Logic GL640 parallel-port to USB bridge. * - * Based on source aquired from Plustek
+ * Based on source acquired from Plustek
* Copyright (c) 2003-2004 Gerhard Jaeger
* * History: @@ -24,9 +24,7 @@ * 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. + * along with this program. If not, see . * * As a special exception, the authors of SANE give permission for * additional uses of the libraries contained in this release of SANE. @@ -731,7 +729,7 @@ static SANE_Bool decodeVal( char *src, char *opt, if( tmp ) { - /* on success, compare wiht the given one */ + /* on success, compare with the given one */ if( 0 == strcmp( tmp, opt )) { DBG( _DBG_SANE_INIT, "Decoding option >%s<\n", opt ); @@ -779,7 +777,7 @@ static SANE_Bool decodeVal( char *src, char *opt, return SANE_FALSE; } -/** function to retrive the device name of a given string +/** function to retrieve the device name of a given string * @param src - string that keeps the option name to check src for * @param dest - pointer to the string, that should receive the detected * devicename @@ -840,7 +838,7 @@ static SANE_Status attach( const char *dev_name, if( NULL == dev ) return SANE_STATUS_NO_MEM; - /* assign all the stuff we need fo this device... */ + /* assign all the stuff we need for this device... */ memset(dev, 0, sizeof (*dev)); dev->fd = -1; @@ -916,7 +914,7 @@ static void init_config_struct( pCnfDef cnf ) cnf->adj.bgamma = 1.0; } -/** intialize the backend +/** initialize the backend */ SANE_Status sane_init( SANE_Int *version_code, SANE_Auth_Callback authorize ) { diff --git a/backend/u12.h b/backend/u12.h index 41b19b9..a7faeff 100644 --- a/backend/u12.h +++ b/backend/u12.h @@ -21,9 +21,7 @@ * 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. + * along with this program. If not, see . * * As a special exception, the authors of SANE give permission for * additional uses of the libraries contained in this release of SANE. diff --git a/backend/umax-scanner.c b/backend/umax-scanner.c index 03bca0e..0ccf6bc 100644 --- a/backend/umax-scanner.c +++ b/backend/umax-scanner.c @@ -15,9 +15,7 @@ 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. + along with this program. If not, see . As a special exception, the authors of SANE give permission for additional uses of the libraries contained in this release of SANE. diff --git a/backend/umax-scanner.h b/backend/umax-scanner.h index da10b7b..dd76562 100644 --- a/backend/umax-scanner.h +++ b/backend/umax-scanner.h @@ -15,9 +15,7 @@ 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. + along with this program. If not, see . As a special exception, the authors of SANE give permission for additional uses of the libraries contained in this release of SANE. diff --git a/backend/umax-scsidef.h b/backend/umax-scsidef.h index ddb04bb..476bac5 100644 --- a/backend/umax-scsidef.h +++ b/backend/umax-scsidef.h @@ -16,9 +16,7 @@ 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. + along with this program. If not, see . As a special exception, the authors of SANE give permission for additional uses of the libraries contained in this release of SANE. @@ -699,7 +697,7 @@ static unsigned char window_descriptor_blockC[] = /* 0x48 */ 0x00, 0x00, 0x00, 0x00, /* Line Count */ #define set_WD_line_count(sb, val) putnbyte(sb + 0x48, val, 4) -/* 0x4c */ 4, 176, /* x coordiante base 1200 (pts/inch) */ +/* 0x4c */ 4, 176, /* x coordinate base 1200 (pts/inch) */ #define set_WD_x_coordinate_base(sb, val) putnbyte(sb + 0x4c, val, 2) /* 0x4e */ 4, 176, /* y coordinate base 1200 (pts/inch) */ diff --git a/backend/umax-uc1200s.c b/backend/umax-uc1200s.c index 5569a2b..87d3904 100644 --- a/backend/umax-uc1200s.c +++ b/backend/umax-uc1200s.c @@ -16,9 +16,7 @@ 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. + along with this program. If not, see . As a special exception, the authors of SANE give permission for additional uses of the libraries contained in this release of SANE. diff --git a/backend/umax-uc1200se.c b/backend/umax-uc1200se.c index f1e8e31..9b660f4 100644 --- a/backend/umax-uc1200se.c +++ b/backend/umax-uc1200se.c @@ -16,9 +16,7 @@ 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. + along with this program. If not, see . As a special exception, the authors of SANE give permission for additional uses of the libraries contained in this release of SANE. diff --git a/backend/umax-uc1260.c b/backend/umax-uc1260.c index 4de9170..ec7925c 100644 --- a/backend/umax-uc1260.c +++ b/backend/umax-uc1260.c @@ -15,9 +15,7 @@ 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. + along with this program. If not, see . As a special exception, the authors of SANE give permission for additional uses of the libraries contained in this release of SANE. diff --git a/backend/umax-uc630.c b/backend/umax-uc630.c index 440064c..dc0665f 100644 --- a/backend/umax-uc630.c +++ b/backend/umax-uc630.c @@ -15,9 +15,7 @@ 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. + along with this program. If not, see . As a special exception, the authors of SANE give permission for additional uses of the libraries contained in this release of SANE. diff --git a/backend/umax-uc840.c b/backend/umax-uc840.c index 0592c95..d07e15b 100644 --- a/backend/umax-uc840.c +++ b/backend/umax-uc840.c @@ -15,9 +15,7 @@ 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. + along with this program. If not, see . As a special exception, the authors of SANE give permission for additional uses of the libraries contained in this release of SANE. diff --git a/backend/umax-ug630.c b/backend/umax-ug630.c index 3a339fc..45fa462 100644 --- a/backend/umax-ug630.c +++ b/backend/umax-ug630.c @@ -15,9 +15,7 @@ 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. + along with this program. If not, see . As a special exception, the authors of SANE give permission for additional uses of the libraries contained in this release of SANE. diff --git a/backend/umax-ug80.c b/backend/umax-ug80.c index 2e31d61..39fdba4 100644 --- a/backend/umax-ug80.c +++ b/backend/umax-ug80.c @@ -18,9 +18,7 @@ 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. + along with this program. If not, see . As a special exception, the authors of SANE give permission for additional uses of the libraries contained in this release of SANE. diff --git a/backend/umax-usb.c b/backend/umax-usb.c index 75f4739..05019c7 100644 --- a/backend/umax-usb.c +++ b/backend/umax-usb.c @@ -19,9 +19,7 @@ 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. + along with this program. If not, see . As a special exception, the authors of SANE give permission for additional uses of the libraries contained in this release of SANE. @@ -231,7 +229,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 - * scanner. So The queing is disabled. The performance does not seems + * scanner. So The queueing is disabled. The performance does not seems * to be bad anyway. */ @@ -275,7 +273,7 @@ sanei_umaxusb_open (const char *dev, int *fdp, SANE_Word vendor; SANE_Word product; - /* We have openned the device. Check that it is a USB scanner. */ + /* We have opened the device. Check that it is a USB scanner. */ if (sanei_usb_get_vendor_product (*fdp, &vendor, &product) != SANE_STATUS_GOOD) { /* This is not a USB scanner, or SANE or the OS doesn't support it. */ sanei_usb_close(*fdp); diff --git a/backend/umax.c b/backend/umax.c index 94f8aa4..9cefc08 100644 --- a/backend/umax.c +++ b/backend/umax.c @@ -19,9 +19,7 @@ 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. + along with this program. If not, see . As a special exception, the authors of SANE give permission for additional uses of the libraries contained in this release of SANE. @@ -64,11 +62,11 @@ . . - sane_get_option_descriptor() : get option information . . - sane_control_option() : change option values . . - . . - sane_start() : start image aquisition + . . - sane_start() : start image acquisition . . - sane_get_parameters() : returns actual scan-parameters . . - sane_read() : read image-data (from pipe) in ADF mode this is done often: - . . - sane_start() : start image aquisition + . . - sane_start() : start image acquisition . . - sane_get_parameters() : returns actual scan-parameters . . - sane_read() : read image-data (from pipe) @@ -1986,7 +1984,7 @@ static SANE_Status umax_queue_read_image_data_req(Umax_Device *dev, unsigned int set_R_datatype_code(sread.cmd, R_datatype_imagedata); /* set datatype */ dev->length_queued[bufnr] = length; /* set length request */ - dev->length_read[bufnr] = length; /* set length request, can be changed asyncronous by umax_scsi_req_enter */ + dev->length_read[bufnr] = length; /* set length request, can be changed asynchronous by umax_scsi_req_enter */ status = umax_scsi_req_enter(dev, sread.cmd, sread.size, dev->buffer[bufnr], &(dev->length_read[bufnr]), &(dev->queue_id[bufnr])); if (status) @@ -3219,7 +3217,7 @@ static int umax_identify_scanner(Umax_Device *dev) memcpy(dev->buffer[0]+0x24, inq_data.inquiry, inq_data.inquiry_len-0x24); /* correct variables */ - set_inquiry_sc_uta(dev->buffer[0], get_inquiry_transavail(dev->buffer[0])); /* transparancy available ? */ + set_inquiry_sc_uta(dev->buffer[0], get_inquiry_transavail(dev->buffer[0])); /* transparency 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); @@ -3934,7 +3932,7 @@ static int umax_check_values(Umax_Device *dev) { if ( (dev->colormode != RGB) || (dev->three_pass != 0) ) { - dev->do_color_ordering = 0; /* color ordering not necessery */ + dev->do_color_ordering = 0; /* color ordering not necessary */ } } @@ -7946,7 +7944,7 @@ SANE_Status sane_start(SANE_Handle handle) umax_set_window_param(scanner->device); status = umax_start_scan(scanner->device); - if (status) /* errror */ + if (status) /* error */ { umax_give_scanner(scanner->device); /* reposition and release scanner */ return status; @@ -7967,13 +7965,13 @@ SANE_Status sane_start(SANE_Handle handle) } status = umax_do_calibration(scanner->device); - if (status) /* errror */ + if (status) /* error */ { umax_give_scanner(scanner->device); /* reposition and release scanner */ return status; } - if (scanner->device->pause_after_calibration) /* may be usefull */ + if (scanner->device->pause_after_calibration) /* may be useful */ { DBG(DBG_info2,"pause after calibration %d msec ...\n", scanner->device->pause_after_calibration); usleep(((long) scanner->device->pause_after_calibration) * 1000); /* time in ms */ diff --git a/backend/umax.conf.in b/backend/umax.conf.in index 06b2750..d30d0a3 100644 --- a/backend/umax.conf.in +++ b/backend/umax.conf.in @@ -63,7 +63,7 @@ # 1 = enabled (same values for red, green and blue) #options exposure-time-rgb-bind 0 -# define if shading data shall be inverted befor sending it back to the scanner +# define if shading data shall be inverted before sending it back to the scanner # -1 = automatically set by driver - if known # 0 = disabled # 1 = enabled diff --git a/backend/umax.h b/backend/umax.h index e6b83fd..c3c1228 100644 --- a/backend/umax.h +++ b/backend/umax.h @@ -15,9 +15,7 @@ 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. + along with this program. If not, see . As a special exception, the authors of SANE give permission for additional uses of the libraries contained in this release of SANE. @@ -183,7 +181,7 @@ enum Umax_Option /* LIST OF AVAILABLE SCANNERS, THE VALUES LISTED HERE ARE THE SAME FOR DIFFERENT APPLICATIONS THAT USE THE SAME DEVICE */ -/* Umax_Device contains values relevant for the device that are not intersting for the sane interface */ +/* Umax_Device contains values relevant for the device that are not interesting for the sane interface */ typedef struct Umax_Device { @@ -354,21 +352,21 @@ typedef struct Umax_Device int use_exposure_time_def_b; /* exposure time default */ int wdb_len; /* use this length of WDB */ - unsigned int width_in_pixels; /* thats the wanted width in pixels */ - unsigned int length_in_pixels; /* thats the wanted length in pixels */ - unsigned int scanwidth; /* thats the width in pixels at x_coordinate_base dpi */ - unsigned int scanlength; /* thats the length in pixels at y_coordinate_base dpi */ + unsigned int width_in_pixels; /* that's the wanted width in pixels */ + unsigned int length_in_pixels; /* that's the wanted length in pixels */ + unsigned int scanwidth; /* that's the width in pixels at x_coordinate_base dpi */ + unsigned int scanlength; /* that's the length in pixels at y_coordinate_base dpi */ unsigned int bytes_per_color; /* bytes per each color */ unsigned int x_resolution; /* scan-resolution for x in dpi */ unsigned int y_resolution; /* scan-resolution for y in dpi */ double scale_x; /* x-scaling of optical resolution */ double scale_y; /* y-scaling of optical resolution */ - int upper_left_x; /* thats the left edge in points at 1200pt/inch */ - int upper_left_y; /* thats the top edge in points at 1200pt/inch */ + int upper_left_x; /* that's the left edge in points at 1200pt/inch */ + int upper_left_y; /* that's the top edge in points at 1200pt/inch */ - unsigned int x_coordinate_base; /* x base in pixels/inch, normaly 1200 */ - unsigned int y_coordinate_base; /* y base in pixels/inch, normaly 1200 */ + unsigned int x_coordinate_base; /* x base in pixels/inch, normally 1200 */ + unsigned int y_coordinate_base; /* y base in pixels/inch, normally 1200 */ unsigned int bits_per_pixel; /* number of bits per pixel */ int bits_per_pixel_code; /* 1 = 24bpp, 4 = 30 bpp, 8 = 36 bpp */ @@ -396,7 +394,7 @@ typedef struct Umax_Device int adf; /* 1 if ADF turned on */ int uta; /* 1 if UTA turned on */ int calibration; /* calibration :0=ignore, 1=driver, 2=by image */ - int low_byte_first; /* 10 bit mode: 0=high byte frist, 1=low byte frist */ + int low_byte_first; /* 10 bit mode: 0=high byte first, 1=low byte first */ int colormode; /* LINEART, HALFTONE, GRAYSCALE or RGB */ # define LINEART 1 # define HALFTONE 2 diff --git a/backend/umax1220u-common.c b/backend/umax1220u-common.c index e14dfea..dd70834 100644 --- a/backend/umax1220u-common.c +++ b/backend/umax1220u-common.c @@ -19,9 +19,7 @@ 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. + along with this program. If not, see . As a special exception, the authors of SANE give permission for additional uses of the libraries contained in this release of SANE. @@ -87,7 +85,7 @@ * physical limit to UMAX_MAX_WIDTH as well (based on the * sensor size) but I do not know what it is. The current * value can be increased beyond what it is now, but you - * gain nothing in usuable scan area (you only scan more + * gain nothing in usable scan area (you only scan more * of the underside of the scanner's plastic lid). */ @@ -98,7 +96,7 @@ /* Buffer size. Specifies the size of the buffer that is * used to copy data from the scanner. The old command * line driver had this set at 0x80000 which is likely - * the largest possible chunck of data that can be. + * the largest possible chunk of data that can be. * at once. This is probably most efficient, but using * a lower value for the SANE driver makes the driver * more responsive to interaction. @@ -369,7 +367,7 @@ xxxops (UMAX_Handle * scan) } /* -Apparently sends the two syncronization characters followed +Apparently sends the two synchronization characters followed by the command length, followed by the command number */ static SANE_Status @@ -412,7 +410,7 @@ usync (UMAX_Handle * scan, UMAX_Cmd cmd, int len) } /* -This function escapes any syncronization sequence that may be +This function escapes any synchronization sequence that may be in data, storing the result in buf. In the worst case where every character gets escaped buf must be at least twice as large as dlen. diff --git a/backend/umax1220u.c b/backend/umax1220u.c index 30c9e86..6e8d95f 100644 --- a/backend/umax1220u.c +++ b/backend/umax1220u.c @@ -18,9 +18,7 @@ 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. + along with this program. If not, see . As a special exception, the authors of SANE give permission for additional uses of the libraries contained in this release of SANE. diff --git a/backend/umax_pp.c b/backend/umax_pp.c index 16adbe3..4a4ab8a 100644 --- a/backend/umax_pp.c +++ b/backend/umax_pp.c @@ -13,9 +13,7 @@ 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. + along with this program. If not, see . As a special exception, the authors of SANE give permission for additional uses of the libraries contained in this release of SANE. @@ -419,7 +417,8 @@ umax_pp_auto_attach (SANEI_Config * config, SANE_Int safe) * device name to use for attach try. */ static SANE_Status -umax_pp_configure_attach (SANEI_Config * config, const char *devname) +umax_pp_configure_attach (SANEI_Config * config, const char *devname, + void __sane_unused__ *data) { const char *lp; SANE_Char *token; @@ -961,7 +960,7 @@ sane_init (SANE_Int * version_code, SANE_Auth_Callback authorize) /* generic configure and attach function */ status = sanei_configure_attach (UMAX_PP_CONFIG_FILE, &config, - umax_pp_configure_attach); + umax_pp_configure_attach, NULL); /* free option descriptors */ for (i = 0; i < NUM_CFG_OPTIONS; i++) @@ -2083,7 +2082,7 @@ sane_start (SANE_Handle handle) &(dev->th)); /* we enlarged the scanning zone */ /* to allow reordering, we must */ - /* substract it from real scanning */ + /* subtract it from real scanning */ /* zone */ dev->th -= points; DBG (64, "sane_start: bpp=%d,tw=%d,th=%d\n", dev->bpp, dev->tw, diff --git a/backend/umax_pp.h b/backend/umax_pp.h index c8ffdfa..ffff012 100644 --- a/backend/umax_pp.h +++ b/backend/umax_pp.h @@ -13,9 +13,7 @@ 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. + along with this program. If not, see . As a special exception, the authors of SANE give permission for additional uses of the libraries contained in this release of SANE. diff --git a/backend/umax_pp_low.c b/backend/umax_pp_low.c index 569f824..35cefa9 100644 --- a/backend/umax_pp_low.c +++ b/backend/umax_pp_low.c @@ -13,9 +13,7 @@ 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. + along with this program. If not, see . As a special exception, the authors of SANE give permission for additional uses of the libraries contained in this release of SANE. @@ -89,7 +87,7 @@ /*************************************************/ /* here we define sanei_inb/sanei_outb based on */ -/* OS dependant inb/outb definitions */ +/* OS dependent inb/outb definitions */ /* SANE_INB is defined whenever a valid inb/outb */ /* definition has been found */ /* once all these work, it might be moved to */ @@ -539,7 +537,7 @@ static void ECPFifoMode (void); /* block transfer init */ static void ECPSetBuffer (int size); -/* mode dependant operations */ +/* mode dependent operations */ static int PS2Something (int reg); static void PS2bufferRead (int size, unsigned char *dest); static void PS2bufferWrite (int size, unsigned char *source); @@ -739,12 +737,12 @@ static int gAutoSettings = 1; static void Outb (int port, int value); /*****************************************************************************/ -/* ouput 'size' bytes stored in 'source' on given port */ +/* output 'size' bytes stored in 'source' on given port */ /*****************************************************************************/ static void Outsb (int port, unsigned char *source, int size); /*****************************************************************************/ -/* ouput 'size' 32 bits words stored in 'source' on given port */ +/* output 'size' 32 bits words stored in 'source' on given port */ /*****************************************************************************/ static void Outsw (int port, unsigned char *source, int size); @@ -755,12 +753,12 @@ static void Outsw (int port, unsigned char *source, int size); static int Inb (int port); /*****************************************************************************/ -/* input 'size' bytes from given port ans store them in 'dest' */ +/* input 'size' bytes from given port and store them in 'dest' */ /*****************************************************************************/ static void Insb (int port, unsigned char *dest, int size); /*****************************************************************************/ -/* input 'size' 32 bits word from given port ans store them in 'dest' */ +/* input 'size' 32 bits word from given port and store them in 'dest' */ /*****************************************************************************/ static void Insw (int port, unsigned char *dest, int size); @@ -918,7 +916,7 @@ sanei_parport_find_device (void) /* - * gain direct acces to IO port, and set parport to the 'right' mode + * gain direct access to IO port, and set parport to the 'right' mode * returns 1 on success, 0 an failure */ @@ -1065,12 +1063,12 @@ sanei_umax_pp_initPort (int port, const char *name) #endif mode = 0; - /* prefered mode is EPP */ + /* preferred mode is EPP */ if (modes & PARPORT_MODE_EPP) { mode = IEEE1284_MODE_EPP; - /* negot allways fail here ... */ + /* negot always fail here ... */ rc = ioctl (fd, PPNEGOT, &mode); if (rc) { @@ -1129,7 +1127,7 @@ sanei_umax_pp_initPort (int port, const char *name) } - /* allways start in compat mode (for probe) */ + /* always start in compat mode (for probe) */ mode = IEEE1284_MODE_COMPAT; rc = ioctl (fd, PPSETMODE, &mode); if (rc) @@ -1694,7 +1692,7 @@ sanei_umax_pp_scannerStatus (void) gTime = 0; } - /* 0x07 variant returns status with bit 0 or 1 allways set to 1 */ + /* 0x07 variant returns status with bit 0 or 1 always set to 1 */ /* so we mask it out */ return scannerStatus & 0xFC; } @@ -5254,7 +5252,7 @@ testVersion (int no) status = ((status << 1) & 0x70) | (status & 0x80); if (status != count) { - /* since failure is expected, we dont't alaways print */ + /* since failure is expected, we don't alaways print */ /* this message ... */ DBG (2, "status %d doesn't match count 0x%X! %s:%d\n", status, count, __FILE__, __LINE__); @@ -6655,7 +6653,7 @@ probe610p (int recover) DBG (0, "initScanner610p() failed (%s:%d)\n", __FILE__, __LINE__); return 0; } - /* successfull end ... */ + /* successful end ... */ DBG (1, "UMAX Astra 610p detected\n"); DBG (1, "probe610p done ...\n"); return 1; @@ -7759,7 +7757,7 @@ sanei_umax_pp_probeScanner (int recover) reg = registerRead (0x19) & 0xC8; /* if reg=E8 or D8 , we have a 'messed' scanner */ - /* 4 tranform buffers + 'void' are sent: 1 B&W, and 3 RGB ? */ + /* 4 transform buffers + 'void' are sent: 1 B&W, and 3 RGB ? */ memset (initbuf, 0x00, 2048 * sizeof (int)); memset (voidbuf, 0x00, 2048 * sizeof (int)); @@ -7795,7 +7793,7 @@ sanei_umax_pp_probeScanner (int recover) __LINE__); /* everything above the FF 55 AA tag is 'void' */ - /* it seems that the buffer is reused and only the beginning is initalized */ + /* it seems that the buffer is reused and only the beginning is initialized */ for (i = 515; i < 2048; i++) initbuf[i] = voidbuf[i]; @@ -7838,7 +7836,7 @@ sanei_umax_pp_probeScanner (int recover) REGISTERWRITE (0x0A, 0x18); /* end */ /* read them back */ - REGISTERWRITE (0x0A, 0x11); /*start transfert */ + REGISTERWRITE (0x0A, 0x11); /*start transfer */ if (gMode == UMAX_PP_PARPORT_ECP) { ECPSetBuffer (0x400); @@ -9592,7 +9590,7 @@ bloc2Decode (int *op) for (i = 0; i < 16; i++) sprintf (str + 3 * i, "%02X ", (unsigned char) op[i]); str[48] = 0x00; - DBG (0, "Command bloc 2: %s\n", str); + DBG (0, "Command block 2: %s\n", str); scanh = op[0] + (op[1] & 0x3F) * 256; @@ -9671,7 +9669,7 @@ bloc8Decode (int *op) for (i = 0; i < len; i++) sprintf (str + 3 * i, "%02X ", (unsigned char) op[i]); str[3 * i] = 0x00; - DBG (0, "Command bloc 8: %s\n", str); + DBG (0, "Command block 8: %s\n", str); xskip = op[17] + 256 * (op[18] & 0x0F); if (op[33] & 0x40) @@ -10606,7 +10604,7 @@ sanei_umax_pp_scan (int x, int y, int width, int height, int dpi, int color, /* colors don't come in sync, so we must increase y */ - /* to have extra lines to reorder datas */ + /* to have extra lines to reorder data */ if (sanei_umax_pp_getastra () > 610) { switch (dpi) @@ -10870,7 +10868,7 @@ sanei_umax_pp_scan (int x, int y, int width, int height, int dpi, int color, elapsed, (somme / elapsed) / 1024.0); #endif - /* release ressources */ + /* release resources */ if (fout != NULL) fclose (fout); free (dest); @@ -11139,7 +11137,7 @@ sanei_umax_pp_startScan (int x, int y, int width, int height, int dpi, vgaBlue = gain & 0x00F; } - /* ccd calibration is allways done */ + /* ccd calibration is always done */ /* with final dc and vga */ if (shadingCalibration (color, dcRed, dcGreen, dcBlue, vgaRed, vgaGreen, vgaBlue, @@ -11481,7 +11479,7 @@ sanei_umax_pp_startScan (int x, int y, int width, int height, int dpi, { /* 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 + * pixel of scan (at 300 dpi), we already shift to the left * when doing shadingCalibration, but now we have to move coeffs * to match x coordinate */ delta = x - sanei_umax_pp_getLeft (); @@ -11916,7 +11914,7 @@ offsetCalibration1220p (int color, int *offRed, int *offGreen, int *offBlue) DBG (16, "entering offsetCalibration1220p() ... (%s:%d)\n", __FILE__, __LINE__); - /* really dirty hack: somethig is buggy in BW mode */ + /* really dirty hack: something is buggy in BW mode */ /* we override mode with color until the bug is found */ /* color = RGB_MODE; */ @@ -12134,7 +12132,7 @@ offsetCalibration610p (int color, int *offRed, int *offGreen, int *offBlue) /* first color channel: used both in color and b&w modes */ /* offset to the max */ - /* supposed to be green componant */ + /* supposed to be green component */ offset = 0x10; do { @@ -12583,7 +12581,7 @@ coarseGainCalibration1220p (int color, int dcRed, int dcGreen, DBG (16, "entering coarseGainCalibration1220p() ... (%s:%d) \n", __FILE__, __LINE__); - /* temporay workaround */ + /* temporary workaround */ color = RGB_MODE; /* initialize VGA components */ @@ -12893,7 +12891,7 @@ shadingCalibration610p (int color, int dcRed, int dcGreen, int dcBlue, COMPLETIONWAIT; /* picture height is scan area height minus y */ - /* then we substract 14 or 6 lines that aren't scanned */ + /* then we subtract 14 or 6 lines that aren't scanned */ if (color < RGB_MODE) h = h - y - 14; else @@ -12904,7 +12902,7 @@ shadingCalibration610p (int color, int dcRed, int dcGreen, int dcBlue, "shadingCalibration610p: trying to read 0x%06X bytes ... (%s:%d)\n", size, __FILE__, __LINE__); /* since we know that each scan line matches CCD width, we signals - * that data reading doens't need to sync on each byte, but at each + * that data reading doesn't need to sync on each byte, but at each * row end */ sanei_umax_pp_setfull (1); @@ -12995,7 +12993,7 @@ shadingCalibration610p (int color, int dcRed, int dcGreen, int dcBlue, /* * build CCD correction: a white area below the top is scanned without - * correction, and the data are used to compute the coefficents needed + * correction, and the data are used to compute the coefficients needed * to correct the light/CCD variations */ static int diff --git a/backend/umax_pp_low.h b/backend/umax_pp_low.h index 253ef6a..53aca3f 100644 --- a/backend/umax_pp_low.h +++ b/backend/umax_pp_low.h @@ -13,9 +13,7 @@ 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. + along with this program. If not, see . As a special exception, the authors of SANE give permission for additional uses of the libraries contained in this release of SANE. diff --git a/backend/umax_pp_mid.c b/backend/umax_pp_mid.c index 4b16745..ef608ac 100644 --- a/backend/umax_pp_mid.c +++ b/backend/umax_pp_mid.c @@ -13,9 +13,7 @@ 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. + along with this program. If not, see . As a special exception, the authors of SANE give permission for additional uses of the libraries contained in this release of SANE. diff --git a/backend/umax_pp_mid.h b/backend/umax_pp_mid.h index 97d1366..8a8a871 100644 --- a/backend/umax_pp_mid.h +++ b/backend/umax_pp_mid.h @@ -13,9 +13,7 @@ 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. + along with this program. If not, see . As a special exception, the authors of SANE give permission for additional uses of the libraries contained in this release of SANE. @@ -104,7 +102,7 @@ extern int sanei_umax_pp_lamp (int on); initialize transport layer initialize scanner - on succes returns UMAX1220P_OK, + on success returns UMAX1220P_OK, else one of the error above. port: addr when doing direc I/O @@ -117,7 +115,7 @@ extern int sanei_umax_pp_open (int port, char *name); /* - release any ressource acquired during open + release any resource acquired during open since there may be only one scanner, no port parameter */ extern int sanei_umax_pp_close (void); diff --git a/backend/v4l.c b/backend/v4l.c index f9245d0..b15e5d1 100644 --- a/backend/v4l.c +++ b/backend/v4l.c @@ -15,9 +15,7 @@ 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. + along with this program. If not, see . As a special exception, the authors of SANE give permission for additional uses of the libraries contained in this release of SANE. @@ -731,7 +729,7 @@ sane_control_option (SANE_Handle handle, SANE_Int option, action == SANE_ACTION_GET_VALUE ? "get" : action == SANE_ACTION_SET_VALUE ? "set" : action == SANE_ACTION_SET_AUTO ? "auto set" : - "(unknow action with)", option, + "(unknown action with)", option, s->opt[option].name ? s->opt[option].name : s->opt[option].title); cap = s->opt[option].cap; diff --git a/backend/v4l.conf.in b/backend/v4l.conf.in index bb55f1f..e9c15e8 100644 --- a/backend/v4l.conf.in +++ b/backend/v4l.conf.in @@ -1,7 +1,7 @@ # # In order to use the v4linux backend you have to give the device # You can enable multiple lines if -# you really have multible v4l devices. +# you really have multiple v4l devices. # /dev/bttv0 /dev/video0 diff --git a/backend/xerox_mfp.c b/backend/xerox_mfp.c index f5fd70e..edd6e64 100644 --- a/backend/xerox_mfp.c +++ b/backend/xerox_mfp.c @@ -518,7 +518,7 @@ static void reset_options(struct device *dev) dev->val[OPT_RESOLUTION].w = 150; dev->val[OPT_MODE].s = string_match(scan_modes, SANE_VALUE_SCAN_MODE_COLOR); - /* if docs loaded in adf use it as default source, flatbed oterwise */ + /* if docs loaded in adf use it as default source, flatbed otherwise */ dev->val[OPT_SOURCE].s = UNCONST(doc_sources[(dev->doc_loaded)? 1 : 0]); dev->val[OPT_THRESHOLD].w = SANE_FIX(50); @@ -1028,7 +1028,8 @@ list_one_device(SANE_String_Const devname) /* SANE API ignores return code of this callback */ static SANE_Status -list_conf_devices(UNUSED(SANEI_Config *config), const char *devname) +list_conf_devices(SANEI_Config __sane_unused__ *config, const char *devname, + void __sane_unused__ *data) { return tr_from_devname(devname)->configure_device(devname, list_one_device); } @@ -1080,7 +1081,7 @@ sane_get_devices(const SANE_Device *** device_list, SANE_Bool local) config.count = 0; config.descriptors = NULL; config.values = NULL; - sanei_configure_attach(XEROX_CONFIG_FILE, &config, list_conf_devices); + sanei_configure_attach(XEROX_CONFIG_FILE, &config, list_conf_devices, NULL); for (dev_count = 0, dev = devices_head; dev; dev = dev->next) dev_count++; -- cgit v1.2.3