1 /* Extended cpio format from POSIX.1.
2    Copyright (C) 1992, 2005, 2007, 2010, 2014-2015, 2017 Free Software
3    Foundation, Inc.
4 
5    This program is free software; you can redistribute it and/or modify
6    it under the terms of the GNU General Public License as published by
7    the Free Software Foundation; either version 3, or (at your option)
8    any later version.
9 
10    This program is distributed in the hope that it will be useful,
11    but WITHOUT ANY WARRANTY; without even the implied warranty of
12    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13    GNU General Public License for more details.
14 
15    You should have received a copy of the GNU General Public
16    License along with this program; if not, write to the Free
17    Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
18    Boston, MA 02110-1301 USA.  */
19 
20 #ifndef _CPIO_H
21 
22 #define _CPIO_H 1
23 
24 /* A cpio archive consists of a sequence of files.
25    Each file has a 76 byte header,
26    a variable length, NUL terminated filename,
27    and variable length file data.
28    A header for a filename "TRAILER!!!" indicates the end of the archive.  */
29 
30 #define CPIO_TRAILER_NAME "TRAILER!!!"
31 
32 /* All the fields in the header are ISO 646 (approximately ASCII) strings
33    of octal numbers, left padded, not NUL terminated.
34 
35    Field Name	Length in Bytes	Notes
36    c_magic	6		must be "070707"
37    c_dev	6
38    c_ino	6
39    c_mode	6		see below for value
40    c_uid	6
41    c_gid	6
42    c_nlink	6
43    c_rdev	6		only valid for chr and blk special files
44    c_mtime	11
45    c_namesize	6		count includes terminating NUL in pathname
46    c_filesize	11		must be 0 for FIFOs and directories  */
47 
48 /* Values for c_mode, OR'd together: */
49 
50 #define C_IRUSR		000400
51 #define C_IWUSR		000200
52 #define C_IXUSR		000100
53 #define C_IRGRP		000040
54 #define C_IWGRP		000020
55 #define C_IXGRP		000010
56 #define C_IROTH		000004
57 #define C_IWOTH		000002
58 #define C_IXOTH		000001
59 
60 #define C_ISUID		004000
61 #define C_ISGID		002000
62 #define C_ISVTX		001000
63 
64 #define C_ISBLK		060000
65 #define C_ISCHR		020000
66 #define C_ISDIR		040000
67 #define C_ISFIFO	010000
68 #define C_ISSOCK	0140000
69 #define C_ISLNK		0120000
70 #define C_ISCTG		0110000
71 #define C_ISREG		0100000
72 
73 #endif /* cpio.h */
74