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