rpm 5.3.7

file/src/tar.h

Go to the documentation of this file.
00001 /*
00002  * Copyright (c) Ian F. Darwin 1986-1995.
00003  * Software written by Ian F. Darwin and others;
00004  * maintained 1995-present by Christos Zoulas and others.
00005  * 
00006  * Redistribution and use in source and binary forms, with or without
00007  * modification, are permitted provided that the following conditions
00008  * are met:
00009  * 1. Redistributions of source code must retain the above copyright
00010  *    notice immediately at the beginning of the file, without modification,
00011  *    this list of conditions, and the following disclaimer.
00012  * 2. Redistributions in binary form must reproduce the above copyright
00013  *    notice, this list of conditions and the following disclaimer in the
00014  *    documentation and/or other materials provided with the distribution.
00015  *  
00016  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
00017  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
00018  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
00019  * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE FOR
00020  * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
00021  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
00022  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
00023  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
00024  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
00025  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
00026  * SUCH DAMAGE.
00027  */
00028 /*
00029  * Header file for public domain tar (tape archive) program.
00030  *
00031  * @(#)tar.h 1.20 86/10/29      Public Domain.
00032  *
00033  * Created 25 August 1985 by John Gilmore, ihnp4!hoptoad!gnu.
00034  *
00035  * $File: tar.h,v 1.12 2008/02/07 00:58:52 christos Exp $ # checkin only
00036  */
00037 
00038 /*
00039  * Header block on tape.
00040  *
00041  * I'm going to use traditional DP naming conventions here.
00042  * A "block" is a big chunk of stuff that we do I/O on.
00043  * A "record" is a piece of info that we care about.
00044  * Typically many "record"s fit into a "block".
00045  */
00046 #define RECORDSIZE      512
00047 #define NAMSIZ  100
00048 #define TUNMLEN 32
00049 #define TGNMLEN 32
00050 
00051 union record {
00052         char            charptr[RECORDSIZE];
00053         struct header {
00054                 char    name[NAMSIZ];
00055                 char    mode[8];
00056                 char    uid[8];
00057                 char    gid[8];
00058                 char    size[12];
00059                 char    mtime[12];
00060                 char    chksum[8];
00061                 char    linkflag;
00062                 char    linkname[NAMSIZ];
00063                 char    magic[8];
00064                 char    uname[TUNMLEN];
00065                 char    gname[TGNMLEN];
00066                 char    devmajor[8];
00067                 char    devminor[8];
00068         } header;
00069 };
00070 
00071 /* The magic field is filled with this if uname and gname are valid. */
00072 #define TMAGIC          "ustar"         /* 5 chars and a null */
00073 #define GNUTMAGIC       "ustar  "       /* 7 chars and a null */