home *** CD-ROM | disk | FTP | other *** search
/ Source Code 1994 March / Source_Code_CD-ROM_Walnut_Creek_March_1994.iso / compsrcs / x / volume19 / xodometr / part02 < prev    next >
Encoding:
Text File  |  1993-04-27  |  49.1 KB  |  1,622 lines

  1. Newsgroups: comp.sources.x
  2. From: lusol@Turkey.CC.Lehigh.EDU (Stephen O. Lidie)
  3. Subject: v19i038:  xodometer - Track pointer and measure distance moved, Part02/04
  4. Message-ID: <1993Mar11.161603.17249@sparky.imd.sterling.com>
  5. X-Md4-Signature: 314177200a9bacf7d26a07dd596a7ff2
  6. Date: Thu, 11 Mar 1993 16:16:03 GMT
  7. Approved: chris@sparky.imd.sterling.com
  8.  
  9. Submitted-by: lusol@Turkey.CC.Lehigh.EDU (Stephen O. Lidie)
  10. Posting-number: Volume 19, Issue 38
  11. Archive-name: xodometer/part02
  12. Environment: X11
  13.  
  14.  
  15. #! /bin/sh
  16. # This is a shell archive.  Remove anything before this line, then unpack
  17. # it by saving it into a file and typing "sh file".  To overwrite existing
  18. # files, type "sh file -c".  You can also feed this as standard input via
  19. # unshar, or by typing "sh <file", e.g..  If this archive is complete, you
  20. # will see the following message at the end:
  21. #        "End of archive 2 (of 4)."
  22. # Contents:  Makefile Makefile.AIX evap/evap.c
  23. # Wrapped by lusol@Turkey.CC.Lehigh.EDU on Wed Mar 10 19:42:12 1993
  24. PATH=/bin:/usr/bin:/usr/ucb ; export PATH
  25. if test -f 'Makefile' -a "${1}" != "-c" ; then 
  26.   echo shar: Will not clobber existing file \"'Makefile'\"
  27. else
  28. echo shar: Extracting \"'Makefile'\" \(12026 characters\)
  29. sed "s/^X//" >'Makefile' <<'END_OF_FILE'
  30. X# Makefile generated by imake - do not edit!
  31. X# $XConsortium: imake.c,v 1.65 91/07/25 17:50:17 rws Exp $
  32. X#
  33. X# The cpp used on this machine replaces all newlines and multiple tabs and
  34. X# spaces in a macro expansion with a single space.  Imake tries to compensate
  35. X# for this, but is not always successful.
  36. X#
  37. X
  38. X# -------------------------------------------------------------------------
  39. X# Makefile generated from "Imake.tmpl" and </tmp/IIf.Rq8Crx>
  40. X# $XConsortium: Imake.tmpl,v 1.139 91/09/16 08:52:48 rws Exp $
  41. X#
  42. X# Platform-specific parameters may be set in the appropriate <vendor>.cf
  43. X# configuration files.  Site-specific parameters should be set in the file
  44. X# site.def.  Full rebuilds are recommended if any parameters are changed.
  45. X#
  46. X# If your C preprocessor does not define any unique symbols, you will need
  47. X# to set BOOTSTRAPCFLAGS when rebuilding imake (usually when doing
  48. X# "make World" the first time).
  49. X#
  50. X
  51. X# -------------------------------------------------------------------------
  52. X# site-specific configuration parameters that need to come before
  53. X# the platform-specific parameters - edit site.def to change
  54. X
  55. X# site:  $XConsortium: site.def,v 1.2 91/07/30 20:26:44 rws Exp $
  56. X
  57. X# -------------------------------------------------------------------------
  58. X# platform-specific configuration parameters - edit ibm.cf to change
  59. X
  60. X# platform:  $XConsortium: ibm.cf,v 1.29 91/07/28 22:39:58 rws Exp $
  61. X
  62. X# operating system:  AIX 3.2.3
  63. X
  64. X# $XConsortium: ibmLib.rules,v 1.5 91/05/10 09:27:27 jap Exp $
  65. X
  66. X# -------------------------------------------------------------------------
  67. X# site-specific configuration parameters that go after
  68. X# the platform-specific parameters - edit site.def to change
  69. X
  70. X# site:  $XConsortium: site.def,v 1.2 91/07/30 20:26:44 rws Exp $
  71. X
  72. X            SHELL = /bin/sh
  73. X
  74. X              TOP = .
  75. X      CURRENT_DIR = .
  76. X
  77. X               AR = ar clq
  78. X  BOOTSTRAPCFLAGS =
  79. X               CC = cc
  80. X               AS = as
  81. X
  82. X         COMPRESS = compress
  83. X              CPP = /usr/lpp/X11/Xamples/util/cpp/cpp $(STD_CPP_DEFINES)
  84. X    PREPROCESSCMD = cc -E $(STD_CPP_DEFINES)
  85. X          INSTALL = /usr/ucb/install
  86. X               LD = ld
  87. X             LINT = lint
  88. X      LINTLIBFLAG = -o
  89. X         LINTOPTS = -ax
  90. X               LN = ln -s
  91. X             MAKE = make
  92. X               MV = mv
  93. X               CP = cp
  94. X
  95. X               RM = rm -f
  96. X            TROFF = psroff
  97. X         MSMACROS = -ms
  98. X              TBL = tbl
  99. X              EQN = eqn
  100. X     STD_INCLUDES =
  101. X  STD_CPP_DEFINES = -DSYSV -DAIXV3 -D_BSD -D_BSD_INCLUDES
  102. X      STD_DEFINES = -DSYSV -DAIXV3 -D_BSD -D_BSD_INCLUDES
  103. X EXTRA_LOAD_FLAGS = -bnodelcsect
  104. X  EXTRA_LIBRARIES =
  105. X             TAGS = ctags
  106. X
  107. X           MFLAGS = -$(MAKEFLAGS)
  108. X
  109. X    SHAREDCODEDEF = -DSHAREDCODE
  110. X         SHLIBDEF = -DAIXSHLIB
  111. X
  112. X    PROTO_DEFINES =
  113. X
  114. X     INSTPGMFLAGS =
  115. X
  116. X     INSTBINFLAGS = -m 0755
  117. X     INSTUIDFLAGS = -m 4755
  118. X     INSTLIBFLAGS = -m 0644
  119. X     INSTINCFLAGS = -m 0444
  120. X     INSTMANFLAGS = -m 0444
  121. X     INSTDATFLAGS = -m 0444
  122. X    INSTKMEMFLAGS = -m 4755
  123. X
  124. X      PROJECTROOT = /usr/local/X11R5
  125. X
  126. X     TOP_INCLUDES = -I$(INCROOT)
  127. X
  128. X      CDEBUGFLAGS = -O
  129. X        CCOPTIONS =
  130. X
  131. X      ALLINCLUDES = $(INCLUDES) $(EXTRA_INCLUDES) $(TOP_INCLUDES) $(STD_INCLUDES)
  132. X       ALLDEFINES = $(ALLINCLUDES) $(STD_DEFINES) $(EXTRA_DEFINES) $(PROTO_DEFINES) $(DEFINES)
  133. X           CFLAGS = $(CDEBUGFLAGS) $(CCOPTIONS) $(ALLDEFINES)
  134. X        LINTFLAGS = $(LINTOPTS) -DLINT $(ALLDEFINES)
  135. X
  136. X           LDLIBS = $(SYS_LIBRARIES) $(EXTRA_LIBRARIES)
  137. X
  138. X        LDOPTIONS = $(CDEBUGFLAGS) $(CCOPTIONS) $(LOCAL_LDFLAGS) -L$(USRLIBDIR)
  139. X
  140. X   LDCOMBINEFLAGS = -r
  141. X      DEPENDFLAGS =
  142. X
  143. X        MACROFILE = ibm.cf
  144. X           RM_CMD = $(RM) *.CKP *.ln *.BAK *.bak *.o core errs ,* *~ *.a .emacs_* tags TAGS make.log MakeOut
  145. X
  146. X    IMAKE_DEFINES =
  147. X
  148. X         IRULESRC = $(CONFIGDIR)
  149. X        IMAKE_CMD = $(IMAKE) -DUseInstalled -I$(IRULESRC) $(IMAKE_DEFINES)
  150. X
  151. X     ICONFIGFILES = $(IRULESRC)/Imake.tmpl $(IRULESRC)/Imake.rules \
  152. X            $(IRULESRC)/Project.tmpl $(IRULESRC)/site.def \
  153. X            $(IRULESRC)/$(MACROFILE) $(EXTRA_ICONFIGFILES)
  154. X
  155. X# -------------------------------------------------------------------------
  156. X# X Window System Build Parameters
  157. X# $XConsortium: Project.tmpl,v 1.138 91/09/10 09:02:12 rws Exp $
  158. X
  159. X# -------------------------------------------------------------------------
  160. X# X Window System make variables; this need to be coordinated with rules
  161. X
  162. X          PATHSEP = /
  163. X        USRLIBDIR = /usr/local/X11R5/lib
  164. X           BINDIR = /usr/local/X11R5/bin
  165. X          INCROOT = /usr/local/X11R5/include
  166. X     BUILDINCROOT = $(TOP)
  167. X      BUILDINCDIR = $(BUILDINCROOT)/X11
  168. X      BUILDINCTOP = ..
  169. X           INCDIR = $(INCROOT)/X11
  170. X           ADMDIR = /usr/adm
  171. X           LIBDIR = $(USRLIBDIR)/X11
  172. X        CONFIGDIR = $(LIBDIR)/config
  173. X       LINTLIBDIR = $(USRLIBDIR)/lint
  174. X
  175. X          FONTDIR = $(LIBDIR)/fonts
  176. X         XINITDIR = $(LIBDIR)/xinit
  177. X           XDMDIR = $(LIBDIR)/xdm
  178. X           TWMDIR = $(LIBDIR)/twm
  179. X          MANPATH = /usr/local/X11R5/man
  180. X    MANSOURCEPATH = $(MANPATH)/man
  181. X        MANSUFFIX = n
  182. X     LIBMANSUFFIX = 3
  183. X           MANDIR = $(MANSOURCEPATH)$(MANSUFFIX)
  184. X        LIBMANDIR = $(MANSOURCEPATH)$(LIBMANSUFFIX)
  185. X           NLSDIR = $(LIBDIR)/nls
  186. X        PEXAPIDIR = $(LIBDIR)/PEX
  187. X      XAPPLOADDIR = $(LIBDIR)/app-defaults
  188. X       FONTCFLAGS = -t
  189. X
  190. X     INSTAPPFLAGS = $(INSTDATFLAGS)
  191. X
  192. X            IMAKE = imake
  193. X           DEPEND = makedepend
  194. X              RGB = rgb
  195. X
  196. X            FONTC = bdftopcf
  197. X
  198. X        MKFONTDIR = mkfontdir
  199. X        MKDIRHIER = /bin/sh $(BINDIR)/mkdirhier
  200. X
  201. X        CONFIGSRC = $(TOP)/config
  202. X       DOCUTILSRC = $(TOP)/doc/util
  203. X        CLIENTSRC = $(TOP)/clients
  204. X          DEMOSRC = $(TOP)/demos
  205. X           LIBSRC = $(TOP)/lib
  206. X          FONTSRC = $(TOP)/fonts
  207. X       INCLUDESRC = $(TOP)/X11
  208. X        SERVERSRC = $(TOP)/server
  209. X          UTILSRC = $(TOP)/util
  210. X        SCRIPTSRC = $(UTILSRC)/scripts
  211. X       EXAMPLESRC = $(TOP)/examples
  212. X       CONTRIBSRC = $(TOP)/../contrib
  213. X           DOCSRC = $(TOP)/doc
  214. X           RGBSRC = $(TOP)/rgb
  215. X        DEPENDSRC = $(UTILSRC)/makedepend
  216. X         IMAKESRC = $(CONFIGSRC)
  217. X         XAUTHSRC = $(LIBSRC)/Xau
  218. X          XLIBSRC = $(LIBSRC)/X
  219. X           XMUSRC = $(LIBSRC)/Xmu
  220. X       TOOLKITSRC = $(LIBSRC)/Xt
  221. X       AWIDGETSRC = $(LIBSRC)/Xaw
  222. X       OLDXLIBSRC = $(LIBSRC)/oldX
  223. X      XDMCPLIBSRC = $(LIBSRC)/Xdmcp
  224. X      BDFTOSNFSRC = $(FONTSRC)/bdftosnf
  225. X      BDFTOSNFSRC = $(FONTSRC)/clients/bdftosnf
  226. X      BDFTOPCFSRC = $(FONTSRC)/clients/bdftopcf
  227. X     MKFONTDIRSRC = $(FONTSRC)/clients/mkfontdir
  228. X         FSLIBSRC = $(FONTSRC)/lib/fs
  229. X    FONTSERVERSRC = $(FONTSRC)/server
  230. X     EXTENSIONSRC = $(TOP)/extensions
  231. X         XILIBSRC = $(EXTENSIONSRC)/lib/xinput
  232. X      PHIGSLIBSRC = $(EXTENSIONSRC)/lib/PEX
  233. X
  234. X# $XConsortium: ibmLib.tmpl,v 1.2 91/05/04 11:49:00 rws Exp $
  235. X
  236. XPICFLAGS = -bM\:SRE
  237. X
  238. X  DEPEXTENSIONLIB =
  239. X     EXTENSIONLIB = -lXext
  240. X
  241. X          DEPXLIB = $(DEPEXTENSIONLIB)
  242. X             XLIB = $(EXTENSIONLIB) -lX11
  243. X
  244. X        DEPXMULIB =
  245. X           XMULIB = -lXmu
  246. X
  247. X       DEPOLDXLIB =
  248. X          OLDXLIB = -loldX
  249. X
  250. X      DEPXTOOLLIB = $(USRLIBDIR)/libXt.a
  251. X         XTOOLLIB = -lXt
  252. X
  253. X        DEPXAWLIB =
  254. X           XAWLIB = -lXaw
  255. X
  256. X        DEPXILIB =
  257. X           XILIB = -lXi
  258. X
  259. X        SOXLIBREV = SharedXlibRev
  260. X          SOXTREV = SharedXtRev
  261. X         SOXAWREV = SharedXawRev
  262. X        SOOLDXREV = SharedOldXRev
  263. X         SOXMUREV = SharedXmuRev
  264. X        SOXEXTREV = SharedXextRev
  265. X      SOXINPUTREV = SharedXinputRev
  266. X
  267. X      DEPXAUTHLIB = $(USRLIBDIR)/libXau.a
  268. X         XAUTHLIB =  -lXau
  269. X      DEPXDMCPLIB = $(USRLIBDIR)/libXdmcp.a
  270. X         XDMCPLIB =  -lXdmcp
  271. X
  272. X        DEPPHIGSLIB = $(USRLIBDIR)/libphigs.a
  273. X           PHIGSLIB =  -lphigs
  274. X
  275. X       DEPXBSDLIB = $(USRLIBDIR)/libXbsd.a
  276. X          XBSDLIB =  -lXbsd
  277. X
  278. X LINTEXTENSIONLIB = $(LINTLIBDIR)/llib-lXext.ln
  279. X         LINTXLIB = $(LINTLIBDIR)/llib-lX11.ln
  280. X          LINTXMU = $(LINTLIBDIR)/llib-lXmu.ln
  281. X        LINTXTOOL = $(LINTLIBDIR)/llib-lXt.ln
  282. X          LINTXAW = $(LINTLIBDIR)/llib-lXaw.ln
  283. X           LINTXI = $(LINTLIBDIR)/llib-lXi.ln
  284. X        LINTPHIGS = $(LINTLIBDIR)/llib-lphigs.ln
  285. X
  286. X          DEPLIBS = $(DEPXAWLIB) $(DEPXMULIB) $(DEPXTOOLLIB) $(DEPXLIB)
  287. X
  288. X         DEPLIBS1 = $(DEPLIBS)
  289. X         DEPLIBS2 = $(DEPLIBS)
  290. X         DEPLIBS3 = $(DEPLIBS)
  291. X
  292. X# -------------------------------------------------------------------------
  293. X# Imake rules for building libraries, programs, scripts, and data files
  294. X# rules:  $XConsortium: Imake.rules,v 1.123 91/09/16 20:12:16 rws Exp $
  295. X
  296. X# -------------------------------------------------------------------------
  297. X# start of Imakefile
  298. X
  299. X#
  300. X# Imakefile for xodometer.
  301. X#
  302. X# Stephen O. Lidie, Lehigh University Computing Center, 93/02/11.
  303. X#
  304. X# lusol@Lehigh.EDU
  305. X#
  306. X# Prior to running xmkmf inspect/change the following variables:
  307. X#
  308. X#    BINDIR        binary directoy
  309. X#    MANDIR        man page directory
  310. X#    RANLIB        what is ranlib (sorry, not defined in AIX)
  311. X#    PERLDIR        path name of Perl (it's OK if you don't have Perl!)
  312. X#    CDEBUGFLAGS    cc compiler options
  313. X#    MATHLIB        name of math library
  314. X#    LOCAL_LIBRARIES    which libraries
  315. X#
  316. X# Then:  xmkmf; make; make install
  317. X#
  318. X
  319. X#
  320. X# Where you want things installed.
  321. X#
  322. XBINDIR          = /usr/local/bin
  323. XMANDIR          = /usr/local/man/man1
  324. X
  325. X#
  326. X# Whether or not you have/need ranlib.
  327. X#
  328. XRANLIB        = ranlib    # have or need ranlib
  329. X#RANLIB         = /bin/true    # do not have or need ranlib
  330. X
  331. X#
  332. X# Where to get Perl.  It's OK if you don't have Perl, but expect an error
  333. X# from the program genmp during a 'make install' - the error can be safely
  334. X# ignored.  I use genmp (generate_man_page) so that the xodometer man page
  335. X# is always up-to-date, but the one that you have received in this
  336. X# distribution is by definition the latest and greatest.
  337. X#
  338. XPERLDIR         = /usr/local/bin
  339. X
  340. XCDEBUGFLAGS     = -O
  341. XMATHLIB         = -lm
  342. XLOCAL_LIBRARIES = $(XLIB) $(MATHLIB)
  343. X
  344. XSRCS        = xodo.c evap/evap.c
  345. XOBJS        = xodo.o evap/evap.o
  346. X
  347. Xall::    xodo_a xodo
  348. X
  349. Xclean::
  350. X    rm xodo xodo.o xodomm.a evap/evap.o
  351. X
  352. Xevap/evap.o:    evap/evap.c evap/evap.h
  353. X    (cd evap; $(CC) $(CDEBUGFLAGS) -DP_EVAP_MM_PATH=\"$(BINDIR)\" -c evap.c)
  354. X
  355. Xxodo_a:
  356. X    ar rcv xodomm.a evap\/xodo.mm
  357. X    $(RANLIB) xodomm.a
  358. X    sed -e "s!/usr/local/bin!$(BINDIR)!g" evap/xodo_pdt.skl > evap/xodo_pdt.out
  359. X
  360. Xinstall::
  361. X    $(INSTALL) -c $(INSTPGMFLAGS) xodo     $(BINDIR)
  362. X    $(INSTALL) -c $(INSTPGMFLAGS) xodomm.a $(BINDIR)
  363. X    sed -e "s!/usr/local/bin!$(PERLDIR)!" evap/genmp.skl > evap/genmp
  364. X    chmod 755 evap/genmp
  365. X    @echo " "
  366. X    @echo "******* Any errors from genmp can be safely ignored!"
  367. X    -evap/genmp $(BINDIR)/xodo 1> /dev/null 2> /dev/null
  368. X    @echo "******* Any errors from genmp can be safely ignored!"
  369. X    @echo " "
  370. X    $(INSTALL) -c $(INSTMANFLAGS) xodo.man $(MANDIR)/xodo.1
  371. X
  372. X PROGRAM = xodo
  373. X
  374. Xall:: xodo
  375. X
  376. Xxodo: $(OBJS) $(DEPLIBS)
  377. X    $(RM) $@
  378. X    $(CC) -o $@ $(OBJS) $(LDOPTIONS) $(LOCAL_LIBRARIES) $(LDLIBS) $(EXTRA_LOAD_FLAGS)
  379. X
  380. Xinstall:: xodo
  381. X    @if [ -d $(DESTDIR)$(BINDIR) ]; then set +x; \
  382. X    else (set -x; $(MKDIRHIER) $(DESTDIR)$(BINDIR)); fi
  383. X    $(INSTALL) -c $(INSTPGMFLAGS)  xodo $(DESTDIR)$(BINDIR)
  384. X
  385. Xinstall.man:: xodo.man
  386. X    @if [ -d $(DESTDIR)$(MANDIR) ]; then set +x; \
  387. X    else (set -x; $(MKDIRHIER) $(DESTDIR)$(MANDIR)); fi
  388. X    $(INSTALL) -c $(INSTMANFLAGS) xodo.man $(DESTDIR)$(MANDIR)/xodo.$(MANSUFFIX)
  389. X
  390. Xdepend::
  391. X    $(DEPEND) $(DEPENDFLAGS) -s "# DO NOT DELETE" -- $(ALLDEFINES) -- $(SRCS)
  392. X
  393. Xlint:
  394. X    $(LINT) $(LINTFLAGS) $(SRCS) $(LINTLIBS)
  395. Xlint1:
  396. X    $(LINT) $(LINTFLAGS) $(FILE) $(LINTLIBS)
  397. X
  398. Xclean::
  399. X    $(RM) $(PROGRAM)
  400. X
  401. X# -------------------------------------------------------------------------
  402. X# common rules for all Makefiles - do not edit
  403. X
  404. Xemptyrule::
  405. X
  406. Xclean::
  407. X    $(RM_CMD) "#"*
  408. X
  409. XMakefile::
  410. X    -@if [ -f Makefile ]; then set -x; \
  411. X    $(RM) Makefile.bak; $(MV) Makefile Makefile.bak; \
  412. X    else exit 0; fi
  413. X    $(IMAKE_CMD) -DTOPDIR=$(TOP) -DCURDIR=$(CURRENT_DIR)
  414. X
  415. Xtags::
  416. X    $(TAGS) -w *.[ch]
  417. X    $(TAGS) -xw *.[ch] > TAGS
  418. X
  419. X# -------------------------------------------------------------------------
  420. X# empty rules for directories that do not have SUBDIRS - do not edit
  421. X
  422. Xinstall::
  423. X    @echo "install in $(CURRENT_DIR) done"
  424. X
  425. Xinstall.man::
  426. X    @echo "install.man in $(CURRENT_DIR) done"
  427. X
  428. XMakefiles::
  429. X
  430. Xincludes::
  431. X
  432. X# -------------------------------------------------------------------------
  433. X# dependencies generated by makedepend
  434. X
  435. END_OF_FILE
  436. if test 12026 -ne `wc -c <'Makefile'`; then
  437.     echo shar: \"'Makefile'\" unpacked with wrong size!
  438. fi
  439. # end of 'Makefile'
  440. fi
  441. if test -f 'Makefile.AIX' -a "${1}" != "-c" ; then 
  442.   echo shar: Will not clobber existing file \"'Makefile.AIX'\"
  443. else
  444. echo shar: Extracting \"'Makefile.AIX'\" \(12026 characters\)
  445. sed "s/^X//" >'Makefile.AIX' <<'END_OF_FILE'
  446. X# Makefile generated by imake - do not edit!
  447. X# $XConsortium: imake.c,v 1.65 91/07/25 17:50:17 rws Exp $
  448. X#
  449. X# The cpp used on this machine replaces all newlines and multiple tabs and
  450. X# spaces in a macro expansion with a single space.  Imake tries to compensate
  451. X# for this, but is not always successful.
  452. X#
  453. X
  454. X# -------------------------------------------------------------------------
  455. X# Makefile generated from "Imake.tmpl" and </tmp/IIf.Rh0CzR>
  456. X# $XConsortium: Imake.tmpl,v 1.139 91/09/16 08:52:48 rws Exp $
  457. X#
  458. X# Platform-specific parameters may be set in the appropriate <vendor>.cf
  459. X# configuration files.  Site-specific parameters should be set in the file
  460. X# site.def.  Full rebuilds are recommended if any parameters are changed.
  461. X#
  462. X# If your C preprocessor does not define any unique symbols, you will need
  463. X# to set BOOTSTRAPCFLAGS when rebuilding imake (usually when doing
  464. X# "make World" the first time).
  465. X#
  466. X
  467. X# -------------------------------------------------------------------------
  468. X# site-specific configuration parameters that need to come before
  469. X# the platform-specific parameters - edit site.def to change
  470. X
  471. X# site:  $XConsortium: site.def,v 1.2 91/07/30 20:26:44 rws Exp $
  472. X
  473. X# -------------------------------------------------------------------------
  474. X# platform-specific configuration parameters - edit ibm.cf to change
  475. X
  476. X# platform:  $XConsortium: ibm.cf,v 1.29 91/07/28 22:39:58 rws Exp $
  477. X
  478. X# operating system:  AIX 3.2.3
  479. X
  480. X# $XConsortium: ibmLib.rules,v 1.5 91/05/10 09:27:27 jap Exp $
  481. X
  482. X# -------------------------------------------------------------------------
  483. X# site-specific configuration parameters that go after
  484. X# the platform-specific parameters - edit site.def to change
  485. X
  486. X# site:  $XConsortium: site.def,v 1.2 91/07/30 20:26:44 rws Exp $
  487. X
  488. X            SHELL = /bin/sh
  489. X
  490. X              TOP = .
  491. X      CURRENT_DIR = .
  492. X
  493. X               AR = ar clq
  494. X  BOOTSTRAPCFLAGS =
  495. X               CC = cc
  496. X               AS = as
  497. X
  498. X         COMPRESS = compress
  499. X              CPP = /usr/lpp/X11/Xamples/util/cpp/cpp $(STD_CPP_DEFINES)
  500. X    PREPROCESSCMD = cc -E $(STD_CPP_DEFINES)
  501. X          INSTALL = /usr/ucb/install
  502. X               LD = ld
  503. X             LINT = lint
  504. X      LINTLIBFLAG = -o
  505. X         LINTOPTS = -ax
  506. X               LN = ln -s
  507. X             MAKE = make
  508. X               MV = mv
  509. X               CP = cp
  510. X
  511. X               RM = rm -f
  512. X            TROFF = psroff
  513. X         MSMACROS = -ms
  514. X              TBL = tbl
  515. X              EQN = eqn
  516. X     STD_INCLUDES =
  517. X  STD_CPP_DEFINES = -DSYSV -DAIXV3 -D_BSD -D_BSD_INCLUDES
  518. X      STD_DEFINES = -DSYSV -DAIXV3 -D_BSD -D_BSD_INCLUDES
  519. X EXTRA_LOAD_FLAGS = -bnodelcsect
  520. X  EXTRA_LIBRARIES =
  521. X             TAGS = ctags
  522. X
  523. X           MFLAGS = -$(MAKEFLAGS)
  524. X
  525. X    SHAREDCODEDEF = -DSHAREDCODE
  526. X         SHLIBDEF = -DAIXSHLIB
  527. X
  528. X    PROTO_DEFINES =
  529. X
  530. X     INSTPGMFLAGS =
  531. X
  532. X     INSTBINFLAGS = -m 0755
  533. X     INSTUIDFLAGS = -m 4755
  534. X     INSTLIBFLAGS = -m 0644
  535. X     INSTINCFLAGS = -m 0444
  536. X     INSTMANFLAGS = -m 0444
  537. X     INSTDATFLAGS = -m 0444
  538. X    INSTKMEMFLAGS = -m 4755
  539. X
  540. X      PROJECTROOT = /usr/local/X11R5
  541. X
  542. X     TOP_INCLUDES = -I$(INCROOT)
  543. X
  544. X      CDEBUGFLAGS = -O
  545. X        CCOPTIONS =
  546. X
  547. X      ALLINCLUDES = $(INCLUDES) $(EXTRA_INCLUDES) $(TOP_INCLUDES) $(STD_INCLUDES)
  548. X       ALLDEFINES = $(ALLINCLUDES) $(STD_DEFINES) $(EXTRA_DEFINES) $(PROTO_DEFINES) $(DEFINES)
  549. X           CFLAGS = $(CDEBUGFLAGS) $(CCOPTIONS) $(ALLDEFINES)
  550. X        LINTFLAGS = $(LINTOPTS) -DLINT $(ALLDEFINES)
  551. X
  552. X           LDLIBS = $(SYS_LIBRARIES) $(EXTRA_LIBRARIES)
  553. X
  554. X        LDOPTIONS = $(CDEBUGFLAGS) $(CCOPTIONS) $(LOCAL_LDFLAGS) -L$(USRLIBDIR)
  555. X
  556. X   LDCOMBINEFLAGS = -r
  557. X      DEPENDFLAGS =
  558. X
  559. X        MACROFILE = ibm.cf
  560. X           RM_CMD = $(RM) *.CKP *.ln *.BAK *.bak *.o core errs ,* *~ *.a .emacs_* tags TAGS make.log MakeOut
  561. X
  562. X    IMAKE_DEFINES =
  563. X
  564. X         IRULESRC = $(CONFIGDIR)
  565. X        IMAKE_CMD = $(IMAKE) -DUseInstalled -I$(IRULESRC) $(IMAKE_DEFINES)
  566. X
  567. X     ICONFIGFILES = $(IRULESRC)/Imake.tmpl $(IRULESRC)/Imake.rules \
  568. X            $(IRULESRC)/Project.tmpl $(IRULESRC)/site.def \
  569. X            $(IRULESRC)/$(MACROFILE) $(EXTRA_ICONFIGFILES)
  570. X
  571. X# -------------------------------------------------------------------------
  572. X# X Window System Build Parameters
  573. X# $XConsortium: Project.tmpl,v 1.138 91/09/10 09:02:12 rws Exp $
  574. X
  575. X# -------------------------------------------------------------------------
  576. X# X Window System make variables; this need to be coordinated with rules
  577. X
  578. X          PATHSEP = /
  579. X        USRLIBDIR = /usr/local/X11R5/lib
  580. X           BINDIR = /usr/local/X11R5/bin
  581. X          INCROOT = /usr/local/X11R5/include
  582. X     BUILDINCROOT = $(TOP)
  583. X      BUILDINCDIR = $(BUILDINCROOT)/X11
  584. X      BUILDINCTOP = ..
  585. X           INCDIR = $(INCROOT)/X11
  586. X           ADMDIR = /usr/adm
  587. X           LIBDIR = $(USRLIBDIR)/X11
  588. X        CONFIGDIR = $(LIBDIR)/config
  589. X       LINTLIBDIR = $(USRLIBDIR)/lint
  590. X
  591. X          FONTDIR = $(LIBDIR)/fonts
  592. X         XINITDIR = $(LIBDIR)/xinit
  593. X           XDMDIR = $(LIBDIR)/xdm
  594. X           TWMDIR = $(LIBDIR)/twm
  595. X          MANPATH = /usr/local/X11R5/man
  596. X    MANSOURCEPATH = $(MANPATH)/man
  597. X        MANSUFFIX = n
  598. X     LIBMANSUFFIX = 3
  599. X           MANDIR = $(MANSOURCEPATH)$(MANSUFFIX)
  600. X        LIBMANDIR = $(MANSOURCEPATH)$(LIBMANSUFFIX)
  601. X           NLSDIR = $(LIBDIR)/nls
  602. X        PEXAPIDIR = $(LIBDIR)/PEX
  603. X      XAPPLOADDIR = $(LIBDIR)/app-defaults
  604. X       FONTCFLAGS = -t
  605. X
  606. X     INSTAPPFLAGS = $(INSTDATFLAGS)
  607. X
  608. X            IMAKE = imake
  609. X           DEPEND = makedepend
  610. X              RGB = rgb
  611. X
  612. X            FONTC = bdftopcf
  613. X
  614. X        MKFONTDIR = mkfontdir
  615. X        MKDIRHIER = /bin/sh $(BINDIR)/mkdirhier
  616. X
  617. X        CONFIGSRC = $(TOP)/config
  618. X       DOCUTILSRC = $(TOP)/doc/util
  619. X        CLIENTSRC = $(TOP)/clients
  620. X          DEMOSRC = $(TOP)/demos
  621. X           LIBSRC = $(TOP)/lib
  622. X          FONTSRC = $(TOP)/fonts
  623. X       INCLUDESRC = $(TOP)/X11
  624. X        SERVERSRC = $(TOP)/server
  625. X          UTILSRC = $(TOP)/util
  626. X        SCRIPTSRC = $(UTILSRC)/scripts
  627. X       EXAMPLESRC = $(TOP)/examples
  628. X       CONTRIBSRC = $(TOP)/../contrib
  629. X           DOCSRC = $(TOP)/doc
  630. X           RGBSRC = $(TOP)/rgb
  631. X        DEPENDSRC = $(UTILSRC)/makedepend
  632. X         IMAKESRC = $(CONFIGSRC)
  633. X         XAUTHSRC = $(LIBSRC)/Xau
  634. X          XLIBSRC = $(LIBSRC)/X
  635. X           XMUSRC = $(LIBSRC)/Xmu
  636. X       TOOLKITSRC = $(LIBSRC)/Xt
  637. X       AWIDGETSRC = $(LIBSRC)/Xaw
  638. X       OLDXLIBSRC = $(LIBSRC)/oldX
  639. X      XDMCPLIBSRC = $(LIBSRC)/Xdmcp
  640. X      BDFTOSNFSRC = $(FONTSRC)/bdftosnf
  641. X      BDFTOSNFSRC = $(FONTSRC)/clients/bdftosnf
  642. X      BDFTOPCFSRC = $(FONTSRC)/clients/bdftopcf
  643. X     MKFONTDIRSRC = $(FONTSRC)/clients/mkfontdir
  644. X         FSLIBSRC = $(FONTSRC)/lib/fs
  645. X    FONTSERVERSRC = $(FONTSRC)/server
  646. X     EXTENSIONSRC = $(TOP)/extensions
  647. X         XILIBSRC = $(EXTENSIONSRC)/lib/xinput
  648. X      PHIGSLIBSRC = $(EXTENSIONSRC)/lib/PEX
  649. X
  650. X# $XConsortium: ibmLib.tmpl,v 1.2 91/05/04 11:49:00 rws Exp $
  651. X
  652. XPICFLAGS = -bM\:SRE
  653. X
  654. X  DEPEXTENSIONLIB =
  655. X     EXTENSIONLIB = -lXext
  656. X
  657. X          DEPXLIB = $(DEPEXTENSIONLIB)
  658. X             XLIB = $(EXTENSIONLIB) -lX11
  659. X
  660. X        DEPXMULIB =
  661. X           XMULIB = -lXmu
  662. X
  663. X       DEPOLDXLIB =
  664. X          OLDXLIB = -loldX
  665. X
  666. X      DEPXTOOLLIB = $(USRLIBDIR)/libXt.a
  667. X         XTOOLLIB = -lXt
  668. X
  669. X        DEPXAWLIB =
  670. X           XAWLIB = -lXaw
  671. X
  672. X        DEPXILIB =
  673. X           XILIB = -lXi
  674. X
  675. X        SOXLIBREV = SharedXlibRev
  676. X          SOXTREV = SharedXtRev
  677. X         SOXAWREV = SharedXawRev
  678. X        SOOLDXREV = SharedOldXRev
  679. X         SOXMUREV = SharedXmuRev
  680. X        SOXEXTREV = SharedXextRev
  681. X      SOXINPUTREV = SharedXinputRev
  682. X
  683. X      DEPXAUTHLIB = $(USRLIBDIR)/libXau.a
  684. X         XAUTHLIB =  -lXau
  685. X      DEPXDMCPLIB = $(USRLIBDIR)/libXdmcp.a
  686. X         XDMCPLIB =  -lXdmcp
  687. X
  688. X        DEPPHIGSLIB = $(USRLIBDIR)/libphigs.a
  689. X           PHIGSLIB =  -lphigs
  690. X
  691. X       DEPXBSDLIB = $(USRLIBDIR)/libXbsd.a
  692. X          XBSDLIB =  -lXbsd
  693. X
  694. X LINTEXTENSIONLIB = $(LINTLIBDIR)/llib-lXext.ln
  695. X         LINTXLIB = $(LINTLIBDIR)/llib-lX11.ln
  696. X          LINTXMU = $(LINTLIBDIR)/llib-lXmu.ln
  697. X        LINTXTOOL = $(LINTLIBDIR)/llib-lXt.ln
  698. X          LINTXAW = $(LINTLIBDIR)/llib-lXaw.ln
  699. X           LINTXI = $(LINTLIBDIR)/llib-lXi.ln
  700. X        LINTPHIGS = $(LINTLIBDIR)/llib-lphigs.ln
  701. X
  702. X          DEPLIBS = $(DEPXAWLIB) $(DEPXMULIB) $(DEPXTOOLLIB) $(DEPXLIB)
  703. X
  704. X         DEPLIBS1 = $(DEPLIBS)
  705. X         DEPLIBS2 = $(DEPLIBS)
  706. X         DEPLIBS3 = $(DEPLIBS)
  707. X
  708. X# -------------------------------------------------------------------------
  709. X# Imake rules for building libraries, programs, scripts, and data files
  710. X# rules:  $XConsortium: Imake.rules,v 1.123 91/09/16 20:12:16 rws Exp $
  711. X
  712. X# -------------------------------------------------------------------------
  713. X# start of Imakefile
  714. X
  715. X#
  716. X# Imakefile for xodometer.
  717. X#
  718. X# Stephen O. Lidie, Lehigh University Computing Center, 93/02/11.
  719. X#
  720. X# lusol@Lehigh.EDU
  721. X#
  722. X# Prior to running xmkmf inspect/change the following variables:
  723. X#
  724. X#    BINDIR        binary directoy
  725. X#    MANDIR        man page directory
  726. X#    RANLIB        what is ranlib (sorry, not defined in AIX)
  727. X#    PERLDIR        path name of Perl (it's OK if you don't have Perl!)
  728. X#    CDEBUGFLAGS    cc compiler options
  729. X#    MATHLIB        name of math library
  730. X#    LOCAL_LIBRARIES    which libraries
  731. X#
  732. X# Then:  xmkmf; make; make install
  733. X#
  734. X
  735. X#
  736. X# Where you want things installed.
  737. X#
  738. XBINDIR          = /usr/local/bin
  739. XMANDIR          = /usr/local/man/man1
  740. X
  741. X#
  742. X# Whether or not you have/need ranlib.
  743. X#
  744. XRANLIB        = ranlib    # have or need ranlib
  745. X#RANLIB         = /bin/true    # do not have or need ranlib
  746. X
  747. X#
  748. X# Where to get Perl.  It's OK if you don't have Perl, but expect an error
  749. X# from the program genmp during a 'make install' - the error can be safely
  750. X# ignored.  I use genmp (generate_man_page) so that the xodometer man page
  751. X# is always up-to-date, but the one that you have received in this
  752. X# distribution is by definition the latest and greatest.
  753. X#
  754. XPERLDIR         = /usr/local/bin
  755. X
  756. XCDEBUGFLAGS     = -O
  757. XMATHLIB         = -lm
  758. XLOCAL_LIBRARIES = $(XLIB) $(MATHLIB)
  759. X
  760. XSRCS        = xodo.c evap/evap.c
  761. XOBJS        = xodo.o evap/evap.o
  762. X
  763. Xall::    xodo_a xodo
  764. X
  765. Xclean::
  766. X    rm xodo xodo.o xodomm.a evap/evap.o
  767. X
  768. Xevap/evap.o:    evap/evap.c evap/evap.h
  769. X    (cd evap; $(CC) $(CDEBUGFLAGS) -DP_EVAP_MM_PATH=\"$(BINDIR)\" -c evap.c)
  770. X
  771. Xxodo_a:
  772. X    ar rcv xodomm.a evap\/xodo.mm
  773. X    $(RANLIB) xodomm.a
  774. X    sed -e "s!/usr/local/bin!$(BINDIR)!g" evap/xodo_pdt.skl > evap/xodo_pdt.out
  775. X
  776. Xinstall::
  777. X    $(INSTALL) -c $(INSTPGMFLAGS) xodo     $(BINDIR)
  778. X    $(INSTALL) -c $(INSTPGMFLAGS) xodomm.a $(BINDIR)
  779. X    sed -e "s!/usr/local/bin!$(PERLDIR)!" evap/genmp.skl > evap/genmp
  780. X    chmod 755 evap/genmp
  781. X    @echo " "
  782. X    @echo "******* Any errors from genmp can be safely ignored!"
  783. X    -evap/genmp $(BINDIR)/xodo 1> /dev/null 2> /dev/null
  784. X    @echo "******* Any errors from genmp can be safely ignored!"
  785. X    @echo " "
  786. X    $(INSTALL) -c $(INSTMANFLAGS) xodo.man $(MANDIR)/xodo.1
  787. X
  788. X PROGRAM = xodo
  789. X
  790. Xall:: xodo
  791. X
  792. Xxodo: $(OBJS) $(DEPLIBS)
  793. X    $(RM) $@
  794. X    $(CC) -o $@ $(OBJS) $(LDOPTIONS) $(LOCAL_LIBRARIES) $(LDLIBS) $(EXTRA_LOAD_FLAGS)
  795. X
  796. Xinstall:: xodo
  797. X    @if [ -d $(DESTDIR)$(BINDIR) ]; then set +x; \
  798. X    else (set -x; $(MKDIRHIER) $(DESTDIR)$(BINDIR)); fi
  799. X    $(INSTALL) -c $(INSTPGMFLAGS)  xodo $(DESTDIR)$(BINDIR)
  800. X
  801. Xinstall.man:: xodo.man
  802. X    @if [ -d $(DESTDIR)$(MANDIR) ]; then set +x; \
  803. X    else (set -x; $(MKDIRHIER) $(DESTDIR)$(MANDIR)); fi
  804. X    $(INSTALL) -c $(INSTMANFLAGS) xodo.man $(DESTDIR)$(MANDIR)/xodo.$(MANSUFFIX)
  805. X
  806. Xdepend::
  807. X    $(DEPEND) $(DEPENDFLAGS) -s "# DO NOT DELETE" -- $(ALLDEFINES) -- $(SRCS)
  808. X
  809. Xlint:
  810. X    $(LINT) $(LINTFLAGS) $(SRCS) $(LINTLIBS)
  811. Xlint1:
  812. X    $(LINT) $(LINTFLAGS) $(FILE) $(LINTLIBS)
  813. X
  814. Xclean::
  815. X    $(RM) $(PROGRAM)
  816. X
  817. X# -------------------------------------------------------------------------
  818. X# common rules for all Makefiles - do not edit
  819. X
  820. Xemptyrule::
  821. X
  822. Xclean::
  823. X    $(RM_CMD) "#"*
  824. X
  825. XMakefile::
  826. X    -@if [ -f Makefile ]; then set -x; \
  827. X    $(RM) Makefile.bak; $(MV) Makefile Makefile.bak; \
  828. X    else exit 0; fi
  829. X    $(IMAKE_CMD) -DTOPDIR=$(TOP) -DCURDIR=$(CURRENT_DIR)
  830. X
  831. Xtags::
  832. X    $(TAGS) -w *.[ch]
  833. X    $(TAGS) -xw *.[ch] > TAGS
  834. X
  835. X# -------------------------------------------------------------------------
  836. X# empty rules for directories that do not have SUBDIRS - do not edit
  837. X
  838. Xinstall::
  839. X    @echo "install in $(CURRENT_DIR) done"
  840. X
  841. Xinstall.man::
  842. X    @echo "install.man in $(CURRENT_DIR) done"
  843. X
  844. XMakefiles::
  845. X
  846. Xincludes::
  847. X
  848. X# -------------------------------------------------------------------------
  849. X# dependencies generated by makedepend
  850. X
  851. END_OF_FILE
  852. if test 12026 -ne `wc -c <'Makefile.AIX'`; then
  853.     echo shar: \"'Makefile.AIX'\" unpacked with wrong size!
  854. fi
  855. # end of 'Makefile.AIX'
  856. fi
  857. if test -f 'evap/evap.c' -a "${1}" != "-c" ; then 
  858.   echo shar: Will not clobber existing file \"'evap/evap.c'\"
  859. else
  860. echo shar: Extracting \"'evap/evap.c'\" \(21851 characters\)
  861. sed "s/^X//" >'evap/evap.c' <<'END_OF_FILE'
  862. X#include <ctype.h>
  863. X#include <malloc.h>
  864. X#include <stdio.h>
  865. X#include <sys/types.h>
  866. X#include <pwd.h>
  867. X#include "evap.h"
  868. X
  869. XFILE   *popen();
  870. X
  871. Xint    evap_display_message_module();
  872. Xvoid   evap_display_usage();
  873. Xvoid   evap_display_which();
  874. Xvoid   evap_type_conversion();
  875. Xvoid   evap_type_verification();
  876. X
  877. X
  878. Xint
  879. Xevap(argc, argv, pdt, check_parameters_function, pvt)
  880. X  int    *argc;
  881. X  char   **argv[];
  882. X  struct pdt_header pdt;
  883. X  int    *check_parameters_function;
  884. X  Parameter_Value *pvt;
  885. X
  886. X/*
  887. X  Step through the parameters, checking if they are valid, and if they
  888. X  require a value that one is specified and that it is valid. Note that
  889. X  it changes argv and argc to point to file names that appear AFTER all
  890. X  the parameters.  pvt is modified with the new parameter values.
  891. X  Because argv[0], the program name, is no longer available after calling
  892. X  evaluate_parameters, stuff it into pvt[P_HELP].unconverted_value.
  893. X  If a help message module is specified in the PDT header, then search the
  894. X  message module archive file libevapmm.a for the help text and display it
  895. X  if the -help switch is specified on the command line.  If the message
  896. X  module cannot be located then generate a short Usage: report.
  897. X  The check_parameters_function is currently unused and should be NULL.
  898. X
  899. X  Complete documentation can be found in the header file evap.h, including the
  900. X  evaluate_parameters revision history.
  901. X    
  902. X  Copyright (C) 1990 - 1993 by Lehigh University.  All rights reserved.
  903. X
  904. X*/
  905. X{
  906. X
  907. X  char   *arg;
  908. X  char   *command;
  909. X  char   *default_variable;
  910. X  short  full_help;
  911. X  short  usage_help;
  912. X  char   *getenv();
  913. X  int    i, j, entry;
  914. X  char   *parameter_help[P_MAX_PARAMETER_HELP];
  915. X  int    parameter_help_count;
  916. X  char   *parameter_help_name;
  917. X
  918. X  char   *strtok();
  919. X
  920. X  full_help = FALSE;        /* assume standard -help (brief) help */
  921. X  usage_help = FALSE;        /* assume standard -help (brief) help */
  922. X
  923. X  if (strncmp(pdt.version, "PDT Version", 11) != 0) {
  924. X    printf("Error - evaluate_parameters has detected an illegal PDT.\n");
  925. X    exit(1);
  926. X  }
  927. X
  928. X  if (check_parameters_function != NULL) {
  929. X    printf("Informative - check_parameters_function is not supported.\n");
  930. X  }
  931. X
  932. X  command = *argv[0];
  933. X  pvt[P_HELP].unconverted_value = command;
  934. X
  935. X  while (*argc > 1 && (*argv)[1][0] == '-') {
  936. X    (*argc)--;
  937. X    arg = *++(*argv);        /* get this parameter */
  938. X    arg++;            /* skip over the - */
  939. X    if (*arg == '-') return( 0 ); /* allow -- to end command line parameters */
  940. X    entry = -1;
  941. X    if (strcmp(arg, "full_help") == 0) {
  942. X      full_help = TRUE;        /* flag special full help from disci */
  943. X      pvt[P_HELP].specified = TRUE;
  944. X      continue;            /* while argc */
  945. X    }  
  946. X    if (strcmp(arg, "usage_help") == 0) {
  947. X      usage_help = TRUE;    /* flag special usage help from disci */
  948. X      pvt[P_HELP].specified = TRUE;
  949. X      continue;            /* while argc */
  950. X    }  
  951. X
  952. X    for (i=0; (pvt[i].parameter) != NULL && entry == -1; i++) 
  953. X      if ( (strcmp(arg, pvt[i].parameter) == 0) && pvt[i].changeable)
  954. X        entry = i;        /* exact match on full form */
  955. X
  956. X    for (i=0; (pvt[i].parameter) != NULL && entry == -1; i++)
  957. X      if ( (strcmp(arg, pvt[i].alias) == 0) && pvt[i].changeable)
  958. X        entry = i;        /* exact match on alias */
  959. X
  960. X    if (entry == -1) {        /* no match so far, try a substring match */
  961. X      for (i=0; (pvt[i].parameter) != NULL; i++) 
  962. X        if ( (strncmp(arg, pvt[i].parameter, strlen(arg)) == 0) &&
  963. X             pvt[i].changeable) {
  964. X          if (entry != -1) {
  965. X            printf("Ambiguous parameter: -%s.\n", arg);
  966. X            printf("Type %s -help for command line parameter information.\n",
  967. X                  pvt[P_HELP].unconverted_value);
  968. X            exit(1);
  969. X          }
  970. X          entry = i;        /* substring match on full form */
  971. X        }
  972. X    }
  973. X
  974. X    if (entry ==  -1) {
  975. X      printf("Invalid parameter: -%s.\n", arg);
  976. X      printf("Type %s -help for command line parameter information.\n",
  977. X            pvt[P_HELP].unconverted_value);
  978. X      exit(1);
  979. X    }
  980. X
  981. X    pvt[entry].specified = TRUE; /* mark it as specified by the user */
  982. X    if (pvt[entry].type != P_TYPE_SWITCH) { /* value for non-switch types */
  983. X      if (*argc > 1) {
  984. X        (*argc)--;
  985. X        pvt[entry].unconverted_value = *++(*argv);
  986. X      } else {
  987. X        printf("Value required for parameter -%s.\n", arg);
  988. X        printf("Type %s -help for command line parameter information.\n",
  989. X              pvt[P_HELP].unconverted_value);
  990. X        exit(1);
  991. X      }
  992. X    } /* ifend */
  993. X
  994. X    evap_type_verification(&pvt[entry], pvt[P_HELP].unconverted_value);
  995. X
  996. X  } /* while argc */
  997. X
  998. X  if (pvt[P_HELP].specified) {    /* display command information */
  999. X    if (full_help) {
  1000. X      printf ("Command Source:  ");
  1001. X      evap_display_which(command);
  1002. X      printf ("\nMessage Module Name:  %s\n\n", pdt.help_module_name);
  1003. X      fflush(stdout);        /* not sure why I NEED this! */
  1004. X    }
  1005. X
  1006. X    if ( usage_help || (evap_display_message_module(pdt.help_module_name,
  1007. X          parameter_help, ¶meter_help_count) != 0) )
  1008. X      evap_display_usage(command, pdt, pvt);
  1009. X
  1010. X    printf ("\nParameters:\n");
  1011. X    if ( ! full_help )
  1012. X      printf( "\n" );
  1013. X    for (i=0; (pvt[i].parameter != NULL); i++) {
  1014. X      /* changeable = -1 means valid but HIDDEN from -disci */
  1015. X      if (pvt[i].changeable == 1) { /*valid and advertisable*/
  1016. X    if ( full_help )
  1017. X      printf( "\n" );
  1018. X    if (strcmp(pvt[i].alias, "") != 0)
  1019. X          printf ("-%s, %s%s\n",pvt[i].parameter, pvt[i].alias,
  1020. X                 pvt[i].description);
  1021. X        else
  1022. X          printf ("-%s%s\n",pvt[i].parameter, pvt[i].description);
  1023. X
  1024. X    if ( full_help && (parameter_help_count >= 0) ) {
  1025. X      printf( "\n" );
  1026. X          if ( i == P_HELP ) {
  1027. X            printf(
  1028. X         "\tIndicates display brief help information, which includes\n" );
  1029. X            printf(
  1030. X             "\ta command description with examples, plus a synopsis of\n" );
  1031. X        printf(
  1032. X             "\tthe command line parameters.  If you specify -full_help\n" );
  1033. X        printf(
  1034. X             "\trather than -help complete parameter help is displayed\n" );
  1035. X        printf(
  1036. X             "\tif it's available.\n" );
  1037. X          }
  1038. X      /*
  1039. X             Search parameter_help for this parameter's description.
  1040. X         Each entry is a list of new-line-separated lines - the
  1041. X         first line is the name of the parameter.
  1042. X          */
  1043. X      for ( j=0; j <= parameter_help_count; j++ ) {
  1044. X        parameter_help_name = strtok( parameter_help[j], "\n" );
  1045. X        if ( strcmp( pvt[i].parameter, parameter_help_name ) == 0 ) {
  1046. X          printf( "%s", parameter_help[j]+strlen(parameter_help_name)+1 );
  1047. X        } /* ifend */
  1048. X      } /* forend */
  1049. X    } /* ifend */
  1050. X      } /* ifend */ 
  1051. X    } /* forend */
  1052. X    if (strncmp(pdt.version, "PDT Version 1.0 ", 16) > 0) {
  1053. X      if (strcmp(pdt.file_list, "no_file_list") == 0)
  1054. X    ;
  1055. X      else if (strcmp(pdt.file_list, "required_file_list") == 0) {
  1056. X        printf("\n file(s) required by this command\n");
  1057. X      } else {
  1058. X        printf("\n [file(s)] optionally required by this command\n");
  1059. X      }
  1060. X    } /* ifend PDT version 1.1 or greater */
  1061. X    printf ("\n");
  1062. X    exit(0);
  1063. X  }
  1064. X
  1065. X  /*
  1066. X    Now loop through the PDT looking for unspecified parameters.
  1067. X
  1068. X    If there is a default environment variable specified and it is
  1069. X    defined then update the structure member unconverted_value.
  1070. X
  1071. X    Then perform type verification.
  1072. X  */
  1073. X  if (strncmp(pdt.version, "PDT Version 1.1 ", 16) > 0) {
  1074. X    for (i = 0; pvt[i].parameter != NULL; i++) {
  1075. X
  1076. X      if ( i == P_HELP ) continue; /* for */
  1077. X      if (! pvt[i].specified) {
  1078. X    if (pvt[i].default_variable != NULL) {
  1079. X      if ((default_variable = getenv(pvt[i].default_variable)) != NULL) {
  1080. X        pvt[i].unconverted_value = default_variable;
  1081. X      } /* ifend */
  1082. X    } /* ifend default variable */ 
  1083. X    evap_type_verification(&pvt[i], command);
  1084. X      } /* ifend parameter not specified */
  1085. X
  1086. X    } /* forend */
  1087. X  } /* ifend PDT version 1.2 or greater */
  1088. X
  1089. X  /*
  1090. X    Complain if there are any $required parameters.  Perform type conversion.
  1091. X  */
  1092. X  for (i=0; (pvt[i].parameter != NULL); i++) {
  1093. X    if (strcmp("$required", pvt[i].unconverted_value) == 0) {
  1094. X      printf ("Parameter %s is required but was omitted.\n", pvt[i].parameter);
  1095. X      printf("Type %s -help for command line parameter information.\n",
  1096. X            pvt[P_HELP].unconverted_value);
  1097. X      exit(1);
  1098. X    }
  1099. X    evap_type_conversion(&pvt[i]);
  1100. X  } /* forend */
  1101. X
  1102. X  if (strncmp(pdt.version, "PDT Version 1.0 ", 16) > 0) {
  1103. X    if ((strcmp(pdt.file_list, "no_file_list") == 0) &&
  1104. X          (*argc > 1)) {
  1105. X      printf("Trailing file name(s) not permitted.\n");
  1106. X      printf("Type %s -help for command line parameter information.\n",
  1107. X            pvt[P_HELP].unconverted_value);
  1108. X      exit(1);
  1109. X    } 
  1110. X    if ((strcmp(pdt.file_list, "required_file_list") == 0) &&
  1111. X          (*argc == 1)) {
  1112. X      printf ("Trailing file name(s) required.\n");
  1113. X      printf("Type %s -help for command line parameter information.\n",
  1114. X            pvt[P_HELP].unconverted_value);
  1115. X      exit(1);
  1116. X    }
  1117. X  } /* ifend PDT version 1.1 or greater */
  1118. X
  1119. X  return( 0 );            /* success */
  1120. X
  1121. X} /* end evaluate_parameters */
  1122. X
  1123. X
  1124. X
  1125. X
  1126. Xvoid
  1127. Xevap_type_verification(pvte, command_name)
  1128. X  Parameter_Value *pvte;
  1129. X  char   *command_name;
  1130. X
  1131. X/*
  1132. X  Type-check/initialize the unconverted_value member (a C string).
  1133. X  Evaluate backticked items.
  1134. X*/
  1135. X{
  1136. X
  1137. X#define BACKMAX 1024
  1138. X
  1139. X  char   *backcomd;
  1140. X  int    backcnt;
  1141. X  int    backincr;
  1142. X  char   *backline;
  1143. X  char   *backptr;
  1144. X  FILE   *backtick;
  1145. X  int    i;
  1146. X  int    valid;
  1147. X  char   *value;
  1148. X  char   home[6];
  1149. X  struct passwd *pwent;
  1150. X  char   *home_ptr;
  1151. X
  1152. X  if ( pvte->unconverted_value[0] == '`' &&
  1153. X      pvte->unconverted_value[strlen( pvte->unconverted_value ) - 1] == '`' ) {
  1154. X    backcomd = (char *)malloc( 10 + strlen( pvte->unconverted_value ) );
  1155. X    sprintf( backcomd, "echo %s", pvte->unconverted_value );
  1156. X    if ( (backtick = popen( backcomd, "r" )) != NULL ) {
  1157. X      backcnt = 1;
  1158. X      backline = (char *)malloc( BACKMAX * backcnt );
  1159. X      backptr = fgets( backline, BACKMAX, backtick );
  1160. X      pvte->unconverted_value = backline;
  1161. X      while ( backptr != NULL ) {
  1162. X    backline = (char *) realloc( backline, BACKMAX * ++backcnt );
  1163. X    pvte->unconverted_value = backline;
  1164. X    backincr = (BACKMAX * (backcnt - 1)) - (backcnt - 1);
  1165. X    backptr = fgets( backline+backincr, BACKMAX, backtick );
  1166. X      }
  1167. X      pvte->unconverted_value[strlen( pvte->unconverted_value ) - 1] = '\0';
  1168. X      pclose( backtick );
  1169. X      free( backcomd );
  1170. X    } /* ifend backtick evaluation */
  1171. X  } /* backticks */
  1172. X
  1173. X  value = pvte->unconverted_value; /* get value from pvt entry */
  1174. X  switch (pvte->type) {
  1175. X
  1176. X  case P_TYPE_SWITCH:
  1177. X    pvte->unconverted_value = "TRUE";
  1178. X    break;
  1179. X
  1180. X  case P_TYPE_STRING:
  1181. X    break; /* anything OK */
  1182. X
  1183. X  case P_TYPE_REAL:
  1184. X    if (FALSE) { /* no type enforcment (no U*X consistency either) */
  1185. X      printf("Expecting real reference, found \"%s\" for parameter -%s.\n",
  1186. X            pvte->unconverted_value, pvte->parameter);
  1187. X      printf("Type %s -help for command line parameter information.\n",
  1188. X            command_name);
  1189. X      exit(1);
  1190. X    }
  1191. X    break;
  1192. X
  1193. X  case P_TYPE_INTEGER:
  1194. X    if((isdigit(*value)) || (value[0] == '+') || (value[0] == '-'))
  1195. X      value++;
  1196. X    else {
  1197. X      printf("Expecting integer reference, found \"%s\" for parameter -%s.\n",
  1198. X            pvte->unconverted_value, pvte->parameter);
  1199. X      printf("Type %s -help for command line parameter information.\n",
  1200. X            command_name);
  1201. X      exit(1);
  1202. X    }
  1203. X    for(; *value != '\0'; value++) {
  1204. X      if(! isdigit(*value)) {
  1205. X        printf(
  1206. X         "Expecting integer reference, found \"%s\" for parameter -%s.\n",
  1207. X              pvte->unconverted_value, pvte->parameter);
  1208. X        printf("Type %s -help for command line parameter information.\n",
  1209. X              command_name);
  1210. X        exit(1);
  1211. X      }
  1212. X    }
  1213. X    break;
  1214. X
  1215. X  case P_TYPE_BOOLEAN:
  1216. X    if((strcmp(value, "TRUE") != 0) && (strcmp(value, "FALSE") != 0)) {
  1217. X      printf("Expecting boolean reference, found \"%s\" for parameter -%s.\n",
  1218. X            pvte->unconverted_value, pvte->parameter);
  1219. X      printf("Type %s -help for command line parameter information.\n",
  1220. X            command_name);
  1221. X      exit(1);
  1222. X    }
  1223. X    break;
  1224. X
  1225. X  case P_TYPE_FILE:
  1226. X    home_ptr = NULL;
  1227. X    strncpy( home, value, 5);    /* look for $HOME or ~ */
  1228. X    home[5] = '\0';
  1229. X    if ( strcmp( home, "$HOME" ) == 0) 
  1230. X      home_ptr = value+5;
  1231. X    if ( *value == '~')
  1232. X      home_ptr = value+1;
  1233. X    if ( home_ptr != NULL ) {    /* expand the shorthand */
  1234. X      if ( (pwent = getpwuid( getuid() )) != NULL ) {
  1235. X        pvte->unconverted_value = (char *)malloc( strlen( value ) +
  1236. X              strlen( pwent->pw_dir ) );
  1237. X    strcpy( pvte->unconverted_value, pwent->pw_dir );
  1238. X    strcat( pvte->unconverted_value, home_ptr );
  1239. X    value = pvte->unconverted_value;
  1240. X      } /* ifend pwent */
  1241. X    } /* ifend expand $HOME */
  1242. X    if (strlen(value) > 255) {
  1243. X      printf("Expecting file reference, found \"%s\" for parameter -%s.\n",
  1244. X            pvte->unconverted_value, pvte->parameter);
  1245. X      printf("Type %s -help for command line parameter information.\n",
  1246. X            command_name);
  1247. X      exit(1);
  1248. X    }
  1249. X    break;
  1250. X
  1251. X  case P_TYPE_KEY:
  1252. X    if (pvte->valid_values[0]) {
  1253. X
  1254. X      for(valid=FALSE, i=0; pvte->valid_values[i] && ! valid; i++)
  1255. X        if (strcmp(value, pvte->valid_values[i]) == 0)
  1256. X          valid = TRUE;        /* ok, got one */
  1257. X
  1258. X      if (! valid)        /* no exact match, try a substring match */
  1259. X        for(valid=FALSE, i=0; pvte->valid_values[i]; i++)
  1260. X          if (strncmp(value, pvte->valid_values[i], strlen(value)) == 0) {
  1261. X            if (valid) {
  1262. X              printf("Ambiguous keyword for parameter -%s: %s.\n",
  1263. X                    pvte->parameter, value);
  1264. X              printf("Type %s -help for command line parameter information.\n",
  1265. X                    command_name);
  1266. X              exit(1);
  1267. X            }
  1268. X            valid = TRUE;    /* ok, got one */
  1269. X            pvte->unconverted_value = pvte->valid_values[i];
  1270. X          } /* ifend update value in pvt */
  1271. X
  1272. X      if (! valid) {        /* no matches */
  1273. X        printf("\"%s\" is not a valid value for the parameter -%s.\n",
  1274. X               pvte->unconverted_value, pvte->parameter);
  1275. X        printf("Type %s -help for command line parameter information.\n",
  1276. X              command_name);
  1277. X        exit(1);
  1278. X      }
  1279. X    }
  1280. X    break;
  1281. X
  1282. X  case P_TYPE_APPLICATION:
  1283. X    break;            /* anything is valid in this case */
  1284. X
  1285. X  case P_TYPE_NAME:
  1286. X    for ( ; *value != '\0'; value++ ) {
  1287. X      if ( *value == ' ' || *value == '\n' || *value == '\t' ) {
  1288. X    printf("Expecting name reference, found \"%s\" for parameter -%s.\n",
  1289. X           pvte->unconverted_value, pvte->parameter);
  1290. X    printf("Type %s -help for command line parameter information.\n",
  1291. X           command_name);
  1292. X    exit(1);
  1293. X      }
  1294. X    }
  1295. X    break;
  1296. X
  1297. X  default:
  1298. X    printf("Error in evap_type_verification (default), please get help!\n");
  1299. X    exit(1);
  1300. X    break;
  1301. X  }
  1302. X
  1303. X  return;
  1304. X
  1305. X} /* end evap_type_verification */
  1306. X
  1307. X
  1308. X
  1309. X
  1310. Xvoid
  1311. Xevap_type_conversion(pvte)
  1312. X  Parameter_Value *pvte;
  1313. X
  1314. X/*
  1315. X  Convert all the unconverted values, which are C strings, in a type-dependent
  1316. X  manner, and store the result in the value variant record (union).
  1317. X*/
  1318. X{
  1319. X
  1320. X  char   *value;
  1321. X
  1322. X  value = pvte->unconverted_value; /* get value from pvt entry */
  1323. X  switch (pvte->type) {
  1324. X
  1325. X  case P_TYPE_SWITCH:
  1326. X    if (strcmp(value, "TRUE") == 0)
  1327. X      pvte->value.switch_value = TRUE;
  1328. X    else
  1329. X      pvte->value.switch_value = FALSE;
  1330. X    break;
  1331. X
  1332. X  case P_TYPE_STRING:
  1333. X    pvte->value.string_value = value;
  1334. X    break;
  1335. X
  1336. X  case P_TYPE_REAL:
  1337. X    sscanf(value, "%lg", &pvte->value.real_value);
  1338. X    break;
  1339. X
  1340. X  case P_TYPE_INTEGER:
  1341. X    sscanf(value, "%d", &pvte->value.integer_value);
  1342. X    break;
  1343. X
  1344. X  case P_TYPE_BOOLEAN:
  1345. X    if (strcmp(value, "TRUE") == 0)
  1346. X      pvte->value.boolean_value = TRUE;
  1347. X    else
  1348. X      pvte->value.boolean_value = FALSE;
  1349. X    break;
  1350. X
  1351. X  case P_TYPE_FILE:
  1352. X    pvte->value.file_value = value;
  1353. X    break;
  1354. X
  1355. X  case P_TYPE_KEY:
  1356. X    pvte->value.key_value = value;
  1357. X    break;
  1358. X
  1359. X  case P_TYPE_APPLICATION:
  1360. X    pvte->value.application_value = value;
  1361. X    break;
  1362. X
  1363. X  case P_TYPE_NAME:
  1364. X    pvte->value.name_value = value;
  1365. X    break;
  1366. X
  1367. X  default:
  1368. X    printf("Error in evap_type_conversion (default), please get help!\n");
  1369. X    exit(1);
  1370. X    break;
  1371. X  }
  1372. X
  1373. X  return;
  1374. X
  1375. X} /* end evap_type_conversion */
  1376. X
  1377. X
  1378. X
  1379. Xint
  1380. Xevap_display_message_module(message_module_name, parameter_help,
  1381. X                parameter_help_count)
  1382. X char   *message_module_name;
  1383. X char   *parameter_help[];
  1384. X int    *parameter_help_count;
  1385. X
  1386. X/*
  1387. X  Search an evaluate_parameters message module file for the specified help
  1388. X  module and, if found, display it.
  1389. X  The message_module_name parameter is either a simple message module name or
  1390. X  a message module name prefixed with the path name of a local message module
  1391. X  archive file.  For example:
  1392. X    disci.mm               names a message module disci.mm in file libevapmm.a
  1393. X    my_mm/my_program.mm    names a message module my_progam.mm in file my_mm
  1394. X*/
  1395. X{
  1396. X
  1397. X  FILE*  a;            /* stream to read ar output from */
  1398. X  char   afn[256];        /* evap ar message module path name */
  1399. X  char   ar_str[512];        /* ar p libevapmm.a mm */
  1400. X  char*  cp;            /* character pointer */
  1401. X  short  parameter_help_in_progress;
  1402. X
  1403. X  extern char *strrchr();    /* string.h vs. strings.h hassles!!!! */
  1404. X                /* freakin' U*X inconsistencies...    */
  1405. X
  1406. X  if (message_module_name == NULL)
  1407. X    return( 1 );        /* if no message module specified */
  1408. X
  1409. X  cp = strrchr(message_module_name, '/'); /* check for local archive path */
  1410. X  if (cp == NULL) {        /* simple message module name */
  1411. X    strcpy(afn, P_EVAP_MM_PATH); /* use default ar file name */
  1412. X  } else {            /* private message module ar file */
  1413. X    *cp = '\0'; /* separate file path name and message module name */
  1414. X    strcpy(afn, message_module_name);
  1415. X    strcpy(message_module_name, cp+1);
  1416. X  } /* ifend simple message module */
  1417. X
  1418. X  sprintf(ar_str, "ar p %s %s 2> /dev/null", afn,
  1419. X        message_module_name);
  1420. X
  1421. X  *parameter_help_count = -1;    /* no parameters have help so far */
  1422. X  parameter_help_in_progress = FALSE; /* not collecting parameter help */
  1423. X
  1424. X  if ( (a = popen( ar_str, "r" )) == NULL )
  1425. X    return( 1 );        /* do usage */
  1426. X
  1427. X  if ( fgets( ar_str, 512, a ) == NULL )
  1428. X    return( 1 );        /* do usage */
  1429. X
  1430. X  do {                /* copy message module until EOF */
  1431. X    if ( ar_str[0] == '.' ) {    /* or until start of parameter help */
  1432. X      parameter_help_in_progress = TRUE;
  1433. X      /*
  1434. X    Create an array of parameter help: the first line is the parameter
  1435. X    name and successive lines are the associated help text.
  1436. X      */
  1437. X      (*parameter_help_count)++;
  1438. X      parameter_help[*parameter_help_count] =
  1439. X    (char *)malloc( P_MAX_PARAMETER_HELP_LENGTH );
  1440. X      strcpy( parameter_help[*parameter_help_count], ar_str+1 );
  1441. X      continue; /* do */
  1442. X    } /* ifend start of parameter help */
  1443. X    if ( parameter_help_in_progress ) {
  1444. X      if ( strlen( parameter_help[*parameter_help_count] ) + strlen( ar_str )
  1445. X      < P_MAX_PARAMETER_HELP_LENGTH ) {
  1446. X    strcat( parameter_help[*parameter_help_count], ar_str );
  1447. X      } else {
  1448. X    sprintf( ar_str,
  1449. X        "\n*** Parameter Help Text Exceeds %d Characters ***\n",
  1450. X        P_MAX_PARAMETER_HELP_LENGTH );
  1451. X    strcpy( parameter_help[*parameter_help_count] +
  1452. X           P_MAX_PARAMETER_HELP_LENGTH - strlen( ar_str ) - 1,
  1453. X           ar_str );
  1454. X      }
  1455. X    } else {
  1456. X      printf( "%s", ar_str );
  1457. X    }
  1458. X  } while (fgets( ar_str, 512, a) != NULL); /* doend */
  1459. X  pclose( a );
  1460. X
  1461. X  return( 0 );            /* success */
  1462. X
  1463. X} /* end evap_display_message_module */
  1464. X
  1465. X
  1466. X
  1467. X
  1468. X
  1469. Xvoid
  1470. Xevap_display_usage(command, pdt, pvt)
  1471. X  char   *command;
  1472. X  struct pdt_header pdt;
  1473. X  Parameter_Value pvt[];
  1474. X
  1475. X/*
  1476. X  Generate a 'standard' usage display in lieu of a help message module.
  1477. X*/
  1478. X{
  1479. X
  1480. X  int    i;
  1481. X  int    optional_param_count;
  1482. X
  1483. X  optional_param_count = 0;
  1484. X  printf("\nUsage: %s", command);
  1485. X
  1486. X  for(i=0; pvt[i].parameter != NULL; i++) {
  1487. X    if (pvt[i].changeable == 1) { /* valid and advertisable */
  1488. X      optional_param_count++;
  1489. X      if (strcmp(pvt[i].unconverted_value, "$required") == 0) {
  1490. X        optional_param_count--;
  1491. X        if (strcmp(pvt[i].alias, "") != 0)
  1492. X          printf(" -%s", pvt[i].alias);
  1493. X        else
  1494. X          printf(" -%s", pvt[i].parameter);
  1495. X      } /* ifend */
  1496. X    } /* ifend */
  1497. X  } /* forend */
  1498. X
  1499. X  if (optional_param_count > 0) {
  1500. X    printf(" [");
  1501. X    for(i=0; pvt[i].parameter != NULL; i++) {
  1502. X      if (pvt[i].changeable == 1) { /* if advertisable */
  1503. X        if (strcmp(pvt[i].unconverted_value, "$required") != 0) {
  1504. X          if (strcmp(pvt[i].alias, "") != 0)
  1505. X            printf(" -%s", pvt[i].alias);
  1506. X          else
  1507. X            printf(" -%s", pvt[i].parameter);
  1508. X        } /* ifend */
  1509. X      } /* ifend */
  1510. X    } /* forend */
  1511. X    printf("]");
  1512. X  } /* ifend */
  1513. X
  1514. X  if (strncmp(pdt.version, "PDT Version 1.0 ", 16) > 0) {
  1515. X    if (strcmp(pdt.file_list, "required_file_list") == 0)
  1516. X      printf(" file(s)\n");
  1517. X    else if (strcmp(pdt.file_list, "optional_file_list") == 0)
  1518. X      printf(" [file(s)]\n");
  1519. X    else
  1520. X      printf("\n");
  1521. X  } /* ifend PDT version 1.1 or greater */
  1522. X  else
  1523. X    printf("\n");
  1524. X
  1525. X  return;
  1526. X
  1527. X} /* end evap_display_usage */
  1528. X
  1529. X
  1530. X
  1531. X
  1532. Xvoid
  1533. Xevap_display_which(command)
  1534. X  char   *command;
  1535. X
  1536. X/*
  1537. X  Perform a fast 'which' function to show the source of this command.
  1538. X  (Copied from which.c on UUNET.UU.NET, but with a few bug fixes.)
  1539. X*/
  1540. X{
  1541. X
  1542. X  char   *getenv(), *path = getenv("PATH");
  1543. X  char   test[1000], *pc, save;
  1544. X  int    len, found;
  1545. X
  1546. X  extern char *strrchr();    /* string.h vs. strings.h hassles! */
  1547. X  char name[256];        /* name exclusive of path */
  1548. X  char *cp;            /* character pointer */  
  1549. X
  1550. X  cp = strrchr(command, '/');    /* look for path separator */
  1551. X  if (cp == NULL)
  1552. X    strcpy(name, command);    /* if a simple file name */
  1553. X  else {
  1554. X    printf("%s\n", command);    /* must be an explicit path */
  1555. X    return;
  1556. X  }
  1557. X
  1558. X  pc = path;
  1559. X  found = 0;
  1560. X
  1561. X  while (*pc != '\0' && found == 0) {
  1562. X    len = 0;
  1563. X
  1564. X    while (*pc != ':' && *pc != '\0') {
  1565. X      len++;
  1566. X      pc++;
  1567. X    } /* whilend */
  1568. X
  1569. X    save = *pc;
  1570. X    *pc = '\0';
  1571. X    sprintf(test, "%s/%s", pc-len, name);
  1572. X    *pc = save;
  1573. X    if (*pc)
  1574. X      pc++;
  1575. X
  1576. X    found = (0 == access(test, 01)); /* executable */
  1577. X    if (found)
  1578. X      puts(test);
  1579. X
  1580. X  } /* whilend */
  1581. X
  1582. X  return;
  1583. X
  1584. X} /* end evap_display_which */
  1585. END_OF_FILE
  1586. if test 21851 -ne `wc -c <'evap/evap.c'`; then
  1587.     echo shar: \"'evap/evap.c'\" unpacked with wrong size!
  1588. fi
  1589. # end of 'evap/evap.c'
  1590. fi
  1591. echo shar: End of archive 2 \(of 4\).
  1592. cp /dev/null ark2isdone
  1593. MISSING=""
  1594. for I in 1 2 3 4 ; do
  1595.     if test ! -f ark${I}isdone ; then
  1596.     MISSING="${MISSING} ${I}"
  1597.     fi
  1598. done
  1599. if test "${MISSING}" = "" ; then
  1600.     echo You have unpacked all 4 archives.
  1601.     echo "Read README for installation instructions."
  1602.     rm -f ark[1-9]isdone
  1603. else
  1604.     echo You still need to unpack the following archives:
  1605.     echo "        " ${MISSING}
  1606. fi
  1607. ##  End of shell archive.
  1608. exit 0
  1609.  
  1610. exit 0 # Just in case...
  1611. -- 
  1612.   // chris@IMD.Sterling.COM            | Send comp.sources.x submissions to:
  1613. \X/  Amiga - The only way to fly!      |
  1614.  "It's intuitively obvious to the most |    sources-x@imd.sterling.com
  1615.   casual observer..."                  |
  1616.