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 /sys/imio/iki/qpf/qpfrename.x | |
download | iraf-linux-fa080de7afc95aa1c19a6e6fc0e0708ced2eadc4.tar.gz |
Initial commit
Diffstat (limited to 'sys/imio/iki/qpf/qpfrename.x')
-rw-r--r-- | sys/imio/iki/qpf/qpfrename.x | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/sys/imio/iki/qpf/qpfrename.x b/sys/imio/iki/qpf/qpfrename.x new file mode 100644 index 00000000..70f90626 --- /dev/null +++ b/sys/imio/iki/qpf/qpfrename.x @@ -0,0 +1,37 @@ +# Copyright(c) 1986 Association of Universities for Research in Astronomy Inc. + +include <error.h> +include "qpf.h" + +# QPF_RENAME -- Rename a datafile. + +procedure qpf_rename (kernel, old_root, old_extn, new_root, new_extn, status) + +int kernel #I IKI kernel +char old_root[ARB] #I old image root name +char old_extn[ARB] #I old image extn +char new_root[ARB] #I new image root name +char new_extn[ARB] #I old image extn +int status #O output status + +pointer sp, oldname, newname +errchk qp_rename + +begin + call smark (sp) + call salloc (oldname, SZ_PATHNAME, TY_CHAR) + call salloc (newname, SZ_PATHNAME, TY_CHAR) + + # Get filenames of old and new datafiles. + call iki_mkfname (old_root, old_extn, Memc[oldname], SZ_PATHNAME) + call iki_mkfname (new_root, QPF_EXTN, Memc[newname], SZ_PATHNAME) + + # Rename the datafile. + iferr (call qp_rename (Memc[oldname], Memc[newname])) { + call erract (EA_WARN) + status = ERR + } else + status = OK + + call sfree (sp) +end |