diff options
Diffstat (limited to 'noao/digiphot/apphot/aputil/aprmwhite.x')
-rw-r--r-- | noao/digiphot/apphot/aputil/aprmwhite.x | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/noao/digiphot/apphot/aputil/aprmwhite.x b/noao/digiphot/apphot/aputil/aprmwhite.x new file mode 100644 index 00000000..071ea7ed --- /dev/null +++ b/noao/digiphot/apphot/aputil/aprmwhite.x @@ -0,0 +1,22 @@ +include <ctype.h> + +# AP_RMWHITE -- Remove whitespace from a string. + +procedure ap_rmwhite (instr, outstr, maxch) + +char instr[ARB] # the input string +char outstr[ARB] # the output string, may be the same as instr +int maxch # maximum number of characters in outstr + +int ip, op + +begin + op = 1 + for (ip = 1; (instr[ip] != EOS) && (op <= maxch); ip = ip + 1) { + if (IS_WHITE(instr[ip])) + next + outstr[op] = instr[ip] + op = op + 1 + } + outstr[op] = EOS +end |