Newsgroups: comp.sources.unix From: kstailey@leidecker.gsfc.nasa.gov (Kenneth Stailey) Subject: v28i139: pint - PINT is not TWAIN (scanner interface toolset), Part01/07 Message-id: <1.783771355.23520@gw.home.vix.com> Sender: unix-sources-moderator@gw.home.vix.com Approved: vixie@gw.home.vix.com Submitted-By: kstailey@leidecker.gsfc.nasa.gov (Kenneth Stailey) Posting-Number: Volume 28, Issue 139 Archive-Name: pint/part01 PINT is a first stab at a scanner interface with enough flexibility to work with fairly divergent scanners (although currently only SCSI scanners are supported, they are disappointingly divergent). In additon PINT is portable across two pretty divergent versions of UNIX, AIX 3.2 and SunOS 4.1 #! /bin/sh # This is a shell archive. Remove anything before this line, then unpack # it by saving it into a file and typing "sh file". To overwrite existing # files, type "sh file -c". You can also feed this as standard input via # unshar, or by typing "sh 'pint/INSTALL' <<'END_OF_FILE' XIf you are using AIX 3.2.x then cd into ibm and read INSTALL. XIf you are using SunOS 4.1.x then cd into sun and read INSTALL. X XIf you have succeeded in getting PINT into your kernel cd into util Xand read INSTALL. END_OF_FILE if test 213 -ne `wc -c <'pint/INSTALL'`; then echo shar: \"'pint/INSTALL'\" unpacked with wrong size! fi # end of 'pint/INSTALL' fi if test ! -d 'pint/ibm' ; then echo shar: Creating directory \"'pint/ibm'\" mkdir 'pint/ibm' fi if test -f 'pint/ibm/ADF_notes' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'pint/ibm/ADF_notes'\" else echo shar: Extracting \"'pint/ibm/ADF_notes'\" \(625 characters\) sed "s/^X//" >'pint/ibm/ADF_notes' <<'END_OF_FILE' Xuse_adf command does: X Xscanopen() check & reserve scanner X Xscanioctl() PAPER_PUSH X X turn on ADF X unload ADF, ignore result X load ADF, turn off ADF and return EIO if load fails or X set ADF flag to "ADF is armed" X X Xscanclose() release scanner X X------------------------------------------------------------------ X Xdd read command does: X Xscanopen() check & reserve scanner X Xscanread() X first call X transmit parameters X init scanner X if "ADF is armed" change ADF flag to "unload on close" X X first and subsequent calls X transfer data X Xscanclose() X if ADF flag is X release scanner X unload ADF if ADF flag says "unload on close" END_OF_FILE if test 625 -ne `wc -c <'pint/ibm/ADF_notes'`; then echo shar: \"'pint/ibm/ADF_notes'\" unpacked with wrong size! fi # end of 'pint/ibm/ADF_notes' fi if test -f 'pint/ibm/Problems' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'pint/ibm/Problems'\" else echo shar: Extracting \"'pint/ibm/Problems'\" \(3050 characters\) sed "s/^X//" >'pint/ibm/Problems' <<'END_OF_FILE' XHardware: X XRicoh FS1: X X1) Doesn't handle inquiries in SYNC mode: /etc/methods/cfghscsi hangs X trying to configure it. Boot with scanner off. X X2) There is a color convergence problem, maybe our unit needs to be serviced. X X3) You can't ask for less than one row of data. It's sort of like a tape X drive having a block size limitation. In fact I return the same error X that a tape driver does: "Invalid argument". X X XSharp JX600: X X1) Does not do disconnects and is so slow that reading more that ~5K X will cause disk drives on the same controller to time out. X X2) 1/25" is a poor choice for the measurement unit: can't specify X 1/2", 1/4", 1/8", 1/10", etc as sizes. X X3) The unaddressable boarders (top ~1/4", side ~1/8") are annoying. X X XRicoh IS50: X X1) doesn't support SYNC mode (doesn't even send a "message reject" X message which is terrible), but will autoconfigure if the host adapter X device driver has it's queue depth set to 1. X X2) Random noise on the SCSI bus that is caused by turning on the power X to the RS/6000 cause the IS50 to crash. Only a sending a BDR X (bus device reset) or cycling the scanner's power switch will bring X it around. X Consequently you must turn on the RS/6000 a few seconds (about 3) X before you power on the IS50. X X3) Ambiant light level disturbances such as opening the hood during, X scanner operation or the lamp access door falling open makes the X driver fail, and requires reseting the scanner. X XFujitsu M3096G: X X1) scanner driver only works with memory/compression board "option" X X2) Window size cannot exceed 4MB of data. This is entire flatbed in X monochrome, but not grayscale. X XRicoh IS410/IBM 2456: X X1) No known hardware problems. This scanner really impliments SCSI. X XHP ScanJet IIc X X1) Does not support standard SCSI scanner interface. Pretents to be a SCSI X "CPU device" and accepts escape code sequences via SCSI write command. X XUMAX UC630/UG630 X X1) Scanner is slow and does not do disconnects, watch out for disk drive driver X timeouts. X2) Nice color saturation for the UC630, but it takes some time to sweep over X the paper three times. X--------------------------------------------------------------------------- X XSoftware: X XIBM has not documented the "privcheck()" function used by their Xexample drivers to detemine whether the user has authority to perform Xthe "openx()" system call on the driver. X XHP Scanjet IIc driver: X X1) I'm not sure if the window size calculation works for all X combinations of sizes and resolutions. X XFS1 driver: X X1) The brightness control is not present, but there is something called X threshold that may allow brightness to be simulated. Currently the X driver acts like there is no hardware brightness control. X X2) The contrast control isn't standard and will take time to figure out. X Currently the driver acts like there is no hardware contrast control. X XSharp JX600 driver: X X1) Scanner is VERY slow and does not do disconnects. Must do I/O with X small buffers. X2) Only works with early (level "H" or lower???) EPROMS. END_OF_FILE if test 3050 -ne `wc -c <'pint/ibm/Problems'`; then echo shar: \"'pint/ibm/Problems'\" unpacked with wrong size! fi # end of 'pint/ibm/Problems' fi if test ! -d 'pint/ibm/dist' ; then echo shar: Creating directory \"'pint/ibm/dist'\" mkdir 'pint/ibm/dist' fi if test -f 'pint/ibm/dist/Files' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'pint/ibm/dist/Files'\" else echo shar: Extracting \"'pint/ibm/dist/Files'\" \(188 characters\) sed "s/^X//" >'pint/ibm/dist/Files' <<'END_OF_FILE' X./lpp_name X./usr/lpp/scanner/liblpp.a X./usr/lpp/msg/En_US/scanner.cat X./usr/include/sys/scanio.h X./etc/methods/cfgscan X./etc/methods/ucfgscan X./etc/drivers/scandd X./etc/drivers/scandd_pin END_OF_FILE if test 188 -ne `wc -c <'pint/ibm/dist/Files'`; then echo shar: \"'pint/ibm/dist/Files'\" unpacked with wrong size! fi # end of 'pint/ibm/dist/Files' fi if test ! -d 'pint/ibm/dist/etc' ; then echo shar: Creating directory \"'pint/ibm/dist/etc'\" mkdir 'pint/ibm/dist/etc' fi if test ! -d 'pint/ibm/dist/etc/drivers' ; then echo shar: Creating directory \"'pint/ibm/dist/etc/drivers'\" mkdir 'pint/ibm/dist/etc/drivers' fi if test -f 'pint/ibm/dist/etc/drivers/scandd' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'pint/ibm/dist/etc/drivers/scandd'\" else echo shar: Extracting \"'pint/ibm/dist/etc/drivers/scandd'\" \(0 characters\) sed "s/^X//" >'pint/ibm/dist/etc/drivers/scandd' <<'END_OF_FILE' END_OF_FILE if test 0 -ne `wc -c <'pint/ibm/dist/etc/drivers/scandd'`; then echo shar: \"'pint/ibm/dist/etc/drivers/scandd'\" unpacked with wrong size! fi chmod +x 'pint/ibm/dist/etc/drivers/scandd' # end of 'pint/ibm/dist/etc/drivers/scandd' fi if test -f 'pint/ibm/dist/etc/drivers/scandd_pin' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'pint/ibm/dist/etc/drivers/scandd_pin'\" else echo shar: Extracting \"'pint/ibm/dist/etc/drivers/scandd_pin'\" \(0 characters\) sed "s/^X//" >'pint/ibm/dist/etc/drivers/scandd_pin' <<'END_OF_FILE' END_OF_FILE if test 0 -ne `wc -c <'pint/ibm/dist/etc/drivers/scandd_pin'`; then echo shar: \"'pint/ibm/dist/etc/drivers/scandd_pin'\" unpacked with wrong size! fi chmod +x 'pint/ibm/dist/etc/drivers/scandd_pin' # end of 'pint/ibm/dist/etc/drivers/scandd_pin' fi if test ! -d 'pint/ibm/dist/etc/methods' ; then echo shar: Creating directory \"'pint/ibm/dist/etc/methods'\" mkdir 'pint/ibm/dist/etc/methods' fi if test -f 'pint/ibm/dist/etc/methods/cfgscan' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'pint/ibm/dist/etc/methods/cfgscan'\" else echo shar: Extracting \"'pint/ibm/dist/etc/methods/cfgscan'\" \(0 characters\) sed "s/^X//" >'pint/ibm/dist/etc/methods/cfgscan' <<'END_OF_FILE' END_OF_FILE if test 0 -ne `wc -c <'pint/ibm/dist/etc/methods/cfgscan'`; then echo shar: \"'pint/ibm/dist/etc/methods/cfgscan'\" unpacked with wrong size! fi chmod +x 'pint/ibm/dist/etc/methods/cfgscan' # end of 'pint/ibm/dist/etc/methods/cfgscan' fi if test -f 'pint/ibm/dist/etc/methods/ucfgscan' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'pint/ibm/dist/etc/methods/ucfgscan'\" else echo shar: Extracting \"'pint/ibm/dist/etc/methods/ucfgscan'\" \(0 characters\) sed "s/^X//" >'pint/ibm/dist/etc/methods/ucfgscan' <<'END_OF_FILE' END_OF_FILE if test 0 -ne `wc -c <'pint/ibm/dist/etc/methods/ucfgscan'`; then echo shar: \"'pint/ibm/dist/etc/methods/ucfgscan'\" unpacked with wrong size! fi chmod +x 'pint/ibm/dist/etc/methods/ucfgscan' # end of 'pint/ibm/dist/etc/methods/ucfgscan' fi if test -f 'pint/ibm/dist/lpp_name' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'pint/ibm/dist/lpp_name'\" else echo shar: Extracting \"'pint/ibm/dist/lpp_name'\" \(77 characters\) sed "s/^X//" >'pint/ibm/dist/lpp_name' <<'END_OF_FILE' X1 R I { Xpint 01.01.0000.0000 01 N O En_US PINT SCSI Scanner Driver X} END_OF_FILE if test 77 -ne `wc -c <'pint/ibm/dist/lpp_name'`; then echo shar: \"'pint/ibm/dist/lpp_name'\" unpacked with wrong size! fi # end of 'pint/ibm/dist/lpp_name' fi if test -f 'pint/ibm/dist/make-bff' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'pint/ibm/dist/make-bff'\" else echo shar: Extracting \"'pint/ibm/dist/make-bff'\" \(1003 characters\) sed "s/^X//" >'pint/ibm/dist/make-bff' <<'END_OF_FILE' X#!/bin/ksh X# X# PINT Pint Is Not TWAIN - common scanner driver interface for UN*X X# Copyright (C) 1994 Kenneth Stailey ken@spacenet.com X# X# This program is free software; you can redistribute it and/or modify X# it under the terms of the GNU General Public License as published by X# the Free Software Foundation; either version 2 of the License, or X# (at your option) any later version. X# X# This program is distributed in the hope that it will be useful, X# but WITHOUT ANY WARRANTY; without even the implied warranty of X# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the X# GNU General Public License for more details. X# X# You should have received a copy of the GNU General Public License X# along with this program; if not, write to the Free Software X# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. X# X Xecho making sure we\'re up to date: X(cd usr/lpp/scanner; make) X Xecho "\nWriting out the scanner LPP to the bff file:" Xcat Files | backup -ivqf scanner.obj Xecho done. END_OF_FILE if test 1003 -ne `wc -c <'pint/ibm/dist/make-bff'`; then echo shar: \"'pint/ibm/dist/make-bff'\" unpacked with wrong size! fi chmod +x 'pint/ibm/dist/make-bff' # end of 'pint/ibm/dist/make-bff' fi if test -f 'pint/ibm/dist/make-scanner' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'pint/ibm/dist/make-scanner'\" else echo shar: Extracting \"'pint/ibm/dist/make-scanner'\" \(1571 characters\) sed "s/^X//" >'pint/ibm/dist/make-scanner' <<'END_OF_FILE' X#!/bin/ksh X# X# PINT Pint Is Not TWAIN - common scanner driver interface for UN*X X# Copyright (C) 1994 Kenneth Stailey ken@spacenet.com X# X# This program is free software; you can redistribute it and/or modify X# it under the terms of the GNU General Public License as published by X# the Free Software Foundation; either version 2 of the License, or X# (at your option) any later version. X# X# This program is distributed in the hope that it will be useful, X# but WITHOUT ANY WARRANTY; without even the implied warranty of X# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the X# GNU General Public License for more details. X# X# You should have received a copy of the GNU General Public License X# along with this program; if not, write to the Free Software X# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. X# X Xif [ `whoami` != root ] Xthen X echo you must use the root account to run this script. X echo try \"su -c make-scanner\" X exit Xfi X Xclear Xcat << //EOF X X -------------------------------------------------------------------- X You have invoked the SCSI scanner device driver LPP cutter. X -------------------------------------------------------------------- X X X//EOF X Xecho makeing sure we\'re up to date: X(cd usr/lpp/scanner; make) X Xecho "\nPlease insert a formatted floppy in the drive and press Enter. \c" Xread ans X Xecho "\nWriting out the scanner LPP to the floppy disk:" Xcat Files | backup -ivq Xecho "\nReading table of contents on floppy to check it:" Xrestore -T -q Xecho "\nYour LPP disk is complete if there were no errors reported." END_OF_FILE if test 1571 -ne `wc -c <'pint/ibm/dist/make-scanner'`; then echo shar: \"'pint/ibm/dist/make-scanner'\" unpacked with wrong size! fi chmod +x 'pint/ibm/dist/make-scanner' # end of 'pint/ibm/dist/make-scanner' fi if test ! -d 'pint/ibm/dist/usr' ; then echo shar: Creating directory \"'pint/ibm/dist/usr'\" mkdir 'pint/ibm/dist/usr' fi if test ! -d 'pint/ibm/dist/usr/include' ; then echo shar: Creating directory \"'pint/ibm/dist/usr/include'\" mkdir 'pint/ibm/dist/usr/include' fi if test ! -d 'pint/ibm/dist/usr/include/sys' ; then echo shar: Creating directory \"'pint/ibm/dist/usr/include/sys'\" mkdir 'pint/ibm/dist/usr/include/sys' fi if test -f 'pint/ibm/dist/usr/include/sys/scanio.h' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'pint/ibm/dist/usr/include/sys/scanio.h'\" else echo shar: Extracting \"'pint/ibm/dist/usr/include/sys/scanio.h'\" \(2817 characters\) sed "s/^X//" >'pint/ibm/dist/usr/include/sys/scanio.h' <<'END_OF_FILE' X/* X * scanio.h: ioctl header file for PINT scanner device driver X */ X X/* X * PINT Pint Is Not TWAIN - common scanner driver interface for UN*X X * Copyright (C) 1994 Kenneth Stailey ken@spacenet.com X * X * This program is free software; you can redistribute it and/or modify X * it under the terms of the GNU General Public License as published by X * the Free Software Foundation; either version 2 of the License, or X * (at your option) any later version. X * X * This program is distributed in the hope that it will be useful, X * but WITHOUT ANY WARRANTY; without even the implied warranty of X * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the X * GNU General Public License for more details. X * X * You should have received a copy of the GNU General Public License X * along with this program; if not, write to the Free Software X * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. X */ X X#ifndef _SYS_SCANIO X# define _SYS_SCANIO X Xstruct scan_io { X ulong scan_window_width; /* width in 1/1200ths of an inch */ X ulong scan_window_length; /* length in 1/1200ths of an inch */ X ushort scan_x_resolution; /* horizontal resolution in dots-per-inch */ X ushort scan_y_resolution; /* vertical resolution in dots-per-inch */ X ulong scan_x_origin; /* horizontal coordinate of upper left corner */ X ulong scan_y_origin; /* vertical coordinate of upper left corner */ X uchar scan_image_mode; /* type of image data sent by scanner */ X uchar scan_brightness; /* brightness control for those to can do it */ X uchar scan_contrast; /* contrast control for those to can do it */ X uchar scan_scanner_type; /* type of scanner (read only variable) */ X uchar scan_use_adf; /* whether to use Automatic Document Feeder */ X}; X Xstruct scan_pixel_sizes { X uint pix_width; X uint pix_height; X}; X X/* X * defines for different commands X */ X#define SCAN_PAPER_PUSH 33 /* unload the ADF then load it */ X#define SCAN_GET 45 X#define SCAN_SET 78 X#define SCAN_GET_PIXEL_SIZE 99 /* return the size in pixels of the X scanner's active area */ X X/* X * defines for scan_image_mode field (SIM stands for Scan Image Mode) X */ X#define SIM_BINARY_MONOCHROME 0 X#define SIM_DITHERED_MONOCHROME 1 X#define SIM_GRAYSCALE 2 X#define SIM_COLOR 5 X#define SIM_RED 103 X#define SIM_GREEN 104 X#define SIM_BLUE 105 X X/* X * defines for different types of scanners & odm names as comments X */ X X#define RICOH_IS410 1 /* ricoh_is410 */ X#define FUJITSU 2 /* fujitsu */ X#define FUJITSU_M3096G 2 /* fujitsu_m3096g */ X#define HP_SCANJET_IIC 3 /* hp_scanjet_IIc */ X#define RICOH_FS1 4 /* ricoh_fs1 */ X#define SHARP_JX600 5 /* sharp_jx600 */ X#define RICOH_IS50 6 /* ricoh_is50 */ X#define IBM_2456 7 /* ibm_2456 */ X#define UMAX_UC630 8 /* umax_uc630 */ X#define UMAX_UG630 9 /* umax_ug630 */ X X#endif /* _SYS_SCANIO */ END_OF_FILE if test 2817 -ne `wc -c <'pint/ibm/dist/usr/include/sys/scanio.h'`; then echo shar: \"'pint/ibm/dist/usr/include/sys/scanio.h'\" unpacked with wrong size! fi # end of 'pint/ibm/dist/usr/include/sys/scanio.h' fi if test ! -d 'pint/ibm/dist/usr/lpp' ; then echo shar: Creating directory \"'pint/ibm/dist/usr/lpp'\" mkdir 'pint/ibm/dist/usr/lpp' fi if test ! -d 'pint/ibm/dist/usr/lpp/msg' ; then echo shar: Creating directory \"'pint/ibm/dist/usr/lpp/msg'\" mkdir 'pint/ibm/dist/usr/lpp/msg' fi if test ! -d 'pint/ibm/dist/usr/lpp/msg/En_US' ; then echo shar: Creating directory \"'pint/ibm/dist/usr/lpp/msg/En_US'\" mkdir 'pint/ibm/dist/usr/lpp/msg/En_US' fi if test -f 'pint/ibm/dist/usr/lpp/msg/En_US/scanner.cat' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'pint/ibm/dist/usr/lpp/msg/En_US/scanner.cat'\" else echo shar: Extracting \"'pint/ibm/dist/usr/lpp/msg/En_US/scanner.cat'\" \(1047 characters\) sed "s/^X//" >'pint/ibm/dist/usr/lpp/msg/En_US/scanner.cat' <<'END_OF_FILE' END_OF_FILE if test 1047 -ne `wc -c <'pint/ibm/dist/usr/lpp/msg/En_US/scanner.cat'`; then echo shar: \"'pint/ibm/dist/usr/lpp/msg/En_US/scanner.cat'\" unpacked with wrong size! fi # end of 'pint/ibm/dist/usr/lpp/msg/En_US/scanner.cat' fi if test ! -d 'pint/ibm/dist/usr/lpp/scanner' ; then echo shar: Creating directory \"'pint/ibm/dist/usr/lpp/scanner'\" mkdir 'pint/ibm/dist/usr/lpp/scanner' fi if test -f 'pint/ibm/dist/usr/lpp/scanner/Makefile' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'pint/ibm/dist/usr/lpp/scanner/Makefile'\" else echo shar: Extracting \"'pint/ibm/dist/usr/lpp/scanner/Makefile'\" \(1410 characters\) sed "s/^X//" >'pint/ibm/dist/usr/lpp/scanner/Makefile' <<'END_OF_FILE' X# X# PINT Pint Is Not TWAIN - common scanner driver interface for UN*X X# Copyright (C) 1994 Kenneth Stailey ken@spacenet.com X# X# This program is free software; you can redistribute it and/or modify X# it under the terms of the GNU General Public License as published by X# the Free Software Foundation; either version 2 of the License, or X# (at your option) any later version. X# X# This program is distributed in the hope that it will be useful, X# but WITHOUT ANY WARRANTY; without even the implied warranty of X# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the X# GNU General Public License for more details. X# X# You should have received a copy of the GNU General Public License X# along with this program; if not, write to the Free Software X# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. X# XFILES = PdAt.scan.add \ X PdDv.scan.add \ X al \ X copyright \ X devlist.new \ X instal \ X inventory \ X lpp.cleanup \ X remove.new \ X scanner.inv.u \ X size \ X sm_cmd_hdr.add \ X sm_cmd_opt.add \ X sm_menu_opt.add \ X sm_name_hdr.add X XINVFILES = \ X ../../../etc/drivers/scandd \ X ../../../etc/drivers/scandd_pin \ X ../../../etc/methods/cfgscan \ X ../../../etc/methods/ucfgscan \ X ../../../usr/lpp/msg/En_US/scanner.cat \ X ../../../usr/include/sys/scanio.h X Xliblpp.a: $(FILES) X rm -f liblpp.a X ar rv liblpp.a $(FILES) X Xinventory: $(INVFILES) X mkinventory X Xscanner.inv.u: $(INVFILES) X mkinventory END_OF_FILE if test 1410 -ne `wc -c <'pint/ibm/dist/usr/lpp/scanner/Makefile'`; then echo shar: \"'pint/ibm/dist/usr/lpp/scanner/Makefile'\" unpacked with wrong size! fi # end of 'pint/ibm/dist/usr/lpp/scanner/Makefile' fi if test -f 'pint/ibm/dist/usr/lpp/scanner/al' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'pint/ibm/dist/usr/lpp/scanner/al'\" else echo shar: Extracting \"'pint/ibm/dist/usr/lpp/scanner/al'\" \(150 characters\) sed "s/^X//" >'pint/ibm/dist/usr/lpp/scanner/al' <<'END_OF_FILE' X./etc/drivers/scandd X./etc/drivers/scandd_pin X./etc/methods/cfgscan X./etc/methods/ucfgscan X./usr/lpp/msg/En_US/scanner.cat X./usr/include/sys/scanio.h END_OF_FILE if test 150 -ne `wc -c <'pint/ibm/dist/usr/lpp/scanner/al'`; then echo shar: \"'pint/ibm/dist/usr/lpp/scanner/al'\" unpacked with wrong size! fi # end of 'pint/ibm/dist/usr/lpp/scanner/al' fi if test -f 'pint/ibm/dist/usr/lpp/scanner/copyright' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'pint/ibm/dist/usr/lpp/scanner/copyright'\" else echo shar: Extracting \"'pint/ibm/dist/usr/lpp/scanner/copyright'\" \(29 characters\) sed "s/^X//" >'pint/ibm/dist/usr/lpp/scanner/copyright' <<'END_OF_FILE' X XSCSI Scanner Device Driver X END_OF_FILE if test 29 -ne `wc -c <'pint/ibm/dist/usr/lpp/scanner/copyright'`; then echo shar: \"'pint/ibm/dist/usr/lpp/scanner/copyright'\" unpacked with wrong size! fi # end of 'pint/ibm/dist/usr/lpp/scanner/copyright' fi if test -f 'pint/ibm/dist/usr/lpp/scanner/devlist.new' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'pint/ibm/dist/usr/lpp/scanner/devlist.new'\" else echo shar: Extracting \"'pint/ibm/dist/usr/lpp/scanner/devlist.new'\" \(99 characters\) sed "s/^X//" >'pint/ibm/dist/usr/lpp/scanner/devlist.new' <<'END_OF_FILE' Xfujitsu Xricoh_is410 Xricoh_fs1 Xricoh_is50 Xsharp_jx600 Xibm_2456 Xumax_uc630 Xumax_ug630 Xhp_scanjet_IIc END_OF_FILE if test 99 -ne `wc -c <'pint/ibm/dist/usr/lpp/scanner/devlist.new'`; then echo shar: \"'pint/ibm/dist/usr/lpp/scanner/devlist.new'\" unpacked with wrong size! fi # end of 'pint/ibm/dist/usr/lpp/scanner/devlist.new' fi if test -f 'pint/ibm/dist/usr/lpp/scanner/instal' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'pint/ibm/dist/usr/lpp/scanner/instal'\" else echo shar: Extracting \"'pint/ibm/dist/usr/lpp/scanner/instal'\" \(1184 characters\) sed "s/^X//" >'pint/ibm/dist/usr/lpp/scanner/instal' <<'END_OF_FILE' X#!/bin/ksh X X# subr to report error codes from commands. XCHECK() { X if [ $1 -ne 0 ] X then X echo $2 returned $1 X exit 1 X fi X} X XTARGET=$1 X X# pick up on $ODMDIR etc X. /etc/environment X XCWD=`pwd` X XPATH=/bin:/usr/bin:/etc:/usr/ucb:/usr/etc:. Xexport PATH X X# remove the old lpp Xif [ -x lpp.remove ] Xthen X lpp.remove Xelse X cp devlist.new lpp.devlist X remove.new Xfi X X/etc/inurest -d $TARGET -q ${CWD}/al scanner XCHECK $? "iurest -d $TARGET -q ${CWD}/al scanner" X X###### update the ODM ###### X Xfor i in `ls *.add` Xdo X odmadd $i X CHECK $? "odmadd $i" Xdone X X###### end of ODM update section ###### X X# link the En_US catalog to the C one Xif [ `uname -r` = 1 ] Xthen X ln -sf ../En_US/scanner.cat /usr/lpp/msg/C/scanner.cat Xelse X ln -sf /usr/lpp/msg/En_US/scanner.cat /usr/lib/methods/scanner.cat Xfi X X# install the latest LPP removal scripts Xmv remove.new lpp.remove Xmv devlist.new lpp.devlist X X# make AIX 3.2 LPP emulate AIX 3.1 Xif [ `uname -r` = 2 ] Xthen X rm -rf inst_convert X mkdir inst_convert X mv scanner.inv.u inst_convert X X rm -f `/bin/ls | grep -v 'copyright\$' | grep -v '^core\$' | X grep -v 'README' | grep -v '^lpp\.'` 2>/dev/null Xfi X Xrm -rf $SAVE X X# that's all folks Xexit 0 END_OF_FILE if test 1184 -ne `wc -c <'pint/ibm/dist/usr/lpp/scanner/instal'`; then echo shar: \"'pint/ibm/dist/usr/lpp/scanner/instal'\" unpacked with wrong size! fi chmod +x 'pint/ibm/dist/usr/lpp/scanner/instal' # end of 'pint/ibm/dist/usr/lpp/scanner/instal' fi if test -f 'pint/ibm/dist/usr/lpp/scanner/lpp.cleanup' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'pint/ibm/dist/usr/lpp/scanner/lpp.cleanup'\" else echo shar: Extracting \"'pint/ibm/dist/usr/lpp/scanner/lpp.cleanup'\" \(221 characters\) sed "s/^X//" >'pint/ibm/dist/usr/lpp/scanner/lpp.cleanup' <<'END_OF_FILE' X#!/bin/ksh X Xif [ -x /usr/lpp/scanner/lpp.remove ] Xthen X /usr/lpp/scanner/lpp.remove Xelse X mv /usr/lpp/scanner/devlist.new /usr/lpp/scanner/lpp.devlist X /usr/lpp/scanner/remove.new Xfi X Xcd / Xrm -rf /usr/lpp/scanner X Xexit 0 END_OF_FILE if test 221 -ne `wc -c <'pint/ibm/dist/usr/lpp/scanner/lpp.cleanup'`; then echo shar: \"'pint/ibm/dist/usr/lpp/scanner/lpp.cleanup'\" unpacked with wrong size! fi chmod +x 'pint/ibm/dist/usr/lpp/scanner/lpp.cleanup' # end of 'pint/ibm/dist/usr/lpp/scanner/lpp.cleanup' fi if test -f 'pint/ibm/dist/usr/lpp/scanner/remove.new' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'pint/ibm/dist/usr/lpp/scanner/remove.new'\" else echo shar: Extracting \"'pint/ibm/dist/usr/lpp/scanner/remove.new'\" \(2168 characters\) sed "s/^X//" >'pint/ibm/dist/usr/lpp/scanner/remove.new' <<'END_OF_FILE' X#!/bin/ksh X XPATH=/bin:/usr/bin:/etc:/usr/ucb:. Xexport PATH XCWD=`pwd` X X# first make sure we are running as root... Xid | grep -s '0(root)' >/dev/null Xif [ $? != 0 ] Xthen X echo you must be running as root in order to execute this program X exit 1 Xfi X X# purge Predefined Device and Attribute ODM entries X Xfor dev in `cat /usr/lpp/scanner/lpp.devlist` Xdo X for i in `lsdev -C -c scanner -s scsi -t $dev -F name` X do X rmdev -l $i -d >/dev/null 2>&1 X done X X odmdelete -o PdDv -q type=$dev >/dev/null 2>&1 X odmdelete -o PdAt -q uniquetype=scanner/scsi/$dev >/dev/null 2>&1 Xdone X X# purge smit ODM entries X Xodmdelete -o sm_cmd_hdr -q "id = lsdscan" >/dev/null 2>&1 Xodmdelete -o sm_cmd_hdr -q "id = lssscan" >/dev/null 2>&1 Xodmdelete -o sm_cmd_hdr -q "id = rmvscan_hdr" >/dev/null 2>&1 Xodmdelete -o sm_cmd_hdr -q "id = cfgscan_hdr" >/dev/null 2>&1 Xodmdelete -o sm_cmd_hdr -q "id like makscan_*_hdr" >/dev/null 2>&1 Xodmdelete -o sm_cmd_hdr -q "id like chgscan_*" >/dev/null 2>&1 X Xodmdelete -o sm_cmd_opt -q "id = scanner_ln_opt" >/dev/null 2>&1 Xodmdelete -o sm_cmd_opt -q "id = scanner_predef_opt" >/dev/null 2>&1 Xodmdelete -o sm_cmd_opt -q "id = makscan_parent_opt" >/dev/null 2>&1 Xodmdelete -o sm_cmd_opt -q "id = scan_add" >/dev/null 2>&1 Xodmdelete -o sm_cmd_opt -q "id = scan_chg" >/dev/null 2>&1 Xodmdelete -o sm_cmd_opt -q "id = scan_rmv" >/dev/null 2>&1 Xodmdelete -o sm_cmd_opt -q "id = scan_cfg" >/dev/null 2>&1 Xodmdelete -o sm_cmd_opt -q "id like *scan_common*" >/dev/null 2>&1 Xodmdelete -o sm_cmd_opt -q "id like scan_resolution*" >/dev/null 2>&1 X Xodmdelete -o sm_menu_opt -q "next_id = scanner" >/dev/null 2>&1 Xodmdelete -o sm_menu_opt -q "id = scanner" >/dev/null 2>&1 X Xodmdelete -o sm_name_hdr -q "id = chgscan" >/dev/null 2>&1 Xodmdelete -o sm_name_hdr -q "id = cfgscan" >/dev/null 2>&1 Xodmdelete -o sm_name_hdr -q "id = rmvscan" >/dev/null 2>&1 Xodmdelete -o sm_name_hdr -q "id like 'makscan*'" >/dev/null 2>&1 X Xrm -f /etc/drivers/scandd Xrm -f /etc/drivers/scandd_pin Xrm -f /etc/methods/cfgscan Xrm -f /etc/methods/ucfgscan Xrm -f /usr/lpp/msg/En_US/scanner.cat Xrm -f /usr/lpp/msg/C/scanner.cat Xrm -f /usr/lib/methods/scanner.cat Xrm -f /usr/include/sys/scanio.h X Xexit 0 END_OF_FILE if test 2168 -ne `wc -c <'pint/ibm/dist/usr/lpp/scanner/remove.new'`; then echo shar: \"'pint/ibm/dist/usr/lpp/scanner/remove.new'\" unpacked with wrong size! fi chmod +x 'pint/ibm/dist/usr/lpp/scanner/remove.new' # end of 'pint/ibm/dist/usr/lpp/scanner/remove.new' fi if test -f 'pint/ibm/dist/usr/lpp/scanner/size' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'pint/ibm/dist/usr/lpp/scanner/size'\" else echo shar: Extracting \"'pint/ibm/dist/usr/lpp/scanner/size'\" \(71 characters\) sed "s/^X//" >'pint/ibm/dist/usr/lpp/scanner/size' <<'END_OF_FILE' X/etc/objrepos 1 X/etc/methods 52 X/etc/drivers 48 X/usr/lpp/scanner 10000 END_OF_FILE if test 71 -ne `wc -c <'pint/ibm/dist/usr/lpp/scanner/size'`; then echo shar: \"'pint/ibm/dist/usr/lpp/scanner/size'\" unpacked with wrong size! fi # end of 'pint/ibm/dist/usr/lpp/scanner/size' fi if test -f 'pint/ibm/install-scandd' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'pint/ibm/install-scandd'\" else echo shar: Extracting \"'pint/ibm/install-scandd'\" \(494 characters\) sed "s/^X//" >'pint/ibm/install-scandd' <<'END_OF_FILE' X#! /bin/ksh X X# Not the real install script, just something to put the latest driver build X# into the appropriate place. X X# for the real install: X# try "make dist" to build the lpp heirarchy X# and "cd dist; make-scanner" to write it to a disk or "make-bff" to a file X Xchmod go=rx scandd scandd_pin Xsu -c cp scandd scandd_pin /etc/drivers X Xfor dev in `lsdev -C -c scanner -F name` Xdo X rmdev -l $dev Xdone X Xfor dev in `lsdev -C -c scanner -F name` Xdo X mkdev -l $dev X su -c chmod a=r /dev/$dev Xdone END_OF_FILE if test 494 -ne `wc -c <'pint/ibm/install-scandd'`; then echo shar: \"'pint/ibm/install-scandd'\" unpacked with wrong size! fi chmod +x 'pint/ibm/install-scandd' # end of 'pint/ibm/install-scandd' fi if test -f 'pint/ibm/scan_b.exp' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'pint/ibm/scan_b.exp'\" else echo shar: Extracting \"'pint/ibm/scan_b.exp'\" \(1003 characters\) sed "s/^X//" >'pint/ibm/scan_b.exp' <<'END_OF_FILE' X#!/etc/drivers/scandd_pin X X* X* PINT Pint Is Not TWAIN - common scanner driver interface for UN*X X* Copyright (C) 1994 Kenneth Stailey ken@spacenet.com X* X* This program is free software; you can redistribute it and/or modify X* it under the terms of the GNU General Public License as published by X* the Free Software Foundation; either version 2 of the License, or X* (at your option) any later version. X* X* This program is distributed in the hope that it will be useful, X* but WITHOUT ANY WARRANTY; without even the implied warranty of X* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the X* GNU General Public License for more details. X* X* You should have received a copy of the GNU General Public License X* along with this program; if not, write to the Free Software X* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. X* X X* bottom half exports for PINT X* first release, version 0.1 X Xscan_scsi_cmd Xscanwait Xscaniodone Xscanner_config_count Xscanner_list Xscanner_chain_lock END_OF_FILE if test 1003 -ne `wc -c <'pint/ibm/scan_b.exp'`; then echo shar: \"'pint/ibm/scan_b.exp'\" unpacked with wrong size! fi # end of 'pint/ibm/scan_b.exp' fi if test -f 'pint/ibm/scan_t.exp' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'pint/ibm/scan_t.exp'\" else echo shar: Extracting \"'pint/ibm/scan_t.exp'\" \(917 characters\) sed "s/^X//" >'pint/ibm/scan_t.exp' <<'END_OF_FILE' X#!/etc/drivers/scandd X X* X* PINT Pint Is Not TWAIN - common scanner driver interface for UN*X X* Copyright (C) 1994 Kenneth Stailey ken@spacenet.com X* X* This program is free software; you can redistribute it and/or modify X* it under the terms of the GNU General Public License as published by X* the Free Software Foundation; either version 2 of the License, or X* (at your option) any later version. X* X* This program is distributed in the hope that it will be useful, X* but WITHOUT ANY WARRANTY; without even the implied warranty of X* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the X* GNU General Public License for more details. X* X* You should have received a copy of the GNU General Public License X* along with this program; if not, write to the Free Software X* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. X* X X* there is nothing in this file except for the #! line and comments END_OF_FILE if test 917 -ne `wc -c <'pint/ibm/scan_t.exp'`; then echo shar: \"'pint/ibm/scan_t.exp'\" unpacked with wrong size! fi # end of 'pint/ibm/scan_t.exp' fi if test -f 'pint/ibm/scanio.h' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'pint/ibm/scanio.h'\" else echo shar: Extracting \"'pint/ibm/scanio.h'\" \(2811 characters\) sed "s/^X//" >'pint/ibm/scanio.h' <<'END_OF_FILE' X/* X * PINT Pint Is Not TWAIN - common scanner driver interface for UN*X X * Copyright (C) 1994 Kenneth Stailey ken@spacenet.com X * X * This program is free software; you can redistribute it and/or modify X * it under the terms of the GNU General Public License as published by X * the Free Software Foundation; either version 2 of the License, or X * (at your option) any later version. X * X * This program is distributed in the hope that it will be useful, X * but WITHOUT ANY WARRANTY; without even the implied warranty of X * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the X * GNU General Public License for more details. X * X * You should have received a copy of the GNU General Public License X * along with this program; if not, write to the Free Software X * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. X */ X X/* X * ioctl header file for PINT X * first release, version 0.1 X */ X X#ifndef _SYS_SCANIO X# define _SYS_SCANIO X Xstruct scan_io { X ulong scan_window_width; /* width in 1/1200ths of an inch */ X ulong scan_window_length; /* length in 1/1200ths of an inch */ X ushort scan_x_resolution; /* horizontal resolution in dots-per-inch */ X ushort scan_y_resolution; /* vertical resolution in dots-per-inch */ X ulong scan_x_origin; /* horizontal coord. of upper left corner */ X ulong scan_y_origin; /* vertical coordinate of upper left corner */ X uchar scan_image_mode; /* type of image data sent by scanner */ X uchar scan_brightness; /* brightness control for those to can do it */ X uchar scan_contrast; /* contrast control for those to can do it */ X uchar scan_scanner_type; /* type of scanner (read only variable) */ X uchar scan_unused1; X}; X Xstruct scan_pixel_sizes { X uint pix_width; X uint pix_height; X}; X X/* X * defines for different commands X */ X#define SCAN_USE_ADF 33 /* make next image come from ADF */ X /* or return EIO if it couldn't be done */ X#define SCAN_GET 45 X#define SCAN_SET 78 X#define SCAN_GET_PIXEL_SIZE 99 /* return the size in pixels of the X scanner's active area */ X X/* X * defines for scan_image_mode field (SIM stands for Scan Image Mode) X */ X#define SIM_BINARY_MONOCHROME 0 X#define SIM_DITHERED_MONOCHROME 1 X#define SIM_GRAYSCALE 2 X#define SIM_COLOR 5 X#define SIM_RED 103 X#define SIM_GREEN 104 X#define SIM_BLUE 105 X X X/* X * defines for different types of scanners & odm names as comments X */ X X#define RICOH_IS410 1 /* ricoh_is410 */ X#define FUJITSU 2 /* fujitsu */ X#define FUJITSU_M3096G 2 /* fujitsu_m3096g */ X#define HP_SCANJET_IIC 3 /* hp_scanjet_IIc */ X#define RICOH_FS1 4 /* ricoh_fs1 */ X#define SHARP_JX600 5 /* sharp_jx600 */ X#define RICOH_IS50 6 /* ricoh_is50 */ X#define IBM_2456 7 /* ibm_2456 */ X#define UMAX_UC630 8 /* umax_uc630 */ X#define UMAX_UG630 9 /* umax_ug630 */ X X#endif /* _SYS_SCANIO */ END_OF_FILE if test 2811 -ne `wc -c <'pint/ibm/scanio.h'`; then echo shar: \"'pint/ibm/scanio.h'\" unpacked with wrong size! fi # end of 'pint/ibm/scanio.h' fi if test -f 'pint/ibm/scanner.messages' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'pint/ibm/scanner.messages'\" else echo shar: Extracting \"'pint/ibm/scanner.messages'\" \(997 characters\) sed "s/^X//" >'pint/ibm/scanner.messages' <<'END_OF_FILE' X X$delset 1 X$set 1 X$quote " X X1 "scan area width in 1/1200ths of an inch" X2 "scan area length in 1/1200ths of an inch" X3 "horizontal resolution in dots-per-inch" X4 "vertical resolution in dots-per-inch" X5 "upper left corner x in 1/1200ths of an inch" X6 "upper left corner y in 1/1200ths of an inch" X7 "type of image data sent by scanner" X8 "image data brightness" X9 "image data contrast" X10 "use Automatic Document Feeder" X100 "Fujitsu M3096G scanner" X101 "Ricoh IS410 scanner" X102 "IBM 2456 Scanner" X103 "Ricoh FS1 scanner" X104 "Sharp JX600 scanner" X105 "Ricoh IS50 scanner" X106 "UMAX UC630 scanner" X107 "UMAX UG630 scanner" X108 "HP ScanJet IIc scanner" X X$delset 2 X$set 2 X$quote " X X1 "Scanner" X1001 "a graphics input device that reads images from pictures on paper" X X$delset 3 X$set 3 X$quote " X X1 "Scanner" X2 "Scanner type" X3 "Scanner interface" X4 "Description" X5 "Status" X6 "Location" X7 "Parent adapter" X8 "Connection address" X100 "Change/Show Characteristics of a Scanner" X101 "Add a Scanner" END_OF_FILE if test 997 -ne `wc -c <'pint/ibm/scanner.messages'`; then echo shar: \"'pint/ibm/scanner.messages'\" unpacked with wrong size! fi # end of 'pint/ibm/scanner.messages' fi if test -f 'pint/ibm/sm_menu_opt.add' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'pint/ibm/sm_menu_opt.add'\" else echo shar: Extracting \"'pint/ibm/sm_menu_opt.add'\" \(2533 characters\) sed "s/^X//" >'pint/ibm/sm_menu_opt.add' <<'END_OF_FILE' X* X* PINT Pint Is Not TWAIN - common scanner driver interface for UN*X X* Copyright (C) 1994 Kenneth Stailey ken@spacenet.com X* X* This program is free software; you can redistribute it and/or modify X* it under the terms of the GNU General Public License as published by X* the Free Software Foundation; either version 2 of the License, or X* (at your option) any later version. X* X* This program is distributed in the hope that it will be useful, X* but WITHOUT ANY WARRANTY; without even the implied warranty of X* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the X* GNU General Public License for more details. X* X* You should have received a copy of the GNU General Public License X* along with this program; if not, write to the Free Software X* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. X* X* smit menus for PINT X* first release, version 0.1 X Xsm_menu_opt: X id_seq_num = "105" X id = "dev" X next_id = "scanner" X text = "Scanner" X text_msg_file = "scanner.cat" X text_msg_set = 2 X text_msg_id = 1 X next_type = "m" X alias = "" X help_msg_id = "" X help_msg_loc = "" X Xsm_menu_opt: X id_seq_num = "010" X id = "scanner" X next_id = "lsdscan" X text = "List All Defined Scanners" X text_msg_file = "scanner.cat" X text_msg_set = 2 X text_msg_id = 2 X next_type = "d" X alias = "" X help_msg_id = "" X help_msg_loc = "" X Xsm_menu_opt: X id_seq_num = "020" X id = "scanner" X next_id = "lssscan" X text = "List All Supported Scanners" X text_msg_file = "scanner.cat" X text_msg_set = 2 X text_msg_id = 3 X next_type = "d" X alias = "" X help_msg_id = "" X help_msg_loc = "" X Xsm_menu_opt: X id_seq_num = "030" X id = "scanner" X next_id = "makscan" X text = "Add a Scanner" X text_msg_file = "scanner.cat" X text_msg_set = 2 X text_msg_id = 4 X next_type = "n" X alias = "" X help_msg_id = "" X help_msg_loc = "" X Xsm_menu_opt: X id_seq_num = "040" X id = "scanner" X next_id = "chgscan" X text = "Change / Show Characteristics of a Scanner" X text_msg_file = "scanner.cat" X text_msg_set = "2" X text_msg_id = "5" X next_type = "n" X alias = "" X help_msg_id = "" X help_msg_loc = "" X Xsm_menu_opt: X id_seq_num = "050" X id = "scanner" X next_id = "rmvscan" X text = "Remove a Scanner" X text_msg_file = "scanner.cat" X text_msg_set = 0 X text_msg_id = 0 X next_type = "n" X alias = "" X help_msg_id = "" X help_msg_loc = "" X Xsm_menu_opt: X id_seq_num = "060" X id = "scanner" X next_id = "cfgscan" X text = "Configure a Defined Scanner" X text_msg_file = "scanner.cat" X text_msg_set = 2 X text_msg_id = 7 X next_type = "n" X alias = "" X help_msg_id = "" X help_msg_loc = "" END_OF_FILE if test 2533 -ne `wc -c <'pint/ibm/sm_menu_opt.add'`; then echo shar: \"'pint/ibm/sm_menu_opt.add'\" unpacked with wrong size! fi # end of 'pint/ibm/sm_menu_opt.add' fi if test -f 'pint/ibm/window_size.c' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'pint/ibm/window_size.c'\" else echo shar: Extracting \"'pint/ibm/window_size.c'\" \(1376 characters\) sed "s/^X//" >'pint/ibm/window_size.c' <<'END_OF_FILE' X/* X * PINT Pint Is Not TWAIN - common scanner driver interface for UN*X X * Copyright (C) 1994 Kenneth Stailey ken@spacenet.com X * X * This program is free software; you can redistribute it and/or modify X * it under the terms of the GNU General Public License as published by X * the Free Software Foundation; either version 2 of the License, or X * (at your option) any later version. X * X * This program is distributed in the hope that it will be useful, X * but WITHOUT ANY WARRANTY; without even the implied warranty of X * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the X * GNU General Public License for more details. X * X * You should have received a copy of the GNU General Public License X * along with this program; if not, write to the Free Software X * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. X */ X X/* window size calculation for PINT X * first release, version 0.1 X */ X X/* This is in a separate file because it requires the "long long" data type X * (GNU C's 64-bit int) in order to prevent overflow or loss of precision. X */ X Xint window_size(int w, int xr, int l, int yr) X{ X unsigned long long wl, xrl, ll, yrl; X X wl = (unsigned long long)w; X xrl = (unsigned long long)xr; X ll = (unsigned long long)l; X yrl = (unsigned long long)yr; X X return (int)(wl * xrl * ll * yrl / (long long)(1440000)); X} X X/* 1200*1200 = 1440000 */ END_OF_FILE if test 1376 -ne `wc -c <'pint/ibm/window_size.c'`; then echo shar: \"'pint/ibm/window_size.c'\" unpacked with wrong size! fi # end of 'pint/ibm/window_size.c' fi if test ! -d 'pint/sun' ; then echo shar: Creating directory \"'pint/sun'\" mkdir 'pint/sun' fi if test -f 'pint/sun/INSTALL' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'pint/sun/INSTALL'\" else echo shar: Extracting \"'pint/sun/INSTALL'\" \(286 characters\) sed "s/^X//" >'pint/sun/INSTALL' <<'END_OF_FILE' X1) Type "make install" in the driver directory. This should build scan.o and X copy it to ../dist/+install. X X2) Build "confmod" (in dist dir.) and copy it to dist/+install X X3) Make a compressed "bar" archive of +install to a floppy. X X4) Run "extract_unbundled" to install the driver. END_OF_FILE if test 286 -ne `wc -c <'pint/sun/INSTALL'`; then echo shar: \"'pint/sun/INSTALL'\" unpacked with wrong size! fi # end of 'pint/sun/INSTALL' fi if test ! -d 'pint/sun/dist' ; then echo shar: Creating directory \"'pint/sun/dist'\" mkdir 'pint/sun/dist' fi if test ! -d 'pint/sun/dist/+install' ; then echo shar: Creating directory \"'pint/sun/dist/+install'\" mkdir 'pint/sun/dist/+install' fi if test ! -d 'pint/sun/dist/+install/OBJ' ; then echo shar: Creating directory \"'pint/sun/dist/+install/OBJ'\" mkdir 'pint/sun/dist/+install/OBJ' fi if test -f 'pint/sun/dist/+install/confmod' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'pint/sun/dist/+install/confmod'\" else echo shar: Extracting \"'pint/sun/dist/+install/confmod'\" \(0 characters\) sed "s/^X//" >'pint/sun/dist/+install/confmod' <<'END_OF_FILE' END_OF_FILE if test 0 -ne `wc -c <'pint/sun/dist/+install/confmod'`; then echo shar: \"'pint/sun/dist/+install/confmod'\" unpacked with wrong size! fi chmod +x 'pint/sun/dist/+install/confmod' # end of 'pint/sun/dist/+install/confmod' fi if test -f 'pint/sun/dist/+install/copyright.d' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'pint/sun/dist/+install/copyright.d'\" else echo shar: Extracting \"'pint/sun/dist/+install/copyright.d'\" \(35 characters\) sed "s/^X//" >'pint/sun/dist/+install/copyright.d' <<'END_OF_FILE' X X SCSI PINT Scanner Device Driver X END_OF_FILE if test 35 -ne `wc -c <'pint/sun/dist/+install/copyright.d'`; then echo shar: \"'pint/sun/dist/+install/copyright.d'\" unpacked with wrong size! fi # end of 'pint/sun/dist/+install/copyright.d' fi if test -f 'pint/sun/dist/+install/scanio.h' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'pint/sun/dist/+install/scanio.h'\" else echo shar: Extracting \"'pint/sun/dist/+install/scanio.h'\" \(0 characters\) sed "s/^X//" >'pint/sun/dist/+install/scanio.h' <<'END_OF_FILE' END_OF_FILE if test 0 -ne `wc -c <'pint/sun/dist/+install/scanio.h'`; then echo shar: \"'pint/sun/dist/+install/scanio.h'\" unpacked with wrong size! fi # end of 'pint/sun/dist/+install/scanio.h' fi if test ! -d 'pint/sun/driver' ; then echo shar: Creating directory \"'pint/sun/driver'\" mkdir 'pint/sun/driver' fi if test -f 'pint/sun/driver/Makefile' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'pint/sun/driver/Makefile'\" else echo shar: Extracting \"'pint/sun/driver/Makefile'\" \(80 characters\) sed "s/^X//" >'pint/sun/driver/Makefile' <<'END_OF_FILE' Xall: scan.o X Xinstall: all X cp scan.o ../dist/+install/OBJ X Xclean: X rm -f scan.o END_OF_FILE if test 80 -ne `wc -c <'pint/sun/driver/Makefile'`; then echo shar: \"'pint/sun/driver/Makefile'\" unpacked with wrong size! fi # end of 'pint/sun/driver/Makefile' fi if test -f 'pint/sun/driver/scan.h' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'pint/sun/driver/scan.h'\" else echo shar: Extracting \"'pint/sun/driver/scan.h'\" \(16 characters\) sed "s/^X//" >'pint/sun/driver/scan.h' <<'END_OF_FILE' X#define NSCAN 1 END_OF_FILE if test 16 -ne `wc -c <'pint/sun/driver/scan.h'`; then echo shar: \"'pint/sun/driver/scan.h'\" unpacked with wrong size! fi # end of 'pint/sun/driver/scan.h' fi if test -f 'pint/sun/driver/scanio.h' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'pint/sun/driver/scanio.h'\" else echo shar: Extracting \"'pint/sun/driver/scanio.h'\" \(3458 characters\) sed "s/^X//" >'pint/sun/driver/scanio.h' <<'END_OF_FILE' X/* X * PINT Pint Is Not TWAIN - common scanner driver interface for UN*X X * Copyright (C) 1994 Kenneth Stailey ken@spacenet.com X * X * This program is free software; you can redistribute it and/or modify X * it under the terms of the GNU General Public License as published by X * the Free Software Foundation; either version 2 of the License, or X * (at your option) any later version. X * X * This program is distributed in the hope that it will be useful, X * but WITHOUT ANY WARRANTY; without even the implied warranty of X * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the X * GNU General Public License for more details. X * X * You should have received a copy of the GNU General Public License X * along with this program; if not, write to the Free Software X * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. X */ X/* X * scanio.h: ioctl header file for PINT scanner driver for SunOS 4.1 X * first release version 0.1 X */ X#ifndef _SYS_SCANIO_H X#define _SYS_SCANIO_H X X#include "/usr/sys/scsi/scsi.h" X#include X Xtypedef unsigned long ulong; Xtypedef unsigned char uchar; X Xstruct scan_io { X ulong scan_window_width; /* width in 1/1200ths of an inch */ X ulong scan_window_length; /* length in 1/1200ths of an inch */ X ushort scan_x_resolution; /* horizontal resolution in dots-per-inch */ X ushort scan_y_resolution; /* vertical resolution in dots-per-inch */ X ulong scan_x_origin; /* horizontal coordinate of upper left corner */ X ulong scan_y_origin; /* vertical coordinate of upper left corner */ X uchar scan_image_mode; /* type of image data sent by scanner */ X uchar scan_brightness; /* brightness control for those to can do it */ X uchar scan_contrast; /* contrast control for those to can do it */ X uchar scan_scanner_type; /* type of scanner (read only variable) */ X}; X Xstruct scan_pixel_sizes { X uint pix_width; X uint pix_height; X}; X X/* X * struct for generic command, SCANIOC_CMD X */ Xstruct scancmd { X union scsi_cdb sc_cdb; /* Actual CDB for the command */ X caddr_t sc_bufaddr; /* user buffer address */ X u_int sc_buflen; /* user buffer length */ X int sc_timeout; /* cmd timeout (sec); 0=> use default */ X u_int sc_rw; /* DMA direction, B_READ or B_WRITE */ X}; X X/* X * defines for different commands X */ X /* make the ADF the paper source for the next read operation */ X#define SCAN_USE_ADF _IO(Z, 33) X /* retrieve parameters */ X#define SCAN_GET _IOR(Z, 45, struct scan_io) X /* assign parameters */ X#define SCAN_SET _IOW(Z, 78, struct scan_io) X /* return the size in pixels of the scanner's active area */ X#define SCAN_GET_PIXEL_SIZE _IOR(Z, 99, struct scan_pixel_sizes) X X#define SCANIOC_GETERRC _IOR(f, 2, struct scsi_extended_sense) X#define SCANIOC_CMD _IOW(f, 4, struct scancmd) X X/* X * defines for scan_image_mode field X */ X#define SIM_BINARY_MONOCHROME 0 X#define SIM_DITHERED_MONOCHROME 1 X#define SIM_GRAYSCALE 2 X#define SIM_COLOR 5 X#define SIM_RED 103 X#define SIM_GREEN 104 X#define SIM_BLUE 105 X X/* X * defines for different types of scanners & odm names as comments X */ X X#define RICOH_IS410 1 /* ricoh_is410 */ X#define FUJITSU 2 /* fujitsu M3096G */ X#define HP_SCANJET_IIC 3 /* hp_scanjet_IIc */ X#define RICOH_FS1 4 /* ricoh_fs1 */ X#define SHARP_JX600 5 /* sharp_jx600 */ X#define RICOH_IS50 6 /* ricoh_is50 */ X#define IBM_2456 7 /* ibm_2456 */ X#define UMAX_UC630 8 /* umax_uc630 */ X#define UMAX_UG630 9 /* umax_ug630 */ X X#endif /* _SYS_SCANIO_H */ END_OF_FILE if test 3458 -ne `wc -c <'pint/sun/driver/scanio.h'`; then echo shar: \"'pint/sun/driver/scanio.h'\" unpacked with wrong size! fi # end of 'pint/sun/driver/scanio.h' fi if test ! -d 'pint/sun/misc' ; then echo shar: Creating directory \"'pint/sun/misc'\" mkdir 'pint/sun/misc' fi if test ! -d 'pint/util' ; then echo shar: Creating directory \"'pint/util'\" mkdir 'pint/util' fi if test -f 'pint/util/INSTALL' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'pint/util/INSTALL'\" else echo shar: Extracting \"'pint/util/INSTALL'\" \(244 characters\) sed "s/^X//" >'pint/util/INSTALL' <<'END_OF_FILE' X1) Make sure that the pint driver is in your kernel, see ../INSTALL X X2) Make sure that /usr/include/sys/scanio.h is the one for your OS. X X3) Fiddle with Makefile if you want to. X X4) Type "make install". X X5) cd into scripts, type "make install" END_OF_FILE if test 244 -ne `wc -c <'pint/util/INSTALL'`; then echo shar: \"'pint/util/INSTALL'\" unpacked with wrong size! fi # end of 'pint/util/INSTALL' fi if test -f 'pint/util/Makefile' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'pint/util/Makefile'\" else echo shar: Extracting \"'pint/util/Makefile'\" \(272 characters\) sed "s/^X//" >'pint/util/Makefile' <<'END_OF_FILE' X#CFLAGS = -g XCFLAGS = -O X XPROGS = fs1toppm get_scanner reset_scanner set_scanner use_adf get_pixel_sizes X XBIN_DIR = /usr/local/bin XMAN_DIR = /usr/local/man/man1 X Xall: $(PROGS) X Xinstall: all X cp $(PROGS) $(BIN_DIR) X cp *.1 $(MAN_DIR) X Xclean: X rm -f $(PROGS) *.o core a.out END_OF_FILE if test 272 -ne `wc -c <'pint/util/Makefile'`; then echo shar: \"'pint/util/Makefile'\" unpacked with wrong size! fi # end of 'pint/util/Makefile' fi if test -f 'pint/util/fixup_fujitsu_grayscale.c' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'pint/util/fixup_fujitsu_grayscale.c'\" else echo shar: Extracting \"'pint/util/fixup_fujitsu_grayscale.c'\" \(1482 characters\) sed "s/^X//" >'pint/util/fixup_fujitsu_grayscale.c' <<'END_OF_FILE' X/* X * PINT Pint Is Not TWAIN - common scanner driver interface for UN*X X * Copyright (C) 1994 Kenneth Stailey ken@spacenet.com X * X * This program is free software; you can redistribute it and/or modify X * it under the terms of the GNU General Public License as published by X * the Free Software Foundation; either version 2 of the License, or X * (at your option) any later version. X * X * This program is distributed in the hope that it will be useful, X * but WITHOUT ANY WARRANTY; without even the implied warranty of X * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the X * GNU General Public License for more details. X * X * You should have received a copy of the GNU General Public License X * along with this program; if not, write to the Free Software X * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. X */ X X/* X * fixup_fujitsu_grayscale.c: convert scanner output to PGM X * X * This is faster than using "pgminvert | pnmgamma" but does the same X * thing basically. X */ X X#include X#include X Xstatic int gamma_table[256]; X Xvoid buildgamma(double gamma) X{ X int i, v; X double one_over_gamma, index; X X one_over_gamma = 1.0 / gamma; X X for (i = 0; i <= 255; ++i) { X index = (double)i / 255.0; X v = (255.0 * pow(index, one_over_gamma)) + 0.5; X if (v > 255) X v = 255; X gamma_table[i] = 255 - v; X } X} X Xmain() X{ X int ch; X X buildgamma(0.75); X X while ((ch = getchar()) != EOF) X putchar((char)(gamma_table[ch])); X} END_OF_FILE if test 1482 -ne `wc -c <'pint/util/fixup_fujitsu_grayscale.c'`; then echo shar: \"'pint/util/fixup_fujitsu_grayscale.c'\" unpacked with wrong size! fi # end of 'pint/util/fixup_fujitsu_grayscale.c' fi if test -f 'pint/util/fs1toppm.1' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'pint/util/fs1toppm.1'\" else echo shar: Extracting \"'pint/util/fs1toppm.1'\" \(954 characters\) sed "s/^X//" >'pint/util/fs1toppm.1' <<'END_OF_FILE' X.TH fs1toppm 1 "21 February 1994" X.SH NAME Xfs1toppm - convert the output from the Ricoh FS1 scanner to PPM format X.SH SYNOPSIS X.B fs1toppm X.I X.I X.SH DESCRIPTION X.I fs1toppm Xreads the width and height in pixels of the scanner image Xdata as a decimal integer from the command line and the scanner image Xdata from the file specified on the command line. XIt writes the data out in a format compatible with Portable Pix Map X(PPM) "rawbits". X.PP XThis program was written because the color data format used by Xthe Ricoh FS1 scanner and Portable Pix Map (PPM) are incompatible. XIn PPM the red, green and blue samples are interleaved at the pixel level; Xthe Ricoh FS1 interleaves them at the row level. X.PP XThe X.I grabscan Xscript uses X.I fs1toppm Xinternally. X.SH EXAMPLES Xfs1toppm 100 200 picture.fs1 >picture.ppm X.SH SEE ALSO Xppm(5) X.SH AUTHOR X.nf XKenneth Stailey (kstailey@gnu.ai.mit.edu) (ken@spacenet.com) X.fi END_OF_FILE if test 954 -ne `wc -c <'pint/util/fs1toppm.1'`; then echo shar: \"'pint/util/fs1toppm.1'\" unpacked with wrong size! fi # end of 'pint/util/fs1toppm.1' fi if test -f 'pint/util/fs1toppm.c' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'pint/util/fs1toppm.c'\" else echo shar: Extracting \"'pint/util/fs1toppm.c'\" \(2185 characters\) sed "s/^X//" >'pint/util/fs1toppm.c' <<'END_OF_FILE' X/* X * PINT Pint Is Not TWAIN - common scanner driver interface for UN*X X * Copyright (C) 1994 Kenneth Stailey ken@spacenet.com X * X * This program is free software; you can redistribute it and/or modify X * it under the terms of the GNU General Public License as published by X * the Free Software Foundation; either version 2 of the License, or X * (at your option) any later version. X * X * This program is distributed in the hope that it will be useful, X * but WITHOUT ANY WARRANTY; without even the implied warranty of X * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the X * GNU General Public License for more details. X * X * You should have received a copy of the GNU General Public License X * along with this program; if not, write to the Free Software X * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. X */ X X/* X * fs1toppm.c: convert output from Ricoh FS1 into PPM format X */ X X#include X#include X#include X Xchar fp_buf[262144]; Xchar out_buf[262144]; X Xvoid usage(); Xint read_rgb(FILE *, char *, int); X Xmain(int argc, char *argv[]) X{ X int width; X FILE *fp; X char rgb[3]; X X if (argc != 4) { X usage(); X exit(1); X } X X width = atoi(argv[1]); X X if ((fp = fopen(argv[3], "r")) == NULL) { X perror("open"); X exit(-1); X } X setbuffer(fp, fp_buf, 262144); X setbuffer(stdout, out_buf, 262144); X X printf("P6\n%d %d 255\n", width, atoi(argv[2])); X X while(read_rgb(fp, rgb, width) != EOF) { X fwrite(rgb, 3, 1, stdout); X } X X fclose(fp); X} X Xint read_rgb(FILE *fp, char *rgb, int width) X{ X static int cur_pos = 0; X X if (fseek(fp, cur_pos, SEEK_SET) != 0) { X perror("fseek red"); X exit(-1); X } X if (fread(&rgb[0], 1, 1, fp) != 1) X return EOF; X X if (fseek(fp, cur_pos + width, SEEK_SET) != 0) { X perror("fseek green"); X exit(-1); X } X if (fread(&rgb[1], 1, 1, fp) != 1) X return EOF; X X if (fseek(fp, cur_pos + width * 2, SEEK_SET) != 0) { X perror("fseek blue"); X exit(-1); X } X if (fread(&rgb[2], 1, 1, fp) != 1) X return EOF; X X if (++cur_pos % width == 0) X cur_pos += width * 2; X X return 0; X} X Xvoid usage() X{ X fprintf(stderr, "usage: fs1toppm width height fs1_file\n"); X} END_OF_FILE if test 2185 -ne `wc -c <'pint/util/fs1toppm.c'`; then echo shar: \"'pint/util/fs1toppm.c'\" unpacked with wrong size! fi # end of 'pint/util/fs1toppm.c' fi if test -f 'pint/util/get_pixel_sizes.1' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'pint/util/get_pixel_sizes.1'\" else echo shar: Extracting \"'pint/util/get_pixel_sizes.1'\" \(457 characters\) sed "s/^X//" >'pint/util/get_pixel_sizes.1' <<'END_OF_FILE' X.TH get_pixel_sizes 1 "18 August 1994" X.SH NAME Xget_pixel_sizes - get the width and height of the image data in pixels X.SH SYNOPSIS X.B get_pixel_sizes X.RI [ -l ] X.SH DESCRIPTION XPrints the width and height of the current scanner's active area Xin pixels. XThe -l flag is used if you have two or more scanners. The Xdefault logical name is "scan0". X.SH AUTHOR X.nf XKenneth Stailey (kstailey@gnu.ai.mit.edu, ken@spacenet.com) X.fi END_OF_FILE if test 457 -ne `wc -c <'pint/util/get_pixel_sizes.1'`; then echo shar: \"'pint/util/get_pixel_sizes.1'\" unpacked with wrong size! fi # end of 'pint/util/get_pixel_sizes.1' fi if test -f 'pint/util/get_pixel_sizes.c' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'pint/util/get_pixel_sizes.c'\" else echo shar: Extracting \"'pint/util/get_pixel_sizes.c'\" \(2031 characters\) sed "s/^X//" >'pint/util/get_pixel_sizes.c' <<'END_OF_FILE' X/* X * PINT Pint Is Not TWAIN - common scanner driver interface for UN*X X * Copyright (C) 1994 Kenneth Stailey ken@spacenet.com X * X * This program is free software; you can redistribute it and/or modify X * it under the terms of the GNU General Public License as published by X * the Free Software Foundation; either version 2 of the License, or X * (at your option) any later version. X * X * This program is distributed in the hope that it will be useful, X * but WITHOUT ANY WARRANTY; without even the implied warranty of X * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the X * GNU General Public License for more details. X * X * You should have received a copy of the GNU General Public License X * along with this program; if not, write to the Free Software X * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. X */ X X/* X * get_pixel_size.c: return the width and height of the specified scanner's X * active area X */ X X#include X#include X#include X Xvoid err_exit(char *progname) X{ X fprintf(stderr, "usage: %s [-l scan0]\n", progname); X exit(1); X} X Xmain(int argc, char *argv[]) X{ X int c; X extern int optind; X extern char *optarg; X char scan_name[80]; X char *scan_logical_name = "scan0"; X int scan_fd; X char err_string[128]; X struct scan_pixel_sizes pix; X X while ((c = getopt(argc, argv, "l:")) != EOF) { X switch (c) { X case 'l': X scan_logical_name = optarg; X break; X case '?': X err_exit(argv[0]); X } X } X X strcpy(scan_name, "/dev/"); X strcat(scan_name, scan_logical_name); X X if ((scan_fd = open(scan_name, O_RDONLY)) < 0) { X sprintf(err_string, "%s: open of scanner (%s) failed", X argv[0], scan_name); X perror(err_string); X err_exit(argv[0]); X } X X if (ioctl(scan_fd, SCAN_GET_PIXEL_SIZE, &pix) < 0) { X sprintf(err_string, "%s: ioctl SCAN_GET_PIXEL_SIZE failed", argv[0]); X perror(err_string); X err_exit(argv[0]); X } X X close(scan_fd); X X printf("%d %d\n", pix.pix_width, pix.pix_height); X X exit(0); X} END_OF_FILE if test 2031 -ne `wc -c <'pint/util/get_pixel_sizes.c'`; then echo shar: \"'pint/util/get_pixel_sizes.c'\" unpacked with wrong size! fi # end of 'pint/util/get_pixel_sizes.c' fi if test -f 'pint/util/get_scanner.1' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'pint/util/get_scanner.1'\" else echo shar: Extracting \"'pint/util/get_scanner.1'\" \(688 characters\) sed "s/^X//" >'pint/util/get_scanner.1' <<'END_OF_FILE' X.TH get_scanner 1 "25 October 1994" X.SH NAME Xget_scanner - view the current parameter settings for the scanner X.SH SYNOPSIS X.B get_scanner X.RI [ -q ][ -l ] X.SH DESCRIPTION XProduces a list of scanner attributes and their values. The optional X-q flag formats the list to match the command line for the set_scanner Xprogram. This is useful for saving and restoring settings inside of Xscripts. The -l flag is used if you have two or more scanners. The Xdefault logical name is "scan0". X.SH EXAMPLES Xget_scanner -l scan1 X Xold_values=`get_scanner -q` X.SH "SEE ALSO" Xset_scanner(1) X.SH AUTHOR X.nf XKenneth Stailey (kstailey@gnu.ai.mit.edu, ken@spacenet.com) X.fi END_OF_FILE if test 688 -ne `wc -c <'pint/util/get_scanner.1'`; then echo shar: \"'pint/util/get_scanner.1'\" unpacked with wrong size! fi # end of 'pint/util/get_scanner.1' fi if test -f 'pint/util/get_scanner.c' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'pint/util/get_scanner.c'\" else echo shar: Extracting \"'pint/util/get_scanner.c'\" \(3654 characters\) sed "s/^X//" >'pint/util/get_scanner.c' <<'END_OF_FILE' X/* X * PINT Pint Is Not TWAIN - common scanner driver interface for UN*X X * Copyright (C) 1994 Kenneth Stailey ken@spacenet.com X * X * This program is free software; you can redistribute it and/or modify X * it under the terms of the GNU General Public License as published by X * the Free Software Foundation; either version 2 of the License, or X * (at your option) any later version. X * X * This program is distributed in the hope that it will be useful, X * but WITHOUT ANY WARRANTY; without even the implied warranty of X * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the X * GNU General Public License for more details. X * X * You should have received a copy of the GNU General Public License X * along with this program; if not, write to the Free Software X * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. X */ X X/* X * get_scanner.c: retrieve the a scanner's parameters X */ X#include X#include X#include X#include X#include X Xvoid Xusage(char *prog_name) X{ X fprintf(stderr, "usage: %s [-q][-l ]\n", prog_name); X exit(-1); X} X X Xmain(int argc, char *argv[]) X{ X int s_fd; X struct scan_io s_io; X X int quiet = FALSE; X X char *logical_name = "scan0"; X char device_special[255]; X X int c; X extern int optind; X extern char *optarg; X X while ((c = getopt(argc, argv, "ql:")) != EOF) { X switch (c) { X case 'q': X quiet = TRUE; X break; X X case 'l': X logical_name = optarg; X break; X X case '?': X usage(argv[0]); X break; X } X } X X sprintf(device_special, "/dev/%s", logical_name); X if ((s_fd = open(device_special, O_RDONLY)) < 0) { X perror("open of scanner"); X exit(-1); X } X X if (ioctl(s_fd, SCAN_GET, &s_io) < 0) { X perror("ioctl on scanner"); X exit(-1); X } X X if (quiet) { X printf("-w %g -h %g -x %g -y %g -b %d -c %d -r %d", X (double)s_io.scan_window_width / 1200.0, X (double)s_io.scan_window_length / 1200.0, X (double)s_io.scan_x_origin / 1200.0, X (double)s_io.scan_y_origin / 1200.0, X s_io.scan_brightness, X s_io.scan_contrast, X s_io.scan_x_resolution); X switch (s_io.scan_image_mode) { X case SIM_BINARY_MONOCHROME: X printf(" -i m\n"); X break; X case SIM_DITHERED_MONOCHROME: X printf(" -i d\n"); X break; X case SIM_GRAYSCALE: X printf(" -i g\n"); X break; X case SIM_COLOR: X printf(" -i c\n"); X break; X case SIM_RED: X printf(" -i R\n"); X break; X case SIM_GREEN: X printf(" -i G\n"); X break; X case SIM_BLUE: X printf(" -i B\n"); X break; X } X } else { X printf("width = %g inches\n", (double)s_io.scan_window_width / 1200.0); X printf("height = %g inches\n", (double)s_io.scan_window_length / 1200.0); X printf("x_origin = %g inches\n", (double)s_io.scan_x_origin / 1200.0); X printf("y_origin = %g inches\n", (double)s_io.scan_y_origin / 1200.0); X printf("brightness = %d\n", s_io.scan_brightness); X printf("contrast = %d\n", s_io.scan_contrast); X printf("resolution = %d dpi\n", s_io.scan_x_resolution); X printf("image_mode = "); X switch (s_io.scan_image_mode) { X case SIM_BINARY_MONOCHROME: X printf("binary_monochrome\n"); X break; X case SIM_DITHERED_MONOCHROME: X printf("dithered_monochrome\n"); X break; X case SIM_GRAYSCALE: X printf("grayscale\n"); X break; X case SIM_COLOR: X printf("color\n"); X break; X case SIM_RED: X printf("red\n"); X break; X case SIM_GREEN: X printf("green\n"); X break; X case SIM_BLUE: X printf("blue\n"); X break; X } X } X X close(s_fd); X} END_OF_FILE if test 3654 -ne `wc -c <'pint/util/get_scanner.c'`; then echo shar: \"'pint/util/get_scanner.c'\" unpacked with wrong size! fi # end of 'pint/util/get_scanner.c' fi if test -f 'pint/util/reset_scanner.1' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'pint/util/reset_scanner.1'\" else echo shar: Extracting \"'pint/util/reset_scanner.1'\" \(494 characters\) sed "s/^X//" >'pint/util/reset_scanner.1' <<'END_OF_FILE' X.TH reset-scanner 1 "25 October 1994" X.SH NAME Xreset-scanner - clear error conditions on the scanner X.SH SYNOPSIS X.B reset-scanner X.RI [ -l ] X.SH DESCRIPTION XIf the scanner gets stuck and the error lights go on and you wish that Xyou could push the reset button on it but there isn't one, run this (as Xthe super-user) instead and it will send a Bus Device Reset (BDR) to the Xscanner. X.SH AUTHOR X.nf XKenneth Stailey (kstailey@gnu.ai.mit.edu, ken@spacenet.com) X.fi END_OF_FILE if test 494 -ne `wc -c <'pint/util/reset_scanner.1'`; then echo shar: \"'pint/util/reset_scanner.1'\" unpacked with wrong size! fi # end of 'pint/util/reset_scanner.1' fi if test -f 'pint/util/reset_scanner.c' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'pint/util/reset_scanner.c'\" else echo shar: Extracting \"'pint/util/reset_scanner.c'\" \(1930 characters\) sed "s/^X//" >'pint/util/reset_scanner.c' <<'END_OF_FILE' X/* X * PINT Pint Is Not TWAIN - common scanner driver interface for UN*X X * Copyright (C) 1994 Kenneth Stailey ken@spacenet.com X * X * This program is free software; you can redistribute it and/or modify X * it under the terms of the GNU General Public License as published by X * the Free Software Foundation; either version 2 of the License, or X * (at your option) any later version. X * X * This program is distributed in the hope that it will be useful, X * but WITHOUT ANY WARRANTY; without even the implied warranty of X * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the X * GNU General Public License for more details. X * X * You should have received a copy of the GNU General Public License X * along with this program; if not, write to the Free Software X * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. X */ X X/* X * reset_scanner.c: clear scanner of error conditions X * Ricoh's don't have reset buttons, but could use them. X */ X X#include X#include X#include X Xvoid Xusage(char *prog_name) X{ X fprintf(stderr, "usage: %s [-l ]\n", prog_name); X exit(-1); X} X Xmain(int argc, char *argv[]) X{ X int sfd; X char *logical_name = "scan0"; X char device[255]; X char cmd[255]; X X int fast = FALSE; X X int c; X extern int optind; X extern char *optarg; X X while ((c = getopt(argc, argv, "fl:")) != EOF) { X switch (c) { X case 'l': X logical_name = optarg; X break; X X case 'f': X fast = TRUE; X break; X X case '?': X usage(argv[0]); X break; X } X } X X strcpy(device, "/dev/"); X strcat(device, logical_name); X X if ((sfd = openx(device, O_RDONLY, 0, SC_FORCED_OPEN)) < 0) { X fprintf(stderr, "openx of %s failed: ", device); X perror(""); X exit(-1); X } X X close(sfd); X X if (fast) X exit(0); X X sprintf(cmd, "rmdev -l %s", logical_name); X system(cmd); X sprintf(cmd, "mkdev -l %s", logical_name); X system(cmd); X} END_OF_FILE if test 1930 -ne `wc -c <'pint/util/reset_scanner.c'`; then echo shar: \"'pint/util/reset_scanner.c'\" unpacked with wrong size! fi # end of 'pint/util/reset_scanner.c' fi if test ! -d 'pint/util/scripts' ; then echo shar: Creating directory \"'pint/util/scripts'\" mkdir 'pint/util/scripts' fi if test -f 'pint/util/scripts/Makefile' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'pint/util/scripts/Makefile'\" else echo shar: Extracting \"'pint/util/scripts/Makefile'\" \(262 characters\) sed "s/^X//" >'pint/util/scripts/Makefile' <<'END_OF_FILE' XBINDIR=/usr/local/bin X XPROGS= fujitsu_m3096g_grabscan \ X grabscan \ X hp_scanjet_IIc_grabscan \ X ricoh_fs1_grabscan \ X ricoh_is410_grabscan \ X ricoh_is50_grabscan \ X sharp_jx600_grabscan \ X umax_uc630_grabscan X Xinstall: X chmod 755 $(PROGS) X cp $(PROGS) $(BINDIR) END_OF_FILE if test 262 -ne `wc -c <'pint/util/scripts/Makefile'`; then echo shar: \"'pint/util/scripts/Makefile'\" unpacked with wrong size! fi # end of 'pint/util/scripts/Makefile' fi if test -f 'pint/util/scripts/fujitsu_m3096g_grabscan' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'pint/util/scripts/fujitsu_m3096g_grabscan'\" else echo shar: Extracting \"'pint/util/scripts/fujitsu_m3096g_grabscan'\" \(1417 characters\) sed "s/^X//" >'pint/util/scripts/fujitsu_m3096g_grabscan' <<'END_OF_FILE' X#!/bin/ksh X X# X# PINT Pint Is Not TWAIN - common scanner driver interface for UN*X X# Copyright (C) 1994 Kenneth Stailey ken@spacenet.com X# X# This program is free software; you can redistribute it and/or modify X# it under the terms of the GNU General Public License as published by X# the Free Software Foundation; either version 2 of the License, or X# (at your option) any later version. X# X# This program is distributed in the hope that it will be useful, X# but WITHOUT ANY WARRANTY; without even the implied warranty of X# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the X# GNU General Public License for more details. X# X# You should have received a copy of the GNU General Public License X# along with this program; if not, write to the Free Software X# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. X# X X# X# a wrapper for making PNM rawbits files from the Fujitsu scanner data X# X Xif [ $# -gt 1 ] Xthen X echo usage: $0 [\] 1>&2 X exit -1 Xfi X Xif [ $# = 0 ] Xthen X scan_lname=scan0 Xelse X scan_lname=$1 Xfi X Ximage_mode=`get_scanner -l $scan_lname | awk '/image_mode/ { print $3 }'` X Xset `get_pixel_sizes -l $scan_lname` Xwidth=$1 Xheight=$2 X Xif [ $image_mode = grayscale ] Xthen X echo P5 X echo $width $height X echo 255 X dd if=/dev/$scan_lname bs=256k | fixup_fujitsu_grayscale Xelse # monochrome X echo P4 X echo $width $height X dd if=/dev/$scan_lname bs=256k Xfi END_OF_FILE if test 1417 -ne `wc -c <'pint/util/scripts/fujitsu_m3096g_grabscan'`; then echo shar: \"'pint/util/scripts/fujitsu_m3096g_grabscan'\" unpacked with wrong size! fi chmod +x 'pint/util/scripts/fujitsu_m3096g_grabscan' # end of 'pint/util/scripts/fujitsu_m3096g_grabscan' fi if test -f 'pint/util/scripts/grabscan' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'pint/util/scripts/grabscan'\" else echo shar: Extracting \"'pint/util/scripts/grabscan'\" \(2057 characters\) sed "s/^X//" >'pint/util/scripts/grabscan' <<'END_OF_FILE' X#!/bin/ksh X# X# PINT Pint Is Not TWAIN - common scanner driver interface for UN*X X# Copyright (C) 1994 Kenneth Stailey ken@spacenet.com X# X# This program is free software; you can redistribute it and/or modify X# it under the terms of the GNU General Public License as published by X# the Free Software Foundation; either version 2 of the License, or X# (at your option) any later version. X# X# This program is distributed in the hope that it will be useful, X# but WITHOUT ANY WARRANTY; without even the implied warranty of X# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the X# GNU General Public License for more details. X# X# You should have received a copy of the GNU General Public License X# along with this program; if not, write to the Free Software X# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. X# X X# top-level script to kick off scanning. X Xexport LANG=En_US X Xif [ $# -ne 0 -a $# -ne 2 ] Xthen X echo usage: grabscan '[ -l \ ]' >&2 X exit 1 Xfi X Xif [ $# -eq 2 ] Xthen X scan_lname=$2 Xelse X scan_lname=scan0 Xfi X Xif [ -f /unix ] Xthen X scan_type=`lsdev -C -l $scan_lname | cut -d' ' -f5` Xelse X echo OOPS, you need to get the scanner type by modifing X echo get_scanner to return it. X echo If that's too difficult, just hardcode the scanner X echo type in \"grabscan\" with scan_type=myscanner. X exit 1 Xfi X Xif [ -z "$scan_type" ] Xthen X echo grabscan: no scanner found. >&2 X echo grabscan: terminating execution. >&2 X exit 1 Xfi X Xcase `lsdev -C -l $scan_lname | cut -d' ' -f5` in X IS410|2456) X exec ricoh_is410_grabscan $scan_lname X ;; X X M3096G) X exec fujitsu_m3096g_grabscan $scan_lname X ;; X X FS1) X exec ricoh_fs1_grabscan $scan_lname X ;; X X JX600) X exec sharp_jx600_grabscan $scan_lname X ;; X X IS50) X exec ricoh_is50_grabscan $scan_lname X ;; X X UC630|UG630) X exec umax_uc630_grabscan $scan_lname X ;; X X ScanJet) X exec hp_scanjet_IIc_grabscan $scan_lname X ;; X X *) X echo grabscan: an unsupported scanner type was specified. >&2 X echo grabscan: terminating execution. >&2 X exit 1 X ;; Xesac END_OF_FILE if test 2057 -ne `wc -c <'pint/util/scripts/grabscan'`; then echo shar: \"'pint/util/scripts/grabscan'\" unpacked with wrong size! fi chmod +x 'pint/util/scripts/grabscan' # end of 'pint/util/scripts/grabscan' fi if test -f 'pint/util/scripts/grabscan.1' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'pint/util/scripts/grabscan.1'\" else echo shar: Extracting \"'pint/util/scripts/grabscan.1'\" \(396 characters\) sed "s/^X//" >'pint/util/scripts/grabscan.1' <<'END_OF_FILE' X.TH grabscan 1 "22 November 1994" X.SH NAME Xgrabscan - read scanner data into a Portable Any Map (PNM) file X.SH SYNOPSIS X.B grabscan X.RI [ -l ] X.SH DESCRIPTION XGrabscan analyzes the scanner parameters and uses them to construct a XPNM file header. It then writes the header and scanner data to standard Xoutput. X.SH AUTHOR X.nf XKenneth Stailey (ken@spacenet.com) X.fi END_OF_FILE if test 396 -ne `wc -c <'pint/util/scripts/grabscan.1'`; then echo shar: \"'pint/util/scripts/grabscan.1'\" unpacked with wrong size! fi # end of 'pint/util/scripts/grabscan.1' fi if test -f 'pint/util/scripts/hp_scanjet_IIc_grabscan' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'pint/util/scripts/hp_scanjet_IIc_grabscan'\" else echo shar: Extracting \"'pint/util/scripts/hp_scanjet_IIc_grabscan'\" \(1506 characters\) sed "s/^X//" >'pint/util/scripts/hp_scanjet_IIc_grabscan' <<'END_OF_FILE' X#!/bin/ksh X# X# PINT Pint Is Not TWAIN - common scanner driver interface for UN*X X# Copyright (C) 1994 Kenneth Stailey ken@spacenet.com X# X# This program is free software; you can redistribute it and/or modify X# it under the terms of the GNU General Public License as published by X# the Free Software Foundation; either version 2 of the License, or X# (at your option) any later version. X# X# This program is distributed in the hope that it will be useful, X# but WITHOUT ANY WARRANTY; without even the implied warranty of X# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the X# GNU General Public License for more details. X# X# You should have received a copy of the GNU General Public License X# along with this program; if not, write to the Free Software X# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. X# X# hp_scanjet_IIc_grabscan: X# a wrapper for making PNM rawbits files from the HP ScanJet IIc data X# X Xif [ $# -gt 1 ] Xthen X echo usage: $0 [\] 1>&2 X exit -1 Xfi X Xif [ $# = 0 ] Xthen X scan_lname=scan0 Xelse X scan_lname=$1 Xfi X Ximage_mode=`get_scanner -l $scan_lname | awk '/image_mode/ { print $3 }'` X Xset `get_pixel_sizes -l $scan_lname` Xwidth=$1 Xheight=$2 X Xcase $image_mode in X color) X echo P6 X echo $width $height X echo 255 X dd if=/dev/$scan_lname bs=256k X ;; X X grayscale) X echo P5 X echo $width $height X echo 255 X dd if=/dev/$scan_lname bs=256k X ;; X X binary_monochrome) X echo P4 X echo $width $height X dd if=/dev/$scan_lname bs=256k X ;; Xesac END_OF_FILE if test 1506 -ne `wc -c <'pint/util/scripts/hp_scanjet_IIc_grabscan'`; then echo shar: \"'pint/util/scripts/hp_scanjet_IIc_grabscan'\" unpacked with wrong size! fi chmod +x 'pint/util/scripts/hp_scanjet_IIc_grabscan' # end of 'pint/util/scripts/hp_scanjet_IIc_grabscan' fi if test -f 'pint/util/scripts/ricoh_fs1_grabscan' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'pint/util/scripts/ricoh_fs1_grabscan'\" else echo shar: Extracting \"'pint/util/scripts/ricoh_fs1_grabscan'\" \(1339 characters\) sed "s/^X//" >'pint/util/scripts/ricoh_fs1_grabscan' <<'END_OF_FILE' X#!/bin/ksh X# X# PINT Pint Is Not TWAIN - common scanner driver interface for UN*X X# Copyright (C) 1994 Kenneth Stailey ken@spacenet.com X# X# This program is free software; you can redistribute it and/or modify X# it under the terms of the GNU General Public License as published by X# the Free Software Foundation; either version 2 of the License, or X# (at your option) any later version. X# X# This program is distributed in the hope that it will be useful, X# but WITHOUT ANY WARRANTY; without even the implied warranty of X# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the X# GNU General Public License for more details. X# X# You should have received a copy of the GNU General Public License X# along with this program; if not, write to the Free Software X# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. X# X# ricoh_fs1_grabscan: X# a wrapper for making PPM rawbits files from the Ricoh FS1 scanner data X# X Xif [ $# -gt 1 ] Xthen X echo usage: $0 [\] 1>&2 X exit -1 Xfi X Xif [ $# = 0 ] Xthen X scan_lname=scan0 Xelse X scan_lname=$1 Xfi X Ximage_mode=`get_scanner -l $scan_lname | awk '/image_mode/ { print $3 }'` X Xset `get_pixel_sizes -l $scan_lname` Xwidth=$1 Xheight=$2 X Xdd if=/dev/$scan_lname of=/tmp/fs1_grabscan.$$ bs=256k X Xfs1toppm $width $height /tmp/fs1_grabscan.$$ X Xrm /tmp/fs1_grabscan.$$ END_OF_FILE if test 1339 -ne `wc -c <'pint/util/scripts/ricoh_fs1_grabscan'`; then echo shar: \"'pint/util/scripts/ricoh_fs1_grabscan'\" unpacked with wrong size! fi chmod +x 'pint/util/scripts/ricoh_fs1_grabscan' # end of 'pint/util/scripts/ricoh_fs1_grabscan' fi if test -f 'pint/util/scripts/ricoh_is410_grabscan' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'pint/util/scripts/ricoh_is410_grabscan'\" else echo shar: Extracting \"'pint/util/scripts/ricoh_is410_grabscan'\" \(1417 characters\) sed "s/^X//" >'pint/util/scripts/ricoh_is410_grabscan' <<'END_OF_FILE' X#!/bin/ksh X# X# PINT Pint Is Not TWAIN - common scanner driver interface for UN*X X# Copyright (C) 1994 Kenneth Stailey ken@spacenet.com X# X# This program is free software; you can redistribute it and/or modify X# it under the terms of the GNU General Public License as published by X# the Free Software Foundation; either version 2 of the License, or X# (at your option) any later version. X# X# This program is distributed in the hope that it will be useful, X# but WITHOUT ANY WARRANTY; without even the implied warranty of X# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the X# GNU General Public License for more details. X# X# You should have received a copy of the GNU General Public License X# along with this program; if not, write to the Free Software X# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. X# X# X# ricoh_is410_grabscan: X# a wrapper for making PNM rawbits files from the Ricoh IS410 scanner data X# X Xif [ $# -gt 1 ] Xthen X echo usage: $0 [\] 1>&2 X exit -1 Xfi X Xif [ $# = 0 ] Xthen X scan_lname=scan0 Xelse X scan_lname=$1 Xfi X Ximage_mode=`get_scanner -l $scan_lname | awk '/image_mode/ { print $3 }'` X Xset `get_pixel_sizes -l $scan_lname` Xwidth=$1 Xheight=$2 X Xif [ $image_mode = grayscale ] Xthen X echo P5 X echo $width $height X echo 255 X dd if=/dev/$scan_lname bs=256k Xelse # monochrome X echo P4 X echo $width $height X dd if=/dev/$scan_lname bs=256k Xfi END_OF_FILE if test 1417 -ne `wc -c <'pint/util/scripts/ricoh_is410_grabscan'`; then echo shar: \"'pint/util/scripts/ricoh_is410_grabscan'\" unpacked with wrong size! fi chmod +x 'pint/util/scripts/ricoh_is410_grabscan' # end of 'pint/util/scripts/ricoh_is410_grabscan' fi if test -f 'pint/util/scripts/ricoh_is50_grabscan' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'pint/util/scripts/ricoh_is50_grabscan'\" else echo shar: Extracting \"'pint/util/scripts/ricoh_is50_grabscan'\" \(1413 characters\) sed "s/^X//" >'pint/util/scripts/ricoh_is50_grabscan' <<'END_OF_FILE' X#!/bin/ksh X# X# PINT Pint Is Not TWAIN - common scanner driver interface for UN*X X# Copyright (C) 1994 Kenneth Stailey ken@spacenet.com X# X# This program is free software; you can redistribute it and/or modify X# it under the terms of the GNU General Public License as published by X# the Free Software Foundation; either version 2 of the License, or X# (at your option) any later version. X# X# This program is distributed in the hope that it will be useful, X# but WITHOUT ANY WARRANTY; without even the implied warranty of X# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the X# GNU General Public License for more details. X# X# You should have received a copy of the GNU General Public License X# along with this program; if not, write to the Free Software X# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. X# X# ricoh_is50_grabscan: X# a wrapper for making PNM rawbits files from the Ricoh IS50 scanner data X# X Xif [ $# -gt 1 ] Xthen X echo usage: $0 [\] 1>&2 X exit -1 Xfi X Xif [ $# = 0 ] Xthen X scan_lname=scan0 Xelse X scan_lname=$1 Xfi X Ximage_mode=`get_scanner -l $scan_lname | awk '/image_mode/ { print $3 }'` X Xset `get_pixel_sizes -l $scan_lname` Xwidth=$1 Xheight=$2 X Xif [ $image_mode = grayscale ] Xthen X echo P5 X echo $width $height X echo 255 X dd if=/dev/$scan_lname bs=256k Xelse # monochrome X echo P4 X echo $width $height X dd if=/dev/$scan_lname bs=256k Xfi END_OF_FILE if test 1413 -ne `wc -c <'pint/util/scripts/ricoh_is50_grabscan'`; then echo shar: \"'pint/util/scripts/ricoh_is50_grabscan'\" unpacked with wrong size! fi chmod +x 'pint/util/scripts/ricoh_is50_grabscan' # end of 'pint/util/scripts/ricoh_is50_grabscan' fi if test -f 'pint/util/scripts/sharp_jx600_grabscan' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'pint/util/scripts/sharp_jx600_grabscan'\" else echo shar: Extracting \"'pint/util/scripts/sharp_jx600_grabscan'\" \(1513 characters\) sed "s/^X//" >'pint/util/scripts/sharp_jx600_grabscan' <<'END_OF_FILE' X#!/bin/ksh X# X# PINT Pint Is Not TWAIN - common scanner driver interface for UN*X X# Copyright (C) 1994 Kenneth Stailey ken@spacenet.com X# X# This program is free software; you can redistribute it and/or modify X# it under the terms of the GNU General Public License as published by X# the Free Software Foundation; either version 2 of the License, or X# (at your option) any later version. X# X# This program is distributed in the hope that it will be useful, X# but WITHOUT ANY WARRANTY; without even the implied warranty of X# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the X# GNU General Public License for more details. X# X# You should have received a copy of the GNU General Public License X# along with this program; if not, write to the Free Software X# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. X# X# sharp_jx600_grabscan: X# a wrapper for making PNM rawbits files from the Sharp JX600 data X# X Xif [ $# -gt 1 ] Xthen X echo usage: $0 [\] 1>&2 X exit -1 Xfi X Xif [ $# = 0 ] Xthen X scan_lname=scan0 Xelse X scan_lname=$1 Xfi X Ximage_mode=`get_scanner -l $scan_lname | awk '/image_mode/ { print $3 }'` X Xset `get_pixel_sizes -l $scan_lname` Xwidth=$1 Xheight=$2 X Xcase $image_mode in X color) X echo P6 X echo $width $height X echo 255 X dd if=/dev/$scan_lname bs=32k X ;; X X grayscale) X echo P5 X echo $width $height X echo 255 X dd if=/dev/$scan_lname bs=32k X ;; X X binary_monochrome) X (echo P4 X echo $width $height X dd if=/dev/$scan_lname bs=32k) | pnminvert X ;; Xesac END_OF_FILE if test 1513 -ne `wc -c <'pint/util/scripts/sharp_jx600_grabscan'`; then echo shar: \"'pint/util/scripts/sharp_jx600_grabscan'\" unpacked with wrong size! fi chmod +x 'pint/util/scripts/sharp_jx600_grabscan' # end of 'pint/util/scripts/sharp_jx600_grabscan' fi if test -f 'pint/util/scripts/umax_uc630_grabscan' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'pint/util/scripts/umax_uc630_grabscan'\" else echo shar: Extracting \"'pint/util/scripts/umax_uc630_grabscan'\" \(2272 characters\) sed "s/^X//" >'pint/util/scripts/umax_uc630_grabscan' <<'END_OF_FILE' X#!/bin/ksh X# X# PINT Pint Is Not TWAIN - common scanner driver interface for UN*X X# Copyright (C) 1994 Kenneth Stailey ken@spacenet.com X# X# This program is free software; you can redistribute it and/or modify X# it under the terms of the GNU General Public License as published by X# the Free Software Foundation; either version 2 of the License, or X# (at your option) any later version. X# X# This program is distributed in the hope that it will be useful, X# but WITHOUT ANY WARRANTY; without even the implied warranty of X# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the X# GNU General Public License for more details. X# X# You should have received a copy of the GNU General Public License X# along with this program; if not, write to the Free Software X# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. X# X# umax_uc630_grabscan: X# a wrapper for making PNM rawbits files from the UMAX UC630 scanner data X# X Xif [ $# -gt 1 ] Xthen X echo usage: $0 [\] 1>&2 X exit -1 Xfi X Xif [ $# = 0 ] Xthen X scan_lname=scan0 Xelse X scan_lname=$1 Xfi X Ximage_mode=`get_scanner -l $scan_lname | awk '/image_mode/ { print $3 }'` X Xset `get_pixel_sizes -l $scan_lname` Xwidth=$1 Xheight=$2 X Xcase $image_mode in X Xgrayscale) X echo P5 X echo $width $height X echo 255 X dd if=/dev/$scan_lname bs=256k X;; X Xbinary_monochrome|dithered_monochrome) X echo P4 X echo $width $height X dd if=/dev/$scan_lname bs=256k X;; X Xred|green|blue) X X save_modes=`get_scanner -q` X X echo grabbing colors: >&2 X X# red pass... X echo red... >&2 X set_scanner -i R >/dev/null X (echo P5 X echo $width $height X echo 255 X dd if=/dev/scan0 bs=256k) > /tmp/grabscan.$$.red X X# green pass... X echo green... >&2 X set_scanner -i G >/dev/null X (echo P5 X echo $width $height X echo 255 X dd if=/dev/scan0 bs=256k) > /tmp/grabscan.$$.green X X# blue pass... X echo blue... >&2 X set_scanner -i B >/dev/null X (echo P5 X echo $width $height X echo 255 X dd if=/dev/scan0 bs=256k) > /tmp/grabscan.$$.blue X X echo mixing colors together... >&2 X rgb3toppm /tmp/grabscan.$$.red /tmp/grabscan.$$.green /tmp/grabscan.$$.blue X X rm /tmp/grabscan.$$.red /tmp/grabscan.$$.green /tmp/grabscan.$$.blue X X# restore scanner X set_scanner $save_modes >/dev/null X X;; X Xesac X Xecho done >&2 END_OF_FILE if test 2272 -ne `wc -c <'pint/util/scripts/umax_uc630_grabscan'`; then echo shar: \"'pint/util/scripts/umax_uc630_grabscan'\" unpacked with wrong size! fi chmod +x 'pint/util/scripts/umax_uc630_grabscan' # end of 'pint/util/scripts/umax_uc630_grabscan' fi if test -f 'pint/util/set_scanner.1' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'pint/util/set_scanner.1'\" else echo shar: Extracting \"'pint/util/set_scanner.1'\" \(2764 characters\) sed "s/^X//" >'pint/util/set_scanner.1' <<'END_OF_FILE' X.TH set_scanner 1 "25 October 1994" X.SH NAME Xset_scanner - change the parameter settings for the scanner X.SH SYNOPSIS X.B set_scanner X.RI [ -w width ] X.RI [ -h height] X.RI [ -x x_origin ] X.RI [ -y y_origin ] X.RI [ -r resolution ] X.RI [ -l logical_name ] X.RI [ -i image_mode ] X.RI [ \-b brightness ] X.RI [ -c contrast ] X.RI [ -d ] X.SH DESCRIPTION XChanges one or more of the scanner's attributes. Changes are stored Xin the ODM if you use the -d flag (for setting default values), but Xleaving off the -d is faster. X.SH FLAGS X.B \-w X.I width. XSets the width of the scanner active area to the given value in inches. XDecimal fractions of inches are acceptable for this and all other size Xvalues. X.PP X.B \-h X.I height. XSets the height of the scanner active area to the given value in inches. X.PP X.B \-x X.I x_origin. XSets the upper left hand corner x coordinate of the scanner active area to Xthe given value in inches. X.PP X.B \-y X.I y_origin. XSets the upper left hand corner y coordinate of the scanner active area to Xthe given value in inches. X.PP X.B \-r X.I resolution. XSets the resolution to the given value in dots-per-inch. To see Xacceptable values for X.I resolution Xuse "lsattr -R -l scan0 -a x_resolution" X.PP X.B \-l X.I logical name of scanner. XSpecifies what scanner to use. The default is "scan0" X.PP X.B \-i X.I image mode. XChange the type of image data sent by the scanner. The flag is followed Xby a one-letter code representing the image mode. Use "m" for binary Xmonochrome (solid black or white), "d" for dithered monochrome (halftoned), X"g" for grayscale, "c" for color, "R" for red only, "G" for green only or X"B" for blue only. Not all scanners support all formats. X.PP X.B \-b X.I brightness XSet the hardware brightness control inside the scanner, if any. This flag Xis followed by a decimal integer that specifies how bright the image is to be. XTo see acceptable values for X.I brightness Xuse the command "lsattr -R -l scan0 -a brightness". X.PP X.B \-c X.I contrast XSet the hardware contrast control inside the scanner, if any. This flag Xis followed by a decimal integer that specifies the level of contrast used. XTo see acceptable values for X.I contrast Xuse the command "lsattr -R -l scan0 -a contrast". X.I X.PP X.B \-d XSet the defaults. Scanner settings will be remembered even after the system Xreboots. X.B set_scanner Xwill use "chdev" to alter the ODM instead of the ioctl(2) system call on the Xdevice special file. X.SH EXAMPLES X.PP Xthe command: X.PP Xset_scanner -w 5.5 -h 3.75 -r 300 X.PP Xwill set the active area of the scanner to 5 1/2" x 3 3/4" at 300 dots-per-inch Xresolution X.SH "SEE ALSO" Xget_scanner(1) X.SH BUGS XProbably should support Metric measurement units too. X.SH AUTHOR X.nf XKenneth Stailey (kstailey@gnu.ai.mit.edu, ken@spacenet.com) X.fi END_OF_FILE if test 2764 -ne `wc -c <'pint/util/set_scanner.1'`; then echo shar: \"'pint/util/set_scanner.1'\" unpacked with wrong size! fi # end of 'pint/util/set_scanner.1' fi if test -f 'pint/util/use_adf.1' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'pint/util/use_adf.1'\" else echo shar: Extracting \"'pint/util/use_adf.1'\" \(607 characters\) sed "s/^X//" >'pint/util/use_adf.1' <<'END_OF_FILE' X.TH use_adf 1 "25 October 1994" X.SH NAME Xuse_adf - set up the scanner for reading a page from the ADF X.SH SYNOPSIS X.B use_adf X.RI [ -l ] X.SH DESCRIPTION XWhen you run this program on a scanner with paper in the Automatic XDocument Feeder (ADF), the next time you do a read the ADF will be the Xpaper source. This program will also eject paper sitting in the ADF. X.SH NOTE XThe Ricoh scanner must have the "use_adf" attribute set to "yes" in Xorder to work the ADF. This is not true for the Fujitsu. X.SH AUTHOR X.nf XKenneth Stailey (kstailey@gnu.ai.mit.edu, ken@spacenet.com) X.fi END_OF_FILE if test 607 -ne `wc -c <'pint/util/use_adf.1'`; then echo shar: \"'pint/util/use_adf.1'\" unpacked with wrong size! fi # end of 'pint/util/use_adf.1' fi if test -f 'pint/util/use_adf.c' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'pint/util/use_adf.c'\" else echo shar: Extracting \"'pint/util/use_adf.c'\" \(1869 characters\) sed "s/^X//" >'pint/util/use_adf.c' <<'END_OF_FILE' X/* X * PINT Pint Is Not TWAIN - common scanner driver interface for UN*X X * Copyright (C) 1994 Kenneth Stailey ken@spacenet.com X * X * This program is free software; you can redistribute it and/or modify X * it under the terms of the GNU General Public License as published by X * the Free Software Foundation; either version 2 of the License, or X * (at your option) any later version. X * X * This program is distributed in the hope that it will be useful, X * but WITHOUT ANY WARRANTY; without even the implied warranty of X * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the X * GNU General Public License for more details. X * X * You should have received a copy of the GNU General Public License X * along with this program; if not, write to the Free Software X * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. X */ X X/* X * use_adf.c: make the scanner use the ADF as the next paper source X */ X X#include X#include X#include X#include X Xvoid Xusage(char *prog_name) X{ X fprintf(stderr, "usage: %s [-l ]\n", prog_name); X exit(-1); X} X Xmain(int argc, char *argv[]) X{ X int sfd; X char *logical_name = "scan0"; X char device[255]; X X int c; X extern int optind; X extern char *optarg; X X extern int errno; X X while ((c = getopt(argc, argv, "l:")) != EOF) { X switch (c) { X case 'l': X logical_name = optarg; X break; X X case '?': X usage(argv[0]); X break; X } X } X X strcpy(device, "/dev/"); X strcat(device, logical_name); X X if ((sfd = open(device, O_RDONLY)) < 0) { X fprintf(stderr, "open of %s failed: ", device); X perror(""); X exit(errno); X } X X if (ioctl(sfd, SCAN_USE_ADF, NULL) < 0) { X perror("use_adf: ioctl SCAN_USE_ADF failed"); X fprintf(stderr, "use_adf: ADF probably empty or jammed\n"); X exit(errno); X } X X close(sfd); X exit(0); X} END_OF_FILE if test 1869 -ne `wc -c <'pint/util/use_adf.c'`; then echo shar: \"'pint/util/use_adf.c'\" unpacked with wrong size! fi # end of 'pint/util/use_adf.c' fi echo shar: End of archive 1 \(of 7\). cp /dev/null ark1isdone MISSING="" for I in 1 2 3 4 5 6 7 ; do if test ! -f ark${I}isdone ; then MISSING="${MISSING} ${I}" fi done if test "${MISSING}" = "" ; then echo You have unpacked all 7 archives. rm -f ark[1-9]isdone else echo You still need to unpack the following archives: echo " " ${MISSING} fi ## End of shell archive. exit 0