v04i071: JetRoff Source Code (02 of 7)

root2 at pcrat.UUCP root2 at pcrat.UUCP
Sun Sep 18 09:06:51 AEST 1988


Posting-number: Volume 4, Issue 71
Submitted-by: "A. Nonymous" <root2 at pcrat.UUCP>
Archive-name: jetroff/src/Part02

#! /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 2 (of 7)."
# Contents:  bm/jetbm.c bm/unittestC.sh bm/unittestM.sh bsd/getopt.c
#   bsd/getopt1.c bsd/jetusageBSD.sh djet/jetcheck.c djet/line.c
#   djet/lj.h djet/spline.c doc/djet.1.spec doc/jetbackup.1
#   doc/jetbm.1 doc/monster.clp doc/pcpaint.1 doc/pcx.1
#   font/devjet/fontcfg.sh font/devjet/makefile
#   font/devjet/mathsy.code font/mkfont/README font/mkfont/mkfont.1
#   font/mkfont/nextword.c makefile
# Wrapped by rick at pcroe on Sat Aug 27 13:00:59 1988
PATH=/bin:/usr/bin:/usr/ucb:/usr/lbin:$PATH ; export PATH
if test -f 'bm/jetbm.c' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'bm/jetbm.c'\"
else
echo shar: Extracting \"'bm/jetbm.c'\" \(1892 characters\)
sed "s/^X//" >'bm/jetbm.c' <<'END_OF_FILE'
X/*c
X *	JetRoff - DWB 2.0 postprocessor for HP LaserJet Series II
X *
X *	Copyright (c) 1988 PC Research, Inc.  All Rights Reserved.
X *
X *	This source code is supplied to you under the terms of the
X *	contents of the "License" agreement found with this source
X *	distribution.  You must read the "License" before you use
X *	this source code in any way.
X *
Xc*/
X
X/*
X *	jetbm.c:
X *		Bitmap includer for "standard" jetroff bitmap format
X */
X
X/*
X * $Id: jetbm.c,v 1.1 88/08/26 23:26:22 rick Exp $
X *
X * $Log:	jetbm.c,v $
X * Revision 1.1  88/08/26  23:26:22  rick
X * Initial revision
X * 
X */
X#ifndef lint
Xstatic char rcsid[] = "$Id: jetbm.c,v 1.1 88/08/26 23:26:22 rick Exp $";
X#endif
X
X#include <stdio.h>
X
Xextern char	*malloc();
Xextern void	free();
X
Xextern int	debug;
X
X#define	Fread	(void) fread
X#define	Fprintf	(void) fprintf
X
Xtypedef unsigned char	uchar;
Xtypedef unsigned short	ushort;
X
Xushort	xpixels;
Xushort	ypixels;
X
Xlong	getlong()
X{
X	register long	x3, x2, x1, x0;
X
X	x0 = getchar();
X	x1 = getchar();
X	x2 = getchar();
X	x3 = getchar();
X
X	return (x0 + (x1 << 8) + (x2 << 16) + (x3 << 24));
X}
X
Xmap_open(fname, p_xpixels, p_ypixels)
Xchar	*fname;
Xint	*p_xpixels;
Xint	*p_ypixels;
X{
X	char		*filename;
X	extern FILE	*myreopen();
X
X	if ( myreopen(filename = fname, "r", stdin,
X		"JETMAPS", STD) == NULL)
X	{
X		error(1, "Couldn't find bitmap file '%s'", filename);
X	}
X
X	*p_xpixels = xpixels = getlong();
X	*p_ypixels = ypixels = getlong();
X
X	return (0);
X}
X
X/*
X *	Read picture
X */
Xmap_read(picbuf)
Xunsigned char	*picbuf;
X{
X	register int	x, y;
X	register int	xbytes = (xpixels + 7)/8;
X	
X	for (y = 0; y < ypixels; ++y)
X	{
X		for (x = 0; x < xbytes; ++x)
X		{
X			picbuf[y*xbytes+x] = (unsigned char) getchar();
X		}
X	}
X
X	return (0);
X}
X
Xmap_close()
X{
X}
X
Xchar	map_opts[] = "";
X
Xmap_option(letter, optarg)
Xchar	letter;
Xchar	*optarg;
X{
X#	ifdef lint
X		return (optarg[letter]);
X#	else
X		return (1);
X#endif
X}
X
Xmap_usage()
X{
X}
END_OF_FILE
if test 1892 -ne `wc -c <'bm/jetbm.c'`; then
    echo shar: \"'bm/jetbm.c'\" unpacked with wrong size!
fi
# end of 'bm/jetbm.c'
fi
if test -f 'bm/unittestC.sh' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'bm/unittestC.sh'\"
else
echo shar: Extracting \"'bm/unittestC.sh'\" \(2119 characters\)
sed "s/^X//" >'bm/unittestC.sh' <<'END_OF_FILE'
X#/*c
X# *	JetRoff - DWB 2.0 postprocessor for HP LaserJet Series II
X# *
X# *	Copyright (c) 1988 PC Research, Inc.  All Rights Reserved.
X# *
X# *	This source code is supplied to you under the terms of the
X# *	contents of the "License" agreement found with this source
X# *	distribution.  You must read the "License" before you use
X# *	this source code in any way.
X# *
X#c*/
X
X#
X# $Id: unittestC.sh,v 1.1 88/08/26 23:26:26 rick Exp $
X#
X# $Log:	unittestC.sh,v $
X# Revision 1.1  88/08/26  23:26:26  rick
X# Initial revision
X# 
X#
X
Xp="-p5,7,11-15"
X
XY=50; X=2300; echo "\033*p${X}x${Y}YCR\c"
XY=650; X=2300; echo "\033*p${X}x${Y}YCRM\c"
XY=1250; X=2300; echo "\033*p${X}x${Y}YCMR\c"
X
XY=0; X=0; echo "\033*p${X}x${Y}Y\c"
Xpcpaint -c -l61 -r101 -t60 -b100 -a0 -H $DEBUG $p sam_16.pic
XY=600; X=0; echo "\033*p${X}x${Y}Y\c"
Xpcpaint -c -l61 -r101 -t60 -b100 -a0 -i -H $DEBUG $p sam_16.pic
XY=1200; X=0; echo "\033*p${X}x${Y}Y\c"
Xpcpaint -c -l61 -r101 -t60 -b100 -i -a0 -H $DEBUG $p sam_16.pic
XY=2900; X=0; echo "\033*p${X}x${Y}YROTATE 0\c"
X
XY=0; X=600; echo "\033*p${X}x${Y}Y\c"
Xpcpaint -c -l61 -r101 -t60 -b100 -a90 -H $DEBUG $p sam_16.pic
XY=600; X=600; echo "\033*p${X}x${Y}Y\c"
Xpcpaint -c -l61 -r101 -t60 -b100 -a90 -i -H $DEBUG $p sam_16.pic
XY=1200; X=600; echo "\033*p${X}x${Y}Y\c"
Xpcpaint -c -l61 -r101 -t60 -b100 -i -a90 -H $DEBUG $p sam_16.pic
XY=2900; X=600; echo "\033*p${X}x${Y}YROTATE 90\c"
X
XY=0; X=1200; echo "\033*p${X}x${Y}Y\c"
Xpcpaint -c -l61 -r101 -t60 -b100 -a180 -H $DEBUG $p sam_16.pic
XY=600; X=1200; echo "\033*p${X}x${Y}Y\c"
Xpcpaint -c -l61 -r101 -t60 -b100 -a180 -i -H $DEBUG $p sam_16.pic
XY=1200; X=1200; echo "\033*p${X}x${Y}Y\c"
Xpcpaint -c -l61 -r101 -t60 -b100 -i -a180 -H $DEBUG $p sam_16.pic
XY=2900; X=1200; echo "\033*p${X}x${Y}YROTATE 180\c"
X
XY=0; X=1800; echo "\033*p${X}x${Y}Y\c"
Xpcpaint -c -l61 -r101 -t60 -b100 -a270 -H $DEBUG $p sam_16.pic
XY=600; X=1800; echo "\033*p${X}x${Y}Y\c"
Xpcpaint -c -l61 -r101 -t60 -b100 -a270 -i -H $DEBUG $p sam_16.pic
XY=1200; X=1800; echo "\033*p${X}x${Y}Y\c"
Xpcpaint -c -l61 -r101 -t60 -b100 -i -a270 -H $DEBUG $p sam_16.pic
XY=2900; X=1800; echo "\033*p${X}x${Y}YROTATE 270\c"
END_OF_FILE
if test 2119 -ne `wc -c <'bm/unittestC.sh'`; then
    echo shar: \"'bm/unittestC.sh'\" unpacked with wrong size!
