allbery@uunet.UU.NET (Brandon S. Allbery - comp.sources.misc) (10/01/89)
Posting-number: Volume 8, Issue 86 Submitted-by: howard@dahlbeck.ericsson.se (Howard Gayle) Archive-name: libhoward/part08 #! /bin/sh # This is a shell archive. Remove anything before this line, then feed it # into a shell via "sh file" or similar. To overwrite existing files, # type "sh file -c". # The tool that generated this appeared in the comp.sources.unix newsgroup; # send mail to comp-sources-unix@uunet.uu.net if you want that tool. # If this archive is complete, you will see the following message at the end: # "End of archive 8 (of 9)." # Contents: MakeCommon cat-path.1 cia.1 cia.b copy-self.b freeze.1 # gold-lt.tex lnR.1 lnR0.b malf.h mcpstr.3 memcmp.c mfclose.c # mfopen.c mkFreeze.b new-1.b new-3.b new-MakeC.b smpdtl.c strend.3 # strend.c usage.3 usage.c userfn.3 # Wrapped by howard@hasse on Mon Sep 25 07:08:15 1989 PATH=/bin:/usr/bin:/usr/ucb ; export PATH if test -f 'MakeCommon' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'MakeCommon'\" else echo shar: Extracting \"'MakeCommon'\" \(1412 characters\) sed "s/^X//" >'MakeCommon' <<'END_OF_FILE' X# MakeCommon - common definitions for uMakefile and Makefile for howard X# X# $Header: MakeCommon,v 1.3 89/09/22 13:46:45 howard Exp $ X# X# Copyright 1989 Howard Lee Gayle X# This file is written in the ISO 8859/1 character set. X# X# This program is free software; you can redistribute it and/or modify X# it under the terms of the GNU General Public License version 1, X# as published by the Free Software Foundation. X# X# This program is distributed in the hope that it will be useful, X# but WITHOUT ANY WARRANTY; without even the implied warranty of X# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the X# GNU General Public License for more details. X# X# You should have received a copy of the GNU General Public License X# along with this program; if not, write to the Free Software X# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. X X# Commands: X X# Change mode of a file. XCHMOD=chmod X X# Get a file from the distribution directory. XDISTI=mkDistI X X# Write arguments on stdout. XECHO=echo X X# Remove a file. XRM=zap -f X X# Perform set difference operations. XSETS=sets X X# Uncompress if necessary and check out from RCS or SCCS. XUNCMPRS=mkUncmprs X X X# C include file search path. XINCLUDES=-I/usr/local/local-include -I/usr/local/free/howard/1/include X X# Special C programs. These are *not* library functions. XSCS = mk-smp.c X X# Generated C include files. Xit = cc-lims.i libc-lims.i registers.i simultipre.i END_OF_FILE if test 1412 -ne `wc -c <'MakeCommon'`; then echo shar: \"'MakeCommon'\" unpacked with wrong size! fi # end of 'MakeCommon' fi if test -f 'cat-path.1' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'cat-path.1'\" else echo shar: Extracting \"'cat-path.1'\" \(1437 characters\) sed "s/^X//" >'cat-path.1' <<'END_OF_FILE' X.\" $Header: cat-path.1,v 1.1 89/09/21 10:52:02 howard Exp $ X.TH CAT-PATH 1 "$Revision: 1.1 $" X.SH NAME Xcat-path \- search path for files and concatenate them X.SH SYNOPSIS X.B cat-path X.I path X.I filename \&.\|.\|. X.SH COPYRIGHT XCopyright \(co 1989 Howard Lee Gayle X.SH DESCRIPTION X.I cat-path Xsearches X.IR path , Xa colon-separated list of directories, Xfor each given file, then copies it to standard output. XDirectory names in X.I path Xmust X.I not Xend with /. X.SH EXAMPLE XSearch for an include file: X.nf X % cat-path /usr/include:/usr/local/include limits.h X.fi X.SH BUGS XShould be more relaxed about directory name syntax. X.SH LICENSE XThis program is free software; you can redistribute it and/or modify Xit under the terms of the GNU General Public License version 1, Xas published by the Free Software Foundation. X.PP XThis program is distributed in the hope that it will be useful, Xbut WITHOUT ANY WARRANTY; without even the implied warranty of XMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the XGNU General Public License for more details. X.PP XYou should have received a copy of the GNU General Public License Xalong with this program; if not, write to the Free Software XFoundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. X.SH AUTHOR XHoward Gayle, XTN/ETX/T/BG, XEricsson Telecom AB, XS-126 25 Stockholm, XSweden, Xhoward@ericsson.se, Xuunet!ericsson.se!howard, XPhone: +46 8 719 5565, XFAX: +46 8 719 9598, XTelex: 14910 ERIC S END_OF_FILE if test 1437 -ne `wc -c <'cat-path.1'`; then echo shar: \"'cat-path.1'\" unpacked with wrong size! fi # end of 'cat-path.1' fi if test -f 'cia.1' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'cia.1'\" else echo shar: Extracting \"'cia.1'\" \(1455 characters\) sed "s/^X//" >'cia.1' <<'END_OF_FILE' X.\" $Header: cia.1,v 1.1 89/09/23 14:11:22 howard Exp $ X.TH CIA 1 "$Revision: 1.1 $" X.SH NAME Xcia \- check files into RCS with strict locking X.SH SYNOPSIS X.B cia X.RB [ " \-u " ] X.I filename \&.\|.\|. X.SH COPYRIGHT XCopyright \(co 1989 Howard Lee Gayle X.SH DESCRIPTION X.I cia Xchecks the given files into RCS files in an RCS subdirectory, Xand turns on strict locking. XThe X.B \-u Xoption causes it to check out the files again. X.SH EXAMPLE X.nf X % cia foo.c foo.1 X.fi X.SH FILES X.DT X.nf XRCS/*,v \- RCS files X.fi X.SH "SEE ALSO" X.IR ci (1), X.IR kgb (0). X.SH BUGS XA X.B \-l Xoption to do co\ \-l would be nice. X.SH ETYMOLOGY XCheck in all, of course. X.SH LICENSE XThis program is free software; you can redistribute it and/or modify Xit under the terms of the GNU General Public License version 1, Xas published by the Free Software Foundation. X.PP XThis program is distributed in the hope that it will be useful, Xbut WITHOUT ANY WARRANTY; without even the implied warranty of XMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the XGNU General Public License for more details. X.PP XYou should have received a copy of the GNU General Public License Xalong with this program; if not, write to the Free Software XFoundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. X.SH AUTHOR XHoward Gayle, XTN/ETX/T/BG, XEricsson Telecom AB, XS-126 25 Stockholm, XSweden, Xhoward@ericsson.se, Xuunet!ericsson.se!howard, XPhone: +46 8 719 5565, XFAX: +46 8 719 9598, XTelex: 14910 ERIC S END_OF_FILE if test 1455 -ne `wc -c <'cia.1'`; then echo shar: \"'cia.1'\" unpacked with wrong size! fi # end of 'cia.1' fi if test -f 'cia.b' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'cia.b'\" else echo shar: Extracting \"'cia.b'\" \(1488 characters\) sed "s/^X//" >'cia.b' <<'END_OF_FILE' X X# cia - Check in arguments to RCS X# X# $Header: cia.b,v 1.3 89/09/23 14:06:03 howard Exp $ X# X# Copyright 1989 Howard Lee Gayle X# This file is written in the ISO 8859/1 character set. X# X# This program is free software; you can redistribute it and/or modify X# it under the terms of the GNU General Public License version 1, X# as published by the Free Software Foundation. X# X# This program is distributed in the hope that it will be useful, X# but WITHOUT ANY WARRANTY; without even the implied warranty of X# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the X# GNU General Public License for more details. X# X# You should have received a copy of the GNU General Public License X# along with this program; if not, write to the Free Software X# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. X# X# Shell variables: X# c - flag to check out again X# f - steps through files X# r - RCS file X# u - usage string X XCMDNAME=cia Xexport CMDNAME Xu="Usage: $CMDNAME [-u] file..." Xif [ "x$1" = x-u ] Xthen X c=1 X shift Xfi Xif [ $# -eq 0 ] Xthen X echo "$u" 1>&2 X exit 1 Xfi Xif [ ! -d RCS ] Xthen X echo "$CMDNAME: no RCS directory" 1>&2 X exit 1 Xfi Xfor f Xdo X if [ -r "$f" ] X then X r="RCS/$f,v" X if [ -f "$r" ] X then X echo "$CMDNAME: $r: RCS file already exists" 1>&2 X else X ci "$f" "$r" && rcs -L "$r" X if [ $c ] X then X co "$f" X fi X fi X else X echo "$CMDNAME: $f: file not readable" 1>&2 X fi Xdone X END_OF_FILE if test 1488 -ne `wc -c <'cia.b'`; then echo shar: \"'cia.b'\" unpacked with wrong size! fi # end of 'cia.b' fi if test -f 'copy-self.b' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'copy-self.b'\" else echo shar: Extracting \"'copy-self.b'\" \(1500 characters\) sed "s/^X//" >'copy-self.b' <<'END_OF_FILE' X X# copy-self - break link X# X# $Header: copy-self.b,v 1.5 89/09/21 07:18:17 howard Exp $ X# X# Copyright 1989 Howard Lee Gayle X# This file is written in the ISO 8859/1 character set. X# X# This program is free software; you can redistribute it and/or modify X# it under the terms of the GNU General Public License version 1, X# as published by the Free Software Foundation. X# X# This program is distributed in the hope that it will be useful, X# but WITHOUT ANY WARRANTY; without even the implied warranty of X# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the X# GNU General Public License for more details. X# X# You should have received a copy of the GNU General Public License X# along with this program; if not, write to the Free Software X# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. X# X# Shell variables: X# d - directory in which file resides X# g - directory is group-writeable X# f - step through file names X# t - temporary file name X# u - usage string X XCMDNAME=copy-self Xexport CMDNAME Xu="Usage: $CMDNAME [-r] file..." Xif [ $# -eq 0 ] Xthen X echo "$u" 1>&2 X exit 1 Xfi Xif [ "x$1" = x-r ] Xthen X shift X for f X do X d=`dirname "$f"` X t="$d"/.copy-self$$ X cp "$f" $t && mv -f $t "$f" X done Xelse X for f X do X d=`dirname "$f"` X t="$d"/.copy-self$$ X g=`ls -ld "$d" | grep '^d....w'` X if [ "$g" ] X then X cp "$f" $t && mv -f $t "$f" && chmod ug+w "$f" X else X cp "$f" $t && mv -f $t "$f" && chmod u+w "$f" X fi X done Xfi END_OF_FILE if test 1500 -ne `wc -c <'copy-self.b'`; then echo shar: \"'copy-self.b'\" unpacked with wrong size! fi # end of 'copy-self.b' fi if test -f 'freeze.1' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'freeze.1'\" else echo shar: Extracting \"'freeze.1'\" \(1861 characters\) sed "s/^X//" >'freeze.1' <<'END_OF_FILE' X.\" $Header: freeze.1,v 1.1 89/09/23 14:22:28 howard Exp $ X.TH FREEZE 1 "$Revision: 1.1 $" X.SH NAME Xfreeze \- record latest revisions of all RCS files in directory X.SH SYNOPSIS X.B freeze X.BI [\-r revision ] X.SH COPYRIGHT XCopyright \(co 1989 Howard Lee Gayle X.SH DESCRIPTION X.I freeze XRecords the names, latest revisions, and latest modification Xtimes of the RCS files in the RCS subdirectory. XIt records them in an RCS file named FREEZE. X(To keep Bertrand Russell happy, information about FREEZE is X.I not Xrecorded.) XFREEZE is created if necessary. XIf the X.B \-r Xoption is present, the given revision is passed to X.IR ci (1) Xwhen checking in FREEZE. X.SH EXAMPLE XFreezing the first internal release after external release 2: X.nf X % freeze -r3 X.fi X.SH FILES X.DT X.nf XRCS/*,v \- RCS file X.fi X.SH "SEE ALSO" X.IR rcs (1), X.IR freezePch (1). X.SH "IN FUTURE" XIt would be useful to have a command to check out the revision Xof every file in a given FREEZE file. XFor instance, if a bug report comes in about revision 2.7, it Xwould be easy to recreate it. X.SH LICENSE XThis program is free software; you can redistribute it and/or modify Xit under the terms of the GNU General Public License version 1, Xas published by the Free Software Foundation. X.PP XThis program is distributed in the hope that it will be useful, Xbut WITHOUT ANY WARRANTY; without even the implied warranty of XMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the XGNU General Public License for more details. X.PP XYou should have received a copy of the GNU General Public License Xalong with this program; if not, write to the Free Software XFoundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. X.SH AUTHOR XHoward Gayle, XTN/ETX/T/BG, XEricsson Telecom AB, XS-126 25 Stockholm, XSweden, Xhoward@ericsson.se, Xuunet!ericsson.se!howard, XPhone: +46 8 719 5565, XFAX: +46 8 719 9598, XTelex: 14910 ERIC S END_OF_FILE if test 1861 -ne `wc -c <'freeze.1'`; then echo shar: \"'freeze.1'\" unpacked with wrong size! fi # end of 'freeze.1' fi if test -f 'gold-lt.tex' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'gold-lt.tex'\" else echo shar: Extracting \"'gold-lt.tex'\" \(1887 characters\) sed "s/^X//" >'gold-lt.tex' <<'END_OF_FILE' X% gold-lt.tex - set LaTeX paper size X% X% Copyright 1989 Howard Lee Gayle X% This file is written in the ISO 8859/1 character set. X% X% $Header: gold-lt.tex,v 1.2 89/08/28 19:02:50 howard Exp $ X% X% This program is free software; you can redistribute it and/or modify X% it under the terms of the GNU General Public License version 1, X% as published by the Free Software Foundation. X% X% This program is distributed in the hope that it will be useful, X% but WITHOUT ANY WARRANTY; without even the implied warranty of X% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the X% GNU General Public License for more details. X% X% You should have received a copy of the GNU General Public License X% along with this program; if not, write to the Free Software X% Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. X% X% This file is for LaTeX output for A4 paper that may later be X% copied to 8.5 X 11 inch paper. It maintains the following constraints: X% 1) Top and side margins are at least 25 mm, even after copying. X% 2) The bottom margin (below the page number) is at least 10 mm, X% even after copying. X% 3) The body has the golden ratio. X% 4) The width should be 2--3 alphabets. X% X% The numbers are derived as follows. An A4 page is 297 X 210 mm. X% An 8.5 X 11 page is 279 X 216 mm, rounded to the nearest mm. X% Allowing 25 mm for the top margin, 11 mm for the footer, and X% 10 mm for the bottom margin, we can compute the text height X% from the height of the shorter page (the 8.5 X 11) as: X% 279 - 25 - 11 - 10 = 233 mm. Dividing by the golden ratio X% 0.5 * (1 + sqrt (5)) = 1.6180339887498948482045868343656381177203091798057628 X% gives the text width of 145 mm. This leaves X% (210 - 145) / 2 = 32 mm for the side margins with the narrower X% (A4) paper. X% X\setlength{\textheight}{233mm} X\setlength{\textwidth}{145mm} X\topmargin -14mm X\oddsidemargin 9mm X\evensidemargin 9mm END_OF_FILE if test 1887 -ne `wc -c <'gold-lt.tex'`; then echo shar: \"'gold-lt.tex'\" unpacked with wrong size! fi # end of 'gold-lt.tex' fi if test -f 'lnR.1' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'lnR.1'\" else echo shar: Extracting \"'lnR.1'\" \(1639 characters\) sed "s/^X//" >'lnR.1' <<'END_OF_FILE' X.\" $Header: lnR.1,v 1.2 89/09/15 11:45:47 howard Exp $ X.TH LNR 1 "$Revision: 1.2 $" X.SH NAME XlnR \- link contents of directory recursively X.SH SYNOPSIS X.B lnR X.RB [ " \-s " ] X.RB [ " \-v " ] X.I from to X.SH COPYRIGHT XCopyright \(co 1989 Howard Lee Gayle X.SH DESCRIPTION X.I LnR Xlinks the files in directory X.I from Xand recursively all subdirectories into the directory X.IR to . XIt creates directories as necessary. XIn other words, it performs a shallow copy. X.SH OPTIONS X.nr xx (\w'\-s 'u+2n)/1n X.TP \n(xx X.B \-s XUse symbolic links. XThe default is to use hard links. X.TP X.B \-v XVerbose. X.SH EXAMPLE X.nf X lnR /usr/local/free-dist/tex/2.93 /usr/local/free/tex/2.93 X.fi X.SH "SEE ALSO" X.IR ln (1). X.SH BUGS XIt should handle block and character special files. XIt should be able to copy directories' owners, groups, and modes. X.SH LICENSE XThis program is free software; you can redistribute it and/or modify Xit under the terms of the GNU General Public License version 1, Xas published by the Free Software Foundation. X.PP XThis program is distributed in the hope that it will be useful, Xbut WITHOUT ANY WARRANTY; without even the implied warranty of XMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the XGNU General Public License for more details. X.PP XYou should have received a copy of the GNU General Public License Xalong with this program; if not, write to the Free Software XFoundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. X.SH AUTHOR XHoward Gayle, XTN/ETX/T/BG, XEricsson Telecom AB, XS-126 25 Stockholm, XSweden, Xhoward@ericsson.se, Xuunet!ericsson.se!howard, XPhone: +46 8 719 5565, XFAX: +46 8 719 9598, XTelex: 14910 ERIC S END_OF_FILE if test 1639 -ne `wc -c <'lnR.1'`; then echo shar: \"'lnR.1'\" unpacked with wrong size! fi # end of 'lnR.1' fi if test -f 'lnR0.b' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'lnR0.b'\" else echo shar: Extracting \"'lnR0.b'\" \(1535 characters\) sed "s/^X//" >'lnR0.b' <<'END_OF_FILE' X X# lnR0 - auxiliary shell file for lnR X# X# $Header: lnR0.b,v 1.4 89/09/21 19:22:16 howard Exp $ X# X# Copyright 1989 Howard Lee Gayle X# This file is written in the ISO 8859/1 character set. X# X# This program is free software; you can redistribute it and/or modify X# it under the terms of the GNU General Public License version 1, X# as published by the Free Software Foundation. X# X# This program is distributed in the hope that it will be useful, X# but WITHOUT ANY WARRANTY; without even the implied warranty of X# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the X# GNU General Public License for more details. X# X# You should have received a copy of the GNU General Public License X# along with this program; if not, write to the Free Software X# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. X# X# Shell variables: X# l - ln command X# m - mkdir command X# u - usage string X Xu='Usage: lnR0 symbolic verbose from to' Xif [ $# -ne 4 ] Xthen X echo "$u" 1>&2 X exit 1 Xfi Xl='ln' Xm='mkdir' Xif [ -b "$3" -o -c "$3" -o -p "$3" ] Xthen X echo "$CMDNAME: can not link $3" 1>&2 X exit 1 Xelif [ -h "$3" ] Xthen X s=`ls -l "$3" | sed -e 's;^..* -> ;;'` X if [ $2 = 1 ] X then X echo ln -s "$s" "$4" X fi X $l -s "$s" "$4" Xelif [ -d "$3" ] Xthen X if [ ! -d "$4" ] X then X if [ $2 = 1 ] X then X echo mkdir "$4" X fi X $m "$4" X fi Xelif [ -f "$3" ] Xthen X if [ $2 = 1 ] X then X echo ln $1 "$3" "$4" X fi X $l $1 "$3" "$4" Xelse X echo "$CMDNAME: file $3 does not exist" 1>&2 X exit 1 Xfi END_OF_FILE if test 1535 -ne `wc -c <'lnR0.b'`; then echo shar: \"'lnR0.b'\" unpacked with wrong size! fi # end of 'lnR0.b' fi if test -f 'malf.h' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'malf.h'\" else echo shar: Extracting \"'malf.h'\" \(1636 characters\) sed "s/^X//" >'malf.h' <<'END_OF_FILE' X/* malf.h - Declarations for using malf() functions. X * X * Copyright 1989 Howard Lee Gayle X * X * $Header: malf.h,v 1.18 89/08/20 10:45:05 howard Exp $ X * X * This program is free software; you can redistribute it and/or modify X * it under the terms of the GNU General Public License version 1, X * as published by the Free Software Foundation. X * X * This program is distributed in the hope that it will be useful, X * but WITHOUT ANY WARRANTY; without even the implied warranty of X * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the X * GNU General Public License for more details. X * X * You should have received a copy of the GNU General Public License X * along with this program; if not, write to the Free Software X * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. X * X * Prerequisites: howard/port.h, howard/version.h. X */ X X/* If this Boolean is true, calling malf() with a nonzero exit X * code will result in an abort() call and core dump instead of an X * exit() call.*/ XPUBLIC boolT _debug; X XPUBLIC bStrT getlic(); XPUBLIC bStrT getlin(); XPUBLIC bStrT getpwf(); XPUBLIC void malf(); XPUBLIC void malf0(); XPUBLIC void malf1(); XPUBLIC voidPT mcalloc(); XPUBLIC bStrT mcpstr(); XPUBLIC void mfclose(); XPUBLIC void mfcopy(); XPUBLIC void mfflush(); XPUBLIC streamT mfopen(); XPUBLIC void mfseek(); XPUBLIC streamT mopenp(); XPUBLIC boolT msgfn(); XPUBLIC bStrT prefix(); XPUBLIC bStrT prefxi(); XPUBLIC void putspn(); XPUBLIC void qrndr (); XPUBLIC void qrnds (); XPUBLIC long qrndu (); XPUBLIC bStrT strend(); XPUBLIC bStrT userfn(); XPUBLIC unsigned yrwk(); END_OF_FILE if test 1636 -ne `wc -c <'malf.h'`; then echo shar: \"'malf.h'\" unpacked with wrong size! fi # end of 'malf.h' fi if test -f 'mcpstr.3' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'mcpstr.3'\" else echo shar: Extracting \"'mcpstr.3'\" \(1602 characters\) sed "s/^X//" >'mcpstr.3' <<'END_OF_FILE' X.\" $Header: mcpstr.3,v 1.2 89/05/18 10:56:17 howard Exp $ X.TH MCPSTR "3 -lhoward" "$Revision: 1.2 $" "Howard\'s C library" "Howard\'s C library" X.SH NAME Xmcpstr \- make a new copy of a string and check for errors X.SH SYNOPSIS X.nf X.BR "#include <" stdio.h ">" X.BR "#include <" howard/port.h ">" X.BR "#include <" howard/malf.h ">" X.fi X.LP X.RI "bStrT mcpstr (" orig ")" X.nf X.RI "bStrT " orig ";" X.SH COPYRIGHT XCopyright \(co 1989 Howard Lee Gayle X.SH DESCRIPTION X.I Mcpstr Xallocates dynamic memory (using X.IR malloc (3)) Xto hold the string X.IR orig . XIt then copies X.I orig Xinto the newly allocated memory, and returns a pointer to it. XHowever, if X.I malloc Xindicates an error then X.I mcpstr Xcalls X.I malf1 "," Xwhich does not return. X.SH "SEE ALSO" X.IR malloc (3), X.IR malf "(3 -lhoward)." X.SH LICENSE XThis program is free software; you can redistribute it and/or modify Xit under the terms of the GNU General Public License version 1, Xas published by the Free Software Foundation. X.PP XThis program is distributed in the hope that it will be useful, Xbut WITHOUT ANY WARRANTY; without even the implied warranty of XMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the XGNU General Public License for more details. X.PP XYou should have received a copy of the GNU General Public License Xalong with this program; if not, write to the Free Software XFoundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. X.SH AUTHOR XHoward Gayle, XTN/ETX/T/BG, XEricsson Telecom AB, XS-126 25 Stockholm, XSweden, Xhoward@ericsson.se, Xuunet!ericsson.se!howard, XPhone: +46 8 719 5565, XFAX: +46 8 719 9598, XTelex: 14910 ERIC S END_OF_FILE if test 1602 -ne `wc -c <'mcpstr.3'`; then echo shar: \"'mcpstr.3'\" unpacked with wrong size! fi # end of 'mcpstr.3' fi if test -f 'memcmp.c' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'memcmp.c'\" else echo shar: Extracting \"'memcmp.c'\" \(569 characters\) sed "s/^X//" >'memcmp.c' <<'END_OF_FILE' X/* X * memcmp - compare arrays of bytes X * X * Public domain code by Henry Spencer. X */ X X#include <stdio.h> X#include <howard/port.h> X#include <howard/version.h> X XMODVER ("@(#)$Header: memcmp.c,v 1.1 89/08/15 18:17:12 howard Exp $"); X X#ifdef NOMEMCMP Xint /* <0, == 0, >0 */ Xmemcmp(s1, s2, size) X char * s1; X char * s2; Xint size; X{ X register char *scan1; X register char *scan2; X register int n; X X scan1 = s1; X scan2 = s2; X for (n = size; n > 0; n--) X if (*scan1 == *scan2) { X scan1++; X scan2++; X } else X return(*scan1 - *scan2); X X return(0); X} X#endif NOMEMCMP END_OF_FILE if test 569 -ne `wc -c <'memcmp.c'`; then echo shar: \"'memcmp.c'\" unpacked with wrong size! fi # end of 'memcmp.c' fi if test -f 'mfclose.c' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'mfclose.c'\" else echo shar: Extracting \"'mfclose.c'\" \(1668 characters\) sed "s/^X//" >'mfclose.c' <<'END_OF_FILE' X/* X * mfclose - fclose() + malf1() X */ X X#ifndef lint Xstatic char _cpyrgt[] = "Copyright 1989 Howard Lee Gayle"; X#endif lint X X/* X * This program is free software; you can redistribute it and/or modify X * it under the terms of the GNU General Public License version 1, X * as published by the Free Software Foundation. X * X * This program is distributed in the hope that it will be useful, X * but WITHOUT ANY WARRANTY; without even the implied warranty of X * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the X * GNU General Public License for more details. X * X * You should have received a copy of the GNU General Public License X * along with this program; if not, write to the Free Software X * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. X */ X X#include <stdio.h> X#include <howard/port.h> X#include <howard/version.h> X XMODVER ("@(#)$Header: mfclose.c,v 1.3 89/08/13 14:53:25 howard Exp $"); X X#include <howard/malf.h> X#include <howard/registers.i> X XPUBLIC void mfclose (s, n) XstreamT s; /* Stream to close.*/ XbStrT n; /* File name.*/ X X X/* Function: X * X * Algorithm: X * Call fclose(). On error call malf1(). X * Returns: X * X * Notes: X * X */ X{ Xif (fclose (s)) malf1 ("%s: Can not close", n); X} X X#ifdef TEST X#include <howard/usage.h> X XMAINVER ("@(#)$Header: mfclose.c,v 1.3 89/08/13 14:53:25 howard Exp $"); XUSAGE ("file"); X XPUBLIC int main (argc, argv) Xint argc; /* Number of arguments.*/ XbStrT *argv; /* Points to array of argument strings.*/ X{ Xif (2 != argc) usage(); Xmfclose (mfopen (argv[1], "r"), argv[1]); XPUTS ("Success"); Xmfflush (stdout, "Standard Output"); Xexit (SUCCESS); X X#ifdef lint Xreturn (SUCCESS); X#endif X} X#endif END_OF_FILE if test 1668 -ne `wc -c <'mfclose.c'`; then echo shar: \"'mfclose.c'\" unpacked with wrong size! fi # end of 'mfclose.c' fi if test -f 'mfopen.c' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'mfopen.c'\" else echo shar: Extracting \"'mfopen.c'\" \(1792 characters\) sed "s/^X//" >'mfopen.c' <<'END_OF_FILE' X/* X * mfopen - try to open file and report errors with malf X */ X X#ifndef lint Xstatic char _cpyrgt[] = "Copyright 1989 Howard Lee Gayle"; X#endif lint X X/* X * This program is free software; you can redistribute it and/or modify X * it under the terms of the GNU General Public License version 1, X * as published by the Free Software Foundation. X * X * This program is distributed in the hope that it will be useful, X * but WITHOUT ANY WARRANTY; without even the implied warranty of X * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the X * GNU General Public License for more details. X * X * You should have received a copy of the GNU General Public License X * along with this program; if not, write to the Free Software X * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. X */ X X#include <stdio.h> X#include <howard/port.h> X#include <howard/version.h> X XMODVER ("@(#)$Header: mfopen.c,v 1.5 89/08/13 15:07:38 howard Exp $"); X X#include <howard/malf.h> X#include <howard/registers.i> X XPUBLIC streamT mfopen (n, m) XbStrT n; /* File name.*/ XbStrT m; /* Mode string.*/ X X/* Function: X * Attempt to open the file. On error call malf1(). X * Algorithm: X * Call fopen(). X * Returns: X * On success, the streamT for the opened file. No return on error. X * Notes: X * X */ X{ XR1 streamT s = fopen (S(n), S(m)); /* Stream.*/ X Xif (NULSTRM == s) malf1 ("%s: Can not open mode %s", n, m); Xreturn (s); X} X X#ifdef TEST X#include <howard/usage.h> X XMAINVER ("@(#)$Header: mfopen.c,v 1.5 89/08/13 15:07:38 howard Exp $"); XUSAGE ("filename mode"); X XPUBLIC int main (argc, argv) Xint argc; /* Number of arguments.*/ XbStrT *argv; /* Points to array of argument strings.*/ X{ Xif (3 != argc) usage(); X(void) mfopen (argv[1], argv[2]); Xexit (SUCCESS); X X#ifdef lint Xreturn (SUCCESS); X#endif X} X#endif END_OF_FILE if test 1792 -ne `wc -c <'mfopen.c'`; then echo shar: \"'mfopen.c'\" unpacked with wrong size! fi # end of 'mfopen.c' fi if test -f 'mkFreeze.b' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'mkFreeze.b'\" else echo shar: Extracting \"'mkFreeze.b'\" \(1422 characters\) sed "s/^X//" >'mkFreeze.b' <<'END_OF_FILE' X X# mkFreeze - make FREEZE.{date,i,major,minor,version} X# X# $Header: mkFreeze.b,v 1.3 89/09/20 13:40:05 howard Exp $ X# X# Copyright 1989 Howard Lee Gayle X# This file is written in the ISO 8859/1 character set. X# X# This program is free software; you can redistribute it and/or modify X# it under the terms of the GNU General Public License version 1, X# as published by the Free Software Foundation. X# X# This program is distributed in the hope that it will be useful, X# but WITHOUT ANY WARRANTY; without even the implied warranty of X# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the X# GNU General Public License for more details. X# X# You should have received a copy of the GNU General Public License X# along with this program; if not, write to the Free Software X# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. X# X# Shell variables: X# u - usage string X XCMDNAME=mkFreeze Xexport CMDNAME Xu="Usage: $CMDNAME" Xif [ $# -ne 0 ] Xthen X echo "$u" 1>&2 X exit 1 Xfi Xawk '/^.Header: FREEZE,v /{ X print $3 > "FREEZE.version"; X split ($3, t, "."); X print t[1] > "FREEZE.major"; X print t[2] > "FREEZE.minor"; X y=substr($4,1,2); X if (y < 70) y += 2000; else y += 1900; X dat=sprintf "%d-%s-%s %s",y,substr($4,4,2),substr($4,7,2),$5; X print dat > "FREEZE.date"; X d = "#define FRZ_"; X printf "%sMAJ %s\n%sMIN %s\n%sDAT \"%s\"\n%sID \"@(#)%s\"\n",d,t[1],d,t[2],d,dat,d,$0 > "FREEZE.i"; X}' < FREEZE END_OF_FILE if test 1422 -ne `wc -c <'mkFreeze.b'`; then echo shar: \"'mkFreeze.b'\" unpacked with wrong size! fi # end of 'mkFreeze.b' fi if test -f 'new-1.b' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'new-1.b'\" else echo shar: Extracting \"'new-1.b'\" \(1653 characters\) sed "s/^X//" >'new-1.b' <<'END_OF_FILE' X X# new-1.b - create a new section 1 manual entry source file from a prototype X# X# $Header: new-1.b,v 1.2 89/09/21 12:39:49 howard Exp $ X# X# Copyright 1989 Howard Lee Gayle X# This file is written in the ISO 8859/1 character set. X# X# This program is free software; you can redistribute it and/or modify X# it under the terms of the GNU General Public License version 1, X# as published by the Free Software Foundation. X# X# This program is distributed in the hope that it will be useful, X# but WITHOUT ANY WARRANTY; without even the implied warranty of X# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the X# GNU General Public License for more details. X# X# You should have received a copy of the GNU General Public License X# along with this program; if not, write to the Free Software X# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. X# X# Shell variables: X# a - file name prefix in all caps X# d - '$' X# f - steps through files to create X# p - file name prefix X# u - usage string X XCMDNAME=new-1 Xexport CMDNAME Xu="Usage: $CMDNAME file..." Xif [ $# -eq 0 ] Xthen X echo "$u" 1>&2 X exit 1 Xfi Xd='$' Xfor f Xdo X p=`basename "$f" .1` X a=`echo "$p" | tr '[a-z]' '[A-Z]'` X cat << EOF > "$f" X.\" ${d}Header${d} X.TH $a 1 "${d}Revision${d}" X.SH NAME X$p \- X.SH SYNOPSIS X.B $p X.RB [ " \-o " ] X.I filename \&.\|.\|. XEOF X if [ "$NEWTEXTPATH" ] X then X cat-path "$NEWTEXTPATH" new-1.cprt >> "$f" X fi X cat << EOF >> "$f" X.SH DESCRIPTION X.I $p X X.SH OPTIONS X.SH EXAMPLE X.nf X.fi X.SH FILES X.DT X.nf X.fi X.SH "SEE ALSO" X.SH DIAGNOSTICS X.SH BUGS XEOF X if [ "$NEWTEXTPATH" ] X then X cat-path "$NEWTEXTPATH" new-1.txt >> "$f" X fi Xdone END_OF_FILE if test 1653 -ne `wc -c <'new-1.b'`; then echo shar: \"'new-1.b'\" unpacked with wrong size! fi # end of 'new-1.b' fi if test -f 'new-3.b' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'new-3.b'\" else echo shar: Extracting \"'new-3.b'\" \(1656 characters\) sed "s/^X//" >'new-3.b' <<'END_OF_FILE' X X# new-3.b - create a new section 3 manual entry source file from a prototype X# X# $Header: new-3.b,v 1.1 89/09/21 12:44:29 howard Exp $ X# X# Copyright 1989 Howard Lee Gayle X# This file is written in the ISO 8859/1 character set. X# X# This program is free software; you can redistribute it and/or modify X# it under the terms of the GNU General Public License version 1, X# as published by the Free Software Foundation. X# X# This program is distributed in the hope that it will be useful, X# but WITHOUT ANY WARRANTY; without even the implied warranty of X# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the X# GNU General Public License for more details. X# X# You should have received a copy of the GNU General Public License X# along with this program; if not, write to the Free Software X# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. X# X# Shell variables: X# a - file name prefix in all caps X# d - '$' X# f - steps through files to create X# p - file name prefix X# u - usage string X XCMDNAME=new-3 Xexport CMDNAME Xu="Usage: $CMDNAME file..." Xif [ $# -eq 0 ] Xthen X echo "$u" 1>&2 X exit 1 Xfi Xd='$' Xfor f Xdo X p=`basename "$f" .3` X a=`echo "$p" | tr '[a-z]' '[A-Z]'` X cat << EOF > "$f" X.\" ${d}Header${d} X.TH $a 3 "${d}Revision${d}" X.SH NAME X$p \- X.SH SYNOPSIS X.nf X.BR "#include <" stdio.h ">" X.fi X.LP X.BR "void " "$p (" XEOF X if [ "$NEWTEXTPATH" ] X then X cat-path "$NEWTEXTPATH" new-3.cprt >> "$f" X fi X cat << EOF >> "$f" X.SH DESCRIPTION X.I $p X.SH RETURNS X.SH EXAMPLES X.nf X.fi X.SH FILES X.SH "SEE ALSO" X.SH DIAGNOSTICS X.SH BUGS XEOF X if [ "$NEWTEXTPATH" ] X then X cat-path "$NEWTEXTPATH" new-3.txt >> "$f" X fi Xdone END_OF_FILE if test 1656 -ne `wc -c <'new-3.b'`; then echo shar: \"'new-3.b'\" unpacked with wrong size! fi # end of 'new-3.b' fi if test -f 'new-MakeC.b' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'new-MakeC.b'\" else echo shar: Extracting \"'new-MakeC.b'\" \(1624 characters\) sed "s/^X//" >'new-MakeC.b' <<'END_OF_FILE' X X# new-MakeC.b - create a new MakeCommon file from a prototype X# X# $Header: new-MakeC.b,v 1.1 89/09/21 12:48:58 howard Exp $ X# X# Copyright 1989 Howard Lee Gayle X# This file is written in the ISO 8859/1 character set. X# X# This program is free software; you can redistribute it and/or modify X# it under the terms of the GNU General Public License version 1, X# as published by the Free Software Foundation. X# X# This program is distributed in the hope that it will be useful, X# but WITHOUT ANY WARRANTY; without even the implied warranty of X# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the X# GNU General Public License for more details. X# X# You should have received a copy of the GNU General Public License X# along with this program; if not, write to the Free Software X# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. X# X# Shell variables: X# c - '#' X# d - '$' X# f - steps through files to create X# u - usage string X XCMDNAME=new-MakeC Xexport CMDNAME Xu="Usage: $CMDNAME file..." Xif [ $# -eq 0 ] Xthen X echo "$u" 1>&2 X exit 1 Xfi Xc='#' Xd='$' Xfor f Xdo X cat << EOF > "$f" X$c $f - common definitions for uMakefile and Makefile for ~ X$c X$c ${d}Header$d X$c XEOF X if [ "$NEWTEXTPATH" ] X then X cat-path "$NEWTEXTPATH" new.txt | sed -e "s;^;$c ;" >> "$f" X fi X cat << 'EOF' >> "$f" X X# Change mode of a file. XCHMOD=chmod X X# Get a file from the distribution directory. XDISTI=mkDistI X X# Remove a file. XRM=zap -f X X# Uncompress if necessary and check out from RCS or SCCS. XUNCMPRS=mkUncmprs X X# C include file search path. XINCLUDES=-I/usr/local/local-include -I/usr/local/free/howard/0/include XEOF Xdone END_OF_FILE if test 1624 -ne `wc -c <'new-MakeC.b'`; then echo shar: \"'new-MakeC.b'\" unpacked with wrong size! fi # end of 'new-MakeC.b' fi if test -f 'smpdtl.c' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'smpdtl.c'\" else echo shar: Extracting \"'smpdtl.c'\" \(1735 characters\) sed "s/^X//" >'smpdtl.c' <<'END_OF_FILE' X/* X * smpdtl - look up character in digit table X */ X X#ifndef lint Xstatic char _cpyrgt[] = "Copyright 1989 Howard Lee Gayle"; X#endif lint X X/* X * This program is free software; you can redistribute it and/or modify X * it under the terms of the GNU General Public License version 1, X * as published by the Free Software Foundation. X * X * This program is distributed in the hope that it will be useful, X * but WITHOUT ANY WARRANTY; without even the implied warranty of X * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the X * GNU General Public License for more details. X * X * You should have received a copy of the GNU General Public License X * along with this program; if not, write to the Free Software X * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. X */ X X#include <stdio.h> X#include <howard/port.h> X#include <howard/version.h> X XMODVER ("@(#)$Header: smpdtl.c,v 1.6 89/08/14 17:37:31 howard Exp $"); X X#include <errno.h> X#include <string.h> X#include <howard/registers.i> X#include <howard/simultipre.i> X#include <howard/smp.h> X XPUBLIC int smpdtl (c, dt) XR2 rcharT c; /* Character to look up.*/ XR3 bStrT *dt; /* Digit table.*/ X X/* Function: X * Search digit table dt for character c. X * Algorithm: X * Linear search. X * Returns: X * Index into dt on success, -1 on error. X * Notes: X * X */ X{ XR1 bStrT *p; /* Steps through dt.*/ X Xfor (p = dt; (NULBSTR != *p) && (NULCSTR == strchr ((cStrT) *p, c)); ++p) X ; Xreturn ((NULBSTR == *p) ? -1 : p - dt); X} X X#ifdef TEST X#include <howard/usage.h> X XMAINVER ("@(#)$Header: smpdtl.c,v 1.6 89/08/14 17:37:31 howard Exp $"); XUSAGE (""); X X#include <howard/malf.h> X XPUBLIC int main () X{ Xmalf1 ("Testing done in a2smp"); X X#ifdef lint Xreturn (SUCCESS); X#endif X} X#endif END_OF_FILE if test 1735 -ne `wc -c <'smpdtl.c'`; then echo shar: \"'smpdtl.c'\" unpacked with wrong size! fi # end of 'smpdtl.c' fi if test -f 'strend.3' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'strend.3'\" else echo shar: Extracting \"'strend.3'\" \(1536 characters\) sed "s/^X//" >'strend.3' <<'END_OF_FILE' X.\" $Header: strend.3,v 1.6 89/08/14 09:31:24 howard Exp $ X.TH STREND "3 -lhoward" "$Revision: 1.6 $" "Howard\'s C library" "Howard\'s C library" X.SH NAME Xstrend \- return pointer to NUL at end of string X.SH SYNOPSIS X.nf X.BR "#include <" stdio.h ">" X.BR "#include <" howard/port.h ">" X.BR "#include <" howard/malf.h ">" X.fi X.LP X.BR "void " "strend (" X.IR s ) X.nf X.RI "bStrT " s ";" X.SH COPYRIGHT XCopyright \(co 1989 Howard Lee Gayle X.SH DESCRIPTION X.I Strend Xreturns a pointer to the ASCII NUL character that terminates string X.IR s . X.SH DIAGNOSTICS XIf X.I s Xis NULL, X.I strend Xcalls X.IR malf1 "(3 -lhoward)." X.SH "SEE ALSO" X.IR malf "(3 \-lhoward)," X.IR string (3). X.SH LICENSE XThis program is free software; you can redistribute it and/or modify Xit under the terms of the GNU General Public License version 1, Xas published by the Free Software Foundation. X.PP XThis program is distributed in the hope that it will be useful, Xbut WITHOUT ANY WARRANTY; without even the implied warranty of XMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the XGNU General Public License for more details. X.PP XYou should have received a copy of the GNU General Public License Xalong with this program; if not, write to the Free Software XFoundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. X.SH AUTHOR XHoward Gayle, XTN/ETX/T/BG, XEricsson Telecom AB, XS-126 25 Stockholm, XSweden, Xhoward@ericsson.se, Xuunet!ericsson.se!howard, XPhone: +46 8 719 5565, XFAX: +46 8 719 9598, XTelex: 14910 ERIC S X.PP XThe idea comes from PWB, but all code is original. END_OF_FILE if test 1536 -ne `wc -c <'strend.3'`; then echo shar: \"'strend.3'\" unpacked with wrong size! fi # end of 'strend.3' fi if test -f 'strend.c' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'strend.c'\" else echo shar: Extracting \"'strend.c'\" \(1543 characters\) sed "s/^X//" >'strend.c' <<'END_OF_FILE' X/* X * strend - return pointer to NUL at end of string X */ X X#ifndef lint Xstatic char _cpyrgt[] = "Copyright 1989 Howard Lee Gayle"; X#endif lint X X/* X * This program is free software; you can redistribute it and/or modify X * it under the terms of the GNU General Public License version 1, X * as published by the Free Software Foundation. X * X * This program is distributed in the hope that it will be useful, X * but WITHOUT ANY WARRANTY; without even the implied warranty of X * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the X * GNU General Public License for more details. X * X * You should have received a copy of the GNU General Public License X * along with this program; if not, write to the Free Software X * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. X */ X X#include <stdio.h> X#include <howard/port.h> X#include <howard/version.h> X XMODVER ("@(#)$Header: strend.c,v 1.6 89/08/14 09:27:31 howard Exp $"); X X#include <howard/registers.i> X#include <howard/malf.h> X XPUBLIC bStrT strend (p) XR1 bStrT p; /* The string.*/ X X/* Function: X * Return a pointer to the NUL terminator of string p. X * Algorithm: X * Step through it. X * Returns: X * Pointer. X */ X{ Xif (NULBSTR == p) malf1 ("strend: null argument"); Xwhile (EOS != B (*p)) X ++p; Xreturn (p); X} X X#ifdef TEST X#include <howard/usage.h> X XMAINVER ("@(#)$Header: strend.c,v 1.6 89/08/14 09:27:31 howard Exp $"); XUSAGE (""); X Xmain() X{ XbStrT s = S("123"); X Xif (&s[3] != strend (s)) malf1 ("Test failed"); Xexit (SUCCESS); X X#ifdef lint Xreturn (SUCCESS); X#endif X} X#endif END_OF_FILE if test 1543 -ne `wc -c <'strend.c'`; then echo shar: \"'strend.c'\" unpacked with wrong size! fi # end of 'strend.c' fi if test -f 'usage.3' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'usage.3'\" else echo shar: Extracting \"'usage.3'\" \(1769 characters\) sed "s/^X//" >'usage.3' <<'END_OF_FILE' X.\" @(#)$Header: usage.3,v 1.5 89/08/14 09:23:24 howard Exp $ X.TH USAGE "3 -lhoward" "$Revision: 1.5 $" "Howard\'s C library" "Howard\'s C library" X.SH NAME Xusage \- write usage message on standard error and exit X.SH SYNOPSIS X.nf X.BR "#include <" stdio.h ">" X.BR "#include <" howard/port.h ">" X.BR "#include <" howard/version.h ">" X.BR "#include <" howard/usage.h ">" X.PP X.RI "MAINVER (" version ");" X.RI "USAGE (" message ");" X.LP X.BR "void " "usage()" X.SH COPYRIGHT XCopyright \(co 1989 Howard Lee Gayle X.SH DESCRIPTION X.I Usage Xwrites a usage message on standard error and then exits Xwith exit code 1. XIt calls X.IR putspn (3) Xto write the program name. X.SH EXAMPLE XThe following example shows use with rcs. X.nf X MAINVER ("@(#)$Header: usage.3,v 1.5 89/08/14 09:23:24 howard Exp $"); X USAGE ("[-a] [-b] file..."); X \&. X \&. X \&. X main (argc, argv) X \&. X \&. X \&. X if (2 > argc) usage(); X.fi X.SH "SEE ALSO" X.IR putspn "(3 \-lhoward)." X.SH LICENSE XThis program is free software; you can redistribute it and/or modify Xit under the terms of the GNU General Public License version 1, Xas published by the Free Software Foundation. X.PP XThis program is distributed in the hope that it will be useful, Xbut WITHOUT ANY WARRANTY; without even the implied warranty of XMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the XGNU General Public License for more details. X.PP XYou should have received a copy of the GNU General Public License Xalong with this program; if not, write to the Free Software XFoundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. X.SH AUTHOR XHoward Gayle, XTN/ETX/T/BG, XEricsson Telecom AB, XS-126 25 Stockholm, XSweden, Xhoward@ericsson.se, Xuunet!ericsson.se!howard, XPhone: +46 8 719 5565, XFAX: +46 8 719 9598, XTelex: 14910 ERIC S END_OF_FILE if test 1769 -ne `wc -c <'usage.3'`; then echo shar: \"'usage.3'\" unpacked with wrong size! fi # end of 'usage.3' fi if test -f 'usage.c' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'usage.c'\" else echo shar: Extracting \"'usage.c'\" \(1562 characters\) sed "s/^X//" >'usage.c' <<'END_OF_FILE' X/* X * usage - write usage string on standard error and exit X */ X X#ifndef lint Xstatic char _cpyrgt[] = "Copyright 1989 Howard Lee Gayle"; X#endif lint X X/* X * This program is free software; you can redistribute it and/or modify X * it under the terms of the GNU General Public License version 1, X * as published by the Free Software Foundation. X * X * This program is distributed in the hope that it will be useful, X * but WITHOUT ANY WARRANTY; without even the implied warranty of X * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the X * GNU General Public License for more details. X * X * You should have received a copy of the GNU General Public License X * along with this program; if not, write to the Free Software X * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. X */ X X#include <stdio.h> X#include <howard/port.h> X#include <howard/version.h> X XMODVER ("@(#)$Header: usage.c,v 1.6 89/08/14 09:18:44 howard Exp $"); X X#include <howard/malf.h> X#include <howard/usage.h> X XPUBLIC void usage() X X/* Function: X * Write a usage message on stderr. X * Exit with exit code 1. X * Algorithm: X * If the global _progn is set up, write the program name from it. X * Then write the string to which the global _usage points. X */ X{ Xextern bStrT _usage; /* Usage string.*/ X XFPUTS ("Usage: ", stderr); Xputspn(); XPUTC (' ', stderr); XFPUTS ((cStrT) _usage, stderr); XPUTC ('\n', stderr); XFFLUSH (stderr); Xexit (1); X} X X#ifdef TEST XMAINVER ("@(#)$Header: usage.c,v 1.6 89/08/14 09:18:44 howard Exp $"); XUSAGE ("[-a] [-b] {file}"); Xmain() X{ Xusage(); X} X#endif END_OF_FILE if test 1562 -ne `wc -c <'usage.c'`; then echo shar: \"'usage.c'\" unpacked with wrong size! fi # end of 'usage.c' fi if test -f 'userfn.3' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'userfn.3'\" else echo shar: Extracting \"'userfn.3'\" \(1834 characters\) sed "s/^X//" >'userfn.3' <<'END_OF_FILE' X.\" $Header: userfn.3,v 1.1 89/08/20 11:39:55 howard Exp $ X.TH USERFN "3 -lhoward" "$Revision: 1.1 $" "Howard\'s C library" "Howard\'s C library" X.SH NAME Xuserfn \- copy full name of user X.SH SYNOPSIS X.nf X.BR "#include <" stdio.h ">" X.BR "#include <" howard/port.h ">" X.BR "#include <" howard/malf.h ">" X.fi X.LP XbStrT userfn ( X.IR buffer ) X.nf X.RI "bStrT " buffer ; X.fi X.SH COPYRIGHT XCopyright \(co 1989 Howard Lee Gayle X.SH DESCRIPTION X.I userfn Xcopies into the area to which X.I buffer Xpoints the full (real) name of the user running the process Xthat called it. XIt first tries to get the user's login name with X.IR getlogin (3), Xthen gets the password entry with X.IR getpwnam . XIf that fails, it gets the password entry with X.IR getpwuid . XIn either case, it then calls X.I getpwf Xto get the full name. X.SH RETURNS XOn success, a pointer to the NUL in X.I buffer Xat the end of the copied full name. XNULL if the full name is empty or there is no password entry. X.SH "SEE ALSO" X.IR getpwent (3), X.IR getpwf "(3 \-lhoward)." X.SH LICENSE XThis program is free software; you can redistribute it and/or modify Xit under the terms of the GNU General Public License version 1, Xas published by the Free Software Foundation. X.PP XThis program is distributed in the hope that it will be useful, Xbut WITHOUT ANY WARRANTY; without even the implied warranty of XMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the XGNU General Public License for more details. X.PP XYou should have received a copy of the GNU General Public License Xalong with this program; if not, write to the Free Software XFoundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. X.SH AUTHOR XHoward Gayle, XTN/ETX/T/BG, XEricsson Telecom AB, XS-126 25 Stockholm, XSweden, Xhoward@ericsson.se, Xuunet!ericsson.se!howard, XPhone: +46 8 719 5565, XFAX: +46 8 719 9598, XTelex: 14910 ERIC S END_OF_FILE if test 1834 -ne `wc -c <'userfn.3'`; then echo shar: \"'userfn.3'\" unpacked with wrong size! fi # end of 'userfn.3' fi echo shar: End of archive 8 \(of 9\). cp /dev/null ark8isdone MISSING="" for I in 1 2 3 4 5 6 7 8 9 ; do if test ! -f ark${I}isdone ; then MISSING="${MISSING} ${I}" fi done if test "${MISSING}" = "" ; then echo You have unpacked all 9 archives. rm -f ark[1-9]isdone ark[1-9][0-9]isdone else echo You still need to unpack the following archives: echo " " ${MISSING} fi ## End of shell archive. exit 0