cpio.h 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  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, write to the Free
  15. Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
  16. 02111-1307 USA. */
  17. #ifndef _CPIO_H
  18. #define _CPIO_H 1
  19. /* A cpio archive consists of a sequence of files.
  20. Each file has a 76 byte header,
  21. a variable length, NUL terminated filename,
  22. and variable length file data.
  23. A header for a filename "TRAILER!!!" indicates the end of the archive. */
  24. /* All the fields in the header are ISO 646 (approximately ASCII) strings
  25. of octal numbers, left padded, not NUL terminated.
  26. Field Name Length in Bytes Notes
  27. c_magic 6 must be "070707"
  28. c_dev 6
  29. c_ino 6
  30. c_mode 6 see below for value
  31. c_uid 6
  32. c_gid 6
  33. c_nlink 6
  34. c_rdev 6 only valid for chr and blk special files
  35. c_mtime 11
  36. c_namesize 6 count includes terminating NUL in pathname
  37. c_filesize 11 must be 0 for FIFOs and directories */
  38. /* Value for the field `c_magic'. */
  39. #define MAGIC "070707"
  40. /* Values for c_mode, OR'd together: */
  41. #define C_IRUSR 000400
  42. #define C_IWUSR 000200
  43. #define C_IXUSR 000100
  44. #define C_IRGRP 000040
  45. #define C_IWGRP 000020
  46. #define C_IXGRP 000010
  47. #define C_IROTH 000004
  48. #define C_IWOTH 000002
  49. #define C_IXOTH 000001
  50. #define C_ISUID 004000
  51. #define C_ISGID 002000
  52. #define C_ISVTX 001000
  53. #define C_ISBLK 060000
  54. #define C_ISCHR 020000
  55. #define C_ISDIR 040000
  56. #define C_ISFIFO 010000
  57. #define C_ISSOCK 0140000
  58. #define C_ISLNK 0120000
  59. #define C_ISCTG 0110000
  60. #define C_ISREG 0100000
  61. #endif /* cpio.h */