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/mtio/mtskip.x | |
download | iraf-linux-fa080de7afc95aa1c19a6e6fc0e0708ced2eadc4.tar.gz |
Initial commit
Diffstat (limited to 'sys/mtio/mtskip.x')
-rw-r--r-- | sys/mtio/mtskip.x | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/sys/mtio/mtskip.x b/sys/mtio/mtskip.x new file mode 100644 index 00000000..f51948a4 --- /dev/null +++ b/sys/mtio/mtskip.x @@ -0,0 +1,31 @@ +# Copyright(c) 1986 Association of Universities for Research in Astronomy Inc. + +include <fset.h> + +# MT_SKIP_RECORD -- Skip records on an opened file. Return the actual number +# of records skipped; stop if EOF is reached. + +int procedure mt_skip_record (fd, nrecords) + +int fd #I magtape device +int nrecords #I number of records to skip + +pointer sp, buf +int n, bufsize +errchk aread, await +int await(), fstati() + +begin + call smark (sp) + bufsize = fstati (fd, F_BUFSIZE) + call salloc (buf, bufsize, TY_CHAR) + + for (n=1; n <= nrecords; n=n+1) { + call aread (fd, Memc[buf], bufsize, 0) + if (await (fd) == EOF) + break + } + + call sfree (sp) + return (n-1) +end |