home *** CD-ROM | disk | FTP | other *** search
Text File | 1993-04-27 | 49.1 KB | 1,622 lines |
- Newsgroups: comp.sources.x
- From: lusol@Turkey.CC.Lehigh.EDU (Stephen O. Lidie)
- Subject: v19i038: xodometer - Track pointer and measure distance moved, Part02/04
- Message-ID: <1993Mar11.161603.17249@sparky.imd.sterling.com>
- X-Md4-Signature: 314177200a9bacf7d26a07dd596a7ff2
- Date: Thu, 11 Mar 1993 16:16:03 GMT
- Approved: chris@sparky.imd.sterling.com
-
- Submitted-by: lusol@Turkey.CC.Lehigh.EDU (Stephen O. Lidie)
- Posting-number: Volume 19, Issue 38
- Archive-name: xodometer/part02
- Environment: X11
-
-
- #! /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 4)."
- # Contents: Makefile Makefile.AIX evap/evap.c
- # Wrapped by lusol@Turkey.CC.Lehigh.EDU on Wed Mar 10 19:42:12 1993
- PATH=/bin:/usr/bin:/usr/ucb ; export PATH
- if test -f 'Makefile' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'Makefile'\"
- else
- echo shar: Extracting \"'Makefile'\" \(12026 characters\)
- sed "s/^X//" >'Makefile' <<'END_OF_FILE'
- X# Makefile generated by imake - do not edit!
- X# $XConsortium: imake.c,v 1.65 91/07/25 17:50:17 rws Exp $
- X#
- X# The cpp used on this machine replaces all newlines and multiple tabs and
- X# spaces in a macro expansion with a single space. Imake tries to compensate
- X# for this, but is not always successful.
- X#
- X
- X# -------------------------------------------------------------------------
- X# Makefile generated from "Imake.tmpl" and </tmp/IIf.Rq8Crx>
- X# $XConsortium: Imake.tmpl,v 1.139 91/09/16 08:52:48 rws Exp $
- X#
- X# Platform-specific parameters may be set in the appropriate <vendor>.cf
- X# configuration files. Site-specific parameters should be set in the file
- X# site.def. Full rebuilds are recommended if any parameters are changed.
- X#
- X# If your C preprocessor does not define any unique symbols, you will need
- X# to set BOOTSTRAPCFLAGS when rebuilding imake (usually when doing
- X# "make World" the first time).
- X#
- X
- X# -------------------------------------------------------------------------
- X# site-specific configuration parameters that need to come before
- X# the platform-specific parameters - edit site.def to change
- X
- X# site: $XConsortium: site.def,v 1.2 91/07/30 20:26:44 rws Exp $
- X
- X# -------------------------------------------------------------------------
- X# platform-specific configuration parameters - edit ibm.cf to change
- X
- X# platform: $XConsortium: ibm.cf,v 1.29 91/07/28 22:39:58 rws Exp $
- X
- X# operating system: AIX 3.2.3
- X
- X# $XConsortium: ibmLib.rules,v 1.5 91/05/10 09:27:27 jap Exp $
- X
- X# -------------------------------------------------------------------------
- X# site-specific configuration parameters that go after
- X# the platform-specific parameters - edit site.def to change
- X
- X# site: $XConsortium: site.def,v 1.2 91/07/30 20:26:44 rws Exp $
- X
- X SHELL = /bin/sh
- X
- X TOP = .
- X CURRENT_DIR = .
- X
- X AR = ar clq
- X BOOTSTRAPCFLAGS =
- X CC = cc
- X AS = as
- X
- X COMPRESS = compress
- X CPP = /usr/lpp/X11/Xamples/util/cpp/cpp $(STD_CPP_DEFINES)
- X PREPROCESSCMD = cc -E $(STD_CPP_DEFINES)
- X INSTALL = /usr/ucb/install
- X LD = ld
- X LINT = lint
- X LINTLIBFLAG = -o
- X LINTOPTS = -ax
- X LN = ln -s
- X MAKE = make
- X MV = mv
- X CP = cp
- X
- X RM = rm -f
- X TROFF = psroff
- X MSMACROS = -ms
- X TBL = tbl
- X EQN = eqn
- X STD_INCLUDES =
- X STD_CPP_DEFINES = -DSYSV -DAIXV3 -D_BSD -D_BSD_INCLUDES
- X STD_DEFINES = -DSYSV -DAIXV3 -D_BSD -D_BSD_INCLUDES
- X EXTRA_LOAD_FLAGS = -bnodelcsect
- X EXTRA_LIBRARIES =
- X TAGS = ctags
- X
- X MFLAGS = -$(MAKEFLAGS)
- X
- X SHAREDCODEDEF = -DSHAREDCODE
- X SHLIBDEF = -DAIXSHLIB
- X
- X PROTO_DEFINES =
- X
- X INSTPGMFLAGS =
- X
- X INSTBINFLAGS = -m 0755
- X INSTUIDFLAGS = -m 4755
- X INSTLIBFLAGS = -m 0644
- X INSTINCFLAGS = -m 0444
- X INSTMANFLAGS = -m 0444
- X INSTDATFLAGS = -m 0444
- X INSTKMEMFLAGS = -m 4755
- X
- X PROJECTROOT = /usr/local/X11R5
- X
- X TOP_INCLUDES = -I$(INCROOT)
- X
- X CDEBUGFLAGS = -O
- X CCOPTIONS =
- X
- X ALLINCLUDES = $(INCLUDES) $(EXTRA_INCLUDES) $(TOP_INCLUDES) $(STD_INCLUDES)
- X ALLDEFINES = $(ALLINCLUDES) $(STD_DEFINES) $(EXTRA_DEFINES) $(PROTO_DEFINES) $(DEFINES)
- X CFLAGS = $(CDEBUGFLAGS) $(CCOPTIONS) $(ALLDEFINES)
- X LINTFLAGS = $(LINTOPTS) -DLINT $(ALLDEFINES)
- X
- X LDLIBS = $(SYS_LIBRARIES) $(EXTRA_LIBRARIES)
- X
- X LDOPTIONS = $(CDEBUGFLAGS) $(CCOPTIONS) $(LOCAL_LDFLAGS) -L$(USRLIBDIR)
- X
- X LDCOMBINEFLAGS = -r
- X DEPENDFLAGS =
- X
- X MACROFILE = ibm.cf
- X RM_CMD = $(RM) *.CKP *.ln *.BAK *.bak *.o core errs ,* *~ *.a .emacs_* tags TAGS make.log MakeOut
- X
- X IMAKE_DEFINES =
- X
- X IRULESRC = $(CONFIGDIR)
- X IMAKE_CMD = $(IMAKE) -DUseInstalled -I$(IRULESRC) $(IMAKE_DEFINES)
- X
- X ICONFIGFILES = $(IRULESRC)/Imake.tmpl $(IRULESRC)/Imake.rules \
- X $(IRULESRC)/Project.tmpl $(IRULESRC)/site.def \
- X $(IRULESRC)/$(MACROFILE) $(EXTRA_ICONFIGFILES)
- X
- X# -------------------------------------------------------------------------
- X# X Window System Build Parameters
- X# $XConsortium: Project.tmpl,v 1.138 91/09/10 09:02:12 rws Exp $
- X
- X# -------------------------------------------------------------------------
- X# X Window System make variables; this need to be coordinated with rules
- X
- X PATHSEP = /
- X USRLIBDIR = /usr/local/X11R5/lib
- X BINDIR = /usr/local/X11R5/bin
- X INCROOT = /usr/local/X11R5/include
- X BUILDINCROOT = $(TOP)
- X BUILDINCDIR = $(BUILDINCROOT)/X11
- X BUILDINCTOP = ..
- X INCDIR = $(INCROOT)/X11
- X ADMDIR = /usr/adm
- X LIBDIR = $(USRLIBDIR)/X11
- X CONFIGDIR = $(LIBDIR)/config
- X LINTLIBDIR = $(USRLIBDIR)/lint
- X
- X FONTDIR = $(LIBDIR)/fonts
- X XINITDIR = $(LIBDIR)/xinit
- X XDMDIR = $(LIBDIR)/xdm
- X TWMDIR = $(LIBDIR)/twm
- X MANPATH = /usr/local/X11R5/man
- X MANSOURCEPATH = $(MANPATH)/man
- X MANSUFFIX = n
- X LIBMANSUFFIX = 3
- X MANDIR = $(MANSOURCEPATH)$(MANSUFFIX)
- X LIBMANDIR = $(MANSOURCEPATH)$(LIBMANSUFFIX)
- X NLSDIR = $(LIBDIR)/nls
- X PEXAPIDIR = $(LIBDIR)/PEX
- X XAPPLOADDIR = $(LIBDIR)/app-defaults
- X FONTCFLAGS = -t
- X
- X INSTAPPFLAGS = $(INSTDATFLAGS)
- X
- X IMAKE = imake
- X DEPEND = makedepend
- X RGB = rgb
- X
- X FONTC = bdftopcf
- X
- X MKFONTDIR = mkfontdir
- X MKDIRHIER = /bin/sh $(BINDIR)/mkdirhier
- X
- X CONFIGSRC = $(TOP)/config
- X DOCUTILSRC = $(TOP)/doc/util
- X CLIENTSRC = $(TOP)/clients
- X DEMOSRC = $(TOP)/demos
- X LIBSRC = $(TOP)/lib
- X FONTSRC = $(TOP)/fonts
- X INCLUDESRC = $(TOP)/X11
- X SERVERSRC = $(TOP)/server
- X UTILSRC = $(TOP)/util
- X SCRIPTSRC = $(UTILSRC)/scripts
- X EXAMPLESRC = $(TOP)/examples
- X CONTRIBSRC = $(TOP)/../contrib
- X DOCSRC = $(TOP)/doc
- X RGBSRC = $(TOP)/rgb
- X DEPENDSRC = $(UTILSRC)/makedepend
- X IMAKESRC = $(CONFIGSRC)
- X XAUTHSRC = $(LIBSRC)/Xau
- X XLIBSRC = $(LIBSRC)/X
- X XMUSRC = $(LIBSRC)/Xmu
- X TOOLKITSRC = $(LIBSRC)/Xt
- X AWIDGETSRC = $(LIBSRC)/Xaw
- X OLDXLIBSRC = $(LIBSRC)/oldX
- X XDMCPLIBSRC = $(LIBSRC)/Xdmcp
- X BDFTOSNFSRC = $(FONTSRC)/bdftosnf
- X BDFTOSNFSRC = $(FONTSRC)/clients/bdftosnf
- X BDFTOPCFSRC = $(FONTSRC)/clients/bdftopcf
- X MKFONTDIRSRC = $(FONTSRC)/clients/mkfontdir
- X FSLIBSRC = $(FONTSRC)/lib/fs
- X FONTSERVERSRC = $(FONTSRC)/server
- X EXTENSIONSRC = $(TOP)/extensions
- X XILIBSRC = $(EXTENSIONSRC)/lib/xinput
- X PHIGSLIBSRC = $(EXTENSIONSRC)/lib/PEX
- X
- X# $XConsortium: ibmLib.tmpl,v 1.2 91/05/04 11:49:00 rws Exp $
- X
- XPICFLAGS = -bM\:SRE
- X
- X DEPEXTENSIONLIB =
- X EXTENSIONLIB = -lXext
- X
- X DEPXLIB = $(DEPEXTENSIONLIB)
- X XLIB = $(EXTENSIONLIB) -lX11
- X
- X DEPXMULIB =
- X XMULIB = -lXmu
- X
- X DEPOLDXLIB =
- X OLDXLIB = -loldX
- X
- X DEPXTOOLLIB = $(USRLIBDIR)/libXt.a
- X XTOOLLIB = -lXt
- X
- X DEPXAWLIB =
- X XAWLIB = -lXaw
- X
- X DEPXILIB =
- X XILIB = -lXi
- X
- X SOXLIBREV = SharedXlibRev
- X SOXTREV = SharedXtRev
- X SOXAWREV = SharedXawRev
- X SOOLDXREV = SharedOldXRev
- X SOXMUREV = SharedXmuRev
- X SOXEXTREV = SharedXextRev
- X SOXINPUTREV = SharedXinputRev
- X
- X DEPXAUTHLIB = $(USRLIBDIR)/libXau.a
- X XAUTHLIB = -lXau
- X DEPXDMCPLIB = $(USRLIBDIR)/libXdmcp.a
- X XDMCPLIB = -lXdmcp
- X
- X DEPPHIGSLIB = $(USRLIBDIR)/libphigs.a
- X PHIGSLIB = -lphigs
- X
- X DEPXBSDLIB = $(USRLIBDIR)/libXbsd.a
- X XBSDLIB = -lXbsd
- X
- X LINTEXTENSIONLIB = $(LINTLIBDIR)/llib-lXext.ln
- X LINTXLIB = $(LINTLIBDIR)/llib-lX11.ln
- X LINTXMU = $(LINTLIBDIR)/llib-lXmu.ln
- X LINTXTOOL = $(LINTLIBDIR)/llib-lXt.ln
- X LINTXAW = $(LINTLIBDIR)/llib-lXaw.ln
- X LINTXI = $(LINTLIBDIR)/llib-lXi.ln
- X LINTPHIGS = $(LINTLIBDIR)/llib-lphigs.ln
- X
- X DEPLIBS = $(DEPXAWLIB) $(DEPXMULIB) $(DEPXTOOLLIB) $(DEPXLIB)
- X
- X DEPLIBS1 = $(DEPLIBS)
- X DEPLIBS2 = $(DEPLIBS)
- X DEPLIBS3 = $(DEPLIBS)
- X
- X# -------------------------------------------------------------------------
- X# Imake rules for building libraries, programs, scripts, and data files
- X# rules: $XConsortium: Imake.rules,v 1.123 91/09/16 20:12:16 rws Exp $
- X
- X# -------------------------------------------------------------------------
- X# start of Imakefile
- X
- X#
- X# Imakefile for xodometer.
- X#
- X# Stephen O. Lidie, Lehigh University Computing Center, 93/02/11.
- X#
- X# lusol@Lehigh.EDU
- X#
- X# Prior to running xmkmf inspect/change the following variables:
- X#
- X# BINDIR binary directoy
- X# MANDIR man page directory
- X# RANLIB what is ranlib (sorry, not defined in AIX)
- X# PERLDIR path name of Perl (it's OK if you don't have Perl!)
- X# CDEBUGFLAGS cc compiler options
- X# MATHLIB name of math library
- X# LOCAL_LIBRARIES which libraries
- X#
- X# Then: xmkmf; make; make install
- X#
- X
- X#
- X# Where you want things installed.
- X#
- XBINDIR = /usr/local/bin
- XMANDIR = /usr/local/man/man1
- X
- X#
- X# Whether or not you have/need ranlib.
- X#
- XRANLIB = ranlib # have or need ranlib
- X#RANLIB = /bin/true # do not have or need ranlib
- X
- X#
- X# Where to get Perl. It's OK if you don't have Perl, but expect an error
- X# from the program genmp during a 'make install' - the error can be safely
- X# ignored. I use genmp (generate_man_page) so that the xodometer man page
- X# is always up-to-date, but the one that you have received in this
- X# distribution is by definition the latest and greatest.
- X#
- XPERLDIR = /usr/local/bin
- X
- XCDEBUGFLAGS = -O
- XMATHLIB = -lm
- XLOCAL_LIBRARIES = $(XLIB) $(MATHLIB)
- X
- XSRCS = xodo.c evap/evap.c
- XOBJS = xodo.o evap/evap.o
- X
- Xall:: xodo_a xodo
- X
- Xclean::
- X rm xodo xodo.o xodomm.a evap/evap.o
- X
- Xevap/evap.o: evap/evap.c evap/evap.h
- X (cd evap; $(CC) $(CDEBUGFLAGS) -DP_EVAP_MM_PATH=\"$(BINDIR)\" -c evap.c)
- X
- Xxodo_a:
- X ar rcv xodomm.a evap\/xodo.mm
- X $(RANLIB) xodomm.a
- X sed -e "s!/usr/local/bin!$(BINDIR)!g" evap/xodo_pdt.skl > evap/xodo_pdt.out
- X
- Xinstall::
- X $(INSTALL) -c $(INSTPGMFLAGS) xodo $(BINDIR)
- X $(INSTALL) -c $(INSTPGMFLAGS) xodomm.a $(BINDIR)
- X sed -e "s!/usr/local/bin!$(PERLDIR)!" evap/genmp.skl > evap/genmp
- X chmod 755 evap/genmp
- X @echo " "
- X @echo "******* Any errors from genmp can be safely ignored!"
- X -evap/genmp $(BINDIR)/xodo 1> /dev/null 2> /dev/null
- X @echo "******* Any errors from genmp can be safely ignored!"
- X @echo " "
- X $(INSTALL) -c $(INSTMANFLAGS) xodo.man $(MANDIR)/xodo.1
- X
- X PROGRAM = xodo
- X
- Xall:: xodo
- X
- Xxodo: $(OBJS) $(DEPLIBS)
- X $(RM) $@
- X $(CC) -o $@ $(OBJS) $(LDOPTIONS) $(LOCAL_LIBRARIES) $(LDLIBS) $(EXTRA_LOAD_FLAGS)
- X
- Xinstall:: xodo
- X @if [ -d $(DESTDIR)$(BINDIR) ]; then set +x; \
- X else (set -x; $(MKDIRHIER) $(DESTDIR)$(BINDIR)); fi
- X $(INSTALL) -c $(INSTPGMFLAGS) xodo $(DESTDIR)$(BINDIR)
- X
- Xinstall.man:: xodo.man
- X @if [ -d $(DESTDIR)$(MANDIR) ]; then set +x; \
- X else (set -x; $(MKDIRHIER) $(DESTDIR)$(MANDIR)); fi
- X $(INSTALL) -c $(INSTMANFLAGS) xodo.man $(DESTDIR)$(MANDIR)/xodo.$(MANSUFFIX)
- X
- Xdepend::
- X $(DEPEND) $(DEPENDFLAGS) -s "# DO NOT DELETE" -- $(ALLDEFINES) -- $(SRCS)
- X
- Xlint:
- X $(LINT) $(LINTFLAGS) $(SRCS) $(LINTLIBS)
- Xlint1:
- X $(LINT) $(LINTFLAGS) $(FILE) $(LINTLIBS)
- X
- Xclean::
- X $(RM) $(PROGRAM)
- X
- X# -------------------------------------------------------------------------
- X# common rules for all Makefiles - do not edit
- X
- Xemptyrule::
- X
- Xclean::
- X $(RM_CMD) "#"*
- X
- XMakefile::
- X -@if [ -f Makefile ]; then set -x; \
- X $(RM) Makefile.bak; $(MV) Makefile Makefile.bak; \
- X else exit 0; fi
- X $(IMAKE_CMD) -DTOPDIR=$(TOP) -DCURDIR=$(CURRENT_DIR)
- X
- Xtags::
- X $(TAGS) -w *.[ch]
- X $(TAGS) -xw *.[ch] > TAGS
- X
- X# -------------------------------------------------------------------------
- X# empty rules for directories that do not have SUBDIRS - do not edit
- X
- Xinstall::
- X @echo "install in $(CURRENT_DIR) done"
- X
- Xinstall.man::
- X @echo "install.man in $(CURRENT_DIR) done"
- X
- XMakefiles::
- X
- Xincludes::
- X
- X# -------------------------------------------------------------------------
- X# dependencies generated by makedepend
- X
- END_OF_FILE
- if test 12026 -ne `wc -c <'Makefile'`; then
- echo shar: \"'Makefile'\" unpacked with wrong size!
- fi
- # end of 'Makefile'
- fi
- if test -f 'Makefile.AIX' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'Makefile.AIX'\"
- else
- echo shar: Extracting \"'Makefile.AIX'\" \(12026 characters\)
- sed "s/^X//" >'Makefile.AIX' <<'END_OF_FILE'
- X# Makefile generated by imake - do not edit!
- X# $XConsortium: imake.c,v 1.65 91/07/25 17:50:17 rws Exp $
- X#
- X# The cpp used on this machine replaces all newlines and multiple tabs and
- X# spaces in a macro expansion with a single space. Imake tries to compensate
- X# for this, but is not always successful.
- X#
- X
- X# -------------------------------------------------------------------------
- X# Makefile generated from "Imake.tmpl" and </tmp/IIf.Rh0CzR>
- X# $XConsortium: Imake.tmpl,v 1.139 91/09/16 08:52:48 rws Exp $
- X#
- X# Platform-specific parameters may be set in the appropriate <vendor>.cf
- X# configuration files. Site-specific parameters should be set in the file
- X# site.def. Full rebuilds are recommended if any parameters are changed.
- X#
- X# If your C preprocessor does not define any unique symbols, you will need
- X# to set BOOTSTRAPCFLAGS when rebuilding imake (usually when doing
- X# "make World" the first time).
- X#
- X
- X# -------------------------------------------------------------------------
- X# site-specific configuration parameters that need to come before
- X# the platform-specific parameters - edit site.def to change
- X
- X# site: $XConsortium: site.def,v 1.2 91/07/30 20:26:44 rws Exp $
- X
- X# -------------------------------------------------------------------------
- X# platform-specific configuration parameters - edit ibm.cf to change
- X
- X# platform: $XConsortium: ibm.cf,v 1.29 91/07/28 22:39:58 rws Exp $
- X
- X# operating system: AIX 3.2.3
- X
- X# $XConsortium: ibmLib.rules,v 1.5 91/05/10 09:27:27 jap Exp $
- X
- X# -------------------------------------------------------------------------
- X# site-specific configuration parameters that go after
- X# the platform-specific parameters - edit site.def to change
- X
- X# site: $XConsortium: site.def,v 1.2 91/07/30 20:26:44 rws Exp $
- X
- X SHELL = /bin/sh
- X
- X TOP = .
- X CURRENT_DIR = .
- X
- X AR = ar clq
- X BOOTSTRAPCFLAGS =
- X CC = cc
- X AS = as
- X
- X COMPRESS = compress
- X CPP = /usr/lpp/X11/Xamples/util/cpp/cpp $(STD_CPP_DEFINES)
- X PREPROCESSCMD = cc -E $(STD_CPP_DEFINES)
- X INSTALL = /usr/ucb/install
- X LD = ld
- X LINT = lint
- X LINTLIBFLAG = -o
- X LINTOPTS = -ax
- X LN = ln -s
- X MAKE = make
- X MV = mv
- X CP = cp
- X
- X RM = rm -f
- X TROFF = psroff
- X MSMACROS = -ms
- X TBL = tbl
- X EQN = eqn
- X STD_INCLUDES =
- X STD_CPP_DEFINES = -DSYSV -DAIXV3 -D_BSD -D_BSD_INCLUDES
- X STD_DEFINES = -DSYSV -DAIXV3 -D_BSD -D_BSD_INCLUDES
- X EXTRA_LOAD_FLAGS = -bnodelcsect
- X EXTRA_LIBRARIES =
- X TAGS = ctags
- X
- X MFLAGS = -$(MAKEFLAGS)
- X
- X SHAREDCODEDEF = -DSHAREDCODE
- X SHLIBDEF = -DAIXSHLIB
- X
- X PROTO_DEFINES =
- X
- X INSTPGMFLAGS =
- X
- X INSTBINFLAGS = -m 0755
- X INSTUIDFLAGS = -m 4755
- X INSTLIBFLAGS = -m 0644
- X INSTINCFLAGS = -m 0444
- X INSTMANFLAGS = -m 0444
- X INSTDATFLAGS = -m 0444
- X INSTKMEMFLAGS = -m 4755
- X
- X PROJECTROOT = /usr/local/X11R5
- X
- X TOP_INCLUDES = -I$(INCROOT)
- X
- X CDEBUGFLAGS = -O
- X CCOPTIONS =
- X
- X ALLINCLUDES = $(INCLUDES) $(EXTRA_INCLUDES) $(TOP_INCLUDES) $(STD_INCLUDES)
- X ALLDEFINES = $(ALLINCLUDES) $(STD_DEFINES) $(EXTRA_DEFINES) $(PROTO_DEFINES) $(DEFINES)
- X CFLAGS = $(CDEBUGFLAGS) $(CCOPTIONS) $(ALLDEFINES)
- X LINTFLAGS = $(LINTOPTS) -DLINT $(ALLDEFINES)
- X
- X LDLIBS = $(SYS_LIBRARIES) $(EXTRA_LIBRARIES)
- X
- X LDOPTIONS = $(CDEBUGFLAGS) $(CCOPTIONS) $(LOCAL_LDFLAGS) -L$(USRLIBDIR)
- X
- X LDCOMBINEFLAGS = -r
- X DEPENDFLAGS =
- X
- X MACROFILE = ibm.cf
- X RM_CMD = $(RM) *.CKP *.ln *.BAK *.bak *.o core errs ,* *~ *.a .emacs_* tags TAGS make.log MakeOut
- X
- X IMAKE_DEFINES =
- X
- X IRULESRC = $(CONFIGDIR)
- X IMAKE_CMD = $(IMAKE) -DUseInstalled -I$(IRULESRC) $(IMAKE_DEFINES)
- X
- X ICONFIGFILES = $(IRULESRC)/Imake.tmpl $(IRULESRC)/Imake.rules \
- X $(IRULESRC)/Project.tmpl $(IRULESRC)/site.def \
- X $(IRULESRC)/$(MACROFILE) $(EXTRA_ICONFIGFILES)
- X
- X# -------------------------------------------------------------------------
- X# X Window System Build Parameters
- X# $XConsortium: Project.tmpl,v 1.138 91/09/10 09:02:12 rws Exp $
- X
- X# -------------------------------------------------------------------------
- X# X Window System make variables; this need to be coordinated with rules
- X
- X PATHSEP = /
- X USRLIBDIR = /usr/local/X11R5/lib
- X BINDIR = /usr/local/X11R5/bin
- X INCROOT = /usr/local/X11R5/include
- X BUILDINCROOT = $(TOP)
- X BUILDINCDIR = $(BUILDINCROOT)/X11
- X BUILDINCTOP = ..
- X INCDIR = $(INCROOT)/X11
- X ADMDIR = /usr/adm
- X LIBDIR = $(USRLIBDIR)/X11
- X CONFIGDIR = $(LIBDIR)/config
- X LINTLIBDIR = $(USRLIBDIR)/lint
- X
- X FONTDIR = $(LIBDIR)/fonts
- X XINITDIR = $(LIBDIR)/xinit
- X XDMDIR = $(LIBDIR)/xdm
- X TWMDIR = $(LIBDIR)/twm
- X MANPATH = /usr/local/X11R5/man
- X MANSOURCEPATH = $(MANPATH)/man
- X MANSUFFIX = n
- X LIBMANSUFFIX = 3
- X MANDIR = $(MANSOURCEPATH)$(MANSUFFIX)
- X LIBMANDIR = $(MANSOURCEPATH)$(LIBMANSUFFIX)
- X NLSDIR = $(LIBDIR)/nls
- X PEXAPIDIR = $(LIBDIR)/PEX
- X XAPPLOADDIR = $(LIBDIR)/app-defaults
- X FONTCFLAGS = -t
- X
- X INSTAPPFLAGS = $(INSTDATFLAGS)
- X
- X IMAKE = imake
- X DEPEND = makedepend
- X RGB = rgb
- X
- X FONTC = bdftopcf
- X
- X MKFONTDIR = mkfontdir
- X MKDIRHIER = /bin/sh $(BINDIR)/mkdirhier
- X
- X CONFIGSRC = $(TOP)/config
- X DOCUTILSRC = $(TOP)/doc/util
- X CLIENTSRC = $(TOP)/clients
- X DEMOSRC = $(TOP)/demos
- X LIBSRC = $(TOP)/lib
- X FONTSRC = $(TOP)/fonts
- X INCLUDESRC = $(TOP)/X11
- X SERVERSRC = $(TOP)/server
- X UTILSRC = $(TOP)/util
- X SCRIPTSRC = $(UTILSRC)/scripts
- X EXAMPLESRC = $(TOP)/examples
- X CONTRIBSRC = $(TOP)/../contrib
- X DOCSRC = $(TOP)/doc
- X RGBSRC = $(TOP)/rgb
- X DEPENDSRC = $(UTILSRC)/makedepend
- X IMAKESRC = $(CONFIGSRC)
- X XAUTHSRC = $(LIBSRC)/Xau
- X XLIBSRC = $(LIBSRC)/X
- X XMUSRC = $(LIBSRC)/Xmu
- X TOOLKITSRC = $(LIBSRC)/Xt
- X AWIDGETSRC = $(LIBSRC)/Xaw
- X OLDXLIBSRC = $(LIBSRC)/oldX
- X XDMCPLIBSRC = $(LIBSRC)/Xdmcp
- X BDFTOSNFSRC = $(FONTSRC)/bdftosnf
- X BDFTOSNFSRC = $(FONTSRC)/clients/bdftosnf
- X BDFTOPCFSRC = $(FONTSRC)/clients/bdftopcf
- X MKFONTDIRSRC = $(FONTSRC)/clients/mkfontdir
- X FSLIBSRC = $(FONTSRC)/lib/fs
- X FONTSERVERSRC = $(FONTSRC)/server
- X EXTENSIONSRC = $(TOP)/extensions
- X XILIBSRC = $(EXTENSIONSRC)/lib/xinput
- X PHIGSLIBSRC = $(EXTENSIONSRC)/lib/PEX
- X
- X# $XConsortium: ibmLib.tmpl,v 1.2 91/05/04 11:49:00 rws Exp $
- X
- XPICFLAGS = -bM\:SRE
- X
- X DEPEXTENSIONLIB =
- X EXTENSIONLIB = -lXext
- X
- X DEPXLIB = $(DEPEXTENSIONLIB)
- X XLIB = $(EXTENSIONLIB) -lX11
- X
- X DEPXMULIB =
- X XMULIB = -lXmu
- X
- X DEPOLDXLIB =
- X OLDXLIB = -loldX
- X
- X DEPXTOOLLIB = $(USRLIBDIR)/libXt.a
- X XTOOLLIB = -lXt
- X
- X DEPXAWLIB =
- X XAWLIB = -lXaw
- X
- X DEPXILIB =
- X XILIB = -lXi
- X
- X SOXLIBREV = SharedXlibRev
- X SOXTREV = SharedXtRev
- X SOXAWREV = SharedXawRev
- X SOOLDXREV = SharedOldXRev
- X SOXMUREV = SharedXmuRev
- X SOXEXTREV = SharedXextRev
- X SOXINPUTREV = SharedXinputRev
- X
- X DEPXAUTHLIB = $(USRLIBDIR)/libXau.a
- X XAUTHLIB = -lXau
- X DEPXDMCPLIB = $(USRLIBDIR)/libXdmcp.a
- X XDMCPLIB = -lXdmcp
- X
- X DEPPHIGSLIB = $(USRLIBDIR)/libphigs.a
- X PHIGSLIB = -lphigs
- X
- X DEPXBSDLIB = $(USRLIBDIR)/libXbsd.a
- X XBSDLIB = -lXbsd
- X
- X LINTEXTENSIONLIB = $(LINTLIBDIR)/llib-lXext.ln
- X LINTXLIB = $(LINTLIBDIR)/llib-lX11.ln
- X LINTXMU = $(LINTLIBDIR)/llib-lXmu.ln
- X LINTXTOOL = $(LINTLIBDIR)/llib-lXt.ln
- X LINTXAW = $(LINTLIBDIR)/llib-lXaw.ln
- X LINTXI = $(LINTLIBDIR)/llib-lXi.ln
- X LINTPHIGS = $(LINTLIBDIR)/llib-lphigs.ln
- X
- X DEPLIBS = $(DEPXAWLIB) $(DEPXMULIB) $(DEPXTOOLLIB) $(DEPXLIB)
- X
- X DEPLIBS1 = $(DEPLIBS)
- X DEPLIBS2 = $(DEPLIBS)
- X DEPLIBS3 = $(DEPLIBS)
- X
- X# -------------------------------------------------------------------------
- X# Imake rules for building libraries, programs, scripts, and data files
- X# rules: $XConsortium: Imake.rules,v 1.123 91/09/16 20:12:16 rws Exp $
- X
- X# -------------------------------------------------------------------------
- X# start of Imakefile
- X
- X#
- X# Imakefile for xodometer.
- X#
- X# Stephen O. Lidie, Lehigh University Computing Center, 93/02/11.
- X#
- X# lusol@Lehigh.EDU
- X#
- X# Prior to running xmkmf inspect/change the following variables:
- X#
- X# BINDIR binary directoy
- X# MANDIR man page directory
- X# RANLIB what is ranlib (sorry, not defined in AIX)
- X# PERLDIR path name of Perl (it's OK if you don't have Perl!)
- X# CDEBUGFLAGS cc compiler options
- X# MATHLIB name of math library
- X# LOCAL_LIBRARIES which libraries
- X#
- X# Then: xmkmf; make; make install
- X#
- X
- X#
- X# Where you want things installed.
- X#
- XBINDIR = /usr/local/bin
- XMANDIR = /usr/local/man/man1
- X
- X#
- X# Whether or not you have/need ranlib.
- X#
- XRANLIB = ranlib # have or need ranlib
- X#RANLIB = /bin/true # do not have or need ranlib
- X
- X#
- X# Where to get Perl. It's OK if you don't have Perl, but expect an error
- X# from the program genmp during a 'make install' - the error can be safely
- X# ignored. I use genmp (generate_man_page) so that the xodometer man page
- X# is always up-to-date, but the one that you have received in this
- X# distribution is by definition the latest and greatest.
- X#
- XPERLDIR = /usr/local/bin
- X
- XCDEBUGFLAGS = -O
- XMATHLIB = -lm
- XLOCAL_LIBRARIES = $(XLIB) $(MATHLIB)
- X
- XSRCS = xodo.c evap/evap.c
- XOBJS = xodo.o evap/evap.o
- X
- Xall:: xodo_a xodo
- X
- Xclean::
- X rm xodo xodo.o xodomm.a evap/evap.o
- X
- Xevap/evap.o: evap/evap.c evap/evap.h
- X (cd evap; $(CC) $(CDEBUGFLAGS) -DP_EVAP_MM_PATH=\"$(BINDIR)\" -c evap.c)
- X
- Xxodo_a:
- X ar rcv xodomm.a evap\/xodo.mm
- X $(RANLIB) xodomm.a
- X sed -e "s!/usr/local/bin!$(BINDIR)!g" evap/xodo_pdt.skl > evap/xodo_pdt.out
- X
- Xinstall::
- X $(INSTALL) -c $(INSTPGMFLAGS) xodo $(BINDIR)
- X $(INSTALL) -c $(INSTPGMFLAGS) xodomm.a $(BINDIR)
- X sed -e "s!/usr/local/bin!$(PERLDIR)!" evap/genmp.skl > evap/genmp
- X chmod 755 evap/genmp
- X @echo " "
- X @echo "******* Any errors from genmp can be safely ignored!"
- X -evap/genmp $(BINDIR)/xodo 1> /dev/null 2> /dev/null
- X @echo "******* Any errors from genmp can be safely ignored!"
- X @echo " "
- X $(INSTALL) -c $(INSTMANFLAGS) xodo.man $(MANDIR)/xodo.1
- X
- X PROGRAM = xodo
- X
- Xall:: xodo
- X
- Xxodo: $(OBJS) $(DEPLIBS)
- X $(RM) $@
- X $(CC) -o $@ $(OBJS) $(LDOPTIONS) $(LOCAL_LIBRARIES) $(LDLIBS) $(EXTRA_LOAD_FLAGS)
- X
- Xinstall:: xodo
- X @if [ -d $(DESTDIR)$(BINDIR) ]; then set +x; \
- X else (set -x; $(MKDIRHIER) $(DESTDIR)$(BINDIR)); fi
- X $(INSTALL) -c $(INSTPGMFLAGS) xodo $(DESTDIR)$(BINDIR)
- X
- Xinstall.man:: xodo.man
- X @if [ -d $(DESTDIR)$(MANDIR) ]; then set +x; \
- X else (set -x; $(MKDIRHIER) $(DESTDIR)$(MANDIR)); fi
- X $(INSTALL) -c $(INSTMANFLAGS) xodo.man $(DESTDIR)$(MANDIR)/xodo.$(MANSUFFIX)
- X
- Xdepend::
- X $(DEPEND) $(DEPENDFLAGS) -s "# DO NOT DELETE" -- $(ALLDEFINES) -- $(SRCS)
- X
- Xlint:
- X $(LINT) $(LINTFLAGS) $(SRCS) $(LINTLIBS)
- Xlint1:
- X $(LINT) $(LINTFLAGS) $(FILE) $(LINTLIBS)
- X
- Xclean::
- X $(RM) $(PROGRAM)
- X
- X# -------------------------------------------------------------------------
- X# common rules for all Makefiles - do not edit
- X
- Xemptyrule::
- X
- Xclean::
- X $(RM_CMD) "#"*
- X
- XMakefile::
- X -@if [ -f Makefile ]; then set -x; \
- X $(RM) Makefile.bak; $(MV) Makefile Makefile.bak; \
- X else exit 0; fi
- X $(IMAKE_CMD) -DTOPDIR=$(TOP) -DCURDIR=$(CURRENT_DIR)
- X
- Xtags::
- X $(TAGS) -w *.[ch]
- X $(TAGS) -xw *.[ch] > TAGS
- X
- X# -------------------------------------------------------------------------
- X# empty rules for directories that do not have SUBDIRS - do not edit
- X
- Xinstall::
- X @echo "install in $(CURRENT_DIR) done"
- X
- Xinstall.man::
- X @echo "install.man in $(CURRENT_DIR) done"
- X
- XMakefiles::
- X
- Xincludes::
- X
- X# -------------------------------------------------------------------------
- X# dependencies generated by makedepend
- X
- END_OF_FILE
- if test 12026 -ne `wc -c <'Makefile.AIX'`; then
- echo shar: \"'Makefile.AIX'\" unpacked with wrong size!
- fi
- # end of 'Makefile.AIX'
- fi
- if test -f 'evap/evap.c' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'evap/evap.c'\"
- else
- echo shar: Extracting \"'evap/evap.c'\" \(21851 characters\)
- sed "s/^X//" >'evap/evap.c' <<'END_OF_FILE'
- X#include <ctype.h>
- X#include <malloc.h>
- X#include <stdio.h>
- X#include <sys/types.h>
- X#include <pwd.h>
- X#include "evap.h"
- X
- XFILE *popen();
- X
- Xint evap_display_message_module();
- Xvoid evap_display_usage();
- Xvoid evap_display_which();
- Xvoid evap_type_conversion();
- Xvoid evap_type_verification();
- X
- X
- Xint
- Xevap(argc, argv, pdt, check_parameters_function, pvt)
- X int *argc;
- X char **argv[];
- X struct pdt_header pdt;
- X int *check_parameters_function;
- X Parameter_Value *pvt;
- X
- X/*
- X Step through the parameters, checking if they are valid, and if they
- X require a value that one is specified and that it is valid. Note that
- X it changes argv and argc to point to file names that appear AFTER all
- X the parameters. pvt is modified with the new parameter values.
- X Because argv[0], the program name, is no longer available after calling
- X evaluate_parameters, stuff it into pvt[P_HELP].unconverted_value.
- X
- X If a help message module is specified in the PDT header, then search the
- X message module archive file libevapmm.a for the help text and display it
- X if the -help switch is specified on the command line. If the message
- X module cannot be located then generate a short Usage: report.
- X
- X The check_parameters_function is currently unused and should be NULL.
- X
- X
- X Complete documentation can be found in the header file evap.h, including the
- X evaluate_parameters revision history.
- X
- X
- X Copyright (C) 1990 - 1993 by Lehigh University. All rights reserved.
- X
- X*/
- X{
- X
- X char *arg;
- X char *command;
- X char *default_variable;
- X short full_help;
- X short usage_help;
- X char *getenv();
- X int i, j, entry;
- X char *parameter_help[P_MAX_PARAMETER_HELP];
- X int parameter_help_count;
- X char *parameter_help_name;
- X
- X char *strtok();
- X
- X full_help = FALSE; /* assume standard -help (brief) help */
- X usage_help = FALSE; /* assume standard -help (brief) help */
- X
- X if (strncmp(pdt.version, "PDT Version", 11) != 0) {
- X printf("Error - evaluate_parameters has detected an illegal PDT.\n");
- X exit(1);
- X }
- X
- X if (check_parameters_function != NULL) {
- X printf("Informative - check_parameters_function is not supported.\n");
- X }
- X
- X command = *argv[0];
- X pvt[P_HELP].unconverted_value = command;
- X
- X while (*argc > 1 && (*argv)[1][0] == '-') {
- X (*argc)--;
- X arg = *++(*argv); /* get this parameter */
- X arg++; /* skip over the - */
- X if (*arg == '-') return( 0 ); /* allow -- to end command line parameters */
- X entry = -1;
- X if (strcmp(arg, "full_help") == 0) {
- X full_help = TRUE; /* flag special full help from disci */
- X pvt[P_HELP].specified = TRUE;
- X continue; /* while argc */
- X }
- X if (strcmp(arg, "usage_help") == 0) {
- X usage_help = TRUE; /* flag special usage help from disci */
- X pvt[P_HELP].specified = TRUE;
- X continue; /* while argc */
- X }
- X
- X for (i=0; (pvt[i].parameter) != NULL && entry == -1; i++)
- X if ( (strcmp(arg, pvt[i].parameter) == 0) && pvt[i].changeable)
- X entry = i; /* exact match on full form */
- X
- X for (i=0; (pvt[i].parameter) != NULL && entry == -1; i++)
- X if ( (strcmp(arg, pvt[i].alias) == 0) && pvt[i].changeable)
- X entry = i; /* exact match on alias */
- X
- X if (entry == -1) { /* no match so far, try a substring match */
- X for (i=0; (pvt[i].parameter) != NULL; i++)
- X if ( (strncmp(arg, pvt[i].parameter, strlen(arg)) == 0) &&
- X pvt[i].changeable) {
- X if (entry != -1) {
- X printf("Ambiguous parameter: -%s.\n", arg);
- X printf("Type %s -help for command line parameter information.\n",
- X pvt[P_HELP].unconverted_value);
- X exit(1);
- X }
- X entry = i; /* substring match on full form */
- X }
- X }
- X
- X if (entry == -1) {
- X printf("Invalid parameter: -%s.\n", arg);
- X printf("Type %s -help for command line parameter information.\n",
- X pvt[P_HELP].unconverted_value);
- X exit(1);
- X }
- X
- X pvt[entry].specified = TRUE; /* mark it as specified by the user */
- X if (pvt[entry].type != P_TYPE_SWITCH) { /* value for non-switch types */
- X if (*argc > 1) {
- X (*argc)--;
- X pvt[entry].unconverted_value = *++(*argv);
- X } else {
- X printf("Value required for parameter -%s.\n", arg);
- X printf("Type %s -help for command line parameter information.\n",
- X pvt[P_HELP].unconverted_value);
- X exit(1);
- X }
- X } /* ifend */
- X
- X evap_type_verification(&pvt[entry], pvt[P_HELP].unconverted_value);
- X
- X } /* while argc */
- X
- X if (pvt[P_HELP].specified) { /* display command information */
- X if (full_help) {
- X printf ("Command Source: ");
- X evap_display_which(command);
- X printf ("\nMessage Module Name: %s\n\n", pdt.help_module_name);
- X fflush(stdout); /* not sure why I NEED this! */
- X }
- X
- X if ( usage_help || (evap_display_message_module(pdt.help_module_name,
- X parameter_help, ¶meter_help_count) != 0) )
- X evap_display_usage(command, pdt, pvt);
- X
- X printf ("\nParameters:\n");
- X if ( ! full_help )
- X printf( "\n" );
- X for (i=0; (pvt[i].parameter != NULL); i++) {
- X /* changeable = -1 means valid but HIDDEN from -disci */
- X if (pvt[i].changeable == 1) { /*valid and advertisable*/
- X if ( full_help )
- X printf( "\n" );
- X if (strcmp(pvt[i].alias, "") != 0)
- X printf ("-%s, %s%s\n",pvt[i].parameter, pvt[i].alias,
- X pvt[i].description);
- X else
- X printf ("-%s%s\n",pvt[i].parameter, pvt[i].description);
- X
- X if ( full_help && (parameter_help_count >= 0) ) {
- X printf( "\n" );
- X if ( i == P_HELP ) {
- X printf(
- X "\tIndicates display brief help information, which includes\n" );
- X printf(
- X "\ta command description with examples, plus a synopsis of\n" );
- X printf(
- X "\tthe command line parameters. If you specify -full_help\n" );
- X printf(
- X "\trather than -help complete parameter help is displayed\n" );
- X printf(
- X "\tif it's available.\n" );
- X }
- X /*
- X Search parameter_help for this parameter's description.
- X Each entry is a list of new-line-separated lines - the
- X first line is the name of the parameter.
- X */
- X for ( j=0; j <= parameter_help_count; j++ ) {
- X parameter_help_name = strtok( parameter_help[j], "\n" );
- X if ( strcmp( pvt[i].parameter, parameter_help_name ) == 0 ) {
- X printf( "%s", parameter_help[j]+strlen(parameter_help_name)+1 );
- X } /* ifend */
- X } /* forend */
- X } /* ifend */
- X } /* ifend */
- X } /* forend */
- X if (strncmp(pdt.version, "PDT Version 1.0 ", 16) > 0) {
- X if (strcmp(pdt.file_list, "no_file_list") == 0)
- X ;
- X else if (strcmp(pdt.file_list, "required_file_list") == 0) {
- X printf("\n file(s) required by this command\n");
- X } else {
- X printf("\n [file(s)] optionally required by this command\n");
- X }
- X } /* ifend PDT version 1.1 or greater */
- X printf ("\n");
- X exit(0);
- X }
- X
- X /*
- X Now loop through the PDT looking for unspecified parameters.
- X
- X If there is a default environment variable specified and it is
- X defined then update the structure member unconverted_value.
- X
- X Then perform type verification.
- X */
- X if (strncmp(pdt.version, "PDT Version 1.1 ", 16) > 0) {
- X for (i = 0; pvt[i].parameter != NULL; i++) {
- X
- X if ( i == P_HELP ) continue; /* for */
- X if (! pvt[i].specified) {
- X if (pvt[i].default_variable != NULL) {
- X if ((default_variable = getenv(pvt[i].default_variable)) != NULL) {
- X pvt[i].unconverted_value = default_variable;
- X } /* ifend */
- X } /* ifend default variable */
- X evap_type_verification(&pvt[i], command);
- X } /* ifend parameter not specified */
- X
- X } /* forend */
- X } /* ifend PDT version 1.2 or greater */
- X
- X /*
- X Complain if there are any $required parameters. Perform type conversion.
- X */
- X for (i=0; (pvt[i].parameter != NULL); i++) {
- X if (strcmp("$required", pvt[i].unconverted_value) == 0) {
- X printf ("Parameter %s is required but was omitted.\n", pvt[i].parameter);
- X printf("Type %s -help for command line parameter information.\n",
- X pvt[P_HELP].unconverted_value);
- X exit(1);
- X }
- X evap_type_conversion(&pvt[i]);
- X } /* forend */
- X
- X if (strncmp(pdt.version, "PDT Version 1.0 ", 16) > 0) {
- X if ((strcmp(pdt.file_list, "no_file_list") == 0) &&
- X (*argc > 1)) {
- X printf("Trailing file name(s) not permitted.\n");
- X printf("Type %s -help for command line parameter information.\n",
- X pvt[P_HELP].unconverted_value);
- X exit(1);
- X }
- X if ((strcmp(pdt.file_list, "required_file_list") == 0) &&
- X (*argc == 1)) {
- X printf ("Trailing file name(s) required.\n");
- X printf("Type %s -help for command line parameter information.\n",
- X pvt[P_HELP].unconverted_value);
- X exit(1);
- X }
- X } /* ifend PDT version 1.1 or greater */
- X
- X return( 0 ); /* success */
- X
- X} /* end evaluate_parameters */
- X
- X
- X
- X
- Xvoid
- Xevap_type_verification(pvte, command_name)
- X Parameter_Value *pvte;
- X char *command_name;
- X
- X/*
- X Type-check/initialize the unconverted_value member (a C string).
- X Evaluate backticked items.
- X*/
- X{
- X
- X#define BACKMAX 1024
- X
- X char *backcomd;
- X int backcnt;
- X int backincr;
- X char *backline;
- X char *backptr;
- X FILE *backtick;
- X int i;
- X int valid;
- X char *value;
- X char home[6];
- X struct passwd *pwent;
- X char *home_ptr;
- X
- X if ( pvte->unconverted_value[0] == '`' &&
- X pvte->unconverted_value[strlen( pvte->unconverted_value ) - 1] == '`' ) {
- X backcomd = (char *)malloc( 10 + strlen( pvte->unconverted_value ) );
- X sprintf( backcomd, "echo %s", pvte->unconverted_value );
- X if ( (backtick = popen( backcomd, "r" )) != NULL ) {
- X backcnt = 1;
- X backline = (char *)malloc( BACKMAX * backcnt );
- X backptr = fgets( backline, BACKMAX, backtick );
- X pvte->unconverted_value = backline;
- X while ( backptr != NULL ) {
- X backline = (char *) realloc( backline, BACKMAX * ++backcnt );
- X pvte->unconverted_value = backline;
- X backincr = (BACKMAX * (backcnt - 1)) - (backcnt - 1);
- X backptr = fgets( backline+backincr, BACKMAX, backtick );
- X }
- X pvte->unconverted_value[strlen( pvte->unconverted_value ) - 1] = '\0';
- X pclose( backtick );
- X free( backcomd );
- X } /* ifend backtick evaluation */
- X } /* backticks */
- X
- X value = pvte->unconverted_value; /* get value from pvt entry */
- X switch (pvte->type) {
- X
- X case P_TYPE_SWITCH:
- X pvte->unconverted_value = "TRUE";
- X break;
- X
- X case P_TYPE_STRING:
- X break; /* anything OK */
- X
- X case P_TYPE_REAL:
- X if (FALSE) { /* no type enforcment (no U*X consistency either) */
- X printf("Expecting real reference, found \"%s\" for parameter -%s.\n",
- X pvte->unconverted_value, pvte->parameter);
- X printf("Type %s -help for command line parameter information.\n",
- X command_name);
- X exit(1);
- X }
- X break;
- X
- X case P_TYPE_INTEGER:
- X if((isdigit(*value)) || (value[0] == '+') || (value[0] == '-'))
- X value++;
- X else {
- X printf("Expecting integer reference, found \"%s\" for parameter -%s.\n",
- X pvte->unconverted_value, pvte->parameter);
- X printf("Type %s -help for command line parameter information.\n",
- X command_name);
- X exit(1);
- X }
- X for(; *value != '\0'; value++) {
- X if(! isdigit(*value)) {
- X printf(
- X "Expecting integer reference, found \"%s\" for parameter -%s.\n",
- X pvte->unconverted_value, pvte->parameter);
- X printf("Type %s -help for command line parameter information.\n",
- X command_name);
- X exit(1);
- X }
- X }
- X break;
- X
- X case P_TYPE_BOOLEAN:
- X if((strcmp(value, "TRUE") != 0) && (strcmp(value, "FALSE") != 0)) {
- X printf("Expecting boolean reference, found \"%s\" for parameter -%s.\n",
- X pvte->unconverted_value, pvte->parameter);
- X printf("Type %s -help for command line parameter information.\n",
- X command_name);
- X exit(1);
- X }
- X break;
- X
- X case P_TYPE_FILE:
- X home_ptr = NULL;
- X strncpy( home, value, 5); /* look for $HOME or ~ */
- X home[5] = '\0';
- X if ( strcmp( home, "$HOME" ) == 0)
- X home_ptr = value+5;
- X if ( *value == '~')
- X home_ptr = value+1;
- X if ( home_ptr != NULL ) { /* expand the shorthand */
- X if ( (pwent = getpwuid( getuid() )) != NULL ) {
- X pvte->unconverted_value = (char *)malloc( strlen( value ) +
- X strlen( pwent->pw_dir ) );
- X strcpy( pvte->unconverted_value, pwent->pw_dir );
- X strcat( pvte->unconverted_value, home_ptr );
- X value = pvte->unconverted_value;
- X } /* ifend pwent */
- X } /* ifend expand $HOME */
- X if (strlen(value) > 255) {
- X printf("Expecting file reference, found \"%s\" for parameter -%s.\n",
- X pvte->unconverted_value, pvte->parameter);
- X printf("Type %s -help for command line parameter information.\n",
- X command_name);
- X exit(1);
- X }
- X break;
- X
- X case P_TYPE_KEY:
- X if (pvte->valid_values[0]) {
- X
- X for(valid=FALSE, i=0; pvte->valid_values[i] && ! valid; i++)
- X if (strcmp(value, pvte->valid_values[i]) == 0)
- X valid = TRUE; /* ok, got one */
- X
- X if (! valid) /* no exact match, try a substring match */
- X for(valid=FALSE, i=0; pvte->valid_values[i]; i++)
- X if (strncmp(value, pvte->valid_values[i], strlen(value)) == 0) {
- X if (valid) {
- X printf("Ambiguous keyword for parameter -%s: %s.\n",
- X pvte->parameter, value);
- X printf("Type %s -help for command line parameter information.\n",
- X command_name);
- X exit(1);
- X }
- X valid = TRUE; /* ok, got one */
- X pvte->unconverted_value = pvte->valid_values[i];
- X } /* ifend update value in pvt */
- X
- X if (! valid) { /* no matches */
- X printf("\"%s\" is not a valid value for the parameter -%s.\n",
- X pvte->unconverted_value, pvte->parameter);
- X printf("Type %s -help for command line parameter information.\n",
- X command_name);
- X exit(1);
- X }
- X }
- X break;
- X
- X case P_TYPE_APPLICATION:
- X break; /* anything is valid in this case */
- X
- X case P_TYPE_NAME:
- X for ( ; *value != '\0'; value++ ) {
- X if ( *value == ' ' || *value == '\n' || *value == '\t' ) {
- X printf("Expecting name reference, found \"%s\" for parameter -%s.\n",
- X pvte->unconverted_value, pvte->parameter);
- X printf("Type %s -help for command line parameter information.\n",
- X command_name);
- X exit(1);
- X }
- X }
- X break;
- X
- X default:
- X printf("Error in evap_type_verification (default), please get help!\n");
- X exit(1);
- X break;
- X }
- X
- X return;
- X
- X} /* end evap_type_verification */
- X
- X
- X
- X
- Xvoid
- Xevap_type_conversion(pvte)
- X Parameter_Value *pvte;
- X
- X/*
- X Convert all the unconverted values, which are C strings, in a type-dependent
- X manner, and store the result in the value variant record (union).
- X*/
- X{
- X
- X char *value;
- X
- X value = pvte->unconverted_value; /* get value from pvt entry */
- X switch (pvte->type) {
- X
- X case P_TYPE_SWITCH:
- X if (strcmp(value, "TRUE") == 0)
- X pvte->value.switch_value = TRUE;
- X else
- X pvte->value.switch_value = FALSE;
- X break;
- X
- X case P_TYPE_STRING:
- X pvte->value.string_value = value;
- X break;
- X
- X case P_TYPE_REAL:
- X sscanf(value, "%lg", &pvte->value.real_value);
- X break;
- X
- X case P_TYPE_INTEGER:
- X sscanf(value, "%d", &pvte->value.integer_value);
- X break;
- X
- X case P_TYPE_BOOLEAN:
- X if (strcmp(value, "TRUE") == 0)
- X pvte->value.boolean_value = TRUE;
- X else
- X pvte->value.boolean_value = FALSE;
- X break;
- X
- X case P_TYPE_FILE:
- X pvte->value.file_value = value;
- X break;
- X
- X case P_TYPE_KEY:
- X pvte->value.key_value = value;
- X break;
- X
- X case P_TYPE_APPLICATION:
- X pvte->value.application_value = value;
- X break;
- X
- X case P_TYPE_NAME:
- X pvte->value.name_value = value;
- X break;
- X
- X default:
- X printf("Error in evap_type_conversion (default), please get help!\n");
- X exit(1);
- X break;
- X }
- X
- X return;
- X
- X} /* end evap_type_conversion */
- X
- X
- X
- Xint
- Xevap_display_message_module(message_module_name, parameter_help,
- X parameter_help_count)
- X char *message_module_name;
- X char *parameter_help[];
- X int *parameter_help_count;
- X
- X/*
- X Search an evaluate_parameters message module file for the specified help
- X module and, if found, display it.
- X
- X The message_module_name parameter is either a simple message module name or
- X a message module name prefixed with the path name of a local message module
- X archive file. For example:
- X
- X disci.mm names a message module disci.mm in file libevapmm.a
- X my_mm/my_program.mm names a message module my_progam.mm in file my_mm
- X*/
- X{
- X
- X FILE* a; /* stream to read ar output from */
- X char afn[256]; /* evap ar message module path name */
- X char ar_str[512]; /* ar p libevapmm.a mm */
- X char* cp; /* character pointer */
- X short parameter_help_in_progress;
- X
- X extern char *strrchr(); /* string.h vs. strings.h hassles!!!! */
- X /* freakin' U*X inconsistencies... */
- X
- X if (message_module_name == NULL)
- X return( 1 ); /* if no message module specified */
- X
- X cp = strrchr(message_module_name, '/'); /* check for local archive path */
- X if (cp == NULL) { /* simple message module name */
- X strcpy(afn, P_EVAP_MM_PATH); /* use default ar file name */
- X } else { /* private message module ar file */
- X *cp = '\0'; /* separate file path name and message module name */
- X strcpy(afn, message_module_name);
- X strcpy(message_module_name, cp+1);
- X } /* ifend simple message module */
- X
- X sprintf(ar_str, "ar p %s %s 2> /dev/null", afn,
- X message_module_name);
- X
- X *parameter_help_count = -1; /* no parameters have help so far */
- X parameter_help_in_progress = FALSE; /* not collecting parameter help */
- X
- X if ( (a = popen( ar_str, "r" )) == NULL )
- X return( 1 ); /* do usage */
- X
- X if ( fgets( ar_str, 512, a ) == NULL )
- X return( 1 ); /* do usage */
- X
- X do { /* copy message module until EOF */
- X if ( ar_str[0] == '.' ) { /* or until start of parameter help */
- X parameter_help_in_progress = TRUE;
- X /*
- X Create an array of parameter help: the first line is the parameter
- X name and successive lines are the associated help text.
- X */
- X (*parameter_help_count)++;
- X parameter_help[*parameter_help_count] =
- X (char *)malloc( P_MAX_PARAMETER_HELP_LENGTH );
- X strcpy( parameter_help[*parameter_help_count], ar_str+1 );
- X continue; /* do */
- X } /* ifend start of parameter help */
- X if ( parameter_help_in_progress ) {
- X if ( strlen( parameter_help[*parameter_help_count] ) + strlen( ar_str )
- X < P_MAX_PARAMETER_HELP_LENGTH ) {
- X strcat( parameter_help[*parameter_help_count], ar_str );
- X } else {
- X sprintf( ar_str,
- X "\n*** Parameter Help Text Exceeds %d Characters ***\n",
- X P_MAX_PARAMETER_HELP_LENGTH );
- X strcpy( parameter_help[*parameter_help_count] +
- X P_MAX_PARAMETER_HELP_LENGTH - strlen( ar_str ) - 1,
- X ar_str );
- X }
- X } else {
- X printf( "%s", ar_str );
- X }
- X } while (fgets( ar_str, 512, a) != NULL); /* doend */
- X pclose( a );
- X
- X return( 0 ); /* success */
- X
- X} /* end evap_display_message_module */
- X
- X
- X
- X
- X
- Xvoid
- Xevap_display_usage(command, pdt, pvt)
- X char *command;
- X struct pdt_header pdt;
- X Parameter_Value pvt[];
- X
- X/*
- X Generate a 'standard' usage display in lieu of a help message module.
- X*/
- X{
- X
- X int i;
- X int optional_param_count;
- X
- X optional_param_count = 0;
- X printf("\nUsage: %s", command);
- X
- X for(i=0; pvt[i].parameter != NULL; i++) {
- X if (pvt[i].changeable == 1) { /* valid and advertisable */
- X optional_param_count++;
- X if (strcmp(pvt[i].unconverted_value, "$required") == 0) {
- X optional_param_count--;
- X if (strcmp(pvt[i].alias, "") != 0)
- X printf(" -%s", pvt[i].alias);
- X else
- X printf(" -%s", pvt[i].parameter);
- X } /* ifend */
- X } /* ifend */
- X } /* forend */
- X
- X if (optional_param_count > 0) {
- X printf(" [");
- X for(i=0; pvt[i].parameter != NULL; i++) {
- X if (pvt[i].changeable == 1) { /* if advertisable */
- X if (strcmp(pvt[i].unconverted_value, "$required") != 0) {
- X if (strcmp(pvt[i].alias, "") != 0)
- X printf(" -%s", pvt[i].alias);
- X else
- X printf(" -%s", pvt[i].parameter);
- X } /* ifend */
- X } /* ifend */
- X } /* forend */
- X printf("]");
- X } /* ifend */
- X
- X if (strncmp(pdt.version, "PDT Version 1.0 ", 16) > 0) {
- X if (strcmp(pdt.file_list, "required_file_list") == 0)
- X printf(" file(s)\n");
- X else if (strcmp(pdt.file_list, "optional_file_list") == 0)
- X printf(" [file(s)]\n");
- X else
- X printf("\n");
- X } /* ifend PDT version 1.1 or greater */
- X else
- X printf("\n");
- X
- X return;
- X
- X} /* end evap_display_usage */
- X
- X
- X
- X
- Xvoid
- Xevap_display_which(command)
- X char *command;
- X
- X/*
- X Perform a fast 'which' function to show the source of this command.
- X (Copied from which.c on UUNET.UU.NET, but with a few bug fixes.)
- X*/
- X{
- X
- X char *getenv(), *path = getenv("PATH");
- X char test[1000], *pc, save;
- X int len, found;
- X
- X extern char *strrchr(); /* string.h vs. strings.h hassles! */
- X char name[256]; /* name exclusive of path */
- X char *cp; /* character pointer */
- X
- X cp = strrchr(command, '/'); /* look for path separator */
- X if (cp == NULL)
- X strcpy(name, command); /* if a simple file name */
- X else {
- X printf("%s\n", command); /* must be an explicit path */
- X return;
- X }
- X
- X pc = path;
- X found = 0;
- X
- X while (*pc != '\0' && found == 0) {
- X len = 0;
- X
- X while (*pc != ':' && *pc != '\0') {
- X len++;
- X pc++;
- X } /* whilend */
- X
- X save = *pc;
- X *pc = '\0';
- X sprintf(test, "%s/%s", pc-len, name);
- X *pc = save;
- X if (*pc)
- X pc++;
- X
- X found = (0 == access(test, 01)); /* executable */
- X if (found)
- X puts(test);
- X
- X } /* whilend */
- X
- X return;
- X
- X} /* end evap_display_which */
- END_OF_FILE
- if test 21851 -ne `wc -c <'evap/evap.c'`; then
- echo shar: \"'evap/evap.c'\" unpacked with wrong size!
- fi
- # end of 'evap/evap.c'
- fi
- echo shar: End of archive 2 \(of 4\).
- cp /dev/null ark2isdone
- MISSING=""
- for I in 1 2 3 4 ; do
- if test ! -f ark${I}isdone ; then
- MISSING="${MISSING} ${I}"
- fi
- done
- if test "${MISSING}" = "" ; then
- echo You have unpacked all 4 archives.
- echo "Read README for installation instructions."
- 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
-
- exit 0 # Just in case...
- --
- // chris@IMD.Sterling.COM | Send comp.sources.x submissions to:
- \X/ Amiga - The only way to fly! |
- "It's intuitively obvious to the most | sources-x@imd.sterling.com
- casual observer..." |
-