Back to index

php5  5.3.10
tar.h
Go to the documentation of this file.
00001 #ifndef __PHAR_TAR_H
00002 #define __PHAR_TAR_H
00003 /*
00004   +----------------------------------------------------------------------+
00005   | TAR archive support for Phar                                         |
00006   +----------------------------------------------------------------------+
00007   | Copyright (c) 2005-2012 The PHP Group                                |
00008   +----------------------------------------------------------------------+
00009   | This source file is subject to version 3.01 of the PHP license,      |
00010   | that is bundled with this package in the file LICENSE, and is        |
00011   | available through the world-wide-web at the following url:           |
00012   | http://www.php.net/license/3_01.txt.                                 |
00013   | If you did not receive a copy of the PHP license and are unable to   |
00014   | obtain it through the world-wide-web, please send a note to          |
00015   | license@php.net so we can mail you a copy immediately.               |
00016   +----------------------------------------------------------------------+
00017   | Authors: Dmitry Stogov <dmitry@zend.com>                             |
00018   |          Gregory Beaver <cellog@php.net>                             |
00019   +----------------------------------------------------------------------+
00020 */
00021 
00022 #ifdef PHP_WIN32
00023 #pragma pack(1)
00024 # define PHAR_TAR_PACK
00025 #elif defined(__sgi)
00026 # define PHAR_TAR_PACK
00027 #elif defined(__GNUC__)
00028 # define PHAR_TAR_PACK __attribute__((__packed__))
00029 #else
00030 # define PHAR_TAR_PACK
00031 #endif
00032 
00033 #if defined(__sgi)
00034 # pragma pack 0
00035 #endif
00036 
00040 typedef struct _old_tar_header {  /* {{{ */
00041        char name[100];     /* name of file;
00042                                 directory is indicated by a trailing slash (/) */
00043        char mode[8];       /* file mode */
00044        char uid[8];        /* owner user ID */
00045        char gid[8];        /* owner group ID */
00046        char size[12];      /* length of file in bytes */
00047        char mtime[12];     /* modify time of file */
00048        char checksum[8];   /* checksum for header */
00049        char link;          /* indicator for links;
00050                                 1 for a linked file,
00051                                 2 for a symbolic link,
00052                                 0 otherwise */
00053        char linkname[100]; /* name of linked file */
00054 } PHAR_TAR_PACK old_tar_header;
00055 /* }}} */
00056 
00057 #if defined(__sgi)
00058 # pragma pack 0
00059 #endif
00060 
00065 typedef struct _tar_header {  /* {{{ */
00066        char name[100];     /* name of file */
00067        char mode[8];       /* file mode   */
00068        char uid[8];        /* owner user ID */
00069        char gid[8];        /* owner group ID */
00070        char size[12];      /* length of file in bytes */
00071        char mtime[12];     /* modify time of file */
00072        char checksum[8];   /* checksum for header */
00073        char typeflag;      /* type of file
00074                                 0 Regular file
00075                                 1 Link to another file already archived
00076                                 2 Symbolic link
00077                                 3 Character special device
00078                                 4 Block special device
00079                                 5 Directory
00080                                 6 FIFO special file
00081                                 7 Reserved */
00082        char linkname[100]; /* name of linked file */
00083        char magic[6];      /* USTAR indicator */
00084        char version[2];    /* USTAR version */
00085        char uname[32];     /* owner user name */
00086        char gname[32];     /* owner group name */
00087        char devmajor[8];   /* device major number */
00088        char devminor[8];   /* device minor number */
00089        char prefix[155];   /* prefix for file name;
00090                               the value of the prefix field, if non-null,
00091                               is prefixed to the name field to allow names
00092                               longer then 100 characters */
00093        char padding[12];   /* unused zeroed bytes */
00094 } PHAR_TAR_PACK tar_header;
00095 /* }}} */
00096 
00097 #ifdef PHP_WIN32
00098 #pragma pack()
00099 #endif
00100 
00101 #endif /* __PHAR_TAR_H */