]> Dogcows Code - chaz/tar/blobdiff - src/tar.h
(OLDGNU_COMPATIBILITY): Removed
[chaz/tar] / src / tar.h
index e51436380d2fb2b51b7cc6a012a13dfdc94918dc..9ba0a46be8a6b0b23d7c5d1455ca3e4d10fba155 100644 (file)
--- a/src/tar.h
+++ b/src/tar.h
    with this program; if not, write to the Free Software Foundation, Inc.,
    59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
 
-/* If OLDGNU_COMPATIBILITY is not zero, tar produces archives which, by
-   default, are readable by older versions of GNU tar.  This can be
-   overriden by using --posix; in this case, POSIXLY_CORRECT in environment
-   may be set for enforcing stricter conformance.  If OLDGNU_COMPATIBILITY
-   is zero or undefined, tar will eventually produces archives which, by
-   default, POSIX compatible; then either using --posix or defining
-   POSIXLY_CORRECT enforces stricter conformance.
-
-   This #define will disappear in a few years.  FP, June 1995.  */
-#define OLDGNU_COMPATIBILITY 1
-
 /* tar Header Block, from POSIX 1003.1-1990.  */
 
 /* POSIX header.  */
@@ -53,6 +42,29 @@ struct posix_header
                                /* 500 */
 };
 
+struct star_header
+{                              /* byte offset */
+  char name[100];              /*   0 */
+  char mode[8];                        /* 100 */
+  char uid[8];                 /* 108 */
+  char gid[8];                 /* 116 */
+  char size[12];               /* 124 */
+  char mtime[12];              /* 136 */
+  char chksum[8];              /* 148 */
+  char typeflag;               /* 156 */
+  char linkname[100];          /* 157 */
+  char magic[6];               /* 257 */
+  char version[2];             /* 263 */
+  char uname[32];              /* 265 */
+  char gname[32];              /* 297 */
+  char devmajor[8];            /* 329 */
+  char devminor[8];            /* 337 */
+  char prefix[131];            /* 345 */
+  char atime[12];               /* 476 */
+  char ctime[12];               /* 488 */
+                                /* 500 */
+};
+
 #define TMAGIC   "ustar"       /* ustar and a null */
 #define TMAGLEN  6
 #define TVERSION "00"          /* 00 and no null */
@@ -69,6 +81,10 @@ struct posix_header
 #define FIFOTYPE '6'           /* FIFO special */
 #define CONTTYPE '7'           /* reserved */
 
+#define XHDTYPE  'x'            /* Extended header referring to the
+                                  next file in the archive */
+#define XGLTYPE  'g'            /* Global extended header */
+
 /* Bits used in the mode field, values in octal.  */
 #define TSUID    04000         /* set UID on execution */
 #define TSGID    02000         /* set GID on execution */
@@ -122,26 +138,6 @@ struct sparse
 #define SPARSES_IN_OLDGNU_HEADER 4
 #define SPARSES_IN_SPARSE_HEADER 21
 
-/* The GNU extra header contains some information GNU tar needs, but not
-   foreseen in POSIX header format.  It is only used after a POSIX header
-   (and never with old GNU headers), and immediately follows this POSIX
-   header, when typeflag is a letter rather than a digit, so signaling a GNU
-   extension.  */
-
-struct extra_header
-{                              /* byte offset */
-  char atime[12];              /*   0 */
-  char ctime[12];              /*  12 */
-  char offset[12];             /*  24 */
-  char realsize[12];           /*  36 */
-  char longnames[4];           /*  48 */
-  char unused_pad1[68];                /*  52 */
-  struct sparse sp[SPARSES_IN_EXTRA_HEADER];
-                               /* 120 */
-  char isextended;             /* 504 */
-                               /* 505 */
-};
-
 /* Extension header for sparse files, used immediately after the GNU extra
    header, and used only if all sparse information cannot fit into that
    extra header.  There might even be many such extension headers, one after
@@ -225,14 +221,31 @@ enum archive_format
   V7_FORMAT,                   /* old V7 tar format */
   OLDGNU_FORMAT,               /* GNU format as per before tar 1.12 */
   POSIX_FORMAT,                        /* restricted, pure POSIX format */
+  STAR_FORMAT,                  /* Star format defined in 1994 */
   GNU_FORMAT                   /* POSIX format with GNU extensions */
 };
 
+struct tar_stat_info
+{
+  char *orig_file_name;     /* name of file read from the archive header */
+  char *file_name;          /* name of file for the current archive entry
+                              after being normalized.  */
+  int had_trailing_slash;   /* nonzero if the current archive entry had a
+                              trailing slash before it was normalized. */
+  char *link_name;          /* name of link for the current archive entry.  */
+
+  unsigned int  devminor;   /* device minor number */
+  unsigned int  devmajor;   /* device major number */
+  char          *uname;     /* user name of owner */
+  char          *gname;     /* group name of owner */
+  struct stat   stat;       /* regular filesystem stat */ 
+};
+
 union block
 {
   char buffer[BLOCKSIZE];
   struct posix_header header;
-  struct extra_header extra_header;
+  struct star_header star_header;
   struct oldgnu_header oldgnu_header;
   struct sparse_header sparse_header;
 };
This page took 0.024988 seconds and 4 git commands to generate.