[comp.sources.x] v09i048: xloadimage, Part01/09

jimf@saber.com (09/28/90)

Submitted-by: saber.com!jimf@saber.com
Posting-number: Volume 9, Issue 48
Archive-name: xloadimage/part01

Version 2.0 contains the following enhancements and modifications:

	* There is now a single Makefile for a variety of different
	  target environments.
	* New readers for MacPaint, FBM, CMU, Utah RLE and XWD image
	  formats.
	* PGM and PPM support added to PBM loader.
	* Gamma equalization option.
	* Smoothing option.
	* Rotation option.
	* G3 FAX support was modified to cut down on false positive
	  identifications.
	* Stdin can now be used as the image source.  This change also
	  included caching that improves normal performance.
	* Color slideshows now work.
	* Icon titles use an abbreviated titlebar title
	* The resource class name was changed from XLoadImage to
	  xloadimage to be more predictable.
	* Several options now propagate to all images following them
	  if the -slideshow option is specified.
	* Miscellaneous fixes to several existing loaders.

Enjoy,

jim frost
saber software
jimf@saber.com

#! /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 1 (of 9)."
# Contents:  Imakefile Makefile README VMS-CHANGES buildshar.c
#   patchlevel pbm.h rle.h sunraster.h xloadimage.h xwd.h
#   cmuwmraster.h options.h
# Wrapped by jimf@armory on Tue Sep 25 19:37:39 1990
PATH=/bin:/usr/bin:/usr/ucb ; export PATH
if test -f 'Imakefile' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'Imakefile'\"
else
echo shar: Extracting \"'Imakefile'\" \(1620 characters\)
sed "s/^X//" >'Imakefile' <<'END_OF_FILE'
X    SYSPATHFILE = $(XAPPLOADDIR)/Xloadimage
X        DEFINES = -DSYSPATHFILE=\"$(SYSPATHFILE)\"
X        DEPLIBS = $(DEPXLIB)
XLOCAL_LIBRARIES = $(XLIB)
XSYS_LIBRARIES   = -lm
X           SRCS = bright.c clip.c cmuwmraster.c compress.c dither.c \
X		  faces.c fbm.c fill.c g3.c gif.c halftone.c hash.c \
X		  imagetypes.c mac.c merge.c misc.c new.c options.c \
X		  path.c pbm.c reduce.c rle.c rlelib.c root.c \
X                  rotate.c send.c smooth.c sunraster.c value.c window.c \
X                  xbitmap.c xloadimage.c xpixmap.c xwd.c zio.c zoom.c
X           OBJS = bright.o clip.o cmuwmraster.o compress.o dither.o \
X		  faces.o fbm.o fill.o g3.o gif.o halftone.o hash.o \
X		  imagetypes.o mac.o merge.o misc.o new.o options.o \
X		  path.o pbm.o reduce.o rle.o rlelib.o root.o \
X                  rotate.o send.o smooth.o sunraster.o value.o window.o \
X                  xbitmap.o xloadimage.o xpixmap.o xwd.o zio.o zoom.o
X
XComplexProgramTarget(xloadimage)
X
Xinstall:: $(SYSPATHFILE)
X	$(RM) $(BINDIR)/xview $(BINDIR)/xsetbg
X	$(LN) $(BINDIR)/xloadimage $(BINDIR)/xview
X	$(LN) $(BINDIR)/xloadimage $(BINDIR)/xsetbg
X
X$(SYSPATHFILE):
X	@echo "*** Creating default $(SYSPATHFILE) since you"
X	@echo "*** don't have one. This file is used to set up default places"
X	@echo "*** and names to look for images.  You probably want to edit"
X	@echo "*** it for your site.  See the xloadimage manual page for"
X	@echo "*** details on the contents of this file."
X	cp /dev/null $(SYSPATHFILE)
X	echo "path=$(LIBDIR)/bitmaps $(LIBDIR)/images" \
X		>> $(SYSPATHFILE)
X	echo "extension=.csun .msun .sun .face .xbm .bm .gif" \
X		>>$(SYSPATHFILE)
END_OF_FILE
if test 1620 -ne `wc -c <'Imakefile'`; then
    echo shar: \"'Imakefile'\" unpacked with wrong size!
