Update.
[glibc.git] / posix / cpio.h
blob0364e8af809899abd2af1686564081b78e3e327a
1 /* Extended cpio format from POSIX.1.
2 This file is part of the GNU C Library.
3 Copyright (C) 1992, 1998 Free Software Foundation, Inc.
5 NOTE: The canonical source of this file is maintained with the GNU cpio.
6 Bugs can be reported to bug-glibc@gnu.org.
8 The GNU C Library is free software; you can redistribute it and/or
9 modify it under the terms of the GNU Library General Public License as
10 published by the Free Software Foundation; either version 2 of the
11 License, or (at your option) any later version.
13 The GNU C Library is distributed in the hope that it will be useful,
14 but WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 Library General Public License for more details.
18 You should have received a copy of the GNU Library General Public
19 License along with the GNU C Library; see the file COPYING.LIB. If not,
20 write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
21 Boston, MA 02111-1307, USA. */
23 #ifndef _CPIO_H
24 #define _CPIO_H 1
26 /* A cpio archive consists of a sequence of files.
27 Each file has a 76 byte header,
28 a variable length, NUL terminated filename,
29 and variable length file data.
30 A header for a filename "TRAILER!!!" indicates the end of the archive. */
32 /* All the fields in the header are ISO 646 (approximately ASCII) strings
33 of octal numbers, left padded, not NUL terminated.
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 */
48 /* Value for the field `c_magic'. */
49 #define MAGIC "070707"
51 /* Values for c_mode, OR'd together: */
53 #define C_IRUSR 000400
54 #define C_IWUSR 000200
55 #define C_IXUSR 000100
56 #define C_IRGRP 000040
57 #define C_IWGRP 000020
58 #define C_IXGRP 000010
59 #define C_IROTH 000004
60 #define C_IWOTH 000002
61 #define C_IXOTH 000001
63 #define C_ISUID 004000
64 #define C_ISGID 002000
65 #define C_ISVTX 001000
67 #define C_ISBLK 060000
68 #define C_ISCHR 020000
69 #define C_ISDIR 040000
70 #define C_ISFIFO 010000
71 #define C_ISSOCK 0140000
72 #define C_ISLNK 0120000
73 #define C_ISCTG 0110000
74 #define C_ISREG 0100000
76 #endif /* cpio.h */