diff options
author | Joe Hunkeler <jhunkeler@gmail.com> | 2015-08-11 16:51:37 -0400 |
---|---|---|
committer | Joe Hunkeler <jhunkeler@gmail.com> | 2015-08-11 16:51:37 -0400 |
commit | 40e5a5811c6ffce9b0974e93cdd927cbcf60c157 (patch) | |
tree | 4464880c571602d54f6ae114729bf62a89518057 /pkg/utilities/nttools/copyone/getimghdr.x | |
download | iraf-osx-40e5a5811c6ffce9b0974e93cdd927cbcf60c157.tar.gz |
Repatch (from linux) of OSX IRAF
Diffstat (limited to 'pkg/utilities/nttools/copyone/getimghdr.x')
-rw-r--r-- | pkg/utilities/nttools/copyone/getimghdr.x | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/pkg/utilities/nttools/copyone/getimghdr.x b/pkg/utilities/nttools/copyone/getimghdr.x new file mode 100644 index 00000000..03dc9ced --- /dev/null +++ b/pkg/utilities/nttools/copyone/getimghdr.x @@ -0,0 +1,35 @@ +# GETIMGHDR -- Read a keyword from an image header into a string +# +# B.Simon 13-Aug-87 First Code +# B.Simon 12-Dec-94 Added error check +# B.Simon 21-Jul-97 Add extra check to work around imgftype bug + +procedure getimghdr (hd, keyword, maxch, value, keytype) + +pointer hd # i: Image descriptor +char keyword[ARB] # i: Name of header keyword +int maxch # i: Maximum length of keyword value +char value[ARB] # o: Keyword value +int keytype # o: Type of header keyword +#-- +int imgftype() +errchk imgstr + +begin + # Read image header keyword and get datatype + + call imgstr (hd, keyword, value, maxch) + keytype = imgftype (hd, keyword) + + # If boolean, convert to the standard names + # The check on value[2] is to work around a + # bug in imgftype() + + if (value[2] == EOS && keytype == TY_BOOL) + if (value[1] == 'T') + call strcpy ("yes", value, maxch) + else + call strcpy ("no", value, maxch) + + return +end |