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 /sys/imio/iki/ikidelete.x | |
download | iraf-osx-40e5a5811c6ffce9b0974e93cdd927cbcf60c157.tar.gz |
Repatch (from linux) of OSX IRAF
Diffstat (limited to 'sys/imio/iki/ikidelete.x')
-rw-r--r-- | sys/imio/iki/ikidelete.x | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/sys/imio/iki/ikidelete.x b/sys/imio/iki/ikidelete.x new file mode 100644 index 00000000..a172980b --- /dev/null +++ b/sys/imio/iki/ikidelete.x @@ -0,0 +1,41 @@ +# Copyright(c) 1986 Association of Universities for Research in Astronomy Inc. + +include <syserr.h> +include "iki.h" + +# IKI_DELETE -- Delete an image or group of images. + +procedure iki_delete (image) + +char image[ARB] #I name of image + +int k, status +pointer sp, root, extn +int iki_access() +bool fnullfile() + +errchk syserrs +include "iki.com" + +begin + if (fnullfile (image)) + return + + call smark (sp) + call salloc (root, SZ_PATHNAME, TY_CHAR) + call salloc (extn, MAX_LENEXTN, TY_CHAR) + + # Verify that the image exists and determine its type. + k = iki_access (image, Memc[root], Memc[extn], 0) + if (k < 0) + call syserrs (SYS_IKIAMBIG, image) + else if (k == 0) + call syserrs (SYS_IKIIMNF, image) + + # Delete the image. + call zcall4 (IKI_DELETE(k), k, Memc[root], Memc[extn], status) + if (status == ERR) + call syserrs (SYS_IKIDEL, image) + + call sfree (sp) +end |