Newsgroups: comp.sources.unix
From: kstailey@leidecker.gsfc.nasa.gov (Kenneth Stailey)
Subject: v28i141: pint - PINT is not TWAIN (scanner interface toolset), Part03/07
References: <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 141
Archive-Name: pint/part03

#! /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 <file", e.g..  If this archive is complete, you
# will see the following message at the end:
#		"End of archive 3 (of 7)."
# Contents:  pint/COPYING pint/ibm/cfgscan.c pint/ibm/scandd.h
#   pint/ibm/sm_cmd_opt.add pint/sun/dist/+install/install_unbundled
# Wrapped by kstailey@leidecker on Tue Nov  1 12:27:53 1994
PATH=/bin:/usr/bin:/usr/ucb ; export PATH
if test -f 'pint/COPYING' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'pint/COPYING'\"
else
echo shar: Extracting \"'pint/COPYING'\" \(17976 characters\)
sed "s/^X//" >'pint/COPYING' <<'END_OF_FILE'
X		    GNU GENERAL PUBLIC LICENSE
X		       Version 2, June 1991
X
X Copyright (C) 1989, 1991 Free Software Foundation, Inc.
X                          675 Mass Ave, Cambridge, MA 02139, USA
X Everyone is permitted to copy and distribute verbatim copies
X of this license document, but changing it is not allowed.
X
X			    Preamble
X
X  The licenses for most software are designed to take away your
Xfreedom to share and change it.  By contrast, the GNU General Public
XLicense is intended to guarantee your freedom to share and change free
Xsoftware--to make sure the software is free for all its users.  This
XGeneral Public License applies to most of the Free Software
XFoundation's software and to any other program whose authors commit to
Xusing it.  (Some other Free Software Foundation software is covered by
Xthe GNU Library General Public License instead.)  You can apply it to
Xyour programs, too.
X
X  When we speak of free software, we are referring to freedom, not
Xprice.  Our General Public Licenses are designed to make sure that you
Xhave the freedom to distribute copies of free software (and charge for
Xthis service if you wish), that you receive source code or can get it
Xif you want it, that you can change the software or use pieces of it
Xin new free programs; and that you know you can do these things.
X
X  To protect your rights, we need to make restrictions that forbid
Xanyone to deny you these rights or to ask you to surrender the rights.
XThese restrictions translate to certain responsibilities for you if you
Xdistribute copies of the software, or if you modify it.
X
X  For example, if you distribute copies of such a program, whether
Xgratis or for a fee, you must give the recipients all the rights that
Xyou have.  You must make sure that they, too, receive or can get the
Xsource code.  And you must show them these terms so they know their
Xrights.
X
X  We protect your rights with two steps: (1) copyright the software, and
X(2) offer you this license which gives you legal permission to copy,
Xdistribute and/or modify the software.
X
X  Also, for each author's protection and ours, we want to make certain
Xthat everyone understands that there is no warranty for this free
Xsoftware.  If the software is modified by someone else and passed on, we
Xwant its recipients to know that what they have is not the original, so
Xthat any problems introduced by others will not reflect on the original
Xauthors' reputations.
X
X  Finally, any free program is threatened constantly by software
Xpatents.  We wish to avoid the danger that redistributors of a free
Xprogram will individually obtain patent licenses, in effect making the
Xprogram proprietary.  To prevent this, we have made it clear that any
Xpatent must be licensed for everyone's free use or not licensed at all.
X
X  The precise terms and conditions for copying, distribution and
Xmodification follow.
X
X		    GNU GENERAL PUBLIC LICENSE
X   TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
X
X  0. This License applies to any program or other work which contains
Xa notice placed by the copyright holder saying it may be distributed
Xunder the terms of this General Public License.  The "Program", below,
Xrefers to any such program or work, and a "work based on the Program"
Xmeans either the Program or any derivative work under copyright law:
Xthat is to say, a work containing the Program or a portion of it,
Xeither verbatim or with modifications and/or translated into another
Xlanguage.  (Hereinafter, translation is included without limitation in
Xthe term "modification".)  Each licensee is addressed as "you".
X
XActivities other than copying, distribution and modification are not
Xcovered by this License; they are outside its scope.  The act of
Xrunning the Program is not restricted, and the output from the Program
Xis covered only if its contents constitute a work based on the
XProgram (independent of having been made by running the Program).
XWhether that is true depends on what the Program does.
X
X  1. You may copy and distribute verbatim copies of the Program's
Xsource code as you receive it, in any medium, provided that you
Xconspicuously and appropriately publish on each copy an appropriate
Xcopyright notice and disclaimer of warranty; keep intact all the
Xnotices that refer to this License and to the absence of any warranty;
Xand give any other recipients of the Program a copy of this License
Xalong with the Program.
X
XYou may charge a fee for the physical act of transferring a copy, and
Xyou may at your option offer warranty protection in exchange for a fee.
X
X  2. You may modify your copy or copies of the Program or any portion
Xof it, thus forming a work based on the Program, and copy and
Xdistribute such modifications or work under the terms of Section 1
Xabove, provided that you also meet all of these conditions:
X
X    a) You must cause the modified files to carry prominent notices
X    stating that you changed the files and the date of any change.
X
X    b) You must cause any work that you distribute or publish, that in
X    whole or in part contains or is derived from the Program or any
X    part thereof, to be licensed as a whole at no charge to all third
X    parties under the terms of this License.
X
X    c) If the modified program normally reads commands interactively
X    when run, you must cause it, when started running for such
X    interactive use in the most ordinary way, to print or display an
X    announcement including an appropriate copyright notice and a
X    notice that there is no warranty (or else, saying that you provide
X    a warranty) and that users may redistribute the program under
X    these conditions, and telling the user how to view a copy of this
X    License.  (Exception: if the Program itself is interactive but
X    does not normally print such an announcement, your work based on
X    the Program is not required to print an announcement.)
X
XThese requirements apply to the modified work as a whole.  If
Xidentifiable sections of that work are not derived from the Program,
Xand can be reasonably considered independent and separate works in
Xthemselves, then this License, and its terms, do not apply to those
Xsections when you distribute them as separate works.  But when you
Xdistribute the same sections as part of a whole which is a work based
Xon the Program, the distribution of the whole must be on the terms of
Xthis License, whose permissions for other licensees extend to the
Xentire whole, and thus to each and every part regardless of who wrote it.
X
XThus, it is not the intent of this section to claim rights or contest
Xyour rights to work written entirely by you; rather, the intent is to
Xexercise the right to control the distribution of derivative or
Xcollective works based on the Program.
X
XIn addition, mere aggregation of another work not based on the Program
Xwith the Program (or with a work based on the Program) on a volume of
Xa storage or distribution medium does not bring the other work under
Xthe scope of this License.
X
X  3. You may copy and distribute the Program (or a work based on it,
Xunder Section 2) in object code or executable form under the terms of
XSections 1 and 2 above provided that you also do one of the following:
X
X    a) Accompany it with the complete corresponding machine-readable
X    source code, which must be distributed under the terms of Sections
X    1 and 2 above on a medium customarily used for software interchange; or,
X
X    b) Accompany it with a written offer, valid for at least three
X    years, to give any third party, for a charge no more than your
X    cost of physically performing source distribution, a complete
X    machine-readable copy of the corresponding source code, to be
X    distributed under the terms of Sections 1 and 2 above on a medium
X    customarily used for software interchange; or,
X
X    c) Accompany it with the information you received as to the offer
X    to distribute corresponding source code.  (This alternative is
X    allowed only for noncommercial distribution and only if you
X    received the program in object code or executable form with such
X    an offer, in accord with Subsection b above.)
X
XThe source code for a work means the preferred form of the work for
Xmaking modifications to it.  For an executable work, complete source
Xcode means all the source code for all modules it contains, plus any
Xassociated interface definition files, plus the scripts used to
Xcontrol compilation and installation of the executable.  However, as a
Xspecial exception, the source code distributed need not include
Xanything that is normally distributed (in either source or binary
Xform) with the major components (compiler, kernel, and so on) of the
Xoperating system on which the executable runs, unless that component
Xitself accompanies the executable.
X
XIf distribution of executable or object code is made by offering
Xaccess to copy from a designated place, then offering equivalent
Xaccess to copy the source code from the same place counts as
Xdistribution of the source code, even though third parties are not
Xcompelled to copy the source along with the object code.
X
X  4. You may not copy, modify, sublicense, or distribute the Program
Xexcept as expressly provided under this License.  Any attempt
Xotherwise to copy, modify, sublicense or distribute the Program is
Xvoid, and will automatically terminate your rights under this License.
XHowever, parties who have received copies, or rights, from you under
Xthis License will not have their licenses terminated so long as such
Xparties remain in full compliance.
X
X  5. You are not required to accept this License, since you have not
Xsigned it.  However, nothing else grants you permission to modify or
Xdistribute the Program or its derivative works.  These actions are
Xprohibited by law if you do not accept this License.  Therefore, by
Xmodifying or distributing the Program (or any work based on the
XProgram), you indicate your acceptance of this License to do so, and
Xall its terms and conditions for copying, distributing or modifying
Xthe Program or works based on it.
X
X  6. Each time you redistribute the Program (or any work based on the
XProgram), the recipient automatically receives a license from the
Xoriginal licensor to copy, distribute or modify the Program subject to
Xthese terms and conditions.  You may not impose any further
Xrestrictions on the recipients' exercise of the rights granted herein.
XYou are not responsible for enforcing compliance by third parties to
Xthis License.
X
X  7. If, as a consequence of a court judgment or allegation of patent
Xinfringement or for any other reason (not limited to patent issues),
Xconditions are imposed on you (whether by court order, agreement or
Xotherwise) that contradict the conditions of this License, they do not
Xexcuse you from the conditions of this License.  If you cannot
Xdistribute so as to satisfy simultaneously your obligations under this
XLicense and any other pertinent obligations, then as a consequence you
Xmay not distribute the Program at all.  For example, if a patent
Xlicense would not permit royalty-free redistribution of the Program by
Xall those who receive copies directly or indirectly through you, then
Xthe only way you could satisfy both it and this License would be to
Xrefrain entirely from distribution of the Program.
X
XIf any portion of this section is held invalid or unenforceable under
Xany particular circumstance, the balance of the section is intended to
Xapply and the section as a whole is intended to apply in other
Xcircumstances.
X
XIt is not the purpose of this section to induce you to infringe any
Xpatents or other property right claims or to contest validity of any
Xsuch claims; this section has the sole purpose of protecting the
Xintegrity of the free software distribution system, which is
Ximplemented by public license practices.  Many people have made
Xgenerous contributions to the wide range of software distributed
Xthrough that system in reliance on consistent application of that
Xsystem; it is up to the author/donor to decide if he or she is willing
Xto distribute software through any other system and a licensee cannot
Ximpose that choice.
X
XThis section is intended to make thoroughly clear what is believed to
Xbe a consequence of the rest of this License.
X
X  8. If the distribution and/or use of the Program is restricted in
Xcertain countries either by patents or by copyrighted interfaces, the
Xoriginal copyright holder who places the Program under this License
Xmay add an explicit geographical distribution limitation excluding
Xthose countries, so that distribution is permitted only in or among
Xcountries not thus excluded.  In such case, this License incorporates
Xthe limitation as if written in the body of this License.
X
X  9. The Free Software Foundation may publish revised and/or new versions
Xof the General Public License from time to time.  Such new versions will
Xbe similar in spirit to the present version, but may differ in detail to
Xaddress new problems or concerns.
X
XEach version is given a distinguishing version number.  If the Program
Xspecifies a version number of this License which applies to it and "any
Xlater version", you have the option of following the terms and conditions
Xeither of that version or of any later version published by the Free
XSoftware Foundation.  If the Program does not specify a version number of
Xthis License, you may choose any version ever published by the Free Software
XFoundation.
X
X  10. If you wish to incorporate parts of the Program into other free
Xprograms whose distribution conditions are different, write to the author
Xto ask for permission.  For software which is copyrighted by the Free
XSoftware Foundation, write to the Free Software Foundation; we sometimes
Xmake exceptions for this.  Our decision will be guided by the two goals
Xof preserving the free status of all derivatives of our free software and
Xof promoting the sharing and reuse of software generally.
X
X			    NO WARRANTY
X
X  11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
XFOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW.  EXCEPT WHEN
XOTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
XPROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
XOR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
XMERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.  THE ENTIRE RISK AS
XTO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU.  SHOULD THE
XPROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
XREPAIR OR CORRECTION.
X
X  12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
XWILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
XREDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
XINCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
XOUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
XTO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
XYOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
XPROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
XPOSSIBILITY OF SUCH DAMAGES.
X
X		     END OF TERMS AND CONDITIONS
X
X	    How to Apply These Terms to Your New Programs
X
X  If you develop a new program, and you want it to be of the greatest
Xpossible use to the public, the best way to achieve this is to make it
Xfree software which everyone can redistribute and change under these terms.
X
X  To do so, attach the following notices to the program.  It is safest
Xto attach them to the start of each source file to most effectively
Xconvey the exclusion of warranty; and each file should have at least
Xthe "copyright" line and a pointer to where the full notice is found.
X
X    <one line to give the program's name and a brief idea of what it does.>
X    Copyright (C) 19yy  <name of author>
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
XAlso add information on how to contact you by electronic and paper mail.
X
XIf the program is interactive, make it output a short notice like this
Xwhen it starts in an interactive mode:
X
X    Gnomovision version 69, Copyright (C) 19yy name of author
X    Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
X    This is free software, and you are welcome to redistribute it
X    under certain conditions; type `show c' for details.
X
XThe hypothetical commands `show w' and `show c' should show the appropriate
Xparts of the General Public License.  Of course, the commands you use may
Xbe called something other than `show w' and `show c'; they could even be
Xmouse-clicks or menu items--whatever suits your program.
X
XYou should also get your employer (if you work as a programmer) or your
Xschool, if any, to sign a "copyright disclaimer" for the program, if
Xnecessary.  Here is a sample; alter the names:
X
X  Yoyodyne, Inc., hereby disclaims all copyright interest in the program
X  `Gnomovision' (which makes passes at compilers) written by James Hacker.
X
X  <signature of Ty Coon>, 1 April 1989
X  Ty Coon, President of Vice
X
XThis General Public License does not permit incorporating your program into
Xproprietary programs.  If your program is a subroutine library, you may
Xconsider it more useful to permit linking proprietary applications with the
Xlibrary.  If this is what you want to do, use the GNU Library General
XPublic License instead of this License.
END_OF_FILE
if test 17976 -ne `wc -c <'pint/COPYING'`; then
    echo shar: \"'pint/COPYING'\" unpacked with wrong size!
fi
# end of 'pint/COPYING'
fi
if test -f 'pint/ibm/cfgscan.c' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'pint/ibm/cfgscan.c'\"
else
echo shar: Extracting \"'pint/ibm/cfgscan.c'\" \(14005 characters\)
sed "s/^X//" >'pint/ibm/cfgscan.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 * Configure method for PINT
X * first release, version 0.1
X */
X
X#include <sys/types.h>
X#include <sys/cfgdb.h>
X#include <sys/cfgodm.h>
X#include <sys/sysconfig.h>
X#include <sys/device.h>
X#include <sys/mode.h>
X#include <sys/errno.h>
X#include <stdlib.h>
X#include <stdio.h>
X#include <cf.h>
X#include <sys/stat.h>
X#include <sys/scsi.h>
X#include <sys/watchdog.h>
X#ifdef IOSTAT			/* define IOSTAT to use "iostat -d scan0" */
X#include <sys/iostat.h>
X#endif
X#include "scandd.h"
X
X#define USAGE(S)	(fprintf(stderr, "Usage: %s -l name [ -1 | -2 ]\n", (S)), exit(E_ARGS))
X
X
X#define UNDO0		0
X#define UNDO1		1
X#define UNDO2		2
X#define UNDO3		3
X
X#define CDEV_MODE	(S_IFCHR|0444)
X
Xint		lock_id;
Xint		phase = RUNTIME_CFG;
Xstruct cfg_dd	cfg;
Xstruct PdDv	pddv;
Xstruct CuDv	cudv;
Xchar	       *logical_name = NULL;
X
X/*
X * function prototypes
X */
Xvoid close_odm_exit(int err, int undo);
Xint scsi_inq_test(char *parent, char *connwhere, char *model);
X
X
Xmain(int argc, char *argv[])
X{
X  char	 search_string[0x100];
X  char	 *odm_path;
X  char   odm_lock_path[1024];
X  char	 devpath[0x100];
X  long	 majorno, minor;
X
X  char parent_dev[1024];	/* pathname to the parent's special file */
X  struct stat parent_stat;	/* parent's special file inode data */
X  SCAN_DDS sdds;		/* uiomove() puts the DDS in here */
X
X  struct CuAt	*cuat;		/* ODM handle */
X  struct PdAt   pdat;		/* ODM returns model name here */
X  struct CuDv   parent_obj;	/* ODM returns parent adapter here */
X  struct CuDv   connection;	/* ODM returns on connection here */
X
X  extern int   optind;
X  extern char *optarg;
X  int    c;			/* for getopt() return */
X
X  int    n;			/* getattr() count return */
X
X  while ((c = getopt(argc, argv, "l:12")) != EOF) {
X    switch (c) {
X    case 'l':
X      if (logical_name != NULL)
X	USAGE(*argv);
X      logical_name = optarg;
X      break;
X    case '1':
X      if (phase != RUNTIME_CFG)
X	USAGE(*argv);
X      phase = PHASE1;
X      break;
X    case '2':
X      if (phase != RUNTIME_CFG)
X	USAGE(*argv);
X      phase = PHASE2;
X      break;
X    default:
X      USAGE(*argv);
X    }
X  }
X
X  if (logical_name == NULL)	/* logical name must be specified */
X    exit(E_LNAME);
X
X
X  /* initialize and lock ODM */
X
X  if (odm_initialize() < 0)
X    exit(E_ODMINIT);
X
X  if ((odm_path = getenv("ODMDIR")) == NULL) {
X    fprintf(stderr, "%s: ODMDIR environment variable is undefined.\n",
X	    argv[0]);
X    exit(E_ODMLOCK);
X  }
X  strcpy(odm_lock_path, odm_path);
X  strcat(odm_lock_path, "/config_lock");
X  if ((lock_id = odm_lock(odm_lock_path, 10)) == -1)
X    close_odm_exit(E_ODMLOCK, UNDO0);
X
X  /* get customized device entry from CuDv */
X
X  sprintf(search_string, "name = '%s'", logical_name);
X  switch ((int)odm_get_first(CuDv_CLASS, search_string, &cudv)) {
X  case 0:
X    close_odm_exit(E_NOCuDv, UNDO0);
X  case -1:
X    close_odm_exit(E_ODMGET, UNDO0);
X  }
X
X  /* get predefined device from PdDv */
X
X  sprintf(search_string, "uniquetype = '%s'", cudv.PdDvLn_Lvalue);
X  switch ((int)odm_get_first(PdDv_CLASS, search_string, &pddv)) {
X  case 0:
X    close_odm_exit(E_NOPdDv, UNDO0);
X  case -1:
X    close_odm_exit(E_ODMGET, UNDO0);
X  }
X
X  /* if the system is booting work the LED display */
X
X  if (phase != RUNTIME_CFG)
X    setleds(pddv.led);
X
X  /* only configure "DEFINED" devices */
X
X  if (cudv.status == DEFINED) {
X
X    /*  get the tunable parameters from the ODM  */
X
X    if ((cuat = getattr(logical_name, "window_width", FALSE, &n)) == NULL)
X      close_odm_exit(E_NOATTR, UNDO0);
X    sdds.window_width = atol(cuat->value);
X
X    if ((cuat = getattr(logical_name, "window_length", FALSE, &n)) == NULL)
X      close_odm_exit(E_NOATTR, UNDO0);
X    sdds.window_length = atol(cuat->value);
X 
X   if ((cuat = getattr(logical_name, "x_resolution", FALSE, &n)) == NULL)
X      close_odm_exit(E_NOATTR, UNDO0);
X    sdds.x_resolution = (ushort)atoi(cuat->value);
X
X    if ((cuat = getattr(logical_name, "y_resolution", FALSE, &n)) == NULL)
X      close_odm_exit(E_NOATTR, UNDO0);
X    sdds.y_resolution = (ushort)atoi(cuat->value);
X    
X    if ((cuat = getattr(logical_name, "x_origin", FALSE, &n)) == NULL)
X      close_odm_exit(E_NOATTR, UNDO0);
X    sdds.x_origin = atol(cuat->value);
X
X    if ((cuat = getattr(logical_name, "y_origin", FALSE, &n)) == NULL)
X      close_odm_exit(E_NOATTR, UNDO0);
X    sdds.y_origin = atol(cuat->value);
X
X    if ((cuat = getattr(logical_name, "image_mode", FALSE, &n)) == NULL)
X      close_odm_exit(E_NOATTR, UNDO0);
X    if (strcmp(cuat->value, "grayscale") == 0)
X      sdds.image_mode = GRAYSCALE;
X    else if (strcmp(cuat->value, "dithered") == 0)
X      sdds.image_mode = DITHERED_MONOCHROME;
X    else if (strcmp(cuat->value, "monochrome") == 0)
X      sdds.image_mode = BINARY_MONOCHROME;
X    else if (strcmp(cuat->value, "red") == 0)
X      sdds.image_mode = RED;
X    else if (strcmp(cuat->value, "green") == 0)
X      sdds.image_mode = GREEN;
X    else if (strcmp(cuat->value, "blue") == 0)
X      sdds.image_mode = BLUE;
X    else if (strcmp(cuat->value, "color") == 0)
X      sdds.image_mode = COLOR;
X
X    if ((cuat = getattr(logical_name, "brightness", FALSE, &n)) != NULL)
X      sdds.brightness = (uchar)atoi(cuat->value);
X
X    if ((cuat = getattr(logical_name, "contrast", FALSE, &n)) != NULL)
X      sdds.contrast = (uchar)atoi(cuat->value);
X
X    if ((cuat = getattr(logical_name, "use_adf", FALSE, &n)) != NULL)
X      sdds.use_adf = (uchar)(strcmp(cuat->value, "no"));
X
X    /* populate DDS with 'connwhere' */
X
X    sdds.scsi_id = (uchar)(cudv.connwhere[0] - '0');
X    sdds.lun     = (uchar)(cudv.connwhere[1] - '0');
X
X    /* populate DDS with logical name (scan0) */
X
X    strncpy(sdds.logical_name, logical_name, 8);
X
X    /* populate DDS with scanner type code */
X
X    if (strcmp(pddv.type, "ricoh_is410") == 0)
X      sdds.scanner_type = RICOH_IS410;
X    else if (strcmp(pddv.type, "fujitsu") == 0)
X      sdds.scanner_type = FUJITSU;
X    else if (strcmp(pddv.type, "ricoh_fs1") == 0)
X      sdds.scanner_type = RICOH_FS1;
X    else if (strcmp(pddv.type, "sharp_jx600") == 0)
X      sdds.scanner_type = SHARP_JX600;
X    else if (strcmp(pddv.type, "ricoh_is50") == 0)
X      sdds.scanner_type = RICOH_IS50;
X    else if (strcmp(pddv.type, "ibm_2456") == 0)
X      sdds.scanner_type = IBM_2456;
X    else if (strcmp(pddv.type, "umax_uc630") == 0)
X      sdds.scanner_type = UMAX_UC630;
X    else if (strcmp(pddv.type, "umax_ug630") == 0)
X      sdds.scanner_type = UMAX_UG630;
X    else if (strcmp(pddv.type, "hp_scanjet_IIc") == 0)
X      sdds.scanner_type = HP_SCANJET_IIC;
X
X    /* check the parent */
X
X    sprintf(search_string, "name = '%s'", cudv.parent);
X    switch ((int)odm_get_first(CuDv_CLASS, search_string, &parent_obj)) {
X    case 0:
X      close_odm_exit(E_NOCuDvPARENT, UNDO0);
X    case -1:
X      close_odm_exit(E_ODMGET, UNDO0);
X    }
X
X    /* test for parent's availability */
X    if (parent_obj.status != AVAILABLE)
X      close_odm_exit(E_PARENTSTATE, UNDO0); /* can't continue w.o./parent */
X
X    /* check the connection */
X
X    /*  use SCSI INQUIRY command to see if the scanner matches the ODM  */
X
X    /* get the model name from the PdAt */
X    sprintf(search_string, "uniquetype = '%s' and attribute = 'model_name'",
X	    pddv.uniquetype);
X    switch ((int)odm_get_first(PdAt_CLASS, search_string, &pdat)) {
X    case 0:
X      close_odm_exit(E_NOPdOBJ, UNDO0);
X    case -1:
X      close_odm_exit(E_ODMGET, UNDO0);
X    }
X
X    while (TRUE) {
X      if (scsi_inq_test(cudv.parent, cudv.connwhere, pdat.deflt))
X	break;
X
X      /* check all model names in the ODM */
X
X      switch ((int)odm_get_next(PdAt_CLASS, &pdat)) {
X      case 0:
X	close_odm_exit(E_NODETECT, UNDO0);
X      case -1:
X	close_odm_exit(E_ODMGET, UNDO0);
X      }
X    }
X
X    /* test connection, reject if already in use */
X
X    sprintf(search_string,
X	    "parent = '%s' AND connwhere = '%s' AND status = %d",
X	    cudv.parent, cudv.connwhere, AVAILABLE);
X    switch ((int)odm_get_first(CuDv_CLASS, search_string, &connection)) {
X    case -1:
X      close_odm_exit(E_ODMGET, UNDO0);
X    case 0:
X      break;		/* if nothing is connected then we are fine */
X    default:
X      close_odm_exit(E_AVAILCONNECT, UNDO0);
X    }
X
X    /* if the driver exists then load it */
X
X    if (*pddv.DvDr != 0) {
X      if ((cfg.kmid = loadext(pddv.DvDr, TRUE, FALSE)) == NULL)
X	close_odm_exit(E_LOADEXT, UNDO0);
X
X      /*  get the major & minor numbers  */
X
X      if ((majorno = genmajor(pddv.DvDr)) == -1)
X	close_odm_exit(E_MAJORNO, UNDO1);
X
X      minor = atol(&logical_name[4]); /* minor is logical name's number */
X
X      /*   make the special file   */
X
X      cfg.devno  = makedev(majorno, minor);
X      sprintf(devpath, "/dev/%s", logical_name);
X
X      if (mknod(devpath, CDEV_MODE, cfg.devno) < 0 && errno == EEXIST) {
X	if (unlink(devpath) < 0 || mknod(devpath, CDEV_MODE, cfg.devno) < 0)
X	  close_odm_exit(E_MKSPECIAL, UNDO2);
X      }
X
X      /* complete the DDS */
X
X      /* put the parent adapter special file devno into the DDS */
X      strcpy(parent_dev, "/dev/");
X      strcat(parent_dev, cudv.parent);
X      if (stat(parent_dev, &parent_stat) < 0)
X	close_odm_exit(E_DDS, UNDO2);
X      sdds.parent_devno = parent_stat.st_rdev;
X
X      cfg.ddsptr = (char *)&sdds;
X      cfg.ddslen = sizeof(sdds);
X
X      /*  call the driver's initialization routine  */
X
X      cfg.cmd = CFG_INIT;
X      if (sysconfig(SYS_CFGDD, &cfg, sizeof(struct cfg_dd)) == -1)
X	close_odm_exit(E_CFGINIT, UNDO2);
X
X    }  /* test for presence of device driver */
X
X    /* mark device as available in CuDv */
X
X    cudv.status = AVAILABLE;
X    if (odm_change_obj(CuDv_CLASS, &cudv) < 0)
X      close_odm_exit(E_ODMUPDATE, UNDO3);
X
X  } /* test if device is AVAILABLE */
X
X  close_odm_exit(E_OK, UNDO0);
X}
X
X/*
X * scsi_inq_test: look for scanner using SCSI INQUIRY command
X * takes the parent device name "/dev/scsi0", a connection code "connwhere"
X *  and the model name we are looking for
X * returns non-zero if it finds that the model string matches
X *  or a zero if it does not match, or if any errors occur.
X */
X
Xint
Xscsi_inq_test(char *parent, char *connwhere, char *model)
X{
X  int scsi_fd;
X  struct sc_inquiry sc_inq;
X  uchar inq_response[128];	/* response from fp_ioctl SCIOINQU */
X  char parent_dev[128];
X  int back_out = 0;		/* for undoing stuff when errors happen */
X  int rc = 0;			/* return from this funtion */
X
X  strcpy(parent_dev, "/dev/");
X  strcat(parent_dev, parent);
X
X  /* open the host adapter */
X  if ((scsi_fd = open(parent_dev, O_RDONLY)) < 0) {
X
X#ifdef DEBUG
X    fprintf(stderr, "open of %s failed -- errno = %d", parent_dev, errno);
X#endif
X
X    return (1);
X  } else {
X    ++back_out;			/* now a close(scsi_fd) is necessary */
X  }
X
X  /* send an ioctl START to the host adapter */
X
X  if (ioctl(scsi_fd, SCIOSTART,
X	    IDLUN((uchar)(connwhere[0]-'0'), (uchar)(connwhere[1]-'0'))) < 0) {
X
X#ifdef DEBUG
X    fprintf(stderr, "ioctl SCIOSTART on  %s failed -- errno = %d",
X	    parent_dev, errno);
X#endif
X
X    goto inq_out;
X  } else {
X    ++back_out;			/* now a SCIOSTOP is necessary */
X  }
X
X  /* send an ioctl INQUIRY to the host adapter */
X  /* fill out the sc_inquiry struct */
X  sc_inq.scsi_id	= (uchar)(connwhere[0] - '0');
X  sc_inq.lun_id		= (uchar)(connwhere[1] - '0');
X  sc_inq.rsv1		= (uchar)0;
X  sc_inq.inquiry_len	= (uchar)(sizeof(inq_response) - 1);
X  sc_inq.inquiry_ptr	= inq_response;
X  sc_inq.rsv2		= (uchar)0;
X  sc_inq.rsv3		= (uchar)0;
X  sc_inq.rsv4		= (uchar)0;
X  if (strncmp(model, "FS1 S",  5) == 0 ||
X      strncmp(model, "IS50",   4) == 0 ||
X      strncmp(model, "UC630",  5) == 0 ||
X      strncmp(model, "UG630",  5) == 0 ||
X      strncmp(model, "C1750A", 6) == 0)
X    sc_inq.flags	= (uchar)SC_ASYNC;
X  else
X    sc_inq.flags	= (uchar)0;
X  sc_inq.rsv5		= (uint)0;
X
X  if (ioctl(scsi_fd, SCIOINQU, &sc_inq) < 0) {
X#ifdef DEBUG
X    fprintf(stderr, "ioctl SCIOINQU on %s failed -- errno = %d",
X	    connwhere, errno);
X#endif
X    goto inq_out;
X  } else {
X#ifdef DEBUG
X    fprintf(stderr, "model: '%s'  response: '%s'\n", model, &inq_response[16]);
X#endif
X    if (strncmp(model, &inq_response[16], strlen(model)) == 0)
X      rc = 1;			/* ta-da! */
X  }
X
X  /****  exit scsi_inq_test performing any cleanup  ***/
X
X inq_out:
X  switch (back_out) {
X  case 2:			/* a SCIOSTOP is necessary */
X
X    (void)ioctl(scsi_fd, SCIOSTOP,   /* hope it worked! */
X	  IDLUN((uchar)(connwhere[0]-'0'), (uchar)(connwhere[1]-'0')));
X
X				/* fall through to 1 */
X
X  case 1:			/* a close(scsi_fd) is necessary */
X    close(scsi_fd);		/* fall through to 0 */
X
X  case 0:			/* no cleanup necessary */
X    break;
X
X  default:
X    fprintf(stderr, "cfgscan in scsi_inq_test(): bad back_out value: %d\n",
X	    back_out);
X  }
X  return (rc);
X}
X
X/* clean up and exit */
X
Xvoid
Xclose_odm_exit(int err, int undo)
X{
X  odm_unlock(lock_id);
X  odm_terminate();
X
X  switch (undo) {
X  case UNDO0:
X    break;
X
X  case UNDO3:			  /* Terminate Device */
X    cfg.kmid = (mid_t) 0;
X    cfg.ddsptr = NULL;
X    cfg.ddslen = (int) 0;
X    cfg.cmd = CFG_TERM;
X    (void) sysconfig(SYS_CFGDD, &cfg, sizeof(struct cfg_dd));
X				  /* fall through to UNDO2... */
X
X  case UNDO2:			  /* release major number & unload driver */
X    reldevno(logical_name, TRUE); /* fall through to UNDO1... */
X
X  case UNDO1:			  /* Unload driver */
X    (void) loadext(pddv.DvDr, FALSE, FALSE);
X    break;
X  }
X  exit(err);
X}
END_OF_FILE
if test 14005 -ne `wc -c <'pint/ibm/cfgscan.c'`; then
    echo shar: \"'pint/ibm/cfgscan.c'\" unpacked with wrong size!
fi
# end of 'pint/ibm/cfgscan.c'
fi
if test -f 'pint/ibm/scandd.h' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'pint/ibm/scandd.h'\"
else
echo shar: Extracting \"'pint/ibm/scandd.h'\" \(13863 characters\)
sed "s/^X//" >'pint/ibm/scandd.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 * defines for different types of scanners
X * first release, version 0.1
X */
X
X#define RICOH_IS410	1
X#define FUJITSU		2	/* obsolescent #define */
X#define FUJITSU_M3096G  2	/* prefered #define */
X#define HP_SCANJET_IIC  3
X#define RICOH_FS1	4
X#define SHARP_JX600	5
X#define RICOH_IS50	6
X#define IBM_2456	7
X#define UMAX_UC630	8
X#define UMAX_UG630      9
X
X
X/*
X * defines for paper sizes
X */
X#define STANDARD_PAPER_SIZE	0x80
X#define NONSTANDARD_PAPER_SIZE	0xc0
X#define PORTRAIT		0x00
X#define LANDSCAPE		0x10
X#define LETTER			0x07
X#define DOUBLE_LETTER		0x06
X#define LEGAL			0x0f
X
X/*
X * defines for IMAGE_COMPOSITION field
X */
X#define BINARY_MONOCHROME   0
X#define DITHERED_MONOCHROME 1
X#define GRAYSCALE 2
X#define COLOR	  5
X#define RED	  103
X#define GREEN	  104
X#define BLUE	  105
X
X
X/*
X * defines for HALFTONE_PATTERN field
X */
X#define BUILTIN_HALFTONE_PATTERN	0
X#define DOWNLOADABLE_HALFTONE_PATTERN	1
X
X/*
X * scsi opcodes not provided in <sys/scsi.h>
X */
X#define SCSI_SET_WINDOW		0x24
X#define SCSI_GET_WINDOW		0x25
X#define SCSI_TRIGGER_SCAN       0x1b
X#define SCSI_GET_BUFFER_STATUS  0x34
X#define SCSI_OBJECT_POSITION    0x31
X#define SCSI_GET_IMAGE_STATUS   0x0f
X/* read request with special data type tells sharp to abort read mode */
X#define SCSI_SHARP_READ_ABORT   SCSI_READ_EXTENDED
X
X/*
X *  defines for sc_buf.scsi_command.scsi_cmd.scsi_bytes
X *  SCSI command block
X */
X#define SCB2 0
X#define SCB3 1
X#define SCB4 2
X#define SCB5 3
X#define SCB6 4
X#define SCB7 5
X#define SCB8 6
X#define SCB9 7
X
X/* sizes for mode parameter's base_measurement_unit */
X
X#define INCHES 0
X#define MILLIMETERS 1
X#define POINTS 2
X
X/*
X *  misc defines
X */
X#define SCANNER_HASHSIZE 0x0f	/* for scanner_list table */
X#define SCAN_STOP_UNIT	0
X#define SCAN_START_UNIT 1
X#define SCAN_PASS_THRU		  0xEF	  /* cmd state for pass-thru ioctl */
X
X#define ADAPTER_FATAL		  0xFD /* adapter_error for you're hosed */
X#define ADAPTER_RETRY		  0xFE /* adapter_error for retry cmd  */
X#define ADAPTER_RESET		  0xFF /* adapter_error for reset dev  */
X
X#define MAX_TUR_RETRIES		  3   /* number of Test Unit Ready retries */
X
X/* misc bit flags */
X#define PF_BIT 0x10		/* for mode select */
X#define WAIT_BIT (uchar)(0x01)	/* for get data buffer status */
X#define LOAD_BIT (uchar)(0x01)	/* for object position */
X
X#define SCANNING_MEASUREMENT_PARAMETERS (uchar)(3)
X
X/*
X * the (ever-increasing) Device Dependent Structure (DDS)
X */
X
Xtypedef struct scan_dds SCAN_DDS;
X
Xstruct scan_dds {
X  uchar  scsi_id;		/* SCSI id from 0 to 7 */
X  uchar  lun;			/* Logical Unit Number */
X  dev_t  parent_devno;		/* major-minor combo from parent adapter */
X  char   logical_name[8];	/* "scan0" for instance */
X  uint	 scanner_type;		/* see defines above */
X  ulong  window_width;		/* width in 1/2000ths of an inch */
X  ulong  window_length;		/* length in 1/2000ths of an inch */
X  ushort x_resolution;		/* horizontal resolution in dots-per-inch */
X  ushort y_resolution;		/* vertical resolution in dots-per-inch */
X  ulong  x_origin;		/* horizontal coordinate of upper left corner */
X  ulong  y_origin;		/* vertical coordinate of upper left corner */
X  uchar  image_mode;		/* type of image data sent by scanner */
X  uchar  brightness;		/* image brightness control */
X  uchar  contrast;		/* image contrast control */
X  uchar  use_adf;		/* use Automatic Document Feeder */
X};
X
X/*
X *  SCSI_MODE_SELECT parameter list
X */
Xstruct ricoh_mode_params {
X  /* header */
X  uchar mode_data_length;
X  uchar medium_type;
X  uchar device_specific_parameter;
X  uchar block_descriptor_length;
X
X  /* page descriptor */
X  uchar page_code;
X  uchar paramter_length;
X  uchar base_measurement_unit;
X  uchar reserved1;
X  uchar measurement_unit_devisor_msb;
X  uchar measurement_unit_devisor_lsb;
X  uchar reserved2;
X  uchar reserved3;
X
X  /* ADF support */
X  uchar adf_page_code;
X  uchar adf_parameter_length;
X  uchar adf_control;
X  uchar reserved4;
X  uchar reserved5;
X  uchar reserved6;
X  uchar reserved7;
X  uchar reserved8;
X};
X
X
X/*
X * arrays & defines for setting scanner windows
X */
X
X/* common header... */
X
X#define window_desc_header_size 8
X
X#define WDH_RESERVED0				0
X#define WDH_RESERVED1				1
X#define WDH_RESERVED2				2
X#define WDH_RESERVED3				3
X#define WDH_RESERVED4				4
X#define WDH_RESERVED5				5
X#define WDH_WINDOW_DESCRIPTOR_BLOCK_LENGTH_MSB	6
X#define WDH_WINDOW_DESCRIPTOR_BLOCK_LENGTH_LSB	7
X
X/* common portions of the window descriptor... */
X
X#define window_desc_size 64
X
X#define WD_WINDOW_ID		8
X#define WD_RESERVED00		9
X#define WD_X_RES_MSB		10
X#define WD_X_RES_LSB		11
X#define WD_Y_RES_MSB		12
X#define WD_Y_RES_LSB		13
X#define WD_UPPER_LEFT_X_MSB	14		/* Most Significant Byte */
X#define WD_UPPER_LEFT_X_MHB	15		/* Middle High Byte */
X#define WD_UPPER_LEFT_X_MLB	16		/* Middle Low Byte */
X#define WD_UPPER_LEFT_X_LSB	17		/* Least Significant Byte */
X#define WD_UPPER_LEFT_Y_MSB	18
X#define WD_UPPER_LEFT_Y_MHB	19
X#define WD_UPPER_LEFT_Y_MLB	20
X#define WD_UPPER_LEFT_Y_LSB	21
X#define WD_WIDTH_MSB		22
X#define WD_WIDTH_MHB		23
X#define WD_WIDTH_MLB		24
X#define WD_WIDTH_LSB		25
X#define WD_LENGTH_MSB		26
X#define WD_LENGTH_MHB		27
X#define WD_LENGTH_MLB		28
X#define WD_LENGTH_LSB		29
X#define WD_BRIGHTNESS		30
X#define WD_THRESHOLD		31
X#define WD_CONTRAST		32
X#define WD_IMAGE_COMPOSTION	33
X#define WD_BITS_PER_PIXEL	34
X
X/* damn incompatibility with HALFTONEs... */
X
X#define WDF_HALFTONE_PATTERN_MSB 35 /* Fujitsu style */
X#define WDF_HALFTONE_PATTERN_LSB 36
X
X#define WDR_HALFTONE_CODE       35 /* Ricoh style */
X#define WDR_HALFTONE_ID         36
X
X/* back to common stuff... */
X
X#define WD_RIF_AND_PADDING	37
X#define RIF		0x80	/* bitmask for RIF bit */
X#define PADDING_TYPE	0x03	/* bitmask for padding type bits */
X
X#define WD_BIT_ORDERING_MSB	38
X#define WD_BIT_ORDERING_LSB	39
X#define WD_COMPRESSION_TYPE	40
X#define WD_COMPRESSION_ARG	41
X#define WD_RESERVED01		42
X#define WD_RESERVED02		43
X#define WD_RESERVED03		44
X#define WD_RESERVED04		45
X#define WD_RESERVED05		46
X#define WD_RESERVED06		47
X
X/* Fujitsu specific window descriptor stuff... */
X
X#define WDF_IDENTIFICATION_CODE 48
X#define WDF_RESERVED07		49
X#define WDF_OUTLINE		50
X#define WDF_EMPHASIS		51
X#define WDF_MIXED		52
X#define WDF_MIRRORING		53
X#define WDF_RESERVED08		54
X#define WDF_RESERVED09		55
X#define WDF_RESERVED10		56
X#define WDF_RESERVED11		57
X#define WDF_RESERVED12		58
X#define WDF_SUBWINDOW_LIST_MSB	59
X#define WDF_SUBWINDOW_LIST_LSB	60
X#define WDF_PAPER_SIZE		61
X#define WDF_X_MSB		62
X#define WDF_X_MHB		63
X#define WDF_X_MLB		64
X#define WDF_X_LSB		65
X#define WDF_Y_MSB		66
X#define WDF_Y_MHB		67
X#define WDF_Y_MLB		68
X#define WDF_Y_LSB		69
X#define WDF_RESERVED13		70
X#define WDF_RESERVED14		71
X
X/* Ricoh specific window descriptor stuff... */
X
X#define WDR_RESERVED01          48
X#define WDR_RESERVED02          49
X#define WDR_MRIF_FILTERING_GAMMA_ID 50
X#define WDR_RESERVED03          51
X#define WDR_RESERVED04          52
X#define WDR_BINARY_FILTER       53
X#define WDR_RESERVED05          54
X#define WDR_RESERVED06          55
X#define WDR_RESERVED07          56
X#define WDR_RESERVED08          58
X#define WDR_RESERVED09          58
X#define WDR_RESERVED10          59
X#define WDR_RESERVED11          60
X#define WDR_RESERVED12          61
X#define WDR_RESERVED13          62
X#define WDR_RESERVED14          63
X#define WDR_RESERVED15          64
X#define WDR_RESERVED16          65
X#define WDR_RESERVED17          66
X#define WDR_RESERVED18          67
X#define WDR_RESERVED19          68
X#define WDR_RESERVED20          69
X#define WDR_RESERVED21          70
X#define WDR_RESERVED22          71
X
X/* UMAX specific window descriptor stuff... */
X#define WDU_SPEED		48
X#define WDU_SELECT_COLOR	49
X#define WDU_HIGHLIGHT		50
X#define WDU_SHADOW		51
X#define WDU_PAPER_LENGTH_MSB	52
X#define WDU_PAPER_LENGTH_LSB	53
X
X/*
X * Since iodone() & devstrat() want a "struct buf *" and we need more
X * than that we define a structure with trailing addition data and
X * use a pointer to that instead of just a buf struct.	IBM does it too
X * with their sc_buf struct which also starts with a buf struct.
X * We tack on our scan_df struct to the whole thing
X */
X
Xstruct scan_buf {
X  struct sc_buf	  scsi_buf;
X  struct scan_df *scan_ptr;
X  uint	 retry_count;
X};
X
X/* structure for the REQUEST SENSE data from the target */
X
Xstruct scan_req_sense_data {
X  uchar err_code;
X  uchar segment_number;
X  uchar sense_key;
X#define ILI_BIT 0x20		/* illegal length bit in sense key field */
X#define EOM_BIT 0x40		/* end of media bit in sense key field */
X  uchar info0;
X  uchar info1;
X  uchar info2;
X  uchar info3;
X  uchar additional_sense_length;
X  uchar cmd_specific0;
X  uchar cmd_specific1;
X  uchar cmd_specific2;
X  uchar cmd_specific3;
X  uchar additional_sense_code;
X  uchar additional_sense_code_qualifier;
X  uchar FRU;			/* field replaceable unit code */
X  uchar sense_key_specific0;
X  uchar sense_key_specific1;
X  uchar sense_key_specific2;
X};
X
Xstruct scan_inq_data {
X  uchar peripheral_type;
X  uchar device_type_qualifier;
X  uchar version;
X  uchar response_data_format;
X  uchar additional_inq_length;
X  uchar reserved01;
X  uchar reserved02;
X  uchar flags;
X  uchar vendor_id[16];
X  uchar product_id[16];
X  uchar product_version[4];
X};
X
X/*
X *  structure for misc scanner info
X *   this gets xmalloc'd from the pinned heap in scanconfig()
X */
Xstruct scan_df {
X  struct scan_df *next_defined; /* Ptr to next defined scan_df		  */
X  struct scan_df *next_opened;	/* Ptr to next opened scan_df		  */
X  struct scan_dds s_dds;	/* device dependent info struct		  */
X  dev_t	 devno;			/* key used to tie entry to special file  */
X  struct file *fp;		/* for fp_devxxx() routines		  */
X  struct scan_buf data_buf;	/* buf block to use for normal data xfers */
X  struct scan_buf cmd_buf;	/* buf block to use for a command	  */
X  struct scan_buf reqsen_buf;	/* buf block to use for a request sense	  */
X  struct scan_buf ioctl_buf;	/* buf block to use for a ioctl()s	  */
X  struct sc_error_log_df scan_errlog; /* error log structure		  */
X  struct scan_req_sense_data rs; /* space for request sense replies	  */
X  struct scan_inq_data inq;	/* space for inquiry replies              */
X  int    window_size;		/* # of bytes in the window		  */
X  int    bytes_ready;		/* response from GET_BUFFER		  */
X  int	 tur_count;		/* number of Test Unit Ready's tried	  */
X  uchar	 cmd_state;		/* current command used in iodone()	  */
X  enum   hp_cmds {
X    HP_CONFIG,			/* send the scan params to the scanner    */
X    HP_TRIGGER,			/* start the scan operation               */
X    HP_PAPER_SENSE,		/* test ADF for paper                     */
X    HP_UNLOAD_ADF,		/* unload document from ADF               */
X  } hp_command;
X  uchar  hp_response[20];	/* escape code response from ScanJet IIc  */
X  uchar	 check_condition;	/* set when a request sense is needed	  */
X  uchar  adapter_error;		/* set to the ret val from adapter_error()*/
X  uchar	 retry;			/* this command is a retry		  */
X  uchar  triggered;		/* has a SCSI_SCAN_TRIGGER been sent yet? */
X  uchar	 opened;		/* the device has been opened		  */
X  uchar  do_unload;		/* toggle for PAPER_PUSH ioctl            */
X  uchar  configured;            /* SCSI_SET_WINDOW has been sent	  */
X  uchar  using_adf;		/* flag to indicate UMAX ADF read         */
X  enum   adf_states {
X    ADF_UNUSED,			/* scan from flatbed, not ADF             */
X    ADF_ARMED,			/* scan from ADF, everything's set up     */
X    ADF_CLEANUP,		/* eject paper from ADF on close          */
X  } adf_state;
X  uchar  buf_status[12];	/* for the SCSI_GET_BUFFER_STATUS command */
X  uchar	 diag_mode;		/* device is open in diag mode		  */
X  uchar	 retain_reservation;	/* no release on close			  */
X#ifdef IOSTAT
X  struct dkstat scan_dkstat;	/* iostat struct for scanner */
X#endif
X};
X
X/*
X * scanner hash table definition
X */
Xstruct scan_hash_table_df {
X	struct scan_df	     *defined_head;
X	struct scan_df	     *opened_head;
X};
X
X
X/* function prototypes */
X
X/* top half */
Xint scanconfig(dev_t devno, int cmd, struct uio *uiop);
Xint scanopen(dev_t devno, ulong devflag, chan_t chan, int ext);
Xint scanclose(dev_t devno, chan_t chan);
Xint scanread(dev_t devno, struct uio *uiop, chan_t chan, int ext);
Xint scanioctl(dev_t devno, int cmd, int arg,
X	      ulong devflag, chan_t chan, int ext);
Xint calc_umax_row_len(int dpi, int ww);
Xint umax_has_paper_in_adf(struct scan_df *scan_ptr);
Xvoid find_umax(struct scan_df *scan_ptr);
Xvoid do_request_sense(struct scan_df *scan_ptr);
X
X/* bottom half */
Xvoid scaniodone(struct buf *bp);
Xvoid scan_scsi_cmd(uchar, struct scan_df *);
Xvoid scanner_reserve_unit(struct scan_df *);
Xvoid scanner_release_unit(struct scan_df *);
X/* void scanner_request_sense(struct scan_df *); */
Xvoid scanner_set_window(struct scan_df *);
Xvoid scan_trigger(struct scan_df *);
Xvoid scanwait(struct buf *);	/* XXX -> should use iowait() if possible */
X
X
Xuchar adapter_error(struct scan_buf *);
X
Xextern int nodev();		/* returns error */
Xextern int nulldev();		/* returns success */
Xextern int uphysio(struct uio *, int, uint, dev_t, int (*)(), int(*)(), void *);
Xextern int uiomove(caddr_t, int, enum uio_rw, struct uio *);
Xextern int devstrat(struct buf *);
END_OF_FILE
if test 13863 -ne `wc -c <'pint/ibm/scandd.h'`; then
    echo shar: \"'pint/ibm/scandd.h'\" unpacked with wrong size!
fi
# end of 'pint/ibm/scandd.h'
fi
if test -f 'pint/ibm/sm_cmd_opt.add' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'pint/ibm/sm_cmd_opt.add'\"
else
echo shar: Extracting \"'pint/ibm/sm_cmd_opt.add'\" \(17228 characters\)
sed "s/^X//" >'pint/ibm/sm_cmd_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_cmd_opt:
X	id_seq_num = "0"
X	id = "scanner_ln_opt"
X	disc_field_name = ""
X	name = "Scanner"
X	name_msg_file = "scanner.cat"
X	name_msg_set = 5
X	name_msg_id = 1
X	op_type = "l"
X	entry_type = "t"
X	entry_size = 0
X	required = "y"
X	prefix = ""
X	cmd_to_list_mode = "1"
X	cmd_to_list = "lsdev -C -c scanner"
X	cmd_to_list_postfix = ""
X	multi_select = ""
X	value_index = 0
X	disp_values = ""
X	values_msg_file = ""
X	values_msg_set = 0
X	values_msg_id = 0
X	aix_values = ""
X	help_msg_id = ""
X	help_msg_loc = ""
X
Xsm_cmd_opt:
X	id_seq_num = "0"
X	id = "scanner_predef_opt"
X	disc_field_name = ""
X	name = "Scanner Type"
X	name_msg_file = "scanner.cat"
X	name_msg_set = 4
X	name_msg_id = 2
X	op_type = "l"
X	entry_type = "t"
X	entry_size = 0
X	required = "y"
X	prefix = ""
X	cmd_to_list_mode = "a"
X	cmd_to_list = "lsdev -P -c scanner -F \"type subclass description\""
X	cmd_to_list_postfix = ""
X	multi_select = ""
X	value_index = 0
X	disp_values = ""
X	values_msg_file = ""
X	values_msg_set = 0
X	values_msg_id = 0
X	aix_values = ""
X	help_msg_id = ""
X	help_msg_loc = ""
X
Xsm_cmd_opt:
X	id_seq_num = "0"
X	id = "makscan_parent_opt"
X	disc_field_name = ""
X	name = "Parent Adapter "
X	name_msg_file = "scanner.cat"
X	name_msg_set = 4
X	name_msg_id = 10
X	op_type = "l"
X	entry_type = "t"
X	entry_size = 0
X	required = "y"
X	prefix = ""
X	cmd_to_list_mode = "1"
X	cmd_to_list = "lsparent -C "
X	cmd_to_list_postfix = "-k subclass"
X	multi_select = ""
X	value_index = 0
X	disp_values = ""
X	values_msg_file = ""
X	values_msg_set = 0
X	values_msg_id = 0
X	aix_values = ""
X	help_msg_id = ""
X	help_msg_loc = ""
X
Xsm_cmd_opt:
X	id_seq_num = "001"
X	id = "scan_add"
X	disc_field_name = "type"
X	name = "Scanner Type"
X	name_msg_file = "scanner.cat"
X	name_msg_set = 27
X	name_msg_id = 708
X	op_type = "n"
X	entry_type = "n"
X	entry_size = 0
X	required = "y"
X	prefix = "-t "
X	cmd_to_list_mode = ""
X	cmd_to_list = ""
X	cmd_to_list_postfix = ""
X	multi_select = ""
X	value_index = 0
X	disp_values = ""
X	values_msg_file = ""
X	values_msg_set = 0
X	values_msg_id = 0
X	aix_values = ""
X	help_msg_id = ""
X	help_msg_loc = ""
X
Xsm_cmd_opt:
X	id_seq_num = "002"
X	id = "scan_add"
X	disc_field_name = "subclass"
X	name = "Scanner interface"
X	name_msg_file = "scanner.cat"
X	name_msg_set = 3
X	name_msg_id = 3
X	op_type = ""
X	entry_type = "n"
X	entry_size = 0
X	required = "y"
X	prefix = "-s "
X	cmd_to_list_mode = ""
X	cmd_to_list = ""
X	cmd_to_list_postfix = ""
X	multi_select = ""
X	value_index = 0
X	disp_values = ""
X	values_msg_file = ""
X	values_msg_set = 0
X	values_msg_id = 0
X	aix_values = ""
X	help_msg_id = ""
X	help_msg_loc = ""
X
Xsm_cmd_opt:
X	id_seq_num = "003"
X	id = "scan_add"
X	disc_field_name = "desc"
X	name = "Description"
X	name_msg_file = "scanner.cat"
X	name_msg_set = 3
X	name_msg_id = 4
X	op_type = ""
X	entry_type = "n"
X	entry_size = 0
X	required = "n"
X	prefix = ""
X	cmd_to_list_mode = ""
X	cmd_to_list = ""
X	cmd_to_list_postfix = ""
X	multi_select = ""
X	value_index = 0
X	disp_values = ""
X	values_msg_file = ""
X	values_msg_set = 0
X	values_msg_id = 0
X	aix_values = ""
X	help_msg_id = ""
X	help_msg_loc = ""
X
Xsm_cmd_opt:
X	id_seq_num = "004"
X	id = "scan_add"
X	disc_field_name = "parent"
X	name = "Parent adapter"
X	name_msg_file = "scanner.cat"
X	name_msg_set = 3
X	name_msg_id = 7
X	op_type = ""
X	entry_type = "n"
X	entry_size = 0
X	required = "y"
X	prefix = "-p "
X	cmd_to_list_mode = ""
X	cmd_to_list = ""
X	cmd_to_list_postfix = ""
X	multi_select = ""
X	value_index = 0
X	disp_values = ""
X	values_msg_file = ""
X	values_msg_set = 0
X	values_msg_id = 0
X	aix_values = ""
X	help_msg_id = ""
X	help_msg_loc = ""
X
Xsm_cmd_opt:
X	id_seq_num = "005"
X	id = "scan_add"
X	disc_field_name = "connection"
X	name = "CONNECTION address"
X	name_msg_file = "scanner.cat"
X	name_msg_set = 27
X	name_msg_id = 513
X	op_type = "l"
X	entry_type = "t"
X	entry_size = 0
X	required = "+"
X	prefix = "-w "
X	cmd_to_list_mode = "1"
X	cmd_to_list = "lsconn "
X	cmd_to_list_postfix = "-p parent -k subclass"
X	multi_select = ""
X	value_index = 0
X	disp_values = ""
X	values_msg_file = ""
X	values_msg_set = 0
X	values_msg_id = 0
X	aix_values = ""
X	help_msg_id = ""
X	help_msg_loc = ""
X
Xsm_cmd_opt:
X	id_seq_num = "001"
X	id = "scan_chg"
X	disc_field_name = "logicname"
X	name = "Scanner"
X	name_msg_file = "scanner.cat"
X	name_msg_set = 3
X	name_msg_id = 1
X	op_type = ""
X	entry_type = "n"
X	entry_size = 0
X	required = "y"
X	prefix = "-l "
X	cmd_to_list_mode = ""
X	cmd_to_list = ""
X	cmd_to_list_postfix = ""
X	multi_select = ""
X	value_index = 0
X	disp_values = ""
X	values_msg_file = ""
X	values_msg_set = 0
X	values_msg_id = 0
X	aix_values = ""
X	help_msg_id = ""
X	help_msg_loc = ""
X
Xsm_cmd_opt:
X	id_seq_num = "002"
X	id = "scan_chg"
X	disc_field_name = "type"
X	name = "Scanner Type"
X	name_msg_file = "scanner.cat"
X	name_msg_set = 3
X	name_msg_id = 2
X	op_type = ""
X	entry_type = "n"
X	entry_size = 0
X	required = "n"
X	prefix = "-t "
X	cmd_to_list_mode = ""
X	cmd_to_list = ""
X	cmd_to_list_postfix = ""
X	multi_select = ""
X	value_index = 0
X	disp_values = ""
X	values_msg_file = ""
X	values_msg_set = 0
X	values_msg_id = 0
X	aix_values = ""
X	help_msg_id = ""
X	help_msg_loc = ""
X
Xsm_cmd_opt:
X	id_seq_num = "003"
X	id = "scan_chg"
X	disc_field_name = "subclass"
X	name = "Scanner interface"
X	name_msg_file = "scanner.cat"
X	name_msg_set = 3
X	name_msg_id = 3
X	op_type = ""
X	entry_type = "n"
X	entry_size = 0
X	required = "n"
X	prefix = "-s "
X	cmd_to_list_mode = ""
X	cmd_to_list = ""
X	cmd_to_list_postfix = ""
X	multi_select = ""
X	value_index = 0
X	disp_values = ""
X	values_msg_file = ""
X	values_msg_set = 0
X	values_msg_id = 0
X	aix_values = ""
X	help_msg_id = ""
X	help_msg_loc = ""
X
Xsm_cmd_opt:
X	id_seq_num = "004"
X	id = "scan_chg"
X	disc_field_name = "desc"
X	name = "Description"
X	name_msg_file = "scanner.cat"
X	name_msg_set = 3
X	name_msg_id = 4
X	op_type = ""
X	entry_type = "n"
X	entry_size = 0
X	required = "n"
X	prefix = ""
X	cmd_to_list_mode = ""
X	cmd_to_list = ""
X	cmd_to_list_postfix = ""
X	multi_select = ""
X	value_index = 0
X	disp_values = ""
X	values_msg_file = ""
X	values_msg_set = 0
X	values_msg_id = 0
X	aix_values = ""
X	help_msg_id = ""
X	help_msg_loc = ""
X
Xsm_cmd_opt:
X	id_seq_num = "005"
X	id = "scan_chg"
X	disc_field_name = "state"
X	name = "Status"
X	name_msg_file = "scanner.cat"
X	name_msg_set = 3
X	name_msg_id = 5
X	op_type = ""
X	entry_type = "n"
X	entry_size = 0
X	required = "n"
X	prefix = ""
X	cmd_to_list_mode = ""
X	cmd_to_list = ""
X	cmd_to_list_postfix = ""
X	multi_select = ""
X	value_index = 0
X	disp_values = ""
X	values_msg_file = ""
X	values_msg_set = 0
X	values_msg_id = 0
X	aix_values = ""
X	help_msg_id = ""
X	help_msg_loc = ""
X
Xsm_cmd_opt:
X	id_seq_num = "006"
X	id = "scan_chg"
X	disc_field_name = "loc"
X	name = "Location"
X	name_msg_file = "scanner.cat"
X	name_msg_set = 3
X	name_msg_id = 6
X	op_type = ""
X	entry_type = "n"
X	entry_size = 0
X	required = "n"
X	prefix = ""
X	cmd_to_list_mode = ""
X	cmd_to_list = ""
X	cmd_to_list_postfix = ""
X	multi_select = ""
X	value_index = 0
X	disp_values = ""
X	values_msg_file = ""
X	values_msg_set = 0
X	values_msg_id = 0
X	aix_values = ""
X	help_msg_id = ""
X	help_msg_loc = ""
X
Xsm_cmd_opt:
X	id_seq_num = "007"
X	id = "scan_chg"
X	disc_field_name = "parent"
X	name = "Parent adapter"
X	name_msg_file = "scanner.cat"
X	name_msg_set = 3
X	name_msg_id = 7
X	op_type = ""
X	entry_type = ""
X	entry_size = 0
X	required = "y"
X	prefix = "-p "
X	cmd_to_list_mode = ""
X	cmd_to_list = ""
X	cmd_to_list_postfix = ""
X	multi_select = ""
X	value_index = 0
X	disp_values = ""
X	values_msg_file = ""
X	values_msg_set = 0
X	values_msg_id = 0
X	aix_values = ""
X	help_msg_id = ""
X	help_msg_loc = ""
X
Xsm_cmd_opt:
X	id_seq_num = "008"
X	id = "scan_chg,scan_common"
X	disc_field_name = "port"
X	name = "Connection address"
X	name_msg_file = "scanner.cat"
X	name_msg_set = 3
X	name_msg_id = 8
X	op_type = ""
X	entry_type = "n"
X	entry_size = 0
X	required = "n"
X	prefix = ""
X	cmd_to_list_mode = ""
X	cmd_to_list = ""
X	cmd_to_list_postfix = ""
X	multi_select = ""
X	value_index = 0
X	disp_values = ""
X	values_msg_file = ""
X	values_msg_set = 0
X	values_msg_id = 0
X	aix_values = ""
X	help_msg_id = ""
X	help_msg_loc = ""
X
Xsm_cmd_opt:
X	id_seq_num = "001"
X	id = "scan_rmv"
X	disc_field_name = "logicname"
X	name = "Scanner"
X	name_msg_file = "scanner.cat"
X	name_msg_set = 0
X	name_msg_id = 0
X	op_type = ""
X	entry_type = ""
X	entry_size = 0
X	required = "y"
X	prefix = "-l "
X	cmd_to_list_mode = ""
X	cmd_to_list = ""
X	cmd_to_list_postfix = ""
X	multi_select = ""
X	value_index = 0
X	disp_values = ""
X	values_msg_file = ""
X	values_msg_set = 0
X	values_msg_id = 0
X	aix_values = ""
X	help_msg_id = ""
X	help_msg_loc = ""
X
Xsm_cmd_opt:
X	id_seq_num = "002"
X	id = "scan_rmv"
X	disc_field_name = ""
X	name = "KEEP definition in database"
X	name_msg_file = "scanner.cat"
X	name_msg_set = 0
X	name_msg_id = 0
X	op_type = "r"
X	entry_type = "n"
X	entry_size = 0
X	required = "n"
X	prefix = " "
X	cmd_to_list_mode = ""
X	cmd_to_list = ""
X	cmd_to_list_postfix = ""
X	multi_select = ""
X	value_index = 0
X	disp_values = "yes,no"
X	values_msg_file = "scanner.cat"
X	values_msg_set = 0
X	values_msg_id = 0
X	aix_values = ",-d "
X	help_msg_id = ""
X	help_msg_loc = ""
X
Xsm_cmd_opt:
X	id_seq_num = "001"
X	id = "scan_cfg"
X	disc_field_name = "logicname"
X	name = "Scanner"
X	name_msg_file = "scanner.cat"
X	name_msg_set = 0
X	name_msg_id = 0
X	op_type = ""
X	entry_type = ""
X	entry_size = 0
X	required = "y"
X	prefix = "-l "
X	cmd_to_list_mode = ""
X	cmd_to_list = ""
X	cmd_to_list_postfix = ""
X	multi_select = ""
X	value_index = 0
X	disp_values = ""
X	values_msg_file = ""
X	values_msg_set = 0
X	values_msg_id = 0
X	aix_values = ""
X	help_msg_id = ""
X	help_msg_loc = ""
X
Xsm_cmd_opt:
X	id_seq_num = "010"
X	id = "scan_common"
X	disc_field_name = "window_width"
X	name = "scan area width in 1/1200ths of an inch"
X	name_msg_file = "scanner.cat"
X	name_msg_set = 1
X	name_msg_id = 1
X	op_type = "l"
X	entry_type = "#"
X	entry_size = 0
X	required = ""
X	prefix = "-a window_width="
X	cmd_to_list_mode = "r"
X	cmd_to_list = "lsattr -c scanner -a window_width -R"
X	cmd_to_list_postfix = "-s subclass -t type"
X	multi_select = ""
X	value_index = 0
X	disp_values = ""
X	values_msg_file = ""
X	values_msg_set = 0
X	values_msg_id = 0
X	aix_values = ""
X	help_msg_id = ""
X	help_msg_loc = ""
X
Xsm_cmd_opt:
X	id_seq_num = "011"
X	id = "scan_common"
X	disc_field_name = "window_length"
X	name = "scan area length in 1/1200ths of an inch"
X	name_msg_file = "scanner.cat"
X	name_msg_set = 1
X	name_msg_id = 2
X	op_type = "l"
X	entry_type = "#"
X	entry_size = 0
X	required = ""
X	prefix = "-a window_length="
X	cmd_to_list_mode = "r"
X	cmd_to_list = "lsattr -c scanner -a window_length -R"
X	cmd_to_list_postfix = "-s subclass -t type"
X	multi_select = ""
X	value_index = 0
X	disp_values = ""
X	values_msg_file = ""
X	values_msg_set = 0
X	values_msg_id = 0
X	aix_values = ""
X	help_msg_id = ""
X	help_msg_loc = ""
X
Xsm_cmd_opt:
X	id_seq_num = "012"
X	id = "scan_resolution_as_range"
X	disc_field_name = "x_resolution"
X	name = "horizontal resolution in dots-per-inch"
X	name_msg_file = "scanner.cat"
X	name_msg_set = 1
X	name_msg_id = 3
X	op_type = "l"
X	entry_type = "#"
X	entry_size = 0
X	required = ""
X	prefix = "-a x_resolution="
X	cmd_to_list_mode = "r"
X	cmd_to_list = "lsattr -c scanner -a x_resolution -R"
X	cmd_to_list_postfix = "-s subclass -t type"
X	multi_select = ""
X	value_index = 0
X	disp_values = ""
X	values_msg_file = ""
X	values_msg_set = 0
X	values_msg_id = 0
X	aix_values = ""
X	help_msg_id = ""
X	help_msg_loc = ""
X
Xsm_cmd_opt:
X	id_seq_num = "012"
X	id = "scan_resolution_as_list"
X	disc_field_name = "x_resolution"
X	name = "horizontal resolution in dots-per-inch"
X	name_msg_file = "scanner.cat"
X	name_msg_set = 1
X	name_msg_id = 3
X	op_type = "lr"
X	entry_type = "#"
X	entry_size = 0
X	required = ""
X	prefix = "-a x_resolution="
X	cmd_to_list_mode = "a"
X	cmd_to_list = "lsattr -c scanner -a x_resolution -R"
X	cmd_to_list_postfix = "-s subclass -t type"
X	multi_select = ""
X	value_index = 0
X	disp_values = ""
X	values_msg_file = ""
X	values_msg_set = 0
X	values_msg_id = 0
X	aix_values = ""
X	help_msg_id = ""
X	help_msg_loc = ""
X
Xsm_cmd_opt:
X	id_seq_num = "013"
X	id = "scan_resolution_as_range"
X	disc_field_name = "y_resolution"
X	name = "vertical resolution in dots-per-inch"
X	name_msg_file = "scanner.cat"
X	name_msg_set = 1
X	name_msg_id = 4
X	op_type = "l"
X	entry_type = "#"
X	entry_size = 0
X	required = ""
X	prefix = "-a y_resolution="
X	cmd_to_list_mode = "r"
X	cmd_to_list = "lsattr -c scanner -a y_resolution -R"
X	cmd_to_list_postfix = "-s subclass -t type"
X	multi_select = ""
X	value_index = 0
X	disp_values = ""
X	values_msg_file = ""
X	values_msg_set = 0
X	values_msg_id = 0
X	aix_values = ""
X	help_msg_id = ""
X	help_msg_loc = ""
X
Xsm_cmd_opt:
X	id_seq_num = "013"
X	id = "scan_resolution_as_list"
X	disc_field_name = "y_resolution"
X	name = "vertical resolution in dots-per-inch"
X	name_msg_file = "scanner.cat"
X	name_msg_set = 1
X	name_msg_id = 4
X	op_type = "lr"
X	entry_type = "#"
X	entry_size = 0
X	required = ""
X	prefix = "-a y_resolution="
X	cmd_to_list_mode = "a"
X	cmd_to_list = "lsattr -c scanner -a y_resolution -R"
X	cmd_to_list_postfix = "-s subclass -t type"
X	multi_select = ""
X	value_index = 0
X	disp_values = ""
X	values_msg_file = ""
X	values_msg_set = 0
X	values_msg_id = 0
X	aix_values = ""
X	help_msg_id = ""
X	help_msg_loc = ""
X
Xsm_cmd_opt:
X	id_seq_num = "014"
X	id = "scan_common"
X	disc_field_name = "x_origin"
X	name = "upper left corner x in 1/1200ths of an inch"
X	name_msg_file = "scanner.cat"
X	name_msg_set = 1
X	name_msg_id = 5
X	op_type = "l"
X	entry_type = "#"
X	entry_size = 0
X	required = ""
X	prefix = "-a x_origin="
X	cmd_to_list_mode = "r"
X	cmd_to_list = "lsattr -c scanner -a x_origin -R"
X	cmd_to_list_postfix = "-s subclass -t type"
X	multi_select = ""
X	value_index = 0
X	disp_values = ""
X	values_msg_file = ""
X	values_msg_set = 0
X	values_msg_id = 0
X	aix_values = ""
X	help_msg_id = ""
X	help_msg_loc = ""
X
Xsm_cmd_opt:
X	id_seq_num = "015"
X	id = "scan_common"
X	disc_field_name = "y_origin"
X	name = "upper left corner y in 1/1200ths of an inch"
X	name_msg_file = "scanner.cat"
X	name_msg_set = 1
X	name_msg_id = 6
X	op_type = "l"
X	entry_type = "#"
X	entry_size = 0
X	required = ""
X	prefix = "-a y_origin="
X	cmd_to_list_mode = "r"
X	cmd_to_list = "lsattr -c scanner -a y_origin -R"
X	cmd_to_list_postfix = "-s subclass -t type"
X	multi_select = ""
X	value_index = 0
X	disp_values = ""
X	values_msg_file = ""
X	values_msg_set = 0
X	values_msg_id = 0
X	aix_values = ""
X	help_msg_id = ""
X	help_msg_loc = ""
X
Xsm_cmd_opt:
X	id_seq_num = "016"
X	id = "scan_common"
X	disc_field_name = "image_mode"
X	name = "type of image data sent by scanner"
X	name_msg_file = "scanner.cat"
X	name_msg_set = 1
X	name_msg_id = 7
X	op_type = "l"
X	entry_type = "t"
X	entry_size = 0
X	required = ""
X	prefix = "-a image_mode="
X	cmd_to_list_mode = "a"
X	cmd_to_list = "lsattr -c scanner -a image_mode -R"
X	cmd_to_list_postfix = "-s subclass -t type"
X	multi_select = ""
X	value_index = 0
X	disp_values = ""
X	values_msg_file = ""
X	values_msg_set = 0
X	values_msg_id = 0
X	aix_values = ""
X	help_msg_id = ""
X	help_msg_loc = ""
X
Xsm_cmd_opt:
X	id_seq_num = "017"
X	id = "scan_common_ricoh_is410"
X	disc_field_name = "brightness"
X	name = "image data brightness"
X	name_msg_file = "scanner.cat"
X	name_msg_set = 1
X	name_msg_id = 8
X	op_type = "l"
X	entry_type = "#"
X	entry_size = 0
X	required = ""
X	prefix = "-a brightness="
X	cmd_to_list_mode = "r"
X	cmd_to_list = "lsattr -c scanner -a brightness -R"
X	cmd_to_list_postfix = "-s subclass -t type"
X	multi_select = ""
X	value_index = 0
X	disp_values = ""
X	values_msg_file = ""
X	values_msg_set = 0
X	values_msg_id = 0
X	aix_values = ""
X	help_msg_id = ""
X	help_msg_loc = ""
X
Xsm_cmd_opt:
X	id_seq_num = "018"
X	id = "scan_common_ricoh_is410"
X	disc_field_name = "contrast"
X	name = "image data contrast"
X	name_msg_file = "scanner.cat"
X	name_msg_set = 1
X	name_msg_id = 9
X	op_type = "l"
X	entry_type = "#"
X	entry_size = 0
X	required = ""
X	prefix = "-a contrast="
X	cmd_to_list_mode = "r"
X	cmd_to_list = "lsattr -c scanner -a contrast -R"
X	cmd_to_list_postfix = "-s subclass -t type"
X	multi_select = ""
X	value_index = 0
X	disp_values = ""
X	values_msg_file = ""
X	values_msg_set = 0
X	values_msg_id = 0
X	aix_values = ""
X	help_msg_id = ""
X	help_msg_loc = ""
X
X*sm_cmd_opt:
X*	id_seq_num = "019"
X*	id = "scan_common_ricoh_is410"
X*	disc_field_name = "use_adf"
X*	name = "use Automatic Document Feeder"
X*	name_msg_file = "scanner.cat"
X*	name_msg_set = 1
X*	name_msg_id = 10
X*	op_type = "r"
X*	entry_type = ""
X*	entry_size = 0
X*	required = ""
X*	prefix = "-a use_adf="
X*	cmd_to_list_mode = ""
X*	cmd_to_list = ""
X*	cmd_to_list_postfix = ""
X*	multi_select = "n"
X*	value_index = 0
X*	disp_values = "yes,no"
X*	values_msg_file = ""
X*	values_msg_set = 0
X*	values_msg_id = 0
X*	aix_values = "yes,no"
X*	help_msg_id = ""
X*	help_msg_loc = ""
END_OF_FILE
if test 17228 -ne `wc -c <'pint/ibm/sm_cmd_opt.add'`; then
    echo shar: \"'pint/ibm/sm_cmd_opt.add'\" unpacked with wrong size!
fi
# end of 'pint/ibm/sm_cmd_opt.add'
fi
if test -f 'pint/sun/dist/+install/install_unbundled' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'pint/sun/dist/+install/install_unbundled'\"
else
echo shar: Extracting \"'pint/sun/dist/+install/install_unbundled'\" \(12586 characters\)
sed "s/^X//" >'pint/sun/dist/+install/install_unbundled' <<'END_OF_FILE'
X#!/bin/sh
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# install_unbundled: what "extract_unbundled" runs
X#
X
XPATH=.:/usr/ucb:/bin:/usr/bin:/etc:/usr/etc
Xexport PATH
XWORK_PATH=/usr/tmp/unbundled
XANS=""
XDEVICE_VAL=0
X
Xif [ -d /usr/sys/sun4c ]
Xthen
X    MACHINE_DIR="/usr/sys/sun4c"
Xelse
X    if [ -d /usr/sys/sun4m ]
X    then
X	MACHINE_DIR="/usr/sys/sun4m"
X    else
X	echo "error: can't determine machine type"
X	exit 1
X    fi
Xfi
X
XCONF_DIR=$MACHINE_DIR/conf
X
XCONF_FILE="/usr/sys/sun/conf"    # devsw/inode configuration file
XFILES_ENTRY="scsi/targets/scan.c             optional scan scsibus"
X
Xclear
X
X# Tell the user what this script is
Xecho "    Scanner Driver installation script"
Xecho
X
X# Remind user that they must be root to build new kernel and install driver.
X
Xecho "REMEMBER you must be root or have super-user permission in order that"
Xecho "         this product will install correctly. If any errors occur    "
Xecho "         while building the new kernel DO NOT install it until they  "
Xecho "         have been resolved.                                         "
Xecho
Xecho "This script will try and build a kernel automatically for you but may"
Xecho "fail. If the script fails or any errors occur during the build you   "
Xecho "will have to install the driver manually. See the STREAMS device     "
Xecho "driver manual for more detail on how to do this.                     "
Xecho
Xecho "The script will also make copies of some system files while it is    "
Xecho "running.  Backups of these files will be have '.orig' added to their "
Xecho "names.  To be completely safe, you may wish to make your own backups "
Xecho "too."
Xecho "The files effected are: "
Xecho "/usr/sys/sun/conf.c     $CONF_DIR/files"
Xecho
XANS=m
Xwhile [ "$ANS" != "y" -a "$ANS" != "n" ]
Xdo
X    echo -n "Do you wish to continue (y/n)? "
X    read ANS
X
X    case $ANS in
X    y|Y|yes|YES)
X	ANS=y
X    ;;
X    n|N|no|NO)
X	ANS=n
X    ;;		
X    esac
Xdone
Xif [ ! $ANS = "y" ]
Xthen
X    echo "installation terminated"
X    rm -r /usr/tmp/unbundled
X    exit 1
Xfi
X
X# prompt user for SCSI ID
X
Xwhile [ "$SCSI_ID" = "" ] 
Xdo
X    echo 
X    echo -n "Enter the SCSI ID of this device (default 5) : "
X    read SCSI_ID
X    SCSI_ID=${SCSI_ID:-5}
X    case  "$SCSI_ID" in
X	0|2|5)
X	    continue
X	;;
X
X	3|1)
X	    echo "This ID is usually reserved by the Sun disk drive units" 
X	    ANS=m
X	    while [ "$ANS" != "y" -a "$ANS" != "n" ]
X	    do
X	        echo -n "Are you sure you wish to use this ID (y/n)? "
X		read ANS
X		case $ANS in
X		y|Y|yes|YES)
X		    ANS=y
X		;;
X		n|N|no|NO)
X		    ANS=n
X		;;		
X		esac
X	    done
X	    if [ $ANS = 'y' ]
X	    then
X	    	echo "Using "$SCSI_ID
X	    else
X	    	echo "Please try another ID"
X		SCSI_ID=""
X	    fi
X	;;
X
X	4)
X	    echo "This ID is usually reserved by the Sun tape drive units"
X	    ANS=m
X	    while [ "$ANS" != "y" -a "$ANS" != "n" ]
X	    do
X	    	echo -n "Are you sure you wish to use this ID (y/n)? "
X		read ANS
X		case $ANS in
X		y|Y|yes|YES)
X		    ANS=y
X		;;
X		n|N|no|NO)
X		    ANS=n
X		;;		
X		esac
X	    done
X	    if [ $ANS = 'y' ]
X	    then
X	    	echo "Using "$SCSI_ID
X	    else
X	    	echo "Please try another ID"
X		SCSI_ID=""
X	    fi
X	;;
X
X	6)
X	    echo "This ID is usually reserved by the Sun CD-ROM pack."
X	    ANS=m
X	    while [ "$ANS" != "y" -a "$ANS" != "n" ]
X	    do
X	    	echo -n "Are you sure you wish to use this ID (y/n)? "
X		read ANS
X		case $ANS in
X		y|Y|yes|YES)
X		    ANS=y
X		;;
X		n|N|no|NO)
X		    ANS=n
X		;;		
X		esac
X	    done
X	    if [ ANS = 'y' ]
X	    then
X	    	echo "Using "$SCSI_ID
X	    else
X	    	echo "Please try another ID"
X		SCSI_ID=""
X	    fi
X	;;
X
X	*)
X	    echo $SCSI_ID "is not a valid SCSI ID"
X	    SCSI_ID=""
X	;;
X    esac
Xdone
X
X# Move scan.o to OBJ directory.
X
Xecho
Xecho "Moving object files."
Xcp OBJ/scan.o $MACHINE_DIR/OBJ
Xif [ $? != 0 ]
Xthen
X    echo failed to install object files in $MACHINE_DIR/OBJ
X    rm -r /usr/tmp/unbundled
X    exit 1
Xfi
X
Xecho
Xecho installing system header file \"scanio.h\" in /usr/include/sys
Xcp scanio.h /usr/include/sys
X
XDRIVER_LINE="device scan0 at scsibus0 target $SCSI_ID lun 0   # scanner device"
X
Xecho
Xecho "install needs to know the name of the currently running kernel. You"
Xecho "can find this out by looking in /etc/motd or /usr/adm/messages or"
Xecho "by rebooting the machine and viewing the startup messages."
Xecho "Look for a message similar to:"
Xecho "'SunOS Release 4.1.3 (GENERIC) #1: Thu Oct 11 10:48:40 PDT 1993'"
Xecho "The name given in between the parentheses e.g. GENERIC is the name"
Xecho "you should give in the following question. Please remember to type the"
Xecho "name in capital letters just like you see it."
Xecho
Xecho "What is the configuration name of the currently running kernel"
Xecho -n "(default is GENERIC) ? "
Xread KERNEL
XKERNEL=${KERNEL:-"GENERIC"}
X
Xecho
Xecho "Enter a name for the new kernel once it has been built"
Xecho -n "(default is SCANNER) ? "
Xread NEW_KER
XNEW_KER=${NEW_KER:-"SCANNER"}
X
Xecho
Xecho "Reflecting configuration change"
X
XSEARCH="scsibus0 target $SCSI_ID "
X
X# See if driver has already been installed
Xaltline $CONF_DIR/$KERNEL NULL "device scan0" NULL t
XRET_VAL=$?
Xif [ $RET_VAL = 2 ]
Xthen
X    echo "Fatal: Cannot configure system."
X    rm -r /usr/tmp/unbundled
X    exit 1
Xfi
X
Xif [ $RET_VAL = 1 ]
Xthen
X    echo
X    echo "The configuration file $CONF_DIR/$KERNEL already contains an"
X    echo "entry for the IceScan driver."
X    echo "Install can assume that the current entry for the scanner is already"
X    echo "correct.  If this is so then installation will continue.  If not"
X    echo "then you must remove the entry from $CONF_DIR/$KERNEL and restart"
X    echo "the installation."
X    echo
X    ANS=m
X    while [ "$ANS" != "y" -a "$ANS" != "n" ]
X    do
X	echo -n "Is it safe to assume this entry is correct (y/n)?"
X	read ANS
X	case $ANS in
X	y|Y|yes|YES)
X	    ANS=y
X	;;
X	n|N|no|NO)
X	    ANS=n
X	;;		
X	esac
X    done
X    if [ ! $ANS = "y" ]
X    then
X        echo
X        echo "Please remove the bad entry from $CONF_DIR/$KERNEL and restart"
X	rm -r /usr/tmp/unbundled
X        exit 1
X    fi
X    echo
X    echo "Continuing installation using existing entry"
X    cp $CONF_DIR/$KERNEL $CONF_DIR/$NEW_KER
Xelse
X    altline $CONF_DIR/$KERNEL $CONF_DIR/$NEW_KER "$SEARCH" "$DRIVER_LINE" c
Xfi
X
Xif [ ! $? = 0 ]
Xthen
X    echo "Error creating new config file"
X    rm -r /usr/tmp/unbundled
X    exit 1
Xfi
X
X# Backup old version of files to files.orig
Xecho
Xecho "$CONF_DIR/files will be copied to $CONF_DIR/files.orig"
XANS=m
Xwhile [ "$ANS" != "y" -a "$ANS" != "n" ]
Xdo
X    echo -n "Is this OK (y/n)? "
X    read ANS
X    case $ANS in
X    y|Y|yes|YES)
X	ANS=y
X    ;;
X    n|N|no|NO)
X	ANS=n
X    ;;		
X    esac
Xdone
Xif [ ! $ANS = "y" ]
Xthen
X    echo "Please make sure the current files data can be backed up and restart"
X    rm -r /usr/tmp/unbundled
X    exit 1
Xfi
X
Xcp $CONF_DIR/files $CONF_DIR/files.orig
Xif [ ! $? = 0 ]
Xthen
X    echo "Fatal: Couldn't backup files to files.orig"
X    rm -r /usr/tmp/unbundled
X    exit 1
Xfi
X
X# Now add object file line to files.	
Xaltline "$CONF_DIR/files" NULL "../OBJ/scan.o" NULL t
Xif [ $? = 1 ]
Xthen
X    echo
X    echo "The configuration file $CONF_DIR/files already contains an entry"
X    echo "for the scanner driver."
X    echo "Install can assume that the current entry for the driver is already"
X    echo "correct."
X    echo "If this is so then installation will continue. If not then you must"
X    echo "remove the entry from $CONF_DIR/files before continuing."
X    echo
X    ANS=m
X    while [ "$ANS" != "y" -a "$ANS" != "n" ]
X    do
X	echo -n "Is it safe to assume this entry is correct (y/n)?"
X	read ANS
X	case $ANS in
X	y|Y|yes|YES)
X	    ANS=y
X	;;
X	n|N|no|NO)
X	    ANS=n
X	;;
X	esac
X    done
X    if [ ! $ANS = "y" ]
X    then
X        echo "Please remove the bad entry from $CONF_DIR/files and restart"
X	rm -r /usr/tmp/unbundled
X        exit 1
X    fi
X    echo "Continuing installation using existing entry"
Xelse
X    altline "$CONF_DIR/files" "$CONF_DIR/files.xxx" "scsi/targets/st.c" "$FILES_ENTRY" a
X    if [ ! $? = 0 ]
X    then
X        echo "Fatal: Couldn't make new configuration in $CONF_DIR/files.xxx"
X	rm -r /usr/tmp/unbundled
X        exit 1
X    fi
X    mv $CONF_DIR/files.xxx $CONF_DIR/files
X    if [ ! $? = 0 ]
X    then
X        echo "Fatal: Couldn't overwrite $CONF_DIR/files with new config"
X	rm -r /usr/tmp/unbundled
X        exit 1
X    fi
Xfi
X
X# Copy /usr/sys/sun/conf.c to conf.c.orig
Xecho
Xecho "Copying /usr/sys/sun/conf.c to conf.c.orig"
XANS=m
Xwhile [ "$ANS" != "y" -a "$ANS" != "n" ]
Xdo
X    echo -n "Is this OK (y/n)? "
X    read ANS
X    case $ANS in
X    y|Y|yes|YES)
X    	ANS=y
X    ;;
X    n|N|no|NO)
X    	ANS=n
X    ;;
X    esac
Xdone
Xif [ ! $ANS = "y" ]
Xthen
X    echo "Exiting without moving /usr/sys/sun/conf.c to conf.c.orig"
X    rm -r /usr/tmp/unbundled
X    exit 1
Xfi
X
Xcp $CONF_FILE.c $CONF_FILE.c.orig
Xif [ ! $? = 0 ]
Xthen
X    echo "Fatal: Couldn't copy /usr/sys/sun/conf.c to conf.c.orig"
X    rm -r /usr/tmp/unbundled
X    exit 1
Xfi
X
X# see if scanner driver is already present
X
Xaltline "$CONF_FILE.c" NULL "scanopen" NULL t
Xif [ $? = 1 ]
Xthen
X    echo
X    echo "The configuration file $CONF_FILE.c already contains an entry"
X    echo "for the scanner driver."
X    echo "Install can assume that the current entry is already correct."
X    echo "If this is so then installation will continue. If not then you must"
X    echo "remove the entry from $CONF_FILE.c and restart installation."
X    echo
X    ANS=m
X    while [ "$ANS" != "y" -a "$ANS" != "n" ]
X    do
X    	echo -n "Is it safe to assume this entry is correct (y/n)?"
X	read ANS
X	case $ANS in
X	y|Y|yes|YES)
X    	    ANS=y
X	;;
X	n|N|no|NO)
X    	    ANS=n
X	;;
X	esac
X    done
X    if [ ! $ANS = "y" ]
X    then
X        echo "Please remove the bad entry from $CONF_FILE.c and restart"
X	rm -r /usr/tmp/unbundled
X        exit 1
X    fi
X    echo "Continuing installation using existing entry"
X    confmod $CONF_FILE.c NULL t
Xelse
X    echo "adding scanner driver info to $CONF_FILE.c"
X    confmod $CONF_FILE.c $CONF_FILE.xxx a
Xfi
X
XRET_VAL=$?
X
Xif [ $RET_VAL = 0 ]
Xthen
X    echo "Couldn't alter $CONF_FILE.c"
X    rm -r /usr/tmp/unbundled
X    exit 1
Xfi
X
Xif [ -f $CONF_FILE.xxx ]
Xthen
X    mv $CONF_FILE.xxx $CONF_FILE.c
X    chmod 444 $CONF_FILE.c
Xfi
X
Xecho ""
Xecho "Making device special file /dev/scan0.  Major is $RET_VAL Minor is 0"
X
X# Make special files corresponding to returned value of confmod
Xif [ -c /dev/scan0 ]
Xthen
X    echo
X    echo "The device special file /dev/scan0 already exists."
X    echo "Install will re-create it from scratch."
X    ANS=m
X    while [ "$ANS" != "y" -a "$ANS" != "n" ]
X    do
X    	echo -n "Is this ok (y/n)? "
X	read ANS
X	case $ANS in
X	y|Y|yes|YES)
X	    ANS=y
X	;;
X	n|N|no|NO)
X	    ANS=n
X	;;
X	esac
X    done
X    if [ $ANS != "y" ]
X    then
X	echo "/dev/scan0 must have the correct major number to function."
X	rm -r /usr/tmp/unbundled
X	exit 1
X    fi
X    rm -f /dev/scan0
Xfi
X
Xmknod /dev/scan0 c $RET_VAL 0
X
Xif [ ! $? = 0 ]
Xthen
X    echo "Fatal: couldn't make device special file /dev/scan0, mknod failed"
X    rm -r /usr/tmp/unbundled
X    exit 1
Xfi
X
Xchmod 444 /dev/scan0
X
Xecho
Xecho "Making new kernel files via 'config $NEW_KER'."
Xcd $CONF_DIR
Xconfig $NEW_KER
Xif [ ! $? = 0 ]
Xthen
X    echo "Error creating new kernel files"
X    rm -r /usr/tmp/unbundled
X    exit 1
Xfi
X
Xecho building vmunix from new kernel files.
X
Xcd ../$NEW_KER
Xmake
Xif [ $? = 0 ]
Xthen
X    echo
X    echo "The new kernel has been built successfully."
X    echo "In order to make the changes active you must copy the new kernel"
X    echo "in $MACHINE_DIR/$NEW_KER/vmunix to /vmunix"
X    echo "and then reboot."
X    echo
X    echo "It is always wise to backup /vmunix to /vmunix.old before doing so."
Xelse
X    echo
X    echo "The kernel build did not complete successfully. You must either"
X    echo "fix the problem and restart, or build the kernel manually."
X    rm -r /usr/tmp/unbundled
X    exit 1
Xfi
X
Xecho
Xecho "Installation completed."
Xrm -r /usr/tmp/unbundled
END_OF_FILE
if test 12586 -ne `wc -c <'pint/sun/dist/+install/install_unbundled'`; then
    echo shar: \"'pint/sun/dist/+install/install_unbundled'\" unpacked with wrong size!
fi
chmod +x 'pint/sun/dist/+install/install_unbundled'
# end of 'pint/sun/dist/+install/install_unbundled'
fi
echo shar: End of archive 3 \(of 7\).
cp /dev/null ark3isdone
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
