]> glassweightruler.freedombox.rocks Git - Ventoy.git/blob - wimboot/wimboot-2.7.3/src/cpio.h
added Spanish (Latinoamérica) translation (#1865)
[Ventoy.git] / wimboot / wimboot-2.7.3 / src / cpio.h
1 #ifndef _CPIO_H
2 #define _CPIO_H
3
4 /*
5 * Copyright (C) 2012 Michael Brown <mbrown@fensystems.co.uk>.
6 *
7 * This program is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU General Public License as
9 * published by the Free Software Foundation; either version 2 of the
10 * License, or (at your option) any later version.
11 *
12 * This program is distributed in the hope that it will be useful, but
13 * WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
20 * 02110-1301, USA.
21 */
22
23 /**
24 * @file
25 *
26 * CPIO archives
27 *
28 */
29
30 #include <stdint.h>
31
32 /** A CPIO archive header
33 *
34 * All field are hexadecimal ASCII numbers padded with '0' on the
35 * left to the full width of the field.
36 */
37 struct cpio_header {
38 /** The string "070701" or "070702" */
39 char c_magic[6];
40 /** File inode number */
41 char c_ino[8];
42 /** File mode and permissions */
43 char c_mode[8];
44 /** File uid */
45 char c_uid[8];
46 /** File gid */
47 char c_gid[8];
48 /** Number of links */
49 char c_nlink[8];
50 /** Modification time */
51 char c_mtime[8];
52 /** Size of data field */
53 char c_filesize[8];
54 /** Major part of file device number */
55 char c_maj[8];
56 /** Minor part of file device number */
57 char c_min[8];
58 /** Major part of device node reference */
59 char c_rmaj[8];
60 /** Minor part of device node reference */
61 char c_rmin[8];
62 /** Length of filename, including final NUL */
63 char c_namesize[8];
64 /** Checksum of data field if c_magic is 070702, othersize zero */
65 char c_chksum[8];
66 } __attribute__ (( packed ));
67
68 /** CPIO magic */
69 #define CPIO_MAGIC "070701"
70
71 /** CPIO trailer */
72 #define CPIO_TRAILER "TRAILER!!!"
73
74 extern int cpio_extract ( void *data, size_t len,
75 int ( * file ) ( const char *name, void *data,
76 size_t len ) );
77
78 #endif /* _CPIO_H */