1 /* Extended cpio header from POSIX.1.
2 Copyright (C) 1992, 2006 Free Software Foundation, Inc.
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)
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.
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. */
25 struct old_cpio_header
27 unsigned short c_magic;
30 unsigned short c_mode;
33 unsigned short c_nlink;
35 unsigned short c_mtimes[2];
36 unsigned short c_namesize;
37 unsigned short c_filesizes[2];
40 struct old_ascii_header
55 /* "New" portable format and CRC format:
57 Each file has a 110 byte header,
58 a variable length, NUL terminated filename,
59 and variable length file data.
60 A header for a filename "TRAILER!!!" indicates the end of the archive. */
62 /* All the fields in the header are ISO 646 (approximately ASCII) strings
63 of hexadecimal numbers, left padded, not NUL terminated: */
65 struct new_ascii_header
67 char c_magic[6]; /* "070701" for "new" portable format
68 "070702" for CRC format */
75 char c_filesize[8]; /* must be 0 for FIFOs and directories */
78 char c_rdev_maj[8]; /* only valid for chr and blk special files */
79 char c_rdev_min[8]; /* only valid for chr and blk special files */
80 char c_namesize[8]; /* count includes terminating NUL in pathname */
81 char c_chksum[8]; /* 0 for "new" portable format; for CRC format
82 the sum of all the bytes in the file */
85 struct cpio_file_stat /* Internal representation of a CPIO header */
87 unsigned short c_magic;
100 unsigned long c_chksum;
102 char *c_tar_linkname;
106 #endif /* cpiohdr.h */