[comp.sources.misc] v13i120: lj2ps 1.2

lishka@uwslh.slh.wisc.edu (Chris Lishka (hang loose...) ) (07/10/90)

Posting-number: Volume 13, Issue 120
Submitted-by: lishka@uwslh.slh.wisc.edu (Chris Lishka (hang loose...) )
Archive-name: lj2ps-1.2/part12

---- Cut Here and unpack ----
#!/bin/sh
# this is lj2ps.12 (part 12 of a multipart archive)
# do not concatenate these parts, unpack them in order with /bin/sh
# file ljcmds.c continued
#
if touch 2>&1 | fgrep '[-amc]' > /dev/null
 then TOUCH=touch
 else TOUCH=true
fi
if test ! -r @shar_seq_.tmp; then
	echo "Please unpack part 1 first!"
	exit 1
fi
(read Scheck
 if test "$Scheck" != 12; then
	echo "Please unpack part $Scheck next!"
	exit 1
 else
	exit 0
 fi
) < @shar_seq_.tmp || exit 1
echo "x - Continuing file ljcmds.c"
sed 's/^X//' << 'SHAR_EOF' >> ljcmds.c &&
X    if( (scan() == 0) && (curr_token.code == PARAM_CONTINUE) ){
X      error("end-of-file reached while reading parameters", variable);
X    }
X#ifdef DEBUG
X    if( debug ) fprintf(stderr, "{TOKEN:%d}", curr_token.code);
X#endif
X    switch( curr_token.code ){
X    case PARAM_CONTINUE:
X      break;
X    case PARAM_END:
X      break;
X    default:
X      internal_error("illegal token encountered in parameters", "");
X    } /* switch(...) */
X  } while( curr_token.code != PARAM_END );
X
X} /* ljcmd_star_c() */
X
X
X
Xvoid
Xljcmd_star_p(ifile, ofile)	/* Command: ^[*p device-dependent movement */
X     FILE *ifile, *ofile;
X{
X
X  do{
X      /* If EOF is reached, then flag an error and return */
X    if( (scan() == 0) && (curr_token.code == PARAM_CONTINUE) ){
X      error("end-of-file reached while reading parameters", variable);
X    }
X#ifdef DEBUG
X    if( debug ) fprintf(stderr, "{TOKEN:%d}", curr_token.code);
X#endif
X    switch( curr_token.code ){
X    case PARAM_CONTINUE:
X    case PARAM_END:
X      if( operation('X') ){	/* Move horizontally by dots*/
X	lj_text_end(ofile);
X	switch( pos_code ){
X	case POS_ABSOLUTE:	/* Absolute postioning */
X	  lj_cursor_hor_abs(ofile, dt2in(atof(number))); break;
X	case POS_REL_POSITIVE:	/* Relative positive */
X	  lj_cursor_hor_rel(ofile, dt2in(atof(number))); break;
X	case POS_REL_NEGATIVE:	/* Relative negative */
X	  lj_cursor_hor_rel(ofile, -(dt2in(atof(number)))); break;
X	default:
X	  internal_error("illegal positioning code", "");
X	}
X	lj_text_begin();
X      }
X      else if( operation('Y') ){ /* Move vertically by dots */
X	lj_text_end(ofile);
X	lj_undl_flush(ofile);
X	switch( pos_code ){
X	case POS_ABSOLUTE:	/* Absolute postioning */
X	  lj_cursor_ver_abs(ofile,
X			    page_height -
X			    (margin_top + dt2in(atof(number))));
X	  break;
X	case POS_REL_POSITIVE:	/* Relative positive */
X	  lj_cursor_ver_rel(ofile, dt2in(atof(number))); break;
X	case POS_REL_NEGATIVE:	/* Relative negative */
X	  lj_cursor_ver_rel(ofile, -(dt2in(atof(number)))); break;
X	default:
X	  internal_error("illegal positioning code", "");
X	}
X	lj_undl_mark(ofile);
X	lj_text_begin();
X      } /* else if( Y ) */
X      else{			/* Unknown command */
X	warning("unknown command with prefix <esc>*p -- ignoring", "");
X      }
X      break;
X    default:
X      internal_error("illegal token encountered in parameters", "");
X    } /* switch(...) */
X  } while( curr_token.code != PARAM_END );
X
X} /* ljcmd_star_p() */
X
X
X
Xvoid
Xljcmd_star_r(ifile, ofile)	/* Command: ^[*r start/end graphics */
X     FILE *ifile, *ofile;
X{
X
X  warning("command family <esc>*r is not implemented -- ignoring", "");
X
X  do{
X      /* Read the next token */
X      /* If EOF is reached, then flag an error and return */
X    if( (scan() == 0) && (curr_token.code == PARAM_CONTINUE) ){
X      error("end-of-file reached while reading parameters", variable);
X    }
X#ifdef DEBUG
X    if( debug ) fprintf(stderr, "{TOKEN:%d}", curr_token.code);
X#endif
X    switch( curr_token.code ){
X    case PARAM_CONTINUE:
X      break;
X    case PARAM_END:
X      break;
X    default:
X      internal_error("illegal token encountered in parameters", "");
X    } /* switch(...) */
X  } while( curr_token.code != PARAM_END );
X
X} /* ljcmd_star_r() */
X
X
Xvoid
Xljcmd_star_t(ifile, ofile)	/* Command: ^[*t graphics resolution */
X     FILE *ifile, *ofile;
X{
X
X  warning("command family <esc>*t is not implemented -- ignoring", "");
X
X  do{
X      /* Read the next token */
X      /* If EOF is reached, then flag an error and return */
X    if( (scan() == 0) && (curr_token.code == PARAM_CONTINUE) ){
X      error("end-of-file reached while reading parameters", variable);
X    }
X#ifdef DEBUG
X    if( debug ) fprintf(stderr, "{TOKEN:%d}", curr_token.code);
X#endif
X    switch( curr_token.code ){
X    case PARAM_CONTINUE:
X      break;
X    case PARAM_END:
X      break;
X    default:
X      internal_error("illegal token encountered in parameters", "");
X    } /* switch(...) */
X  } while( curr_token.code != PARAM_END );
X
X} /* ljcmd_star_t() */
SHAR_EOF
echo "File ljcmds.c is complete" &&
$TOUCH -am 0707112690 ljcmds.c &&
chmod 0644 ljcmds.c ||
echo "restore of ljcmds.c failed"
set `wc -c ljcmds.c`;Wc_c=$1
if test "$Wc_c" != "33110"; then
	echo original size 33110, current size $Wc_c
