#!/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.
{
# 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
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/\\//
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
s/\\s.//g
s/\\\*(M2/MINIX/g
s/\\//
- '"s/ - / (9) - /" < "$page"
+ '"s/ - / (1x) - /" < "$page"
fi
done
-/* 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
#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)
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;
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();