fi
chmod +x 'bm/unittestC.sh'
# end of 'bm/unittestC.sh'
fi
if test -f 'bm/unittestM.sh' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'bm/unittestM.sh'\"
else
echo shar: Extracting \"'bm/unittestM.sh'\" \(2043 characters\)
sed "s/^X//" >'bm/unittestM.sh' <<'END_OF_FILE'
X#/*c
X# *	JetRoff - DWB 2.0 postprocessor for HP LaserJet Series II
X# *
X# *	Copyright (c) 1988 PC Research, Inc.  All Rights Reserved.
X# *
X# *	This source code is supplied to you under the terms of the
X# *	contents of the "License" agreement found with this source
X# *	distribution.  You must read the "License" before you use
X# *	this source code in any way.
X# *
X#c*/
X
X#
X# $Id: unittestM.sh,v 1.1 88/08/26 23:26:27 rick Exp $
X#
X# $Log:	unittestM.sh,v $
X# Revision 1.1  88/08/26  23:26:27  rick
X# Initial revision
X# 
X#
X
Xp="-p5,7,11-15"
X
XY=50; X=2300; echo "\033*p${X}x${Y}YMR\c"
XY=650; X=2300; echo "\033*p${X}x${Y}YMRC\c"
XY=1250; X=2300; echo "\033*p${X}x${Y}YMCR\c"
X
XY=0; X=0; echo "\033*p${X}x${Y}Y\c"
Xpcpaint -c -i -a0 -H $DEBUG $p sam_16.pic
XY=600; X=0; echo "\033*p${X}x${Y}Y\c"
Xpcpaint -c -i -a0 -l61 -r101 -t60 -b100 -H $DEBUG $p sam_16.pic
XY=1200; X=0; echo "\033*p${X}x${Y}Y\c"
Xpcpaint -c -i -l61 -r101 -t60 -b100 -a0 -H $DEBUG $p sam_16.pic
XY=2900; X=0; echo "\033*p${X}x${Y}YROTATE 0\c"
X
XY=0; X=600; echo "\033*p${X}x${Y}Y\c"
Xpcpaint -c -i -a90 -H $DEBUG $p sam_16.pic
XY=600; X=600; echo "\033*p${X}x${Y}Y\c"
Xpcpaint -c -i -a90 -l61 -r101 -t60 -b100 -H $DEBUG $p sam_16.pic
XY=1200; X=600; echo "\033*p${X}x${Y}Y\c"
Xpcpaint -c -i -l61 -r101 -t60 -b100 -a90 -H $DEBUG $p sam_16.pic
XY=2900; X=600; echo "\033*p${X}x${Y}YROTATE 90\c"
X
XY=0; X=1200; echo "\033*p${X}x${Y}Y\c"
Xpcpaint -c -i -a180 -H $DEBUG $p sam_16.pic
XY=600; X=1200; echo "\033*p${X}x${Y}Y\c"
Xpcpaint -c -i -a180 -l61 -r101 -t60 -b100 -H $DEBUG $p sam_16.pic
XY=1200; X=1200; echo "\033*p${X}x${Y}Y\c"
Xpcpaint -c -i -l61 -r101 -t60 -b100 -a180 -H $DEBUG $p sam_16.pic
XY=2900; X=1200; echo "\033*p${X}x${Y}YROTATE 180\c"
X
XY=0; X=1800; echo "\033*p${X}x${Y}Y\c"
Xpcpaint -c -i -a270 -H $DEBUG $p sam_16.pic
XY=600; X=1800; echo "\033*p${X}x${Y}Y\c"
Xpcpaint -c -i -a270 -l61 -r101 -t60 -b100 -H $DEBUG $p sam_16.pic
XY=1200; X=1800; echo "\033*p${X}x${Y}Y\c"
Xpcpaint -c -i -l61 -r101 -t60 -b100 -a270 -H $DEBUG $p sam_16.pic
XY=2900; X=1800; echo "\033*p${X}x${Y}YROTATE 270\c"
END_OF_FILE
if test 2043 -ne `wc -c <'bm/unittestM.sh'`; then
    echo shar: \"'bm/unittestM.sh'\" unpacked with wrong size!
fi
chmod +x 'bm/unittestM.sh'
# end of 'bm/unittestM.sh'
fi
if test -f 'bsd/getopt.c' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'bsd/getopt.c'\"
else
echo shar: Extracting \"'bsd/getopt.c'\" \(1644 characters\)
sed "s/^X//" >'bsd/getopt.c' <<'END_OF_FILE'
X/*
X**  This is the public-domain AT&T getopt(3) code.  I added the
X**  #ifndef stuff because I include <stdio.h> for the program;
X**  getopt, per se, doesn't need it.  I also added the INDEX/index
X**  hack (the original used strchr, of course).  And, note that
X**  technically the casts in the write(2) calls shouldn't be there.
X*/
X
X#ifndef NULL
X#define NULL	0
X#endif
X#ifndef EOF
X#define EOF	(-1)
X#endif
X#ifndef INDEX
X#define INDEX index
X#endif
X
X
X#define ERR(s, c)	if(opterr){\
X	extern int strlen(), write();\
X	char errbuf[2];\
X	errbuf[0] = c; errbuf[1] = '\n';\
X	(void) write(2, argv[0], (unsigned)strlen(argv[0]));\
X	(void) write(2, s, (unsigned)strlen(s));\
X	(void) write(2, errbuf, 2);}
X
Xextern int strcmp();
Xextern char *INDEX();
X
Xint	opterr = 1;
Xint	optind = 1;
Xint	optopt;
Xchar	*optarg;
X
Xint
Xgetopt(argc, argv, opts)
Xint	argc;
Xchar	**argv, *opts;
X{
X	static int sp = 1;
X	register int c;
X	register char *cp;
X
X	if(sp == 1)
X		if(optind >= argc ||
X		   argv[optind][0] != '-' || argv[optind][1] == '\0')
X			return(EOF);
X		else if(strcmp(argv[optind], "--") == NULL) {
X			optind++;
X			return(EOF);
X		}
X	optopt = c = argv[optind][sp];
X	if(c == ':' || (cp=INDEX(opts, c)) == NULL) {
X		ERR(": illegal option -- ", c);
X		if(argv[optind][++sp] == '\0') {
X			optind++;
X			sp = 1;
X		}
X		return('?');
X	}
X	if(*++cp == ':') {
X		if(argv[optind][sp+1] != '\0')
X			optarg = &argv[optind++][sp+1];
X		else if(++optind >= argc) {
X			ERR(": option requires an argument -- ", c);
X			sp = 1;
X			return('?');
X		} else
X			optarg = argv[optind++];
X		sp = 1;
X	} else {
X		if(argv[optind][++sp] == '\0') {
X			sp = 1;
X			optind++;
X		}
X		optarg = NULL;
X	}
X	return(c);
X}
END_OF_FILE
if test 1644 -ne `wc -c <'bsd/getopt.c'`; then
    echo shar: \"'bsd/getopt.c'\" unpacked with wrong size!
fi
# end of 'bsd/getopt.c'
fi
if test -f 'bsd/getopt1.c' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'bsd/getopt1.c'\"
else
echo shar: Extracting \"'bsd/getopt1.c'\" \(1186 characters\)
sed "s/^X//" >'bsd/getopt1.c' <<'END_OF_FILE'
X/*
X**  GETOPT PROGRAM AND LIBRARY ROUTINE
X**
X**  I wrote main() and AT&T wrote getopt() and we both put our efforts into
X**  the public domain via mod.sources.
X**	Rich $alz
X**	Mirror Systems
X**	(mirror!rs, rs at mirror.TMC.COM)
X**	August 10, 1986
X*/
X
X#include <stdio.h>
X
X
X#ifndef INDEX
X#define INDEX index
X#endif
X
X
Xextern char	*INDEX();
Xextern int	 optind;
Xextern char	*optarg;
X
X
Xmain(ac, av)
X    register int	 ac;
X    register char 	*av[];
X{
X    register char 	*flags;
X    register int	 c;
X
X    /* Check usage. */
X    if (ac < 2) {
X	fprintf(stderr, "usage: %s flag-specification arg-list\n", av[0]);
X	exit(2);
X    }
X
X    /* Play games; remember the flags (first argument), then splice
X       them out so it looks like a "standard" command vector. */
X    flags = av[1];
X    av[1] = av[0];
X    av++;
X    ac--;
X
X    /* Print flags. */
X    while ((c = getopt(ac, av, flags)) != EOF) {
X	if (c == '?')
X	    exit(1);
X	/* We assume that shells collapse multiple spaces in `` expansion. */
X	printf("-%c %s ", c, INDEX(flags, c)[1] == ':' ? optarg : "");
X    }
X
X    /* End of flags; print rest of options. */
X    printf("-- ");
X    for (av += optind; *av; av++)
X	printf("%s ", *av);
X    exit(0);
X}
END_OF_FILE
if test 1186 -ne `wc -c <'bsd/getopt1.c'`; then
    echo shar: \"'bsd/getopt1.c'\" unpacked with wrong size!
fi
# end of 'bsd/getopt1.c'
fi
if test -f 'bsd/jetusageBSD.sh' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'bsd/jetusageBSD.sh'\"
else
echo shar: Extracting \"'bsd/jetusageBSD.sh'\" \(1655 characters\)
sed "s/^X//" >'bsd/jetusageBSD.sh' <<'END_OF_FILE'
X#
X#	JetRoff
X#
X#	BSD doesn't have shell functions, so the help
X#	is now in this file
X#
X	echo "Usage:	jetroff [-p -t -e -g -b]"
X	echo "		[-oLIST -nN -sN -mXX -rR# -i -q -z -a]"
X	echo "		[-Ffontdir -Rrastdir -cN -dDEST -S] files ..."
X	echo
X	echo "	-p -e -t -g	Preprocess with pic, eqn, tbl, and/or grap"
X	echo "	-b		Include bitmap inclusion macros"
X	echo "	-oLIST		Print only pages in LIST"
X	echo "	-nN		Number first page with number N"
X	echo "	-sN		Stop (pause) every N pages"
X	echo "	-mXX		Include the XX macros (/usr/lib/tmax/tmac.XX)"
X	echo "	-rR#		Set register r (a one character name) to #"
X	echo "	-i		Read standard input after all other files"
X	echo "	-q		Invoke simultaneous IO mode of the .rd request"
X	echo "	-z		Print only messages generated by .tm requests"
X	echo "	-a		Send a crude ASCII approximation to terminal"
X	echo "	-Ffontdir	Search for the fonts in fontdir"
X	echo "	-Rrastdir	Search for the rasters in rastdir"
X	echo "	-cN		Have the printer generate N copies (max 99)"
X	echo "	-dDEST		Change printer destination to DEST (- is stdout)"
X	echo "	-lN[:W]		Landscape, N pages/sheet, W is sheet width"
X	echo "	-S		Print document statistics to stderr"
X	echo "	-h -?		Print this usage message"
X	echo
X	echo "Example:	jetroff -mm mymemo.mm"
X	echo "Example:	jetroff -man manpage.man"
X	echo "Example:	jetroff -b -mm bitmaps.mm"
X	echo
X	echo "The need for the -e, -t, -p, -g, and -b flags are determined"
X	echo "automatically by jetroff by scanning the document.  The flags"
X	echo "are provided for those cases where jetroff cannot determine"
X	echo "a need for these flags, usually because the document includes"
X	echo ".so (include file) requests."
END_OF_FILE
if test 1655 -ne `wc -c <'bsd/jetusageBSD.sh'`; then
    echo shar: \"'bsd/jetusageBSD.sh'\" unpacked with wrong size!
