Initial revision

This commit is contained in:
ceriel
1987-01-05 17:31:38 +00:00
parent eb28fd80f9
commit b63bf2720c
18 changed files with 1193 additions and 0 deletions

View File

@@ -0,0 +1,29 @@
#include <arch.h>
#include "object.h"
wr_arhdr(fd, arhdr)
register struct ar_hdr *arhdr;
{
#if ! (BYTES_REVERSED || WORDS_REVERSED)
if (sizeof (struct ar_hdr) != AR_TOTAL)
#endif
{
char buf[AR_TOTAL];
register char *c = buf;
register char *p = arhdr->ar_name;
register int i = 14;
while (i--) {
*c++ = *p++;
}
put4(arhdr->ar_date,c); c += 4;
*c++ = arhdr->ar_uid;
*c++ = arhdr->ar_gid;
put2(arhdr->ar_mode,c); c += 2;
put4(arhdr->ar_size,c);
wr_bytes(fd, buf, (long) AR_TOTAL);
}
#if ! (BYTES_REVERSED || WORDS_REVERSED)
else wr_bytes(fd, (char *) arhdr, (long) AR_TOTAL);
#endif
}