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/fio/fnextn.x | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 sys/fio/fnextn.x (limited to 'sys/fio/fnextn.x') diff --git a/sys/fio/fnextn.x b/sys/fio/fnextn.x new file mode 100644 index 00000000..47e73a08 --- /dev/null +++ b/sys/fio/fnextn.x @@ -0,0 +1,21 @@ +# Copyright(c) 1986 Association of Universities for Research in Astronomy Inc. + +# FNEXTN -- Extract the file name extension from a virtual file name (or a +# machine dependent file name. If the VFN contains no extension field, the +# null string is returned. The number of chars in the extension string is +# returned as the function value. + +int procedure fnextn (vfn, outstr, maxch) + +char vfn[ARB], outstr[maxch] +int maxch +int root_offset, extn_offset +int gstrcpy() + +begin + call zfnbrk (vfn, root_offset, extn_offset) + if (vfn[extn_offset] != EOS) + extn_offset = extn_offset + 1 + + return (gstrcpy (vfn[extn_offset], outstr, maxch)) +end -- cgit