fi
# end of 'Imakefile'
fi
if test -f 'Makefile' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'Makefile'\"
else
echo shar: Extracting \"'Makefile'\" \(5149 characters\)
sed "s/^X//" >'Makefile' <<'END_OF_FILE'
X# Makefile for xloadimage.  this replaces the multiple makefiles used in
X# versions prior to xloadimage 1.07.
X
XSYSPATHFILE=/usr/lib/X11/Xloadimage
XINSTALLDIR=/usr/bin/X11
XSTD_CC= cc
XGCC= gcc
XCP= cp
XLN= ln -s
XRM= rm -f
XLIBS= -lX11 -lm
XCFLAGS= -O -DSYSPATHFILE=\"$(SYSPATHFILE)\" $(EXTRAFLAGS)
XGCCFLAGS= -fstrength-reduce -finline-functions
XGCC137FLAGS= -fforce-mem -fforce-addr -fstrength-reduce -finline-functions -DSYSPATHFILE=\"$(SYSPATHFILE)\"
X
XMISC= Imakefile Makefile README VMS-CHANGES buildshar.c xloadimage.man \
X      patchlevel pbm.h rle.h sunraster.h xloadimage.h xwd.h
X
XINCS= cmuwmraster.h copyright.h fbm.h g3.h gif.h hash.h image.h imagetypes.h \
X      kljcpyrght.h mac.h mit.cpyrght mrmcpyrght.h options.h
X
XSRCS= bright.c clip.c cmuwmraster.c compress.c dither.c faces.c fbm.c \
X      fill.c g3.c gif.c halftone.c hash.c imagetypes.c mac.c merge.c misc.c \
X      new.c options.c path.c pbm.c reduce.c rle.c rlelib.c root.c \
X      rotate.c send.c smooth.c sunraster.c value.c window.c xbitmap.c \
X      xloadimage.c xpixmap.c xwd.c zio.c zoom.c 
X
XOBJS= bright.o clip.o cmuwmraster.o compress.o dither.o faces.o fbm.o \
X      fill.o g3.o gif.o halftone.o hash.o imagetypes.o mac.o merge.o misc.o \
X      new.o options.o path.o pbm.o reduce.o rle.o rlelib.o root.o \
X      rotate.o send.o smooth.o sunraster.o value.o window.o xbitmap.o \
X      xloadimage.o xpixmap.o xwd.o zio.o zoom.o
X
XALL= $(MISC) $(INCS) $(SRCS)
X
X# standard target.  this is for BSD-like environments, generally, although
X# it will also work in many System-V environments.
X
Xstd:
X	@echo "Building standard distribution.  If this fails, consider trying"
X	@echo "'make sysv'."
X	make xloadimage CC=$(STD_CC)
X
X# system-v target.  use this if you have a system-v compliant system.
X	
Xsysv:
X	@echo "Building standard distribution for System-V."
X	make xloadimage CC=$(STD_CC) EXTRAFLAGS=-DSYSV
X
X# gcc target.  use this if you have a gcc that is not version 1.37.  you
X# should add -DSYSV between the quotes in EXTRAFLAGS if your system is
X# system-v compliant as well.
X
Xgcc:
X	@echo "Building distribution with GNU cc."
X	@echo "If something doesn't work, try using 'make gcc-1-37' and then"
X	@echo "'make std' before reporting a bug."
X	make xloadimage CC=$(GCC) EXTRAFLAGS="$(GCCFLAGS)"
X
X# this target is for systems which use gcc 1.37.  there is a compiler bug
X# in gcc 1.37 which causes some xloadimage functions to fail with the
X# standard optimizations.  use this if GIF loading and colormap reduction
X# product black pictures.
X
Xgcc-1-37:
X	@echo "Building distribution with GNU cc using flags for gcc 1.37."
X	@echo "If something doesn't work, try using std before reporting"
X	@echo "a bug."
X	make xloadimage CC=$(GCC) EXTRAFLAGS="$(GCC137FLAGS)"
X
Xsysv-gcc:
X	@echo "Building System-V distribution with GNU cc."
X	@echo "If something doesn't work, try using 'make sysv-gcc-1-37' and"
X	@echo "then 'make std' before reporting a bug."
X	make xloadimage CC=$(GCC) EXTRAFLAGS="-DSYSV $(GCCFLAGS)"
X
X# this target is for systems which use gcc 1.37.  there is a compiler bug
X# in gcc 1.37 which causes some xloadimage functions to fail with the
X# standard optimizations.  use this if GIF loading and colormap reduction
X# product black pictures.
X
Xsysv-gcc-1-37:
X	@echo "Building System-V distribution with GNU cc using flags for"
X	@echo "gcc 1.37.  If something doesn't work, try using std before"
X	@echo "reporting a bug."
X	make xloadimage CC=$(GCC) EXTRAFLAGS="-DSYSV $(GCC137FLAGS)"
X
Xinstall: $(SYSPATHFILE)
X	$(RM) $(INSTALLDIR)/xloadimage
X	$(RM) $(INSTALLDIR)/xsetbg
X	$(RM) $(INSTALLDIR)/xview
X	$(CP) xloadimage $(INSTALLDIR)/xloadimage
X	$(LN) $(INSTALLDIR)/xloadimage $(INSTALLDIR)/xsetbg
X	$(LN) $(INSTALLDIR)/xloadimage $(INSTALLDIR)/xview
X
Xxloadimage: $(OBJS)
X	$(CC) $(CFLAGS) -o xloadimage $(OBJS) $(LIBS)
X
X.c.o: xloadimage.h
X	$(CC) -c $(CFLAGS) $*.c
X
Xclean:
X	rm -f *.o *~ xloadimage buildshar doshar shar.* *.tar *.tar.Z
X
X$(SYSPATHFILE):
X	@echo "*** Creating default $(SYSPATHFILE) since you"
X	@echo "*** don't have one. This file is used to set up default places"
X	@echo "*** and names to look for images.  You probably want to edit"
X	@echo "*** it for your site.  See the xloadimage manual page for"
X	@echo "*** details on the contents of this file."
X	cp /dev/null $(SYSPATHFILE)
X	echo "path= /usr/local/images" \
X		>> $(SYSPATHFILE)
X	echo "extension=.csun .msun .sun .face .xbm .bm .gif" \
X		>>$(SYSPATHFILE)
X
X# these targets are for building shar distributions
X
Xbuildshar: buildshar.o
X	$(CC) -o buildshar buildshar.o
X
Xshar: buildshar
X	rm -f shar.* doshar
X	./buildshar $(ALL) > doshar
X	sh doshar
X	rm doshar
X
X# targets for building tar distributions
X
Xtar: xloadimage.tar
X
Xtar.Z: xloadimage.tar
X	compress xloadimage.tar
X
Xxloadimage.tar:
X	tar cf xloadimage.tar $(ALL)
X
X# these targets are for those of us who have Saber-C
X
X# load all objects in saber.  useful if you then swap the portions to debug
X# for source.
X
Xobjinsaber:
X	#setopt ccargs -g -DSYSPATHFILE=\\\"$(SYSPATHFILE)\\\"
X	#load $(OBJS) $(LIBS)
X	#link
X
X# load all sources in saber.  not as useful as the last one.
X
Xsrcinsaber:
X	#setopt load_flags -DSYSPATHFILE=\\\"$(SYSPATHFILE)\\\"
X	#load $(SRCS) $(LIBS)
X	#link
END_OF_FILE
if test 5149 -ne `wc -c <'Makefile'`; then
    echo shar: \"'Makefile'\" unpacked with wrong size!
