From fa080de7afc95aa1c19a6e6fc0e0708ced2eadc4 Mon Sep 17 00:00:00 2001 From: Joseph Hunkeler Date: Wed, 8 Jul 2015 20:46:52 -0400 Subject: Initial commit --- sys/imio/iki/stf/stfdelete.x | 40 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 sys/imio/iki/stf/stfdelete.x (limited to 'sys/imio/iki/stf/stfdelete.x') diff --git a/sys/imio/iki/stf/stfdelete.x b/sys/imio/iki/stf/stfdelete.x new file mode 100644 index 00000000..dd319f12 --- /dev/null +++ b/sys/imio/iki/stf/stfdelete.x @@ -0,0 +1,40 @@ +# Copyright(c) 1986 Association of Universities for Research in Astronomy Inc. + +include +include +include "stf.h" + +# STF_DELETE -- Delete an image. A special operator is required since the +# image is stored as two files. + +procedure stf_delete (kernel, root, extn, status) + +int kernel #I IKI kernel +char root[ARB] #I root filename +char extn[ARB] #U header file extension +int status #O return value + +pointer sp +pointer hdr_fname, pix_fname +int access() + +begin + call smark (sp) + call salloc (hdr_fname, SZ_PATHNAME, TY_CHAR) + call salloc (pix_fname, SZ_PATHNAME, TY_CHAR) + + # Generate filename. + call iki_mkfname (root, extn, Memc[hdr_fname], SZ_PATHNAME) + call stf_mkpixfname (root, extn, Memc[pix_fname], SZ_PATHNAME) + + # If the header cannot be deleted, leave the pixfile alone. + iferr (call delete (Memc[hdr_fname])) + call erract (EA_WARN) + else if (access (Memc[pix_fname],0,0) == YES) { + iferr (call delete (Memc[pix_fname])) + call erract (EA_WARN) + } + + status = OK + call sfree (sp) +end -- cgit