diff options
author | Joe Hunkeler <jhunkeler@gmail.com> | 2015-08-11 16:51:37 -0400 |
---|---|---|
committer | Joe Hunkeler <jhunkeler@gmail.com> | 2015-08-11 16:51:37 -0400 |
commit | 40e5a5811c6ffce9b0974e93cdd927cbcf60c157 (patch) | |
tree | 4464880c571602d54f6ae114729bf62a89518057 /sys/fmio/fmlfawr.x | |
download | iraf-osx-40e5a5811c6ffce9b0974e93cdd927cbcf60c157.tar.gz |
Repatch (from linux) of OSX IRAF
Diffstat (limited to 'sys/fmio/fmlfawr.x')
-rw-r--r-- | sys/fmio/fmlfawr.x | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/sys/fmio/fmlfawr.x b/sys/fmio/fmlfawr.x new file mode 100644 index 00000000..7d122dc0 --- /dev/null +++ b/sys/fmio/fmlfawr.x @@ -0,0 +1,35 @@ +# Copyright(c) 1986 Association of Universities for Research in Astronomy Inc. + +include <mach.h> +include "fmio.h" + +# FM_LFAWRITE -- Asynchronous blocked write to an lfile. The differences +# between text and binary lfiles are not visible above this level; both +# appear as binary files to FIO. + +procedure fm_lfawrite (lf, buf, nbytes, offset) + +pointer lf #I lfile descriptor +char buf[ARB] #O input data buffer +int nbytes #I nbytes to write +long offset #I lfile offset + +int status, nb +pointer sp, pk_buf + +begin + if (and (LF_FLAGS(lf), LFF_TEXTFILE) == 0) + call fm_lfbinwrite (lf, buf, nbytes, offset) + else { + call smark (sp) + call salloc (pk_buf, nbytes / SZB_CHAR, TY_CHAR) + + # Wait for i/o to complete before freeing buffer! + nb = (nbytes + SZB_CHAR-1) / SZB_CHAR + call chrpak (buf, 1, Memc[pk_buf], 1, nb) + call fm_lfbinwrite (lf, Memc[pk_buf], nb, (offset-1)/SZB_CHAR+1) + call fm_lfbinwait (lf, status) + + call sfree (sp) + } +end |