From fa080de7afc95aa1c19a6e6fc0e0708ced2eadc4 Mon Sep 17 00:00:00 2001 From: Joseph Hunkeler Date: Wed, 8 Jul 2015 20:46:52 -0400 Subject: Initial commit --- sys/fmtio/stridx.x | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 sys/fmtio/stridx.x (limited to 'sys/fmtio/stridx.x') diff --git a/sys/fmtio/stridx.x b/sys/fmtio/stridx.x new file mode 100644 index 00000000..dda74f5a --- /dev/null +++ b/sys/fmtio/stridx.x @@ -0,0 +1,17 @@ +# Copyright(c) 1986 Association of Universities for Research in Astronomy Inc. + +# STRIDX -- Return the index of the first occurrence of a character in a +# string. + +int procedure stridx (ch, str) + +char ch, str[ARB] +int ip + +begin + do ip = 1, ARB + if (str[ip] == EOS) + return (0) + else if (str[ip] == ch) + return (ip) +end -- cgit