aboutsummaryrefslogtreecommitdiff
path: root/sys/imfort/db/idbnaxis.x
diff options
context:
space:
mode:
Diffstat (limited to 'sys/imfort/db/idbnaxis.x')
-rw-r--r--sys/imfort/db/idbnaxis.x32
1 files changed, 32 insertions, 0 deletions
diff --git a/sys/imfort/db/idbnaxis.x b/sys/imfort/db/idbnaxis.x
new file mode 100644
index 00000000..3b898403
--- /dev/null
+++ b/sys/imfort/db/idbnaxis.x
@@ -0,0 +1,32 @@
+# Copyright(c) 1986 Association of Universities for Research in Astronomy Inc.
+
+include <ctype.h>
+
+# IDB_NAXIS -- Determine if the named keyword is one of the NAXIS* keywords,
+# and if so return the value of the numeric suffix.
+
+int procedure idb_naxis (keyw, axnum)
+
+char keyw[ARB] # keyword name
+int axnum # receives numeric axis code (0=no suffix)
+
+int ch, ip
+int strncmp(), ctoi()
+
+begin
+ if (strncmp (keyw, "i_naxis", 7) == 0)
+ ip = 8
+ else if (strncmp (keyw, "naxis", 5) == 0)
+ ip = 6
+ else
+ return (NO)
+
+ ch = keyw[ip]
+ if (!IS_DIGIT(ch) && ch != ' ' && ch != EOS)
+ return (NO)
+
+ if (ctoi (keyw, ip, axnum) <= 0)
+ axnum = 0
+
+ return (YES)
+end