tar.h revision 7c2fbfb345896881c631598ee3852ce9ce33fb07
73db2ddb960cafd7ffb6daf89eb697910d36c56dJames Phillpotts
73db2ddb960cafd7ffb6daf89eb697910d36c56dJames Phillpotts/* : : generated by proto : : */
73db2ddb960cafd7ffb6daf89eb697910d36c56dJames Phillpotts/***********************************************************************
73db2ddb960cafd7ffb6daf89eb697910d36c56dJames Phillpotts* *
73db2ddb960cafd7ffb6daf89eb697910d36c56dJames Phillpotts* This software is part of the ast package *
73db2ddb960cafd7ffb6daf89eb697910d36c56dJames Phillpotts* Copyright (c) 1985-2008 AT&T Intellectual Property *
73db2ddb960cafd7ffb6daf89eb697910d36c56dJames Phillpotts* and is licensed under the *
73db2ddb960cafd7ffb6daf89eb697910d36c56dJames Phillpotts* Common Public License, Version 1.0 *
73db2ddb960cafd7ffb6daf89eb697910d36c56dJames Phillpotts* by AT&T Intellectual Property *
73db2ddb960cafd7ffb6daf89eb697910d36c56dJames Phillpotts* *
73db2ddb960cafd7ffb6daf89eb697910d36c56dJames Phillpotts* A copy of the License is available at *
73db2ddb960cafd7ffb6daf89eb697910d36c56dJames Phillpotts* http://www.opensource.org/licenses/cpl1.0.txt *
73db2ddb960cafd7ffb6daf89eb697910d36c56dJames Phillpotts* (with md5 checksum 059e8cd6165cb4c31e351f2b69388fd9) *
73db2ddb960cafd7ffb6daf89eb697910d36c56dJames Phillpotts* *
73db2ddb960cafd7ffb6daf89eb697910d36c56dJames Phillpotts* Information and Software Systems Research *
73db2ddb960cafd7ffb6daf89eb697910d36c56dJames Phillpotts* AT&T Research *
73db2ddb960cafd7ffb6daf89eb697910d36c56dJames Phillpotts* Florham Park NJ *
73db2ddb960cafd7ffb6daf89eb697910d36c56dJames Phillpotts* *
73db2ddb960cafd7ffb6daf89eb697910d36c56dJames Phillpotts* Glenn Fowler <gsf@research.att.com> *
73db2ddb960cafd7ffb6daf89eb697910d36c56dJames Phillpotts* David Korn <dgk@research.att.com> *
73db2ddb960cafd7ffb6daf89eb697910d36c56dJames Phillpotts* Phong Vo <kpv@research.att.com> *
73db2ddb960cafd7ffb6daf89eb697910d36c56dJames Phillpotts* *
73db2ddb960cafd7ffb6daf89eb697910d36c56dJames Phillpotts***********************************************************************/
73db2ddb960cafd7ffb6daf89eb697910d36c56dJames Phillpotts
73db2ddb960cafd7ffb6daf89eb697910d36c56dJames Phillpotts/*
73db2ddb960cafd7ffb6daf89eb697910d36c56dJames Phillpotts * Standard Archive Format
73db2ddb960cafd7ffb6daf89eb697910d36c56dJames Phillpotts * USTAR - Uniform Standard Tape ARchive
73db2ddb960cafd7ffb6daf89eb697910d36c56dJames Phillpotts */
73db2ddb960cafd7ffb6daf89eb697910d36c56dJames Phillpotts
73db2ddb960cafd7ffb6daf89eb697910d36c56dJames Phillpotts#ifndef _TAR_H
73db2ddb960cafd7ffb6daf89eb697910d36c56dJames Phillpotts#if !defined(__PROTO__)
73db2ddb960cafd7ffb6daf89eb697910d36c56dJames Phillpotts#include <prototyped.h>
73db2ddb960cafd7ffb6daf89eb697910d36c56dJames Phillpotts#endif
73db2ddb960cafd7ffb6daf89eb697910d36c56dJames Phillpotts#if !defined(__LINKAGE__)
73db2ddb960cafd7ffb6daf89eb697910d36c56dJames Phillpotts#define __LINKAGE__ /* 2004-08-11 transition */
73db2ddb960cafd7ffb6daf89eb697910d36c56dJames Phillpotts#endif
73db2ddb960cafd7ffb6daf89eb697910d36c56dJames Phillpotts
73db2ddb960cafd7ffb6daf89eb697910d36c56dJames Phillpotts#define _TAR_H
73db2ddb960cafd7ffb6daf89eb697910d36c56dJames Phillpotts
73db2ddb960cafd7ffb6daf89eb697910d36c56dJames Phillpotts#define TBLOCK 512
73db2ddb960cafd7ffb6daf89eb697910d36c56dJames Phillpotts#define NAMSIZ 100
73db2ddb960cafd7ffb6daf89eb697910d36c56dJames Phillpotts#define PFXSIZ 155
73db2ddb960cafd7ffb6daf89eb697910d36c56dJames Phillpotts
73db2ddb960cafd7ffb6daf89eb697910d36c56dJames Phillpotts#define TMODLEN 8
73db2ddb960cafd7ffb6daf89eb697910d36c56dJames Phillpotts#define TUIDLEN 8
73db2ddb960cafd7ffb6daf89eb697910d36c56dJames Phillpotts#define TGIDLEN 8
73db2ddb960cafd7ffb6daf89eb697910d36c56dJames Phillpotts#define TSIZLEN 12
73db2ddb960cafd7ffb6daf89eb697910d36c56dJames Phillpotts#define TMTMLEN 12
73db2ddb960cafd7ffb6daf89eb697910d36c56dJames Phillpotts#define TCKSLEN 8
73db2ddb960cafd7ffb6daf89eb697910d36c56dJames Phillpotts
73db2ddb960cafd7ffb6daf89eb697910d36c56dJames Phillpotts#define TMAGIC "ustar" /* ustar and a null */
73db2ddb960cafd7ffb6daf89eb697910d36c56dJames Phillpotts#define TMAGLEN 6
73db2ddb960cafd7ffb6daf89eb697910d36c56dJames Phillpotts#define TVERSION "00" /* 00 and no null */
73db2ddb960cafd7ffb6daf89eb697910d36c56dJames Phillpotts#define TVERSLEN 2
73db2ddb960cafd7ffb6daf89eb697910d36c56dJames Phillpotts#define TUNMLEN 32
73db2ddb960cafd7ffb6daf89eb697910d36c56dJames Phillpotts#define TGNMLEN 32
73db2ddb960cafd7ffb6daf89eb697910d36c56dJames Phillpotts#define TDEVLEN 8
73db2ddb960cafd7ffb6daf89eb697910d36c56dJames Phillpotts
73db2ddb960cafd7ffb6daf89eb697910d36c56dJames Phillpotts/*
73db2ddb960cafd7ffb6daf89eb697910d36c56dJames Phillpotts * values used in typeflag field
73db2ddb960cafd7ffb6daf89eb697910d36c56dJames Phillpotts */
73db2ddb960cafd7ffb6daf89eb697910d36c56dJames Phillpotts
73db2ddb960cafd7ffb6daf89eb697910d36c56dJames Phillpotts#define REGTYPE '0' /* regular file */
73db2ddb960cafd7ffb6daf89eb697910d36c56dJames Phillpotts#define AREGTYPE 0 /* alternate REGTYPE */
73db2ddb960cafd7ffb6daf89eb697910d36c56dJames Phillpotts#define LNKTYPE '1' /* hard link */
73db2ddb960cafd7ffb6daf89eb697910d36c56dJames Phillpotts#define SYMTYPE '2' /* soft link */
73db2ddb960cafd7ffb6daf89eb697910d36c56dJames Phillpotts#define CHRTYPE '3' /* character special */
73db2ddb960cafd7ffb6daf89eb697910d36c56dJames Phillpotts#define BLKTYPE '4' /* block special */
73db2ddb960cafd7ffb6daf89eb697910d36c56dJames Phillpotts#define DIRTYPE '5' /* directory */
73db2ddb960cafd7ffb6daf89eb697910d36c56dJames Phillpotts#define FIFOTYPE '6' /* FIFO special */
73db2ddb960cafd7ffb6daf89eb697910d36c56dJames Phillpotts#define CONTTYPE '7' /* reserved */
73db2ddb960cafd7ffb6daf89eb697910d36c56dJames Phillpotts#define SOKTYPE '8' /* socket */
73db2ddb960cafd7ffb6daf89eb697910d36c56dJames Phillpotts#define EXTTYPE 'x' /* extended header */
73db2ddb960cafd7ffb6daf89eb697910d36c56dJames Phillpotts#define GLBTYPE 'g' /* global extended header */
73db2ddb960cafd7ffb6daf89eb697910d36c56dJames Phillpotts#define LLNKTYPE 'K' /* long link path */
73db2ddb960cafd7ffb6daf89eb697910d36c56dJames Phillpotts#define LREGTYPE 'L' /* long file path */
73db2ddb960cafd7ffb6daf89eb697910d36c56dJames Phillpotts#define VERTYPE 'V' /* version */
73db2ddb960cafd7ffb6daf89eb697910d36c56dJames Phillpotts
73db2ddb960cafd7ffb6daf89eb697910d36c56dJames Phillpotts/*
73db2ddb960cafd7ffb6daf89eb697910d36c56dJames Phillpotts * bits used in mode field
73db2ddb960cafd7ffb6daf89eb697910d36c56dJames Phillpotts */
73db2ddb960cafd7ffb6daf89eb697910d36c56dJames Phillpotts
73db2ddb960cafd7ffb6daf89eb697910d36c56dJames Phillpotts#define TSUID 04000 /* set uid on exec */
73db2ddb960cafd7ffb6daf89eb697910d36c56dJames Phillpotts#define TSGID 02000 /* set gid on exec */
73db2ddb960cafd7ffb6daf89eb697910d36c56dJames Phillpotts#define TSVTX 01000 /* sticky bit -- reserved */
73db2ddb960cafd7ffb6daf89eb697910d36c56dJames Phillpotts
73db2ddb960cafd7ffb6daf89eb697910d36c56dJames Phillpotts/*
73db2ddb960cafd7ffb6daf89eb697910d36c56dJames Phillpotts * file permissions
73db2ddb960cafd7ffb6daf89eb697910d36c56dJames Phillpotts */
73db2ddb960cafd7ffb6daf89eb697910d36c56dJames Phillpotts
73db2ddb960cafd7ffb6daf89eb697910d36c56dJames Phillpotts#define TUREAD 00400 /* read by owner */
73db2ddb960cafd7ffb6daf89eb697910d36c56dJames Phillpotts#define TUWRITE 00200 /* write by owner */
73db2ddb960cafd7ffb6daf89eb697910d36c56dJames Phillpotts#define TUEXEC 00100 /* execute by owner */
73db2ddb960cafd7ffb6daf89eb697910d36c56dJames Phillpotts#define TGREAD 00040 /* read by group */
73db2ddb960cafd7ffb6daf89eb697910d36c56dJames Phillpotts#define TGWRITE 00020 /* execute by group */
73db2ddb960cafd7ffb6daf89eb697910d36c56dJames Phillpotts#define TGEXEC 00010 /* write by group */
73db2ddb960cafd7ffb6daf89eb697910d36c56dJames Phillpotts#define TOREAD 00004 /* read by other */
73db2ddb960cafd7ffb6daf89eb697910d36c56dJames Phillpotts#define TOWRITE 00002 /* write by other */
73db2ddb960cafd7ffb6daf89eb697910d36c56dJames Phillpotts#define TOEXEC 00001 /* execute by other */
73db2ddb960cafd7ffb6daf89eb697910d36c56dJames Phillpotts
73db2ddb960cafd7ffb6daf89eb697910d36c56dJames Phillpottsstruct header
73db2ddb960cafd7ffb6daf89eb697910d36c56dJames Phillpotts{
73db2ddb960cafd7ffb6daf89eb697910d36c56dJames Phillpotts char name[NAMSIZ];
73db2ddb960cafd7ffb6daf89eb697910d36c56dJames Phillpotts char mode[TMODLEN];
73db2ddb960cafd7ffb6daf89eb697910d36c56dJames Phillpotts char uid[TUIDLEN];
73db2ddb960cafd7ffb6daf89eb697910d36c56dJames Phillpotts char gid[TGIDLEN];
73db2ddb960cafd7ffb6daf89eb697910d36c56dJames Phillpotts char size[TSIZLEN];
73db2ddb960cafd7ffb6daf89eb697910d36c56dJames Phillpotts char mtime[TMTMLEN];
73db2ddb960cafd7ffb6daf89eb697910d36c56dJames Phillpotts char chksum[TCKSLEN];
73db2ddb960cafd7ffb6daf89eb697910d36c56dJames Phillpotts char typeflag;
73db2ddb960cafd7ffb6daf89eb697910d36c56dJames Phillpotts char linkname[NAMSIZ];
4aa5badd5f4858577979ba105aa80ff34e84feccCraig McDonnell char magic[TMAGLEN];
73db2ddb960cafd7ffb6daf89eb697910d36c56dJames Phillpotts char version[TVERSLEN];
char uname[TUNMLEN];
char gname[TGNMLEN];
char devmajor[TDEVLEN];
char devminor[TDEVLEN];
char prefix[PFXSIZ];
};
union hblock
{
char dummy[TBLOCK];
struct header dbuf;
};
#endif