home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Usenet 1994 October
/
usenetsourcesnewsgroupsinfomagicoctober1994disk2.iso
/
misc
/
volume8
/
libhoward
/
part08
/
new-3.b
< prev
next >
Wrap
Text File
|
1989-10-01
|
2KB
|
75 lines
# new-3.b - create a new section 3 manual entry source file from a prototype
#
# $Header: new-3.b,v 1.1 89/09/21 12:44:29 howard Exp $
#
# Copyright 1989 Howard Lee Gayle
# This file is written in the ISO 8859/1 character set.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 1,
# as published by the Free Software Foundation.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
#
# Shell variables:
# a - file name prefix in all caps
# d - '$'
# f - steps through files to create
# p - file name prefix
# u - usage string
CMDNAME=new-3
export CMDNAME
u="Usage: $CMDNAME file..."
if [ $# -eq 0 ]
then
echo "$u" 1>&2
exit 1
fi
d='$'
for f
do
p=`basename "$f" .3`
a=`echo "$p" | tr '[a-z]' '[A-Z]'`
cat << EOF > "$f"
.\" ${d}Header${d}
.TH $a 3 "${d}Revision${d}"
.SH NAME
$p \-
.SH SYNOPSIS
.nf
.BR "#include <" stdio.h ">"
.fi
.LP
.BR "void " "$p ("
EOF
if [ "$NEWTEXTPATH" ]
then
cat-path "$NEWTEXTPATH" new-3.cprt >> "$f"
fi
cat << EOF >> "$f"
.SH DESCRIPTION
.I $p
.SH RETURNS
.SH EXAMPLES
.nf
.fi
.SH FILES
.SH "SEE ALSO"
.SH DIAGNOSTICS
.SH BUGS
EOF
if [ "$NEWTEXTPATH" ]
then
cat-path "$NEWTEXTPATH" new-3.txt >> "$f"
fi
done