From d88e3d82a24aa2bf0e6f0aeb3579128f779bb687 Mon Sep 17 00:00:00 2001 From: Pablo Santamaria Date: Thu, 13 May 2010 00:57:22 +0200 Subject: academic/slatec: Added to 13.0 repository --- academic/slatec/makedoc.sed | 81 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 81 insertions(+) create mode 100644 academic/slatec/makedoc.sed (limited to 'academic/slatec/makedoc.sed') diff --git a/academic/slatec/makedoc.sed b/academic/slatec/makedoc.sed new file mode 100644 index 0000000000..a80bccdf2d --- /dev/null +++ b/academic/slatec/makedoc.sed @@ -0,0 +1,81 @@ +# By Giuseppe Borzi' - my first sed scriptfile +# cancels lines after the proglogue +# Modified by Pablo Santamaria for section 3 of manual pages +1,/END\ PROLOGUE/!d +1,/END\ PROLOGUE/{ +# defines and print the title +/^\*DECK/{ +s/^\*DECK *\(.*\)/.TH \1 3/ +p +s/.*/.SH SYNOPSIS/ +} +s/^ *// +# The hell ! +/^C\*\*\*BEGIN PROLOGUE/{ +# convert to lowercase for use in NAME +y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ +# append next line +N +s/^c\*\*\*begin prologue *\([a-z0-9]*\)\nC\*\*\*PURPOSE *\(.*\)/\1 \\- \2/ +t nosubsidiary +s/\nC\*\*\*SUBSIDIARY// +N +s/^c\*\*\*begin prologue *\([a-z0-9]*\)\nC\*\*\*PURPOSE *\(.*\)/\1 \\- \2/ +:nosubsidiary +h +# print NAME heading +s/.*/.SH NAME/ +p +# retrieve original line from hold space and rewrite +x +} +# cancels END PROLOGUE +s/^C\*\*\*END PROLOGUE.*// +# change each C*** to a roff section heading +s/^C\*\*\*/.SH / +# builds headings formed by two or more words +/\.SH ROUTINES CALLED/{ +h +s/\(\.SH ROUTINES CALLED\).*/\1/ +p +x +s/\.SH ROUTINES CALLED *\(.*\)/\1/ +} +/\.SH REVISION HISTORY (YYMMDD)/{ +h +s/\(\.SH REVISION HISTORY (YYMMDD)\).*/\1/ +p +s/\(\.SH REVISION HISTORY (YYMMDD)\).*/.PD 0/ +p +x +s/\.SH REVISION HISTORY (YYMMDD) *\(.*\)/\1/ +} +/\.SH COMMON BLOCKS/{ +h +s/\(\.SH COMMON BLOCKS\).*/\1/ +p +x +s/\.SH COMMON BLOCKS *\(.*\)/\1/ +} +/\.SH SEE ALSO/{ +h +s/\(\.SH SEE ALSO\).*/\1/ +p +x +s/\.SH SEE ALSO *\(.*\)/\1/ +} +# builds headings formed by one word +/\.SH/{ +h +s/\(\.SH *[A-Z]*\).*/\1/ +p +x +s/\.SH *[A-Z]* *\(.*\)/\1/ +} +# strip initial C and eventually spaces +s/^C *// +s/^C$// +# this is Y2K compliant ! +/[0789][0-9][01][0-9][0-3][0-9]/i\ +.P +} -- cgit v1.2.3