home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Spezial / SPEZIAL2_97.zip / SPEZIAL2_97.iso / ANWEND / PACKER / GTAK258 / RMT / rmt.doc < prev   
Text File  |  1994-10-29  |  4KB  |  140 lines

  1. ###############################################################################
  2. # $Id: rmt.doc,v 1.7 1994/10/04 21:40:52 ak Exp $
  3. ###############################################################################
  4. # $Log: rmt.doc,v $
  5. # Revision 1.7  1994/10/04  21:40:52  ak
  6. # Added the remaining functions to disk support.
  7. #
  8. # Revision 1.6  1994/07/06 21:19:31  ak
  9. # Bugfix.
  10. #
  11. # Revision 1.5  1994/06/02 13:40:29  ak
  12. # Stop reading when a filemark is encountered.
  13. #
  14. # Revision 1.4  1994/03/20 01:10:13  ak
  15. # .
  16. #
  17. # Revision 1.3  1994/02/16 15:29:23  edvkai
  18. # Dummy checkin for CVS 1.3 crlf.
  19. #
  20. # Revision 1.2  1993/12/05 13:33:36  ak
  21. # *** empty log message ***
  22. #
  23. # Revision 1.1  1993/12/05  13:33:14  ak
  24. # Initial revision
  25. #
  26. ###############################################################################
  27.  
  28. Linkage: _System
  29.  
  30. Return values:
  31.     -2: device error (mapped to EIO), see also rmt_error()
  32.     -3: end of media (mapped to ENOSPC)
  33.     -4: invalid function (mapped to EINVAL)
  34.  
  35. -----------------------------------------------------------------------------
  36.     int    rmt_open(char *name, int mode, int prot);
  37.  
  38. Required.
  39. Similar to open(name,mode,prot).
  40. Return an archive handle >= 0.
  41.  
  42. <name> is the part of the archive name beyond the colon. The name
  43. before the colon determines the DLL to be loaded The archive name
  44. "abc:def" loads "rmt_abc.dll" and calls rmt_open("def", ...).
  45.  
  46. -----------------------------------------------------------------------------
  47.     int    rmt_close(int fd);
  48.  
  49. Required.
  50.  
  51. -----------------------------------------------------------------------------
  52.     int    rmt_read(int fd, void *p, unsigned blocksz);
  53.  
  54. Optional. 
  55. Similar to read(fd,p,blocksz).
  56. <blocksz> is the size of a tar block.
  57.  
  58. Reading stops when a filemark is encountered. Subsequent reads return 0
  59. (EOF) until the tape is repositioned by rmt_seek or reopened.
  60.  
  61. -----------------------------------------------------------------------------
  62.     int    rmt_write(int fd, void *p, unsigned blocksz);
  63.  
  64. Optional.
  65. Similar to write(fd,p,blocksz).
  66. <blocksz> is the size of a tar block.
  67.  
  68. -----------------------------------------------------------------------------
  69.     long    rmt_seek(int fd, long block, long blocksz, int mode);
  70.  
  71. Optional.
  72.  
  73. <blocksz> is the size of a tar block.
  74.  
  75. <mode>:    0: Seek to <block> tar blocks from beginning of archive.
  76.        Return >= 0 on success.
  77.  
  78.     1: Return current position in tar blocks.
  79.        <block> is 0.
  80.  
  81.     2: Seek to the end of the archive.
  82.        Return >= 0 on success.
  83.        <block> is 0.
  84.  
  85.        If the device supports multiple archives on the same
  86.        media, like tape devices with filemarks, skip to the
  87.        beginning of the next archive on the media.
  88.  
  89.        If rmt_read hit a filemark and so the tape already is
  90.        properly positioned beyond the filemark, this subfunction
  91.        should just reset the filemark condition.
  92.  
  93.     3: Seek to absolute position identification.
  94.        Return >= 0 on success.
  95.  
  96.     4: Return absolute identification of current position.
  97.  
  98.        An "absolute position identification" can be
  99.        anything which maps to a 32-bit number and
  100.        uniquely identifies a tar block position on the
  101.        media.
  102.  
  103.     5: Rewind to the beginning of the media.
  104.        Return >= 0 on success.
  105.  
  106. If not implemented, a replacement routine maps to lseek. Note that
  107. block numbers are used instead of bytes offsets to avoid loosing QFA
  108. capability beyond 2GB.
  109.  
  110. -----------------------------------------------------------------------------
  111.     int    rmt_ioctl(int fd, int code, void *arg);
  112.  
  113. Optional.
  114. Similar to ioctl(fd,code,arg).
  115.  
  116. This function is intended to provide Unix-style tape ioctl functions
  117. someday. Currently it is not used.
  118.  
  119. -----------------------------------------------------------------------------
  120.     int    rmt_block(int fd);
  121.  
  122. Returns the current device blocksize. Return 0 if the device is set to
  123. variable blocksize.
  124.  
  125. -----------------------------------------------------------------------------
  126.     long    rmt_error(void);
  127.  
  128. Return a detailed error code for the last command if the function
  129. returned -2.
  130.  
  131. -----------------------------------------------------------------------------
  132.     char *    rmt_status(long rcode);
  133.  
  134. Map the error code to a text describing the error. Usually
  135. the function call sequence is
  136.     rmt_*        returning -2
  137.     rmt_error    returning rcode
  138.     rmt_status
  139. so you can use results of the previous command if necessary.
  140.