Back to index

glibc  2.9
cpio.h
Go to the documentation of this file.
00001 /* Extended cpio format from POSIX.1.
00002    This file is part of the GNU C Library.
00003    Copyright (C) 1992, 1998 Free Software Foundation, Inc.
00004    NOTE: The canonical source of this file is maintained with the GNU cpio.
00005 
00006    The GNU C Library is free software; you can redistribute it and/or
00007    modify it under the terms of the GNU Lesser General Public
00008    License as published by the Free Software Foundation; either
00009    version 2.1 of the License, or (at your option) any later version.
00010 
00011    The GNU C Library is distributed in the hope that it will be useful,
00012    but WITHOUT ANY WARRANTY; without even the implied warranty of
00013    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00014    Lesser General Public License for more details.
00015 
00016    You should have received a copy of the GNU Lesser General Public
00017    License along with the GNU C Library; if not, write to the Free
00018    Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
00019    02111-1307 USA.  */
00020 
00021 #ifndef _CPIO_H
00022 #define _CPIO_H 1
00023 
00024 /* A cpio archive consists of a sequence of files.
00025    Each file has a 76 byte header,
00026    a variable length, NUL terminated filename,
00027    and variable length file data.
00028    A header for a filename "TRAILER!!!" indicates the end of the archive.  */
00029 
00030 /* All the fields in the header are ISO 646 (approximately ASCII) strings
00031    of octal numbers, left padded, not NUL terminated.
00032 
00033    Field Name Length in Bytes      Notes
00034    c_magic    6             must be "070707"
00035    c_dev      6
00036    c_ino      6
00037    c_mode     6             see below for value
00038    c_uid      6
00039    c_gid      6
00040    c_nlink    6
00041    c_rdev     6             only valid for chr and blk special files
00042    c_mtime    11
00043    c_namesize 6             count includes terminating NUL in pathname
00044    c_filesize 11            must be 0 for FIFOs and directories  */
00045 
00046 /* Value for the field `c_magic'.  */
00047 #define MAGIC "070707"
00048 
00049 /* Values for c_mode, OR'd together: */
00050 
00051 #define C_IRUSR             000400
00052 #define C_IWUSR             000200
00053 #define C_IXUSR             000100
00054 #define C_IRGRP             000040
00055 #define C_IWGRP             000020
00056 #define C_IXGRP             000010
00057 #define C_IROTH             000004
00058 #define C_IWOTH             000002
00059 #define C_IXOTH             000001
00060 
00061 #define C_ISUID             004000
00062 #define C_ISGID             002000
00063 #define C_ISVTX             001000
00064 
00065 #define C_ISBLK             060000
00066 #define C_ISCHR             020000
00067 #define C_ISDIR             040000
00068 #define C_ISFIFO     010000
00069 #define C_ISSOCK     0140000
00070 #define C_ISLNK             0120000
00071 #define C_ISCTG             0110000
00072 #define C_ISREG             0100000
00073 
00074 #endif /* cpio.h */