Pristine Ack-5.5
[Ack-5.5.git] / modules / src / object / wr_arhdr.c
1 /* $Id: wr_arhdr.c,v 1.8 1994/06/24 11:19:17 ceriel Exp $ */
2 /*
3  * (c) copyright 1987 by the Vrije Universiteit, Amsterdam, The Netherlands.
4  * See the copyright notice in the ACK home directory, in the file "Copyright".
5  */
6 #include "obj.h"
7
8 void
9 wr_arhdr(fd, arhdr)
10         register struct ar_hdr  *arhdr;
11 {
12         char buf[AR_TOTAL];
13         register char *c = buf;
14         register char *p = arhdr->ar_name;
15         register int i = 14;
16
17         while (i--) {
18                 *c++ = *p++;
19         }
20         put2((int)(arhdr->ar_date>>16),c); c += 2;
21         put2((int)(arhdr->ar_date),c); c += 2;
22         *c++ = arhdr->ar_uid;
23         *c++ = arhdr->ar_gid;
24         put2(arhdr->ar_mode,c); c += 2;
25         put2((int)(arhdr->ar_size>>16),c); c += 2;
26         put2((int)(arhdr->ar_size),c);
27         wr_bytes(fd, buf, (long) AR_TOTAL);
28 }