aboutsummaryrefslogtreecommitdiff
path: root/sys/imio/iki/ikidelete.x
diff options
context:
space:
mode:
authorJoseph Hunkeler <jhunkeler@gmail.com>2015-07-08 20:46:52 -0400
committerJoseph Hunkeler <jhunkeler@gmail.com>2015-07-08 20:46:52 -0400
commitfa080de7afc95aa1c19a6e6fc0e0708ced2eadc4 (patch)
treebdda434976bc09c864f2e4fa6f16ba1952b1e555 /sys/imio/iki/ikidelete.x
downloadiraf-linux-fa080de7afc95aa1c19a6e6fc0e0708ced2eadc4.tar.gz
Initial commit
Diffstat (limited to 'sys/imio/iki/ikidelete.x')
-rw-r--r--sys/imio/iki/ikidelete.x41
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