aboutsummaryrefslogtreecommitdiff
path: root/pkg/system/files.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/files.x
downloadiraf-osx-40e5a5811c6ffce9b0974e93cdd927cbcf60c157.tar.gz
Repatch (from linux) of OSX IRAF
Diffstat (limited to 'pkg/system/files.x')
-rw-r--r--pkg/system/files.x32
1 files changed, 32 insertions, 0 deletions
diff --git a/pkg/system/files.x b/pkg/system/files.x
new file mode 100644
index 00000000..9bd94f91
--- /dev/null
+++ b/pkg/system/files.x
@@ -0,0 +1,32 @@
+# Copyright(c) 1986 Association of Universities for Research in Astronomy Inc.
+
+# FILES -- Expand a file name template into a list of file names on the
+# standard output.
+
+procedure t_files()
+
+int list
+pointer sp, template, fname
+
+bool clgetb()
+int fntopnb(), fntgfnb(), clgeti(), btoi()
+
+begin
+ call smark (sp)
+ call salloc (fname, SZ_FNAME, TY_CHAR)
+ call salloc (template, SZ_LINE, TY_CHAR)
+
+ if (clgeti ("$nargs") > 0)
+ call clgstr ("template", Memc[template], SZ_LINE)
+ else
+ call strcpy ("*", Memc[template], SZ_LINE)
+
+ list = fntopnb (Memc[template], btoi(clgetb("sort")))
+ while (fntgfnb (list, Memc[fname], SZ_FNAME) != EOF) {
+ call printf ("%s\n")
+ call pargstr (Memc[fname])
+ }
+
+ call fntclsb (list)
+ call sfree (sp)
+end