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/imfort/imftrans.x | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 sys/imfort/imftrans.x (limited to 'sys/imfort/imftrans.x') diff --git a/sys/imfort/imftrans.x b/sys/imfort/imftrans.x new file mode 100644 index 00000000..f758c3da --- /dev/null +++ b/sys/imfort/imftrans.x @@ -0,0 +1,30 @@ +# Copyright(c) 1986 Association of Universities for Research in Astronomy Inc. + +include "oif.h" + +# IMF_TRANS -- Translate a host filename into root (includes directory +# prefix) and extension fields. FIO escape sequence encoding is used on +# the portion of the filename excluding the directory prefix. Legal host +# filenames are unaffected by the translation except for case conversions, +# i.e., only constructs which are not legal in host filenames are affected +# by the translation, allowing legal host filenames to be passed through +# without change. + +procedure imf_trans (fname, root, extn) + +char fname[ARB] #I input filename +char root[SZ_PATHNAME] #O root portion of filename +char extn[MAX_LENEXTN] #O extn portion of filename + +int o_root, o_extn, ip, op +int gstrcpy() + +begin + # Copy out the directory prefix, if any, unchanged. + call zfnbrk (fname, o_root, o_extn) + op = gstrcpy (fname, root, o_root-1) + 1 + ip = o_root + + # Perform escape sequence encoding and parse into root and extn. + call vfn_encode (fname, ip, root[op], o_root, extn, o_extn) +end -- cgit