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 /pkg/utilities/nttools/stxtools/clgnone.x | |
download | iraf-linux-fa080de7afc95aa1c19a6e6fc0e0708ced2eadc4.tar.gz |
Initial commit
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 |