home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
OS/2 Spezial
/
SPEZIAL2_97.zip
/
SPEZIAL2_97.iso
/
ANWEND
/
PACKER
/
GTAK258
/
RMT
/
rmt.doc
< prev
Wrap
Text File
|
1994-10-29
|
4KB
|
140 lines
###############################################################################
# $Id: rmt.doc,v 1.7 1994/10/04 21:40:52 ak Exp $
###############################################################################
# $Log: rmt.doc,v $
# Revision 1.7 1994/10/04 21:40:52 ak
# Added the remaining functions to disk support.
#
# Revision 1.6 1994/07/06 21:19:31 ak
# Bugfix.
#
# Revision 1.5 1994/06/02 13:40:29 ak
# Stop reading when a filemark is encountered.
#
# Revision 1.4 1994/03/20 01:10:13 ak
# .
#
# Revision 1.3 1994/02/16 15:29:23 edvkai
# Dummy checkin for CVS 1.3 crlf.
#
# Revision 1.2 1993/12/05 13:33:36 ak
# *** empty log message ***
#
# Revision 1.1 1993/12/05 13:33:14 ak
# Initial revision
#
###############################################################################
Linkage: _System
Return values:
-2: device error (mapped to EIO), see also rmt_error()
-3: end of media (mapped to ENOSPC)
-4: invalid function (mapped to EINVAL)
-----------------------------------------------------------------------------
int rmt_open(char *name, int mode, int prot);
Required.
Similar to open(name,mode,prot).
Return an archive handle >= 0.
<name> is the part of the archive name beyond the colon. The name
before the colon determines the DLL to be loaded The archive name
"abc:def" loads "rmt_abc.dll" and calls rmt_open("def", ...).
-----------------------------------------------------------------------------
int rmt_close(int fd);
Required.
-----------------------------------------------------------------------------
int rmt_read(int fd, void *p, unsigned blocksz);
Optional.
Similar to read(fd,p,blocksz).
<blocksz> is the size of a tar block.
Reading stops when a filemark is encountered. Subsequent reads return 0
(EOF) until the tape is repositioned by rmt_seek or reopened.
-----------------------------------------------------------------------------
int rmt_write(int fd, void *p, unsigned blocksz);
Optional.
Similar to write(fd,p,blocksz).
<blocksz> is the size of a tar block.
-----------------------------------------------------------------------------
long rmt_seek(int fd, long block, long blocksz, int mode);
Optional.
<blocksz> is the size of a tar block.
<mode>: 0: Seek to <block> tar blocks from beginning of archive.
Return >= 0 on success.
1: Return current position in tar blocks.
<block> is 0.
2: Seek to the end of the archive.
Return >= 0 on success.
<block> is 0.
If the device supports multiple archives on the same
media, like tape devices with filemarks, skip to the
beginning of the next archive on the media.
If rmt_read hit a filemark and so the tape already is
properly positioned beyond the filemark, this subfunction
should just reset the filemark condition.
3: Seek to absolute position identification.
Return >= 0 on success.
4: Return absolute identification of current position.
An "absolute position identification" can be
anything which maps to a 32-bit number and
uniquely identifies a tar block position on the
media.
5: Rewind to the beginning of the media.
Return >= 0 on success.
If not implemented, a replacement routine maps to lseek. Note that
block numbers are used instead of bytes offsets to avoid loosing QFA
capability beyond 2GB.
-----------------------------------------------------------------------------
int rmt_ioctl(int fd, int code, void *arg);
Optional.
Similar to ioctl(fd,code,arg).
This function is intended to provide Unix-style tape ioctl functions
someday. Currently it is not used.
-----------------------------------------------------------------------------
int rmt_block(int fd);
Returns the current device blocksize. Return 0 if the device is set to
variable blocksize.
-----------------------------------------------------------------------------
long rmt_error(void);
Return a detailed error code for the last command if the function
returned -2.
-----------------------------------------------------------------------------
char * rmt_status(long rcode);
Map the error code to a text describing the error. Usually
the function call sequence is
rmt_* returning -2
rmt_error returning rcode
rmt_status
so you can use results of the previous command if necessary.