aboutsummaryrefslogtreecommitdiff
path: root/pkg/system/page.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/page.x
downloadiraf-osx-40e5a5811c6ffce9b0974e93cdd927cbcf60c157.tar.gz
Repatch (from linux) of OSX IRAF
Diffstat (limited to 'pkg/system/page.x')
-rw-r--r--pkg/system/page.x41
1 files changed, 41 insertions, 0 deletions
diff --git a/pkg/system/page.x b/pkg/system/page.x
new file mode 100644
index 00000000..208bb56b
--- /dev/null
+++ b/pkg/system/page.x
@@ -0,0 +1,41 @@
+# Copyright(c) 1986 Association of Universities for Research in Astronomy Inc.
+
+include <fset.h>
+
+# PAGE -- Display a text file or files on the standard output (the user
+# terminal) one screen at a time, pausing after each screen has been filled.
+# The program is keystroke driven in raw mode, and currently recognizes the
+# keystrokes defined above.
+
+procedure t_page()
+
+bool redirin
+pointer sp, device, prompt, files
+int map_cc, clear_screen, first_page
+
+bool clgetb()
+int fstati(), clgeti(), btoi()
+
+begin
+ call smark (sp)
+ call salloc (device, SZ_FNAME, TY_CHAR)
+ call salloc (prompt, SZ_FNAME, TY_CHAR)
+ call salloc (files, SZ_LINE, TY_CHAR)
+
+ redirin = (fstati (STDIN, F_REDIR) == YES)
+ if (redirin)
+ call strcpy ("STDIN", Memc[files], SZ_LINE)
+ else
+ call clgstr ("files", Memc[files], SZ_LINE)
+
+ map_cc = btoi (clgetb ("map_cc"))
+ clear_screen = btoi (clgetb ("clear_screen"))
+ first_page = clgeti ("first_page")
+ call clgstr ("prompt", Memc[prompt], SZ_FNAME)
+ call clgstr ("device", Memc[device], SZ_FNAME)
+
+ call xpagefiles (Memc[files], Memc[device], Memc[prompt],
+ first_page, clear_screen, map_cc)
+
+ call sfree (sp)
+end