summaryrefslogtreecommitdiffstats
path: root/tools/mandb_fmt-script
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-07 15:19:27 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-07 15:19:27 +0000
commite0023883c6d2e6745a19e4b48e186ed156c1fca8 (patch)
tree1a48b8056ec984385d0d862b683535d04d6ed215 /tools/mandb_fmt-script
parentInitial commit. (diff)
downloadman-db-e0023883c6d2e6745a19e4b48e186ed156c1fca8.tar.xz
man-db-e0023883c6d2e6745a19e4b48e186ed156c1fca8.zip
Adding upstream version 2.11.2.upstream/2.11.2upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'tools/mandb_fmt-script')
-rw-r--r--tools/mandb_fmt-script28
1 files changed, 28 insertions, 0 deletions
diff --git a/tools/mandb_fmt-script b/tools/mandb_fmt-script
new file mode 100644
index 0000000..96f660b
--- /dev/null
+++ b/tools/mandb_fmt-script
@@ -0,0 +1,28 @@
+#! /bin/sh
+# $1 : the source file
+# $2 : the preprocessor string
+# $3 : the output device (optional)
+
+prog=`basename $0`
+prepipe=
+postpipe=
+
+for p in `echo "$2" | sed 's/./& /g'`
+do
+ case $p in
+ e) prepipe="$prepipe | /usr/bin/neqn" ;;
+ g) echo "$prog: can't preprocess with grap" >&2 ;;
+ p) echo "$prog: can't preprocess with pic" >&2 ;;
+ t) prepipe="$prepipe | /usr/bin/tbl" ; postpipe="| /usr/bin/col" ;;
+ r) prepipe="$prepipe | /usr/bin/refer" ;;
+ v) echo "$prog: can't preprocess with vgrind" >&2 ;;
+ *) echo "$prog: unknown preprocessor \`$p'" >&2 ;;
+ esac
+done
+
+case $prog in
+ mandb_tfmt) postpipe="| /usr/bin/troff -t ${3+-T$3}" ;;
+ *) postpipe="| /usr/bin/nroff ${3+-T$3} $postpipe";;
+esac
+
+eval "cat /usr/export/exec/sun4/lib/tmac/tmac.an $1 $prepipe $postpipe"