ar.h 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115
  1. /*++
  2. Copyright (c) 2013 Minoca Corp.
  3. This file is licensed under the terms of the GNU Lesser General Public
  4. License version 3. Alternative licensing terms are available. Contact
  5. info@minocacorp.com for details.
  6. Module Name:
  7. ar.h
  8. Abstract:
  9. This header defines the portable archive format.
  10. Author:
  11. Evan Green 2-Aug-2013
  12. --*/
  13. #ifndef _AR_H
  14. #define _AR_H
  15. //
  16. // ------------------------------------------------------------------- Includes
  17. //
  18. //
  19. // ---------------------------------------------------------------- Definitions
  20. //
  21. #ifdef __cplusplus
  22. extern "C" {
  23. #endif
  24. //
  25. // Define the magic string at the beginning of every archive.
  26. //
  27. #define ARMAG "!<arch>\n"
  28. //
  29. // Define the size of the archive magic string.
  30. //
  31. #define SARMAG 8
  32. //
  33. // Define the magic value that goes at the end of each header.
  34. //
  35. #define ARFMAG "`\n"
  36. //
  37. // ------------------------------------------------------ Data Type Definitions
  38. //
  39. /*++
  40. Structure Description:
  41. This structure stores the portable archive file header format.
  42. Members:
  43. ar_name - Stores the name of the file if it fits, terminated with a / and
  44. with blanks beyond that if the file name is shorter. If the file name
  45. does not fit, there are non-standardized values in this field.
  46. ar_date - Stores the ASCII representation of the file date in decimal
  47. seconds since the 1970 epoch.
  48. ar_uid - Stores the ASCII decimal representation of the user ID that owns
  49. the file.
  50. ar_gid - Stores the ASCII decimal representation of the group ID that owns
  51. the file.
  52. ar_mode - Stores the file mode, in ASCII octal.
  53. ar_size - Stores the file size, in ASCII decimal.
  54. ar_fmag - Contains the magic value ARFMAG.
  55. --*/
  56. struct ar_hdr {
  57. char ar_name[16];
  58. char ar_date[12];
  59. char ar_uid[6];
  60. char ar_gid[6];
  61. char ar_mode[8];
  62. char ar_size[10];
  63. char ar_fmag[2];
  64. };
  65. //
  66. // -------------------------------------------------------------------- Globals
  67. //
  68. //
  69. // -------------------------------------------------------- Function Prototypes
  70. //
  71. #ifdef __cplusplus
  72. }
  73. #endif
  74. #endif