home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Usenet 1994 October
/
usenetsourcesnewsgroupsinfomagicoctober1994disk2.iso
/
unix
/
volume24
/
pucc-mk
/
part05
< prev
next >
Wrap
Text File
|
1991-03-19
|
60KB
|
1,842 lines
Subject: v24i061: Purdue shell turbo charger and manual installer, Part05/06
Newsgroups: comp.sources.unix
Approved: rsalz@uunet.UU.NET
X-Checksum-Snefru: 075abc1d 61c1ccea d3d9d4a0 5332e633
Submitted-by: Kevin Braunsdorf <ksb@cc.purdue.edu>
Posting-number: Volume 24, Issue 61
Archive-name: pucc-mk/part05
#!/bin/sh
# This is part 05 of pucc-1c
# ============= mkcat/strcasecmp.c ==============
if test ! -d 'mkcat'; then
echo 'x - creating directory mkcat'
mkdir 'mkcat'
fi
if test -f 'mkcat/strcasecmp.c' -a X"$1" != X"-c"; then
echo 'x - skipping mkcat/strcasecmp.c (File already exists)'
else
echo 'x - extracting mkcat/strcasecmp.c (Text)'
sed 's/^X//' << 'Purdue' > 'mkcat/strcasecmp.c' &&
/*
X * Copyright (c) 1987 Regents of the University of California.
X * All rights reserved.
X *
X * Redistribution and use in source and binary forms are permitted
X * provided that the above copyright notice and this paragraph are
X * duplicated in all such forms and that any documentation,
X * advertising materials, and other materials related to such
X * distribution and use acknowledge that the software was developed
X * by the University of California, Berkeley. The name of the
X * University may not be used to endorse or promote products derived
X * from this software without specific prior written permission.
X * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
X * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
X * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
X */
X
#if defined(LIBC_SCCS) && !defined(lint)
static char sccsid[] = "@(#)strcasecmp.c 5.7 (Berkeley) 2/7/89";
#endif /* LIBC_SCCS and not lint */
X
#include <sys/types.h>
X
/*
X * This array is designed for mapping upper and lower case letter
X * together for a case independent comparison. The mappings are
X * based upon ascii character sequences.
X */
static u_char charmap[] = {
X '\000', '\001', '\002', '\003', '\004', '\005', '\006', '\007',
X '\010', '\011', '\012', '\013', '\014', '\015', '\016', '\017',
X '\020', '\021', '\022', '\023', '\024', '\025', '\026', '\027',
X '\030', '\031', '\032', '\033', '\034', '\035', '\036', '\037',
X '\040', '\041', '\042', '\043', '\044', '\045', '\046', '\047',
X '\050', '\051', '\052', '\053', '\054', '\055', '\056', '\057',
X '\060', '\061', '\062', '\063', '\064', '\065', '\066', '\067',
X '\070', '\071', '\072', '\073', '\074', '\075', '\076', '\077',
X '\100', '\141', '\142', '\143', '\144', '\145', '\146', '\147',
X '\150', '\151', '\152', '\153', '\154', '\155', '\156', '\157',
X '\160', '\161', '\162', '\163', '\164', '\165', '\166', '\167',
X '\170', '\171', '\172', '\133', '\134', '\135', '\136', '\137',
X '\140', '\141', '\142', '\143', '\144', '\145', '\146', '\147',
X '\150', '\151', '\152', '\153', '\154', '\155', '\156', '\157',
X '\160', '\161', '\162', '\163', '\164', '\165', '\166', '\167',
X '\170', '\171', '\172', '\173', '\174', '\175', '\176', '\177',
X '\200', '\201', '\202', '\203', '\204', '\205', '\206', '\207',
X '\210', '\211', '\212', '\213', '\214', '\215', '\216', '\217',
X '\220', '\221', '\222', '\223', '\224', '\225', '\226', '\227',
X '\230', '\231', '\232', '\233', '\234', '\235', '\236', '\237',
X '\240', '\241', '\242', '\243', '\244', '\245', '\246', '\247',
X '\250', '\251', '\252', '\253', '\254', '\255', '\256', '\257',
X '\260', '\261', '\262', '\263', '\264', '\265', '\266', '\267',
X '\270', '\271', '\272', '\273', '\274', '\275', '\276', '\277',
X '\300', '\301', '\302', '\303', '\304', '\305', '\306', '\307',
X '\310', '\311', '\312', '\313', '\314', '\315', '\316', '\317',
X '\320', '\321', '\322', '\323', '\324', '\325', '\326', '\327',
X '\330', '\331', '\332', '\333', '\334', '\335', '\336', '\337',
X '\340', '\341', '\342', '\343', '\344', '\345', '\346', '\347',
X '\350', '\351', '\352', '\353', '\354', '\355', '\356', '\357',
X '\360', '\361', '\362', '\363', '\364', '\365', '\366', '\367',
X '\370', '\371', '\372', '\373', '\374', '\375', '\376', '\377',
};
X
strcasecmp(s1, s2)
X char *s1, *s2;
{
X register u_char *cm = charmap,
X *us1 = (u_char *)s1,
X *us2 = (u_char *)s2;
X
X while (cm[*us1] == cm[*us2++])
X if (*us1++ == '\0')
X return(0);
X return(cm[*us1] - cm[*--us2]);
}
X
strncasecmp(s1, s2, n)
X char *s1, *s2;
X register int n;
{
X register u_char *cm = charmap,
X *us1 = (u_char *)s1,
X *us2 = (u_char *)s2;
X
X while (--n >= 0 && cm[*us1] == cm[*us2++])
X if (*us1++ == '\0')
X return(0);
X return(n < 0 ? 0 : cm[*us1] - cm[*--us2]);
}
Purdue
chmod 0444 mkcat/strcasecmp.c ||
echo 'restore of mkcat/strcasecmp.c failed'
Wc_c="`wc -c < 'mkcat/strcasecmp.c'`"
test 3766 -eq "$Wc_c" ||
echo 'mkcat/strcasecmp.c: original size 3766, current size' "$Wc_c"
fi
# ============= mkcat/Makefile ==============
if test -f 'mkcat/Makefile' -a X"$1" != X"-c"; then
echo 'x - skipping mkcat/Makefile (File already exists)'
else
echo 'x - extracting mkcat/Makefile (Text)'
sed 's/^X//' << 'Purdue' > 'mkcat/Makefile' &&
# Copyright 1990 Purdue Research Foundation, West Lafayette, Indiana
# 47907. All rights reserved.
#
# Written by Kevin S Braunsdorf, ksb@cc.purdue.edu, purdue!ksb
#
# This software is not subject to any license of the American Telephone
# and Telegraph Company or the Regents of the University of California.
#
# Permission is granted to anyone to use this software for any purpose on
# any computer system, and to alter it and redistribute it freely, subject
# to the following restrictions:
#
# 1. Neither the authors nor Purdue University are responsible for any
# consequences of the use of this software.
#
# 2. The origin of this software must not be misrepresented, either by
# explicit claim or by omission. Credit to the authors and Purdue
# University must appear in documentation and sources.
#
# 3. Altered versions must be plainly marked as such, and must not be
# misrepresented as being the original software.
#
# 4. This notice may not be removed or altered.
#
# Makefile for mkcat
#
# $Id: Makefile.plain,v 3.8 90/07/11 16:17:42 ksb Exp $
#
X
BIN= ${DESTDIR}/usr/local/etc
PROG= mkcat
X
L=../libsrtunq
O=../libopt
#L=/usr/include/local
I=/usr/include
S=/usr/include/sys
P=
X
INCLUDE= -I$L -I$O
#INCLUDE= -I$L
DEBUG= -O
CDEFS=
CFLAGS= ${DEBUG} ${CDEFS} ${INCLUDE}
X
HDR= main.h genwhatis.h format.h readman.h scan.h mkcat.h pt.h machine.h
SRC= main.c genwhatis.c format.c readman.c scan.c mkcat.c pt.c \
X sym2hard.c strcasecmp.c
GENC=
GENH=
GEN= ${GENC} ${GENH}
DEP= ${SRC} ${GENC}
OBJ= main.o genwhatis.o format.o readman.o scan.o mkcat.o pt.o \
X sym2hard.o strcasecmp.o
MAN= mkcat.8l
OTHER= README mkcat.m
SOURCE= Makefile ${MAN} ${HDR} ${SRC} ${OTHER}
X
all: ${PROG}.x
X
${PROG}.x:$P ${OBJ}
# ${CC} ${DEBUG} -o $@ ${OBJ} -lopt -lsrtunq
X ${CC} ${DEBUG} -o $@ ${OBJ} ../libopt/libopt.a ../libsrtunq/libsrtunq.a
# ${CC} ${DEBUG} -o $@ ${OBJ} -lopt -lsrtunq -lbsd
X
self-test: ${PROG}.x ${MAN} FRC
X ./${PROG}.x -v -r. ${MAN} ; echo $$?
X echo 'The cat8 should have formatted pages, whatis should be here.'
X ls -FC cat8 whatis
X
self-clean: FRC
X rm -rf cat? OLD whatis
X
swap: main.h main.c mkcat.m
X mv Makefile Makefile.plain
X mv Makefile.mkcmd Makefile
X mkcmd std_help.m mkcat.m
X -cmp -s prog.c main.c || echo prog.c changed
X -cmp -s prog.h main.h || echo prog.h changed
X rm -f prog.[ch]
X make depend
X
clean: self-clean FRC
X rm -f Makefile.bak ${PROG}.x ${GEN} *.o a.out core errs tags
X
depend: ${HDR} ${SRC} ${GEN} FRC
X maketd ${CDEFS} ${INCLUDE} ${DEP}
X
install: all FRC
X install -cs ${PROG}.x ${BIN}/${PROG}
X
lint: ${HDR} ${SRC} ${GEN} FRC
X lint -h ${CDEFS} ${INCLUDE} ${DEP}
X
# a little chicken and egg stuff here... we hope we can use us to make mkcat
mkcat: ${MAN} ${PROG}.x FRC
X if [ -f ${PROG}.x ]; then \
X PATH=$$PATH:. ${PROG}.x ${MAN} ;\
X else \
X PATH=$$PATH:. ${PROG} ${MAN} ;\
X fi
X
print: source FRC
X lpr -J'${PROG} source' ${SOURCE}
X
shar: source
X shar -p K ${SOURCE} >../mkcat.shar
X
source: ${SOURCE}
X
spotless: clean self-clean
X rcsclean ${SOURCE}
X
tags: ${HDR} ${SRC} ${GEN}
X ctags -t ${HDR} ${SRC} ${GEN}
X
${SOURCE}:
X co -q $@
X
FRC:
X
# DO NOT DELETE THIS LINE - maketd DEPENDS ON IT
X
main.o: $O/getopt.h machine.h main.c mkcat.h
X
genwhatis.o: genwhatis.c genwhatis.h machine.h main.h mkcat.h pt.h
X
format.o: format.c genwhatis.h machine.h main.h mkcat.h pt.h readman.h scan.h
X
readman.o: machine.h main.h mkcat.h readman.c readman.h
X
scan.o: format.h genwhatis.h machine.h main.h mkcat.h pt.h readman.h scan.c
X
mkcat.o: $L/srtunq.h genwhatis.h machine.h main.h mkcat.c mkcat.h pt.h
X
pt.o: machine.h pt.c pt.h
X
sym2hard.o: machine.h main.h sym2hard.c
X
strcasecmp.o: strcasecmp.c
X
# *** Do not add anything here - It will go away. ***
Purdue
chmod 0644 mkcat/Makefile ||
echo 'restore of mkcat/Makefile failed'
Wc_c="`wc -c < 'mkcat/Makefile'`"
test 3675 -eq "$Wc_c" ||
echo 'mkcat/Makefile: original size 3675, current size' "$Wc_c"
fi
# ============= mkcat/Makefile.mkcmd ==============
if test -f 'mkcat/Makefile.mkcmd' -a X"$1" != X"-c"; then
echo 'x - skipping mkcat/Makefile.mkcmd (File already exists)'
else
echo 'x - extracting mkcat/Makefile.mkcmd (Text)'
sed 's/^X//' << 'Purdue' > 'mkcat/Makefile.mkcmd' &&
# Copyright 1990 Purdue Research Foundation, West Lafayette, Indiana
# 47907. All rights reserved.
#
# Written by Kevin S Braunsdorf, ksb@cc.purdue.edu, purdue!ksb
#
# This software is not subject to any license of the American Telephone
# and Telegraph Company or the Regents of the University of California.
#
# Permission is granted to anyone to use this software for any purpose on
# any computer system, and to alter it and redistribute it freely, subject
# to the following restrictions:
#
# 1. Neither the authors nor Purdue University are responsible for any
# consequences of the use of this software.
#
# 2. The origin of this software must not be misrepresented, either by
# explicit claim or by omission. Credit to the authors and Purdue
# University must appear in documentation and sources.
#
# 3. Altered versions must be plainly marked as such, and must not be
# misrepresented as being the original software.
#
# 4. This notice may not be removed or altered.
#
# Makefile for mkcat
#
# $Id: Makefile,v 3.8 90/07/11 15:20:21 ksb Exp $
#
X
BIN= ${DESTDIR}/usr/local/etc
PROG= mkcat
X
L=../libsrtunq
O=../libopt
#L=/usr/include/local
I=/usr/include
S=/usr/include/sys
P=
X
INCLUDE= -I$L -I$O
#INCLUDE= -I$L
DEBUG= -O
CDEFS=
CFLAGS= ${DEBUG} ${CDEFS} ${INCLUDE}
X
HDR= genwhatis.h format.h readman.h scan.h mkcat.h pt.h machine.h
SRC= genwhatis.c format.c readman.c scan.c mkcat.c pt.c \
X sym2hard.c strcasecmp.c
GENC= main.c
GENH= main.h
GEN= ${GENC} ${GENH}
DEP= ${SRC} ${GENC}
OBJ= main.o genwhatis.o format.o readman.o scan.o mkcat.o pt.o \
X sym2hard.o strcasecmp.o
MAN= mkcat.8l
OTHER= README mkcat.m
SOURCE= Makefile ${MAN} ${HDR} ${SRC} ${OTHER}
X
all: ${PROG}.x
X
${PROG}.x:$P ${OBJ}
# ${CC} ${DEBUG} -o $@ ${OBJ} -lopt -lsrtunq
X ${CC} ${DEBUG} -o $@ ${OBJ} ../libopt/libopt.a ../libsrtunq/libsrtunq.a
# ${CC} ${DEBUG} -o $@ ${OBJ} -lopt -lsrtunq -lbsd
X
main.h: main.c
X
main.c: mkcat.m
X mkcmd std_help.m mkcat.m
X -(cmp -s prog.c main.c || (mv prog.c main.c && echo main.c updated))
X -(cmp -s prog.h main.h || (mv prog.h main.h && echo main.h updated))
X rm -f prog.[ch]
X
self-test: ${PROG}.x ${MAN} FRC
X ./${PROG}.x -v -r. ${MAN} ; echo $$?
X echo 'The cat8 should have formatted pages, whatis should be here.'
X ls -FC cat8 whatis
X
self-clean: FRC
X rm -rf cat? OLD whatis
X
swap: main.h main.c
X mv Makefile Makefile.mkcmd
X mv Makefile.plain Makefile
X make depend
X
clean: self-clean FRC
X rm -f Makefile.bak ${PROG}.x ${GEN} *.o a.out core errs tags
X
depend: ${HDR} ${SRC} ${GEN} FRC
X maketd ${CDEFS} ${INCLUDE} ${DEP}
X
install: all FRC
X install -cs ${PROG}.x ${BIN}/${PROG}
X
lint: ${HDR} ${SRC} ${GEN} FRC
X lint -h ${CDEFS} ${INCLUDE} ${DEP}
X
# a little chicken and egg stuff here... we hope we can use us to make mkcat
mkcat: ${MAN} ${PROG}.x FRC
X if [ -f ${PROG}.x ]; then \
X PATH=$$PATH:. ${PROG}.x ${MAN} ;\
X else \
X PATH=$$PATH:. ${PROG} ${MAN} ;\
X fi
X
print: source FRC
X lpr -J'${PROG} source' ${SOURCE}
X
shar: source
X shar -p K ${SOURCE} >../mkcat.shar
X
source: ${SOURCE}
X
spotless: clean self-clean
X rcsclean ${SOURCE}
X
tags: ${HDR} ${SRC} ${GEN}
X ctags -t ${HDR} ${SRC} ${GEN}
X
${SOURCE}:
X co -q $@
X
FRC:
X
# DO NOT DELETE THIS LINE - maketd DEPENDS ON IT
X
genwhatis.o: genwhatis.c genwhatis.h machine.h main.h mkcat.h pt.h
X
format.o: format.c genwhatis.h machine.h main.h mkcat.h pt.h readman.h scan.h
X
readman.o: machine.h main.h mkcat.h readman.c readman.h
X
scan.o: format.h genwhatis.h machine.h main.h mkcat.h pt.h readman.h scan.c
X
mkcat.o: genwhatis.h machine.h main.h mkcat.c mkcat.h pt.h
X
pt.o: machine.h pt.c pt.h
X
sym2hard.o: machine.h main.h sym2hard.c
X
strcasecmp.o: strcasecmp.c
X
main.o: machine.h main.c mkcat.h
X
# *** Do not add anything here - It will go away. ***
Purdue
chmod 0644 mkcat/Makefile.mkcmd ||
echo 'restore of mkcat/Makefile.mkcmd failed'
Wc_c="`wc -c < 'mkcat/Makefile.mkcmd'`"
test 3718 -eq "$Wc_c" ||
echo 'mkcat/Makefile.mkcmd: original size 3718, current size' "$Wc_c"
fi
# ============= mk/mk.m ==============
if test ! -d 'mk'; then
echo 'x - creating directory mk'
mkdir 'mk'
fi
if test -f 'mk/mk.m' -a X"$1" != X"-c"; then
echo 'x - skipping mk/mk.m (File already exists)'
else
echo 'x - extracting mk/mk.m (Text)'
sed 's/^X//' << 'Purdue' > 'mk/mk.m' &&
# mkcmd driver for mk (ksb)
from '"machine.h"';
mix
getenv "MK";
terse "uline"
vector "help"
usage "usage"
X
integer variable "retval" { local initializer "0" }
char* variable "pathname" { help "global for full path to mk" }
X
before {
X update "pathname = argv[0];"
}
X
boolean 'A' {
X named "fFirst"
X help "find the first matched command that succeeds"
}
function "D" {
X named "define"
X parameter "defn"
X update "%n(%a);"
X help "give a definition of an environment variable"
}
function "U" {
X named "undefine"
X parameter "undef"
X update "%n(%a);"
X help "remove a definition for an envoronment variable"
}
boolean "V" {
X hidden named "debug"
X help "output debug information on stderr"
}
boolean "a" {
X named "fAll"
X help "find all matched commands"
}
boolean "c" {
X named "fConfirm"
X help "confirm the action before running it"
}
char* "d" {
X named "submark"
X parameter "submarker"
X help 'look for the string \\"$marker(submarker):\\" in file'
}
boolean "i" {
X named "fCase"
X help "ignore case for markers and submarkers"
}
integer "l" {
X parameter "lines"
X named "lines"
X initializer "99"
X help "specify the max number of lines to search"
}
char* "m" {
X named "markstr"
X parameter "marker"
X help 'look for the string \\"$marker:\\" in file'
}
boolean "n" {
X named "fExec"
X initializer "1"
X help "do not really do it"
}
from '"optaccum.h"'
char* "e" {
X named "pchExamine"
X parameter "templates"
X update '%n = OptAccum(%n, %a, ":");'
X help "scan templates before given files"
}
char* "t" {
X named "pchTemplates"
X parameter "templates"
X update '%n = OptAccum(%n, %a, ":");'
X help "look for marker in template file"
}
boolean "v" {
X named "fVerbose"
X initializer "1"
X update "%n = 1;"
X help "be verbose"
}
action "s" {
X update "%rvn = 0;"
X help "silent operation"
}
X
every {
X named "process"
X param "files"
X update 'retval += process(%a);'
X help "search for commands in these files"
}
exit {
X update "/* we just exit now */"
X aborts "exit(retval);"
}
X
zero {
X from '"mk.h"'
X update 'if (%rVn) {Version();}'
}
Purdue
chmod 0444 mk/mk.m ||
echo 'restore of mk/mk.m failed'
Wc_c="`wc -c < 'mk/mk.m'`"
test 2007 -eq "$Wc_c" ||
echo 'mk/mk.m: original size 2007, current size' "$Wc_c"
fi
# ============= mkcat/mkcat.h ==============
if test -f 'mkcat/mkcat.h' -a X"$1" != X"-c"; then
echo 'x - skipping mkcat/mkcat.h (File already exists)'
else
echo 'x - extracting mkcat/mkcat.h (Text)'
sed 's/^X//' << 'Purdue' > 'mkcat/mkcat.h' &&
/*
X * Some macros to keep me sane in the code (ksb)
X * $Id: mkcat.h,v 3.3 90/11/28 09:43:57 ksb Exp $
X *
X * Copyright 1990 Purdue Research Foundation, West Lafayette, Indiana
X * 47907. All rights reserved.
X *
X * Written by Kevin S Braunsdorf, ksb@cc.purdue.edu, purdue!ksb
X *
X * This software is not subject to any license of the American Telephone
X * and Telegraph Company or the Regents of the University of California.
X *
X * Permission is granted to anyone to use this software for any purpose on
X * any computer system, and to alter it and redistribute it freely, subject
X * to the following restrictions:
X *
X * 1. Neither the authors nor Purdue University are responsible for any
X * consequences of the use of this software.
X *
X * 2. The origin of this software must not be misrepresented, either by
X * explicit claim or by omission. Credit to the authors and Purdue
X * University must appear in documentation and sources.
X *
X * 3. Altered versions must be plainly marked as such, and must not be
X * misrepresented as being the original software.
X *
X * 4. This notice may not be removed or altered.
X */
X
/* debug bits for real problems {most of this was removed in 1989} */
#define DEBUG_NONE 0x0000
#define DEBUG_TRACE 0x0001
#define DEBUG_ASSERT 0x0002
#define DEBUG DEBUG_NONE
X
extern char acNoMem[], acCat[], acRoot[], acWhatis[];
X
#define DIROWNER (0)
#define DIRGROUP (1)
#define DIRMODE (2)
#define PAGEOWNER (DIROWNER+3)
#define PAGEGROUP (DIRGROUP+3)
#define PAGEMODE (DIRMODE+3)
#define WHATISOWNER (DIROWNER+6)
#define WHATISGROUP (DIRGROUP+6)
#define WHATISMODE (DIRMODE+6)
#define MANOWNER (DIROWNER+9)
#define MANGROUP (DIRGROUP+9)
#define MANMODE (DIRMODE+9)
X
#define MAXMODE (MANMODE)
#define MINMODE (DIRMODE)
X
extern char *apcModes[MAXMODE+1];
extern char *pcMkToken;
X
#define fpOut stdout
extern int fCompress, fUseHards;
extern void PrepInfo();
extern int IsOKBase(), ExtConflict();
extern void MakeDir();
Purdue
chmod 0444 mkcat/mkcat.h ||
echo 'restore of mkcat/mkcat.h failed'
Wc_c="`wc -c < 'mkcat/mkcat.h'`"
test 1954 -eq "$Wc_c" ||
echo 'mkcat/mkcat.h: original size 1954, current size' "$Wc_c"
fi
# ============= mkcat/pt.h ==============
if test -f 'mkcat/pt.h' -a X"$1" != X"-c"; then
echo 'x - skipping mkcat/pt.h (File already exists)'
else
echo 'x - extracting mkcat/pt.h (Text)'
sed 's/^X//' << 'Purdue' > 'mkcat/pt.h' &&
/*
X * a simple abstraction for a UNIX pathname
X * $Id: pt.h,v 3.1 90/11/28 09:44:03 ksb Exp $
X *
X * Copyright 1990 Purdue Research Foundation, West Lafayette, Indiana
X * 47907. All rights reserved.
X *
X * Written by Kevin S Braunsdorf, ksb@cc.purdue.edu, purdue!ksb
X *
X * This software is not subject to any license of the American Telephone
X * and Telegraph Company or the Regents of the University of California.
X *
X * Permission is granted to anyone to use this software for any purpose on
X * any computer system, and to alter it and redistribute it freely, subject
X * to the following restrictions:
X *
X * 1. Neither the authors nor Purdue University are responsible for any
X * consequences of the use of this software.
X *
X * 2. The origin of this software must not be misrepresented, either by
X * explicit claim or by omission. Credit to the authors and Purdue
X * University must appear in documentation and sources.
X *
X * 3. Altered versions must be plainly marked as such, and must not be
X * misrepresented as being the original software.
X *
X * 4. This notice may not be removed or altered.
X */
X
typedef struct PTnode {
X char acname[MAXPATHLEN+1]; /* name */
X short istate; /* how is name munged */
X char *pcdir; /* last slash before base */
X char *pcbase; /* first char in base */
X char *pcext; /* '.' in ext, or first char */
X char *pccomp; /* '.' in ".Z" or '\000' */
} PATH;
#define PS_COMP 0x08
#define PS_EXT 0x04
#define PS_DIR 0x01
#define PS_NONE 0x00
X
#define PTHasExt(MpPT) ((char *)0 != (MpPT)->pcext)
#define PTIsComp(MpPT) ((char *)0 != (MpPT)->pccomp)
X
#if HAVE_PROTO
extern void PTInit(char *, PATH *);
extern char *PTLocal(PATH *);
extern char *PTFull(PATH *);
extern char *PTDir(PATH *);
extern char *PTBase(PATH *);
extern char *PTExt(PATH *);
extern int PTComp(PATH *);
extern int PTUnComp(PATH *);
#else
extern void PTInit();
extern char *PTLocal();
extern char *PTFull();
extern char *PTDir();
extern char *PTBase();
extern char *PTExt();
extern int PTComp();
extern int PTUnComp();
#endif
Purdue
chmod 0444 mkcat/pt.h ||
echo 'restore of mkcat/pt.h failed'
Wc_c="`wc -c < 'mkcat/pt.h'`"
test 2050 -eq "$Wc_c" ||
echo 'mkcat/pt.h: original size 2050, current size' "$Wc_c"
fi
# ============= mkcat/genwhatis.h ==============
if test -f 'mkcat/genwhatis.h' -a X"$1" != X"-c"; then
echo 'x - skipping mkcat/genwhatis.h (File already exists)'
else
echo 'x - extracting mkcat/genwhatis.h (Text)'
sed 's/^X//' << 'Purdue' > 'mkcat/genwhatis.h' &&
/*
X * Keep track of whatis links
X * $Id: genwhatis.h,v 3.2 90/11/28 09:43:53 ksb Exp $
X *
X * Copyright 1990 Purdue Research Foundation, West Lafayette, Indiana
X * 47907. All rights reserved.
X *
X * Written by Kevin S Braunsdorf, ksb@cc.purdue.edu, purdue!ksb
X *
X * This software is not subject to any license of the American Telephone
X * and Telegraph Company or the Regents of the University of California.
X *
X * Permission is granted to anyone to use this software for any purpose on
X * any computer system, and to alter it and redistribute it freely, subject
X * to the following restrictions:
X *
X * 1. Neither the authors nor Purdue University are responsible for any
X * consequences of the use of this software.
X *
X * 2. The origin of this software must not be misrepresented, either by
X * explicit claim or by omission. Credit to the authors and Purdue
X * University must appear in documentation and sources.
X *
X * 3. Altered versions must be plainly marked as such, and must not be
X * misrepresented as being the original software.
X *
X * 4. This notice may not be removed or altered.
X */
X
/*
X * each of these is a link to (another name for) a manual page
X */
typedef struct LKnode {
X char *pclname; /* the basename of this link */
X char chwok; /* whatis entry is OK */
X char chreal; /* this is the `real' name of this page */
X char chdelins; /* this link should be deleted */
} LINK;
X
#define LINK_DEL 'd'
#define LINK_INS 'i'
#define LINK_REAL 'R'
#define LINK_SYMBOLIC '@'
#define LINK_OK 'y'
#define LINK_BAD 'n'
X
/*
X * at the end of formatting and linking all the pages we want to make
X * one pass through the whatis database to update it.
X */
typedef struct WUnode {
X int isection;
X int ilen;
X char **ppclist;
X char *pcsummary;
X char *pcext;
X char *pcbase;
X char *pcalso;
} WHATIS;
Purdue
chmod 0444 mkcat/genwhatis.h ||
echo 'restore of mkcat/genwhatis.h failed'
Wc_c="`wc -c < 'mkcat/genwhatis.h'`"
test 1815 -eq "$Wc_c" ||
echo 'mkcat/genwhatis.h: original size 1815, current size' "$Wc_c"
fi
# ============= mkcat/mkcat.m ==============
if test -f 'mkcat/mkcat.m' -a X"$1" != X"-c"; then
echo 'x - skipping mkcat/mkcat.m (File already exists)'
else
echo 'x - extracting mkcat/mkcat.m (Text)'
sed 's/^X//' << 'Purdue' > 'mkcat/mkcat.m' &&
# mkcat parser in mkcmd
# $Id: mkcat.m,v 3.5 90/11/28 09:43:59 ksb Exp $
# this tool is generated standalone because it goes to the world
X
getenv "MKCAT"
X
string variable "copyright" {
X init '"@(#) Copyright 1990 Purdue Research Foundation.\\nAll rights reserved.\\n"'
}
X
from '"machine.h"'
X
boolean 'A' {
X named "fCkAlso"
X excludes "IR"
X init '0'
X help "scan the formatted pages for SEE ALSO errors"
}
X
boolean 'R' {
X named "fInitNew"
X excludes "WIZL"
X init '0'
X help "install a new manual root"
}
X
boolean 'V' {
X named "fVersion"
X excludes "WIZLD"
X init '0'
X help "show the version and configuration of this program"
}
X
boolean 'D' {
X named "fDelete"
X excludes "WIZLVR"
X init '0'
X help "delete the given pages from the cat directories"
}
X
boolean 'W' {
X named "fMkWhatis"
X excludes "DIZVR"
X init "0"
X help "rebuild the whatis database from the cat pages"
}
X
boolean "L" {
X named "fMkLinks"
X excludes "DIZVR"
X init "0"
X help "rebuild auxiliary links to cat pages"
}
X
boolean "Z" {
X named "fJustComp"
X excludes "DILWVR"
X init "0"
X help "check file compression and update"
}
X
boolean "I" {
X named "fInstall"
X excludes "DLWZVR"
X init "0"
X help "install the given pages (default action)"
}
X
boolean "G" {
X hidden named "fGenInstck"
X init "0"
X help "generate an instck checklist for the manual system"
}
X
integer variable 'iExit' {
X init '0'
}
X
boolean 'f' {
X named "fFormat"
X init '1'
X help "the given pages are already formatted, just use them"
}
X
boolean 'v' {
X named 'fVerbose'
X init '0'
X update "%n = 1;"
X help "be verbose by displaying shell commands as they are run"
}
X
action 's' {
X update "%rvn = 0;"
X help "be silent"
}
X
X
boolean 'n' {
X named 'fExec'
X init '1'
X update "%n = 0;%rvn = 1;"
X help "do not really change the manual system"
}
X
from '"mkcat.h"'
pointer 'r' {
X named 'pcRoot'
X parameter "root"
X init "acRoot"
X help "specify a user defined root for the manual system"
}
X
pointer 'm' {
X named 'pcMan'
X param "man"
X init '(char *)0'
X help "save the manual page source in parallel with the cat page"
}
X
pointer 'c' {
X named 'pcCat'
X parameter 'cat'
X init 'acCat'
X help "specify the prefix for cat directories (cat1 cat2 cat3...)"
}
X
pointer 'w' {
X named "pcWhatis"
X init "acWhatis"
X param "whatis"
X help "specify a whatis database to update"
}
X
X
list {
X named "doMkCat"
X param "pages"
X update "iExit = %n(argc-optind, %a);"
X help "the manual pages to be updated"
}
X
exit {
X update ""
X aborts "return iExit;"
}
Purdue
chmod 0444 mkcat/mkcat.m ||
echo 'restore of mkcat/mkcat.m failed'
Wc_c="`wc -c < 'mkcat/mkcat.m'`"
test 2423 -eq "$Wc_c" ||
echo 'mkcat/mkcat.m: original size 2423, current size' "$Wc_c"
fi
# ============= mk/Tests/options ==============
if test ! -d 'mk/Tests'; then
echo 'x - creating directory mk/Tests'
mkdir 'mk/Tests'
fi
if test -f 'mk/Tests/options' -a X"$1" != X"-c"; then
echo 'x - skipping mk/Tests/options (File already exists)'
else
echo 'x - extracting mk/Tests/options (Text)'
sed 's/^X//' << 'Purdue' > 'mk/Tests/options' &&
$Compile: MK=-t/dev/null; export MK; for marker in All Verbose Case Interactive NotReally\n\tdo\n\t\t%b -m $marker %f && echo "$marker test OK"\n\tdone
X
$All: %b -m%m -d1 %f && %b -a -m%m -d2 %f && %b -A -m%m -d3 %f
$All(1): [ "%A" = "" ] && [ _"%a" = _"" ] && [ _"%o" = _"-v" ] && [ _"%O" = _"v" ]
$All(2): [ "%A" = "a" ] && [ _"%a" = _"-a" ] && [ _"%o" = _"-av" ] && [ _"%O" = _"av" ]
$All(3): [ "%A" = "A" ] && [ _"%a" = _"-A" ] && [ _"%o" = _"-Av" ] && [ _"%O" = _"Av" ]
X
$Verbose: %b -m%m -d1 %f && %b -v -m%m -d2 %f && %b -s -m%m -d3 %f
$Verbose(1): [ "%V" = "v" ] && [ _"%v" = _"-v" ] && [ _"%o" = _"-v" ] && [ _"%O" = _"v" ]
$Verbose(2): [ "%V" = "v" ] && [ _"%v" = _"-v" ] && [ _"%o" = _"-v" ] && [ _"%O" = _"v" ]
$Verbose(3): [ "%V" = "s" ] && [ _"%v" = _"-s" ] && [ _"%o" = _"-s" ] && [ _"%O" = _"s" ]
X
$Case: %b -m%m -d1 %f && %b -i -m%m -d2 %f && %b -i -m%m -d3 %f
$Case(1): [ "%I" = "" ] && [ _"%i" = _"" ] && [ _"%o" = _"-v" ] && [ _"%O" = _"v" ]
$Case(2): [ "%I" = "i" ] && [ _"%i" = _"-i" ] && [ _"%o" = _"-iv" ] && [ _"%O" = _"iv" ]
$caSe(3): [ "%I" = "i" ] && [ _"%i" = _"-i" ] && [ _"%o" = _"-iv" ] && [ _"%O" = _"iv" ]
X
$Interactive: %b -m%m -d1 %f && echo "y" | %b -c -m%m -d2 %f
$Interactive(1): [ "%C" = "" ] && [ _"%c" = _"" ] && [ _"%o" = _"-v" ] && [ _"%O" = _"v" ]
$Interactive(2): [ "%C" = "c" ] && [ _"%c" = _"-c" ] && [ _"%o" = _"-cv" ] && [ _"%O" = _"cv" ]
X
$NotReally: %b -m%m -d1 %f && ( %b -n -m%m -d2 %f | sh )
$NotReally(1): [ "%N" = "" ] && [ _"%n" = _"" ] && [ _"%o" = _"-v" ] && [ _"%O" = _"v" ]
$NotReally(2): [ "%N" = "n" ] && [ _"%n" = _"-n" ] && [ _"%o" = _"-nv" ] && [ _"%O" = _"nv" ]
Purdue
chmod 0644 mk/Tests/options ||
echo 'restore of mk/Tests/options failed'
Wc_c="`wc -c < 'mk/Tests/options'`"
test 1630 -eq "$Wc_c" ||
echo 'mk/Tests/options: original size 1630, current size' "$Wc_c"
fi
# ============= mk/README ==============
if test -f 'mk/README' -a X"$1" != X"-c"; then
echo 'x - skipping mk/README (File already exists)'
else
echo 'x - extracting mk/README (Text)'
sed 's/^X//' << 'Purdue' > 'mk/README' &&
Sometimes you want to hide a bit of shell code in a file, then later extract
and run that code on that file to produce an output. A good example of this
is the manual system: it would be terrible to have to name a Makefile for
each manual page in /usr/man/man*, or keep said file(s) in sync with the
pages.
X
What we do instead is hide the formatting command in the comments of the
manual page, then extract it when we need to format the page. Thus the
command moves with the page and cannot get lost. If a page has no command
hidden in it we will fall back to a set formula, much as make(1) does.
X
The template formulas are written to give max flexibility by using the shell
to expand some hooks. More about that in mk.5l.
X
We can also set resource limits and exit codes, as well as passing the
environment around more fully.
X
Anyway, that is the plan. We also use this same program in a regression
test driver (valid(1L)) which you can email me about if you care.
X
X
kayessbee
--
"This may be a new sense of the word `robust' for you."
Kevin Braunsdorf, ksb@cc.purdue.edu, pur-ee!ksb, purdue!ksb
Purdue
chmod 0444 mk/README ||
echo 'restore of mk/README failed'
Wc_c="`wc -c < 'mk/README'`"
test 1101 -eq "$Wc_c" ||
echo 'mk/README: original size 1101, current size' "$Wc_c"
fi
# ============= mk-lib/file-valid ==============
if test ! -d 'mk-lib'; then
echo 'x - creating directory mk-lib'
mkdir 'mk-lib'
fi
if test -f 'mk-lib/file-valid' -a X"$1" != X"-c"; then
echo 'x - skipping mk-lib/file-valid (File already exists)'
else
echo 'x - extracting mk-lib/file-valid (Text)'
sed 's/^X//' << 'Purdue' > 'mk-lib/file-valid' &&
# a valid(1L) input file (ksb)
X
$Compile(*): ${valid-valid} -mCompile,Run,Diff,Clean -aClean -o%s -C %f >%f.out 2>%f.log\nFAILED-$?\ncase $FALIED in\n\t0) echo "Validation completed successfully" ;;\n\t1) echo "One Test Failed" ;;\n\t*) echo $FAILED "Tests Failed" ;;\nesac
$Compile(*): ${valid-valid} -mCompile,Run,Diff,Clean -aClean -C %f >%f.out 2>%f.log\nFAILED-$?\ncase $FALIED in\n\t0) echo "Validation completed successfully" ;;\n\t1) echo "One Test Failed" ;;\n\t*) echo $FAILED "Tests Failed" ;;\nesac
X
$Valid(*): ${valid-valid} -mCompile,Run,Diff,Clean -aClean -o%s -C %f >%f.out 2>%f.log\nFAILED-$?\ncase $FALIED in\n\t0) echo "Validation completed successfully" ;;\n\t1) echo "One Test Failed" ;;\n\t*) echo $FAILED "Tests Failed" ;;\nesac
$Valid(*): ${valid-valid} -mCompile,Run,Diff,Clean -aClean -C %f >%f.out 2>%f.log\nFAILED-$?\ncase $FALIED in\n\t0) echo "Validation completed successfully" ;;\n\t1) echo "One Test Failed" ;;\n\t*) echo $FAILED "Tests Failed" ;;\nesac
X
$Clean(*): ${rcsclean-rcsclean} %s *
$Clean(*): ${rcsclean-rcsclean} *
X
$Info(*): ${echo-echo} "test suite description for valid"
Purdue
chmod 0444 mk-lib/file-valid ||
echo 'restore of mk-lib/file-valid failed'
Wc_c="`wc -c < 'mk-lib/file-valid'`"
test 1123 -eq "$Wc_c" ||
echo 'mk-lib/file-valid: original size 1123, current size' "$Wc_c"
fi
# ============= mk-lib/pre-uu ==============
if test -f 'mk-lib/pre-uu' -a X"$1" != X"-c"; then
echo 'x - skipping mk-lib/pre-uu (File already exists)'
else
echo 'x - extracting mk-lib/pre-uu (Text)'
sed 's/^X//' << 'Purdue' > 'mk-lib/pre-uu' &&
# uuencoded files, we hope
X
$Display(*): ${uudecode-uudecode} %f |${PAGER-${more-more}} %s
$Display(*): ${uudecode-uudecode} %f |${PAGER-${more-more}}
X
$Clean(*): ${rm-rm} -f %P
$Clean(*): ${rm-rm} -rf %P
X
$Info(*): ${echo-echo} "uuencoded data"
$Info(*): ${echo-echo} "uuencoded `${uudecode-uudecode) %f >%P && %b %o -m%m -d%s %P && rm -f %P`"
$Info(*): ${echo-echo} "uuencoded `${uudecode-uudecode) %f >%P && %b %o -m%m %P && rm -f %P`"
$Info(*): ${echo-echo} "uuencoded `${uudecode-uudecode) %f >%F && %b %o -m%m %F && rm -f %F`"
$Info(*): ${echo-echo} "uuencoded `${uudecode-uudecode} %f >/tmp/u$\$%F && %b %o -m%m -d%s /tmp/u$\$%F && rm -f /tmp/u$\$%F`"
$*(*): ${echo-echo} "uuencoded `${uudecode-uudecode} %f >/tmp/u$\$%F && %b %o -m%m /tmp/u$\$%F && rm -f /tmp/u$\$%F`"
X
$*(*): ${uudecode-uudecode) %f >%P && %b %o -m%m -d%s %P && rm -f %P
$*(*): ${uudecode-uudecode} %f >%P && %b %o -m%m %P && rm -f %P
$*(*): ${uudecode-uudecode) %f >%F && %b %o -m%m %F && rm -f %F
$*(*): ${uudecode-uudecode} %f >/tmp/u$\$%F && %b %o -m%m -d%s /tmp/u$\$%F && rm -f /tmp/u$\$%F
$*(*): ${uudecode-uudecode} %f >/tmp/u$\$%F && %b %o -m%m /tmp/u$\$%F && rm -f /tmp/u$\$%F
Purdue
chmod 0444 mk-lib/pre-uu ||
echo 'restore of mk-lib/pre-uu failed'
Wc_c="`wc -c < 'mk-lib/pre-uu'`"
test 1168 -eq "$Wc_c" ||
echo 'mk-lib/pre-uu: original size 1168, current size' "$Wc_c"
fi
# ============= mk-lib/dot-m ==============
if test -f 'mk-lib/dot-m' -a X"$1" != X"-c"; then
echo 'x - skipping mk-lib/dot-m (File already exists)'
else
echo 'x - extracting mk-lib/dot-m (Text)'
sed 's/^X//' << 'Purdue' > 'mk-lib/dot-m' &&
# a modula 2 source file? (ksb)
X
$Compile(*): ${m2-m2} ${m2_debug--O} -D%s -o %F %f
$Compile(*): ${m2-m2} ${m2_debug--O} -o %F %f
$M2(*): ${m2-m2} ${m2_debug--O} -c -D%s %f
$M2(*): ${m2-m2} ${m2_debug--O} -c %f
$Clean(*): ${rm-rm} -f %F.o %F
$Clean(*): ${rm-rm} -f %F.o
$Depend(*): ${maketd-maketd} -da -I/usr/include/local -D%s %f
$Depend(*): ${maketd-maketd} -da -I/usr/include/local %f
X
# am mkcmd source file?
$Compile(*): %b %o -mMkcmd %f && %b %o -m%m -s%s %F.c
$Compile(*): %b %o -mMkcmd %f && %b %o -m%m %F.c
X
$Mkcmd(*): ${mkcmd-mkcmd} -n$\$ %f\n\t(${cmp-cmp} -s $\$.c %s.c || (${cp-cp} $\$.c %s.c && echo %s.c updated))\n\t(${cmp-cmp} -s $\$.h %s.h || (${cp-cp} $\$.h %s.h && echo %s.h updated))\n\t${rm-rm} -f $\$.[ch]
$Mkcmd(*): ${mkcmd-mkcmd} -n$\$ %s %f\n\t(${cmp-cmp} -s $\$.c %F.c || (${cp-cp} $\$.c %F.c && echo %F.c updated))\n\t(${cmp-cmp} -s $\$.h %F.h || (${cp-cp} $\$.h %F.h && echo %F.h updated))\n\t${rm-rm} -f $\$.[ch]
$Mkcmd(*): ${mkcmd-mkcmd} -n$\$ %f\n\t(${cmp-cmp} -s $\$.c %F.c || (${cp-cp} $\$.c %F.c && echo %F.c updated))\n\t(${cmp-cmp} -s $\$.h %F.h || (${cp-cp} $\$.h %F.h && echo %F.h updated))\n\t${rm-rm} -f $\$.[ch]
$Mkcmd(*): ${mkcmd-mkcmd} %s %f -n%F
$Mkcmd(*): ${mkcmd-mkcmd} %f -n%F
X
$Clean(*): ${rm-rm} -f prog.[cho] %F.o %F
$Clean(*): ${rm-rm} -f prog.[cho] %F.o
X
$Info(*): ${echo-echo} "Modula 2 source or mkcmd input"
Purdue
chmod 0444 mk-lib/dot-m ||
echo 'restore of mk-lib/dot-m failed'
Wc_c="`wc -c < 'mk-lib/dot-m'`"
test 1371 -eq "$Wc_c" ||
echo 'mk-lib/dot-m: original size 1371, current size' "$Wc_c"
fi
# ============= mk-lib/README ==============
if test -f 'mk-lib/README' -a X"$1" != X"-c"; then
echo 'x - skipping mk-lib/README (File already exists)'
else
echo 'x - extracting mk-lib/README (Text)'
sed 's/^X//' << 'Purdue' > 'mk-lib/README' &&
# $Id: README,v 3.0 90/11/29 08:50:18 ksb Exp $
X
These templates take the place of any hard coded rules. Your users may
pick and choose these, or rules of their own. Some site specific
configuration *may* be done.
X
X 1/ references to default compilers in dot-{c,f,p,l,y} may be changed
X to reflect local compiler/processor names:
X s/cc-cc/cc-gcc/
X s/-f77/-fortran/
X s/-kcl/-lisp/
X s/-pc/-pascal/
X s/-lex/-flex/
X s/-yacc/-bison/ or s/-yacc/-byacc/
X
X (but do not change the `hook' variable, unless you *have* to).
X
X 2/ references to options (-v, -quiet) might be added if local users
X like more/less info by default (on xloadimage for example).
X
X 3/ submarkers might be added to some rule in place of (*).
X
X 4/ more templates for local file extenders might be created. If you
X need help mail me, I might even put them in the next patch!
X
X 5/ you'll have to replace calls to `ltroff' because it is a local
X PUCC program (soon to be released, maybe?).
X
X 6/ you might have to install (any of) xloadimage, patch, perl, etc.
X to get their rules to work.
X
--
"And in time I could only believe in one thing,
X the sky was just phosphorous stars hung on strings."
kayessbee, Kevin Braunsdorf, ksb@cc.purdue.edu, pur-ee!ksb, purdue!ksb
Purdue
chmod 0444 mk-lib/README ||
echo 'restore of mk-lib/README failed'
Wc_c="`wc -c < 'mk-lib/README'`"
test 1259 -eq "$Wc_c" ||
echo 'mk-lib/README: original size 1259, current size' "$Wc_c"
fi
# ============= mkcat/readman.h ==============
if test -f 'mkcat/readman.h' -a X"$1" != X"-c"; then
echo 'x - skipping mkcat/readman.h (File already exists)'
else
echo 'x - extracting mkcat/readman.h (Text)'
sed 's/^X//' << 'Purdue' > 'mkcat/readman.h' &&
/*
X * $Id: readman.h,v 3.1 90/11/28 09:44:07 ksb Exp $
X *
X * Copyright 1990 Purdue Research Foundation, West Lafayette, Indiana
X * 47907. All rights reserved.
X *
X * Written by Kevin S Braunsdorf, ksb@cc.purdue.edu, purdue!ksb
X *
X * This software is not subject to any license of the American Telephone
X * and Telegraph Company or the Regents of the University of California.
X *
X * Permission is granted to anyone to use this software for any purpose on
X * any computer system, and to alter it and redistribute it freely, subject
X * to the following restrictions:
X *
X * 1. Neither the authors nor Purdue University are responsible for any
X * consequences of the use of this software.
X *
X * 2. The origin of this software must not be misrepresented, either by
X * explicit claim or by omission. Credit to the authors and Purdue
X * University must appear in documentation and sources.
X *
X * 3. Altered versions must be plainly marked as such, and must not be
X * misrepresented as being the original software.
X *
X * 4. This notice may not be removed or altered.
X */
X
#define FMT_NORMAL 0 /* bits to record format of text */
#define FMT_BOLD 1 /* FMT_NORMAL can be compared against */
#define FMT_UNDERLINE 2 /* else, use these bits */
#define FMT_OVERSTRIKE 4 /* to read format */
#define LN_PAD 2 /* the caller may append this many other links */
X
extern char acMark[]; /* the begining of the NAME section */
extern char *strsave();
extern int StripFmt();
extern int rdlinks();
Purdue
chmod 0444 mkcat/readman.h ||
echo 'restore of mkcat/readman.h failed'
Wc_c="`wc -c < 'mkcat/readman.h'`"
test 1493 -eq "$Wc_c" ||
echo 'mkcat/readman.h: original size 1493, current size' "$Wc_c"
fi
# ============= mkcat/scan.h ==============
if test -f 'mkcat/scan.h' -a X"$1" != X"-c"; then
echo 'x - skipping mkcat/scan.h (File already exists)'
else
echo 'x - extracting mkcat/scan.h (Text)'
sed 's/^X//' << 'Purdue' > 'mkcat/scan.h' &&
/*
X * $Id: scan.h,v 3.1 90/11/28 09:44:09 ksb Exp $
X *
X * Copyright 1990 Purdue Research Foundation, West Lafayette, Indiana
X * 47907. All rights reserved.
X *
X * Written by Kevin S Braunsdorf, ksb@cc.purdue.edu, purdue!ksb
X *
X * This software is not subject to any license of the American Telephone
X * and Telegraph Company or the Regents of the University of California.
X *
X * Permission is granted to anyone to use this software for any purpose on
X * any computer system, and to alter it and redistribute it freely, subject
X * to the following restrictions:
X *
X * 1. Neither the authors nor Purdue University are responsible for any
X * consequences of the use of this software.
X *
X * 2. The origin of this software must not be misrepresented, either by
X * explicit claim or by omission. Credit to the authors and Purdue
X * University must appear in documentation and sources.
X *
X * 3. Altered versions must be plainly marked as such, and must not be
X * misrepresented as being the original software.
X *
X * 4. This notice may not be removed or altered.
X */
X
extern int cmpfile();
extern void ScanDups();
extern int AllDir();
extern void ModLinks();
Purdue
chmod 0444 mkcat/scan.h ||
echo 'restore of mkcat/scan.h failed'
Wc_c="`wc -c < 'mkcat/scan.h'`"
test 1164 -eq "$Wc_c" ||
echo 'mkcat/scan.h: original size 1164, current size' "$Wc_c"
fi
# ============= mkcat/machine.h ==============
if test -f 'mkcat/machine.h' -a X"$1" != X"-c"; then
echo 'x - skipping mkcat/machine.h (File already exists)'
else
echo 'x - extracting mkcat/machine.h (Text)'
sed 's/^X//' << 'Purdue' > 'mkcat/machine.h' &&
/*
X * configure for a given machine, not as nice as installs, younger (ksb)
X * $Id: machine.h,v 3.3 90/11/28 09:43:55 ksb Exp $
X *
X * Copyright 1990 Purdue Research Foundation, West Lafayette, Indiana
X * 47907. All rights reserved.
X *
X * Written by Kevin S Braunsdorf, ksb@cc.purdue.edu, purdue!ksb
X *
X * This software is not subject to any license of the American Telephone
X * and Telegraph Company or the Regents of the University of California.
X *
X * Permission is granted to anyone to use this software for any purpose on
X * any computer system, and to alter it and redistribute it freely, subject
X * to the following restrictions:
X *
X * 1. Neither the authors nor Purdue University are responsible for any
X * consequences of the use of this software.
X *
X * 2. The origin of this software must not be misrepresented, either by
X * explicit claim or by omission. Credit to the authors and Purdue
X * University must appear in documentation and sources.
X *
X * 3. Altered versions must be plainly marked as such, and must not be
X * misrepresented as being the original software.
X *
X * 4. This notice may not be removed or altered.
X */
X
/*
X * define this macros to control machine dependent features (ksb)
X */
X
/* OS type
X */
/* #define SYSV 1 /**/
#define bsd 1 /**/
X
/* we do(1) or do not(0) have "ln -s", symlink, and lstat (bsd)
X */
#define HAVE_SLINKS defined(bsd)
X
#if HAVE_SLINKS
#define LSTAT lstat
#else
#define LSTAT stat
#endif
X
#if defined(bsd)
#define strchr index
#define strrchr rindex
#endif
Purdue
chmod 0644 mkcat/machine.h ||
echo 'restore of mkcat/machine.h failed'
Wc_c="`wc -c < 'mkcat/machine.h'`"
test 1525 -eq "$Wc_c" ||
echo 'mkcat/machine.h: original size 1525, current size' "$Wc_c"
fi
# ============= mkcat/format.h ==============
if test -f 'mkcat/format.h' -a X"$1" != X"-c"; then
echo 'x - skipping mkcat/format.h (File already exists)'
else
echo 'x - extracting mkcat/format.h (Text)'
sed 's/^X//' << 'Purdue' > 'mkcat/format.h' &&
/*
X * These routines format a manual page, we hope (ksb)
X * $Id: format.h,v 3.1 90/11/28 09:43:52 ksb Exp $
X *
X * Copyright 1990 Purdue Research Foundation, West Lafayette, Indiana
X * 47907. All rights reserved.
X *
X * Written by Kevin S Braunsdorf, ksb@cc.purdue.edu, purdue!ksb
X *
X * This software is not subject to any license of the American Telephone
X * and Telegraph Company or the Regents of the University of California.
X *
X * Permission is granted to anyone to use this software for any purpose on
X * any computer system, and to alter it and redistribute it freely, subject
X * to the following restrictions:
X *
X * 1. Neither the authors nor Purdue University are responsible for any
X * consequences of the use of this software.
X *
X * 2. The origin of this software must not be misrepresented, either by
X * explicit claim or by omission. Credit to the authors and Purdue
X * University must appear in documentation and sources.
X *
X * 3. Altered versions must be plainly marked as such, and must not be
X * misrepresented as being the original software.
X *
X * 4. This notice may not be removed or altered.
X */
X
extern char acDotZ[];
extern int mysort(), uniq();
extern int ModFmt();
Purdue
chmod 0444 mkcat/format.h ||
echo 'restore of mkcat/format.h failed'
Wc_c="`wc -c < 'mkcat/format.h'`"
test 1204 -eq "$Wc_c" ||
echo 'mkcat/format.h: original size 1204, current size' "$Wc_c"
fi
# ============= mk/mk.h ==============
if test -f 'mk/mk.h' -a X"$1" != X"-c"; then
echo 'x - skipping mk/mk.h (File already exists)'
else
echo 'x - extracting mk/mk.h (Text)'
sed 's/^X//' << 'Purdue' > 'mk/mk.h' &&
#define PATCH_LEVEL 0
X
/*
X * this define controls the auxilary look up of compilation
X * directives in a standard template directory. (%~)
X */
#if !defined(AUXDIR)
#define AUXDIR "/usr/local/lib/mk"
#endif
X
/* undefined implies no aux. lookup
X * defined implies look it up in aux. templates
X */
#if !defined(TEMPL)
#define TEMPL "%~/file-%F:%~/dot-%x:%~/m-%M"
#endif
X
/* this is the template to scan the file given on the command line
X * (The user cannot change it (-F?), which is a `bug'.)
X */
#if !defined(FSCAN)
#define FSCAN "%Yf%f"
#endif
X
/* this defines a pre-scan template to trap bad file types/names
X * (This is what keeps us from opening a .Z file and scanning it.)
X */
#if !defined(BEFORE)
#define BEFORE "%~/type-%y:%~/pre-%x:%~/comma-%U,"
#endif
X
extern void Version();
extern int process();
Purdue
chmod 0644 mk/mk.h ||
echo 'restore of mk/mk.h failed'
Wc_c="`wc -c < 'mk/mk.h'`"
test 806 -eq "$Wc_c" ||
echo 'mk/mk.h: original size 806, current size' "$Wc_c"
fi
# ============= mk/rcsname.c ==============
if test -f 'mk/rcsname.c' -a X"$1" != X"-c"; then
echo 'x - skipping mk/rcsname.c (File already exists)'
else
echo 'x - extracting mk/rcsname.c (Text)'
sed 's/^X//' << 'Purdue' > 'mk/rcsname.c' &&
#include <stdio.h>
#include <sys/types.h>
#include <sys/file.h>
X
#include "machine.h"
X
extern char *strcpy(), *strrchr(), *strcat();
X
char *
rcsname(pchFile)
char *pchFile;
{
X static char path[1024];
X register char *p, *q;
X register int fComma;
X
X q = pchFile;
X strcpy(path, "RCS/");
X strcpy(path+4, q);
X
X fComma =NULL == (p = strrchr(q, ',')) || 'v' != p[1] || '\000' != p[2];
X
X if (fComma) {
X strcat(path, ",v");
X }
#if !defined(F_OK)
#define F_OK 0
#endif
X if (0 == access(path+4, F_OK)) {
X return path+4;
X }
X
X if (0 == access(path, F_OK)) {
X return path;
X }
X
X if ((char *)0 != (p = strrchr(q, '/'))) {
X p[0] = '\000';
X strcpy(path, q);
X strcat(path, "/RCS/");
X strcat(path, p+1);
X p[0] = '/';
X
X if (fComma) {
X strcat(path, ",v");
X }
X if (0 == access(path, F_OK)) {
X return path;
X }
X }
X return (char *)0;
}
Purdue
chmod 0444 mk/rcsname.c ||
echo 'restore of mk/rcsname.c failed'
Wc_c="`wc -c < 'mk/rcsname.c'`"
test 825 -eq "$Wc_c" ||
echo 'mk/rcsname.c: original size 825, current size' "$Wc_c"
fi
# ============= mk/optaccum.c ==============
if test -f 'mk/optaccum.c' -a X"$1" != X"-c"; then
echo 'x - skipping mk/optaccum.c (File already exists)'
else
echo 'x - extracting mk/optaccum.c (Text)'
sed 's/^X//' << 'Purdue' > 'mk/optaccum.c' &&
/*
X * accumulate option strings into a large buffer
X */
#include <stdio.h>
X
#include "machine.h"
X
extern char *progname;
extern char acOutMem[];
X
/*
X * Accumulate a string, for string options that "append with a sep"
X * note: arg must start out as either "(char *)0" or a malloc'd string
X */
char *
OptAccum(pchOld, pchArg, pchSep)
char *pchOld, *pchArg, *pchSep;
{
X extern int strlen();
X extern char *realloc(), *malloc(), *strcat();
X register int len;
X register char *pchNew;
X
X /* Do not add null strings
X */
X len = strlen(pchArg);
X if (0 == len) {
X return pchOld;
X }
X
X if ((char *)0 == pchOld) {
X pchNew = malloc(len+1);
X if ((char *)0 == pchNew) {
X fprintf(stderr, acOutMem, progname);
X exit(1);
X }
X pchNew[0] = '\000';
X } else {
X len += strlen(pchOld)+strlen(pchSep)+1;
X if ((char *)0 == (pchNew = realloc(pchOld, len))) {
X fprintf(stderr, acOutMem, progname);
X exit(1);
X }
X strcat(pchNew, pchSep);
X }
X pchOld = strcat(pchNew, pchArg);
X return pchOld;
}
Purdue
chmod 0444 mk/optaccum.c ||
echo 'restore of mk/optaccum.c failed'
Wc_c="`wc -c < 'mk/optaccum.c'`"
test 977 -eq "$Wc_c" ||
echo 'mk/optaccum.c: original size 977, current size' "$Wc_c"
fi
# ============= mk-lib/pre-dir ==============
if test -f 'mk-lib/pre-dir' -a X"$1" != X"-c"; then
echo 'x - skipping mk-lib/pre-dir (File already exists)'
else
echo 'x - extracting mk-lib/pre-dir (Text)'
sed 's/^X//' << 'Purdue' > 'mk-lib/pre-dir' &&
# a dbm dir file (if it were a directory we would trap with type-d) (ksb)
X
$Display(*): ${perl-perl} \\\n\t-e 'dbmopen(Junk, "%P", 0644);' \\\n\t-e 'while (($dir,$pag) = each %%Junk) { print $%x, "\\n"; %s; }' \\\n\t-e 'dbmclose(Junk);' |${PAGER-${more-more}}
$Display(*): ${perl-perl} \\\n\t-e 'dbmopen(Junk, "%P", 0644);' \\\n\t-e 'while (($dir,$pag) = each %%Junk) { print $%x, "\\n"; }' \\\n\t-e 'dbmclose(Junk);' |${PAGER-${more-more}}
X
$Display(*): ${perl-perl} \\\n\t-e 'dbmopen(Junk, "%P", 0644);' \\\n\t-e 'while (($dir,$pag) = each %%Junk) { print $dir, "=", $pag, "\\n"; %s; }' \\\n\t-e 'dbmclose(Junk);' |${PAGER-${more-more}}
$Display(*): ${perl-perl} \\\n\t-e 'dbmopen(Junk, "%P", 0644);' \\\n\t-e 'while (($dir,$pag) = each %%Junk) { print $dir, "=", $pag, "\\n"; }' \\\n\t-e 'dbmclose(Junk);' |${PAGER-${more-more}}
X
$Info(*): ${echo-echo} "dbm directory or data"
X
$*(*): : '%P is a nbdm file, will not %m(%s) it' && ${false-false}
$*(*): : '%P is a nbdm file, will not %m it' && ${false-false}
Purdue
chmod 0444 mk-lib/pre-dir ||
echo 'restore of mk-lib/pre-dir failed'
Wc_c="`wc -c < 'mk-lib/pre-dir'`"
test 1011 -eq "$Wc_c" ||
echo 'mk-lib/pre-dir: original size 1011, current size' "$Wc_c"
fi
# ============= mk-lib/pre-Z ==============
if test -f 'mk-lib/pre-Z' -a X"$1" != X"-c"; then
echo 'x - skipping mk-lib/pre-Z (File already exists)'
else
echo 'x - extracting mk-lib/pre-Z (Text)'
sed 's/^X//' << 'Purdue' > 'mk-lib/pre-Z' &&
# chain to uncompressed file (ksb)
X
$Display(*): ${zcat-zcat} %f | ${PAGER-${more-more}} %s
$Display(*): ${zcat-zcat} %f | ${PAGER-${more-more}}
X
$Info(*): ${echo-echo} "compressed data"
$Info(*): ${echo-echo} "compressed `${zcat-zcat} %f >%P && %b %o -m%m -d%s %P && rm -f %P`"
$Info(*): ${echo-echo} "compressed `${zcat-zcat} %f >/tmp/Z$\$%F && %b %o -m%m -d%s /tmp/Z$\$%F && rm -f /tmp/Z$\$%F`"
$Info(*): ${echo-echo} "compressed `${zcat-zcat} %f >%P && %b %o -m%m %P && rm -f %P`"
$Info(*): ${echo-echo} "compressed `${zcat-zcat} %f >/tmp/Z$\$%F && %b %o -m%m /tmp/Z$\$%F && rm -f /tmp/Z$\$%F`"
X
$*(*): ${zcat-zcat} %f >%P && %b %o -m%m -d%s %P && rm -f %P
$*(*): ${zcat-zcat} %f >/tmp/Z$\$%F && %b %o -m%m -d%s /tmp/Z$\$%F && rm -f /tmp/Z$\$%F
$*(*): ${zcat-zcat} %f >%P && %b %o -m%m %P && rm -f %P
$*(*): ${zcat-zcat} %f >/tmp/Z$\$%F && %b %o -m%m /tmp/Z$\$%F && rm -f /tmp/Z$\$%F
Purdue
chmod 0444 mk-lib/pre-Z ||
echo 'restore of mk-lib/pre-Z failed'
Wc_c="`wc -c < 'mk-lib/pre-Z'`"
test 897 -eq "$Wc_c" ||
echo 'mk-lib/pre-Z: original size 897, current size' "$Wc_c"
fi
# ============= mk-lib/pre-z ==============
if test -f 'mk-lib/pre-z' -a X"$1" != X"-c"; then
echo 'x - skipping mk-lib/pre-z (File already exists)'
else
echo 'x - extracting mk-lib/pre-z (Text)'
sed 's/^X//' << 'Purdue' > 'mk-lib/pre-z' &&
# compacted file, outdated compression program (ksb)
X
$Display(*): ${pcat-pcat} %f |${PAGER-${more-more}} %s
$Display(*): ${pcat-pcat} %f |${PAGER-${more-more}}
X
$Info(*): ${echo-echo} "compacted data"
$Info(*): ${echo-echo} "compacted `${pcat-pcat) %f >%P && %b %o -m%m -d%s %P && rm -f %P`"
$Info(*): ${echo-echo} "compacted `${pcat-pcat} %f >%P && %b %o -m%m %P && rm -f %P`"
$Info(*): ${echo-echo} "compacted `${pcat-pcat) %f >%F && %b %o -m%m %F && rm -f %F`"
$Info(*): ${echo-echo} "compacted `${pcat-pcat} %f >/tmp/z$\$%F && %b %o -m%m -d%s /tmp/z$\$%F && rm -f /tmp/z$\$%F`"
$Info(*): ${echo-echo} "compacted `${pcat-pcat} %f >/tmp/z$\$%F && %b %o -m%m /tmp/z$\$%F && rm -f /tmp/z$\$%F`"
X
$*(*): ${pcat-pcat) %f >%P && %b %o -m%m -d%s %P && rm -f %P
$*(*): ${pcat-pcat} %f >%P && %b %o -m%m %P && rm -f %P
$*(*): ${pcat-pcat) %f >%F && %b %o -m%m %F && rm -f %F
$*(*): ${pcat-pcat} %f >/tmp/z$\$%F && %b %o -m%m -d%s /tmp/z$\$%F && rm -f /tmp/z$\$%F
$*(*): ${pcat-pcat} %f >/tmp/z$\$%F && %b %o -m%m /tmp/z$\$%F && rm -f /tmp/z$\$%F
Purdue
chmod 0444 mk-lib/pre-z ||
echo 'restore of mk-lib/pre-z failed'
Wc_c="`wc -c < 'mk-lib/pre-z'`"
test 1049 -eq "$Wc_c" ||
echo 'mk-lib/pre-z: original size 1049, current size' "$Wc_c"
fi
# ============= mk-lib/pre-zoo ==============
if test -f 'mk-lib/pre-zoo' -a X"$1" != X"-c"; then
echo 'x - skipping mk-lib/pre-zoo (File already exists)'
else
echo 'x - extracting mk-lib/pre-zoo (Text)'
sed 's/^X//' << 'Purdue' > 'mk-lib/pre-zoo' &&
# this is a zoo archive (ksb)
X
$Display(*): ${zoo-zoo} %s %f |${PAGER-${more-more}}
$Display(*): ${zoo-zoo} lmv %f |${PAGER-${more-more}}
$Display(*): ${zoo-zoo} -list %f |${PAGER-${more-more}}
X
$Zoo(*): : '%B(%s): %f: do what to a zoo archive' && ${false-false}
$Zoo(*): : '%B: %f: do what to a zoo archive' && ${false-false}
X
$Compile(*): ${zoo-zoo} %s %f && %b %o %P && ${rm-rm} -rf %P
$Compile(*): ${zoo-zoo} %f && %b %o -d%s %P && ${rm-rm} -rf %P
$Compile(*): ${zoo-zoo} %f && %b %o %P && ${rm-rm} -rf %P
$Compile(*): ${zoo-zoo} x//+%s %f && %b %o %P && ${rm-rm} -rf %P
$Compile(*): ${zoo-zoo} x//+ %f && %b %o -d%s %P && ${rm-rm} -rf %P
$Compile(*): ${zoo-zoo} x//+ %f && %b %o %P && ${rm-rm} -rf %P
X
$Clean(*): ${rm-rm} -f%s %P
$Clean(*): ${rm-rm} -f%s %F
$Clean(*): ${rm-rm} -f %P
$Clean(*): ${rm-rm} -f %F
X
$Info(*): ${echo-echo} "zoo archive"
Purdue
chmod 0444 mk-lib/pre-zoo ||
echo 'restore of mk-lib/pre-zoo failed'
Wc_c="`wc -c < 'mk-lib/pre-zoo'`"
test 859 -eq "$Wc_c" ||
echo 'mk-lib/pre-zoo: original size 859, current size' "$Wc_c"
fi
# ============= mk-lib/dot-y ==============
if test -f 'mk-lib/dot-y' -a X"$1" != X"-c"; then
echo 'x - skipping mk-lib/dot-y (File already exists)'
else
echo 'x - extracting mk-lib/dot-y (Text)'
sed 's/^X//' << 'Purdue' > 'mk-lib/dot-y' &&
# a yacc input file (ksb)
X
$Compile(*): %b %o -mYacc %f && %b %o -m%m -s%s %F.c
$Compile(*): %b %o -mYacc %f && %b %o -m%m -s%s y.tab.c
$Compile(*): %b %o -mYacc %f && %b %o -m%m %F.c
$Compile(*): %b %o -mYacc %f && %b %o -m%m y.tab.c
X
$Yacc(*): ${yacc-yacc} -d ${yacc_debug} %f\n\t(${cmp-cmp} -s y.tab.c %F.c || (${cp-cp} y.tab.c %F.c && echo %F.c updated))\n\t(${cmp-cmp} -s y.tab.h %F.h || (${cp-cp} y.tab.h %F.h && echo %F.h updated))\n\t${rm-rm} -f y.tab.[ch]
$Yacc(*): ${yacc-yacc} -d ${yacc_debug} %f
$Yacc(*): ${yacc-yacc} ${yacc_debug} %f\n\t(${cmp-cmp} -s y.tab.c %F.c || (${cp-cp} y.tab.c %F.c && echo %F.c updated))\n\t${rm-rm} -f y.tab.c
$Yacc(*): ${yacc-yacc} ${yacc_debug} %f
X
$Clean(*): ${rm-rm} -f y.output y.tab.[ch] %F.[coh]
$Clean(*): ${rm-rm} -f y.output y.tab.[ch]
X
$Info(*): ${echo-echo} "yacc input"
Purdue
chmod 0444 mk-lib/dot-y ||
echo 'restore of mk-lib/dot-y failed'
Wc_c="`wc -c < 'mk-lib/dot-y'`"
test 830 -eq "$Wc_c" ||
echo 'mk-lib/dot-y: original size 830, current size' "$Wc_c"
fi
# ============= mk-lib/pre-MW ==============
if test -f 'mk-lib/pre-MW' -a X"$1" != X"-c"; then
echo 'x - skipping mk-lib/pre-MW (File already exists)'
else
echo 'x - extracting mk-lib/pre-MW (Text)'
sed 's/^X//' << 'Purdue' > 'mk-lib/pre-MW' &&
# chain to unsqueeze file (.MW) for akb (ksb)
X
$Display(*): ${unsqueeze-unsqueeze} <%f | ${PAGER-${more-more}} %s
$Display(*): ${unsqueeze-unsqueeze} <%f | ${PAGER-${more-more}}
X
$Info(*): ${echo-echo} "squeezed data"
$Info(*): ${echo-echo} "squeezed `${unsqueeze-unsqueeze} <%f >%P && %b %o -m%m -d%s %P && rm -f %P`"
$Info(*): ${echo-echo} "squeezed `${unsqueeze-unsqueeze} <%f >/tmp/MW$\$%F && %b %o -m%m -d%s /tmp/MW$\$%F && rm -f /tmp/MW$\$%F`"
$Info(*): ${echo-echo} "squeezed `${unsqueeze-unsqueeze} <%f >%P && %b %o -m%m %P && rm -f %P`"
$Info(*): ${echo-echo} "squeezed `${unsqueeze-unsqueeze} <%f >/tmp/MW$\$%F && %b %o -m%m /tmp/MW$\$%F && rm -f /tmp/MW$\$%F`"
X
$*(*): ${unsqueeze-unsqueeze} <%f >%P && %b %o -m%m -d%s %P && rm -f %P
$*(*): ${unsqueeze-unsqueeze} <%f >/tmp/MW$\$%F && %b %o -m%m -d%s /tmp/MW$\$%F && rm -f /tmp/MW$\$%F
$*(*): ${unsqueeze-unsqueeze} <%f >%P && %b %o -m%m %P && rm -f %P
$*(*): ${unsqueeze-unsqueeze} <%f >/tmp/MW$\$%F && %b %o -m%m /tmp/MW$\$%F && rm -f /tmp/MW$\$%F
Purdue
chmod 0444 mk-lib/pre-MW ||
echo 'restore of mk-lib/pre-MW failed'
Wc_c="`wc -c < 'mk-lib/pre-MW'`"
test 1019 -eq "$Wc_c" ||
echo 'mk-lib/pre-MW: original size 1019, current size' "$Wc_c"
fi
# ============= mkcat/README ==============
if test -f 'mkcat/README' -a X"$1" != X"-c"; then
echo 'x - skipping mkcat/README (File already exists)'
else
echo 'x - extracting mkcat/README (Text)'
sed 's/^X//' << 'Purdue' > 'mkcat/README' &&
# $Id: README,v 3.3 90/11/28 09:43:49 ksb Exp $
X
This is mkcat(8l). It is my friend. Please try it.
X
A good test might be:
X $ make
X $ make self-test
X $ zcat cat8/mkcat.8l.Z | more
X $ cat whatis
X $ mkdir cat3
X $ ./mkcat.x -r. /usr/man/man3/bstring.3 /usr/man/man3/ctype.3
X $ cat whatis
X $ ls cat3
X
(We keep our manual pages compressed here, do you guys?)
Drop me a line with complaints. Note that this *replaces* catman(8),
and makewhatis(8l).
X
To install a new manual root in all its glory use:
X
X $ mkcat -v -r /usr/man -R
X
Which will ask you about how you want the pages kept.
X
Usage in Makefile:
X MAN= mkcat.8l
X
X install: ... FRC
X install ...
X
X mkcat: ${MAN} FRC
X mkcat ${MAN}
X
Thanks for your time. (Note `mkcat -D foo.1l' will delete old pages too.)
--
"The RCMP is to spaceflight as the Canadian government is to freedom." - ADO
kayessbee, Kevin Braunsdorf, ksb@cc.purdue.edu, pur-ee!ksb, purdue!ksb
Purdue
chmod 0444 mkcat/README ||
echo 'restore of mkcat/README failed'
Wc_c="`wc -c < 'mkcat/README'`"
test 911 -eq "$Wc_c" ||
echo 'mkcat/README: original size 911, current size' "$Wc_c"
fi
# ============= mk/optaccum.h ==============
if test -f 'mk/optaccum.h' -a X"$1" != X"-c"; then
echo 'x - skipping mk/optaccum.h (File already exists)'
else
echo 'x - extracting mk/optaccum.h (Text)'
sed 's/^X//' << 'Purdue' > 'mk/optaccum.h' &&
/*
X * OptAccum sums command line switchs into a single string
X * (which is originally (char *)0, or an malloced string).
X * It updates the pchOld by adding pchAdd on the end with a copy
X * of pchSep (if pchAdd is not empty).
X *
X * We need stdio.h.
X *
X * We need to have access to "char *progname;" and "char acOutMem[];"
X * for an out of memory error.
X */
X
extern char *OptAccum(); /* pchNew = OptAccm(pchOld, pchAdd, pchSep); */
Purdue
chmod 0444 mk/optaccum.h ||
echo 'restore of mk/optaccum.h failed'
Wc_c="`wc -c < 'mk/optaccum.h'`"
test 430 -eq "$Wc_c" ||
echo 'mk/optaccum.h: original size 430, current size' "$Wc_c"
fi
# ============= mk/INSTALL ==============
if test -f 'mk/INSTALL' -a X"$1" != X"-c"; then
echo 'x - skipping mk/INSTALL (File already exists)'
else
echo 'x - extracting mk/INSTALL (Text)'
sed 's/^X//' << 'Purdue' > 'mk/INSTALL' &&
You will need the libout library that is avliable on j.cc.purdue.edu.
X
X
1/ Change the default template path in mk.h
X vi mk.h
X
2/ Edit the Makefile to define (or not) the -DRESOURCE flag
X (sysv must be -URESOURCE, I think)
X
X Also set BIN at the top to where mk is to be installed.
X vi Makefile
X
3/ make the mk binary
X make mk
X
4/ install the templates (set the destination directory in that Makefile)
X (cd ../mk-lib && vi Makefile && make install clean)
X
5/ test it if you like
X mk -Vc mk.c Makefile
X (cd Tests && ../mk *)
X
6/ install mk
X make install
X
7/ clean up the source
X make clean
X
8/ Send bugs to ksb@cc.purdue.edu (Kevin Braunsdorf)
X
9/ Thanks!
Purdue
chmod 0444 mk/INSTALL ||
echo 'restore of mk/INSTALL failed'
Wc_c="`wc -c < 'mk/INSTALL'`"
test 657 -eq "$Wc_c" ||
echo 'mk/INSTALL: original size 657, current size' "$Wc_c"
fi
true || echo 'restore of mk/machine.h failed'
echo End of part 5, continue with part 6
exit 0
exit 0 # Just in case...