home *** CD-ROM | disk | FTP | other *** search
/ linuxmafia.com 2016 / linuxmafia.com.tar / linuxmafia.com / pub / linux / backup / star-1.3.1.tar.gz / star-1.3.1.tar / star-1.3.1 / star / mtio.h < prev    next >
C/C++ Source or Header  |  2000-11-15  |  2KB  |  84 lines

  1. /* @(#)mtio.h    1.2 00/11/15 Copyright 1995,2000 J. Schilling */
  2. /*
  3.  *    Simplyfied mtio definitions
  4.  *    to be able to do at least remote mtio on systems
  5.  *    that have no local mtio
  6.  *
  7.  *    Copyright (c) 1995,2000 J. Schilling
  8.  */
  9. /*
  10.  * This program is free software; you can redistribute it and/or modify
  11.  * it under the terms of the GNU General Public License as published by
  12.  * the Free Software Foundation; either version 2, or (at your option)
  13.  * any later version.
  14.  *
  15.  * This program is distributed in the hope that it will be useful,
  16.  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  17.  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  18.  * GNU General Public License for more details.
  19.  *
  20.  * You should have received a copy of the GNU General Public License
  21.  * along with this program; see the file COPYING.  If not, write to
  22.  * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
  23.  */
  24.  
  25. #ifndef    _MTIO_H
  26. #define    _MTIO_H
  27.  
  28. #ifdef    __cplusplus
  29. extern "C" {
  30. #endif
  31.  
  32. /*
  33.  * Definitions for magnetic tape io control commands
  34.  */
  35.  
  36. /*
  37.  * structure for MTIOCTOP - magnetic tape operation command
  38.  */
  39. struct    mtop {
  40.     short    mt_op;        /* op code (see below)            */
  41.     daddr_t    mt_count;    /* repeat count or param        */
  42. };
  43.  
  44. /*
  45.  * op code values for mt_op
  46.  */
  47. #define    MTWEOF        0    /* write EOF record(s)            */
  48. #define    MTFSF        1    /* fwd space over file mark(s)        */
  49. #define    MTBSF        2    /* back space over file mark(s) (1/2" only ) */
  50. #define    MTFSR        3    /* fwd space record(s) (to inter-record gap) */
  51. #define    MTBSR        4    /* back space record(s) (to inter-record gap)*/
  52. #define    MTREW        5    /* rewind tape                */
  53. #define    MTOFFL        6    /* rewind and put the drive offline    */
  54. #define    MTNOP        7    /* no operation (sets status ?)        */
  55.  
  56. /*
  57.  * structure for MTIOCGET - magnetic tape get status command
  58.  */
  59. struct    mtget {
  60.     short    mt_type;    /* type of magnetic tape device        */
  61.                 /* the next two regs are device dependent */
  62.     short    mt_dsreg;    /* drive status 'register'        */
  63.     short    mt_erreg;    /* error 'register'            */
  64.     daddr_t    mt_resid;    /* transfer residual count        */
  65.     daddr_t    mt_fileno;    /* file # for current position        */
  66.     daddr_t    mt_blkno;    /* block # for current position        */
  67. };
  68.  
  69. #define    HAVE_MTGET_TYPE
  70. #define    HAVE_MTGET_DSREG
  71. #define    HAVE_MTGET_ERREG
  72. #define    HAVE_MTGET_RESID
  73. #define    HAVE_MTGET_FILENO
  74. #define    HAVE_MTGET_BLKNO
  75.  
  76. #define    MTIOCGET    0x12340001
  77. #define    MTIOCTOP    0x12340002
  78.  
  79. #ifdef    __cplusplus
  80. }
  81. #endif
  82.  
  83. #endif /* _MTIO_H */
  84.