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/libc/cvfnbrk.c | |
download | iraf-linux-fa080de7afc95aa1c19a6e6fc0e0708ced2eadc4.tar.gz |
Initial commit
Diffstat (limited to 'sys/libc/cvfnbrk.c')
-rw-r--r-- | sys/libc/cvfnbrk.c | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/sys/libc/cvfnbrk.c b/sys/libc/cvfnbrk.c new file mode 100644 index 00000000..346b07fb --- /dev/null +++ b/sys/libc/cvfnbrk.c @@ -0,0 +1,30 @@ +/* Copyright(c) 1986 Association of Universities for Research in Astronomy Inc. +*/ + +#define import_spp +#define import_libc +#define import_knames +#include <iraf.h> + + +/* C_VFNBRK -- Break a virtual filename (or host filename) into its component +** parts, i.e., logical directory (ldir), root, and extension. No characters +** are actually moved, rather, the offsets to the root and extn fields are +** returned as output arguments. +*/ +void +c_vfnbrk ( + char *vfn, /* virtual filename (or osfn) */ + int *root, /* offset of root field. */ + int *extn /* offset of extn field. */ +) +{ + XCHAR sppvfn[SZ_PATHNAME]; + XINT x_root = *root, x_extn = extn; + + ZFNBRK (c_strupk(vfn,sppvfn,SZ_PATHNAME), &x_root, &x_extn); + + /* Make offsets zero-indexed. */ + *root -= 1; + *extn -= 1; +} |