tar.h 3.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. /* $NetBSD: tar.h,v 1.4 2003/08/07 09:44:11 agc Exp $ */
  2. /*-
  3. * Copyright (c) 1994
  4. * The Regents of the University of California. All rights reserved.
  5. *
  6. * This code is derived from software contributed to Berkeley by
  7. * Chuck Karish of Mindcraft, Inc.
  8. *
  9. * Redistribution and use in source and binary forms, with or without
  10. * modification, are permitted provided that the following conditions
  11. * are met:
  12. * 1. Redistributions of source code must retain the above copyright
  13. * notice, this list of conditions and the following disclaimer.
  14. * 2. Redistributions in binary form must reproduce the above copyright
  15. * notice, this list of conditions and the following disclaimer in the
  16. * documentation and/or other materials provided with the distribution.
  17. * 3. Neither the name of the University nor the names of its contributors
  18. * may be used to endorse or promote products derived from this software
  19. * without specific prior written permission.
  20. *
  21. * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
  22. * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  23. * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
  24. * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
  25. * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
  26. * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
  27. * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
  28. * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
  29. * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
  30. * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  31. * SUCH DAMAGE.
  32. *
  33. * @(#)tar.h 8.2 (Berkeley) 1/4/94
  34. */
  35. #ifndef _TAR_H
  36. #define _TAR_H
  37. #define TMAGIC "ustar" /* ustar and a null */
  38. #define TMAGLEN 6
  39. #define TVERSION "00" /* 00 and no null */
  40. #define TVERSLEN 2
  41. /* Values used in typeflag field */
  42. #define REGTYPE '0' /* Regular file */
  43. #define AREGTYPE '\0' /* Regular file */
  44. #define LNKTYPE '1' /* Link */
  45. #define SYMTYPE '2' /* Reserved */
  46. #define CHRTYPE '3' /* Character special */
  47. #define BLKTYPE '4' /* Block special */
  48. #define DIRTYPE '5' /* Directory */
  49. #define FIFOTYPE '6' /* FIFO special */
  50. #define CONTTYPE '7' /* Reserved */
  51. /* Bits used in the mode field - values in octal */
  52. #define TSUID 04000 /* Set UID on execution */
  53. #define TSGID 02000 /* Set GID on execution */
  54. #define TSVTX 01000 /* Reserved */
  55. /* File permissions */
  56. #define TUREAD 00400 /* Read by owner */
  57. #define TUWRITE 00200 /* Write by owner */
  58. #define TUEXEC 00100 /* Execute/Search by owner */
  59. #define TGREAD 00040 /* Read by group */
  60. #define TGWRITE 00020 /* Write by group */
  61. #define TGEXEC 00010 /* Execute/Search by group */
  62. #define TOREAD 00004 /* Read by other */
  63. #define TOWRITE 00002 /* Write by other */
  64. #define TOEXEC 00001 /* Execute/Search by other */
  65. #endif