fi
chmod +x 'bsd/jetusageBSD.sh'
# end of 'bsd/jetusageBSD.sh'
fi
if test -f 'djet/jetcheck.c' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'djet/jetcheck.c'\"
else
echo shar: Extracting \"'djet/jetcheck.c'\" \(1775 characters\)
sed "s/^X//" >'djet/jetcheck.c' <<'END_OF_FILE'
X/*c
X *	JetRoff - DWB 2.0 postprocessor for HP LaserJet Series II
X *
X *	Copyright (c) 1988 PC Research, Inc.  All Rights Reserved.
X *
X *	This source code is supplied to you under the terms of the
X *	contents of the "License" agreement found with this source
X *	distribution.  You must read the "License" before you use
X *	this source code in any way.
X *
Xc*/
X
Xstatic char	Copyright[] =
X"@(#) JetRoff (c) Copyright 1988 PC Research, Inc.  All Rights Reserved.";
X
X/*
X * $Id: jetcheck.c,v 1.1 88/08/26 23:10:57 rick Exp $
X *
X * $Log:	jetcheck.c,v $
X * Revision 1.1  88/08/26  23:10:57  rick
X * Initial revision
X * 
X */
X#ifndef lint
Xstatic char rcsid[] = "@(#) $Id: jetcheck.c,v 1.1 88/08/26 23:10:57 rick Exp $";
X#endif
X
X#include <stdio.h>
X#include <string.h>
X
X/*
X *	Finger out what flags to hand to jetroff
X */
X
Xmain(argc, argv)
Xint	argc;
Xchar	*argv[];
X{
X	register int	i;
X	register FILE	*fp;
X	int		pflag = 0;
X	int		tflag = 0;
X	int		eflag = 0;
X	int		gflag = 0;
X	int		bflag = 0;
X	char		buf[BUFSIZ];
X	extern void	exit();
X
X	for (i = 1; i < argc; ++i)
X	{
X		fp = fopen(argv[i], "r");
X		if (!fp)
X		{
X			(void) fprintf(stderr, "%s: Can't open '%s'\n",
X				argv[0], argv[i]);
X			continue;
X		}
X		while (fgets(buf, sizeof(buf), fp))
X		{
X			if (strncmp(buf, ".TS", 3) == 0) tflag = 1;
X			else if (strncmp(buf, ".PS", 3) == 0) pflag = 1;
X			else if (strncmp(buf, ".EQ", 3) == 0) eflag = 1;
X			else if (strncmp(buf, ".G1", 3) == 0) gflag = 1;
X			else if (strncmp(buf, ".BM", 3) == 0) bflag = 1;
X			if (tflag && pflag && eflag && gflag && bflag)
X				{ (void) fclose(fp); goto done; }
X		}
X		(void) fclose(fp);
X	}
Xdone:
X	(void) printf("%s%s%s%s%s\n",
X		tflag ? " -t" : "",
X		pflag ? " -p" : "",
X		eflag ? " -e" : "",
X		gflag ? " -g" : "",
X		bflag ? " -b" : ""
X		);
X	exit (0);
X	/* NOTREACHED */
X}
END_OF_FILE
if test 1775 -ne `wc -c <'djet/jetcheck.c'`; then
    echo shar: \"'djet/jetcheck.c'\" unpacked with wrong size!
fi
# end of 'djet/jetcheck.c'
fi
if test -f 'djet/line.c' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'djet/line.c'\"
else
echo shar: Extracting \"'djet/line.c'\" \(2475 characters\)
sed "s/^X//" >'djet/line.c' <<'END_OF_FILE'
X/*c
X *	JetRoff - DWB 2.0 postprocessor for HP LaserJet Series II
X *
X *	Copyright (c) 1988 PC Research, Inc.  All Rights Reserved.
X *
X *	This source code is supplied to you under the terms of the
X *	contents of the "License" agreement found with this source
X *	distribution.  You must read the "License" before you use
X *	this source code in any way.
X *
Xc*/
X
X/*
X * $Id: line.c,v 1.1 88/08/26 23:11:01 rick Exp $
X *
X * $Log:	line.c,v $
X * Revision 1.1  88/08/26  23:11:01  rick
X * Initial revision
X * 
X */
X#ifndef lint
Xstatic char rcsid[] = "@(#) $Id: line.c,v 1.1 88/08/26 23:11:01 rick Exp $";
X#endif
X
X#include "dlj.h"
X
Xdraw_line (x1, y1, x2, y2)
Xint x1, y1, x2, y2;
X{
X	if (y1 == y2)
X		draw_horiz(x1, y1, x2);
X	else if (x1 == x2)
X		draw_vert(x1, y1, y2);
X	else
X		draw_hardline(x1, y1, x2, y2);
X}
X
Xint	pen_width[36] =
X{
X	1,
X	1,1,1,1,1,1,1,1,1,1,1,		/*  1-11 */
X	2,2,2,2,			/* 12-15 */
X	3,3,3,3,			/* 16-19 */
X	4,4,4,4,			/* 20-23 */
X	6,6,6,6,			/* 24-27 */
X	7,7,7,7,7,7,7,7			/* 28-35 */
X};
X
Xdraw_vert(x1, y1, y2)
X{
X#	if 0
X		draw_hardline(x1, y1, x1, y2);
X#	else
X		register int t;
X		if (y1 > y2) { t = y1; y1 = y2; y2 = t;}
X		if (PointSize >= 36) t = 8; else t = pen_width[PointSize];
X		hp_pos(x1, y1-t+1);
X		esc("*c%da%db0P", t, y2-y1+t);
X#	endif
X}
X
Xdraw_horiz(x1, y1, x2)
X{
X#	if 0
X		draw_hardline(x1, y1, x2, y1);
X#	else
X		register int t;
X		if (x1 > x2) { t = x1; x1 = x2; x2 = t;}
X		if (PointSize >= 36) t = 8; else t = pen_width[PointSize];
X		hp_pos(x1, y1-t+1);
X		esc("*c%da%db0P", x2-x1+t, t);
X#	endif
X}
X
Xdraw_hardline (x1, y1, x2, y2)
Xint x1, y1, x2, y2;
X{
X	register int	x,y;
X	register int	d;
X	int		dx, dy;
X	int		Aincr, Bincr;
X	int		incr;
X
X	dx = x2 - x1; if (dx < 0) dx = -dx;
X	dy = y2 - y1; if (dy < 0) dy = -dy;
X
X	if (dx == 0 || dy > dx)
X	{	/* draw line by incrementing y */
X		Aincr = 2*(dx-dy); Bincr = 2*dx; d = 2*dx - dy;
X		if (y1 > y2)	/* swap */
X			{ x = x1; x1 = x2; x2 = x; y = y1; y1 = y2; y2 = y; }
X		incr = (x2 > x1) ? 1 : -1;
X		draw_point(x = x1, y1);
X		for (y = y1 + 1; y <= y2; ++y)
X		{
X			if ( d >= 0)
X				{ d += Aincr; x += incr; }
X			else
X				d += Bincr;
X			draw_point(x, y);
X		}
X	}
X	else
X	{	/* draw line by incrementing x */
X		Aincr = 2*(dy-dx); Bincr = 2*dy; d = 2*dy - dx;
X		if (x1 > x2)	/* swap */
X			{ x = x1; x1 = x2; x2 = x; y = y1; y1 = y2; y2 = y; }
X		incr = (y2 > y1) ? 1 : -1;
X		draw_point(x1, y = y1);
X		for (x = x1 + 1; x <= x2; ++x)
X		{
X			if (d >= 0)
X				{ d += Aincr; y += incr; }
X			else
X				d += Bincr;
X			draw_point(x, y);
X		}
X	}
X}
END_OF_FILE
if test 2475 -ne `wc -c <'djet/line.c'`; then
    echo shar: \"'djet/line.c'\" unpacked with wrong size!
