ack/modules/src/object/wr_arhdr.c

37 lines
866 B
C
Raw Normal View History

1987-03-10 09:24:02 +00:00
/* $Header$ */
1987-03-09 15:15:03 +00:00
/*
* (c) copyright 1987 by the Vrije Universiteit, Amsterdam, The Netherlands.
* See the copyright notice in the ACK home directory, in the file "Copyright".
*/
1987-01-05 17:31:38 +00:00
#include <arch.h>
#include "object.h"
wr_arhdr(fd, arhdr)
register struct ar_hdr *arhdr;
{
#if WORDS_REVERSED && !BYTES_REVERSED
1987-01-05 17:31:38 +00:00
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++;
}
put2(arhdr->ar_date>>16,c); c += 2;
put2(arhdr->ar_date,c); c += 2;
1987-01-05 17:31:38 +00:00
*c++ = arhdr->ar_uid;
*c++ = arhdr->ar_gid;
put2(arhdr->ar_mode,c); c += 2;
put2(arhdr->ar_size>>16,c); c += 2;
put2(arhdr->ar_size,c);
1987-01-05 17:31:38 +00:00
wr_bytes(fd, buf, (long) AR_TOTAL);
}
#if WORDS_REVERSED && !BYTES_REVERSED
1987-01-05 17:31:38 +00:00
else wr_bytes(fd, (char *) arhdr, (long) AR_TOTAL);
#endif
}