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