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/imfort/db/idbnaxis.x | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 sys/imfort/db/idbnaxis.x (limited to 'sys/imfort/db/idbnaxis.x') 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 + +# 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 -- cgit