fi
# ============= ljcmds.h ==============
echo "x - extracting ljcmds.h (Text)"
sed 's/^X//' << 'SHAR_EOF' > ljcmds.h &&
X/*
X** Project:		lj2ps
X** File:		ljcmds.h
X**
X** Author:		Christopher Lishka
X** Organization:	Wisconsin State Laboratory of Hygiene
X**			Data Processing Dept.
X**
X** Copyright (C) 1990 by Christopher Lishka.
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 1, or (at your option)
X** 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 LJCMDS_H
X#define LJCMDS_H
X
X  /* Global constants
X  */
X
X  /* Global structure and type definitions
X  */
X
X  /* Global variables
X  */
X
X  /* Global macro definitions
X  */
X
X  /* Global functions
X  */
Xextern void  ljcmd_undefined();	/* Command: undefined */
Xextern void  ljcmd_E();		/* Command: ^[E  reset */
Xextern void  ljcmd_Y();		/* Command: ^[Y  display functions on */
Xextern void  ljcmd_Z();		/* Command: ^[Z  display functions off */
Xextern void  ljcmd_9();		/* Command: ^[9  clear margins */
Xextern void  ljcmd_eq();	/* Command: ^[=  half-line feed */
Xextern void  ljcmd_lp();	/* Command: ^[(  primary symbol set */
Xextern void  ljcmd_rp();	/* Command: ^[)  secondary symbol set */
Xextern void  ljcmd_lp_s();	/* Command: ^[(s primary font attributes */
Xextern void  ljcmd_rp_s();	/* Command: ^[)s secondary font attributes */
Xextern void  ljcmd_amp_a();	/* Command: ^[&a margins & movement */
Xextern void  ljcmd_amp_d();	/* Command: ^[&d underline */
Xextern void  ljcmd_amp_f();	/* Command: ^[&f macros, position stack */
Xextern void  ljcmd_amp_k();	/* Command: ^[&k HMI, pitch, line termination*/
Xextern void  ljcmd_amp_l();	/* Command: ^[&l page attributes */
Xextern void  ljcmd_amp_p();	/* Command: ^[&p transparent print data */
Xextern void  ljcmd_amp_s();	/* Command: ^[&s end-of-line wrap */
Xextern void  ljcmd_star_b();	/* Command: ^[*b bitmap transfer */
Xextern void  ljcmd_star_c();	/* Command: ^[*c graphics, soft fonts */
Xextern void  ljcmd_star_p();	/* Command: ^[*p device-dependent movement */
Xextern void  ljcmd_star_r();	/* Command: ^[*r start/end graphics */
Xextern void  ljcmd_star_t();	/* Command: ^[*t graphics resolution */
X
X#endif
SHAR_EOF
$TOUCH -am 0707112690 ljcmds.h &&
chmod 0644 ljcmds.h ||
echo "restore of ljcmds.h failed"
set `wc -c ljcmds.h`;Wc_c=$1
if test "$Wc_c" != "2558"; then
	echo original size 2558, current size $Wc_c
