From fa080de7afc95aa1c19a6e6fc0e0708ced2eadc4 Mon Sep 17 00:00:00 2001 From: Joseph Hunkeler Date: Wed, 8 Jul 2015 20:46:52 -0400 Subject: Initial commit --- pkg/utilities/nttools/stxtools/strjust.x | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 pkg/utilities/nttools/stxtools/strjust.x (limited to 'pkg/utilities/nttools/stxtools/strjust.x') diff --git a/pkg/utilities/nttools/stxtools/strjust.x b/pkg/utilities/nttools/stxtools/strjust.x new file mode 100644 index 00000000..5f50f080 --- /dev/null +++ b/pkg/utilities/nttools/stxtools/strjust.x @@ -0,0 +1,31 @@ +include + +# STRJUST -- Remove whitspace from a string and convert to lower case +# +# B.Simon 30-Jan-95 copied from synphot$strfix + +procedure strjust (str) + +char str[ARB] # u: string to convert +#-- +int ic, jc + +begin + jc = 1 + for (ic = 1; str[ic] != EOS; ic = ic + 1) { + if (IS_WHITE(str[ic])) + next + + if (IS_UPPER(str[ic])) { + str[jc] = TO_LOWER(str[ic]) + + } else if (jc < ic) { + str[jc] = str[ic] + } + + jc = jc + 1 + } + + str[jc] = EOS +end + -- cgit