Merge of kjb's update to man system to move section 9 to 1x.
This commit is contained in:
parent
52b71b2396
commit
97fa05d773
2 changed files with 13 additions and 13 deletions
|
@ -1,6 +1,6 @@
|
|||
#!/bin/sh
|
||||
#
|
||||
# makewhatis 2.0 - make whatis(5) database. Author: Kees J. Bot.
|
||||
# makewhatis 2.2 - make whatis(5) database. Author: Kees J. Bot.
|
||||
#
|
||||
# Make the whatis database of a man directory from the manual pages.
|
||||
|
||||
|
@ -19,9 +19,9 @@ cd $1 || exit
|
|||
{
|
||||
# First pass, gathering the .SH NAME lines in various forms.
|
||||
|
||||
# First the man[1-8] directories, the titles are under the .SH NAME
|
||||
# First the man[1-9] directories, the titles are under the .SH NAME
|
||||
# section header.
|
||||
for chap in 1 2 3 4 5 6 7 8
|
||||
for chap in 1 2 3 4 5 6 7 8 9
|
||||
do
|
||||
for page in man$chap/*.$chap
|
||||
do
|
||||
|
@ -31,7 +31,7 @@ cd $1 || exit
|
|||
s/"NAME"/NAME/g
|
||||
/^\.SH NAME/,/^\.SH /!d
|
||||
/^\.SH /d
|
||||
s/\\f.//g # should not be needed
|
||||
s/\\f.//g
|
||||
s/\\s[+-].//g
|
||||
s/\\s.//g
|
||||
s/\\//
|
||||
|
@ -41,7 +41,7 @@ cd $1 || exit
|
|||
done
|
||||
|
||||
# The Minix "Book style" documents, look for .CD
|
||||
for page in man9/*.9
|
||||
for page in man1x/*.1x
|
||||
do
|
||||
if test -f "$page"; then
|
||||
|
||||
|
@ -55,7 +55,7 @@ cd $1 || exit
|
|||
s/\\s.//g
|
||||
s/\\\*(M2/MINIX/g
|
||||
s/\\//
|
||||
'"s/ - / (9) - /" < "$page"
|
||||
'"s/ - / (1x) - /" < "$page"
|
||||
fi
|
||||
done
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* man 2.4 - display online manual pages Author: Kees J. Bot
|
||||
/* man 2.5 - display online manual pages Author: Kees J. Bot
|
||||
* 17 Mar 1993
|
||||
*/
|
||||
#define nil NULL
|
||||
|
@ -26,11 +26,11 @@ char TBL_MAGIC[] = ".\\\"t\n";
|
|||
#define arraylimit(a) ((a) + arraysize(a))
|
||||
#define between(a, c, z) ((unsigned) ((c) - (a)) <= (unsigned) ((z) - (a)))
|
||||
|
||||
/* Section 9 uses special macros under Minix. */
|
||||
/* Section 1x uses special macros under Minix. */
|
||||
#if __minix
|
||||
#define SEC9SPECIAL 1
|
||||
#define SEC1xSPECIAL 1
|
||||
#else
|
||||
#define SEC9SPECIAL 0
|
||||
#define SEC1xSPECIAL 0
|
||||
#endif
|
||||
|
||||
int searchwhatis(FILE *wf, char *title, char **ppage, char **psection)
|
||||
|
@ -521,7 +521,7 @@ int trymandir(char *mandir, char *title, char *section)
|
|||
mandir, wsection, wpage, wsection);
|
||||
|
||||
rsp= showpage(pagename, sp->ptype,
|
||||
(SEC9SPECIAL && strcmp(wsection, "9") == 0) ? "-mnx" : "-man");
|
||||
(SEC1xSPECIAL && strcmp(wsection, "1x") == 0) ? "-mnx" : "-man");
|
||||
} while (sp++, !rsp && --ntries != 0);
|
||||
|
||||
if (all) rsp= 0;
|
||||
|
@ -664,8 +664,8 @@ int main(int argc, char **argv)
|
|||
|
||||
if (i >= argc) usage();
|
||||
|
||||
if (between('0', argv[i][0], '9') && argv[i][1] == 0) {
|
||||
/* Allow single digit section designations. */
|
||||
if (between('0', argv[i][0], '9') && i+1 < argc) {
|
||||
/* Old BSD style section designation? */
|
||||
section= argv[i++];
|
||||
}
|
||||
if (i == argc) usage();
|
||||
|
|
Loading…
Reference in a new issue