fi
# end of 'Makefile'
fi
if test -f 'README' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'README'\"
else
echo shar: Extracting \"'README'\" \(9892 characters\)
sed "s/^X//" >'README' <<'END_OF_FILE'
XXLOADIMAGE - X11 Image Loading Utility
X
XWHAT IS IT?
X
XThis utility will view several types of images under X11, or load
Ximages onto the root window.  The current version supports:
X
X	CMU Window Manager raster files
X	Faces Project images
X	Fuzzy Bitmap (FBM) images
X	GIF images
X	G3 FAX images
X	MacPaint images
X	Portable Bitmap (PBM) images
X	Sun monochrome rasterfiles
X	Sun color RGB rasterfiles
X	X pixmap files
X	X10 bitmap files
X	X11 bitmap files
X	Utah Raster Toolkit (RLE) files
X
XA variety of options are available to modify images prior to viewing.
XThese options include clipping, dithering, depth reduction, zoom
X(either X or Y axis independently or both at once), brightening or
Xdarkening, and image merging.  When applicable, these options are done
Xautomatically (eg a color image to be displayed on a monochrome screen
Xwill be dithered automatically).
X
XCOMPILING
X
XThere are a variety of ways to compile xloadimage, depending on what
Xenvironment you have.  The building techniques have changed somewhat
Xfrom versions earlier than 2.0.
X
XIf you are compiling under the X11R4 distribution, the apropriate
XImakefile is included and you should compile as with any other client.
XI haven't personally tested this, but if it's broken it'll be easy to
Xfix.
X
XIf you're compiling on a BSD system or a system that's mostly BSDish,
Xuse "make std" or just "make".  If you have gcc you should keep
Xreading.
X
XIf you're compiling on a System-V system, use "make sysv".  If you
Xhave gcc you may want to use that (read on for caveats) and should use
X"make sysv-gcc" or "make sysv-gcc-1-37" as appropriate.
X
XIf you have gcc on your system, and it's not gcc 1.37, compile via
X"make gcc".  This is changed from earlier versions which had a
Xseparate Makefile for gcc.  Gcc should be used if it works because the
Xstrength-reduction and inline-functions directives dramatically
Ximprove performance of some operations.  Please note that use of gcc
Xon some systems, particularly Sun-4, may cause problems.
X
XIf you have gcc 1.37 on your system, compile via "make gcc-1-37".  Gcc
X1.37 has an optimizer bug which causes (at least) GIF image loading
Xand colormap reduction to fail.  This make target adds some extra
Xcompilation flags which should correct this problem.
X
XIf you run into problems with code compiled with gcc, I suggest trying
Xthe same thing using the standard or System-V target (whichever is
Xappropriate) before reporting a bug.  Bug fixes are always appreciated.
X
XWORKAROUNDS FOR BROKEN SERVERS
X
XSome servers which use odd-depth displays (eg not 1 or a multiple of 8
Xbits) do not correctly handle a plane mask with GXcopy.  If your
Xserver displays color images in only two colors although it supports
Xmore colors, add a -DSERVER_HAS_BROKEN_PLANEMASK to CFLAGS in the
XMakefile.  Some Visual X-19 Turbo displays have this problem; you
Xshould request an updated ROM if you have one of these.
X
XINSTALLATION
X
XAfter compiling and installing xloadimage, I recommend linking or
Xsymlinking to the executable with the names "xview" and "xsetbg".  The
Xdefault behavior is slightly different when invoked with these
Xcommands (they're also easier to type).  If you have a public image
Xarea you should consider setting the SYSPATHFILE option in the
Xmakefile and setting up a system-wide configuration file.  See the man
Xpage for information on the format of this file.
X
XIMPLEMENTATION
X
XMost functions are not particularly fast, and some functions use
Xsimple-minded algorithms deliberately over more advanced ones.  I
Xstressed portability over all and simplicity over performance.  I
Xbelieve the result is a usable, portable tool which should serve the
Xneeds of most users.
X
XThe source code is basically in two parts: image manipulation routines
Xand everything else.  The image manipulation routines should be
Xcompletely independent of X, thus allowing people to use them under
Xother graphical systems.  No guarantees here, but I tried.
X
XPerformance-oriented people will notice that when loading a color
Ximage, the colormap of the image is minimized (and all pixel values in
Xthe image changed), then the colormap is redone (and all pixel values
Xin the image changed again) before sending to X.  This could be
Xreduced to only one remapping of the image but I wanted to keep the
Ximage from X's grubby (greedy?) hands as long as possible, and the
Ximage merging function really wants the image to have a minimized
Xcolormap.
X
XOWNERSHIP
X
XI used a modified version of the MIT X Consortium copyright with all
Xof these functions, thereby allowing full freedom with the code so
Xlong as the copyright notices remain intact.  Free code can be good
Xcode.  All contributions have similar notices.
X
XSUGGESTIONS AND BUG REPORTS
X
XSuggestions and bug reports should go to:
X
X	Jim Frost
X	jimf@saber.com
X	..harvard!saber!jimf
X
XPlease include the version number and sample image data if you are
Xreporting a bug.
X
XFunctions implementing new image types are welcomed; mail them to the
Xsame address and I'll do my best to distribute them.  Try do send them
Xas public domain so I can keep the number of differing copyright
Xmessages to a minimum -- I'll use my standard message and leave the
Ximplementor's name and information in the file for credit.  I wouldn't
Xcopyright this stuff at all except that it's a requirement for X11
Xdistribution.
X
XTHANKS
X
XSpecial thanks to the crew at the Boston University Graphics Lab for
Xtheir assistance and sample images, and to bzs@std.com for his simple
Xdithering algorithm (or what's left of it).  Real special thanks to
XKirk L. Johnson (tuna@athena.mit.edu) for a very nice GIF loader and
Xdithering routine, to Mark Snitily (zok!mark@apple.com) for 386/ix
Xcompatibility work, to Andreas Stolcke (stolcke@icsib12.berkeley.edu)
Xfor miscellaneous bug fixes, to Anthony A. Datri (datri@convex.com)
Xfor adding the class hint, to Mark Moraes (moraes@cs.toronto.edu) for
Xthe slideshow colormap fix, to Gregg Townsend (gmt@cs.arizona.edu) for
Xa suggested dithering routine, to Brian Frost (B1F5814@RIGEL.TAMU.EDU)
Xfor changes for VMS, to Chip Horstman for G3 FAX support, to Deron
XDann Johnson (dj@eng.sun.com) for fixing the RetainTemporary bug, to
XTom Tatlow (tatlow@dash.enet.dec.com) for image rotation code, to Mark
XA. Horstman (mhorstm@sarek.sbc.com) for tilde expansion in
X.xloadimagerc files and virtual-root support in root.c, to Tim Roper
X(timr@labtam.labtam.oz.au), Graeme Gill (graeme@labtam.oz.au) for
Xgamma correction and Utah RLE image support, Mark Majhor
X(uunet!sequent!markm) for FBM and MacPaint support, Ian MacPhedran
X(macphed@dvinci.usask.ca) for PGM and PPM support, Per Fogelstrom
X(pf@diab.se) for a fix to send.c, and any others whose names I've
Xmissed.
X
XHISTORY
X
XPatch 01 contained a new Makefile.std, Makefile.gcc, and Imakefile.
XIt contained a bug-fix to sendImageToX() which allowed bitmaps to be
Xsent from little-endian machines (eg VAX, 80386) correctly, and a fix
Xto xbitmapLoad() to allow correct loading of X10 bitmap images.  An
Xenhancement to imageInWindow() which allowed exiting from image
Xwindows by typing 'q' was submitted by Chris Tengi
X(tengi@idunno.princeton.edu) and was included.  The previously missing
Xfile 'patchlevel' was included.
X
XPatch 02 contained modifications to the Makefiles, support for the X
XPixmap image type, a different dithering algorithm that didn't blow
Xthe image up (with the old one moved to halftone.c), and a bug fix to
Xzoom.c to correct problems when zooming bitmaps.
X
XPatch 03 contained a new loader for GIF files.  The dither bits array
Xin dither.c was changed so it worked properly, and both dither.c and
Xhalftone.c had minor bugs fixed.  Merge.c was modified to correct bugs
Xwhen merging RGB images.  Pbm.c was modified to handle raw format
Ximages.  Root.c was modified to deny image loads which would change
Xthe root window's colormap.  Send.c was modified to use shared colors
Xwhenever possible and to handle color displays which have depths which
Xare not a multiple of 8.  Window.c was modified to avoid deleting the
Xdefault colormap, allowing proper operation on some servers prior to
XX11R3 patchlevel 08.  There were many miscellaneous bug fixes.
X
XPatchlevel 04 contained an enhancement to root.c to use
XRetainTemporary and KillClient(disp, AllTemporary) so that it could
Xclean up after itself when reloading.  The -quiet and -zoom options no
Xlonger cause garbage to be displayed for the image title.  A small bug
Xin new.c that caused incorrect allocation of bitmap images was fixed.
XSeveral calls to XCreateColormap were missing the "visual" parameter
Xin send.c; this was fixed.  A bug relating to -border and monochrome
Xdisplays was fixed.  There were several changes to the Imakefile and
XMakefiles.
X
XPatchlevel 05 contained enhancements to allow slideshows and
Xfullscreen viewing, some bug fixes related to scrolling around within
Ximages, Saber-C makefile enhancements, a bug fix to the halftoning
Xtitle, and the addition of greyscale Sun Rasterfile support.
X
XPatchlevel 06 contained support for G3 FAX images, bug fixes to
Xmerge.c to fix some signed/unsigned errors and clipping problems,
Xchanges to root.c to make previously allocated resources be freed
Xproperly, and a completely new dithering routine.
X
XPatchlevel 07 contained support for MacPaint, FBM, PGM, PPM, CMU, Utah
XRLE and XWD image formats, gamma equalization, image smoothing, and
Ximage rotation.  G3 FAX support was modified to cut down on false
Xpositive identifications.  The zio subsystem was modified to cache
Xreads for performance improvements and to allow stdin to be used as an
Xinput source.  Several loader functions which did not properly close
Xtheir files were fixed.  Color slideshows now work.  Icon titles use
Xan abbreviated titlebar title to enhance readability.  The resource
Xclass name was changed from XLoadImage to xloadimage to be more
Xpredictable.  Several options now propagate to all images following
Xthem if the -slideshow option is specified.
END_OF_FILE
if test 9892 -ne `wc -c <'README'`; then
    echo shar: \"'README'\" unpacked with wrong size!
fi
# end of 'README'
fi
if test -f 'VMS-CHANGES' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'VMS-CHANGES'\"
else
echo shar: Extracting \"'VMS-CHANGES'\" \(5631 characters\)
sed "s/^X//" >'VMS-CHANGES' <<'END_OF_FILE'
XThis file contains changes for running xloadimage under VMS.  Please
Xnote that this file has not been updated to work with versions of
Xxloadimage newer than 1.05.  The differences should be fairly trivial.
X
Xjim frost
X09.20.90
X
X-- cut here --
XFrom B1F5814@rigel.tamu.edu Thu May 31 15:14:35 1990
XDate:    Thu, 31 May 1990 14:11:53 CDT
XFrom: B1F5814@RIGEL.TAMU.EDU (Brian Frost -- Academic Computing Services)
XMessage-Id: <900531141153.2020197e@RIGEL.TAMU.EDU>
XSubject: xloadimage diffs and additions for VMS
XTo: jimf
XX-Vmsmail-To: SMTP%"jimf@saber.com"
X
XJim,
X
XAt the bottom of this messages is the diff file for the current release (1.05)
Xof xloadimage.  In addition to these changes, two new files are also needed for
XVMS use only. MAKE_VMS.COM compiles and links xloadimage. rindex.c is my
Xversion of rindex for VMS.  They are both listed below:
X
XBrian
X
X-README.VMS---------------------------------------------------------------------
XTo compile XLOADIMAGE under VMS just use the MAKE_VMS.COM command procedure
Xprovided.
X
XTo use XLOADIMAGE you need to define a foreign command.  Here is an example of
Xhow to do it.
X
X   XLOADIMAGE :== $SYS$USERDISKB:[B1F5814.DECWINDOWS.XLOADIMAGE]XLOADIMAGE
X
XBrian Frost
X--------------------------------------------------------------------------------
X-MAKE_VMS.COM-------------------------------------------------------------------
X$ define sys sys$library
X$ define X11 decw$include
X$ cc -
XBRIGHT, CLIP, COMPRESS, DITHER, FACES, FILL, GIF, HALFTONE, -
XIMAGETYPES, MERGE, MISC, NEW, OPTIONS, PATH, PBM, REDUCE, -
XRINDEX, ROOT, SEND, SUNRASTER, VALUE, WINDOW, XBITMAP, XLOADIMAGE, -
XXPIXMAP, ZIO, ZOOM 
X$ link/nouserlibrary/exe=xloadimage -
XBRIGHT, CLIP, COMPRESS, DITHER, FACES, FILL, GIF, HALFTONE, -
XIMAGETYPES, MERGE, MISC, NEW, OPTIONS, PATH, PBM, REDUCE, -
XRINDEX, ROOT, SEND, SUNRASTER, VALUE, WINDOW, XBITMAP, XLOADIMAGE, -
XXPIXMAP, ZIO, ZOOM, sys$input/opt
Xsys$library:decw$xlibshr.exe/share
Xsys$library:vaxcrtl.exe/share
X--------------------------------------------------------------------------------
X-rindex.c-----------------------------------------------------------------------
X#include string
Xchar *rindex (our_string, a_char)
X   char our_string[], a_char;
X   {
X      int char_index, string_length;
X      string_length = strlen(our_string);
X      for (char_index = string_length; char_index >= 0 && 
X           our_string[char_index] != a_char; --char_index);
X      if (char_index >= 0)
X         return &our_string[char_index];
X      else
X         return 0;
X   }
X--------------------------------------------------------------------------------
X-diff file----------------------------------------------------------------------
Xdiff -c v1.05/path.c vms/path.c
X*** v1.05/path.c	Thu May 31 13:03:33 1990
X--- vms/path.c	Thu May 31 11:53:27 1990
X***************
X*** 12,18 ****
X--- 12,22 ----
X  #include "xloadimage.h"
X  #include <X11/Xos.h>
X  #include <sys/stat.h>
X+ #ifndef VMS			/* Bef 5/31/89 */
X  #include <pwd.h>
X+ #else
X+ #define R_OK 4
X+ #endif			/* Bef 5/31/89 */
X  #include <errno.h>
X  
X  extern int errno;
X***************
X*** 100,105 ****
X--- 104,110 ----
X    }
X  }
X  
X+ #ifndef VMS			/* Bef 5/31/90 */
X  void loadPathsAndExts()
X  { static int     havepaths= 0;
X    struct passwd *pw;
X***************
X*** 122,128 ****
X    readPathsAndExts(SYSPATHFILE);
X  #endif
X  }
X! 
X  /* find an image with paths and extensions from defaults files.  returns
X   * -1 if access denied or not found, 0 if ok.
X   */
X--- 127,133 ----
X    readPathsAndExts(SYSPATHFILE);
X  #endif
X  }
X! #endif
X  /* find an image with paths and extensions from defaults files.  returns
X   * -1 if access denied or not found, 0 if ok.
X   */
Xdiff -c v1.05/xloadimage.c vms/xloadimage.c
X*** v1.05/xloadimage.c	Thu May 31 13:03:37 1990
X--- vms/xloadimage.c	Thu May 31 11:53:43 1990
X***************
X*** 10,17 ****
X  
X  #include "copyright.h"
X  #include "xloadimage.h"
X  #include "patchlevel"
X! 
X  /* options array and definitions.  note that the enum values must be in the
X   * same order as the options strings.
X   */
X--- 10,20 ----
X  
X  #include "copyright.h"
X  #include "xloadimage.h"
X+ #ifndef VMS			/* Bef 5/31/90 */
X  #include "patchlevel"
X! #else				/* Bef 5/31/90 */
X! #include "patchlevel."	/* Bef 5/31/90 */
X! #endif			/* Bef 5/31/90 */
X  /* options array and definitions.  note that the enum values must be in the
X   * same order as the options strings.
X   */
X***************
X*** 105,111 ****
X--- 108,116 ----
X     * our name was when invoked.
X     */
X  
X+ #ifndef VMS			/* Bef 5/31/90 */
X    loadPathsAndExts();
X+ #endif			/* Bef 5/31/90 */
X    onroot= 0;
X    verbose= 1;
X    if (!strcmp(tail(argv[0]), "xview")) {
Xdiff -c v1.05/zio.c vms/zio.c
X*** v1.05/zio.c	Thu May 31 13:03:39 1990
X--- vms/zio.c	Thu May 31 11:53:49 1990
X***************
X*** 17,22 ****
X--- 17,23 ----
X    char   buf[BUFSIZ];
X  
X    zf= (ZFILE *)lmalloc((unsigned int)sizeof(ZFILE));
X+ #ifndef VMS			/* Bef 5/31/90 */
X    if ((strlen(name) > 2) && !strcmp(".Z", name + (strlen(name) - 2))) {
X      zf->type= ZPIPE;
X      sprintf(buf, "uncompress -c %s", name);
X***************
X*** 26,31 ****
X--- 27,33 ----
X      }
X      return(zf);
X    }
X+ #endif			/* Bef 5/31/90 */
X    zf->type= ZSTANDARD;
X    if (! (zf->stream= fopen(name, "r"))) {
X      lfree((byte *)zf);
X***************
X*** 66,74 ****
X--- 68,78 ----
X    case ZSTANDARD:
X      fclose(zf->stream);
X      break;
X+ #ifndef VMS			/* Bef 5/31/90 */
X    case ZPIPE:
X      pclose(zf->stream);
X      break;
X+ #endif			/* Bef 5/31/90 */
X    default:
X      printf("zclose: bad ZFILE structure\n");
X      exit(1);
X--------------------------------------------------------------------------------
X
END_OF_FILE
if test 5631 -ne `wc -c <'VMS-CHANGES'`; then
    echo shar: \"'VMS-CHANGES'\" unpacked with wrong size!
fi
# end of 'VMS-CHANGES'
fi
if test -f 'buildshar.c' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'buildshar.c'\"
else
echo shar: Extracting \"'buildshar.c'\" \(2783 characters\)
sed "s/^X//" >'buildshar.c' <<'END_OF_FILE'
X/* buildshar.c:
X *
X * utility program to figure out how to pack shar files.  it doesn't try
X * very hard.
X *
X * this program is in the public domain.
X *
X * jim frost 09.25.90
X */
X
X#include <stdio.h>
X#include <sys/types.h>
X#include <sys/stat.h>
X
X/* this defines the size of the shar file not including anything that got
X * added by shar.  should be considerably smaller than 64000.
X */
X
X#define SHAR_SIZE 40000
X
Xstruct file {
X  char *name;
X  int size;
X  struct file *next;
X};
X
Xstruct shar {
X  struct file *file;
X  struct shar *next;
X};
X
Xmain(argc, argv)
X     int    argc;
X     char **argv;
X{ int num_files, files_left;
X  struct file *files;
X  struct stat sbuf;
X  struct shar *shar_list;
X  struct shar *cur_shar;
X  struct file *cur_file;
X  int shar_size, shar_num, num_shars;
X  int a;
X
X  if (argc < 2) {
X    fprintf(stderr, "Usage: %s [files]\n", *argv);
X  }
X
X  /* build table of filenames
X   */
X
X  files= (struct file *)malloc(sizeof(struct file) * (argc - 1));
X  for (a= 0, num_files= 0; *(++argv); a++) {
X    if (stat(*argv, &sbuf) < 0) {
X      perror(*argv);
X      files[a].name= NULL;
X      continue;
X    }
X    num_files++;
X    files[a].name= *argv;
X    files[a].size= sbuf.st_size;
X  }
X
X  /* try to fit files.  this is not a bright algorithm.
X   */
X
X  shar_list= cur_shar= (struct shar *)malloc(sizeof(struct shar));
X  cur_shar->file= NULL;
X  cur_file= NULL;
X  shar_size= 0;
X
X  for (files_left= num_files; files_left;) {
X
X    /* look for a file that'll fit in the current shar
X     */
X
X    for (a= 0; a < num_files; a++)
X      if (files[a].name &&
X	  ((shar_size + files[a].size <= SHAR_SIZE) ||
X	   ((shar_size == 0) && (files[a].size > SHAR_SIZE)))) {
X	shar_size += files[a].size;
X	if (cur_file) {
X	  cur_file->next= (struct file *)malloc(sizeof(struct file));
X	  cur_file= cur_file->next;
X	}
X	else
X	  cur_shar->file= cur_file= (struct file *)malloc(sizeof(struct file));
X	cur_file->name= files[a].name;
X	cur_file->next= NULL;
X	files[a].name= NULL;
X	files_left--;
X	break;
X      }
X
X    /* if nothing fit, make a new shar file
X     */
X
X    if (a == num_files) {
X      cur_shar->next= (struct shar *)malloc(sizeof(struct shar));
X      cur_shar= cur_shar->next;
X      cur_shar->file= NULL;
X      cur_shar->next= NULL;
X      cur_file= NULL;
X      shar_size= 0;
X    }
X  }
X
X  /* find out how many shar files we need for -e flag
X   */
X
X  for (num_shars= 0, cur_shar= shar_list; cur_shar; num_shars++)
X    cur_shar= cur_shar->next;
X
X  /* output each shar command line
X   */
X
X  for (shar_num= 1, cur_shar= shar_list; cur_shar; shar_num++) {
X    printf("shar -n %d -e %d", shar_num, num_shars);
X    for (cur_file= cur_shar->file; cur_file; cur_file= cur_file->next)
X      printf(" %s", cur_file->name);
X    cur_shar= cur_shar->next;
X    printf(" > shar.%d\n", shar_num);
X  }
X  exit(0);
X}
END_OF_FILE
if test 2783 -ne `wc -c <'buildshar.c'`; then
    echo shar: \"'buildshar.c'\" unpacked with wrong size!
fi
# end of 'buildshar.c'
fi
if test -f 'patchlevel' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'patchlevel'\"
else
echo shar: Extracting \"'patchlevel'\" \(125 characters\)
sed "s/^X//" >'patchlevel' <<'END_OF_FILE'
X/* this defines the version and patchlevel of this version of xloadimage
X */
X
X#define VERSION    "2"
X#define PATCHLEVEL "00"
END_OF_FILE
if test 125 -ne `wc -c <'patchlevel'`; then
    echo shar: \"'patchlevel'\" unpacked with wrong size!
fi
# end of 'patchlevel'
fi
if test -f 'pbm.h' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'pbm.h'\"
else
echo shar: Extracting \"'pbm.h'\" \(146 characters\)
sed "s/^X//" >'pbm.h' <<'END_OF_FILE'
X/* pbm.h:
X *
X * PBM header file
X *
X * jim frost 10.15.89
X */
X
Xtypedef struct {
X  unsigned char width[2];
X  unsigned char height[2];
X} PBMCompact;
END_OF_FILE
if test 146 -ne `wc -c <'pbm.h'`; then
    echo shar: \"'pbm.h'\" unpacked with wrong size!
fi
# end of 'pbm.h'
fi
if test -f 'rle.h' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'rle.h'\"
else
echo shar: Extracting \"'rle.h'\" \(6416 characters\)
sed "s/^X//" >'rle.h' <<'END_OF_FILE'
X
X/*
X * This software is copyrighted as noted below.  It may be freely copied,
X * modified, and redistributed, provided that the copyright notice is 
X * preserved on all copies.
X * 
X * There is no warranty or other guarantee of fitness for this software,
X * it is provided solely "as is".  Bug reports or fixes may be sent
X * to the author, who may or may not act on them as he desires.
X *
X * You may not include this software in a program or other software product
X * without supplying the source, or without informing the end-user that the 
X * source is available for no extra charge.
X *
X * If you modify this software, you should include a notice giving the
X * name of the person performing the modification, the date of modification,
X * and the reason for such modification.
X */
X/* 
X * svfb_global.h - externally visible variables for svfb.
X * 
X * Author:	Todd W. Fuqua
X * 		Computer Science Dept.
X * 		University of Utah
X * Date:	Sun Jul 29 1984
X * Copyright (c) 1984 Todd W. Fuqua
X * 
X * Added optimised dither square size globals
X * 88/07/13 Graeme W. Gill
X *
X * $Header: svfb_global.h,v 2.7 86/11/10 11:25:18 thomas Exp $
X * $Log:	svfb_global.h,v $
X * Revision 2.7  86/11/10  11:25:18  thomas
X * Add rle_get_setup return codes.
X * Add is_seek flag to make pipe input work.
X * 
X * Revision 2.6  86/10/08  13:06:07  thomas
X * Add sv_comments field.
X * Add is_eof flag to Runget private data.
X * 
X * Revision 2.4  86/02/27  10:05:40  thomas
X * Change for new sv_globals & sv_putrow interface.
X * Add comments to data structure.
X * 
X * Revision 2.3  85/04/26  15:10:04  thomas
X * New sv_globals structure.  sv_dispatch no longer global variable
X * (incorporated into globals struct).
X * 
X * Revision 2.2  85/04/04  16:42:09  thomas
X * Take out verbose flag, mapflag.  Add ncmap/cmaplen and map pointer.
X * 
X * Revision 2.1  85/03/05  16:02:03  thomas
X * *** empty log message ***
X * 
X */
X
Xenum sv_dispatch {
X    RUN_DISPATCH
X};
X
X/* some compilers have problems converting unsigned bytes to float */
X#define BYTEBUG
X
X/* On BIGENDIAN machines swap the bytes. Everything but vax's and
X * pdp-11's (not sure if it's pdp11 or PDP11 ??)
X * are considered BIGENDIAN machines.
X */
X#if !defined(BIG_ENDIAN) && !defined(LITTLE_ENDIAN)
X#if !defined(vax) && !defined(pdp11) && !defined(ns32000) && !defined(i386)
X#define BIG_ENDIAN
X#else
X#define LITTLE_ENDIAN
X#endif
X#endif
X
X#ifdef BIG_ENDIAN
X#define SWAB(shrt)  (shrt = ((shrt >> 8) & 0xff) | ((shrt << 8) & 0xff00))
X#else
X#define	SWAB(shrt)
X#endif
X
X/* fix up some bezerklysims */
X#ifndef bzero
X# define bzero(xx,yy) memset((char *)(xx),0,(int)(yy))
X#endif
X
X#ifndef bcopy
X# define bcopy(xx,yy,zz) memcpy((char *)(yy),(char *)(xx),(int)(zz))
X#endif
X
X/* ****************************************************************
X * TAG( rle_pixel rle_map )
X *
X * Typedef for 8-bit (or less) pixel data.
X *
X * Typedef for 16-bit color map data.
X */
Xtypedef unsigned char rle_pixel;
Xtypedef unsigned short rle_map;
X
X/*
X * Defines for traditional channel numbers
X */
X#define	SV_RED	    0		/* red channel traditionally here */
X#define SV_GREEN    1		/* green channel traditionally here */
X#define	SV_BLUE	    2		/* blue channel traditionally here */
X#define SV_ALPHA    -1		/* Alpha channel here */
X
X/*
X * Return values from rle_get_setup
X */
X#define	RLE_SUCCESS	0
X#define	RLE_NOT_RLE	-1
X#define	RLE_NO_SPACE	-2
X#define	RLE_EMPTY	-3
X#define	RLE_EOF		-4
X
X/*
X * TAG( sv_globals )
X *
X * Definition of "globals" structure used by RLE routines
X */
X
Xextern struct sv_globals {
X    enum sv_dispatch sv_dispatch; /* type of file to create */
X    int	    sv_ncolors,		/* number of color channels */
X	  * sv_bg_color,	/* pointer to bg color vector */
X	    sv_alpha,		/* if !0, save alpha channel */
X	    sv_background,	/* (background) 0->just save pixels, */
X				/* 1->overlay, 2->clear to bg first */
X	    sv_xmin,		/* lower X bound (left) */
X	    sv_xmax,		/* upper X bound (right) */
X	    sv_ymin,		/* lower Y bound (bottom) */
X	    sv_ymax,		/* upper Y bound (top) */
X	    sv_ncmap,		/* number of color channels in color map */
X				/* map only saved if != 0 */
X	    sv_cmaplen;		/* log2 of color map length */
X    rle_map * sv_cmap;	/* pointer to color map array */
X    char    ** sv_comments;	/* pointer to array of pointers to comments */
X    ZFILE  * svfb_fd;		/* output file */
X    /* 
X     * Bit map of channels to read/save.  Indexed by (channel mod 256).
X     * Alpha channel sets bit 255.
X     * 
X     * Indexing (0 <= c <= 255):
X     *	    sv_bits[c/8] & (1 << (c%8))
X     */
X#define SV_SET_BIT(glob,bit) \
X     ((glob).sv_bits[((bit)&0xff)/8] |= (1<<((bit)&0x7)))
X#define SV_CLR_BIT(glob,bit) \
X	((glob).sv_bits[((bit)&0xff)/8] &= ~(1<<((bit)&0x7)))
X#define SV_BIT(glob,bit) \
X	((glob).sv_bits[((bit)&0xff)/8] & (1<<((bit)&0x7)))
X    char    sv_bits[256/8];
X    /* 
X     * Local storage for rle_getrow & sv_putrow.
X     * rle_getrow has
X     *	    scan_y	int	    current Y scanline
X     *	    vert_skip	int	    number of lines to skip
X     * sv_putrow has
X     *	    nblank	int	    number of blank lines
X     *	    brun	short(*)[2] Array of background runs.
X     *	    fileptr	long	    Position in output file.
X     */
X     union {
X	struct {
X	    int	scan_y,
X		vert_skip;
X	    char is_eof,	/* Set when EOF or EofOp encountered */
X		is_seek;	/* If true, can seek input file */
X	} get;
X	struct {
X	    int	nblank;
X	    short (*brun)[2];
X	    long fileptr;
X	} put;
X     } sv_private;
X} sv_globals;
X
X
X/* 
X * buildmap - build a more usable colormap from data in globals struct.
X */
Xextern rle_pixel **
Xbuildmap();
X/* ( globals, minmap, gamma )
X * struct sv_globals * globals;
X * int minmap;
X * double gamma;
X */
X
X/*
X * rle_getcom - get a specific comment from the image comments.
X */
Xextern char *
Xrle_getcom();
X/* ( name, globals )
X * char * name;
X * struct sv_globals * globals;
X */
X
X/*
X * rle_putcom - put (or replace) a comment into the image comments.
X */
Xextern char *
Xrle_putcom();
X/* ( value, globals )
X * char * value;
X * struct sv_globals * globals;
X */
X
X/*
X * rle_delcom - delete a specific comment from the image comments.
X */
Xextern char *
Xrle_delcom();
X/* ( name, globals )
X * char * name;
X * struct sv_globals * globals;
X */
X
X/*
X * dither globals
X */
X
Xextern int dith_levels;	/* target effective number of levels, default = 128 */
Xextern int dith_np2;	/* set non-zero to use non-power_of_2 matrix size */
Xextern int dith_size;	/* effective size of the dither matrix chosen */
X
END_OF_FILE
if test 6416 -ne `wc -c <'rle.h'`; then
    echo shar: \"'rle.h'\" unpacked with wrong size!
fi
# end of 'rle.h'
fi
if test -f 'sunraster.h' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'sunraster.h'\"
else
echo shar: Extracting \"'sunraster.h'\" \(1643 characters\)
sed "s/^X//" >'sunraster.h' <<'END_OF_FILE'
X/* sunraster.h
X *
X * this describes the header for Sun rasterfiles.  if you have SunOS, a
X * better description is in /usr/include/rasterfile.h.  this is used
X * instead to improve portability and to avoid distribution problems.
X *
X * Copyright 1989 Jim Frost.  See included file "copyright.h" for complete
X * copyright information.
X */
X
X#include "copyright.h"
X
Xstruct rheader {
X  unsigned char magic[4];   /* magic number */
X  unsigned char width[4];   /* width of image in pixels */
X  unsigned char height[4];  /* height of image in pixels */
X  unsigned char depth[4];   /* depth of each pixel */
X  unsigned char length[4];  /* length of the image in bytes */
X  unsigned char type[4];    /* format of file */
X  unsigned char maptype[4]; /* type of colormap */
X  unsigned char maplen[4];  /* length of colormap in bytes */
X};
X
X/* following the header is the colormap (unless maplen is zero) then
X * the image.  each row of the image is rounded to 2 bytes.
X */
X
X#define RMAGICNUMBER 0x59a66a95 /* magic number of this file type */
X
X/* these are the possible file formats
X */
X
X#define ROLD       0 /* old format, see /usr/include/rasterfile.h */
X#define RSTANDARD  1 /* standard format */
X#define RRLENCODED 2 /* run length encoding to compress the image */
X
X/* these are the possible colormap types.  if it's in RGB format,
X * the map is made up of three byte arrays (red, green, then blue)
X * that are each 1/3 of the colormap length.
X */
X
X#define RNOMAP  0 /* no colormap follows the header */
X#define RRGBMAP 1 /* rgb colormap */
X#define RRAWMAP 2 /* raw colormap; good luck */
X
X#define RESC 128 /* run-length encoding escape character */
X
END_OF_FILE
if test 1643 -ne `wc -c <'sunraster.h'`; then
    echo shar: \"'sunraster.h'\" unpacked with wrong size!
fi
# end of 'sunraster.h'
fi
if test -f 'xloadimage.h' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'xloadimage.h'\"
else
echo shar: Extracting \"'xloadimage.h'\" \(1807 characters\)
sed "s/^X//" >'xloadimage.h' <<'END_OF_FILE'
X/* xloadimage.h:
X *
X * jim frost 06.21.89
X *
X * Copyright 1989 Jim Frost.  See included file "copyright.h" for complete
X * copyright information.
X */
X
X#include "copyright.h"
X#include <stdio.h>
X#include <X11/X.h>
X#include <X11/Xlib.h>
X#include <X11/Xutil.h>
X
X#include "image.h"
X#include "options.h"
X
X/* image name and option structure used when processing arguments
X */
X
Xtypedef struct {
X  char         *name;         /* name of image */
X  int           atx, aty;     /* location to load image at */
X  unsigned int  bright;       /* brightness multiplier */
X  float gamma;                /* display gamma */
X  unsigned int  center;       /* true if image is to be centered */
X  unsigned int  clipx, clipy; /* area of image to be used */
X  unsigned int  clipw, cliph;
X  unsigned int  dither;       /* true if image is to be dithered */
X  unsigned int  colors;       /* max # of colors to use for this image */
X  int           rotate;	      /* # degrees to rotate image */
X  unsigned int  smooth;       /* true if image is to be smoothed */
X  char         *fg, *bg;      /* foreground/background colors if mono image */
X  unsigned int  xzoom, yzoom; /* zoom percentages */
X} ImageOptions;
X
X#ifndef MAXIMAGES
X#define MAXIMAGES BUFSIZ /* max # of images we'll try to load at once */
X#endif
X
X/* function declarations
X */
X
Xvoid supportedImageTypes(); /* imagetypes.c */
X
Xunsigned int  fullscreen;
Xunsigned int  onroot;
X
Xchar *tail(); /* misc.c */
Xvoid usage();
Xvoid goodImage();
XImage *processImage();
Xint ioErrorHandler();
X
Xchar *expandPath(); /* path.c */
Xint findImage();
Xvoid listImages();
Xvoid loadPathsAndExts();
Xvoid showPath();
X
Xvoid imageOnRoot(); /* root.c */
X
Xunsigned int sendImageToX(); /* send.c */
X
XVisual *getBestVisual(); /* visual.c */
X
Xvoid cleanUpWindow(); /* window.c */
Xchar imageInWindow();
END_OF_FILE
if test 1807 -ne `wc -c <'xloadimage.h'`; then
    echo shar: \"'xloadimage.h'\" unpacked with wrong size!
fi
# end of 'xloadimage.h'
fi
if test -f 'xwd.h' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'xwd.h'\"
else
echo shar: Extracting \"'xwd.h'\" \(3576 characters\)
sed "s/^X//" >'xwd.h' <<'END_OF_FILE'
X/* xwd.h:
X *
X * portable-ized xwd file information.  they could have made this easier.
X *
X * jim frost 07.24.90
X *
X * Copyright 1989 Jim Frost.  See included file "copyright.h" for complete
X * copyright information.
X */
X
X#define XWD_VERSION 7 /* XWD version we support */
X
Xtypedef struct {
X  byte header_size[4];      /* Size of the entire file header (bytes). */
X  byte file_version[4];	    /* XWD_FILE_VERSION */
X  byte pixmap_format[4];    /* Pixmap format */
X  byte pixmap_depth[4];	    /* Pixmap depth */
X  byte pixmap_width[4];     /* Pixmap width */
X  byte pixmap_height[4];    /* Pixmap height */
X  byte xoffset[4];          /* Bitmap x offset */
X  byte byte_order[4];       /* MSBFirst, LSBFirst */
X  byte bitmap_unit[4];      /* Bitmap unit */
X  byte bitmap_bit_order[4]; /* MSBFirst, LSBFirst */
X  byte bitmap_pad[4];       /* Bitmap scanline pad */
X  byte bits_per_pixel[4];   /* Bits per pixel */
X  byte bytes_per_line[4];   /* Bytes per scanline */
X  byte visual_class[4];     /* Class of colormap */
X  byte red_mask[4];         /* Z red mask */
X  byte green_mask[4];       /* Z green mask */
X  byte blue_mask[4];        /* Z blue mask */
X  byte bits_per_rgb[4];     /* Log2 of distinct color values */
X  byte colormap_entries[4]; /* Number of entries in colormap */
X  byte ncolors[4];          /* Number of Color structures */
X  byte window_width[4];     /* Window width */
X  byte window_height[4];    /* Window height */
X  byte window_x[4];         /* Window upper left X coordinate */
X  byte window_y[4];         /* Window upper left Y coordinate */
X  byte window_bdrwidth[4];  /* Window border width */
X} GenericXWDHeader;
X
Xtypedef struct {
X  unsigned int header_size;      /* Size of the entire file header (bytes). */
X  unsigned int file_version;     /* XWD_FILE_VERSION */
X  unsigned int pixmap_format;    /* Pixmap format */
X  unsigned int pixmap_depth;     /* Pixmap depth */
X  unsigned int pixmap_width;     /* Pixmap width */
X  unsigned int pixmap_height;    /* Pixmap height */
X  unsigned int xoffset;          /* Bitmap x offset */
X  unsigned int byte_order;       /* MSBFirst, LSBFirst */
X  unsigned int bitmap_unit;      /* Bitmap unit */
X  unsigned int bitmap_bit_order; /* MSBFirst, LSBFirst */
X  unsigned int bitmap_pad;       /* Bitmap scanline pad */
X  unsigned int bits_per_pixel;   /* Bits per pixel */
X  unsigned int bytes_per_line;   /* Bytes per scanline */
X  unsigned int visual_class;     /* Class of colormap */
X/*unsigned int red_mask;*/       /* Z red mask */
X/*unsigned int green_mask;*/     /* Z green mask */
X/*unsigned int blue_mask;*/      /* Z blue mask */
X/*unsigned int bits_per_rgb;*/   /* Log2 of distinct color values */
X  unsigned int colormap_entries; /* Number of entries in colormap */
X  unsigned int ncolors;          /* Number of Color structures */
X/*unsigned int window_width;*/   /* Window width */
X/*unsigned int window_height;*/  /* Window height */
X/*unsigned int window_x;*/       /* Window upper left X coordinate */
X/*unsigned int window_y;*/       /* Window upper left Y coordinate */
X/*unsigned int window_bdrwidth;*//* Window border width */
X} XWDHeader;
X
Xtypedef struct {
X  byte pixel[4]; /* pixel value for this color */
X  byte red[2];   /* red intensity */
X  byte green[2]; /* green intensity */
X  byte blue[2];  /* blue intensity */
X  byte flags;    /* XColor flags (ignored) */
X  byte pad;
X} XWDColor;
X
X#define NOT_XWD 0 /* definitely not an XWD file */
X#define XWD_MSB 1 /* looks like XWD file created on MSBFirst machine */
X#define XWD_LSB 2 /* looks like XWD file created on LSBFirst machine */
END_OF_FILE
if test 3576 -ne `wc -c <'xwd.h'`; then
    echo shar: \"'xwd.h'\" unpacked with wrong size!
fi
# end of 'xwd.h'
fi
if test -f 'cmuwmraster.h' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'cmuwmraster.h'\"
else
echo shar: Extracting \"'cmuwmraster.h'\" \(314 characters\)
sed "s/^X//" >'cmuwmraster.h' <<'END_OF_FILE'
X/* cmuwmraster.h
X *
X * this describes the header for ITC (CMU WM) raster files. It is
X * essentially a byte reversed Sun raster, 1 plane, no encoding.
X */
X
X#include "copyright.h"
X
Xstruct cmuwm_header
X{
X    char magic[4];
X    char width[4];
X    char height[4];
X    char depth[2];
X};
X
X#define CMUWM_MAGIC 0xf10040bb
END_OF_FILE
if test 314 -ne `wc -c <'cmuwmraster.h'`; then
    echo shar: \"'cmuwmraster.h'\" unpacked with wrong size!
fi
# end of 'cmuwmraster.h'
fi
if test -f 'options.h' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'options.h'\"
else
echo shar: Extracting \"'options.h'\" \(314 characters\)
sed "s/^X//" >'options.h' <<'END_OF_FILE'
X/* options.h:
X *
X * optionNumber() definitions
X *
X * jim frost 10.03.89
X *
X * Copyright 1989 Jim Frost.  See included file "copyright.h" for complete
X * copyright information.
X */
X
X#include "copyright.h"
X
X#define OPT_NOTOPT   -1
X#define OPT_BADOPT   -2
X#define OPT_SHORTOPT -3
X
Xint optionNumber(); /* options.c */
END_OF_FILE
if test 314 -ne `wc -c <'options.h'`; then
    echo shar: \"'options.h'\" unpacked with wrong size!
fi
# end of 'options.h'
fi
echo shar: End of archive 1 \(of 9\).
cp /dev/null ark1isdone
MISSING=""
for I in 1 2 3 4 5 6 7 8 9 ; do
    if test ! -f ark${I}isdone ; then
	MISSING="${MISSING} ${I}"
    fi
done
if test "${MISSING}" = "" ; then
    echo You have unpacked all 9 archives.
    rm -f ark[1-9]isdone ark[1-9][0-9]isdone
else
    echo You still need to unpack the following archives:
    echo "        " ${MISSING}
fi
##  End of shell archive.
exit 0

dan
----------------------------------------------------
O'Reilly && Associates   argv@sun.com / argv@ora.com
Opinions expressed reflect those of the author only.