aboutsummaryrefslogtreecommitdiff
path: root/pkg/system/help/t_lroff.x
diff options
context:
space:
mode:
authorJoe Hunkeler <jhunkeler@gmail.com>2015-08-11 16:51:37 -0400
committerJoe Hunkeler <jhunkeler@gmail.com>2015-08-11 16:51:37 -0400
commit40e5a5811c6ffce9b0974e93cdd927cbcf60c157 (patch)
tree4464880c571602d54f6ae114729bf62a89518057 /pkg/system/help/t_lroff.x
downloadiraf-osx-40e5a5811c6ffce9b0974e93cdd927cbcf60c157.tar.gz
Repatch (from linux) of OSX IRAF
Diffstat (limited to 'pkg/system/help/t_lroff.x')
-rw-r--r--pkg/system/help/t_lroff.x35
1 files changed, 35 insertions, 0 deletions
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