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/stxtools/clgnone.x | |
download | iraf-osx-40e5a5811c6ffce9b0974e93cdd927cbcf60c157.tar.gz |
Repatch (from linux) of OSX IRAF
Diffstat (limited to 'pkg/utilities/nttools/stxtools/clgnone.x')
-rw-r--r-- | pkg/utilities/nttools/stxtools/clgnone.x | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/pkg/utilities/nttools/stxtools/clgnone.x b/pkg/utilities/nttools/stxtools/clgnone.x new file mode 100644 index 00000000..b6fde15c --- /dev/null +++ b/pkg/utilities/nttools/stxtools/clgnone.x @@ -0,0 +1,37 @@ +# CLGNONE -- Get a string parameter whose value may be "none" +# +# B.Simon 20-Jun-94 original +# B.Simon 30-Jan-95 moved to stxtools + +procedure clgnone (param, value, maxch) + +char param[ARB] # i: parameter name +char value[ARB] # o: parameter value +int maxch # i: maximum length of value +#-- +pointer sp, temp1, temp2 +bool streq() + +begin + # Allocate memory for temporary strings + + call smark (sp) + call salloc (temp1, maxch, TY_CHAR) + call salloc (temp2, maxch, TY_CHAR) + + # Read parameter and convert to lower case for simpler comparison + + call clgstr (param, Memc[temp1], maxch) + call strcpy (Memc[temp1], Memc[temp2], maxch) + call strjust (Memc[temp2]) + + # If value is none, set to null string + + if (Memc[temp2] == EOS || streq (Memc[temp2], "none")) { + value[1] = EOS + } else { + call strcpy (Memc[temp1], value, maxch) + } + + call sfree (sp) +end |