From 371bcb367d96ea4787ed636d05bb45093e13ad17 Mon Sep 17 00:00:00 2001 From: Rick Macklem Date: Fri, 2 Jul 1993 07:27:37 +0000 Subject: [PATCH] New manual page system --- usr.bin/ar/Makefile | 9 +- usr.bin/ar/ar.5 | 146 +++++++++ usr.bin/crontab/Makefile | 10 +- usr.bin/crontab/crontab.5 | 188 +++++++++++ usr.bin/file/Makefile | 4 +- usr.bin/hexdump/Makefile | 2 +- usr.bin/lorder/Makefile | 2 +- usr.bin/m4/Makefile | 2 +- usr.bin/man/Makefile | 8 +- usr.bin/man/apropos.1 | 119 +++++++ usr.bin/man/man.1 | 177 +++++++++++ usr.bin/man/man.c | 620 +++++++++++++++++++++++++++++++++++++ usr.bin/man/whatis.1 | 105 +++++++ usr.bin/mkdep/Makefile | 2 +- usr.bin/ranlib/Makefile | 10 +- usr.bin/ranlib/ranlib.5 | 70 +++++ usr.bin/renice/Makefile | 1 + usr.bin/shar/Makefile | 2 +- usr.bin/showmount/Makefile | 1 + usr.bin/uuencode/Makefile | 4 +- usr.bin/vgrind/Makefile | 4 +- usr.bin/vmstat/Makefile | 2 +- usr.bin/w/Makefile | 2 +- usr.bin/which/Makefile | 2 +- usr.bin/window/Makefile | 2 +- usr.bin/xinstall/Makefile | 2 +- usr.bin/yacc/Makefile | 2 +- 27 files changed, 1454 insertions(+), 44 deletions(-) create mode 100644 usr.bin/ar/ar.5 create mode 100644 usr.bin/crontab/crontab.5 create mode 100644 usr.bin/man/apropos.1 create mode 100644 usr.bin/man/man.1 create mode 100644 usr.bin/man/man.c create mode 100644 usr.bin/man/whatis.1 create mode 100644 usr.bin/ranlib/ranlib.5 diff --git a/usr.bin/ar/Makefile b/usr.bin/ar/Makefile index d79757d554..2860f664a0 100644 --- a/usr.bin/ar/Makefile +++ b/usr.bin/ar/Makefile @@ -4,13 +4,8 @@ PROG= ar CFLAGS+=-I${.CURDIR} SRCS= append.c ar.c archive.c contents.c delete.c extract.c misc.c \ move.c print.c replace.c -MAN1= ar.0 -CLEANFILES=ar.5.0 -ar.0: ar.5.0 - -afterinstall: - install -c -o ${MANOWN} -g ${MANGRP} -m ${MANMODE} ar.5.0 \ - ${DESTDIR}${MANDIR}5/ar.0 +MAN1= ar.1 +MAN5= ar.5 .include diff --git a/usr.bin/ar/ar.5 b/usr.bin/ar/ar.5 new file mode 100644 index 0000000000..ac4ca2bed5 --- /dev/null +++ b/usr.bin/ar/ar.5 @@ -0,0 +1,146 @@ +.\" Copyright (c) 1990, 1991 The Regents of the University of California. +.\" All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" 3. All advertising materials mentioning features or use of this software +.\" must display the following acknowledgement: +.\" This product includes software developed by the University of +.\" California, Berkeley and its contributors. +.\" 4. Neither the name of the University nor the names of its contributors +.\" may be used to endorse or promote products derived from this software +.\" without specific prior written permission. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" @(#)ar.5.5 6.3 (Berkeley) 5/10/91 +.\" +.Dd May 10, 1991 +.Dt AR 5 +.Os +.Sh NAME +.Nm ar +.Nd archive (library) file format +.Sh SYNOPSIS +.Fd #include +.Sh DESCRIPTION +The archive command +.Nm ar +combines several files into one. +Archives are mainly used as libraries of object files intended to be +loaded using the link-editor +.Xr ld 1 . +.Pp +A file created with +.Nm ar +begins with the ``magic'' string "!\en". +The rest of the archive is made up of objects, each of which is composed +of a header for a file, a possible file name, and the file contents. +The header is portable between machine architectures, and, if the file +contents are printable, the archive is itself printable. +.Pp +The header is made up of six variable length +.Tn ASCII +fields, followed by a +two character trailer. +The fields are the object name (16 characters), the file last modification +time (12 characters), the user and group id's (each 6 characters), the file +mode (8 characters) and the file size (10 characters). +All numeric fields are in decimal, except for the file mode which is in +octal. +.Pp +The modification time is the file +.Fa st_mtime +field, i.e., +.Dv CUT +seconds since +the epoch. +The user and group id's are the file +.Fa st_uid +and +.Fa st_gid +fields. +The file mode is the file +.Fa st_mode +field. +The file size is the file +.Fa st_size +field. +The two-byte trailer is the string "\`\en". +.Pp +Only the name field has any provision for overflow. +If any file name is more than 16 characters in length or contains an +embedded space, the string "#1/" followed by the +.Tn ASCII +length of the +name is written in the name field. +The file size (stored in the archive header) is incremented by the length +of the name. +The name is then written immediately following the archive header. +.Pp +Any unused characters in any of these fields are written as space +characters. +If any fields are their particular maximum number of characters in +length, there will be no separation between the fields. +.Pp +Objects in the archive are always an even number of bytes long; files +which are an odd number of bytes long are padded with a newline (``\en'') +character, although the size in the header does not reflect this. +.Sh SEE ALSO +.Xr ar 1 , +.Xr stat 2 +.Sh HISTORY +There have been at least four +.Nm ar +formats. +The first was denoted by the leading ``magic'' number 0177555 (stored as +type int). +These archives were almost certainly created on a 16-bit machine, and +contain headers made up of five fields. +The fields are the object name (8 characters), the file last modification +time (type long), the user id (type char), the file mode (type char) and +the file size (type unsigned int). +Files were padded to an even number of bytes. +.Pp +The second was denoted by the leading ``magic'' number 0177545 (stored as +type int). +These archives may have been created on either 16 or 32-bit machines, and +contain headers made up of six fields. +The fields are the object name (14 characters), the file last modification +time (type long), the user and group id's (each type char), the file mode +(type int) and the file size (type long). +Files were padded to an even number of bytes. +For more information on converting from this format see +.Xr arcv 8 . +.Pp +The current archive format (without support for long character names and +names with embedded spaces) was introduced in +.Bx 4.0 . +The headers were the same as the current format, with the exception that +names longer than 16 characters were truncated, and names with embedded +spaces (and often trailing spaces) were not supported. +It has been extended for these reasons, +as described above. +This format is +.Ud . +.Sh COMPATIBILITY +No archive format is currently specified by any standard. +.At V +has historically distributed archives in a different format from +all of the above. diff --git a/usr.bin/crontab/Makefile b/usr.bin/crontab/Makefile index 20e43fe7b9..6457796020 100644 --- a/usr.bin/crontab/Makefile +++ b/usr.bin/crontab/Makefile @@ -12,14 +12,8 @@ SRCS= crontab.c misc.c entry.c env.c CFLAGS+=-I${.CURDIR} -I${.CURDIR}/../../libexec/crond -DDEBUGGING=1 -DBSD -DCRONDIR='"/var/cron"' -fstrength-reduce BINOWN =root BINMODE=4111 -MAN1= crontab.0 -CLEANFILES=crontab.5.0 - -crontab.0: crontab.5.0 - -afterinstall: - install -c -o ${MANOWN} -g ${MANGRP} -m ${MANMODE} crontab.5.0 \ - ${DESTDIR}${MANDIR}5/crontab.0 +MAN1= crontab.1 +MAN5= crontab.5 .include .PATH: ${.CURDIR}/../../libexec/crond diff --git a/usr.bin/crontab/crontab.5 b/usr.bin/crontab/crontab.5 new file mode 100644 index 0000000000..d7cb2d9d73 --- /dev/null +++ b/usr.bin/crontab/crontab.5 @@ -0,0 +1,188 @@ +.\" $Header: /home/cvs/386BSD/src/usr.bin/crontab/crontab.5.5,v 1.1.1.1 1993/06/12 14:53:53 rgrimes Exp $ +.\" +.\"/* Copyright 1988,1990 by Paul Vixie +.\" * All rights reserved +.\" * +.\" * Distribute freely, except: don't remove my name from the source or +.\" * documentation (don't take credit for my work), mark your changes (don't +.\" * get me blamed for your possible bugs), don't alter or remove this +.\" * notice. May be sold if buildable source is provided to buyer. No +.\" * warrantee of any kind, express or implied, is included with this +.\" * software; use at your own risk, responsibility for damages (if any) to +.\" * anyone resulting from the use of this software rests entirely with the +.\" * user. +.\" * +.\" * Send bug reports, bug fixes, enhancements, requests, flames, etc., and +.\" * I'll try to keep a version up to date. I can be reached as follows: +.\" * Paul Vixie, 329 Noe Street, San Francisco, CA, 94114, (415) 864-7013, +.\" * paul@vixie.sf.ca.us || {hoptoad,pacbell,decwrl,crash}!vixie!paul +.\" */ +.TH CRONTAB 5 "15 January 1990" +.UC 4 +.SH NAME +crontab \- tables for driving cron +.SH DESCRIPTION +A +.I crontab +file contains instructions to the +.IR crond (8) +daemon of the general form: ``run this command at this time on this date''. +Each user has their own crontab, and commands in any given crontab will be +executed as the user who owns the crontab. Uucp and News will usually have +their own crontabs, eliminating the need for explicitly running +.IR su (1) +as part of a cron command. +.PP +Blank lines and leading spaces and tabs are ignored. Lines whose first +non-space character is a pound-sign (#) are comments, and are ignored. +Note that comments are not allowed on the same line as cron commands, since +they will be taken to be part of the command. Similarly, comments are not +allowed on the same line as environment variable settings. +.PP +An active line in a crontab will be either an environment setting or a cron +command. An environment setting is of the form, +.PP + name = value +.PP +where the spaces around the equal-sign (=) are optional, and any subsequent +non-leading spaces in +.I value +will be part of the value assigned to +.IR name . +The +.I value +string may be placed in quotes (single or double, but matching) to preserve +leading or trailing blanks. +.PP +Several environment variables are set up +automatically by the +.IR crond (8) +daemon from the /etc/passwd line of the crontab's owner: USER, HOME, and SHELL. +HOME and SHELL may be overridden by settings in the crontab; USER may not. +.PP +(Note: for UUCP, always set SHELL=/bin/sh, or +.IR crond (8) +will cheerfully try to execute your commands using /usr/lib/uucp/uucico.) +.PP +(Another note: the USER variable is sometimes called LOGNAME or worse on +System V... on these systems, LOGNAME will be set rather than USER.) +.PP +In addition to USER, HOME, and SHELL, +.IR crond (8) +will look at MAILTO if it has any reason to send mail as a result of running +commands in ``this'' crontab. If MAILTO is defined (and non-empty), mail is +sent to the user so named. If MAILTO is defined but empty (MAILTO=""), no +mail will be sent. Otherwise mail is sent to the owner of the crontab. This +option is useful if you decide on /bin/mail instead of /usr/lib/sendmail as +your mailer when you install cron -- /bin/mail doesn't do aliasing, and UUCP +usually doesn't read its mail. +.PP +The format of a cron command is very much the V7 standard, with a number of +upward-compatible extensions. Each line has five time and date fields, +followed by a command. Commands are executed by +.IR crond (8) +when the minute, hour, and month of year fields match the current time, +.I and +when at least one of the two day fields (day of month, or day of week) +match the current time (see ``Note'' below). +.IR crond (8) +examines cron entries once every minute. +The time and date fields are: +.IP +.ta 1.5i +field allowed values +.br +----- -------------- +.br +minute 0-59 +.br +hour 0-23 +.br +day of month 0-31 +.br +month 0-12 (or names, see below) +.br +day of week 0-7 (0 or 7 is Sun, or use names) +.br +.PP +A field may be an asterisk (*), which always matches the +current time. +.PP +Ranges of numbers are allowed. Ranges are two numbers separated +with a hyphen. The specified range is inclusive. For example, +8-11 for an ``hours'' entry specifies execution at hours 8, 9, 10 +and 11. +.PP +Lists are allowed. A list is a set of numbers (or ranges) +separated by commas. Examples: ``1,2,5,9'', ``0-4,8-12''. +.PP +Step values can be used in conjunction with ranges. Following +a range with ``/'' specifies skips of the number's value +through the range. For example, ``0-23/2'' can be used in the hours +field to specify command execution every other hour (the alternative +in the V7 standard is ``0,2,4,6,8,10,12,14,16,18,20,22''). +.PP +Names can also be used for the ``month'' and ``day of week'' +fields. Use the first three letters of the particular +day or month (case doesn't matter). Ranges or +lists of names are not allowed. +.PP +The ``sixth'' field (the rest of the line) specifies the command to be +run. +The entire command portion of the line, up to a newline or % +character, will be executed by the user's login shell or by the shell +specified in the SHELL variable of the cronfile. +Percent-signs (%) in the command, unless escaped with backslash +(\\), will be changed into newline characters, and all data +after the first % will be sent to the command as standard +input. +.PP +Note: The day of a command's execution can be specified by two +fields \(em day of month, and day of week. If both fields are +restricted (ie, aren't *), the command will be run when +.I either +field matches the current time. For example, +.br +``30 4 1,15 * 5'' +would cause a command to be run at 4:30 am on the 1st and 15th of each +month, plus every Friday. +.SH EXAMPLE CRON FILE +.nf + +# use /bin/sh to run commands, no matter what /etc/passwd says +SHELL=/bin/sh +# mail any output to `paul', no matter whose crontab this is +MAILTO=paul +# +# run five minutes after midnight, every day +5 0 * * * $HOME/bin/daily.job >> $HOME/tmp/out 2>&1 +# run at 2:15pm on the first of every month -- output mailed to paul +15 14 1 * * $HOME/bin/monthly +# run at 10 pm on weekdays, annoy Joe +0 22 * * 1-5 mail -s "It's 10pm" joe%Joe,%%Where are your kids?% +23 0-23/2 * * * echo "run 23 minutes after midn, 2am, 4am ..., everyday" +5 4 * * sun echo "run at 5 after 4 every sunday" +.fi +.SH SEE ALSO +crond(8), crontab(1) +.SH EXTENSIONS +When specifying day of week, both day 0 and day 7 will be considered Sunday. +BSD and ATT seem to disagree about this. +.PP +Lists and ranges are allowed to co-exist in the same field. "1-3,7-9" would +be rejected by ATT or BSD cron -- they want to see "1-3" or "7,8,9" ONLY. +.PP +Ranges can include "steps", so "1-9/2" is the same as "1,3,5,7,9". +.PP +Names of months or days of the week can be specified by name. +.PP +Environment variables can be set in the crontab. In BSD or ATT, the +environment handed to child processes is basically the one from /etc/rc. +.PP +Command output is mailed to the crontab owner (BSD can't do this), can be +mailed to a person other than the crontab owner (SysV can't do this), or the +feature can be turned off and no mail will be sent at all (SysV can't do this +either). +.SH AUTHOR +.nf +Paul Vixie, paul@vixie.sf.ca.us diff --git a/usr.bin/file/Makefile b/usr.bin/file/Makefile index 0d6214de0f..9f5484bd49 100644 --- a/usr.bin/file/Makefile +++ b/usr.bin/file/Makefile @@ -7,8 +7,8 @@ PROG= file SRCS= file.c apprentice.c fsmagic.c softmagic.c ascmagic.c is_tar.c \ print.c compress.c CFLAGS+= -DMAGIC='"$(MAGIC)"' -MAN1= file.0 -MAN5= magic.0 +MAN1= file.1 +MAN5= magic.5 CLEANFILES+= magic all: file magic diff --git a/usr.bin/hexdump/Makefile b/usr.bin/hexdump/Makefile index 7dda07ded9..b8e7982027 100644 --- a/usr.bin/hexdump/Makefile +++ b/usr.bin/hexdump/Makefile @@ -2,7 +2,7 @@ PROG= hexdump SRCS= conv.c display.c hexdump.c hexsyntax.c odsyntax.c parse.c -MAN1= hexdump.0 od.0 +MAN1= hexdump.1 od.1 LINKS= ${BINDIR}/hexdump ${BINDIR}/od .include diff --git a/usr.bin/lorder/Makefile b/usr.bin/lorder/Makefile index d002d24bbd..013a413e04 100644 --- a/usr.bin/lorder/Makefile +++ b/usr.bin/lorder/Makefile @@ -1,6 +1,6 @@ # @(#)Makefile 5.3 (Berkeley) 5/18/90 -MAN1= lorder.0 +MAN1= lorder.1 all lorder: ${MAN1} diff --git a/usr.bin/m4/Makefile b/usr.bin/m4/Makefile index b1ead05064..c60b6264a0 100644 --- a/usr.bin/m4/Makefile +++ b/usr.bin/m4/Makefile @@ -6,6 +6,6 @@ PROG= m4 CFLAGS+=-DEXTENDED SRCS = expr.c int2str.c look.c main.c misc.c serv.c -MAN1 = m4.0 +MAN1 = m4.1 .include diff --git a/usr.bin/man/Makefile b/usr.bin/man/Makefile index 020a7c5f04..5d4b96cb87 100644 --- a/usr.bin/man/Makefile +++ b/usr.bin/man/Makefile @@ -1,5 +1,5 @@ -# @(#)Makefile 5.1 (Berkeley) 5/27/90 +PROG= man +LINKS= ${BINDIR}/man ${BINDIR}/apropos ${BINDIR}/man ${BINDIR}/whatis +MAN1= man.1 apropos.1 whatis.1 -SUBDIR= apropos man whatis - -.include +.include diff --git a/usr.bin/man/apropos.1 b/usr.bin/man/apropos.1 new file mode 100644 index 0000000000..44653de134 --- /dev/null +++ b/usr.bin/man/apropos.1 @@ -0,0 +1,119 @@ +.\" Copyright (c) 1989, 1990 The Regents of the University of California. +.\" All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" 3. All advertising materials mentioning features or use of this software +.\" must display the following acknowledgement: +.\" This product includes software developed by the University of +.\" California, Berkeley and its contributors. +.\" 4. Neither the name of the University nor the names of its contributors +.\" may be used to endorse or promote products derived from this software +.\" without specific prior written permission. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" @(#)apropos.1 6.10 (Berkeley) 3/14/91 +.\" +.Dd March 14, 1991 +.Dt APROPOS 1 +.Sh NAME +.Nm apropos +.Nd locate commands by keyword lookup +.Sh SYNOPSIS +.Nm apropos +.Op Fl M Ar path +.Op Fl m Ar path +.Ar keyword ... +.Sh DESCRIPTION +.Nm Apropos +shows which manual pages contain instances of any of the given +.Ar keyword(s) +in their title line. +Each word is considered separately and case of letters is ignored. +Words which are part of other words are considered; when looking for +.Dq compile , +.Nm apropos +will also list all instances of +.Dq compiler . +.Pp +If the line output by +.Nm apropos +starts +.Dq Li name(section) ... +you can enter +.Dq Li man section name +to get +its documentation. +.Pp +The options are as follows: +.Bl -tag -width Ds +.It Fl M +Override the list of standard directories +.Nm apropos +searches for a database named +.Pa whatis.db . +The supplied +.Ar path +must be a colon +.Dq \&: +separated list of directories. +This search path may also be set using the environment variable +.Ev MANPATH . +.It Fl m +Augment the list of standard directories +.Nm apropos +searches for its database. +The supplied +.Ar path +must be a colon +.Dq \&: +separated list of directories. +These directories will be searched before the standard directories +or the directories supplied with the +.Fl M +option or the +.Ev MANPATH +environment variable are searched. +.Sh ENVIRONMENT +.Bl -tag -width MANPATH +.It Ev MANPATH +The standard search path used by +.Xr man 1 +may be overridden by specifying a path in the +.Ev MANPATH +environment variable. +The format of the path is a colon +.Dq \&: +separated list of directories. +.El +.Sh FILES +.Bl -tag -width whatis.db -compact +.It Pa whatis.db +name of the apropos database +.El +.Sh SEE ALSO +.Xr man 1 , +.Xr whatis 1 , +.Xr whereis 1 +.Sh HISTORY +The +.Nm +command appeared in +.Bx 3.0 . diff --git a/usr.bin/man/man.1 b/usr.bin/man/man.1 new file mode 100644 index 0000000000..07768c0a82 --- /dev/null +++ b/usr.bin/man/man.1 @@ -0,0 +1,177 @@ +.\" Copyright (c) 1989, 1990 The Regents of the University of California. +.\" All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" 3. All advertising materials mentioning features or use of this software +.\" must display the following acknowledgement: +.\" This product includes software developed by the University of +.\" California, Berkeley and its contributors. +.\" 4. Neither the name of the University nor the names of its contributors +.\" may be used to endorse or promote products derived from this software +.\" without specific prior written permission. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" @(#)man.1 6.14 (Berkeley) 4/29/91 +.\" +.Dd April 29, 1991 +.Dt MAN 1 +.Os BSD 4 +.Sh NAME +.Nm man +.Nd display the on-line manual pages +.Sh SYNOPSIS +.Nm man +.Op Fl achw +.Op Fl M Ar path +.Op Fl m Ar path +.Op Ar section +.Ar name Ar ... +.Sh DESCRIPTION +The +.Nm man +utility +displays the +.Bx +manual pages entitled +.Ar name . +.Pp +The options are as follows: +.Bl -tag -width indent +.It Fl a +Display all of the manual pages for a specified +.Ar section +and +.Ar name +combination. +(Normally, only the first manual page found is displayed.) +.It Fl c +Copy the manual page to the standard output instead of using +.Xr more 1 +to paginate it. +This is done by default if the standard output is not a terminal device. +.It Fl h +Display only the +.Dq Tn SYNOPSIS +lines of the requested manual pages. +.It Fl M +Override the list of standard directories which +.Nm man +searches for manual pages. +The supplied +.Ar path +must be a colon (``:'') separated list of directories. +This search path may also be set using the environment variable +.Ev MANPATH . +The subdirectories to be searched as well as their search order +is specified by the ``_subdir'' line in the +.Nm man +configuration file. +.It Fl m +Augment the list of standard directories which +.Nm man +searches for manual pages. +The supplied +.Ar path +must be a colon (``:'') separated list of directories. +These directories will be searched before the standard directories or +the directories specified using the +.Fl M +option or the +.Ev MANPATH +environment variable. +.It Fl w +List the pathnames of the manual pages which +.Nm man +would display for the specified +.Ar section +and +.Ar name +combination. +.El +.Pp +The optional +.Ar section +restricts the directories that +.Nm man +will search. +The +.Nm man +configuration file (see +.Xr man_conf 5 ) +specifies the possible +.Ar section +values that are currently available. +If only a single argument is specified or if the first argument is +not a valid section, +.Nm man +assumes that the argument is the name of a manual page to be displayed. +.Sh ENVIRONMENT +.Bl -tag -width MANPATHX +.It Ev MACHINE +As some manual pages are intended only for use on certain architectures, +.Nm man +searches certain directories applicable to the current machine. +Man's +determination of the current machine type may be overridden by setting +the environment variable +.Ev MACHINE +to the name of an architecture (see +.Xr machine 1 ) . +Machine specific areas are checked before general areas. +.It Ev MANPATH +The standard search path used by +.Nm man +may be overridden by specifying a path in the +.Ev MANPATH +environment +variable. +The format of the path is a colon (``:'') separated list of directories. +The subdirectories to be searched as well as their search order +is specified by the ``_subdir'' line in the +.Nm man +configuration file. +.It Ev PAGER +Any value of the environment variable +.Ev PAGER +will be used instead of the standard pagination program +.Xr more 1 . +.El +.Sh FILES +.Bl -tag -width /etc/man.conf -compact +.It Pa /etc/man.conf +man configuration file (see +.Xr man_conf 5 ) +.El +.Sh SEE ALSO +.Xr apropos 1 , +.Xr machine 1 , +.Xr whatis 1 , +.Xr whereis 1 , +.Xr man_conf 5 +.Sh BUGS +The on-line manual pages are, by necessity, forgiving toward stupid +display devices, causing some manual pages to not be as good as their +typeset counterparts. +.Sh HISTORY +A +.Nm +command appeared in +.At v6 . diff --git a/usr.bin/man/man.c b/usr.bin/man/man.c new file mode 100644 index 0000000000..bbd4d26788 --- /dev/null +++ b/usr.bin/man/man.c @@ -0,0 +1,620 @@ +/* + * Copyright (c) 1980 Regents of the University of California. + * All rights reserved. The Berkeley software License Agreement + * specifies the terms and conditions for redistribution. + */ + +#ifndef lint +char copyright[] = +"@(#) Copyright (c) 1980 Regents of the University of California.\n\ + All rights reserved.\n"; +#endif not lint + +#ifndef lint +static char sccsid[] = "@(#)man.c 5.12 (Berkeley) 3/20/86"; +#endif not lint + +#include +#include +#include +#include +#include +#include +#include + +/* + * man + * link also to apropos and whatis + * This version uses more for underlining and paging. + */ +#define NROFFCAT "nroff -mandoc" /* for nroffing to cat file */ +#define NROFF "nroff -mandoc" /* for nroffing to tty */ +#define MORE "more -s" /* paging filter */ +#define CAT_ "/bin/cat" /* for when output is not a tty */ +#define CAT_S "/bin/cat -s" /* for '-' opt (no more) */ + +#define TROFFCMD "troff -man %s" + +#define ALLSECT "1nl6823457po" /* order to look through sections */ +#define SECT1 "1nlo" /* sections to look at if 1 is specified */ +#define SUBSEC1 "cg" /* subsections to try in section 1 */ +#define SUBSEC3 "sxmncf" +#define SUBSEC4 "pfn" +#define SUBSEC8 "cv" + +#define WHATIS "whatis" + +int nomore; +char *CAT = CAT_; +char *manpath = "/usr/share/man:/usr/local/man:/usr/gnu/man:/usr/X386/man"; +char *strcpy(); +char *strcat(); +char *getenv(); +char *calloc(); +char *trim(); +void nuke(int); +int apropos(); +int whatis(); +int section; +int subsec; +int troffit; +int mypid; + +#define eq(a,b) (strcmp(a,b) == 0) + +main(argc, argv) + int argc; + char *argv[]; +{ + char *mp; + + if ((mp = getenv("MANPATH")) != NULL) + manpath = mp; + umask(0); + mypid = getpid(); + if (strcmp(argv[0], "apropos") == 0) { + runpath(argc-1, argv+1, apropos); + exit(0); + } + if (strcmp(argv[0], "whatis") == 0) { + runpath(argc-1, argv+1, whatis); + exit(0); + } + if (argc <= 1) { + fprintf(stderr, "Usage: man [ section ] name ...\n"); + exit(1); + } + argc--, argv++; + while (argc > 0 && argv[0][0] == '-') { + switch(argv[0][1]) { + + case 0: + nomore++; + CAT = CAT_S; + break; + + case 't': + troffit++; + break; + + case 'k': + apropos(argc-1, argv+1); + exit(0); + + case 'f': + whatis(argc-1, argv+1); + exit(0); + + case 'P': /* backwards compatibility */ + case 'M': + if (argc < 2) { + fprintf(stderr, "%s: missing path\n", *argv); + exit(1); + } + argc--, argv++; + manpath = *argv; + break; + } + argc--, argv++; + } + if (troffit == 0 && nomore == 0 && !isatty(1)) + nomore++; + section = 0; + do { + if (eq(argv[0], "local")) { + section = 'l'; + goto sectin; + } else if (eq(argv[0], "new")) { + section = 'n'; + goto sectin; + } else if (eq(argv[0], "old")) { + section = 'o'; + goto sectin; + } else if (eq(argv[0], "public")) { + section = 'p'; + goto sectin; + } else if (isdigit(argv[0][0]) && + (argv[0][1] == 0 || argv[0][2] == 0)) { + section = argv[0][0]; + subsec = argv[0][1]; +sectin: + argc--, argv++; + if (argc == 0) { + fprintf(stderr, + "But what do you want from section %s?\n", + argv[-1]); + exit(1); + } + continue; + } + manual(section, argv[0]); + argc--, argv++; + } while (argc > 0); + exit(0); +} + +runpath(ac, av, f) + int ac; + char *av[]; + int (*f)(); +{ + + if (ac > 0 && strcmp(av[0], "-M") == 0 || strcmp(av[0], "-P") == 0) { + if (ac < 2) { + fprintf(stderr, "%s: missing path\n", av[0]); + exit(1); + } + manpath = av[1]; + ac -= 2, av += 2; + } + (*f)(ac, av); + exit(0); +} + +manual(sec, name) + char sec, *name; +{ + char section = sec; + char work[100], work2[100]; + char path[MAXPATHLEN+1], realname[MAXPATHLEN+1]; + char cmdbuf[150]; + int ss = 0; + struct stat stbuf, stbuf2; + int last; + char *sp = ALLSECT; + FILE *it; + char abuf[BUFSIZ]; + + strcpy(work, "manx/"); + strcat(work, name); + strcat(work, ".x"); + last = strlen(work) - 1; + if (section == '1') { + sp = SECT1; + section = 0; + } + if (section == 0) { /* no section or section 1 given */ + for (section = *sp++; section; section = *sp++) { + work[3] = section; + work[last] = section; + work[last+1] = 0; + work[last+2] = 0; + if (pathstat(work, path, &stbuf)) + break; + if (work[last] >= '1' && work[last] <= '8') { + char *cp; +search: + switch (work[last]) { + case '1': cp = SUBSEC1; break; + case '3': cp = SUBSEC3; break; + case '4': cp = SUBSEC4; break; + case '8': cp = SUBSEC8; break; + default: cp = "0"; break; + } + while (*cp) { + work[last+1] = *cp++; + if (pathstat(work, path, &stbuf)) { + ss = work[last+1]; + goto found; + } + } + if (ss == 0) + work[last+1] = 0; + } + } + if (section == 0) { + if (sec == 0) + printf("No manual entry for %s.\n", name); + else + printf("No entry for %s in section %c%s.\n", + name, sec, " of the manual"); + return; + } + } else { /* section given */ + work[3] = section; + work[last] = section; + work[last+1] = subsec; + work[last+2] = 0; + if (!pathstat(work, path, &stbuf)) { + if ((section >= '1' && section <= '8') && subsec == 0) { + sp = "\0"; + goto search; + } + else if (section == 'o') { /* XXX */ + char *cp; + char sec; + for (sec = '0'; sec <= '8'; sec++) { + work[last] = sec; + if (pathstat(work, path, &stbuf)) + goto found; + switch (work[last]) { + case '1': cp = SUBSEC1; break; + case '3': cp = SUBSEC3; break; + case '4': cp = SUBSEC4; break; + case '8': cp = SUBSEC8; break; + default: cp = ""; break; + } + while (*cp) { + work[last+1] = *cp++; + if (pathstat(work, path, &stbuf)) { + ss = work[last+1]; + goto found; + } + } + if (ss == 0) + work[last+1] = 0; + } + } + printf("No entry for %s in section %c", name, section); + if (subsec) + putchar(subsec); + printf(" of the manual.\n"); + return; + } + } +found: + sprintf(realname, "%s/%s", path, work); + if (troffit) { + troff(path, work); + return; + } + if (!nomore) { + if ((it = fopen(realname, "r")) == NULL) { + goto catit; + } + if (fgets(abuf, BUFSIZ-1, it) && + strncmp(abuf, ".so ", 4) == 0) { + register char *cp = abuf+4; + char *dp; + + while (*cp && *cp != '\n') + cp++; + *cp = 0; + while (cp > abuf && *--cp != '/') + ; + dp = ".so man"; + if (cp != abuf+strlen(dp)+1) { +tohard: + fclose(it); + nomore = 1; + strcpy(work, abuf+4); + goto hardway; + } + for (cp = abuf; *cp == *dp && *cp; cp++, dp++) + ; + if (*dp) + goto tohard; + strcpy(work, cp-3); + } + fclose(it); + } +catit: + strcpy(work2, "cat"); + work2[3] = work[3]; + work2[4] = 0; + sprintf(realname, "%s/%s", path, work2); + if (stat(realname, &stbuf2) < 0) + goto hardway; + strcpy(work2+4, work+4); + sprintf(realname, "%s/%s", path, work2); + if (stat(realname, &stbuf2) < 0 || stbuf2.st_mtime < stbuf.st_mtime) { + if (nomore) + goto hardway; + printf("Reformatting page. Wait..."); + fflush(stdout); + unlink(work2); + if (signal(SIGINT, SIG_IGN) == SIG_DFL) { + (void) signal(SIGINT, nuke); + (void) signal(SIGQUIT, nuke); + (void) signal(SIGTERM, nuke); + } + sprintf(cmdbuf, "%s %s/%s > /tmp/man%d; trap '' 1 15", + NROFFCAT, path, work, mypid); + if (system(cmdbuf)) { + printf(" aborted (sorry)\n"); + nuke(0); + /*NOTREACHED*/ + } + sprintf(cmdbuf, "/bin/mv -f /tmp/man%d %s/%s 2>/dev/null", + mypid, path, work2); + if (system(cmdbuf)) { + sprintf(path, "/"); + sprintf(work2, "tmp/man%d", mypid); + } + printf(" done\n"); + } + strcpy(work, work2); +hardway: + nroff(path, work); + if (work2[0] == 't') + nuke(0); +} + +/* + * Use the manpath to look for + * the file name. The result of + * stat is returned in stbuf, the + * successful path in path. + */ +pathstat(name, path, stbuf) + char *name, path[]; + struct stat *stbuf; +{ + char *cp, *tp, *ep; + char **cpp; + static char *manpaths[] = {"man", "cat", 0}; + static char *nopaths[] = {"", 0}; + + if (strncmp(name, "man", 3) == 0) + cpp = manpaths; + else + cpp = nopaths; + for ( ; *cpp ; cpp++) { + for (cp = manpath; cp && *cp; cp = tp) { + tp = index(cp, ':'); + if (tp) { + if (tp == cp) { + sprintf(path, "%s%s", *cpp, + name+strlen(*cpp)); + } + else { + sprintf(path, "%.*s/%s%s", tp-cp, cp, + *cpp, name+strlen(*cpp)); + } + ep = path + (tp-cp); + tp++; + } else { + sprintf(path, "%s/%s%s", cp, *cpp, + name+strlen(*cpp)); + ep = path + strlen(cp); + } + if (stat(path, stbuf) >= 0) { + *ep = '\0'; + return (1); + } + } + } + return (0); +} + +nroff(pp, wp) + char *pp, *wp; +{ + char cmd[BUFSIZ]; + + chdir(pp); + if (wp[0] == 'c' || wp[0] == 't') + sprintf(cmd, "%s %s", nomore? CAT : MORE, wp); + else + sprintf(cmd, nomore? "%s %s" : "%s %s|%s", NROFF, wp, MORE); + (void) system(cmd); +} + +troff(pp, wp) + char *pp, *wp; +{ + char cmdbuf[BUFSIZ]; + + chdir(pp); + sprintf(cmdbuf, TROFFCMD, wp); + (void) system(cmdbuf); +} + +any(c, sp) + register int c; + register char *sp; +{ + register int d; + + while (d = *sp++) + if (c == d) + return (1); + return (0); +} + +void +nuke(sig) +int sig; +{ + char name[15]; + + sprintf(name, "/tmp/man%d", mypid); + unlink(name); + exit(1); +} + +unsigned int +blklen(ip) + register char **ip; +{ + register unsigned int i = 0; + + while (*ip++) + i++; + return (i); +} + +apropos(argc, argv) + int argc; + char **argv; +{ + char buf[BUFSIZ], file[MAXPATHLEN+1]; + char *gotit, *cp, *tp; + register char **vp; + + if (argc == 0) { + fprintf(stderr, "apropos what?\n"); + exit(1); + } + gotit = calloc(1, blklen(argv)); + for (cp = manpath; cp; cp = tp) { + tp = index(cp, ':'); + if (tp) { + if (tp == cp) + strcpy(file, WHATIS); + else + sprintf(file, "%.*s/%s", tp-cp, cp, WHATIS); + tp++; + } else + sprintf(file, "%s/%s", cp, WHATIS); + if (freopen(file, "r", stdin) == NULL) + continue; + while (fgets(buf, sizeof buf, stdin) != NULL) + for (vp = argv; *vp; vp++) + if (match(buf, *vp)) { + printf("%s", buf); + gotit[vp - argv] = 1; + for (vp++; *vp; vp++) + if (match(buf, *vp)) + gotit[vp - argv] = 1; + break; + } + } + for (vp = argv; *vp; vp++) + if (gotit[vp - argv] == 0) + printf("%s: nothing appropriate\n", *vp); +} + +match(bp, str) + register char *bp; + char *str; +{ + + for (;;) { + if (*bp == 0) + return (0); + if (amatch(bp, str)) + return (1); + bp++; + } +} + +amatch(cp, dp) + register char *cp, *dp; +{ + + while (*cp && *dp && lmatch(*cp, *dp)) + cp++, dp++; + if (*dp == 0) + return (1); + return (0); +} + +lmatch(c, d) + register int c, d; +{ + + if (c == d) + return (1); + if (!isalpha(c) || !isalpha(d)) + return (0); + if (islower(c)) + c = toupper(c); + if (islower(d)) + d = toupper(d); + return (c == d); +} + +whatis(argc, argv) + int argc; + char **argv; +{ + register char *gotit, **vp; + char buf[BUFSIZ], file[MAXPATHLEN+1], *cp, *tp; + + if (argc == 0) { + fprintf(stderr, "whatis what?\n"); + exit(1); + } + for (vp = argv; *vp; vp++) + *vp = trim(*vp); + gotit = calloc(1, blklen(argv)); + for (cp = manpath; cp; cp = tp) { + tp = index(cp, ':'); + if (tp) { + if (tp == cp) + strcpy(file, WHATIS); + else + sprintf(file, "%.*s/%s", tp-cp, cp, WHATIS); + tp++; + } else + sprintf(file, "%s/%s", cp, WHATIS); + if (freopen(file, "r", stdin) == NULL) + continue; + while (fgets(buf, sizeof buf, stdin) != NULL) + for (vp = argv; *vp; vp++) + if (wmatch(buf, *vp)) { + printf("%s", buf); + gotit[vp - argv] = 1; + for (vp++; *vp; vp++) + if (wmatch(buf, *vp)) + gotit[vp - argv] = 1; + break; + } + } + for (vp = argv; *vp; vp++) + if (gotit[vp - argv] == 0) + printf("%s: not found\n", *vp); +} + +wmatch(buf, str) + char *buf, *str; +{ + register char *bp, *cp; + + bp = buf; +again: + cp = str; + while (*bp && *cp && lmatch(*bp, *cp)) + bp++, cp++; + if (*cp == 0 && (*bp == '(' || *bp == ',' || *bp == '\t' || *bp == ' ')) + return (1); + while (isalpha(*bp) || isdigit(*bp)) + bp++; + if (*bp != ',') + return (0); + bp++; + while (isspace(*bp)) + bp++; + goto again; +} + +char * +trim(cp) + register char *cp; +{ + register char *dp; + + for (dp = cp; *dp; dp++) + if (*dp == '/') + cp = dp + 1; + if (cp[0] != '.') { + if (cp + 3 <= dp && dp[-2] == '.' && + any(dp[-1], "cosa12345678npP")) + dp[-2] = 0; + if (cp + 4 <= dp && dp[-3] == '.' && + any(dp[-2], "13") && isalpha(dp[-1])) + dp[-3] = 0; + } + return (cp); +} diff --git a/usr.bin/man/whatis.1 b/usr.bin/man/whatis.1 new file mode 100644 index 0000000000..be52ab71be --- /dev/null +++ b/usr.bin/man/whatis.1 @@ -0,0 +1,105 @@ +.\" Copyright (c) 1989, 1990 The Regents of the University of California. +.\" All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" 3. All advertising materials mentioning features or use of this software +.\" must display the following acknowledgement: +.\" This product includes software developed by the University of +.\" California, Berkeley and its contributors. +.\" 4. Neither the name of the University nor the names of its contributors +.\" may be used to endorse or promote products derived from this software +.\" without specific prior written permission. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" @(#)whatis.1 6.7 (Berkeley) 4/23/91 +.\" +.Dd April 23, 1991 +.Dt WHATIS 1 +.Os BSD 4 +.Sh NAME +.Nm whatis +.Nd describe what a command is +.Sh SYNOPSIS +.Nm whatis +.Op Fl M Ar path +.Op Fl m Ar path +.Ar command Ar ... +.Sh DESCRIPTION +.Nm Whatis +looks up a given command and gives the header line from the manual page. +You can then use the +.Xr man 1 +command to get more information. +.Pp +The options are as follows: +.Bl -tag -width Fl +.It Fl M Ar path +Override the list of standard directories +.Nm whatis +searches for its database named +.Dq Pa whatis.db . +The supplied +.Ar path +must be a colon +.Dq \&: +separated list of directories. +This search path may also be set using the environment variable +.Ev MANPATH . +.It Fl m Ar path +Augment the list of standard directories +.Nm whatis +searches for its database named +.Dq Pa whatis.db . +The supplied +.Ar path +must be a colon +.Dq \&: +separated list of directories. +These directories will be searched before the standard directories +or the directories supplied with the +.Fl M +option or the +.Ev MANPATH +environment variable are searched. +.El +.Sh ENVIRONMENT +.Bl -tag -width MANPATH +.It Ev MANPATH +The standard search path used by +.Xr man 1 +may be overridden by specifying a path in the +.Ev MANPATH +environment variable. +.El +.Sh FILES +.Bl -tag -width whatis.db +.It Pa whatis.db +name of the whatis database +.El +.Sh SEE ALSO +.Xr apropos 1 , +.Xr man 1 , +.Xr whereis 1 +.Sh HISTORY +The +.Nm +command appeared in +.Bx 3.0 . diff --git a/usr.bin/mkdep/Makefile b/usr.bin/mkdep/Makefile index 236a765d55..bd7e70a3ce 100644 --- a/usr.bin/mkdep/Makefile +++ b/usr.bin/mkdep/Makefile @@ -1,6 +1,6 @@ # @(#)Makefile 5.4 (Berkeley) 2/19/91 -MAN1= mkdep.0 +MAN1= mkdep.1 .if (${MACHINE} == "hp300" || ${MACHINE} == "i386") beforeinstall: diff --git a/usr.bin/ranlib/Makefile b/usr.bin/ranlib/Makefile index 4957300a00..0ed9749379 100644 --- a/usr.bin/ranlib/Makefile +++ b/usr.bin/ranlib/Makefile @@ -3,14 +3,8 @@ PROG= ranlib SRCS= archive.c build.c misc.c ranlib.c touch.c CFLAGS+=-I${.CURDIR} -I${.CURDIR}/../ar -MAN1= ranlib.0 +MAN1= ranlib.1 +MAN5= ranlib.5 VPATH= ${.CURDIR}/../ar -CLEANFILES=ranlib.5.0 - -ranlib.0: ranlib.5.0 - -afterinstall: - install -c -o ${MANOWN} -g ${MANGRP} -m ${MANMODE} ranlib.5.0 \ - ${DESTDIR}${MANDIR}5/ranlib.0 .include diff --git a/usr.bin/ranlib/ranlib.5 b/usr.bin/ranlib/ranlib.5 new file mode 100644 index 0000000000..19fe5f4a26 --- /dev/null +++ b/usr.bin/ranlib/ranlib.5 @@ -0,0 +1,70 @@ +.\" Copyright (c) 1990, 1991 The Regents of the University of California. +.\" All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" 3. All advertising materials mentioning features or use of this software +.\" must display the following acknowledgement: +.\" This product includes software developed by the University of +.\" California, Berkeley and its contributors. +.\" 4. Neither the name of the University nor the names of its contributors +.\" may be used to endorse or promote products derived from this software +.\" without specific prior written permission. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" @(#)ranlib.5.5 5.2 (Berkeley) 5/10/91 +.\" +.Dd May 10, 1991 +.Dt RANLIB 5 +.Os +.Sh NAME +.Nm ranlib +.Nd archive (library) table-of-contents format +.Sh SYNOPSIS +.Fd #include +.Sh DESCRIPTION +The archive table-of-contents command +.Nm ranlib +creates a table of contents for archives, containing object files, to +be used by the link-editor +.Xr ld 1 . +It operates on archives created with the utility +.Xr ar 1 . +.Pp +The +.Nm Ranlib +function +prepends a new file to the archive which has three separate parts. +The first part is a standard archive header, which has a special name +field, "__.SYMDEF". +.Pp +The second part is a ``long'' followed by a list of ranlib structures. +The long is the size, in bytes, of the list of ranlib structures. +Each of the ranlib structures consists of a zero based offset into the +next section (a string table of symbols) and an offset from the beginning +of the archive to the start of the archive file which defines the symbol. +The actual number of ranlib structures is this number divided by the size +of an individual ranlib structure. +.Pp +The third part is a ``long'' followed by a string table. +The long is the size, in bytes of the string table. +.Sh SEE ALSO +.Xr ar 1 , +.Xr ranlib 1 diff --git a/usr.bin/renice/Makefile b/usr.bin/renice/Makefile index 3707af1d28..db7cf17fa8 100644 --- a/usr.bin/renice/Makefile +++ b/usr.bin/renice/Makefile @@ -1,5 +1,6 @@ # @(#)Makefile 5.3 (Berkeley) 5/11/90 PROG= renice +MAN8= renice.8 .include diff --git a/usr.bin/shar/Makefile b/usr.bin/shar/Makefile index 3cb889a45a..a69fb16df6 100644 --- a/usr.bin/shar/Makefile +++ b/usr.bin/shar/Makefile @@ -1,6 +1,6 @@ # @(#)Makefile 5.1 (Berkeley) 5/23/90 -MAN1= shar.0 +MAN1= shar.1 all shar: ${MAN1} diff --git a/usr.bin/showmount/Makefile b/usr.bin/showmount/Makefile index ee60854783..957f3c5e08 100644 --- a/usr.bin/showmount/Makefile +++ b/usr.bin/showmount/Makefile @@ -1,6 +1,7 @@ # @(#)Makefile 6.2 (Berkeley) 5/11/90 PROG= showmount +MAN8= showmount.8 DPADD= ${LIBRPC} LDADD= -lrpc diff --git a/usr.bin/uuencode/Makefile b/usr.bin/uuencode/Makefile index cedd7bff83..a81a05b898 100644 --- a/usr.bin/uuencode/Makefile +++ b/usr.bin/uuencode/Makefile @@ -1,8 +1,8 @@ # @(#)Makefile 5.1 (Berkeley) 5/11/90 PROG= uuencode -MAN1= uuencode.0 -MAN5= uuencode.format.0 +MAN1= uuencode.1 +MAN5= uuencode.format.5 MLINKS= uuencode.1 uudecode.1 .include diff --git a/usr.bin/vgrind/Makefile b/usr.bin/vgrind/Makefile index fa7dde8bf2..c1cf27a449 100644 --- a/usr.bin/vgrind/Makefile +++ b/usr.bin/vgrind/Makefile @@ -2,8 +2,8 @@ PROG= vfontedpr SRCS= regexp.c vfontedpr.c vgrindefs.c -MAN1= vgrind.0 -MAN5= vgrindefs.0 +MAN1= vgrind.1 +MAN5= vgrindefs.5 BINDIR= /usr/libexec beforeinstall: diff --git a/usr.bin/vmstat/Makefile b/usr.bin/vmstat/Makefile index a344ce37b6..520bb0210c 100644 --- a/usr.bin/vmstat/Makefile +++ b/usr.bin/vmstat/Makefile @@ -2,7 +2,7 @@ PROG= vmstat CFLAGS+=-I/sys -MAN8= vmstat.0 +MAN8= vmstat.8 BINGRP= kmem BINMODE=2555 DPADD= names.c ${LIBUTIL} diff --git a/usr.bin/w/Makefile b/usr.bin/w/Makefile index f348d27df2..ba57585c5c 100644 --- a/usr.bin/w/Makefile +++ b/usr.bin/w/Makefile @@ -3,7 +3,7 @@ PROG= w SRCS= attime.c w.c proc_compare.c CFLAGS+=-I/sys -MAN1= w.0 uptime.0 +MAN1= w.1 uptime.1 DPADD= ${LIBUTIL} LDADD= -lutil BINGRP= kmem diff --git a/usr.bin/which/Makefile b/usr.bin/which/Makefile index d7cdce698a..1e17feb112 100644 --- a/usr.bin/which/Makefile +++ b/usr.bin/which/Makefile @@ -1,6 +1,6 @@ # @(#)Makefile 5.5 (Berkeley) 7/1/90 -MAN1= which.0 +MAN1= which.1 beforeinstall: install -c -o ${BINOWN} -g ${BINGRP} -m ${BINMODE} \ diff --git a/usr.bin/window/Makefile b/usr.bin/window/Makefile index d4cef4c150..4019676f1b 100644 --- a/usr.bin/window/Makefile +++ b/usr.bin/window/Makefile @@ -14,7 +14,7 @@ SRCS= char.c cmd.c cmd1.c cmd2.c cmd3.c cmd4.c cmd5.c cmd6.c cmd7.c \ wwopen.c wwprintf.c wwpty.c wwputc.c wwputs.c wwredraw.c \ wwredrawwin.c wwrint.c wwscroll.c wwsize.c wwspawn.c wwsuspend.c \ wwtty.c wwunframe.c wwupdate.c wwwrite.c xx.c xxflush.c compress.c -MAN= window.0 +MAN1= window.1 DPADD= ${LIBTERMCAP} LDADD= -ltermcap diff --git a/usr.bin/xinstall/Makefile b/usr.bin/xinstall/Makefile index 89f716a54e..e58f360613 100644 --- a/usr.bin/xinstall/Makefile +++ b/usr.bin/xinstall/Makefile @@ -1,7 +1,7 @@ # @(#)Makefile 5.5 (Berkeley) 6/24/90 PROG= xinstall -MAN1= install.0 +MAN1= install.1 CLEANFILES=xinstall install: maninstall diff --git a/usr.bin/yacc/Makefile b/usr.bin/yacc/Makefile index 71633a3e40..f5c4b9de72 100644 --- a/usr.bin/yacc/Makefile +++ b/usr.bin/yacc/Makefile @@ -3,7 +3,7 @@ PROG= yacc SRCS= closure.c error.c lalr.c lr0.c main.c mkpar.c output.c reader.c \ skeleton.c symtab.c verbose.c warshall.c -MAN1= yacc.0 yyfix.0 +MAN1= yacc.1 yyfix.1 beforeinstall: install -c -o ${BINOWN} -g ${BINGRP} -m ${BINMODE} \ -- 2.20.1