home *** CD-ROM | disk | FTP | other *** search
/ Source Code 1994 March / Source_Code_CD-ROM_Walnut_Creek_March_1994.iso / compsrcs / unix / volume26 / uutraf / part02 < prev    next >
Encoding:
Text File  |  1993-05-07  |  37.3 KB  |  1,270 lines

  1. Newsgroups: comp.sources.unix
  2. From: decvax!concert.net!woods%robohack (Greg A. Woods)
  3. Subject: v26i237: uutraf - UUCP Traffic Analysis and Reporting, Part02/04
  4. Sender: unix-sources-moderator@efficacy.home.vix.com
  5. Approved: vixie@efficacy.home.vix.com
  6.  
  7. Submitted-By: decvax!concert.net!woods%robohack (Greg A. Woods)
  8. Posting-Number: Volume 26, Issue 237
  9. Archive-Name: uutraf/part02
  10.  
  11. #! /bin/sh
  12. # This is a shell archive.  Remove anything before this line, then unpack
  13. # it by saving it into a file and typing "sh file".  To overwrite existing
  14. # files, type "sh file -c".  You can also feed this as standard input via
  15. # unshar, or by typing "sh <file", e.g..  If this archive is complete, you
  16. # will see the following message at the end:
  17. #        "End of archive 2 (of 4)."
  18. # Contents:  Makefile-dist externhdr.shar
  19. # Wrapped by woods@robohack on Sun Nov  8 16:38:12 1992
  20. PATH=/bin:/usr/bin:/usr/ucb ; export PATH
  21. if test -f 'Makefile-dist' -a "${1}" != "-c" ; then 
  22.   echo shar: Will not clobber existing file \"'Makefile-dist'\"
  23. else
  24. echo shar: Extracting \"'Makefile-dist'\" \(10227 characters\)
  25. sed "s/^X//" >'Makefile-dist' <<'END_OF_FILE'
  26. X#! /bin/make -f
  27. X#
  28. X#ident    "@(#)uutraf:Makefile    1.2.2.9    92/11/08 16:35:41 (woods)"
  29. X#
  30. X#    Makefile - for uutraf
  31. X#
  32. X# Usage:
  33. X#    make [OPTIM=] [DEBUG=-DDEBUG] [SDB=-g] [uutraf]
  34. X#    make install
  35. X#    make clean
  36. X#    make clobber
  37. X#    make shar
  38. X#
  39. X# History:
  40. X#    woods@robohack.UUCP - Sun Jul 05 23:43:43 EDT 1992
  41. X#    - many changes getting ready for new release
  42. X#    woods@robohack.UUCP - Sun Jul 15 12:38:34 EDT 1990
  43. X#    - minor cleanups
  44. X#    - added list library modules
  45. X#
  46. X# @(#) FILE:    Makefile
  47. X# @(#) Release:    1.2
  48. X# @(#) Date:    2/2/90
  49. X# @(#) Author:    Greg Hackney (hack@texbell.swbt.com)
  50. X
  51. XSHELL = /bin/sh
  52. X
  53. XLOCAL = /usr/local
  54. X
  55. XBINDIR = $(LOCAL)/bin
  56. XLIBDIR = $(LOCAL)/lib
  57. XINCDIR = $(LOCAL)/include
  58. XMANEXT = 1
  59. XMANDIR = $(LOCAL)/man/man1
  60. X
  61. X# Select the right definition for your system, unless you are compiling on
  62. X# one of the following:  SunOS, ULTRIX, AIX, XENIX.
  63. X# 
  64. X#    v7:    SYSTYPE= -DV7        /* UNTESTED "The Real Thing!"(tm) ;-) */
  65. X#   any BSD:    SYSTYPE= -DBSD        /* UNTESTED (not required?) */
  66. X#  fake BSD:    SYSTYPE= -UBSD        /* UNTESTED [for POSIX/ANSI systems] */
  67. X#    SysIII: SYSTYPE= -DSYSIII    /* UNTESTED */
  68. X#    SysV:    SYSTYPE= -DSYSV         /* generic AT&T or USG unix */
  69. X#    SysVr1:    SYSTYPE= -DSYSVR1    /* UNTESTED i.e. the original SysV */
  70. X#    SysVr2:    SYSTYPE= -DSYSVR2    /* yes, 3b1'ers, this is you too! */
  71. X#    SysVr3: SYSTYPE= -DSYSVR3
  72. X#    SysVr4: SYSTYPE= -DSYSVR4    /* Solaris 2.0 too! */
  73. X#    XENIX:    SYSTYPE=         /* let the compiler do it, please! */
  74. X#    AIX:    SYSTYPE=         /* let the compiler do it, please! */
  75. X#   any P1003.1:SYSTYPE= -D_POSIX_SOURCE    /* may combine with above */
  76. X#
  77. XSYSTYPE        = -DSYSVR3
  78. X
  79. X# NOTE:  you'll have to define DUMB_VOID if your compiler doesn't fully
  80. X# understand the 'void' keyword.  (The most common error indicating this
  81. X# symptom is "operands of ':' have incompatible types" for invocations of
  82. X# the lst_top()/lst_bottom() macros.)  If your compiler doesn't understand
  83. X# 'void' at all, then you should also define REDEF_VOID.
  84. X#
  85. X#DEFS = $(SYSTYPE) -DDUMB_VOID
  86. X#DEFS = $(SYSTYPE) -DDUMB_VOID -DREDEF_VOID
  87. X#
  88. X# If your system has <stdlib.h>, but your compiler isn't ANSI-C
  89. X#    add -DUSE_STDLIB
  90. X# If your compiler is ANSI-C, and you want <malloc.h>,
  91. X#    add -DUSE_MALLOC
  92. X# If your system has <stddef.h>, but isn't ANSI-C (or POSIX),
  93. X#    add -DUSE_STDDEF
  94. X# If your compiler is almost ANSI-C, but doesn't have (__STDC__ == 1),
  95. X#    add -DREALSTDC=1 [(or -D__STDC__=1), BUT -- BE CAREFUL!]
  96. X# If your system is POSIX 1003.1 compliant,
  97. X#    add -D_POSIX_SOURCE
  98. X# If your system has <malloc.h>, but your compiler isn't ANSI-C,
  99. X#    add -DUSE_MALLOC [and perhaps include -lmalloc in LIBS]
  100. X# If your system has <stdarg.h>, but your compiler isn't (ANSI-C && BSD),
  101. X#    add -DUSE_STDARGS [and you'll likely also need -DUSE_PROTOTYPES]
  102. X# If your compiler understands prototypes, but isn't ANSI-C,
  103. X#    add -DUSE_PROTOTYPES
  104. X# If your compiler doesn't understand prototypes for pointers to functions,
  105. X#    add -DNO_PTRPROTO
  106. X# If your compiler has old-style support (V7) for 'void', and isn't ANSI-C
  107. X#    add -DDUMB_VOID
  108. X# If your compiler doesn't understand 'void' at all,
  109. X#    add -DREDEF_VOID
  110. X# If your compiler understands 'const', but isn't ANSI-C
  111. X#    add -DUSE_CONST
  112. X# If your compiler understands 'volatile', but isn't ANSI-C
  113. X#    add -DUSE_VOLATILE
  114. X# If your compiler understands 'signed', but isn't ANSI-C
  115. X#    add -DUSE_SIGNED
  116. X# If your compiler understands 'void *' as the universal pointer, but isn't ANSI-C
  117. X#    add -DUSE_VOIDPTR
  118. X# If your system doesn't typedef 'size_t', and <sysdefs.h> doesn't either
  119. X#    add -DNEED_SIZE_T
  120. X# If your system doesn't typedef 'wchar_t', and <sysdefs.h> doesn't either
  121. X#    add -DNEED_WCHAR_T
  122. X# If your system doesn't typedef 'ptrdiff_t', and <sysdefs.h> doesn't either
  123. X#    add -DNEED_PTRDIFF_T
  124. X#
  125. XDEFS = $(SYSTYPE)
  126. X
  127. X# Use -lc_s if your system supports AT&T shared libraries.
  128. X# Use -lmalloc if your libc(malloc.o) is ancient.  [see -DUSE_MALLOC above]
  129. X#
  130. X#LIBS = -ldlst
  131. X#LIBS = -ldlst -lmalloc
  132. X#LIBS = -ldlst -lc_s
  133. X#LIBS = -ldlst -lmalloc -lc_s
  134. X#
  135. XLIBS = -ldlst -lmalloc -lc_s
  136. X
  137. X# BSD derivatives might need strtok() & getopt()
  138. X#BSDOBJS = strtok.o getopt.o
  139. X
  140. X# Use 'make DEBUG=-DDEBUG' to compile in debugging code.
  141. X# Use 'make DEBUG=-DNDEBUG' to turn off assert()s.
  142. X#
  143. XDEBUG = 
  144. X
  145. X# Use 'make OPTIM= SDB=-g' to build for a symbolic debugger.
  146. X#
  147. XOPTIM = -O
  148. XSDB = 
  149. X
  150. XCFLAGS = $(OPTIM) $(SDB) -I$(INCDIR) $(DEBUG) $(DEFS)
  151. XLDFLAGS = -L$(LIBDIR)
  152. X
  153. X# Another sample:
  154. X#
  155. X#CFLAGS = $(OPTIM) $(SDB) -I$(LOCAL)/include $(DEBUG) $(DEFS) -pipe -ansi \
  156. X#    -Wall -Wshadow -Wpointer-arith -Wcast-qual -Wwrite-strings \
  157. X#    -Dscanf=DONT_USE_SCANF -Dgets=DONT_USE_GETS
  158. X#CC = gcc
  159. X#LIBS = -ldlst
  160. X
  161. X#
  162. X#    The rest should be OK.
  163. X#
  164. X
  165. XPROG = uutraf
  166. X
  167. XOBJECTS = uutraf.o version.o $(BSDOBJS)
  168. XSOURCES = uutraf.c version.c pdstrtok.c
  169. XINCLUDES = uutraf.h version.h patchlevel.h
  170. XOTHER = README Makefile-dist CREDITS defs.h-dist CHANGES RELEASES Letter Letter-1.2
  171. XDOCS = uutraf.1
  172. XOTHERSTUFF = $(OTHER) $(DOC)
  173. X
  174. X.PRECIOUS:    $(OTHERSTUFF)
  175. X
  176. X# for building distributions only!!!!
  177. X#
  178. XDLSTDIR = ../lib/dlst
  179. XDLST = $(DLSTDIR)/dlst.shar
  180. XEXTERN_HDRS = ../head/sccsid.h ../head/sysdefs.h ../head/libc.h ../head/str.h \
  181. X    ../head/extern.h ../head/intern.h
  182. XEXTERN_SRCS = ../lib/pdlibc/getopt.c ../../ucblib/string/strtok.c
  183. XEXTERN_STUFF = $(EXTERN_SRCS) $(EXTERN_HDRS)
  184. XEXTSHARS = externhdr.shar externsrc.shar $(DLST)
  185. X
  186. XFILES = $(DOCS) $(INCLUDES) $(SOURCES) $(OTHER) $(EXTSHARS)
  187. X
  188. Xdefault: $(PROG)
  189. X
  190. Xall: $(PROG)
  191. X
  192. X$(PROG): $(OBJECTS)
  193. X    $(CC) $(CFLAGS) $(LDFLAGS) $(OBJECTS) -o $@ $(LIBS)
  194. X
  195. Xuutraf.o: uutraf.h defs.h version.h
  196. X
  197. Xversion.o: version.h patchlevel.h
  198. X
  199. Xdefs.h: defs.h-dist
  200. X    @echo "Copy defs.h-dist to defs.h and edit to suit." ; exit 1
  201. X
  202. Xinstall: all
  203. X    cp $(PROG) $(BINDIR)/$(PROG)
  204. X    chmod 755 $(BINDIR)/$(PROG)
  205. X    cp uutraf.1 $(MANDIR)/$(PROG).$(MANEXT)
  206. X
  207. Xclean:
  208. X    rm -f $(OBJECTS) core
  209. X
  210. Xclobber: clean clean-ext-shars
  211. X    rm -f $(PROG)
  212. X
  213. Xshar:    $(PROG).shar clean-dlst-dist
  214. X
  215. Xclean-ext-shars:
  216. X    rm -f $(EXTSHARS)
  217. X
  218. Xsimple-dist:    Makefile-dist $(PROG).shar clean-dlst-dist clean-ext-shars
  219. X
  220. X# using 'make dist' prevents ever applying official patches to Makefile-dist...
  221. X#
  222. XMakefile-dist:    Makefile
  223. X    @echo "'cp Makefile Makefile-dist'  Are you sure? [<DEL> to abort] \c"; read junk
  224. X    rm -f Makefile-dist
  225. X    cp Makefile Makefile-dist
  226. X
  227. X$(PROG).shar: $(OTHER) $(DOCS) $(INCLUDES) $(SOURCES) $(EXTSHARS)
  228. X    ( sed -e '/^TO COMPILE$$/,/^#ident/d' README ; \
  229. X      shar -b -t 'NOTE:  contains dlst library sources shar.  Read the README!' \
  230. X        $(OTHER) $(DOCS) $(INCLUDES) $(SOURCES) $(EXTSHARS) ; \
  231. X    ) > $(PROG).shar
  232. X
  233. X$(DLST):
  234. X    cd $(DLSTDIR); $(MAKE) -$(MAKEFLAGS) shar
  235. X
  236. Xclean-dlst-dist:
  237. X    cd $(DLSTDIR); $(MAKE) -$(MAKEFLAGS) cleandist
  238. X
  239. Xecho:
  240. X        @echo Makefile defs.h $(INCLUDES) $(SOURCES)
  241. X
  242. Xechoall:
  243. X        @echo $(FILES)
  244. X
  245. Xexternhdr.shar:    $(EXTERN_HDRS)
  246. X        shar -b -t 'Put these in your local include directory.' $(EXTERN_HDRS) > $@
  247. X
  248. Xexternsrc.shar:    $(EXTERN_SRCS)
  249. X        shar -b -t 'Modules for libfake...' $(EXTERN_SRCS) > $@
  250. X
  251. XADMIN        = sccs enter
  252. XADMINFLAGS    = -fb -ftuutraf -fqwoods
  253. XVCSDIR        = SCCS
  254. X
  255. X# I'll only ever use this once, but you can use it for each major
  256. X# release to start over your local change monitoring
  257. X#
  258. X# WARNING: this is a first hack
  259. X#
  260. Xmksccs:
  261. X        -mkdir $(VCSDIR)
  262. X        $(ADMIN) $(ADMINFLAGS) $(OTHERSTUFF) $(INCLUDES) $(SOURCES)
  263. X
  264. X# You can probably do this kind of stuff with RCS too....
  265. X#
  266. XCHANGEFORMAT    = -d":Z::Y:\::M:\t:Dt:\t(:Q:)\n\t:C:"
  267. XPRS        = prs
  268. XPRSFLAGS    = -l
  269. XRELEASEFORMAT    = date '+%y/%m/%d-%T'
  270. XPATCHFORMAT    = date '+%y%m%d'
  271. XVEDITING    = sccs tell
  272. X
  273. X# Create an actual "release" by updating RELEASES and CHANGES.  A release is
  274. X# defined as any change in patchlevel.h, followed by 'make dist'.
  275. X#
  276. XCHANGES:    patchlevel.h
  277. X        @if [ -n "`$(VEDITING)`" ] ; then echo "Checked out for editing: `$(VEDITING)`"; exit 1; fi
  278. X        @echo '-------------------------------------------------------------------------------' > /tmp/uutraf.$@
  279. X        -$(PRS) $(PRSFLAGS) -c`tail -1 RELEASES` $(CHANGEFORMAT) $(VCSDIR) >> /tmp/uutraf.$@
  280. X        echo '----' >> /tmp/uutraf.$@ ; echo '' >> /tmp/uutraf.$@
  281. X        $(RELEASEFORMAT) >> RELEASES
  282. X        echo "Changes for Release dated:  `tail -1 RELEASES`" | cat - /tmp/uutraf.$@ $@ > $@.new
  283. X        mv -f $@.new $@
  284. X        @rm -f /tmp/uutraf.$@
  285. X        @-chmod -w $@
  286. X
  287. XGET        = sccs get
  288. XDIFF        = diff
  289. XDIFFFLAGS    = -c
  290. X
  291. X# Make a Patch file for changes since the most recent release.
  292. X#
  293. X# WARNING: this is a first hack.  A patch is always made from the most recent
  294. X# full release.  Sequential patches must be interspersed with "fake" releases.
  295. X#
  296. X# Both this, and probably the update of CHANGES (above) should be done in
  297. X# a separate script.
  298. X#
  299. X# NOTE: This can be called at any time without doing a full release.
  300. X#
  301. X# ALSO: Does not update CHANGES.
  302. X#
  303. XPatch:        patchlevel.h
  304. X        @if [ -n "`sccs tell`" ] ; then echo "Do your deltas [make mass-delta]! (`sccs tell`)" ; exit 1 ; fi
  305. X        echo "Patch-Creation-Date: `$(RELEASEFORMAT)`" > $@
  306. X        @: remainder must be one command line, and must append to $@
  307. X        tdir=/tmp/pgen.$$$$ ; \
  308. X        mkdir $$tdir ; \
  309. X        oldver=`tail -1 RELEASES` ; \
  310. X        echo "Changes-Since: $$oldver" >> $@ ; \
  311. X        for mod in `prs -d:M: $(VCSDIR)` ; do \
  312. X            $(GET) -s -p -c$$oldver $$mod > $$tdir/$$mod ; \
  313. X            $(DIFF) $(DIFFFLAGS) $$tdir/$$mod $$mod > $$tdir/diff.out ; \
  314. X            if [ -s $$tdir/diff.out ] ; then \
  315. X                echo "" ; \
  316. X                echo "Index: $$mod" ; \
  317. X                echo "Prereq: `prs -e -c$$oldver -d:I: $$mod`" ; \
  318. X                cat $$tdir/diff.out ; \
  319. X            fi >> $@ ; \
  320. X        done
  321. X        @echo "You should try the patch against $$tdir"
  322. X
  323. X# build a distribution shar set using makekit (from Rich Salz's cshar)
  324. X#
  325. Xdist:        $(PROG).dist clean-dlst-dist clean-ext-shars
  326. X
  327. X$(PROG).dist:    DIST MANIFEST
  328. X        @if [ ! -d DIST ] ; then mkdir DIST ; else rm -i DIST/* ; fi
  329. X        makekit -n./DIST/Part. -m -t'Please read the file README first'
  330. X        touch $(PROG).dist
  331. X
  332. XDIST:
  333. X        -mkdir $@
  334. X
  335. X# building a manifest for makekit requires all other files in the "release"
  336. X# to be ready and up-to-date.  we hide the actual first-stage run of makekit,
  337. X# as it is both boring and has a very long command line.
  338. X#
  339. X# NOTE: this precludes editing of the file MANIFEST (for silly things like
  340. X#    including more descriptive comments...
  341. X#
  342. XMANIFEST:    CHANGES Makefile-dist defs.h-dist $(EXTSHARS)
  343. X        @-rm -f $@
  344. X        @-rm -f makekit.in
  345. X        @echo $(FILES) | tr '\040' '\012' > makekit.in
  346. X        makekit -x -n./DIST/Part. < makekit.in > $@
  347. X        @-rm -f makekit.in
  348. X
  349. Xtest-MANIFEST:
  350. X        -rm -f makekit.in
  351. X        echo $(FILES) | tr '\040' '\012' > makekit.in
  352. X        makekit -x -n./DIST/Part. < makekit.in > $@
  353. END_OF_FILE
  354. if test 10227 -ne `wc -c <'Makefile-dist'`; then
  355.     echo shar: \"'Makefile-dist'\" unpacked with wrong size!
  356. fi
  357. # end of 'Makefile-dist'
  358. fi
  359. if test -f 'externhdr.shar' -a "${1}" != "-c" ; then 
  360.   echo shar: Will not clobber existing file \"'externhdr.shar'\"
  361. else
  362. echo shar: Extracting \"'externhdr.shar'\" \(24610 characters\)
  363. sed "s/^X//" >'externhdr.shar' <<'END_OF_FILE'
  364. X#! /bin/sh
  365. X# This is a shell archive.  Remove anything before this line, then unpack
  366. X# it by saving it into a file and typing "sh file".  To overwrite existing
  367. X# files, type "sh file -c".  You can also feed this as standard input via
  368. X# unshar, or by typing "sh <file", e.g..  If this archive is complete, you
  369. X# will see the following message at the end:
  370. X#        "End of shell archive."
  371. X# Contents:  sccsid.h sysdefs.h libc.h str.h extern.h intern.h
  372. X# Wrapped by woods@robohack on Sun Nov  8 16:36:45 1992
  373. XPATH=/bin:/usr/bin:/usr/ucb ; export PATH
  374. Xif test -f 'sccsid.h' -a "${1}" != "-c" ; then 
  375. X  echo shar: Will not clobber existing file \"'sccsid.h'\"
  376. Xelse
  377. Xecho shar: Extracting \"'sccsid.h'\" \(2526 characters\)
  378. Xsed "s/^X//" >'sccsid.h' <<'END_OF_FILE'
  379. XX/*
  380. XX *    sccsid.h - handle various incantations for SID's
  381. XX *
  382. XX * #ident "@(#)head:sccsid.h    1.3    92/10/09 23:39:52 (woods)"
  383. XX *
  384. XX *
  385. XX * USE (as the very first statements in a C source module w/out '\'s):
  386. XX *
  387. XX *    #define SID    "%Z\%%Y\%:%M\%    %I\%    %E\% %U\% (%Q\%)"
  388. XX *    #include "sccsid.h"
  389. XX *
  390. XX * USE (as the very first statement in a C header module w/out '\'s):
  391. XX *
  392. XX *    #define SID_NM    module_sccsid    * the full name of the static array *
  393. XX *    #define SID_H    "%Z\%%Y\%:%M\%    %I\%    %E\% %U\% (%Q\%)"
  394. XX *    #include "sccsid.h"
  395. XX *
  396. XX * [Use tab characters around the '%I\%'.]
  397. XX *
  398. XX * NOTE:  assumes SYSVR3 or SYSVR4 or SMART_CPP will be defined on the
  399. XX *      compiler command line if appropriate.
  400. XX *
  401. XX * WARNING:  as a side-effect, this file define's and undef's
  402. XX *         both SMART_CPP and MYconst
  403. XX */
  404. XX
  405. XX#if !defined(_AIX) && (defined(SYSVR3) || defined(SYSVR4))
  406. XX# define SMART_CPP
  407. XX# define SMART_IDENT
  408. XX#endif
  409. XX
  410. XX#if defined(SYSVR2)    /* You might want this, but it's usually a no-op. */
  411. XX/*# define SMART_CPP        /* use this if your compiler has #sccs */
  412. XX/*# define SMART_SCCS        /* you must also uncomment '#sccs' lines below */
  413. XX#endif
  414. XX
  415. XX#if defined(__STDC__) && (__STDC__ > 0)
  416. XX# define MYconst    const
  417. XX#else
  418. XX# define MYconst    /* no_op */
  419. XX#endif
  420. XX
  421. XX#ifdef SMART_CPP
  422. XX
  423. XX# ifdef SID
  424. XX#  ifdef SMART_IDENT
  425. XX#   ident    SID    /* comment this out if your cpp blows up */
  426. XX#  endif
  427. XX#  ifdef SMART_SCCS
  428. XX#   include "You must uncomment the #sccs lines for SMART_SCCS to work!"
  429. XX/*#   sccs    SID    /* comment the above line if you uncomment this one */
  430. XX#  endif
  431. XX#  undef SID
  432. XX# else
  433. XX#  ifdef SID_H
  434. XX#   ifdef SID_NM
  435. XX#    ifdef SMART_IDENT
  436. XX#     ident    SID_H    /* unset SMART_CPP if your compiler blows up */
  437. XX#    endif
  438. XX#    ifdef SMART_SCCS
  439. XX#     include "You must uncomment the #sccs lines for SMART_SCCS to work!"
  440. XX/*#     sccs    SID_H    /* comment the above line if you uncomment this one */
  441. XX#    endif
  442. XX#    undef SID_NM
  443. XX#    undef SID_H
  444. XX#   else
  445. XX#    include    "ERROR: you must define SID_NM to use SID_H"
  446. XX#   endif
  447. XX#  else
  448. XX#   include    "ERROR: you must define either SID or SID_H to use sccsid.h"
  449. XX#  endif
  450. XX# endif
  451. XX
  452. XX#else /* !SMART_CPP */
  453. XX
  454. XX# if !(defined(lint) || defined(M_LINT)) || defined(DEBUG)
  455. XX#  ifdef SID
  456. XXstatic MYconst char    sccsid[] = SID;
  457. XX#   undef SID
  458. XX#  else
  459. XX#   ifdef SID_H
  460. XX#    ifdef SID_NM
  461. XXstatic MYconst char    SID_NM[] = SID_H;
  462. XX#     undef SID_NM
  463. XX#     undef SID_H
  464. XX#    else
  465. XX#     include    "ERROR: you must define SID_NM to use SID_H"
  466. XX#    endif
  467. XX#   else
  468. XX#    include    "ERROR: you must define either SID or SID_H to use sccsid.h"
  469. XX#   endif
  470. XX#  endif
  471. XX# endif
  472. XX
  473. XX#endif
  474. XX
  475. XX#undef MYconst
  476. XX#undef SMART_CPP
  477. XEND_OF_FILE
  478. Xif test 2526 -ne `wc -c <'sccsid.h'`; then
  479. X    echo shar: \"'sccsid.h'\" unpacked with wrong size!
  480. Xfi
  481. X# end of 'sccsid.h'
  482. Xfi
  483. Xif test -f 'sysdefs.h' -a "${1}" != "-c" ; then 
  484. X  echo shar: Will not clobber existing file \"'sysdefs.h'\"
  485. Xelse
  486. Xecho shar: Extracting \"'sysdefs.h'\" \(9731 characters\)
  487. Xsed "s/^X//" >'sysdefs.h' <<'END_OF_FILE'
  488. XX/*
  489. XX *    sysdefs.h - Configuration options header file.
  490. XX */
  491. XX
  492. XX#define SID_H    "@(#)head:sysdefs.h    1.3    92/10/03 20:34:24 (woods)"
  493. XX#define SID_NM    sysdefs_sccsid
  494. XX#include <sccsid.h>
  495. XX
  496. XX/*
  497. XX * This file defines a few things such as a base system environment
  498. XX * (BSD/SYSV), and includes some support for ANSI Standard C.  It is, in some
  499. XX * ways, analogous to the ANSI-C <stddef.h> header.  It also defines some
  500. XX * common system data types that may be missing on some platforms.  It is
  501. XX * intended to be included first, and to be followed at some point by
  502. XX * <libc.h>.
  503. XX */
  504. XX
  505. XX/*
  506. XX * NOTE:  In general you will not have to edit this file.  Custom features
  507. XX * should be enabled via command-line defines if necessary (eg. -DDUMB_VOID).
  508. XX */
  509. XX
  510. XX/*
  511. XX * WARNING:  This file uses '\' to continue '#if' lines
  512. XX */
  513. XX
  514. XX/*
  515. XX * Determine if really ANSI C
  516. XX */
  517. XX#if defined(__STDC__) && !defined(REALSTDC)
  518. XX# if (__STDC__ - 0) > 0
  519. XX#  define REALSTDC        1
  520. XX#  ifndef USE_PROTOTYPES
  521. XX#    define USE_PROTOTYPES    1    /* see use of this below */
  522. XX#  endif
  523. XX# else
  524. XX#  define REALSTDC        0
  525. XX# endif
  526. XX#else
  527. XX# define REALSTDC        0
  528. XX#endif
  529. XX
  530. XX/*
  531. XX * some compilers bitch about using 'extern' for "forward" references
  532. XX */
  533. XX#if REALSTDC
  534. XX# define forward    /* implicit */
  535. XX#else
  536. XX# define forward    extern
  537. XX#endif
  538. XX#ifndef private
  539. XX# define private    static
  540. XX#endif
  541. XX
  542. XX/*
  543. XX * Some automated feature detection partially ripped out of JOVE 4.x
  544. XX */
  545. XX
  546. XX#if defined(ultrix) || defined(__ultrix__)
  547. XX# define ULTRIX
  548. XX# ifndef BSD4_2
  549. XX#  define BSD4_2    1    /* True enough for our purposes */
  550. XX# endif
  551. XX#endif
  552. XX
  553. XX#if (defined(sun) || defined(__sun__)) /* && !defined(SUNOS5) */
  554. XX# define SUN
  555. XX# ifndef BSD4_2
  556. XX#  define BSD4_2    1    /* True enough for our purposes */
  557. XX# endif
  558. XX#endif
  559. XX
  560. XX#if defined(mips) || defined(__mips__)
  561. XX# define MIPS
  562. XX# ifndef SYSVR3
  563. XX#  define SYSVR3    1
  564. XX# endif
  565. XX#endif
  566. XX
  567. XX/* M_XENIX is defined by the Compiler */
  568. XX
  569. XX/* SYSV should be defined for AT&T UNIX System V systems */
  570. XX
  571. XX#ifdef SYSVR4
  572. XX# ifndef SYSVR3
  573. XX#  define SYSVR3    1    /* SYSVR3 is a subset of SYSVR4 */
  574. XX# endif
  575. XX#endif
  576. XX#ifdef SYSVR3
  577. XX# ifndef SYSVR2
  578. XX#  define SYSVR2    1    /* SYSVR2 is a subset of SYSVR3 */
  579. XX# endif
  580. XX#endif
  581. XX#ifdef SYSVR2
  582. XX# ifndef SYSV
  583. XX#  define SYSV        1    /* SYSV is a subset of SYSVR2 */
  584. XX# endif
  585. XX#endif
  586. XX#ifdef SYSVR1
  587. XX# ifndef SYSV
  588. XX#  define SYSV        1    /* SYSVR1 is SYSV! */
  589. XX# endif
  590. XX#endif
  591. XX
  592. XX#ifdef BSD4_1
  593. XX# ifndef BSD
  594. XX#  define BSD    1
  595. XX# endif
  596. XX#endif
  597. XX#ifdef BSD4_2
  598. XX# ifndef BSD
  599. XX#  define BSD    1
  600. XX# endif
  601. XX#endif
  602. XX#ifdef BSD4_3
  603. XX# ifndef BSD
  604. XX#  define BSD    1
  605. XX# endif
  606. XX#endif
  607. XX
  608. XX#ifdef BSD2_8
  609. XX# ifndef BSD
  610. XX#  define BSD    1
  611. XX# endif
  612. XX#endif
  613. XX#ifdef BSD2_9
  614. XX# ifndef BSD
  615. XX#  define BSD    1
  616. XX# endif
  617. XX#endif
  618. XX#ifdef BSD2_10
  619. XX# ifndef BSD
  620. XX#  define BSD    1
  621. XX# endif
  622. XX#endif
  623. XX
  624. XX#if defined(BSD) || defined(V7) || defined(SYSIII) /* || defined(M_XENIX) 2.3 */
  625. XX# ifndef strchr
  626. XX#  define strchr    index
  627. XX# endif
  628. XX# ifndef strrchr
  629. XX#  define strrchr    rindex
  630. XX# endif
  631. XX#endif
  632. XX
  633. XX#ifdef SYSV
  634. XX# ifndef HAVE_UNAME
  635. XX#  define HAVE_UNAME    1
  636. XX# endif
  637. XX#endif
  638. XX
  639. XX#if !defined(SYSV) && !defined(M_XENIX) && \
  640. XX    !defined(_POSIX_SOURCE) && !defined(_XOPEN_SOURCE)
  641. XX# define NEED_LOCKF    1
  642. XX#endif
  643. XX
  644. XX/*
  645. XX * Legend says the old Microsoft mc68k C compiler (for XENIX/68000, and
  646. XX * probably originally written by UniSoft) "noticed" if the code defined
  647. XX * 'VOID' and suddenly supported the 'void' keyword, in which case constructs
  648. XX * like the following may cause syntax errors or other weird behavior.
  649. XX * (Personally I thought it was M_VOID that triggered this behavior.)
  650. XX *
  651. XX * NOTE:  we don't use a typedef here.
  652. XX *
  653. XX * NOTE:  See 'UnivPtr' below too!
  654. XX */
  655. XX#ifndef DUMB_VOID
  656. XX# ifndef VOID
  657. XX#  define VOID    void    /* 'VOID' is used where half-baked compilers fail */
  658. XX# endif
  659. XX#else
  660. XX# undef VOID
  661. XX# define VOID    int
  662. XX# if defined(REDEF_VOID) && !defined(void)
  663. XX#  define void    int    /* Even Ritchie's V7 cc supported 'void'.... */
  664. XX# endif
  665. XX#endif
  666. XX
  667. XX/*
  668. XX * proto: macro to allow us to prototype any function declaration without
  669. XX * upsetting old compilers.  Use it like this:
  670. XX *
  671. XX *    extern int    myfun proto(int arg1, char *arg2);
  672. XX *    extern int    (*ptrtofun) ptrproto(void);
  673. XX *    extern char    *morefun proto((char *(*proc) ptrproto((const char *))));
  674. XX *    pattern = myproc("howdy", (int (*) ptrproto((int))) NULL, (char *) NULL);
  675. XX *
  676. XX * If you define this you'll likely need USE_STDARGS too.
  677. XX */
  678. XX#if (REALSTDC == 1) || defined(USE_PROTOTYPES)
  679. XX# define proto(x)        x
  680. XX# ifdef    NO_PTRPROTO
  681. XX   /* on these systems, a prototype cannot be used for a pointer to function */
  682. XX#  define ptrproto(x)        ()
  683. XX# else
  684. XX#  define ptrproto(x)        x
  685. XX# endif
  686. XX#else
  687. XX# define proto(x)        ()
  688. XX# define ptrproto(x)        ()
  689. XX#endif
  690. XX
  691. XX/*
  692. XX * There are two ways to handle functions with a variable number of args.
  693. XX * The old portable way uses <varargs.h>.  The way sanctioned by ANSI X3J11
  694. XX * uses <stdarg.h>.  Unfortunately they are not compatible....  Note also
  695. XX * that if you define this you'll probably need USE_PROTOTYPES too.
  696. XX */
  697. XX#if (REALSTDC == 1) || defined(USE_STDARGS)
  698. XX# ifndef USE_STDARGS
  699. XX#  define USE_STDARGS        1
  700. XX# endif
  701. XX# define va_init(ap, parmN)    { va_start((ap), (parmN)); }
  702. XX#else
  703. XX# define va_init(ap, parmN)    { va_start((ap)); }
  704. XX#endif
  705. XX
  706. XX/*
  707. XX * 'const': readonly type qualifier (use may break some pre-ANSI compilers!)
  708. XX */
  709. XX#if (REALSTDC == 0) && !defined(USE_CONST)
  710. XX# define const        /* Only in ANSI C.  Pity */
  711. XX#endif
  712. XX
  713. XX/*
  714. XX * 'volatile':  type qualifier indicating one of two kinds of magic:
  715. XX *
  716. XX * 1. This object may be modified by an event unknown to the implementation
  717. XX *    (eg. asynchronous signal or memory-mapped I/O device).
  718. XX *
  719. XX * 2. This automatic variable might be modified between a setjmp()
  720. XX *    and a longjmp(), and we wish it to have the correct value after
  721. XX *    the longjmp().  This second meaning is an X3J11 abomination.
  722. XX */
  723. XX#if (REALSTDC == 0) && !defined(USE_VOLATILE)
  724. XX# define volatile    /* also only in ANSI C.  Oh well. */
  725. XX#endif
  726. XX
  727. XX/*
  728. XX * 'signed': converse of 'unsigned'
  729. XX */
  730. XX#if (REALSTDC == 0) && !defined(USE_SIGNED)
  731. XX# define signed        /* bye-bye! */
  732. XX#endif
  733. XX
  734. XX/*
  735. XX * UnivPtr: universal pointer type
  736. XX */
  737. XX#if (REALSTDC == 1) || defined(USE_VOIDPTR)
  738. XXtypedef void        Univ;
  739. XXtypedef void        *UnivPtr;
  740. XXtypedef const void    *UnivConstPtr;    /* object is "constant" */
  741. XXtypedef void * const    UnivPtrConst;    /* pointer is "constant" */
  742. XX#else
  743. XXtypedef char        Univ;
  744. XXtypedef char        *UnivPtr;
  745. XXtypedef const char    *UnivConstPtr;    /* object is "constant" */
  746. XXtypedef char * const    UnivPtrConst;    /* pointer is "constant" */
  747. XX#endif
  748. XX
  749. XX/*
  750. XX * According to the ANSI standard for C, any library routine may
  751. XX * be defined as a macro with parameters.  In order to prevent
  752. XX * the expansion of this macro in a declaration of the routine,
  753. XX * ANSI suggests parenthesizing the identifier.  This is a reasonable
  754. XX * and legal approach, even for K&R C.
  755. XX *
  756. XX * A bug in the MIPS compiler used on MIPS, IRIS, and probably other
  757. XX * MIPS R[23]000 based systems, causes the compiler to reject
  758. XX * these declarations (at least at the current time, 1989 August).
  759. XX * To avoid this bug, we conditionally define and use UNMACRO.
  760. XX */
  761. XX#if defined(MIPS) /* || defined(IRIS) || defined(NEC) */
  762. XX# define UNMACRO(proc)    proc
  763. XX#else
  764. XX# define UNMACRO(proc)    (proc)
  765. XX#endif
  766. XX
  767. XX/*
  768. XX * This is a bit tricky.  Often, when compiling on a POSIX compatible system,
  769. XX * one will *not* want to define _POSIX_SOURCE.  However, not doing so does
  770. XX * not remove the typedefs from the system headers.  Perhaps the opposite
  771. XX * logic should be used, and these should be defined *only* for those system
  772. XX * variants that need them....  The problem being that some compilers get
  773. XX * right upset if you try and re-typedef something, even if to the exact same
  774. XX * fundamental type.  NOTE:  some are ushort, some ulong or long.
  775. XX */
  776. XX#if !defined(SYSVR4) && !defined(_AIX) && \
  777. XX    !defined(_POSIX_SOURCE) && !defined(_XOPEN_SOURCE)
  778. XX# ifdef V7
  779. XXtypedef int        uid_t;
  780. XXtypedef int        gid_t;
  781. XX# else
  782. XX#  ifdef M_XENIX
  783. XXtypedef unsigned short    uid_t;
  784. XXtypedef unsigned short    gid_t;
  785. XX#  else
  786. XXtypedef unsigned int    uid_t;
  787. XXtypedef unsigned int    gid_t;
  788. XX#  endif
  789. XX# endif
  790. XX#endif
  791. XX
  792. XX/*
  793. XX * size_t is required for at least for att-3b1 (defined(u3b)) and most M_XENIX
  794. XX */
  795. XX#if !defined(_SIZE_T) && defined(NEED_SIZE_T) || ((REALSTDC == 0) && \
  796. XX    !defined(SYSVR2) && !defined(SYSVR3) && !defined(SYSVR4) && \
  797. XX    !defined(_POSIX_SOURCE) && !defined(_XOPEN_SOURCE))
  798. XX# define _SIZE_T    1        /* _AIX only? */
  799. XXtypedef unsigned int    size_t;        /* int on some, ulong on some? */
  800. XX#endif
  801. XX
  802. XX/*
  803. XX * 8-bit type & 16-bit macros to avoid sign problems
  804. XX */
  805. XX#ifndef NO_BYTE
  806. XX# if defined(V7) || defined(M_XENIX) || defined(BSD2_8)
  807. XXtypedef char        byte;    /* WARNING: machine dependent! */
  808. XX#  define BYTE(x)    ((x) && 0xff)
  809. XX# else
  810. XXtypedef unsigned char    byte;    /* WARNING: machine dependent! */
  811. XX#  define BYTE(x)    (x)
  812. XX# endif
  813. XX# define HIBYTE(x)    (((x) >> 8) & 0xff)    /* hi byte of short */
  814. XX# define LOBYTE(x)    ((x) & 0xff)        /* lo byte of short */
  815. XX# define HIWORD(x)    (((x) >> 16) & 0xffffL)    /* hi 16-bits of long */
  816. XX# define LOWORD(x)    ((x) & 0xffffL)        /* lo 16-bits of long */
  817. XX# define CHAR(x)    ((x) & 0x7f)
  818. XX# define WORD(x)    ((x) & 0xffffL)        /* i.e. 16-bit word */
  819. XX#endif
  820. XX
  821. XX/*
  822. XX * more ANSI-C types more properly found in <stddef.h>
  823. XX */
  824. XX#if !defined(_WCHAR_T) && (defined(NEED_WCHAR_T) || (!defined(REALSTDC)))
  825. XX# define _WCHAR_T    1        /* _AIX only? */
  826. XXtypedef unsigned short    wchar_t;
  827. XX#endif
  828. XX#if !defined(_PTRDIFF_T) && (defined(NEED_PTRDIFF_T) || (!defined(REALSTDC)))
  829. XX# define _PTRDIFF_T    1        /* _AIX only? */
  830. XXtypedef long        ptrdiff_t;
  831. XX#endif
  832. XX
  833. XX/*
  834. XX * as Henry Spencer says, 'char *sprintf()' is stupid and archaic!
  835. XX */
  836. XX#if !defined(BSD) && (REALSTDC == 0) && !defined(NEED_VSPRINTF) && \
  837. XX    !defined(_POSIX_SOURCE) && !defined(_XOPEN_SOURCE)
  838. XXtypedef int    SPRINTF_T;
  839. XX#else
  840. XXtypedef char    *SPRINTF_T;    /* WARNING: don't use this with vsprintf.shar */
  841. XX#endif
  842. XX
  843. XX/*
  844. XX * Offset of member MEMBER in a struct of type TYPE.
  845. XX *
  846. XX * WARNING:  compiler dependent!
  847. XX */
  848. XX#if !defined(offsetof) && !defined(_AIX) && !defined(_ANSI_C_SOURCE)
  849. XX# define offsetof(TYPE, MEMBER)        ((size_t) &(((TYPE *)0)->MEMBER))
  850. XX#endif
  851. XEND_OF_FILE
  852. Xif test 9731 -ne `wc -c <'sysdefs.h'`; then
  853. X    echo shar: \"'sysdefs.h'\" unpacked with wrong size!
  854. Xfi
  855. X# end of 'sysdefs.h'
  856. Xfi
  857. Xif test -f 'libc.h' -a "${1}" != "-c" ; then 
  858. X  echo shar: Will not clobber existing file \"'libc.h'\"
  859. Xelse
  860. Xecho shar: Extracting \"'libc.h'\" \(6869 characters\)
  861. Xsed "s/^X//" >'libc.h' <<'END_OF_FILE'
  862. XX/*
  863. XX *    libc.h - support for some older libc's
  864. XX */
  865. XX
  866. XX#define SID_H    "@(#)head:libc.h    1.5    92/10/09 23:40:41 (woods)"
  867. XX#define SID_NM    libc_sccsid
  868. XX#include <sccsid.h>
  869. XX
  870. XX/*
  871. XX * DESCRIPTION:  This file defines several things that are expected to be a
  872. XX * part of the compile-time environment for a normal UNIX program.  In
  873. XX * particular, this header attempts to bend a non-POSIX (1003.1) environment
  874. XX * into some semblance of conformance.  By no means am I advocating complete
  875. XX * compliance of POSIX is a good thing -- rather it is a necessary evil!
  876. XX */
  877. XX/*
  878. XX * USAGE:  If your system is POSIX compliant, this header assumes that
  879. XX * _POSIX_SOURCE will be defined.
  880. XX */
  881. XX/*
  882. XX * NOTE:  This file must always included *AFTER* <stdio.h>, <unistd.h>,
  883. XX * <sys/stat.h>, and/or <limits.h>, if you're using either, and in fact you
  884. XX * might want to include it after *all* other includes.
  885. XX */
  886. XX/*
  887. XX * ALSO NOTE: This file should probably be preceded by "sysdefs.h"
  888. XX */
  889. XX/*
  890. XX * HISTORY:  This header is modeled after one of the same name found in the C
  891. XX * News sources written at the University of Toronto by Geoff Collyer and
  892. XX * Henry Spencer.  Greg A. Woods <woods@robohack.UUCP> has adapted it to be
  893. XX * more complete and useful as a stand-alone header.  Some of the following
  894. XX * bits have been derived from headers in many other tools, including Jove.
  895. XX */
  896. XX
  897. XX#ifndef NULL
  898. XX# define NULL    0
  899. XX#endif
  900. XX#ifndef    EOF
  901. XX# define EOF    (-1)
  902. XX#endif
  903. XX#ifndef EOS
  904. XX# define EOS    '\0'
  905. XX#endif
  906. XX
  907. XX/*
  908. XX * Yes, it's ugly to define the following things in here, but the alternative
  909. XX * is to have several copies of each clause spread around many files.
  910. XX */
  911. XX
  912. XX/*
  913. XX * this _should_ be in <limits.h>, but SYSVR2 & BSD don't have one
  914. XX */
  915. XX#ifndef PATH_MAX
  916. XX# ifdef MAXPATHLEN
  917. XX#  define PATH_MAX    MAXPATHLEN
  918. XX# else
  919. XX#  define PATH_MAX    1024
  920. XX# endif
  921. XX#endif
  922. XX#ifndef NAME_MAX
  923. XX# ifdef MAXNAMELEN
  924. XX#  define NAME_MAX    MAXNAMELEN
  925. XX# else
  926. XX#  define NAME_MAX    14
  927. XX# endif
  928. XX#endif
  929. XX
  930. XX/*
  931. XX * Symbolic constants for the "lseek" routine (should be in <unistd.h>).
  932. XX * Don't bother with the old BSD "L*" things.
  933. XX */
  934. XX#ifndef SEEK_SET
  935. XX# define SEEK_SET    0    /* Set file pointer to "offset" */
  936. XX# define SEEK_CUR    1    /* Set file pointer to current plus "offset" */
  937. XX# define SEEK_END    2    /* Set file pointer to EOF plus "offset" */
  938. XX#endif
  939. XX
  940. XX/*
  941. XX * these _should_ be in <sys/stat.h>!
  942. XX */
  943. XX#ifndef S_IRWXU
  944. XX# define S_IRWXU    00700        /* read, write, execute: owner */
  945. XX# define S_IRWXG    00070        /* read, write, execute: group */
  946. XX# define S_IRWXO    00007        /* read, write, execute: other */
  947. XX#endif
  948. XX#ifndef S_IRUSR
  949. XX# define S_IRUSR    00400        /* read permission: owner */
  950. XX# define S_IWUSR    00200        /* write permission: owner */
  951. XX# define S_IXUSR    00100        /* execute permission: owner */
  952. XX# define S_IRGRP    00040        /* read permission: group */
  953. XX# define S_IWGRP    00020        /* write permission: group */
  954. XX# define S_IROTH    00004        /* read permission: other */
  955. XX# define S_IWOTH    00002        /* write permission: other */
  956. XX# define S_IXOTH    00001        /* execute permission: other */
  957. XX#endif
  958. XX
  959. XX/*
  960. XX * signal types: tailor to suit local needs (usually 'VOID' is OK, as it will
  961. XX * be either 'void' or 'int', and most systems that support 'void' will have
  962. XX * "void (*signal)();", and 'VOID' will be 'int' otherwise.)
  963. XX */
  964. XXtypedef VOID (*sigret_t)();
  965. XXtypedef VOID (*sigarg_t)();
  966. XX
  967. XX/*
  968. XX * The SCO UNIX, Solaris 2.0, and probably others have getopt(3c)'s that are not
  969. XX * POSIX compliant.  These should be in <unistd.h>!
  970. XX */
  971. XX#if !defined(NO_GETOPT)        /* might force in getopt(3c) */
  972. XXextern int        optind;
  973. XXextern char        *optarg;
  974. XX#endif
  975. XX
  976. XX#if !REALSTDC && \
  977. XX    !defined(_POSIX_SOURCE) && !defined(XOPEN_SOURCE)
  978. XX
  979. XX/*
  980. XX * these _should_ be in other system header files....  <stdio.h>, <stdlib.h>,
  981. XX * <unistd.h>, etc.
  982. XX *
  983. XX * NOTE:  There are some in here you may not have.
  984. XX *
  985. XX * WARNING:  These are the "standard" declarations, and some "broken" systems
  986. XX * may define things a bit differently.  Hopefully a re-declaration clash
  987. XX * will make this obvious!
  988. XX */
  989. XX
  990. XXextern int        errno;        /* always(?) in <errno.h> */
  991. XX
  992. XXextern SPRINTF_T    sprintf();
  993. XX
  994. XXextern sigret_t        signal();
  995. XX
  996. XXextern void        exit();
  997. XXextern void        _exit();
  998. XX
  999. XXextern void        abort();
  1000. XXextern void        _assert();
  1001. XXextern void        longjmp();
  1002. XX
  1003. XXextern char        *crypt();
  1004. XXextern void        setkey();
  1005. XXextern void        encrypt();
  1006. XX
  1007. XXextern void        monitor();
  1008. XXextern void        profil();
  1009. XX
  1010. XX#ifndef M_UNIX    /* on SCO, it's a macro! */
  1011. XXextern char        *strerror();
  1012. XX#endif /* M_UNIX */
  1013. XX
  1014. XXextern unsigned int    sleep();
  1015. XX
  1016. XXextern time_t        time();
  1017. XXextern struct tm    *gmtime();
  1018. XXextern char        *ctime();
  1019. XX
  1020. XXextern struct passwd    *getpwent();
  1021. XXextern struct passwd    *getpwuid();
  1022. XXextern struct passwd    *getpwnam();
  1023. XXextern void        setpwent();
  1024. XXextern void        endpwent();
  1025. XXextern struct passwd    *fgetpwent();
  1026. XX
  1027. XXextern struct group    *getgrent();
  1028. XXextern struct group    *getgrgid();
  1029. XXextern struct group    *getgrnam();
  1030. XXextern void        setgrent();
  1031. XXextern void        endgrent();
  1032. XXextern struct group    *fgetgrent();
  1033. XX
  1034. XXextern uid_t        getuid();
  1035. XXextern uid_t        geteuid();
  1036. XXextern gid_t        getgid();
  1037. XXextern gid_t        getegid();
  1038. XX
  1039. XXextern FILE        *fopen();
  1040. XXextern FILE        *freopen();
  1041. XXextern FILE        *popen();
  1042. XXextern FILE        *tmpfile();
  1043. XXextern char        *mktemp();
  1044. XXextern char        *tempnam();
  1045. XXextern char        *fgets();
  1046. XXextern char        *gets();
  1047. XXextern long        ftell();
  1048. XXextern void        setbuf();
  1049. XX#if 0
  1050. XXextern void        clearerr();    /* a macro in most <stdio.h>! */
  1051. XX#endif
  1052. XXextern void        rewind();
  1053. XXextern void        perror();
  1054. XX
  1055. XXextern char        *getenv();
  1056. XXextern char        *cuserid();
  1057. XX
  1058. XX#ifndef M_UNIX    /* SCO's compiler (i.e. Microsoft's) barfs on some of these */
  1059. XXextern char        *strcpy();
  1060. XXextern char        *strncpy();
  1061. XXextern char        *strcat();
  1062. XXextern char        *strncat();
  1063. XXextern char        *strchr();
  1064. XXextern char        *strrchr();
  1065. XXextern char        *strpbrk();
  1066. XXextern char        *strtok();
  1067. XXextern char        *strdup();
  1068. XXextern char        *strstr();
  1069. XX#endif /* M_UNIX */
  1070. XXextern int        strcmp();
  1071. XXextern int        strncmp();
  1072. XXextern int        strlen();
  1073. XXextern int        strspn();
  1074. XXextern int        strcspn();
  1075. XX
  1076. XX#ifndef M_UNIX    /* more SCO inconsitency */
  1077. XXextern UnivPtr        memccpy();
  1078. XXextern UnivPtr        memchr();
  1079. XXextern UnivPtr        memcpy();
  1080. XXextern UnivPtr        memmove();
  1081. XXextern UnivPtr        memset();
  1082. XX#endif /* M_UNIX */
  1083. XXextern int        memcmp();
  1084. XX
  1085. XXextern UnivPtr        bsearch();
  1086. XXextern void        qsort();
  1087. XXextern void        twalk();
  1088. XX
  1089. XXextern void        srand();
  1090. XX
  1091. XXextern void        swab();
  1092. XX
  1093. XX#ifndef USE_MALLOC
  1094. XXextern void        free();
  1095. XXextern UnivPtr        calloc();
  1096. XXextern UnivPtr        malloc();
  1097. XXextern UnivPtr        realloc();
  1098. XX#endif /* USE_MALLOC */
  1099. XX
  1100. XXextern double        atof();
  1101. XXextern long        atol();
  1102. XXextern long        labs();
  1103. XX
  1104. XXextern double        strtod();
  1105. XXextern long        strtol();
  1106. XX# if 0
  1107. XXextern unsigned long    strtoul();    /* 'unsigned long' not portable */
  1108. XX# endif
  1109. XX
  1110. XX#endif
  1111. XX
  1112. XX/*
  1113. XX * The following prototypes are esp. useful since they are stdargs-like.
  1114. XX * If they clash, please let me know!
  1115. XX */
  1116. XX#if !REALSTDC && defined(USE_PROTOTYPES)
  1117. XXextern int    printf(const char *fmt, ...);
  1118. XXextern int    fprintf(FILE *fp, const char *fmt, ...);
  1119. XXextern int    sprintf(char *buf, const char *fmt, ...);
  1120. XXextern int    scanf(const char *fmt, ...);
  1121. XXextern int    fscanf(FILE *fp, const char *fmt, ...);
  1122. XXextern int    sscanf(char *s, const char *fmt, ...);
  1123. XX#endif
  1124. XEND_OF_FILE
  1125. Xif test 6869 -ne `wc -c <'libc.h'`; then
  1126. X    echo shar: \"'libc.h'\" unpacked with wrong size!
  1127. Xfi
  1128. X# end of 'libc.h'
  1129. Xfi
  1130. Xif test -f 'str.h' -a "${1}" != "-c" ; then 
  1131. X  echo shar: Will not clobber existing file \"'str.h'\"
  1132. Xelse
  1133. Xecho shar: Extracting \"'str.h'\" \(1389 characters\)
  1134. Xsed "s/^X//" >'str.h' <<'END_OF_FILE'
  1135. XX/*
  1136. XX *    str.h
  1137. XX *
  1138. XX * some stuff borrowed from C News and elsewhere...
  1139. XX */
  1140. XX
  1141. XX#define SID_H    "@(#)head:str.h    1.2    92/04/20 09:53:14 (woods)"
  1142. XX#define SID_NM    str_sccsid
  1143. XX#include "sccsid.h"
  1144. XX
  1145. XX/*
  1146. XX *    simple in-lining for older compilers...
  1147. XX */
  1148. XX#ifndef FASTSTRCHR
  1149. XX# define STRCHR(src, chr, dest)        (dest) = strchr(src, chr)
  1150. XX#else
  1151. XX# define STRCHR(src, chr, dest) \
  1152. XX    for ((dest) = (src); *(dest) != '\0' && *(dest) != (chr); ++(dest)) \
  1153. XX        ; \
  1154. XX    if (*(dest) == '\0') \
  1155. XX        (dest) = NULL        /* N.B.: missing semi-colon */
  1156. XX#endif
  1157. XX
  1158. XX/*
  1159. XX *    more useful things...
  1160. XX */
  1161. XX
  1162. XX/*
  1163. XX * STREQ is an optimised strcmp(a,b)==0
  1164. XX */
  1165. XX#define STREQ(s1, s2)    ((s1)[0] == (s2)[0] && strcmp(s1, s2) == 0)
  1166. XX#define STRNE(s1, s2)    (!((s1)[0] == (s2)[0] && strcmp(s1, s2) == 0))
  1167. XX
  1168. XX#define STRLT(s1, s2)    (strcmp(s1, s2) < 0)
  1169. XX#define STRGT(s1, s2)    (strcmp(s1, s2) > 0)
  1170. XX#define STRLE(s1, s2)    (strcmp(s1, s2) <= 0)
  1171. XX#define STRGE(s1, s2)    (strcmp(s1, s2) >= 0)
  1172. XX
  1173. XX/*
  1174. XX * STREQN is an optimised strncmp(a,b,n)==0; assumes n > 0
  1175. XX */
  1176. XX#define STREQN(s1, s2, len)    ((s1)[0] == (s2)[0] && strncmp(s1, s2, len) == 0)
  1177. XX#define STRNEN(s1, s2, len)    (!((s1)[0] == (s2)[0] && strncmp(s1, s2, len) == 0))
  1178. XX
  1179. XX#define STRLTN(s1, s2, len)    (strncmp(s1, s2, len) < 0)
  1180. XX#define STRGTN(s1, s2, len)    (strncmp(s1, s2, len) > 0)
  1181. XX#define STRLEN(s1, s2, len)    (strncmp(s1, s2, len) <= 0)
  1182. XX#define STRGEN(s1, s2, len)    (strncmp(s1, s2, len) >= 0)
  1183. XX
  1184. XX/* see case.h for case-independent stuff */
  1185. XEND_OF_FILE
  1186. Xif test 1389 -ne `wc -c <'str.h'`; then
  1187. X    echo shar: \"'str.h'\" unpacked with wrong size!
  1188. Xfi
  1189. X# end of 'str.h'
  1190. Xfi
  1191. Xif test -f 'extern.h' -a "${1}" != "-c" ; then 
  1192. X  echo shar: Will not clobber existing file \"'extern.h'\"
  1193. Xelse
  1194. Xecho shar: Extracting \"'extern.h'\" \(311 characters\)
  1195. Xsed "s/^X//" >'extern.h' <<'END_OF_FILE'
  1196. XX/*
  1197. XX *    #include in each module referencing (declaring) global variables
  1198. XX */
  1199. XX
  1200. XX/*#define SID_H    "@(#)head:extern.h    1.1    92/04/20 00:26:48 (woods)"    /* */
  1201. XX/*#define SID_NM    extern_sccsid            /* */
  1202. XX/*#include "sccsid.h"                    /* */
  1203. XX
  1204. XX#undef EXT
  1205. XX#define EXT        extern
  1206. XX
  1207. XX#undef INIT
  1208. XX#define INIT(val)    /* nothing */
  1209. XX
  1210. XX#undef DOINIT
  1211. XEND_OF_FILE
  1212. Xif test 311 -ne `wc -c <'extern.h'`; then
  1213. X    echo shar: \"'extern.h'\" unpacked with wrong size!
  1214. Xfi
  1215. X# end of 'extern.h'
  1216. Xfi
  1217. Xif test -f 'intern.h' -a "${1}" != "-c" ; then 
  1218. X  echo shar: Will not clobber existing file \"'intern.h'\"
  1219. Xelse
  1220. Xecho shar: Extracting \"'intern.h'\" \(299 characters\)
  1221. Xsed "s/^X//" >'intern.h' <<'END_OF_FILE'
  1222. XX/*
  1223. XX *    #include in each module defining global variables
  1224. XX */
  1225. XX
  1226. XX/*#define SID_H    "@(#)head:intern.h    1.1    92/04/20 00:26:52 (woods)"    /* */
  1227. XX/*#define SID_NM    intern_sccsid            /* */
  1228. XX/*#include "sccsid.h"                    /* */
  1229. XX
  1230. XX#undef EXT
  1231. XX#define EXT        /* nothing */
  1232. XX
  1233. XX#undef INIT
  1234. XX#define INIT(val)    = val
  1235. XX
  1236. XX#define DOINIT        1
  1237. XEND_OF_FILE
  1238. Xif test 299 -ne `wc -c <'intern.h'`; then
  1239. X    echo shar: \"'intern.h'\" unpacked with wrong size!
  1240. Xfi
  1241. X# end of 'intern.h'
  1242. Xfi
  1243. Xecho shar: End of shell archive.
  1244. Xecho "Put these in your local include directory."
  1245. Xexit 0
  1246. END_OF_FILE
  1247. if test 24610 -ne `wc -c <'externhdr.shar'`; then
  1248.     echo shar: \"'externhdr.shar'\" unpacked with wrong size!
  1249. fi
  1250. # end of 'externhdr.shar'
  1251. fi
  1252. echo shar: End of archive 2 \(of 4\).
  1253. cp /dev/null ark2isdone
  1254. MISSING=""
  1255. for I in 1 2 3 4 ; do
  1256.     if test ! -f ark${I}isdone ; then
  1257.     MISSING="${MISSING} ${I}"
  1258.     fi
  1259. done
  1260. if test "${MISSING}" = "" ; then
  1261.     echo You have unpacked all 4 archives.
  1262.     echo "Please read the file README first"
  1263.     rm -f ark[1-9]isdone
  1264. else
  1265.     echo You still need to unpack the following archives:
  1266.     echo "        " ${MISSING}
  1267. fi
  1268. ##  End of shell archive.
  1269. exit 0
  1270.