ar.h 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. /* -*-comment-start: "//";comment-end:""-*-
  2. * GNU Mes --- Maxwell Equations of Software
  3. * Copyright (C) 1996 Free Software Foundation, Inc.
  4. * Copyright © 2018 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
  5. *
  6. * This file is part of GNU Mes.
  7. *
  8. * GNU Mes is free software; you can redistribute it and/or modify it
  9. * under the terms of the GNU General Public License as published by
  10. * the Free Software Foundation; either version 3 of the License, or (at
  11. * your option) any later version.
  12. *
  13. * GNU Mes is distributed in the hope that it will be useful, but
  14. * WITHOUT ANY WARRANTY; without even the implied warranty of
  15. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  16. * GNU General Public License for more details.
  17. *
  18. * You should have received a copy of the GNU General Public License
  19. * along with GNU Mes. If not, see <http://www.gnu.org/licenses/>.
  20. */
  21. #ifndef __MES_AR_H
  22. #define __MES_AR_H 1
  23. #if SYSTEM_LIBC
  24. #ifndef _GNU_SOURCE
  25. #define _GNU_SOURCE
  26. #endif
  27. #undef __MES_AR_H
  28. #include_next <ar.h>
  29. #else // ! SYSTEM_LIBC
  30. // Taken from GNU C Library 2.2.5
  31. /* Archive files start with the ARMAG identifying string. Then follows a
  32. `struct ar_hdr', and as many bytes of member file data as its `ar_size'
  33. member indicates, for each member file. */
  34. #define ARMAG "!<arch>\n" /* String that begins an archive file. */
  35. #define SARMAG 8 /* Size of that string. */
  36. #define ARFMAG "`\n" /* String in ar_fmag at end of each header. */
  37. struct ar_hdr
  38. {
  39. char ar_name[16]; /* Member file name, sometimes / terminated. */
  40. char ar_date[12]; /* File date, decimal seconds since Epoch. */
  41. char ar_uid[6], ar_gid[6]; /* User and group IDs, in ASCII decimal. */
  42. char ar_mode[8]; /* File mode, in ASCII octal. */
  43. char ar_size[10]; /* File size, in ASCII decimal. */
  44. char ar_fmag[2]; /* Always contains ARFMAG. */
  45. };
  46. #endif // ! SYSTEM_LIBC
  47. #endif // __MES_ARGZ_H