cpio.h 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  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.
  4. NOTE: The canonical source of this file is maintained with the GNU cpio.
  5. The GNU C Library is free software; you can redistribute it and/or
  6. modify it under the terms of the GNU Lesser General Public
  7. License as published by the Free Software Foundation; either
  8. version 2.1 of the License, or (at your option) any later version.
  9. The GNU C Library 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 GNU
  12. Lesser General Public License for more details.
  13. You should have received a copy of the GNU Lesser General Public
  14. License along with the GNU C Library; if not, see
  15. <http://www.gnu.org/licenses/>. */
  16. #ifndef _CPIO_H
  17. #define _CPIO_H 1
  18. /* A cpio archive consists of a sequence of files.
  19. Each file has a 76 byte header,
  20. a variable length, NUL terminated filename,
  21. and variable length file data.
  22. A header for a filename "TRAILER!!!" indicates the end of the archive. */
  23. /* All the fields in the header are ISO 646 (approximately ASCII) strings
  24. of octal numbers, left padded, not NUL terminated.
  25. Field Name Length in Bytes Notes
  26. c_magic 6 must be "070707"
  27. c_dev 6
  28. c_ino 6
  29. c_mode 6 see below for value
  30. c_uid 6
  31. c_gid 6
  32. c_nlink 6
  33. c_rdev 6 only valid for chr and blk special files
  34. c_mtime 11
  35. c_namesize 6 count includes terminating NUL in pathname
  36. c_filesize 11 must be 0 for FIFOs and directories */
  37. /* Value for the field `c_magic'. */
  38. #define MAGIC "070707"
  39. /* Values for c_mode, OR'd together: */
  40. #define C_IRUSR 000400
  41. #define C_IWUSR 000200
  42. #define C_IXUSR 000100
  43. #define C_IRGRP 000040
  44. #define C_IWGRP 000020
  45. #define C_IXGRP 000010
  46. #define C_IROTH 000004
  47. #define C_IWOTH 000002
  48. #define C_IXOTH 000001
  49. #define C_ISUID 004000
  50. #define C_ISGID 002000
  51. #define C_ISVTX 001000
  52. #define C_ISBLK 060000
  53. #define C_ISCHR 020000
  54. #define C_ISDIR 040000
  55. #define C_ISFIFO 010000
  56. #define C_ISSOCK 0140000
  57. #define C_ISLNK 0120000
  58. #define C_ISCTG 0110000
  59. #define C_ISREG 0100000
  60. #endif /* cpio.h */