Files
RedBear-OS/include/ar.h
T
vasilito daeca3892e Add byteswap/error/libintl/ar/search headers + tsearch family, mempcpy, rawmemchr
Portable ELF tooling (elfutils/libelf, needed by Mesa's radeonsi driver) relies
on several standard headers and functions Red Bear's relibc lacked:

- <byteswap.h>: bswap_16/32/64 (compiler builtins).
- <error.h>: GNU error()/error_at_line() (inline).
- <libintl.h>: gettext family as the identity map (catalog-less system; matches
  glibc's no-catalog fallback behaviour).
- <ar.h>: Unix archive struct/magic (header-only).
- <search.h> + src/header/search: POSIX tsearch/tfind/tdelete/twalk + GNU
  tdestroy, implemented as an unbalanced BST (conforming; POSIX mandates no
  balancing).
- string: mempcpy (memcpy returning end) and rawmemchr (unbounded memchr).

All complete implementations, no stubs. Additive (no ABI break), so existing
sysroot binaries are unaffected.
2026-07-31 15:03:51 +03:00

25 lines
1.0 KiB
C

/* ar.h — Unix archive (ar) file format.
*
* Red Bear OS / relibc. Defines the archive magic strings and per-member header
* layout used by `ar(1)` archives (and consumed by libelf's archive support).
* Header-only: purely a struct and string constants, no runtime symbols.
*/
#ifndef _AR_H
#define _AR_H 1
#define ARMAG "!<arch>\n" /* String that begins an archive file. */
#define SARMAG 8 /* Size of ARMAG string. */
#define ARFMAG "`\n" /* String at the end of each header. */
struct ar_hdr {
char ar_name[16]; /* Member file name, blank/`/`-terminated. */
char ar_date[12]; /* File date, decimal seconds since epoch. */
char ar_uid[6]; /* User id, in ASCII decimal. */
char ar_gid[6]; /* Group id, in ASCII decimal. */
char ar_mode[8]; /* File mode, in ASCII octal. */
char ar_size[10]; /* File size, in ASCII decimal. */
char ar_fmag[2]; /* Always contains ARFMAG. */
};
#endif /* ar.h */