aboutsummaryrefslogtreecommitdiff
path: root/sys/mwcs/iwfind.x
diff options
context:
space:
mode:
authorJoe Hunkeler <jhunkeler@gmail.com>2015-08-11 16:51:37 -0400
committerJoe Hunkeler <jhunkeler@gmail.com>2015-08-11 16:51:37 -0400
commit40e5a5811c6ffce9b0974e93cdd927cbcf60c157 (patch)
tree4464880c571602d54f6ae114729bf62a89518057 /sys/mwcs/iwfind.x
downloadiraf-osx-40e5a5811c6ffce9b0974e93cdd927cbcf60c157.tar.gz
Repatch (from linux) of OSX IRAF
Diffstat (limited to 'sys/mwcs/iwfind.x')
-rw-r--r--sys/mwcs/iwfind.x34
1 files changed, 34 insertions, 0 deletions
diff --git a/sys/mwcs/iwfind.x b/sys/mwcs/iwfind.x
new file mode 100644
index 00000000..e400f9ee
--- /dev/null
+++ b/sys/mwcs/iwfind.x
@@ -0,0 +1,34 @@
+# Copyright(c) 1986 Association of Universities for Research in Astronomy Inc.
+
+include "imwcs.h"
+
+# IW_FINDCARD -- Search the card list in the IMWCS descriptor for a card of
+# the given type, with the given axis and index numbers. Return a pointer to
+# the card if found, else NULL.
+
+pointer procedure iw_findcard (iw, type, axis, index)
+
+pointer iw #I pointer to IMWCS descriptor
+int type #I card type code
+int axis #I axis number, or <0 to ignore
+int index #I index number, or <=0 to ignore
+
+int i
+pointer cp
+
+begin
+ do i = 1, IW_NCARDS(iw) {
+ cp = IW_CARD(iw,i)
+ if (C_TYPE(cp) != type)
+ next
+ if (axis >= 0)
+ if (C_AXIS(cp) != axis)
+ next
+ if (index > 0)
+ if (C_INDEX(cp) != index)
+ next
+ return (cp)
+ }
+
+ return (NULL)
+end