From b0b8aac67b346d40f752d3be427b0521bd72070d Mon Sep 17 00:00:00 2001 From: lukem Date: Sun, 2 Nov 1997 00:23:36 +0000 Subject: [PATCH] * use (``foo'') instead of (foo) * order SEE ALSO on man section then alphabetical * add -w to usage string * deprecate register * minor code move in newman section, to follow style of oldman section --- libexec/getNAME/getNAME.8 | 16 ++++++++-------- libexec/getNAME/getNAME.c | 27 +++++++++++++-------------- 2 files changed, 21 insertions(+), 22 deletions(-) diff --git a/libexec/getNAME/getNAME.8 b/libexec/getNAME/getNAME.8 index 5b34012feb7b..29092ca361dc 100644 --- a/libexec/getNAME/getNAME.8 +++ b/libexec/getNAME/getNAME.8 @@ -1,4 +1,4 @@ -.\" $NetBSD: getNAME.8,v 1.1 1997/11/01 15:03:53 mrg Exp $ +.\" $NetBSD: getNAME.8,v 1.2 1997/11/02 00:23:36 lukem Exp $ .\" .\" Copyright (c) 1997 Matthew R. Green .\" All rights reserved. @@ -48,11 +48,11 @@ returns data for use in an database. .Nm is designed to be called from -.Xr makewhatis 8 , +.Xr makewhatis 8 or other manual grovelling tools, not to be used directly. .Sh OPTIONS The following options are available: -.Bl -tag -width 123456 +.Bl -tag -width Ds .It Fl i The .Fl i @@ -68,11 +68,11 @@ option returns information useful for creating a table of contents. The .Fl w option determines whether traditional man -.Sy (OLD) , +.Pq Dq OLD , new mandoc -.Sy (NEW) , +.Pq Dq NEW , or some unknown -.Sy (UNKNOWN) +.Pq Dq UNKNOWN format exists. .El .Sh HISTORY @@ -85,6 +85,6 @@ It would be nice if .Nm could deal with preformatted manuals. .Sh SEE ALSO +.Xr man 1 , .Xr catman 8 , -.Xr makewhatis 8 , -.Xr man 1 . +.Xr makewhatis 8 diff --git a/libexec/getNAME/getNAME.c b/libexec/getNAME/getNAME.c index e1a99cd3664f..a04c3e49f6a7 100644 --- a/libexec/getNAME/getNAME.c +++ b/libexec/getNAME/getNAME.c @@ -1,4 +1,4 @@ -/* $NetBSD: getNAME.c,v 1.8 1997/11/01 15:03:54 mrg Exp $ */ +/* $NetBSD: getNAME.c,v 1.9 1997/11/02 00:23:37 lukem Exp $ */ /*- * Copyright (c) 1980, 1993 @@ -40,7 +40,7 @@ __COPYRIGHT("@(#) Copyright (c) 1980, 1993\n\ #if 0 static char sccsid[] = "@(#)getNAME.c 8.1 (Berkeley) 6/30/93"; #else -__RCSID("$NetBSD: getNAME.c,v 1.8 1997/11/01 15:03:54 mrg Exp $"); +__RCSID("$NetBSD: getNAME.c,v 1.9 1997/11/02 00:23:37 lukem Exp $"); #endif #endif /* not lint */ @@ -129,13 +129,8 @@ getfrom(pathname) if ((headbuf[1] == 'T' && headbuf[2] == 'H') || (headbuf[1] == 't' && headbuf[2] == 'h')) break; - if (headbuf[1] == 'D' && headbuf[2] == 't') { - if (typeflag) { - printf("%-60s NEW\n", pathname); - return; - } + if (headbuf[1] == 'D' && headbuf[2] == 't') goto newman; - } } if (typeflag) { printf("%-60s OLD\n", pathname); @@ -191,6 +186,10 @@ getfrom(pathname) return; newman: + if (typeflag) { + printf("%-60s NEW\n", pathname); + return; + } for (;;) { if (fgets(linbuf, sizeof linbuf, stdin) == NULL) return; @@ -265,7 +264,7 @@ newman: void trimln(cp) - register char *cp; + char *cp; { while (*cp) @@ -278,7 +277,7 @@ void doname(name) char *name; { - register char *dp = name, *ep; + char *dp = name, *ep; again: while (*dp && *dp != '.') @@ -302,7 +301,7 @@ void split(line, name) char *line, *name; { - register char *cp, *dp; + char *cp, *dp; char *sp, *sep; cp = strchr(line, '-'); @@ -317,7 +316,7 @@ split(line, name) for (sep = "", dp = line; dp && *dp; dp = cp, sep = "\n") { cp = strchr(dp, ','); if (cp) { - register char *tp; + char *tp; for (tp = cp - 1; *tp == ' ' || *tp == '\t'; tp--) ; @@ -335,7 +334,7 @@ void dorefname(name) char *name; { - register char *dp = name, *ep; + char *dp = name, *ep; again: while (*dp && *dp != '.') @@ -356,6 +355,6 @@ again: void usage() { - (void)fprintf(stderr, "usage: getNAME [-it] file ...\n"); + (void)fprintf(stderr, "usage: getNAME [-itw] file ...\n"); exit(1); }