diff options
author | Joe Hunkeler <jhunkeler@gmail.com> | 2015-08-11 16:51:37 -0400 |
---|---|---|
committer | Joe Hunkeler <jhunkeler@gmail.com> | 2015-08-11 16:51:37 -0400 |
commit | 40e5a5811c6ffce9b0974e93cdd927cbcf60c157 (patch) | |
tree | 4464880c571602d54f6ae114729bf62a89518057 /pkg/utilities/t_detab.x | |
download | iraf-osx-40e5a5811c6ffce9b0974e93cdd927cbcf60c157.tar.gz |
Repatch (from linux) of OSX IRAF
Diffstat (limited to 'pkg/utilities/t_detab.x')
-rw-r--r-- | pkg/utilities/t_detab.x | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/pkg/utilities/t_detab.x b/pkg/utilities/t_detab.x new file mode 100644 index 00000000..6928b0b8 --- /dev/null +++ b/pkg/utilities/t_detab.x @@ -0,0 +1,30 @@ +# Copyright(c) 1986 Association of Universities for Research in Astronomy Inc. + +# DETAB -- Each file matching the file template is copied to the standard +# output, replacing tab characters by equivalent sequences of blanks. +# A special list of tabstops may optionally be specified. + +procedure t_detab () + +char tablist[SZ_LINE], line[SZ_LINE], outline[SZ_LINE], in_fname[SZ_FNAME] +int list, nchars, in, tabs[SZ_LINE] +int clpopni(), decode_tablist(), clgfil(), getline() +int gstrdetab(), open() + +begin + list = clpopni ("files") + call clgstr ("tablist", tablist, SZ_LINE) + if (decode_tablist (tablist, tabs, SZ_LINE) == ERR) + call error (1, "Unable to decode list of tabs.") + + while (clgfil (list, in_fname, SZ_FNAME) != EOF) { + in = open (in_fname, READ_ONLY, TEXT_FILE) + while (getline (in, line) != EOF) { + nchars = gstrdetab (line, outline, SZ_LINE, tabs) + call putline (STDOUT, outline) + } + call close (in) + } + + call clpcls (list) +end |