minix/commands/aal/wr_arhdr.c

31 lines
739 B
C
Raw Normal View History

2005-04-21 16:53:53 +02:00
/* $Header$ */
/*
* (c) copyright 1987 by the Vrije Universiteit, Amsterdam, The Netherlands.
* See the copyright notice in the ACK home directory, in the file "Copyright".
*/
#include <arch.h>
#include "object.h"
2010-07-05 01:01:32 +02:00
#include "arch.h"
#include "write.h"
#include "wr_bytes.h"
2005-04-21 16:53:53 +02:00
2010-07-05 01:01:32 +02:00
void wr_arhdr(int fd, struct ar_hdr *arhdr)
2005-04-21 16:53:53 +02:00
{
char buf[AR_TOTAL];
register char *c = buf;
register char *p = arhdr->ar_name;
register int i = 14;
while (i--) {
*c++ = *p++;
}
put2((int)(arhdr->ar_date>>16),c); c += 2;
put2((int)(arhdr->ar_date),c); c += 2;
*c++ = arhdr->ar_uid;
*c++ = arhdr->ar_gid;
put2(arhdr->ar_mode,c); c += 2;
put2((int)(arhdr->ar_size>>16),c); c += 2;
put2((int)(arhdr->ar_size),c);
wr_bytes(fd, buf, (long) AR_TOTAL);
}