diff options
Diffstat (limited to 'src/cpiohdr.h')
-rw-r--r-- | src/cpiohdr.h | 84 |
1 files changed, 50 insertions, 34 deletions
diff --git a/src/cpiohdr.h b/src/cpiohdr.h index c3943b464e16..503563f84406 100644 --- a/src/cpiohdr.h +++ b/src/cpiohdr.h @@ -1,5 +1,5 @@ /* Extended cpio header from POSIX.1. - Copyright (C) 1992 Free Software Foundation, Inc. + Copyright (C) 1992, 2006 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -11,9 +11,10 @@ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. - You should have received a copy of the GNU General Public License along - with this program; if not, write to the Free Software Foundation, Inc., - 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + You should have received a copy of the GNU General Public + License along with this program; if not, write to the Free + Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301 USA. */ #ifndef _CPIOHDR_H @@ -34,9 +35,21 @@ struct old_cpio_header unsigned short c_mtimes[2]; unsigned short c_namesize; unsigned short c_filesizes[2]; - unsigned long c_mtime; /* Long-aligned copy of `c_mtimes'. */ - unsigned long c_filesize; /* Long-aligned copy of `c_filesizes'. */ - char *c_name; +}; + +struct old_ascii_header +{ + char c_magic[6]; + char c_dev[6]; + char c_ino[6]; + char c_mode[6]; + char c_uid[6]; + char c_gid[6]; + char c_nlink[6]; + char c_rdev[6]; + char c_mtime[11]; + char c_namesize[6]; + char c_filesize[11]; }; /* "New" portable format and CRC format: @@ -47,44 +60,47 @@ struct old_cpio_header A header for a filename "TRAILER!!!" indicates the end of the archive. */ /* All the fields in the header are ISO 646 (approximately ASCII) strings - of hexadecimal numbers, left padded, not NUL terminated. + of hexadecimal numbers, left padded, not NUL terminated: */ - Field Name Length in Bytes Notes - c_magic 6 "070701" for "new" portable format - "070702" for CRC format - c_ino 8 - c_mode 8 - c_uid 8 - c_gid 8 - c_nlink 8 - c_mtime 8 - c_filesize 8 must be 0 for FIFOs and directories - c_maj 8 - c_min 8 - c_rmaj 8 only valid for chr and blk special files - c_rmin 8 only valid for chr and blk special files - c_namesize 8 count includes terminating NUL in pathname - c_chksum 8 0 for "new" portable format; for CRC format - the sum of all the bytes in the file */ +struct new_ascii_header +{ + char c_magic[6]; /* "070701" for "new" portable format + "070702" for CRC format */ + char c_ino[8]; + char c_mode[8]; + char c_uid[8]; + char c_gid[8]; + char c_nlink[8]; + char c_mtime[8]; + char c_filesize[8]; /* must be 0 for FIFOs and directories */ + char c_dev_maj[8]; + char c_dev_min[8]; + char c_rdev_maj[8]; /* only valid for chr and blk special files */ + char c_rdev_min[8]; /* only valid for chr and blk special files */ + char c_namesize[8]; /* count includes terminating NUL in pathname */ + char c_chksum[8]; /* 0 for "new" portable format; for CRC format + the sum of all the bytes in the file */ +}; -struct new_cpio_header +struct cpio_file_stat /* Internal representation of a CPIO header */ { unsigned short c_magic; - unsigned long c_ino; - unsigned long c_mode; - unsigned long c_uid; - unsigned long c_gid; - unsigned long c_nlink; - unsigned long c_mtime; - unsigned long c_filesize; + ino_t c_ino; + mode_t c_mode; + uid_t c_uid; + gid_t c_gid; + size_t c_nlink; + time_t c_mtime; + off_t c_filesize; long c_dev_maj; long c_dev_min; long c_rdev_maj; long c_rdev_min; - unsigned long c_namesize; + size_t c_namesize; unsigned long c_chksum; char *c_name; char *c_tar_linkname; }; + #endif /* cpiohdr.h */ |