fi
# end of 'djet/line.c'
fi
if test -f 'djet/lj.h' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'djet/lj.h'\"
else
echo shar: Extracting \"'djet/lj.h'\" \(2245 characters\)
sed "s/^X//" >'djet/lj.h' <<'END_OF_FILE'
X/*c
X *	JetRoff - DWB 2.0 postprocessor for HP LaserJet Series II
X *
X *	Copyright (c) 1988 PC Research, Inc.  All Rights Reserved.
X *
X *	This source code is supplied to you under the terms of the
X *	contents of the "License" agreement found with this source
X *	distribution.  You must read the "License" before you use
X *	this source code in any way.
X *
Xc*/
X
X/*
X * $Id: lj.h,v 1.1 88/08/26 23:11:02 rick Exp $
X *
X * $Log:	lj.h,v $
X * Revision 1.1  88/08/26  23:11:02  rick
X * Initial revision
X * 
X */
X
X/*
X *	lj.h:	LaserJet font/char descriptor structures
X */
X
Xtypedef struct
X{
X	ushort	font_desc_size;
X#				define FONT_DESC_SIZE	64
X	uchar	r1;
X	uchar	font_type;
X#				define FONT_TYPE_7BIT	0
X#				define FONT_TYPE_8BIT	1
X#				define FONT_TYPE_PC8	2
X	ushort	r2;
X	ushort	baseline_dist;
X	ushort	cell_width;
X	ushort	cell_height;
X	uchar	orientation;
X#				define ORIENTATION_PORTRAIT	0
X#				define ORIENTATION_LANDSCAPE	1
X	uchar	spacing;
X#				define SPACING_FIXED		0
X#				define SPACING_PROPORTIONAL	1
X	ushort	symbol_set;
X#				define SYMBOLSET_HP_ROMAN8	277
X	ushort	pitch;
X	ushort	height;
X	ushort	xheight;
X	char	width_type;
X#				define WIDTH_CONDENSED		-2
X#				define WIDTH_SEMICONDENSED	-1
X#				define WIDTH_NORMAL		0
X#				define WIDTH_SEMIEXPANDED	1
X#				define WIDTH_EXPANDED		2
X	uchar	style;
X#				define STYLE_UPRIGHT		0
X#				define STYLE_ITALICS		1
X	char	stroke_weight;
X#				define STROKE_MEDIUM		0
X#				define STROKE_BOLD		3
X#				define STROKE_LIGHT		-3
X	uchar	typeface;
X#				define TYPEFACE_LINEPRINTER	0
X#				define TYPEFACE_HELV		4
X#				define TYPEFACE_TMSRMN		5
X	uchar	r3;
X	uchar	serif_style;
X#				define SERIF_SANS_SQUARE	0
X	ushort	r4;
X	char	underline_dist;
X	uchar	underline_height;
X	ushort	text_height;
X	ushort	text_width;
X	ushort	r5;
X	ushort	r6;
X	uchar	pitch_extended;
X	uchar	height_extended;
X	ushort	r7;
X	ushort	r8;
X	ushort	r9;
X	char	font_name[16];
X} LJ_FONT_DESC;
X
Xtypedef struct
X{
X	uchar	char_desc_format;
X#				define	CHAR_DESC_FORMAT	4
X	char	continuation;
X	uchar	char_desc_size;
X#				define	CHAR_DESC_SIZE		14
X	uchar	class;
X#				define	CLASS			1
X	uchar	orientation;
X	uchar	r1;
X	short	left_offset;
X	short	top_offset;
X	ushort	char_width;
X	ushort	char_height;
X	short	delta_x;
X} LJ_CHAR_DESC;
X
X#define ljmap(c)	((c) < 32 ? (c)+128+32 : (c) )
END_OF_FILE
if test 2245 -ne `wc -c <'djet/lj.h'`; then
    echo shar: \"'djet/lj.h'\" unpacked with wrong size!
fi
# end of 'djet/lj.h'
fi
if test -f 'djet/spline.c' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'djet/spline.c'\"
else
echo shar: Extracting \"'djet/spline.c'\" \(2481 characters\)
sed "s/^X//" >'djet/spline.c' <<'END_OF_FILE'
X/*c
X *	JetRoff - DWB 2.0 postprocessor for HP LaserJet Series II
X *
X *	Copyright (c) 1988 PC Research, Inc.  All Rights Reserved.
X *
X *	This source code is supplied to you under the terms of the
X *	contents of the "License" agreement found with this source
X *	distribution.  You must read the "License" before you use
X *	this source code in any way.
X *
Xc*/
X
X/*
X * $Id: spline.c,v 1.1 88/08/26 23:11:06 rick Exp $
X *
X * $Log:	spline.c,v $
X * Revision 1.1  88/08/26  23:11:06  rick
X * Initial revision
X * 
X */
X#ifndef lint
Xstatic char rcsid[] = "@(#) $Id: spline.c,v 1.1 88/08/26 23:11:06 rick Exp $";
X#endif
X
X#include <stdio.h>
X#include <math.h>
X
Xstatic int oldx, oldy;
X
Xdraw_spline(cx, cy, s)
Xchar	*s;
X{
X	int	x[3], y[3];
X	int	dx, dy;
X
X	oldx = x[1] = x[2] = cx;
X	oldy = y[1] = y[2] = cy;
X	for (;;)
X	{
X		x[0] = x[1]; y[0] = y[1];
X		x[1] = x[2]; y[1] = y[2];
X		if (getnum(&s, &dx) && getnum(&s, &dy))
X		{
X			x[2] = x[1] + dx;
X			y[2] = y[1] + dy;
X			if (diff3(x, y)) spline3(x, y);
X		}
X		else
X			break;
X	}
X	if (diff3(x, y))
X		spline3(x, y);
X	{
X		extern int TroffX, TroffY;
X		TroffX = x[2];
X		TroffY = y[2];
X	}
X}
Xdiff3(x, y)
Xint	x[3], y[3];
X{
X	if (x[0]!=x[1] || x[1]!=x[2] || y[0]!=y[1] || y[1]!=y[2])
X		return 1;
X	else
X		return 0;
X}
X
Xgetnum(pp, valp)
Xchar	**pp;
Xint	*valp;
X{
X	register char	*p;
X	register int	value;
X	register int	neg;
X
X	for(p = *pp; *p == ' ' || *p == '\t' || *p == '\n'; ++p)
X		{}
X	if (*p == 0) { *pp = p; return 0; }
X	for (value = 0, neg = 0; *p == '-' || (*p >= '0' && *p <= '9'); ++p)
X		if (*p == '-') neg = 1;
X		else value = value*10 + *p - '0';
X	if (neg) value = -value;
X	*pp = p;
X	*valp = value;
X	return (1);
X}
X
Xdist(x1, Y1, x2, Y2)
X{
X	double dx, dy;
X
X	dx = x2 - x1;
X	dy = Y2 - Y1;
X	return sqrt(dx*dx + dy*dy) + 0.5;
X}
X
Xspline3(x, y)
Xint	x[3];
Xint	y[3];
X{
X	double		xA, xB, xC;
X	double		yA, yB, yC;
X	double		t;
X	register int	del;
X	register int	i;
X	register int	newx, newy;
X
X	xA = ( (x[0] + x[2]) >> 1) - x[1];
X	yA = ( (y[0] + y[2]) >> 1) - y[1];
X	xB = x[1] - x[0];
X	yB = y[1] - y[0];
X	xC = (x[0] + x[1]) >> 1;
X	yC = (y[0] + y[1]) >> 1;
X	del = (dist(x[0],y[0], x[1],y[1]) + dist(x[1],y[1], x[2],y[2])) / 2;
X	if (del == 0) del = 1;
X
X	for (i = 0; i <= del; ++i)
X	{
X		t = (double) i / (double) del;
X		newx = (xA*t + xB) * t + xC;
X		newy = (yA*t + yB) * t + yC;
X		if (newx != oldx || newy != oldy)
X		{
X			/* (void) fprintf(stderr, " (%d,%d)->(%d,%d)",
X				oldx, oldy, newx, newy); */
X			draw_hardline(oldx, oldy, newx, newy);
X			oldx = newx;
X			oldy = newy;
X		}
X	}
X}
END_OF_FILE
if test 2481 -ne `wc -c <'djet/spline.c'`; then
    echo shar: \"'djet/spline.c'\" unpacked with wrong size!
