From 40e5a5811c6ffce9b0974e93cdd927cbcf60c157 Mon Sep 17 00:00:00 2001 From: Joe Hunkeler Date: Tue, 11 Aug 2015 16:51:37 -0400 Subject: Repatch (from linux) of OSX IRAF --- pkg/system/help/t_lroff.x | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 pkg/system/help/t_lroff.x (limited to 'pkg/system/help/t_lroff.x') diff --git a/pkg/system/help/t_lroff.x b/pkg/system/help/t_lroff.x new file mode 100644 index 00000000..9df65d43 --- /dev/null +++ b/pkg/system/help/t_lroff.x @@ -0,0 +1,35 @@ +# Copyright(c) 1986 Association of Universities for Research in Astronomy Inc. + +# LROFF -- Text process a file. + +procedure t_lroff() + +char fname[SZ_FNAME] +char line[SZ_LINE] +char format[SZ_FNAME] +int fd, lmargin, rmargin +int open(), getline(), strmatch(), clgeti() +extern getline(), putline() + +begin + call clgstr ("input_file", fname, SZ_FNAME) + fd = open (fname, READ_ONLY, TEXT_FILE) + + lmargin = clgeti ("lmargin") + rmargin = clgeti ("rmargin") + call clgstr ("format", format, SZ_FNAME) + + while (getline (fd, line) != EOF) { + if (strmatch (line, "^.help") > 0) { + if (format[1] == 't') + call lroff (getline, fd, putline, STDOUT, lmargin, rmargin, + YES, NO) + else if (format[1] == 'h') + call lroff2html (fd, STDOUT, fname, "", "", "", "") + else if (format[1] == 'p') + call lroff2ps (fd, STDOUT, NULL, "", "") + } + } + + call close (fd) +end -- cgit