diff options
Diffstat (limited to 'bin/info2man')
-rwxr-xr-x | bin/info2man | 169 |
1 files changed, 169 insertions, 0 deletions
diff --git a/bin/info2man b/bin/info2man new file mode 100755 index 00000000000..21d3746d6a9 --- /dev/null +++ b/bin/info2man @@ -0,0 +1,169 @@ +#! /bin/sh +# ============================================================================= +# +# = DESCRIPTION +# Front end to awk script for generating manual pages from classinfo +# files. +# +# = AUTHOR(S) +# Graham Dumpleton +# K. Dorn +# +# = COPYRIGHT +# Copyright 1991 OTC LIMITED +# Copyright 1994 DUMPLETON SOFTWARE CONSULTING PTY LIMITED +# +# ============================================================================= + +OSE_HOST= + +OSE_RELEASE_NAME= +export OSE_RELEASE_NAME + +OSE_ROOT=${OSE_ROOT-$WRAPPER_ROOT} +export OSE_ROOT + +OSE_VERSION_ROOT=$OSE_ROOT +export OSE_VERSION_ROOT + +BINDIR="$OSE_VERSION_ROOT/$OSE_HOST/bin" +LIBDIR=${CLASSINFOLIBDIR-"$OSE_VERSION_ROOT/bin"} + +AWK="${AWK-nawk}" + +if test "$AWK" = "nawk" +then + VARG="-v" +fi + +EXT="3" + +# +# Error. +# +ERROR() +{ + echo "`basename $0`: $1" >&2 + shift + while test $# != "0" + do + echo $1 >&2 + shift + done + exit 1 +} + +# +# Usage message. +# +USAGE() +{ + ERROR "Usage: `basename $0` file.ci" +} + +# +# Check usage. +# +if test $# != "1" -o "'basename $1 .ci'" = "$1" +then + USAGE +fi + +# +# Check for awk file etc. +# +INFO2MAN=$LIBDIR/info2doc.awk +MANFMT=$LIBDIR/info2doc.fmt +HIDINGFMT=$LIBDIR/hiding.fmt + +if test ! -f $HIDINGFMT +then + ERROR "Can't find $HIDINGFMT" +fi + +if test ! -f $INFO2MAN +then + ERROR "Can't find $INFO2MAN" +fi + +if test ! -f $MANFMT +then + ERROR "Can't find $MANFMT" +fi + + + + +ADTS=`$AWK ' +BEGIN { + FS="\n"; RS="" +} +$1 ~ "^(CLASS|STRUCT|UNION)$" && $2 !~ "(::|<)" { + printf( "%s\n", $2 ) +} +$1 ~ "^TEMPLATE$" && $3 !~ "::" { + printf( "%s\n", $3 ) +}' $1` + + + +VCSA=`$AWK ' +BEGIN { + FS="\n"; RS="" +} +$1 ~ "^CSAHEADER$" { + if ( $2 ~ "on" ) + printf("%s","csaprintheader=off"); + else + printf("%s","csaprintheader=off"); +}' $HIDINGFMT` + +VPUBL=`$AWK ' +BEGIN { + FS="\n"; RS="" +} +$1 ~ "^PUBLIC$" { + if ( $2 ~ "on" ) + printf("%s","publ=on"); + else + printf("%s","publ="); +}' $HIDINGFMT` + +VPROT=`$AWK ' +BEGIN { + FS="\n"; RS="" +} +$1 ~ "^PROTECTED$" { + if ( $2 ~ "on" ) + printf("%s","prot=on"); + else + printf("%s","prot="); +}' $HIDINGFMT` + +VPRIV=`$AWK ' +BEGIN { + FS="\n"; RS="" +} +$1 ~ "^PRIVATE$" { + if ( $2 ~ "on" ) + printf("%s","priv=on"); + else + printf("%s","priv="); +}' $HIDINGFMT` + +echo " $VPUBL $VPROT $VPRIV $VCSA " + + + +if test ! -z "$ADTS" +then + for ADT in $ADTS + do + echo "$ADT" + + $AWK -f $INFO2MAN \ + $VARG $VPUBL $VARG $VPROT $VARG $VPRIV $VARG $VCSA \ + $VARG pass=0 $VARG device=troff $VARG infile=$1 \ + $VARG class=$ADT $MANFMT $MANFMT > $ADT.$EXT + done +fi |