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 / table.h < prev    next >
C/C++ Source or Header  |  1996-06-26  |  3KB  |  91 lines

  1. /* @(#)table.h    1.4 96/06/26 Copyright 1994 J. Schilling */
  2. /*
  3.  *    Conversion table definitions for efficient conversion
  4.  *    of different file type representations
  5.  *
  6.  *    Copyright (c) 1994 J. Schilling
  7.  */
  8. /*
  9.  * This program is free software; you can redistribute it and/or modify
  10.  * it under the terms of the GNU General Public License as published by
  11.  * the Free Software Foundation; either version 2, or (at your option)
  12.  * any later version.
  13.  *
  14.  * This program is distributed in the hope that it will be useful,
  15.  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  16.  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  17.  * GNU General Public License for more details.
  18.  *
  19.  * You should have received a copy of the GNU General Public License
  20.  * along with this program; see the file COPYING.  If not, write to
  21.  * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
  22.  */
  23.  
  24. /*
  25.  * Unix uses the following file types
  26.  */
  27. #ifdef    comment
  28.         0000000        /* Unallocated        */
  29. S_IFIFO        0010000    FIFO    /* Named pipe        */
  30. S_IFCHR        0020000    CHR    /* Character special    */
  31. S_IFMPC        0030000        /* UNUSED multiplexed c    */
  32. S_IFDIR        0040000    DIR    /* Directory        */
  33. S_IFNAM        0050000    NAM    /* Named file (XENIX)    */
  34. S_IFBLK        0060000    BLK    /* Block special    */
  35. S_IFMPB        0070000        /* UNUSED multiplexed b    */
  36. S_IFREG        0100000    REG    /* Regular file     */
  37. S_IFCNT        0110000    CTG    /* Contiguous file    */
  38. S_IFLNK        0120000    SLNK    /* Symbolic link    */
  39. S_IFSHAD    0130000        /* Solaris shadow inode    */
  40. S_IFSOCK    0140000    SOCK    /* UNIX domain socket    */
  41. S_IFDOOR    0150000        /* Solaris DOOR        */
  42.         0160000        /* UNUSED cpio acl    */
  43.         0170000        /* UNUSED        */
  44. #endif
  45.  
  46. /*
  47.  * Internal table of file types.
  48.  *
  49.  * N.B. The order in this table is not important,
  50.  * new real file types may be added before XT_DUMPDIR,
  51.  * new symbolic file types may be added before XT_BAD.
  52.  */
  53. #define    XT_NONE        0    /* unallocated file            */
  54. #define    XT_FILE        1    /* regular file                */
  55. #define    XT_CONT        2    /* contiguous file            */
  56. #define    XT_LINK        3    /* hard link (needed for internal use)    */
  57. #define    XT_SLINK    4    /* symbolic link            */
  58. #define    XT_DIR        5    /* directory                */
  59. #define    XT_CHR        6    /* character special            */
  60. #define    XT_BLK        7    /* block special            */
  61. #define    XT_FIFO        8    /* fifo (named pipe)            */
  62. #define    XT_SOCK        9    /* unix domain socket            */
  63.                 /* ... Reserved ...            */
  64. #define    XT_DUMPDIR    20    /* Dir entry containing filenames    */
  65. #define    XT_LONGLINK    21    /* Next file on tape has a long link    */
  66. #define    XT_LONGNAME    22    /* Next file on tape has a long name    */
  67. #define    XT_MULTIVOL    23    /* Continuation of a file from another tape*/
  68. #define    XT_NAMES    24    /* OLD                    */
  69. #define    XT_SPARSE    25    /* for files with holes in it        */
  70. #define    XT_VOLHDR    26    /* Tape Volume header            */
  71. #define    XT_BAD        31    /* illegal file type            */
  72.  
  73. extern char    iftoxt_tab[];
  74. extern char    ustoxt_tab[];
  75. extern char    gttoxt_tab[];
  76.  
  77. extern int    xttoif_tab[];
  78. extern char    xttost_tab[];
  79. extern char    xttous_tab[];
  80. extern char    *xttostr_tab[];
  81.  
  82. #define    IFTOXT(t)    (iftoxt_tab[((t)&S_IFMT) >> 12])/* UNIX to XT    */
  83. #define    USTOXT(t)    (ustoxt(t))            /* ustar to XT    */
  84. #define    _USTOXT(t)    (ustoxt_tab[(t)-REGTYPE])    /* ustar to XT    */
  85. #define    _GTTOXT(t)    (gttoxt_tab[(t)-'A'])        /* gnutar to XT    */
  86.  
  87. #define    XTTOIF(t)    (xttoif_tab[(t)])        /* XT to UNIX    */
  88. #define    XTTOST(t)    (xttost_tab[(t)])        /* XT to star    */
  89. #define    XTTOUS(t)    (xttous_tab[(t)])        /* XT to ustar    */
  90. #define    XTTOSTR(t)    (xttostr_tab[(t)])        /* XT to string */
  91.