aboutsummaryrefslogtreecommitdiff
path: root/sys/fio/fnextn.x
blob: 47e73a08886df2c9786a9e23f6ed15b31e8e2f26 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
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