php-internal-docs 8.4.8
Unofficial docs for php/php-src
Loading...
Searching...
No Matches
tar.h
Go to the documentation of this file.
1#ifndef __PHAR_TAR_H
2#define __PHAR_TAR_H
3/*
4 +----------------------------------------------------------------------+
5 | TAR archive support for Phar |
6 +----------------------------------------------------------------------+
7 | Copyright (c) The PHP Group |
8 +----------------------------------------------------------------------+
9 | This source file is subject to version 3.01 of the PHP license, |
10 | that is bundled with this package in the file LICENSE, and is |
11 | available through the world-wide-web at the following url: |
12 | https://www.php.net/license/3_01.txt |
13 | If you did not receive a copy of the PHP license and are unable to |
14 | obtain it through the world-wide-web, please send a note to |
15 | license@php.net so we can mail you a copy immediately. |
16 +----------------------------------------------------------------------+
17 | Authors: Dmitry Stogov <dmitry@php.net> |
18 | Gregory Beaver <cellog@php.net> |
19 +----------------------------------------------------------------------+
20*/
21
22#ifdef PHP_WIN32
23#pragma pack(1)
24# define PHAR_TAR_PACK
25#elif defined(__sgi)
26# define PHAR_TAR_PACK
27#elif defined(__GNUC__)
28# define PHAR_TAR_PACK __attribute__((__packed__))
29#else
30# define PHAR_TAR_PACK
31#endif
32
33#if defined(__sgi)
34# pragma pack 0
35#endif
40typedef struct _old_tar_header { /* {{{ */
41 char name[100]; /* name of file;
42 directory is indicated by a trailing slash (/) */
43 char mode[8]; /* file mode */
44 char uid[8]; /* owner user ID */
45 char gid[8]; /* owner group ID */
46 char size[12]; /* length of file in bytes */
47 char mtime[12]; /* modify time of file */
48 char checksum[8]; /* checksum for header */
49 char link; /* indicator for links;
50 1 for a linked file,
51 2 for a symbolic link,
52 0 otherwise */
53 char linkname[100]; /* name of linked file */
55/* }}} */
56
57#if defined(__sgi)
58# pragma pack 0
59#endif
65typedef struct _tar_header { /* {{{ */
66 char name[100]; /* name of file */
67 char mode[8]; /* file mode */
68 char uid[8]; /* owner user ID */
69 char gid[8]; /* owner group ID */
70 char size[12]; /* length of file in bytes */
71 char mtime[12]; /* modify time of file */
72 char checksum[8]; /* checksum for header */
73 char typeflag; /* type of file
74 0 Regular file
75 1 Link to another file already archived
76 2 Symbolic link
77 3 Character special device
78 4 Block special device
79 5 Directory
80 6 FIFO special file
81 7 Reserved */
82 char linkname[100]; /* name of linked file */
83 char magic[6]; /* USTAR indicator */
84 char version[2]; /* USTAR version */
85 char uname[32]; /* owner user name */
86 char gname[32]; /* owner group name */
87 char devmajor[8]; /* device major number */
88 char devminor[8]; /* device minor number */
89 char prefix[155]; /* prefix for file name;
90 the value of the prefix field, if non-null,
91 is prefixed to the name field to allow names
92 longer then 100 characters */
93 char padding[12]; /* unused zeroed bytes */
95/* }}} */
96
97#ifdef PHP_WIN32
98#pragma pack()
99#endif
100
101#endif /* __PHAR_TAR_H */
struct _tar_header tar_header
struct _old_tar_header old_tar_header
#define PHAR_TAR_PACK
Definition tar.h:30
char link
Definition tar.h:49
char mode[8]
Definition tar.h:43
char mtime[12]
Definition tar.h:47
char name[100]
Definition tar.h:41
char uid[8]
Definition tar.h:44
char gid[8]
Definition tar.h:45
char linkname[100]
Definition tar.h:53
char checksum[8]
Definition tar.h:48
char size[12]
Definition tar.h:46
char mode[8]
Definition tar.h:67
char name[100]
Definition tar.h:66
char uid[8]
Definition tar.h:68
char typeflag
Definition tar.h:73
char linkname[100]
Definition tar.h:82
char devmajor[8]
Definition tar.h:87
char devminor[8]
Definition tar.h:88
char checksum[8]
Definition tar.h:72
char mtime[12]
Definition tar.h:71
char gid[8]
Definition tar.h:69
char prefix[155]
Definition tar.h:89
char version[2]
Definition tar.h:84
char padding[12]
Definition tar.h:93
char size[12]
Definition tar.h:70
char gname[32]
Definition tar.h:86
char uname[32]
Definition tar.h:85
char magic[6]
Definition tar.h:83