diff options
author | Joseph Hunkeler <jhunkeler@gmail.com> | 2015-07-08 20:46:52 -0400 |
---|---|---|
committer | Joseph Hunkeler <jhunkeler@gmail.com> | 2015-07-08 20:46:52 -0400 |
commit | fa080de7afc95aa1c19a6e6fc0e0708ced2eadc4 (patch) | |
tree | bdda434976bc09c864f2e4fa6f16ba1952b1e555 /sys/fio/fnroot.x | |
download | iraf-linux-fa080de7afc95aa1c19a6e6fc0e0708ced2eadc4.tar.gz |
Initial commit
Diffstat (limited to 'sys/fio/fnroot.x')
-rw-r--r-- | sys/fio/fnroot.x | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/sys/fio/fnroot.x b/sys/fio/fnroot.x new file mode 100644 index 00000000..91042e87 --- /dev/null +++ b/sys/fio/fnroot.x @@ -0,0 +1,21 @@ +# Copyright(c) 1986 Association of Universities for Research in Astronomy Inc. + +# FNROOT -- Extract the root file name from a virtual file name (or from a +# machine dependent filename. If the VFN contains no root name, the null +# string is returned. This occurs when the VFN refers to a directory or +# device, or when the VFN string is a null string. The number of chars in +# the root file name is returned as the function value. + +int procedure fnroot (vfn, outstr, maxch) + +char vfn[ARB], outstr[maxch] +int maxch +int root_offset, extn_offset, nchars_root +int gstrcpy() + +begin + call zfnbrk (vfn, root_offset, extn_offset) + nchars_root = max(0, min(maxch, extn_offset - root_offset)) + + return (gstrcpy (vfn[root_offset], outstr, nchars_root)) +end |