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/fstrfp.x | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 sys/fio/fstrfp.x (limited to 'sys/fio/fstrfp.x') diff --git a/sys/fio/fstrfp.x b/sys/fio/fstrfp.x new file mode 100644 index 00000000..851bb6b1 --- /dev/null +++ b/sys/fio/fstrfp.x @@ -0,0 +1,27 @@ +# Copyright(c) 1986 Association of Universities for Research in Astronomy Inc. + +include +include + +# FSTRFP -- Get a dummy file descriptor for use by STROPEN "files". +# The static part of the descriptor is returned to later be allocated +# by STROPEN. The dynamic part is permanently allocated, and is used to +# make the string look more like a regular file. + +procedure fstrfp (newfp) + +pointer newfp +pointer str_fp +int fd, fgetfd() +data str_fp /NULL/ +include + +begin + if (str_fp == NULL) { + fd = fgetfd ("String_File", STRING_FILE, STRING_FILE) + str_fp = fiodes[fd] + fiodes[fd] = NULL + } + + newfp = str_fp +end -- cgit