fi
# ============= ljfonts.c ==============
echo "x - extracting ljfonts.c (Text)"
sed 's/^X//' << 'SHAR_EOF' > ljfonts.c &&
X/* Project:		lj2ps
X** File:		ljfonts.c
X**
X** Author:		Christopher Lishka
X** Organization:	Wisconsin State Laboratory of Hygiene
X**			Data Processing Dept.
X**
X** Copyright (C) 1990 by Christopher Lishka.
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 1, or (at your option)
X** 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
Xstatic char * ModuleID = "Module ljfonts: v1.0, production";
X
X  /* Include files
X  */
X#include <strings.h>
X#include "ljfonts.h"
X#include "lj.h"
X
X  /* External definitions
X  */
X
X  /* Global variables
X  */
X
X  /* Global function list
X  */
Xextern void  lj_match_font();	/* Get a font (closest match) */
Xextern int   lj_find_font();	/* Find font based on the name */
X
X  /* Local constants
X  */
X#define MAX_BUFFER  2048
X  /* LJ_FONT_ERROR is used to determine if real number attributes (e.g. pitch)
X  ** are the same.  0.1 is currently used because otherwise 16.6 does not match
X  ** with 16.66.  I have no idea how the LaserJet resolves this problem. - C.L.
X  */
X#define LJ_FONT_ERROR 0.1 
X  /* Font attribute priority values */
X#define FAP_ORIENTATION   1024	/* Orientation: landscape/portrait */
X#define FAP_SYM_SET        512	/* Symbol set */
X#define FAP_SPACING        256	/* Spacing: proportional/fixed */
X#define FAP_PITCH          128	/* Pitch (in chars per inch) */
X#define FAP_HEIGHT          64	/* Font height (in points) */
X#define FAP_STYLE           32	/* Style: normal/italic */
X#define FAP_STROKE          16	/* Stroke: -3(light) to 0(normal) to 3(bold) */
X#define FAP_TYPEFACE         8	/* Typeface */
X#define FAP_SOURCE_SOFT      4	/* Source: downloadable "soft" font */
X#define FAP_SOURCE_CART      2	/* Source: cartridge font */
X#define FAP_SOURCE_INT       1	/* Source: internal font */
X
X  /* Local structures and types
X  */
Xtypedef struct {
X    /* Identifier fields */
X  int     source;		/* Font source: where the font is located */
X  int     number;		/* Font number */
X     /* Scaling fields */
X  int     scale;		/* True if scaling should be performed */
X  double  scale_x;		/* % to scale in x direction */
X  double  scale_y;		/* % to scale in y direction */
X    /* LaserJet font ID fields */
X  int     symbol_set;		/* The symbol set of the font */
X  int     spacing;		/* Proportional/fixed */
X  double  pitch;		/* Pitch of fixed or space character */
X  double  point_size;		/* Height of the character */
X  int     style;		/* Upright/italic */
X  int     weight;		/* Stroke weight: -3 to +3 */
X  int     typeface;		/* Which typeface to use */
X  char   *ps_name;		/* The postscript font used for emulation */
X} font_node;
X
X  /* Local variables
X  */
X  /* The table of LaserJet fonts, and the LaserWriter equivalents.
X  **
X  ** Note: the fonts must be listed in priority order, from most important
X  ** to least important.
X  **
X  ** Note: the pitch value for proportional fonts is the width of the space
X  ** character.
X  */
X/*DBX: static */ font_node lj_fonts[] = {
X
X    /*
X    ** Left slot: HP F Font Cartridge
X    */
X 
X    /* L00 (TMS-10): Times-Roman 8U prop. 10pt. upright normal */
X  { LJ_FS_LEFT, 0,        0, 1.20, 1.00, /* Note: scaling is OFF */
X    LJ_SS_8U, LJ_SP_PROPORTIONAL, 17.7, 10.0, LJ_ST_UPRIGHT, 0, LJ_TF_TIMES,
X    "Times-Roman" },
X
X    /* L01 (TMS-10): Times-Roman 0U prop. 10pt. upright normal */
X  { LJ_FS_LEFT, 1,        0, 1.20, 1.00, /* Note: scaling is OFF */
X    LJ_SS_0U, LJ_SP_PROPORTIONAL, 17.7, 10.0, LJ_ST_UPRIGHT, 0, LJ_TF_TIMES,
X    "Times-Roman" },
X
X    /* L02 (TMS-B-10): Times-Roman 0U prop. 10pt. upright bold */
X  { LJ_FS_LEFT, 2,        0, 1.20, 1.00, /* Note: scaling is OFF */
X    LJ_SS_0U, LJ_SP_PROPORTIONAL, 17.7, 10.0, LJ_ST_UPRIGHT, 3, LJ_TF_TIMES,
X    "Times-Bold" },
X
X    /* L03 (TMS-B-10): Times-Roman 8U prop. 10pt. upright bold */
X  { LJ_FS_LEFT, 3,        0, 1.20, 1.00, /* Note: scaling is OFF */
X    LJ_SS_8U, LJ_SP_PROPORTIONAL, 17.7, 10.0, LJ_ST_UPRIGHT, 3, LJ_TF_TIMES,
X    "Times-Bold" },
X
X    /* L04 (TMS-I-10): Times-Roman 0U prop. 10pt. italic normal */
X  { LJ_FS_LEFT, 4,        0, 1.20, 1.00, /* Note: scaling is OFF */
X    LJ_SS_0U, LJ_SP_PROPORTIONAL, 17.7, 10.0, LJ_ST_ITALIC, 0, LJ_TF_TIMES,
X    "Times-Italic" },
X
X    /* L05 (TMS-I-10): Times-Roman 8U prop. 10pt. italic normal */
X  { LJ_FS_LEFT, 5,        0, 1.20, 1.00, /* Note: scaling is OFF */
X    LJ_SS_8U, LJ_SP_PROPORTIONAL, 17.7, 10.0, LJ_ST_ITALIC, 0, LJ_TF_TIMES,
X    "Times-Italic" },
X
X    /* L06 (HELV-B-14.4): Helvetica 0U prop. 14.4pt. upright bold */
X  { LJ_FS_LEFT, 6,        0, 0.00, 0.00, /* Note: scaling is OFF */
X    LJ_SS_0U, LJ_SP_PROPORTIONAL, 15.0, 14.4, LJ_ST_UPRIGHT, 3, LJ_TF_HELV,
X    "Helvetica-Bold" },
X
X    /* L07 (HELV-B-14.4): Helvetica 8U prop. 14.4pt. upright bold */
X  { LJ_FS_LEFT, 7,        0, 0.00, 0.00, /* Note: scaling is OFF */
X    LJ_SS_8U, LJ_SP_PROPORTIONAL, 15.0, 14.4, LJ_ST_UPRIGHT, 3, LJ_TF_HELV,
X    "Helvetica-Bold" },
X
X    /* L08 (TMS-8): Times-Roman 0U prop. 8pt. upright normal */
X  { LJ_FS_LEFT, 8,        0, 1.20, 1.00, /* Note: scaling is OFF */
X    LJ_SS_0U, LJ_SP_PROPORTIONAL, 27.4,  8.0, LJ_ST_UPRIGHT, 0, LJ_TF_TIMES,
X    "Times-Roman" },
X
X    /* L09 (TMS-8): Times-Roman 8U prop. 8pt. upright normal */
X  { LJ_FS_LEFT, 9,        0, 1.20, 1.00, /* Note: scaling is OFF */
X    LJ_SS_8U, LJ_SP_PROPORTIONAL, 27.4,  8.0, LJ_ST_UPRIGHT, 0, LJ_TF_TIMES,
X    "Times-Roman" },
X
X    /* L10 (LP-8.5): Line-Printer 0U 16.6pitch 8.5pt upright normal */
X  { LJ_FS_LEFT, 10,       1, 0.845, 1.00, /* Scaling *****ON***** */
X    LJ_SS_0N, LJ_SP_FIXED,        16.67,  8.5, LJ_ST_UPRIGHT, 0, LJ_TF_LP,
X    "Courier" },
X
X    /* L11 (LP-8.5): Line-Printer 8U 16.6pitch 8.5pt upright normal */
X  { LJ_FS_LEFT, 11,       1, 0.845, 1.00, /* Scaling *****ON***** */
X    LJ_SS_8U, LJ_SP_FIXED,        16.67,  8.5, LJ_ST_UPRIGHT, 0, LJ_TF_LP,
X    "Courier" },
X
X    /*
X    ** Right slot: HP G Font Cartridge
X    */
X
X    /* R00 (PRES-10): Prestige 0U 12pitch 10pt. upright normal */
X  { LJ_FS_RIGHT, 0,       0, 0.00, 0.00, /* Note: scaling is OFF */
X    LJ_SS_0U, LJ_SP_FIXED,        12.0, 10.0, LJ_ST_UPRIGHT, 0, LJ_TF_PRES,
X    "Courier" },
X
X    /* R01 (PRES-10): Prestige 1U 12pitch 10pt. upright normal */
X  { LJ_FS_RIGHT, 1,       0, 0.00, 0.00, /* Note: scaling is OFF */
X    LJ_SS_1U, LJ_SP_FIXED,        12.0, 10.0, LJ_ST_UPRIGHT, 0, LJ_TF_PRES,
X    "Courier" },
X
X    /* R02 (PRES-B-10): Prestige 1U 12pitch 10pt. upright bold */
X  { LJ_FS_RIGHT, 2,       0, 0.00, 0.00, /* Note: scaling is OFF */
X    LJ_SS_1U, LJ_SP_FIXED,        12.0, 10.0, LJ_ST_UPRIGHT, 3, LJ_TF_PRES,
X    "Courier-Bold" },
X
X    /* R03 (PRES-B-10): Prestige 0U 12pitch 10pt. upright bold */
X  { LJ_FS_RIGHT, 3,       0, 0.00, 0.00, /* Note: scaling is OFF */
X    LJ_SS_0U, LJ_SP_FIXED,        12.0, 10.0, LJ_ST_UPRIGHT, 3, LJ_TF_PRES,
X    "Courier-Bold" },
X
X    /* R04 (PRES-I-10): Prestige 1U 12pitch 10pt. italic normal */
X  { LJ_FS_RIGHT, 4,       0, 0.00, 0.00, /* Note: scaling is OFF */
X    LJ_SS_1U, LJ_SP_FIXED,        12.0, 10.0, LJ_ST_ITALIC, 0, LJ_TF_PRES,
X    "Courier-Oblique" },
X
X    /* R05 (PRES-I-10): Prestige 0U 12pitch 10pt. italic normal */
X  { LJ_FS_RIGHT, 5,       0, 0.00, 0.00, /* Note: scaling is OFF */
X    LJ_SS_0U, LJ_SP_FIXED,        12.0, 10.0, LJ_ST_ITALIC, 0, LJ_TF_PRES,
X    "Courier-Oblique" },
X
X    /* R06 (PRES-7): Prestige 1U 16.6pitch 7pt. upright normal */
X  { LJ_FS_RIGHT, 6,       1, 1.03, 1.00, /* Note: scaling is OFF */
X    LJ_SS_1U, LJ_SP_FIXED,        16.67,  7.0, LJ_ST_UPRIGHT, 0, LJ_TF_PRES,
X    "Courier" },
X
X    /* R07 (PRES-7): Prestige 0U 16.6pitch 7pt. upright normal */
X  { LJ_FS_RIGHT, 7,       1, 1.03, 1.00, /* Note: scaling is OFF */
X    LJ_SS_0U, LJ_SP_FIXED,        16.67,  7.0, LJ_ST_UPRIGHT, 0, LJ_TF_PRES,
X    "Courier" },
X
X    /* R08: Line Draw is NOT AVAILABLE */
X/*  "DRAW-12",         "Line-Draw              12    point     12    pitch",*/
X/*  Line draw is not supported! */
X
X    /*
X    ** LaserJet II Internal Fonts
X    */
X
X    /* I00 (COUR-12): Courier 8U 10pitch 12pt. upright normal */
X  { LJ_FS_INTERNAL, 0,    0, 0.00, 0.00, /* Note: scaling is OFF */
X    LJ_SS_8U, LJ_SP_FIXED,        10.0, 12.0, LJ_ST_UPRIGHT, 0, LJ_TF_COUR,
X    "Courier" },
X
X    /* I01 (COUR-12): Courier 10U 10pitch 12pt. upright normal */
X  { LJ_FS_INTERNAL, 1,    0, 0.00, 0.00, /* Note: scaling is OFF */
X    LJ_SS_10U, LJ_SP_FIXED,        10.0, 12.0, LJ_ST_UPRIGHT, 0, LJ_TF_COUR,
X    "Courier" },
X
X    /* I02 (COUR-12): Courier 11U 10pitch 12pt. upright normal */
X  { LJ_FS_INTERNAL, 2,    0, 0.00, 0.00, /* Note: scaling is OFF */
X    LJ_SS_11U, LJ_SP_FIXED,        10.0, 12.0, LJ_ST_UPRIGHT, 0, LJ_TF_COUR,
X    "Courier" },
X
X    /* I03 (COUR-12): Courier 0N 10pitch 12pt. upright normal */
X  { LJ_FS_INTERNAL, 3,    0, 0.00, 0.00, /* Note: scaling is OFF */
X    LJ_SS_0N, LJ_SP_FIXED,        10.0, 12.0, LJ_ST_UPRIGHT, 0, LJ_TF_COUR,
X    "Courier" },
X
X    /* I04 (COUR-B-12): Courier 8U 10pitch 12pt. upright bold */
X  { LJ_FS_INTERNAL, 4,    0, 0.00, 0.00, /* Note: scaling is OFF */
X    LJ_SS_8U, LJ_SP_FIXED,        10.0, 12.0, LJ_ST_UPRIGHT, 3, LJ_TF_COUR,
X    "Courier-Bold" },
X
X    /* I05 (COUR-B-12): Courier 10U 10pitch 12pt. upright bold */
X  { LJ_FS_INTERNAL, 5,    0, 0.00, 0.00, /* Note: scaling is OFF */
X    LJ_SS_10U, LJ_SP_FIXED,        10.0, 12.0, LJ_ST_UPRIGHT, 3, LJ_TF_COUR,
X    "Courier-Bold" },
X
X    /* I06 (COUR-B-12): Courier 11U 10pitch 12pt. upright bold */
X  { LJ_FS_INTERNAL, 6,    0, 0.00, 0.00, /* Note: scaling is OFF */
X    LJ_SS_11U, LJ_SP_FIXED,        10.0, 12.0, LJ_ST_UPRIGHT, 3, LJ_TF_COUR,
X    "Courier-Bold" },
X
X    /* I07 (COUR-B-12): Courier 0N 10pitch 12pt. upright bold */
X  { LJ_FS_INTERNAL, 7,    0, 0.00, 0.00, /* Note: scaling is OFF */
X    LJ_SS_0N, LJ_SP_FIXED,        10.0, 12.0, LJ_ST_UPRIGHT, 3, LJ_TF_COUR,
X    "Courier-Bold" },
X
X    /* I08 (LP-8.5): Line-Printer 8U 16.6pitch 8.5pt. upright normal */
X  { LJ_FS_INTERNAL, 8,    1, 0.845, 1.00, /* Scaling *****ON***** */
X    LJ_SS_8U, LJ_SP_FIXED,        16.67,  8.5, LJ_ST_UPRIGHT, 0, LJ_TF_LP,
X    "Courier" },
X
X    /* I09 (LP-8.5): Line-Printer 10U 16.6pitch 8.5pt. upright normal */
X  { LJ_FS_INTERNAL, 9,    1, 0.845, 1.00, /* Scaling *****ON***** */
X    LJ_SS_10U, LJ_SP_FIXED,        16.67,  8.5, LJ_ST_UPRIGHT, 0, LJ_TF_LP,
X    "Courier" },
X
X    /* Last entry must be nulled out! */
X  { 0, 0,                 0, 0.00, 0.00,
X    0,         0,                    0.0,  0.0, 0,             0, 0,
X    "" }
X};
X
X  /* Local macro definitions
X  */
X
X  /* Local function list
X  */
X
X  /* Function bodies
X  */
X
X  /* lj_get_font() returns in the argument font the closest match to the
X  ** requested font.  The match *never* fails.
X  **
X  ** "Closest match" is defined as the first font in the
X  ** list for which the attributes match.  The attributes are in the
X  ** following priority order:
X  **
X  **        (1) Orientation (always correct because PS has arbitrary rotation)
X  **        (2) Symbol set  (once again, ignored here!)
X  **        (3) Spacing
X  **        (4) Pitch       (ignored if the font is proportional)
X  **        (5) Height
X  **        (6) Style
X  **        (7) Stroke weight
X  **        (8) Typeface
X  **        (9) Soft font        (ignored)
X  **       (10) Cartridge font   (ignored)
X  **       (11) Internal font    (ignored)
X  **
X  ** Priority schemes based on the source of the font (i.e. soft fonts,
X  ** cartridge fonts, or internal fonts) are ignored.  These can be
X  ** duplicated through careful ordering of the list.
X  */
Xvoid
Xlj_match_font(font)
X     ljfont *font;
X{
X  int    match_font;		/* Highest matched font so far */
X  int    match_value;		/* Highest matched value so far */
X  int    curr_value;		/* The current font being tested */
X  int    curr_font;		/* The match value for the current font */
X  double tmp_double;		/* Temporary value */
X
X  curr_font   = 0;
X  match_font  = curr_font;
X  match_value = 0;
X  do{
X    curr_value = 0;
X
X      /* Match the attributes */
X      /* Orientation: *always* matches, because PS allows arbitrary rotation */
X    curr_value += FAP_ORIENTATION;
X      /* Symbol set */
X    if( font->symbol_set == lj_fonts[curr_font].symbol_set ){
X      curr_value += FAP_SYM_SET;
X    }
X      /* Spacing: match to two decimal places */
X    if( font->spacing == lj_fonts[curr_font].spacing ){
X      curr_value += FAP_SPACING;
X    }
X      /* Pitch: ignore if proportional spacing */
X    if( font->spacing == LJ_SP_FIXED ){
X      tmp_double = font->pitch - lj_fonts[curr_font].pitch;
X      if( (-(LJ_FONT_ERROR) <= tmp_double) && (tmp_double <= LJ_FONT_ERROR) ){
X	curr_value += FAP_PITCH;
X      }
X    }
X      /* Height */
X    tmp_double = font->point_size - lj_fonts[curr_font].point_size;
X    if(   (-(LJ_FONT_ERROR) <= tmp_double) && (tmp_double <= LJ_FONT_ERROR) ){
X      curr_value += FAP_HEIGHT;
X    }
X      /* Style: exact match needed */
X    if( font->style == lj_fonts[curr_font].style ){
X      curr_value += FAP_STYLE;
X    }
X      /* Stroke weight: exact match needed */
X    if( font->weight == lj_fonts[curr_font].weight ){
X      curr_value += FAP_STROKE;
X    }
X      /* Typeface: exact match needed */
X    if( font->typeface == lj_fonts[curr_font].typeface ){
X      curr_value += FAP_TYPEFACE;
X    }
X      /* Source soft font: ignored */
X      /* Source cartridge font: ignored */
X      /* Source internal font: ignored */
X
X      /* Check to see if we currently have a better match */
X    if( curr_value > match_value ){
X      match_value = curr_value;
X      match_font  = curr_font;
X    }
X
X    curr_font++;
X  } while( (lj_fonts[curr_font].ps_name[0] != '\0') );
X
X    /* There had *better* be a matched font in match_font by this point.
X    ** If none of the attributes matched, match_font should at least hold
X    ** the default.
X    */
X
X    /* OK. Now copy over *everything* */
X  font->scale      = lj_fonts[match_font].scale;
X  font->scale_x    = lj_fonts[match_font].scale_x;
X  font->scale_y    = lj_fonts[match_font].scale_y;
X  font->symbol_set = lj_fonts[match_font].symbol_set;
X  font->spacing    = lj_fonts[match_font].spacing;
X  if( font->spacing == LJ_SP_FIXED ){
X    font->pitch      = lj_fonts[match_font].pitch;
X  }
X  font->point_size = lj_fonts[match_font].point_size;
X  font->style      = lj_fonts[match_font].style;
X  font->weight     = lj_fonts[match_font].weight;
X  font->typeface   = lj_fonts[match_font].typeface;
X  (void) strcpy(font->ps_name, lj_fonts[match_font].ps_name);
X  font->width      = 1/(lj_fonts[match_font].pitch);
X
X} /* lj_match_font() */
X
X
X
X  /* lj_find_font() finds a font based on the name.  A 0 is returned
X  ** if the search is successful, 1 otherwise.
X  */
Xint
Xlj_find_font(source, number, font)
X     int source, number;  ljfont *font;
X{
X  int found;
X  int counter;
X
X  found = 0;
X  for( counter = 0;
X       !found && !(lj_fonts[counter].source == 0);
X       counter++ ){
X    if(   (source == lj_fonts[counter].source)
X       && (number == lj_fonts[counter].number) ){
X      found = 1;
X      font->scale      = lj_fonts[counter].scale;
X      font->scale_x    = lj_fonts[counter].scale_x;
X      font->scale_y    = lj_fonts[counter].scale_y;
X      font->symbol_set = lj_fonts[counter].symbol_set;
X      font->spacing    = lj_fonts[counter].spacing;
X      if( font->spacing == LJ_SP_FIXED ){
X	font->pitch    = lj_fonts[counter].pitch;
X      }
X      font->point_size = lj_fonts[counter].point_size;
X      font->style      = lj_fonts[counter].style;
X      font->weight     = lj_fonts[counter].weight;
X      font->typeface   = lj_fonts[counter].typeface;
X      (void) strcpy(font->ps_name, lj_fonts[counter].ps_name);
X      font->width      = 1/(lj_fonts[counter].pitch);
X    } /* if */
X  } /* for */
X
X  return( !found );
X} /* lj_find_font() */
SHAR_EOF
$TOUCH -am 0707112690 ljfonts.c &&
chmod 0644 ljfonts.c ||
echo "restore of ljfonts.c failed"
set `wc -c ljfonts.c`;Wc_c=$1
if test "$Wc_c" != "16148"; then
	echo original size 16148, current size $Wc_c
