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/page.x | 41 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 pkg/system/page.x (limited to 'pkg/system/page.x') 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 + +# 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 -- cgit