aboutsummaryrefslogtreecommitdiff
path: root/sys/fmio/fmfopen.x
diff options
context:
space:
mode:
Diffstat (limited to 'sys/fmio/fmfopen.x')
-rw-r--r--sys/fmio/fmfopen.x30
1 files changed, 30 insertions, 0 deletions
diff --git a/sys/fmio/fmfopen.x b/sys/fmio/fmfopen.x
new file mode 100644
index 00000000..6b3b897a
--- /dev/null
+++ b/sys/fmio/fmfopen.x
@@ -0,0 +1,30 @@
+# Copyright(c) 1986 Association of Universities for Research in Astronomy Inc.
+
+# FM_FOPEN -- Open an lfile as an FIO file. A FIO file descriptor is returned
+# for the open file. CLOSE is used to close the opened file.
+
+int procedure fm_fopen (fm, lfile, mode, type)
+
+pointer fm #I FMIO descriptor
+int lfile #I lfile to be opened
+int mode #I file access mode
+int type #I logical file type
+
+int fd
+pointer sp, lfname
+extern fm_lfopen(), fm_lfclose()
+extern fm_lfaread(), fm_lfawrite(), fm_lfawait(), fm_lfstati()
+int fopnbf()
+errchk fopnbf
+
+begin
+ call smark (sp)
+ call salloc (lfname, SZ_FNAME, TY_CHAR)
+
+ call fm_lfname (fm, lfile, type, Memc[lfname], SZ_FNAME)
+ fd = fopnbf (Memc[lfname], mode, fm_lfopen, fm_lfaread, fm_lfawrite,
+ fm_lfawait, fm_lfstati, fm_lfclose)
+
+ call sfree (sp)
+ return (fd)
+end