diff options
author | Joseph Hunkeler <jhunkeler@gmail.com> | 2015-07-08 20:46:52 -0400 |
---|---|---|
committer | Joseph Hunkeler <jhunkeler@gmail.com> | 2015-07-08 20:46:52 -0400 |
commit | fa080de7afc95aa1c19a6e6fc0e0708ced2eadc4 (patch) | |
tree | bdda434976bc09c864f2e4fa6f16ba1952b1e555 /sys/imfort/db/idbnaxis.x | |
download | iraf-linux-fa080de7afc95aa1c19a6e6fc0e0708ced2eadc4.tar.gz |
Initial commit
Diffstat (limited to 'sys/imfort/db/idbnaxis.x')
-rw-r--r-- | sys/imfort/db/idbnaxis.x | 32 |
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 |