diff options
author | Joseph Hunkeler <jhunkeler@gmail.com> | 2015-07-08 20:46:52 -0400 |
---|---|---|
committer | Joseph Hunkeler <jhunkeler@gmail.com> | 2015-07-08 20:46:52 -0400 |
commit | fa080de7afc95aa1c19a6e6fc0e0708ced2eadc4 (patch) | |
tree | bdda434976bc09c864f2e4fa6f16ba1952b1e555 /pkg/utilities/t_entab.x | |
download | iraf-linux-fa080de7afc95aa1c19a6e6fc0e0708ced2eadc4.tar.gz |
Initial commit
Diffstat (limited to 'pkg/utilities/t_entab.x')
-rw-r--r-- | pkg/utilities/t_entab.x | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/pkg/utilities/t_entab.x b/pkg/utilities/t_entab.x new file mode 100644 index 00000000..f0bc977e --- /dev/null +++ b/pkg/utilities/t_entab.x @@ -0,0 +1,31 @@ +# Copyright(c) 1986 Association of Universities for Research in Astronomy Inc. + +# ENTAB -- Given a list of files and a list of tabstops, replace sequences +# of blanks in the files by equivalent sequences of tab characters and blanks. + +procedure t_entab() + +char tablist[SZ_LINE], line[SZ_LINE], outline[SZ_LINE] +char in_fname[SZ_FNAME] +int list, in, nchars + +int clpopni(), decode_tablist(), tabs[SZ_LINE], clgfil(), getline() +int gstrentab(), 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 = gstrentab (line, outline, SZ_LINE, tabs) + call putline (STDOUT, outline) + } + call close (in) + } + + call clpcls (list) +end |