fi
# ============= ljfonts.h ==============
echo "x - extracting ljfonts.h (Text)"
sed 's/^X//' << 'SHAR_EOF' > ljfonts.h &&
X/*
X** Project:		lj2ps
X** File:		ljfonts.h
X**
X** Author:		Christopher Lishka
X** Organization:	Wisconsin State Laboratory of Hygiene
X**			Data Processing Dept.
X**
X** Copyright (C) 1990 by Christopher Lishka.
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 1, or (at your option)
X** 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 LJFONTS_H
X#define LJFONTS_H
X
X#include "lj.h"
X
X  /* Global constants
X  */
X
X  /* Global structure and type definitions
X  */
X
X  /* Global variables
X  */
X
X  /* Global macro definitions
X  */
X
X  /* Global functions
X  */
Xextern void  lj_match_font();	/* Get closest match for a laserjet font */
Xextern int   lj_find_font();	/* Find font based on name */
X
X#endif
SHAR_EOF
$TOUCH -am 0707112690 ljfonts.h &&
chmod 0644 ljfonts.h ||
echo "restore of ljfonts.h failed"
set `wc -c ljfonts.h`;Wc_c=$1
if test "$Wc_c" != "1258"; then
	echo original size 1258, current size $Wc_c
fi
# ============= scan.c ==============
echo "x - extracting scan.c (Text)"
sed 's/^X//' << 'SHAR_EOF' > scan.c &&
X/* Project:		lj2ps
X** File:		scan.c
X**
X** Author:		Christopher Lishka
X** Organization:	Wisconsin State Laboratory of Hygiene
X**			Data Processing Dept.
X**
X** Copyright (C) 1990 by Christopher Lishka.
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 1, or (at your option)
X** 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
Xstatic char * ModuleID = "Module scan: v1.0.1.2, production";
X
X  /* Include files
X  */
X#include <stdio.h>
X#include <ctype.h>
X#include "scan.h"
X#include "lj.h"
X#include "lj2ps.h"
X
X  /* External definitions
X  */
X
X  /* Global variables
X  */
Xint    scan_state;		/* Controls which scanner is being used */
Xchar  *text;			/* Text read in for text tokens */
Xchar  *command;			/* Command read in */
Xchar   variable[MAX_BUFFER];	/* Command parameter */
Xchar   number[MAX_BUFFER];	/* Command numeric argument */
Xint    pos_code;		/* Command numeric position code */
Xtoken  curr_token;		/* Where to hold the scanned token */
X
X  /* Global function list
X  */
Xextern int  scan();		/* The entry into the scanners */
Xextern void scan_init();	/* Reset the input for the scanner */
X
X  /* Local constants
X  */
X  /* Scanner state constants */
X  /* These two constants allow access to the START and END states.  I do not
X  ** recommend changing the actual values for them, because they need to be
X  ** defined to the same value for *all* scanners in here.
X  */
X#define START     1
X#define END       0
X  /* Text scanner states */
X#define ST____    END		/* End...must be zero! */
X#define ST_STT    START		/* Start */
X#define ST_CMD    2		/* Command */
X#define ST_CMA    3		/* Command & */
X#define ST_CMS    4		/* Command * */
X#define ST_TLP    5		/* END: Text ( */
X#define ST_TRP    6		/* END: Text ) */
X#define ST_TBS    7		/* END: Text \ */
X#define ST_TNL    8		/* END: Text \n */
X#define ST_TFF    9		/* END: Text \f */
X#define ST_UNK   10		/* END: Error: unknown command */
X#define ST_CEQ   11		/* END: Command = */
X#define ST_C9    12		/* END: Command 9 */
X#define ST_CZ    13		/* END: Command Z */
X#define ST_CY    14		/* END: Command Y */
X#define ST_CE    15		/* END: Command E */
X#define ST_CAa   16		/* END: Command &a */
X#define ST_CAd   17		/* END: Command &d */
X#define ST_CAf   18		/* END: Command &f */
X#define ST_CAk   19		/* END: Command &k */
X#define ST_CAl   20		/* END: Command &l */
X#define ST_CAp   21		/* END: Command &p */
X#define ST_CAs   22		/* END: Command &s */
X#define ST_CSt   23		/* END: Command *t */
X#define ST_CSr   24		/* END: Command *r */
X#define ST_CSp   25		/* END: Command *p */
X#define ST_CSc   26		/* END: Command *c */
X#define ST_CSb   27		/* END: Command *b */
X#define ST_CLs   28		/* END: Command (s */
X#define ST_CRs   29		/* END: Command )s */
X#define ST_CLP   30		/* END: Command ( */
X#define ST_CRP   31		/* END: Command ) */
X#define ST_TXT   32		/* END: Text */
X#define ST_NUL   33		/* END: Null */
X#define ST_TTB   34		/* END: Tab */
X#define ST_TSI   35		/* END: Shift in */
X#define ST_TSO   36		/* END: Shift out */
X#define ST_MAX   37		/* End of these states */
X  /* Parameter scanner states */
X#define SP____    END		/* End state */
X#define SP_PRM    START		/* Parameter */
X#define SP_INT    2		/* Integer */
X#define SP_FLP    3		/* Floating point */
X#define SP_PEO    4		/* END: Parameter end -- other (no argument) */
X#define SP_PE     5		/* END: Parameter end -- normal */
X#define SP_PC     6		/* END: Parameter continue */
X#define SP_UNK    7		/* END: Unknown command */
X#define SP_MAX    8		/* End of these states */
X  /* Text scanner character classes */
X#define CST___    0		/* All other characters */
X#define CST_LP    1		/* ( */
X#define CST_RP    2		/* ) */
X#define CST_BS    3		/* \ */
X#define CST_NL    4		/* \n */
X#define CST_FF    5		/* \f */
X#define CST_NU    6		/* \0 */
X#define CST_ES    7		/* ^[ */
X#define CST_EQ    8		/* = */
X#define CST_AM    9		/* & */
X#define CST_AS   10		/* * */
X#define CST_9    11		/* 9 */
X#define CST_E    12		/* E */
X#define CST_Y    13		/* Y */
X#define CST_Z    14		/* Z */
X#define CST_a    15		/* a */
X#define CST_b    16		/* b */
X#define CST_c    17		/* c */
X#define CST_d    18		/* d */
X#define CST_f    19		/* f */
X#define CST_k    20		/* k */
X#define CST_l    21		/* l */
X#define CST_p    22		/* p */
X#define CST_r    23		/* r */
X#define CST_s    24		/* s */
X#define CST_t    25		/* t */
X#define CST_EF   26		/* EOF */
X#define CST_TB   27		/* Tab */
X#define CST_SI   28		/* Shift in */
X#define CST_SO   29		/* Shift out */
X#define CST_MAX  30		/* End of these classes */
X  /* Parameter scanner character classes */
X#define CSP___    0		/* All other characters */
X#define CSP_SI    1		/* + - */
X#define CSP_DI    2		/* 0 1 2 3 4 5 6 7 8 9 */
X#define CSP_PE    3		/* . */
X#define CSP_LW    4		/* a-z */
X#define CSP_US    5		/* A-Z ! " # $ % & ' ( ) * , / :   */
X				/* ; < = > ? @ [ \ ] ^ _ ` { | } ~ */
X#define CSP_EF    6		/* EOF */
X#define CSP_MAX   7		/* End of these classes */
X
X  /* Local structures and types
X  */
X  /* The text buffer */
Xtypedef struct {		/* Input buffer */
X  int   length;			/* Number of characters put back */
X  char  storage[MAX_BUFFER];	/* Storage for characters in the buffer */
X} buffer;
X
X  /* Local variables
X  */
Xstatic FILE  *in_file;		/* Input file */
Xstatic char   curr_char;	/* The current character */
Xstatic int    end_of_file;	/* True if at the end_of_file */
Xstatic buffer input;		/* Buffer to hold put-back characters */
X
X  /* The text scanner state/input table */
Xstatic int st_states[ST_MAX][CST_MAX] = {
X/* Legend:
X**{ CST___, CST_LP, CST_RP, CST_BS,   CST_NL, CST_FF, CST_NU, CST_ES,
X**  CST_EQ, CST_AM, CST_AS, CST_9 ,   CST_E , CST_Y , CST_Z , CST_a ,
X**  CST_b , CST_c , CST_d , CST_f ,   CST_k , CST_l , CST_p , CST_r ,
X**  CST_s , CST_t , CST_EF, CST_TB,   CST_SI, CST_SO },
X*/
X    /* ST____: END*/
X  { ST____, ST____, ST____, ST____,   ST____, ST____, ST____, ST____,
X    ST____, ST____, ST____, ST____,   ST____, ST____, ST____, ST____,
X    ST____, ST____, ST____, ST____,   ST____, ST____, ST____, ST____,
X    ST____, ST____, ST____, ST____,   ST____, ST____ },
X    /* ST_STT: Start */
X  { ST_TXT, ST_TLP, ST_TRP, ST_TBS,   ST_TNL, ST_TFF, ST_NUL, ST_CMD,
X    ST_TXT, ST_TXT, ST_TXT, ST_TXT,   ST_TXT, ST_TXT, ST_TXT, ST_TXT,
X    ST_TXT, ST_TXT, ST_TXT, ST_TXT,   ST_TXT, ST_TXT, ST_TXT, ST_TXT,
X    ST_TXT, ST_TXT, ST____, ST_TTB,   ST_TSI, ST_TSO },
X    /* ST_CMD: Command */
X  { ST_UNK, ST_CLP, ST_CRP, ST_UNK,   ST_UNK, ST_UNK, ST_UNK, ST_UNK,
X    ST_CEQ, ST_CMA, ST_CMS, ST_C9 ,   ST_CE , ST_CY , ST_CZ , ST_UNK,
X    ST_UNK, ST_UNK, ST_UNK, ST_UNK,   ST_UNK, ST_UNK, ST_UNK, ST_UNK,
X    ST_UNK, ST_UNK, ST_UNK, ST_UNK,   ST_UNK, ST_UNK },
X    /* ST_CMA: Command & */
X  { ST_UNK, ST_UNK, ST_UNK, ST_UNK,   ST_UNK, ST_UNK, ST_UNK, ST_UNK,
X    ST_UNK, ST_UNK, ST_UNK, ST_UNK,   ST_UNK, ST_UNK, ST_UNK, ST_CAa,
X    ST_UNK, ST_UNK, ST_CAd, ST_CAf,   ST_CAk, ST_CAl, ST_CAp, ST_UNK,
X    ST_CAs, ST_UNK, ST_UNK, ST_UNK,   ST_UNK, ST_UNK },
X    /* ST_CMS: Command * */
X  { ST_UNK, ST_UNK, ST_UNK, ST_UNK,   ST_UNK, ST_UNK, ST_UNK, ST_UNK,
X    ST_UNK, ST_UNK, ST_UNK, ST_UNK,   ST_UNK, ST_UNK, ST_UNK, ST_UNK,
X    ST_CSb, ST_CSc, ST_UNK, ST_UNK,   ST_UNK, ST_UNK, ST_CSp, ST_CSr,
X    ST_UNK, ST_CSt, ST_UNK, ST_UNK,   ST_UNK, ST_UNK },
X    /* ST_TLP: END: Text ( */
X  { ST____, ST____, ST____, ST____,   ST____, ST____, ST____, ST____,
X    ST____, ST____, ST____, ST____,   ST____, ST____, ST____, ST____,
X    ST____, ST____, ST____, ST____,   ST____, ST____, ST____, ST____,
X    ST____, ST____, ST____, ST____,   ST____, ST____ },
X    /* ST_TRP: END: Text ) */
X  { ST____, ST____, ST____, ST____,   ST____, ST____, ST____, ST____,
X    ST____, ST____, ST____, ST____,   ST____, ST____, ST____, ST____,
X    ST____, ST____, ST____, ST____,   ST____, ST____, ST____, ST____,
X    ST____, ST____, ST____, ST____,   ST____, ST____ },
X    /* ST_TBS: END: Text \ */
X  { ST____, ST____, ST____, ST____,   ST____, ST____, ST____, ST____,
X    ST____, ST____, ST____, ST____,   ST____, ST____, ST____, ST____,
X    ST____, ST____, ST____, ST____,   ST____, ST____, ST____, ST____,
X    ST____, ST____, ST____, ST____,   ST____, ST____ },
X    /* ST_TNL: END: Text \n */
X  { ST____, ST____, ST____, ST____,   ST____, ST____, ST____, ST____,
X    ST____, ST____, ST____, ST____,   ST____, ST____, ST____, ST____,
X    ST____, ST____, ST____, ST____,   ST____, ST____, ST____, ST____,
X    ST____, ST____, ST____, ST____,   ST____, ST____ },
X    /* ST_TFF: END: Text \f */
X  { ST____, ST____, ST____, ST____,   ST____, ST____, ST____, ST____,
X    ST____, ST____, ST____, ST____,   ST____, ST____, ST____, ST____,
X    ST____, ST____, ST____, ST____,   ST____, ST____, ST____, ST____,
X    ST____, ST____, ST____, ST____,   ST____, ST____ },
X    /* ST_UNK: END: Error: unknown command */
X  { ST____, ST____, ST____, ST____,   ST____, ST____, ST____, ST____,
X    ST____, ST____, ST____, ST____,   ST____, ST____, ST____, ST____,
X    ST____, ST____, ST____, ST____,   ST____, ST____, ST____, ST____,
X    ST____, ST____, ST____, ST____,   ST____, ST____ },
X    /* ST_CEQ: END: Command = */
X  { ST____, ST____, ST____, ST____,   ST____, ST____, ST____, ST____,
X    ST____, ST____, ST____, ST____,   ST____, ST____, ST____, ST____,
X    ST____, ST____, ST____, ST____,   ST____, ST____, ST____, ST____,
X    ST____, ST____, ST____, ST____,   ST____, ST____ },
X    /* ST_C9:* END: Command 9 */
X  { ST____, ST____, ST____, ST____,   ST____, ST____, ST____, ST____,
X    ST____, ST____, ST____, ST____,   ST____, ST____, ST____, ST____,
X    ST____, ST____, ST____, ST____,   ST____, ST____, ST____, ST____,
X    ST____, ST____, ST____, ST____,   ST____, ST____ },
X    /* ST_CZ:* END: Command Z */
X  { ST____, ST____, ST____, ST____,   ST____, ST____, ST____, ST____,
X    ST____, ST____, ST____, ST____,   ST____, ST____, ST____, ST____,
X    ST____, ST____, ST____, ST____,   ST____, ST____, ST____, ST____,
X    ST____, ST____, ST____, ST____,   ST____, ST____ },
X    /* ST_CY:* END: Command Y */
X  { ST____, ST____, ST____, ST____,   ST____, ST____, ST____, ST____,
X    ST____, ST____, ST____, ST____,   ST____, ST____, ST____, ST____,
X    ST____, ST____, ST____, ST____,   ST____, ST____, ST____, ST____,
X    ST____, ST____, ST____, ST____,   ST____, ST____ },
X    /* ST_CE:* END: Command E */
X  { ST____, ST____, ST____, ST____,   ST____, ST____, ST____, ST____,
X    ST____, ST____, ST____, ST____,   ST____, ST____, ST____, ST____,
X    ST____, ST____, ST____, ST____,   ST____, ST____, ST____, ST____,
X    ST____, ST____, ST____, ST____,   ST____, ST____ },
X    /* ST_CAa: END: Command &a */
X  { ST____, ST____, ST____, ST____,   ST____, ST____, ST____, ST____,
X    ST____, ST____, ST____, ST____,   ST____, ST____, ST____, ST____,
X    ST____, ST____, ST____, ST____,   ST____, ST____, ST____, ST____,
X    ST____, ST____, ST____, ST____,   ST____, ST____ },
X    /* ST_CAd: END: Command &d */
X  { ST____, ST____, ST____, ST____,   ST____, ST____, ST____, ST____,
X    ST____, ST____, ST____, ST____,   ST____, ST____, ST____, ST____,
X    ST____, ST____, ST____, ST____,   ST____, ST____, ST____, ST____,
X    ST____, ST____, ST____, ST____,   ST____, ST____ },
X    /* ST_CAf: END: Command &f */
X  { ST____, ST____, ST____, ST____,   ST____, ST____, ST____, ST____,
X    ST____, ST____, ST____, ST____,   ST____, ST____, ST____, ST____,
X    ST____, ST____, ST____, ST____,   ST____, ST____, ST____, ST____,
X    ST____, ST____, ST____, ST____,   ST____, ST____ },
X    /* ST_CAk: END: Command &k */
X  { ST____, ST____, ST____, ST____,   ST____, ST____, ST____, ST____,
X    ST____, ST____, ST____, ST____,   ST____, ST____, ST____, ST____,
X    ST____, ST____, ST____, ST____,   ST____, ST____, ST____, ST____,
X    ST____, ST____, ST____, ST____,   ST____, ST____ },
X    /* ST_CAl: END: Command &l */
X  { ST____, ST____, ST____, ST____,   ST____, ST____, ST____, ST____,
X    ST____, ST____, ST____, ST____,   ST____, ST____, ST____, ST____,
X    ST____, ST____, ST____, ST____,   ST____, ST____, ST____, ST____,
X    ST____, ST____, ST____, ST____,   ST____, ST____ },
X    /* ST_CAp: END: Command &p */
X  { ST____, ST____, ST____, ST____,   ST____, ST____, ST____, ST____,
X    ST____, ST____, ST____, ST____,   ST____, ST____, ST____, ST____,
X    ST____, ST____, ST____, ST____,   ST____, ST____, ST____, ST____,
X    ST____, ST____, ST____, ST____,   ST____, ST____ },
X    /* ST_CAs: END: Command &s */
X  { ST____, ST____, ST____, ST____,   ST____, ST____, ST____, ST____,
X    ST____, ST____, ST____, ST____,   ST____, ST____, ST____, ST____,
X    ST____, ST____, ST____, ST____,   ST____, ST____, ST____, ST____,
X    ST____, ST____, ST____, ST____,   ST____, ST____ },
X    /* ST_CSt: END: Command *t */
X  { ST____, ST____, ST____, ST____,   ST____, ST____, ST____, ST____,
X    ST____, ST____, ST____, ST____,   ST____, ST____, ST____, ST____,
X    ST____, ST____, ST____, ST____,   ST____, ST____, ST____, ST____,
X    ST____, ST____, ST____, ST____,   ST____, ST____ },
X    /* ST_CSr: END: Command *r */
X  { ST____, ST____, ST____, ST____,   ST____, ST____, ST____, ST____,
X    ST____, ST____, ST____, ST____,   ST____, ST____, ST____, ST____,
X    ST____, ST____, ST____, ST____,   ST____, ST____, ST____, ST____,
X    ST____, ST____, ST____, ST____,   ST____, ST____ },
X    /* ST_CSp: END: Command *p */
X  { ST____, ST____, ST____, ST____,   ST____, ST____, ST____, ST____,
X    ST____, ST____, ST____, ST____,   ST____, ST____, ST____, ST____,
X    ST____, ST____, ST____, ST____,   ST____, ST____, ST____, ST____,
X    ST____, ST____, ST____, ST____,   ST____, ST____ },
X    /* ST_CSc: END: Command *c */
X  { ST____, ST____, ST____, ST____,   ST____, ST____, ST____, ST____,
X    ST____, ST____, ST____, ST____,   ST____, ST____, ST____, ST____,
X    ST____, ST____, ST____, ST____,   ST____, ST____, ST____, ST____,
X    ST____, ST____, ST____, ST____,   ST____, ST____ },
X    /* ST_CSb: END: Command *b */
X  { ST____, ST____, ST____, ST____,   ST____, ST____, ST____, ST____,
X    ST____, ST____, ST____, ST____,   ST____, ST____, ST____, ST____,
X    ST____, ST____, ST____, ST____,   ST____, ST____, ST____, ST____,
X    ST____, ST____, ST____, ST____,   ST____, ST____ },
X    /* ST_CLs: END: Command (s */
X  { ST____, ST____, ST____, ST____,   ST____, ST____, ST____, ST____,
X    ST____, ST____, ST____, ST____,   ST____, ST____, ST____, ST____,
X    ST____, ST____, ST____, ST____,   ST____, ST____, ST____, ST____,
X    ST____, ST____, ST____, ST____,   ST____, ST____ },
X    /* ST_CRs: END: Command )s */
X  { ST____, ST____, ST____, ST____,   ST____, ST____, ST____, ST____,
X    ST____, ST____, ST____, ST____,   ST____, ST____, ST____, ST____,
X    ST____, ST____, ST____, ST____,   ST____, ST____, ST____, ST____,
X    ST____, ST____, ST____, ST____,   ST____, ST____ },
X    /* ST_CLP: END: Command ( */
X  { ST____, ST____, ST____, ST____,   ST____, ST____, ST____, ST____,
X    ST____, ST____, ST____, ST____,   ST____, ST____, ST____, ST____,
X    ST____, ST____, ST____, ST____,   ST____, ST____, ST____, ST____,
X    ST_CLs, ST____, ST____, ST____,   ST____, ST____ },
X    /* ST_CRP: END: Command ) */
X  { ST____, ST____, ST____, ST____,   ST____, ST____, ST____, ST____,
X    ST____, ST____, ST____, ST____,   ST____, ST____, ST____, ST____,
X    ST____, ST____, ST____, ST____,   ST____, ST____, ST____, ST____,
X    ST_CRs, ST____, ST____, ST____,   ST____, ST____ },
X    /* ST_TXT: END: Text */
X  { ST_TXT, ST____, ST____, ST____,   ST____, ST____, ST____, ST____,
X    ST_TXT, ST_TXT, ST_TXT, ST_TXT,   ST_TXT, ST_TXT, ST_TXT, ST_TXT,
X    ST_TXT, ST_TXT, ST_TXT, ST_TXT,   ST_TXT, ST_TXT, ST_TXT, ST_TXT,
X    ST_TXT, ST_TXT, ST____, ST____,   ST____, ST____ },
X    /* ST_NUL: END: Null */
X  { ST____, ST____, ST____, ST____,   ST____, ST____, ST____, ST____,
X    ST____, ST____, ST____, ST____,   ST____, ST____, ST____, ST____,
X    ST____, ST____, ST____, ST____,   ST____, ST____, ST____, ST____,
X    ST____, ST____, ST____, ST____,   ST____, ST____ },
X    /* ST_TTB: END: Tab */
X  { ST____, ST____, ST____, ST____,   ST____, ST____, ST____, ST____,
X    ST____, ST____, ST____, ST____,   ST____, ST____, ST____, ST____,
X    ST____, ST____, ST____, ST____,   ST____, ST____, ST____, ST____,
X    ST____, ST____, ST____, ST____,   ST____, ST____ },
X    /* ST_TSI: END: Shift in */
X  { ST____, ST____, ST____, ST____,   ST____, ST____, ST____, ST____,
X    ST____, ST____, ST____, ST____,   ST____, ST____, ST____, ST____,
X    ST____, ST____, ST____, ST____,   ST____, ST____, ST____, ST____,
X    ST____, ST____, ST____, ST____,   ST____, ST____ },
X    /* ST_TSO: END: Shift out */
X  { ST____, ST____, ST____, ST____,   ST____, ST____, ST____, ST____,
X    ST____, ST____, ST____, ST____,   ST____, ST____, ST____, ST____,
X    ST____, ST____, ST____, ST____,   ST____, ST____, ST____, ST____,
X    ST____, ST____, ST____, ST____,   ST____, ST____ }
X};
X
Xstatic int sp_states[SP_MAX][CSP_MAX] = {
X/* Legend:
X**{ CSP___, CSP_SI, CSP_DI, CSP_PE,   CSP_LW, CSP_US, CSP_EF }
X*/
X    /* SP____: Error */
X  { SP____, SP____, SP____, SP____,   SP____, SP____, SP____ },
X    /* SP_PRM: Parameter */
X  { SP_PEO, SP_INT, SP_INT, SP_PEO,   SP_PC , SP_PE , SP_UNK },
X    /* SP_INT: Integer */
X  { SP_UNK, SP_PE , SP_INT, SP_FLP,   SP_PC , SP_PE , SP_UNK },
X    /* SP_FLP: Floating point */
X  { SP_UNK, SP_PE , SP_FLP, SP_PE ,   SP_PC , SP_PE , SP_UNK },
X    /* SP_PEO: END: Parameter end -- other (no argument) */
X  { SP____, SP____, SP____, SP____,   SP____, SP____, SP____ },
X    /* SP_PE:  END: Parameter end -- normal */
X  { SP____, SP____, SP____, SP____,   SP____, SP____, SP____ },
X    /* SP_PC:  END: Parameter continue */
X  { SP____, SP____, SP____, SP____,   SP____, SP____, SP____ },
X    /* SP_UNK: END: Unknown command */
X  { SP____, SP____, SP____, SP____,   SP____, SP____, SP____ }
X};
X
Xstatic int st_classes[256] = {
X  /* 00 */ CST_NU, CST___, CST___, CST___,   CST___, CST___, CST___, CST___,
X  /* 08 */ CST___, CST_TB, CST_NL, CST___,   CST_FF, CST___, CST_SO, CST_SI,
X  /* 10 */ CST___, CST___, CST___, CST___,   CST___, CST___, CST___, CST___,
X  /* 18 */ CST___, CST___, CST___, CST_ES,   CST___, CST___, CST___, CST___,
X  /* 20 */ CST___, CST___, CST___, CST___,   CST___, CST___, CST_AM, CST___,
X  /* 28 */ CST_LP, CST_RP, CST_AS, CST___,   CST___, CST___, CST___, CST___,
X  /* 30 */ CST___, CST___, CST___, CST___,   CST___, CST___, CST___, CST___,
X  /* 38 */ CST___, CST_9 , CST___, CST___,   CST___, CST_EQ, CST___, CST___,
X  /* 40 */ CST___, CST___, CST___, CST___,   CST___, CST_E , CST___, CST___,
X  /* 48 */ CST___, CST___, CST___, CST___,   CST___, CST___, CST___, CST___,
X  /* 50 */ CST___, CST___, CST___, CST___,   CST___, CST___, CST___, CST___,
X  /* 58 */ CST___, CST_Y , CST_Z , CST___,   CST_BS, CST___, CST___, CST___,
X  /* 60 */ CST___, CST_a , CST_b , CST_c ,   CST_d , CST___, CST_f , CST___,
X  /* 68 */ CST___, CST___, CST___, CST_k ,   CST_l , CST___, CST___, CST___,
X  /* 70 */ CST_p , CST___, CST_r , CST_s ,   CST_t , CST___, CST___, CST___,
X  /* 78 */ CST___, CST___, CST___, CST___,   CST___, CST___, CST___, CST___,
X
X  /* 80 */ CST___, CST___, CST___, CST___,   CST___, CST___, CST___, CST___,
X  /* 88 */ CST___, CST___, CST___, CST___,   CST___, CST___, CST___, CST___,
X  /* 90 */ CST___, CST___, CST___, CST___,   CST___, CST___, CST___, CST___,
X  /* 98 */ CST___, CST___, CST___, CST___,   CST___, CST___, CST___, CST___,
X  /* a0 */ CST___, CST___, CST___, CST___,   CST___, CST___, CST___, CST___,
X  /* a8 */ CST___, CST___, CST___, CST___,   CST___, CST___, CST___, CST___,
X  /* b0 */ CST___, CST___, CST___, CST___,   CST___, CST___, CST___, CST___,
X  /* b8 */ CST___, CST___, CST___, CST___,   CST___, CST___, CST___, CST___,
X  /* c0 */ CST___, CST___, CST___, CST___,   CST___, CST___, CST___, CST___,
X  /* c8 */ CST___, CST___, CST___, CST___,   CST___, CST___, CST___, CST___,
X  /* d0 */ CST___, CST___, CST___, CST___,   CST___, CST___, CST___, CST___,
X  /* d8 */ CST___, CST___, CST___, CST___,   CST___, CST___, CST___, CST___,
X  /* e0 */ CST___, CST___, CST___, CST___,   CST___, CST___, CST___, CST___,
X  /* e8 */ CST___, CST___, CST___, CST___,   CST___, CST___, CST___, CST___,
X  /* f0 */ CST___, CST___, CST___, CST___,   CST___, CST___, CST___, CST___,
X  /* f8 */ CST___, CST___, CST___, CST___,   CST___, CST___, CST___, CST___
X};
X
Xstatic int sp_classes[256] = {
X  /* 00 */ CSP___, CSP___, CSP___, CSP___,   CSP___, CSP___, CSP___, CSP___,
X  /* 08 */ CSP___, CSP___, CSP___, CSP___,   CSP___, CSP___, CSP___, CSP___,
X  /* 10 */ CSP___, CSP___, CSP___, CSP___,   CSP___, CSP___, CSP___, CSP___,
X  /* 18 */ CSP___, CSP___, CSP___, CSP___,   CSP___, CSP___, CSP___, CSP___,
X  /* 20 */ CSP___, CSP_US, CSP_US, CSP_US,   CSP_US, CSP_US, CSP_US, CSP_US,
X  /* 28 */ CSP_US, CSP_US, CSP_US, CSP_SI,   CSP_US, CSP_SI, CSP_PE, CSP_US,
X  /* 30 */ CSP_DI, CSP_DI, CSP_DI, CSP_DI,   CSP_DI, CSP_DI, CSP_DI, CSP_DI,
X  /* 38 */ CSP_DI, CSP_DI, CSP_US, CSP_US,   CSP_US, CSP_US, CSP_US, CSP_US,
X  /* 40 */ CSP_US, CSP_US, CSP_US, CSP_US,   CSP_US, CSP_US, CSP_US, CSP_US,
X  /* 48 */ CSP_US, CSP_US, CSP_US, CSP_US,   CSP_US, CSP_US, CSP_US, CSP_US,
X  /* 50 */ CSP_US, CSP_US, CSP_US, CSP_US,   CSP_US, CSP_US, CSP_US, CSP_US,
X  /* 58 */ CSP_US, CSP_US, CSP_US, CSP_US,   CSP_US, CSP_US, CSP_US, CSP_US,
X  /* 60 */ CSP_LW, CSP_LW, CSP_LW, CSP_LW,   CSP_LW, CSP_LW, CSP_LW, CSP_LW,
X  /* 68 */ CSP_LW, CSP_LW, CSP_LW, CSP_LW,   CSP_LW, CSP_LW, CSP_LW, CSP_LW,
X  /* 70 */ CSP_LW, CSP_LW, CSP_LW, CSP_LW,   CSP_LW, CSP_LW, CSP_LW, CSP_LW,
SHAR_EOF
echo "End of  part 12"
echo "File scan.c is continued in part 13"
echo "13" > @shar_seq_.tmp
exit 0