fi
# end of 'djet/spline.c'
fi
if test -f 'doc/djet.1.spec' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'doc/djet.1.spec'\"
else
echo shar: Extracting \"'doc/djet.1.spec'\" \(1532 characters\)
sed "s/^X//" >'doc/djet.1.spec' <<'END_OF_FILE'
X.ft R
X.ta .25i +.25i +.25i +.25i +.25i +.25i +.25i +.25i +.25i +.25i +.25i +.25i +.25i +.25i +.25i +.25i +.25i +.25i +.25i
X.ps 16
X.vs 24
X\(*G	\(*D	\(*H	\(*L	\(*C	\(*P	\(*S	\(*U	\(*F	\(*Q	\(*W	\(ff	\(fi	\(fl	\(Fi	\(Fl
X.ps 6
X.vs 12
X\f(CW*G	*D	*H	*L	*C	*P	*S	*U	*F	*Q	*W	ff	fi	fl	Fi	Fl\fP
X.ps 16
X.vs 24
X\(ga	\(aa	\(fm	\(hc	\(de	\(cd	\(pl	\(hy	\(eq	\(en	\(\-	\(em	\(vs	\(mi	\(mu	\(di
X.ps 6
X.vs 12
X\f(CWga	aa	fm	hc	de	cd	pl	hy	eq	en	\-	em	vs	mi	mu	di\fP
X.ps 16
X.vs 24
X\(+-	\(-+	\(o+	\(O+	\(o-	\(O-	\(ox	\(Ox	\(o/	\(O/	\(o.	\(O.	\(ci	\(ob	\(bu	\(==
X.ps 6
X.vs 12
X\f(CW+-	-+	o+	O+	o-	O-	ox	Ox	o/	O/	o.	O.	ci	ob	bu	==\fP
X.ps 16
X.vs 24
X\(ib	\(ip	\(le	\(<=	\(ge	\(>=	\(ap	\(cy	\(~~	\(sb	\(sp	\(<-	\(->	\(ua	\(da	\(~=
X.ps 6
X.vs 12
X\f(CWib	ip	le	<=	ge	>=	ap	cy	~~	sb	sp	<-	->	ua	da	~=\fP
X.ps 16
X.vs 24
X\(ld	\(rd	\(pt	\(if	\(mo	\(TR	\(fa	\(te	\(no	\(es	\(pp	\(cu	\(ca	\(as	\(os	\(ts
X.ps 6
X.vs 12
X\f(CWld	rd	pt	if	mo	TR	fa	te	no	es	pp	cu	ca	as	os	ts\fP
X.ps 16
X.vs 24
X\(gr	\(is	\(sc	\(dg	\(dd	\(pg	\(lt	\(lb	\(rt	\(rb	\(lk	\(rk	\(bv	\(lf	\(rf	\(lc
X.ps 6
X.vs 12
X\f(CWgr	is	sc	dg	dd	pg	lt	lb	rt	rb	lk	rk	bv	lf	rf	lc\fP
X.ps 16
X.vs 24
X\(rc	\(sr	\(rn	\(ul	\(ru	\(br	\(co	\(*a	\(*b	\(*g	\(*d	\(*e	\(*z	\(*y	\(*h	\(*i
X.ps 6
X.vs 12
X\f(CWrc	sr	rn	ul	ru	br	co	*a	*b	*g	*d	*e	*z	*y	*h	*i\fP
X.ps 16
X.vs 24
X\(*k	\(*l	\(*m	\(*n	\(*c	\(*p	\(*r	\(*s	\(*t	\(*u	\(*f	\(*x	\(*q	\(*w	\(xe	\(xh
X.ps 6
X.vs 12
X\f(CW*k	*l	*m	*n	*c	*p	*r	*s	*t	*u	*f	*x	*q	*w	xe	xh\fP
X.ps 16
X.vs 24
X\(rh	\(lh	\(pd	\(Sl	\(cs	\(sq	\(bx	\(tm
X.ps 6
X.vs 12
X\f(CWrh	lh	pd	Sl	cs	sq	bx	tm\fP
X.ft R
END_OF_FILE
if test 1532 -ne `wc -c <'doc/djet.1.spec'`; then
    echo shar: \"'doc/djet.1.spec'\" unpacked with wrong size!
fi
# end of 'doc/djet.1.spec'
fi
if test -f 'doc/jetbackup.1' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'doc/jetbackup.1'\"
else
echo shar: Extracting \"'doc/jetbackup.1'\" \(2113 characters\)
sed "s/^X//" >'doc/jetbackup.1' <<'END_OF_FILE'
X.TH jetbackup 1 "PC Research, Inc." "JetRoff"
X.SH NAME
Xjetbackup \- Print landscape documents on both sides of a piece of paper
X.SH SYNOPSIS
X\fBjetbackup [-b] [-w\fIWIDTH\fP]\fR
X.SH DESCRIPTION
X\fIjetbackup\fP is a filter which takes \fBlandscape\fP orientation
X\fIjetroff\fP(1) output
Xand rearranges things so that two pages are printed side by side on
Xa sheet of paper, and if each sheet is re-fed into the printer, the
Xbackside will also be printed.  The four logical pages which are printed
Xare order such that logical page two appears directly behind logical
Xpage one, and likewise for pages three and four.
X.PP
XThe \fI-w\fP option specifies the width of the physical paper.  The
Xunits are inches, and the default is 14 inches.
X.PP
XThe \fI-b\fP option will cause ``This Page Intentionally Left Blank''
Xto be printed on the back of any jobs with an odd number of logical
Xpages. 
X.PP
XThis filter is ideal for producing manual pages and the like.
X.SH EXAMPLE
X.P
XA manual page printed backup, ready for slicing and placing into
Xa PC style binder:
X.RS
X\f(CW$ jetroff -manual -rs1 -l1:14i -d- afio.1 | jetbackup -b -w14i | lp -otroff\fP
X.RE
X.P
XNote that you tell \fIjetroff\fP to print one logical page in
Xlandscape orientation on legal size paper,
Xand you tell the \fIman\fP macros that
Xyou want the reduced page size.  \fIjetbackup\fP is told that the
Xphysical page size is legal size paper; it will automatically place
Xfour logical pages on each physical sheet of paper.  The exact
Xoptions for \fIlp\fP vary from system to system, but the important
Xthing is to make sure the output does not have any end-of-line
Xtranslations performed.
X.P
XOn a LaserJet Series II, feed in the first sheet of paper through
Xthe manual feed.  When it reappears in the hopper, feed it
Xa second time into the manual feed;  do not rotate or flip the
Xpaper as you remove it from the hopper.  Repeat for each
Xadditional sheet of paper.  Then, slice the sheets in half, collate,
Xand three hole punch.
X.SH BUGS
XThis program should really be part of \fIdjet\fP(1).  It cannot
Xbackup portrait orientation documents.
X.SH SEE ALSO
Xjetroff(1)
END_OF_FILE
if test 2113 -ne `wc -c <'doc/jetbackup.1'`; then
    echo shar: \"'doc/jetbackup.1'\" unpacked with wrong size!
fi
# end of 'doc/jetbackup.1'
fi
if test -f 'doc/jetbm.1' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'doc/jetbm.1'\"
else
echo shar: Extracting \"'doc/jetbm.1'\" \(2343 characters\)
sed "s/^X//" >'doc/jetbm.1' <<'END_OF_FILE'
X.TH jetbm 1 "PC Research, Inc." "JetRoff"
X.SH NAME
Xjetbm \- Read a standard JetRoff bitmap
X.SH SYNOPSIS
X\fBjetbm [ \fIoptions\fP ] \fIfilename
X.SH DESCRIPTION
X\fIjetbm\fP(1) reads the JetRoff "standard" bitmap
Xfrom \fIfilename\fP.
XThe picture is written to standard output
Xin the following format.  First,
Xthe number of horizontal dots and vertical dots are written using \fIputw\fP(3).
XThen the scanlines of the picture are written, top to bottom and left
Xto right, as
Xa sequence of bytes.  Each byte contains 8 horizontal pixels.
XIf the horizontal size is not a multiple of 8, the last byte on
Xeach scanline is padded with zero bits.  The most significant bit
Xof each byte corresponds to the leftmost pixel.
X.P
X\fIjetbm\fP pictures are stored in a very simple format.
XThe picture starts off with the width of the picture in pixels.  This
Xnumber is four bytes long and the least significant byte is first.
XNext comes the picture height in pixels, also four bytes long.
XFinally, the pixels of the picture are stored, eight pixels per
Xbyte.  The most significant bit of each bit is the leftmost pixel.
XThe bytes come row by row. 
X.P
XSeveral options are available to modify the bitmap. These are:
X.IP \fB-a\fP\fIangle\fP .5i
XRotate the bitmap counterclockwise \fIangle\fP degrees.
X\fIangle\fP may be 90, 180, or 270.
X.IP \fB-c\fP .5i
XComplement the bitmap.  Print white areas of the bitmap as black,
Xand vice-versa.
X.IP \fB-i\fP .5i
XInvert the bitmap.  Flip the bitmap over right to left, so that it
Xlooks like its reflection in a mirror.
X.IP \fB-r\fP\fIpixels\fP .5i
XClip \fIpixels\fP dots off of the right edge of the bitmap.
X.IP \fB-l\fP\fIpixels\fP .5i
XClip \fIpixels\fP dots off of the left edge of the bitmap.
X.IP \fB-t\fP\fIlines\fP .5i
XClip \fIlines\fP off of the top edge of the bitmap.
X.IP \fB-b\fP\fIlines\fP .5i
XClip \fIlines\fP off of the bottom edge of the bitmap.
X.IP \fB-H\fP .5i
XWrite output in HP LaserJet PCL directly to standard output (for testing).
X.IP \fB-S\fP .5i
XWrite only the number of horizontal dots and vertical dots to
Xstandard output.  The values are written using \fIputw\fP(3).
X.P
XThe options above may be combined in a command line as needed.
XThey are processed from left to right; different ordering of
Xthese options may produce different results.
X.SH SEE ALSO
Xjetroff(1), .BM(5), pcpaint(1), pcx(1), putw(3)
END_OF_FILE
if test 2343 -ne `wc -c <'doc/jetbm.1'`; then
    echo shar: \"'doc/jetbm.1'\" unpacked with wrong size!
fi
# end of 'doc/jetbm.1'
fi
if test -f 'doc/monster.clp' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'doc/monster.clp'\"
else
echo shar: Extracting \"'doc/monster.clp'\" \(2466 characters\)
sed "s/^X//" <<'END_OF_FILE' | uudecode
Xbegin 644 xYzZy
XM'YV0HA( "% ,@$&#_P(@0 ! 1@  _!!\@"B1H at 0 ?_X!^P#H +\'CSX$^(>/
XM'\)_@'P at 8(#Q'SR.'_Z!_'" I$D __Z!4\DR(SZ./_X]"OG YDEX/ 'X"< /
XMZ*^A'SX$*XD2P !\"!HHA0CT ]0/@?#E!#<0JU8_7 ']\!I2JEB75LUN;:H6
XMP,RB8J\6A9=U+E"[(6OB\Q< 7]"=*Y46_CMSY.#"&5,FSOBR[LRRA <;3)H1
XM'..0F O?Y.SR\\2K_Z[Z,_ at G\5)\?Q[]^YAS@$O*/ENS1,LO]NP#^?S9!G<X
XM*&S7$'WS"P .CVU 1:&31(E at P5R#/_I2M\X;NW9 U17?S*YU>\N?:K^'IPRT
XMK^Z6&]-K50E at R<,* Z'@#Z ___[^_/V'P $#$6%@$082@>"!"2ZH8(,# E! 
XM!!160&$$%E9X8888(D! !$ @8   %"1(A8DH&GBBBAX2 86( $1QH8P4TAB!
XMC3AZ& $%"!10((- /AAD$3TJV*.$&R:IX9(=&@"BAR2F2,2*4TJYXA?\&/@B
XM 0 @<$$$YYP320000%FBBE:F:<0!X)#A(I0XSBAGC7*"%4@^.T*)@ 5$G!'.
XM(>88>)!"%D00!C@''$+AH TV.F2C10"" 08!$%/$H'M&@(]!'XS)Z*.@/E@$
XM2B-9BFFAFP+0:02?"NFJ@[ J*"FEIAI$J*&(*AJ!GGSZ":B!<,YYH[!QVHDG
XMCUR>626:S"Y;Y9IMOLFEEV"*2::9:39+Y8E<8,F%M$@RR>&X2=XSIKDA<AF 
XMHZ^R6\0159 !;QDPQDGGO<-2>$45<5Q0!1TP*KMMMD3L*V\5<, XH;A*8KBA
XMN1'< PR,ZX8:ZX'?$M'%0@!DJ!^%'T<0\L@>(R!0%508A++**0.PLLLMH\R0
XM"P( 0((80H!QI D&D*#S! !@$$DBD!R902(8% WTS4:$Z*,!1OB, -!")P*>
XMCPD at K;3-8C1])-12 YW)V!2/C0D"%PE at QMHPJLWV10&,G4G99*>]MAEMWXWV
XM0'+3/;?=;(_H-MYP]SUBW'4#,+C3 !B@=^%C7PU  GT#?;?./IJP-AE3 R!W
XMT3YF8';GFIM!!@ $$ $$ )=W3GDFF ! (02>1][YX  D.#@"^,E=R(5)C([?
XMW6X:2#SO71*0R86?(U]Z\42TCI_H8S-O.WZEFV&@$7>'B-_KRU,H-WCX.;[V
XM]MTC#[[UF9#?^-WHK^W]Y'*S[[[YT*?_/=D37O\^YP6(GAGF%X ,#"@"D=@3
XMZDRF.N0I) &[LL "$]# _9 at L@@.AQ("(D 4$L$H$1@"!001 KP-$P P' 2$(
XMPA,!I-E*$R(B at A$R<9"A82 \72/!"$MXPH/DD(4N' @,#2!#&AK$AN&YVPCQ
XMYB0)H%!QFPL/]6PU-R(6P8B(.YMUE A%$47 B4LTG13'1L487I&*L$NB_-X7
XMA1Y%P (#?)\8K4,]2 ! =(0H4O#L2#TM=ND 9 at B#&TT at HCG>4429T&  .VB 
XM3!3-.H1T'+TF-" SZ,PZ"1C0W%)'I .T+SP"J*2.)"!*K2#R; $\95\BB;</
XMD=)Q.M-*)AO9(B(U$CP.Z)+C1MDC,=(ND\HC1(*2X*%/ LUM,NK'&]EV at 3MF
XMPD!9NF+1FGFA";SC0F5J9NJ(<(1=)"A$U*20!]P1C=EY*7<&VL,N:)&@<U[(
XM'^Y0YK6:F:!][((7[91@ "[D#G>TXT(*W&8W=^%- Q%0G/TD)X4"FDZ"KM.@
XM#EPH ?RY4 ENTT.[P 5$\0/0B?[S6OBY* $RNM&!2)2BNZ(G$3"JT97J\Z0?
XM/2>P1MI2=T; !0D-QSQ11P0U$%07I&A@,_>I"E>X0QVIV%4& & $50A3":I8
XBZ5(EH(HQ:4 595HJ$:(J0U1(59?7TD"74KF!Y%T+ #0# %4&
X 
Xend
END_OF_FILE
chmod +rw xYzZy; uncompress <xYzZy >doc/monster.clp; rm xYzZy
if test 2466 -ne `wc -c <'doc/monster.clp'`; then
    echo shar: \"'doc/monster.clp'\" unpacked with wrong size!
fi
# end of 'doc/monster.clp'
fi
if test -f 'doc/pcpaint.1' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'doc/pcpaint.1'\"
else
echo shar: Extracting \"'doc/pcpaint.1'\" \(2497 characters\)
sed "s/^X//" >'doc/pcpaint.1' <<'END_OF_FILE'
X.TH pcpaint 1 "PC Research, Inc." "JetRoff"
X.SH NAME
Xpcpaint \- Read a \fIPC Paint Plus\fP bitmap
X.SH SYNOPSIS
X\fBpcpaint [ \fIoptions\fP ] \fIfilename
X.SH DESCRIPTION
X\fIpcpaint\fP(1) reads the \fIPC Paint Plus\fP picture or clipping
Xfrom \fIfilename\fP.
XThe picture is written to standard output
Xin the following format.  First,
Xthe number of horizontal dots and vertical dots are written using \fIputw\fP(3).
XThen the scanlines of the picture are written, top to bottom and left
Xto right, as
Xa sequence of bytes.  Each byte contains 8 horizontal pixels.
XIf the horizontal size is not a multiple of 8, the last byte on
Xeach scanline is padded with zero bits.  The most significant bit
Xof each byte corresponds to the leftmost pixel.
X.P
X\fIPC Paint Plus\fP pictures can be stored in several formats.
XMost of these can be discerned by a magic number in the file.
XHowever, clipping files are not recognizable unless the filename
Xis suffixed with \fB.clp\fP.
X.P
XSeveral options are available to modify the bitmap. These are:
X.IP \fB-a\fP\fIangle\fP .5i
XRotate the bitmap counterclockwise \fIangle\fP degrees.
X\fIangle\fP may be 90, 180, or 270.
X.IP \fB-c\fP .5i
XComplement the bitmap.  Print white areas of the bitmap as black,
Xand vice-versa.
X.IP \fB-i\fP .5i
XInvert the bitmap.  Flip the bitmap over right to left, so that it
Xlooks like its reflection in a mirror.
X.IP \fB-r\fP\fIpixels\fP .5i
XClip \fIpixels\fP dots off of the right edge of the bitmap.
X.IP \fB-l\fP\fIpixels\fP .5i
XClip \fIpixels\fP dots off of the left edge of the bitmap.
X.IP \fB-t\fP\fIlines\fP .5i
XClip \fIlines\fP off of the top edge of the bitmap.
X.IP \fB-b\fP\fIlines\fP .5i
XClip \fIlines\fP off of the bottom edge of the bitmap.
X.IP \fB-p\fP\fIpalette\fP .5i
XPixels whose values are in the \fIpalette\fP list are black.  The
Xdefault \fIpalette\fP is all pixels which are non-zero.  The
X\fIpalette\fP is a list of comma separated individual pixel values
Xor ranges.  A range is \fIfirst-last\fP, which is all values from
X\fIfirst\fP to \fIlast\fP, inclusive.
X.IP \fB-H\fP .5i
XWrite output in HP LaserJet PCL directly to standard output (for testing).
X.IP \fB-S\fP .5i
XWrite only the number of horizontal dots and vertical dots to
Xstandard output.  The values are written using \fIputw\fP(3).
X.P
XThe options above may be combined in a command line as needed.
XThey are processed from left to right; different ordering of
Xthese options may produce different results.
X.SH SEE ALSO
Xjetroff(1), .BM(5), jetbm(1), pcx(1), putw(3)
END_OF_FILE
if test 2497 -ne `wc -c <'doc/pcpaint.1'`; then
    echo shar: \"'doc/pcpaint.1'\" unpacked with wrong size!
fi
# end of 'doc/pcpaint.1'
fi
if test -f 'doc/pcx.1' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'doc/pcx.1'\"
else
echo shar: Extracting \"'doc/pcx.1'\" \(2300 characters\)
sed "s/^X//" >'doc/pcx.1' <<'END_OF_FILE'
X.TH pcx 1 "PC Research, Inc." "JetRoff"
X.SH NAME
Xpcx \- Read a \fIPC Paintbrush\fP .PCX bitmap
X.SH SYNOPSIS
X\fBpcx [ \fIoptions\fP ] \fIfilename
X.SH DESCRIPTION
X\fIpcx\fP(1) reads the \fIPC Paintbrush\fP picture
Xfrom \fIfilename\fP.  The picture must be stored in .PCX format.
XThe picture is written to standard output
Xin the following format.  First,
Xthe number of horizontal dots and vertical dots are written using \fIputw\fP(3).
XThen the scanlines of the picture are written, top to bottom and left
Xto right, as
Xa sequence of bytes.  Each byte contains 8 horizontal pixels.
XIf the horizontal size is not a multiple of 8, the last byte on
Xeach scanline is padded with zero bits.  The most significant bit
Xof each byte corresponds to the leftmost pixel.
X.P
XSeveral options are available to modify the bitmap. These are:
X.IP \fB-a\fP\fIangle\fP .5i
XRotate the bitmap counterclockwise \fIangle\fP degrees.
X\fIangle\fP may be 90, 180, or 270.
X.IP \fB-c\fP .5i
XComplement the bitmap.  Print white areas of the bitmap as black,
Xand vice-versa.
X.IP \fB-i\fP .5i
XInvert the bitmap.  Flip the bitmap over right to left, so that it
Xlooks like its reflection in a mirror.
X.IP \fB-r\fP\fIpixels\fP .5i
XClip \fIpixels\fP dots off of the right edge of the bitmap.
X.IP \fB-l\fP\fIpixels\fP .5i
XClip \fIpixels\fP dots off of the left edge of the bitmap.
X.IP \fB-t\fP\fIlines\fP .5i
XClip \fIlines\fP off of the top edge of the bitmap.
X.IP \fB-b\fP\fIlines\fP .5i
XClip \fIlines\fP off of the bottom edge of the bitmap.
X.IP \fB-p\fP\fIpalette\fP .5i
XPixels whose values are in the \fIpalette\fP list are black.  The
Xdefault \fIpalette\fP is all pixels which are non-zero.  The
X\fIpalette\fP is a list of comma separated individual pixel values
Xor ranges.  A range is \fIfirst-last\fP, which is all values from
X\fIfirst\fP to \fIlast\fP, inclusive.
X.IP \fB-H\fP .5i
XWrite output in HP LaserJet PCL directly to standard output (for testing).
X.IP \fB-S\fP .5i
XWrite only the number of horizontal dots and vertical dots to
Xstandard output.  The values are written using \fIputw\fP(3).
X.P
XThe options above may be combined in a command line as needed.
XThey are processed from left to right; different ordering of
Xthese options may produce different results.
X.SH SEE ALSO
Xjetroff(1), jetbm(1), pcpaint(1), .BM(5), putw(3)
END_OF_FILE
if test 2300 -ne `wc -c <'doc/pcx.1'`; then
    echo shar: \"'doc/pcx.1'\" unpacked with wrong size!
fi
# end of 'doc/pcx.1'
fi
if test -f 'font/devjet/fontcfg.sh' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'font/devjet/fontcfg.sh'\"
else
echo shar: Extracting \"'font/devjet/fontcfg.sh'\" \(1314 characters\)
sed "s/^X//" >'font/devjet/fontcfg.sh' <<'END_OF_FILE'
X#/*c
X# *	JetRoff - DWB 2.0 postprocessor for HP LaserJet Series II
X# *
X# *	Copyright (c) 1988 PC Research, Inc.  All Rights Reserved.
X# *
X# *	This source code is supplied to you under the terms of the
X# *	contents of the "License" agreement found with this source
X# *	distribution.  You must read the "License" before you use
X# *	this source code in any way.
X# *
X#c*/
X
X#
X#	Create *.out files from "fontlist" and fonts which
X#	are located in the "pk" directory.
X#
X
X#
X# $Id: fontcfg.sh,v 1.1 88/08/27 00:00:02 rick Exp $
X#
X# $Log:	fontcfg.sh,v $
X# Revision 1.1  88/08/27  00:00:02  rick
X# Initial revision
X# 
X#
X
Xfontlist=fontlist
Xif [ -f ../mkfont/mkfont ]
Xthen
X	MAKEDEV=../mkfont/mkfont
Xelif [ -f mkfont ]
Xthen
X	MAKEDEV=./mkfont
Xelse
X	echo "Couldn't find mkfont"
X	exit 1
Xfi
X#
Xallfonts=`awk '/^[A-Za-z].*/ {printf "%s ",$1;}' $fontlist`
Xstdfonts=`awk '/^-/{ exit;} /^[A-Za-z].*/ {printf "%s ",$1;}' $fontlist`
Xaddfonts=`awk '/^-/{ f=1;} /^[A-Za-z].*/ {if (f) printf "%s ",$1;}' $fontlist`
X./makeDESC
Xecho "Making standard fonts:  \c"
Xecho "$stdfonts"
Xecho "	$MAKEDEV DESC"
X$MAKEDEV DESC
X#
Xecho
Xecho "Making additional fonts:  \c"
Xecho "$addfonts"
Xif [ "Q$addfonts" != Q ]
Xthen
X	for i in $addfonts
X	do
X		echo "	$MAKEDEV DESC $i"
X		$MAKEDEV DESC $i
X	done
Xfi
Xecho
Xecho "*.{out,SZ} files have been built for $allfonts."
END_OF_FILE
if test 1314 -ne `wc -c <'font/devjet/fontcfg.sh'`; then
    echo shar: \"'font/devjet/fontcfg.sh'\" unpacked with wrong size!
fi
chmod +x 'font/devjet/fontcfg.sh'
# end of 'font/devjet/fontcfg.sh'
fi
if test -f 'font/devjet/makefile' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'font/devjet/makefile'\"
else
echo shar: Extracting \"'font/devjet/makefile'\" \(1510 characters\)
sed "s/^X//" >'font/devjet/makefile' <<'END_OF_FILE'
X#
X# $Id: makefile,v 1.1 88/08/27 00:00:05 rick Exp $
X#
X#
XSHELL=/bin/sh
XFONTDIR=/usr/lib/font/devjet
XFONTS = [A-Za-z] [A-Za-z][0-9A-Za-z] DESC
XMAKEDEV=../mkfont/mkfont -c
XMAKEDEV=../mkfont/mkfont
X
X# 	For BSD
XCFLAGS=-I../../bsd
XLFLAGS=../../bsd/bsd.a
X
X#	For AT&T 286 SGS:
XLARGE=-Ml
XCFLAGS=-DERR_ARRAY_TOO_LARGE -DERR_SEG_OVERWRITE
XLFLAGS=
X
X#	For normal system V.3
XLARGE=
XCFLAGS=
XLFLAGS=
X
Xall:	rasters makeDESC sfp2pk DESC DESC.out
X
Xdall:	makeDESC sfp2pk DESC DESC.out
X
Xrasters:
X	if [ -d ../mf ]; then cd pk; make all; fi
X
XmakeDESC:	makeDESC.c
X	$(CC) $(CFLAGS) $(LARGE) makeDESC.c $(LFLAGS) -o makeDESC
X
Xsfp2pk:	sfp2pk.c
X	$(CC) $(CFLAGS) -I../../djet sfp2pk.c $(LFLAGS) -o sfp2pk
X
XDESC:	makeDESC fontlist
X	makeDESC
X
XDESC.out:	DESC
X	$(MAKEDEV) DESC
X	for i in $(FONTS); \
X	do \
X	    if [ $$i = pk ]; then continue; fi; \
X	    if [ ! -r $$i.out ] || [ -n "`find $$i -newer $$i.out -print`" ]; \
X		then $(MAKEDEV) DESC $$i; \
X	    fi; \
X	done
X
Xinstall:	all
X	if [ ! -d $(FONTDIR) ]; then mkdir $(FONTDIR); fi
X	cp fontlist *.code *.out *.SZ $(FONTDIR)
X	cp fontcfg.sh $(FONTDIR)/fontcfg
X	cp makeDESC sfp2pk $(FONTDIR)
X	if [ -d ../mf ]; \
X		then cd pk; make install; else cd pk; make just_install;fi
X
Xdinstall:	dall
X	if [ ! -d $(FONTDIR) ]; then mkdir $(FONTDIR); fi
X	cp fontlist *.code *.out *.SZ $(FONTDIR)
X	cp fontcfg.sh $(FONTDIR)/fontcfg
X	cp makeDESC sfp2pk $(FONTDIR)
X
Xlint:
X	lint makeDESC.c >makeDESC.lint
X	lint -I../../djet sfp2pk.c >sfp2pk.lint
X
Xclean:
X	-rm -f *.out *.SZ
X
Xclobber: clean
X	-rm -f makeDESC sfp2pk
END_OF_FILE
if test 1510 -ne `wc -c <'font/devjet/makefile'`; then
    echo shar: \"'font/devjet/makefile'\" unpacked with wrong size!
fi
# end of 'font/devjet/makefile'
fi
if test -f 'font/devjet/mathsy.code' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'font/devjet/mathsy.code'\"
else
echo shar: Extracting \"'font/devjet/mathsy.code'\" \(1209 characters\)
sed "s/^X//" >'font/devjet/mathsy.code' <<'END_OF_FILE'
X/*
X * $Id: mathsy.code,v 1.1 88/08/27 00:00:06 rick Exp $
X *
X * $Log:	mathsy.code,v $
X * Revision 1.1  88/08/27  00:00:06  rick
X * Initial revision
X * 
X */
X
X/*
X *	'ts' below is a sort of pseudo character that .EQ uses to
X *	separate the three part titles.  It could be any character
X *	that the user doesn't know about (HAH!)
X */
Xchar	*mathsy[128] =
X{
X/*	 0     1     2     3     4     5     6     7	*/
X	"mi", "##", "mu", "##", "di", "##", "+-", "-+",
X	"o+O+", "o-O-", "oxOx", "o/O/", "o.O.", "ci", "ob", "bu",
X	"##", "==", "ib", "ip", "le<=", "ge>=", "##", "##",
X	"apcy", "~~", "sb", "sp", "##", "##", "##", "##",
X
X	"<-", "->", "ua", "da", "##", "##", "##", "~=",
X	"ld", "rd", "##", "##", "##", "##", "##", "pt",
X	"##", "if", "mo", "##", "TR", "##", "##", "##",
X	"fa", "te", "no", "es", "##", "##", "##", "pp",
X
X	"##", "##", "##", "##", "##", "##", "##", "##",
X	"##", "##", "##", "##", "##", "##", "##", "##",
X	"##", "##", "##", "##", "##", "##", "##", "##",
X	"##", "##", "##", "cu", "ca", "##", "as", "os",
X
X	"##", "##", "##", "##", "##", "##", "##", "##",
X	"##", "##", "##", "##", "##", "##", "##", "ts",
X	"##", "##", "gr", "is", "##", "##", "##", "##",
X	"sc", "dg", "dd", "pg", "##", "##", "##", "##",
X};
END_OF_FILE
if test 1209 -ne `wc -c <'font/devjet/mathsy.code'`; then
    echo shar: \"'font/devjet/mathsy.code'\" unpacked with wrong size!
fi
# end of 'font/devjet/mathsy.code'
fi
if test -f 'font/mkfont/README' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'font/mkfont/README'\"
else
echo shar: Extracting \"'font/mkfont/README'\" \(1989 characters\)
sed "s/^X//" >'font/mkfont/README' <<'END_OF_FILE'
XMkfont duplicates  the actions  (more or  less) of  the ATT  "makedev"
Xprogram,  tp  produce  binary  font  files  for  ditroff,  from  ascii
Xdescriptions for the fonts.   Rdfont will read  the binary font  files
Xand produce an  ascii equivalent  (which may then  be re-compiled)  by
Xmkfont.
X
XThese programs were written on a Pyramid 90x in the ucb universe,  and
Xshould compile fairly  readily in  any BSD  environment; they've  been
Xcompiled in the att  environment, and on a  Vax 750 under 4.3BSD  (but
Xnot really tested  in those environments).   Check the  CFLAGS in  the
XMakefile for SYS5.  There is also a cakefile, for those so inclined.
XFor some systems, you may have to deal with the 3-argument open() calls.
X
XThe programs were written  after Pyramid supplied  ditroff with an  OS
Xupgrade,  but  didn't  supply  makedev.    "makedev"  has  since  been
Xsupplied, and mkfont checked against it.
X
XMkfont has  been used  to compile  Postscript fonts  from  description
Xfiles posted to USENET in May of 1986 by Stephen Frede at U of NSW  in
XSydney, Australia--you  should  be able  to  find them  in  a  sources
Xarchive somewhere, if you need them.
X
XI am the author of  these programs, and I  submit them for public  use
Xwithout restriction.
X
XCAVEATS
XThe binary font  files produced  by mkfont will  differ slightly  from
Xthose produced by makedev if there are duplicate entries in the  width
Xtable, unless you use the '-c' option to mkfont (see the man page  for
Xa little more info).
X
XIf you use  these to produce  Postscript font files,  be aware of  the
Xstandard ditroff limit of 10 fonts (enforced by core dump).  I believe
Xpatches to  fix  this  and  other bugs  are  in  the  USENET  archives
Xsomewhere.   For those  of you  with  Pyramids, RTOC  can send  you  a
Xversion which will  handle up to  25 files; otherwise  you'll have  to
Xpick and  chose.    NOTE:  mkfont will  compile  them  fine  (as  will
Xmakedev), but ditroff won't like 'em.
X
X
XDuane H. Hesser
Xdhh at teltone.com
END_OF_FILE
if test 1989 -ne `wc -c <'font/mkfont/README'`; then
    echo shar: \"'font/mkfont/README'\" unpacked with wrong size!
fi
# end of 'font/mkfont/README'
fi
if test -f 'font/mkfont/mkfont.1' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'font/mkfont/mkfont.1'\"
else
echo shar: Extracting \"'font/mkfont/mkfont.1'\" \(2113 characters\)
sed "s/^X//" >'font/mkfont/mkfont.1' <<'END_OF_FILE'
X.TH MKFONT  1-P
X.SH NAME
Xmkfont,rdfont \- create/read ditroff font files
X.SH SYNOPSIS
X.br
X.B mkfont
X.I \-c
X[DESC]
X.br
X.B rdfont
X[DESC.out]
X.SH DESCRIPTION
X.PP
X.I Mkfont
Xreads ascii format font description files and creates binary format
Xfiles usable by
X.I ditroff.
XThe format of the ascii files may be guessed reasonably closely by
Xreading \fCfont\fP(5) and \fCtroff\fP(5).
XAlternatively, if you have existing fonts, you may run
X.I rdfont
Xon them to produce their ascii equivalents (which you may then
Xmodify, if you like, and re-compile with \fImkfont\fP).
XThe produced binary files are named by the input files suffixed with
X.I .out.
X.I Ditroff
Xexpects the font description file to be named
X.I DESC.out,
Xso \fImkfont\fP expects an ascii file named \fIDESC\fP in the
Xcurrent directory if no arguments are given; otherwise, the name
Xof the description file must be given as argument.
XThe \fI-c\fP flag causes the binary files produced to be more
Xnearly compatible with those produced by the ATT \fImakedev\fP
Xprogram (\fImakedev\fP does not make duplicate width table entries
Xin the binary file for characters whose width is given by double
Xquotes in the ascii file; \fImkfont\fP does, unless \fI-c\fP is
Xgiven).
X.PP
X.I Rdfont
Xexamines a binary format font set and produces a set of ascii files
Xwhich describe them.  The ascii files are in a form suitable for
Xre-compiling with \fImkfont\fP.
XIf no arguments are given, a description file named \fIDESC.out\fP
Xis expected.  An alternate description file name may be given as
Xargument.
XThe produced files are named by replacing the \fI.out\fP extensions
Xof the input files by \fI.new\fP, to avoid overwriting existing
Xdescription files.  If these files are to be re-compiled, the
Xextensions should be removed.
X.SH DIAGNOSTICS
X.PP
X.SH BUGS
X.PP
X.I Mkfont
Xdoes not do much checking on the validity of the font, although it
Xcould do so.
X.I Rdfont
Xwrites a few information items to the ascii file as comment lines.
XThat's not a bug, but it does make comparison of originals and
Xduplicates a bit (not muuch) harder.
X.SH AUTHOR
X.br
XDuane H. Hesser
X.br
XTeltone Corporation
END_OF_FILE
if test 2113 -ne `wc -c <'font/mkfont/mkfont.1'`; then
    echo shar: \"'font/mkfont/mkfont.1'\" unpacked with wrong size!
fi
# end of 'font/mkfont/mkfont.1'
fi
if test -f 'font/mkfont/nextword.c' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'font/mkfont/nextword.c'\"
else
echo shar: Extracting \"'font/mkfont/nextword.c'\" \(1875 characters\)
sed "s/^X//" >'font/mkfont/nextword.c' <<'END_OF_FILE'
X#ifndef lint
Xstatic char rcsid[] = "$Id: nextword.c,v 1.1 87/10/23 19:08:11 sysad Exp $";
X#endif
X
X/*
X * $Log:	nextword.c,v $
X * Revision 1.1  87/10/23  19:08:11  sysad
X * Initial revision
X * 
X * 
X */
X
X#define	CNULL	(char *)0
X
X/*  nextword: return the next whitespace delimited word from the      */
X/*  string passed as argument.  The returned word is null- terminated */
X/*  and points to a static copy of the word.  Each time the routine   */
X/*  is called with a new string, the old string copy is freed, and a  */
X/*  static copy of the new string is made and the first word is       */
X/*  returned.  Subsequent calls with the same argument return         */
X/*  succeeding words, or null if no words remain.                     */
X/*                                                                    */
X
Xextern char *savestr();
X
X#include <ctype.h>
Xchar *
Xnextword(string)
Xchar *string;
X{
X	static char *ostring = CNULL;
X	static char *savedstr = CNULL;
X	static char *next = CNULL;
X	char *x,*start;
X
X	if((string == CNULL) || !*string)
X	{
X		/* no string or empty string */
X		if(savedstr)
X			free(savedstr);
X		savedstr = next = ostring = CNULL;
X		return(CNULL);
X	}
X
X	/* Have we seen this string before? */
X	if(string != ostring)
X	{
X		/* Nope; set up the copy and pointers */
X		ostring = string;
X		if(savedstr)
X			free(savedstr);
X		savedstr = savestr(string);
X		next = savedstr;
X	}
X	if(!next || !*next)
X		return(CNULL);
X
X	x = next;
X	/* strip off leading white space */
X	while(*x && (*x != '\n') && isspace(*x))
X		++x;
X	start = x; 					/* x is the start of the word */
X	while(*x && (*x != '\n') && !isspace(*x))
X		++x;
X	if(*x)
X	{
X		*x = '\0'; 						/* null terminate the word */
X		next = ++x;
X	}
X	else next = CNULL;		/* end of string, no more words */
X	if(*start != '\n' && *start != '\0')
X	{
X		/* printf("nw = %s\n",start); /**/
X		return(start);
X	}
X	else
X		return(CNULL);
X}
END_OF_FILE
if test 1875 -ne `wc -c <'font/mkfont/nextword.c'`; then
    echo shar: \"'font/mkfont/nextword.c'\" unpacked with wrong size!
fi
# end of 'font/mkfont/nextword.c'
fi
if test -f 'makefile' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'makefile'\"
else
echo shar: Extracting \"'makefile'\" \(1456 characters\)
sed "s/^X//" >'makefile' <<'END_OF_FILE'
X#
X#	From here, descend into the depths of darkness...
X#
XSHELL=/bin/sh
X#
X#	This UNIX stuff doesn't do anything yet...
X#	You must edit each individual makefile for now
X#
XUNIX=-DBSD
XUNIX=-DSYS5
X#
X#	For building kits...
X#
XSRCFILES=README Copyright License Fonts Credits Register.mm \
X	makefile font/makefile
XSRCDIRS=djet doc bm font/devjet font/mkfont bsd
XFONTDIR=font/devjet/pk
XS=[126789]*
XR=[345]*
XBASE=	$(FONTDIR)/Copyright $(FONTDIR)/makefile \
X	$(FONTDIR)/cmr$S $(FONTDIR)/cmti$S $(FONTDIR)/cmbx$S $(FONTDIR)/cmtt$S \
X	$(FONTDIR)/cmsy$S $(FONTDIR)/cmmi$S $(FONTDIR)/cmtrf$S
XREST=	$(FONTDIR)/cmss* \
X	$(FONTDIR)/cmr$R $(FONTDIR)/cmti$R $(FONTDIR)/cmbx$R $(FONTDIR)/cmtt$R \
X	$(FONTDIR)/cmsy$R $(FONTDIR)/cmmi$R $(FONTDIR)/cmtrf$R
XNFONTFILES=font\/devjet\/pk
X
Xall install clean clobber:
X	cd djet; make $@ UNIX=$(UNIX)
X	cd font; make $@ UNIX=$(UNIX)
X	cd bm; make $@ UNIX=$(UNIX)
X
Xbsd:
X	cd bsd; make
X
Xinstall all: message
X
Xmessage:
X	cat Copyright
X
XPart:
X	bmakekit -iMANIFEST -oMANIFEST -h2
X
XBase:
X	bmakekit -iMANIFESTB -oMANIFESTB -h2 -n Base -k 99
X
XRest:
X	bmakekit -iMANIFESTR -oMANIFESTR -h2 -n Rest -k 99
X
XMANIFEST: FRC
X	(echo;echo;echo font) >MANIFEST
X	findsrc -f $(SRCFILES) $(SRCDIRS) | sed "/$(NFONTFILES)/d" >>MANIFEST
X
XMANIFESTB: FRC
X	(echo;echo;echo font; echo font/devjet; echo font/devjet/pk) >MANIFESTB
X	findsrc -f $(BASE) >>MANIFESTB
X	(echo;echo;echo font; echo font/devjet; echo font/devjet/pk) >MANIFESTR
X	findsrc -f $(REST) >>MANIFESTR
X
XFRC:
END_OF_FILE
if test 1456 -ne `wc -c <'makefile'`; then
    echo shar: \"'makefile'\" unpacked with wrong size!
fi
# end of 'makefile'
fi
echo shar: End of archive 2 \(of 7\).
cp /dev/null ark2isdone
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



More information about the Comp.sources.misc mailing list