* Copyright (c) 1980 Regents of the University of California.
* All rights reserved. The Berkeley software License Agreement
* specifies the terms and conditions for redistribution.
static char sccsid
[] = "@(#)getNAME.c 5.2 (Berkeley) 10/21/85";
* Get name sections from manual pages.
* -i for building intro entries
if (!strcmp(argv
[0], "-t"))
if (!strcmp(argv
[0], "-i"))
getfrom(*argv
++), argc
--;
if (freopen(name
, "r", stdin
) == 0) {
if (fgets(headbuf
, sizeof headbuf
, stdin
) == NULL
)
if (headbuf
[1] == 'T' && headbuf
[2] == 'H')
if (headbuf
[1] == 't' && headbuf
[2] == 'h')
if (fgets(linbuf
, sizeof linbuf
, stdin
) == NULL
)
if (linbuf
[1] == 'S' && linbuf
[2] == 'H')
if (linbuf
[1] == 's' && linbuf
[2] == 'h')
if (fgets(linbuf
, sizeof linbuf
, stdin
) == NULL
)
if (linbuf
[1] == 'S' && linbuf
[2] == 'H')
if (linbuf
[1] == 's' && linbuf
[2] == 'h')
register char *dp
= name
, *ep
;
while (*dp
&& *dp
!= '.')
for (ep
= dp
+1; *ep
; ep
++)
for (--cp
; *cp
== ' ' || *cp
== '\t' || *cp
== '\\'; cp
--)
while (*sp
&& (*sp
== ' ' || *sp
== '\t'))
for (sep
= "", dp
= line
; dp
&& *dp
; dp
= cp
, sep
= "\n") {
for (tp
= cp
- 1; *tp
== ' ' || *tp
== '\t'; tp
--)
for (++cp
; *cp
== ' ' || *cp
== '\t'; cp
++)
printf("%s%s\t", sep
, dp
);
register char *dp
= name
, *ep
;
while (*dp
&& *dp
!= '.')
for (ep
= dp
+1; *ep
; ep
++)