Rev | Line | |
---|
[9] | 1 | /* $Header: /cvsup/minix/src/commands/aal/wr_arhdr.c,v 1.1.1.1 2005/04/21 14:53:58 beng 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 <arch.h>
|
---|
| 7 | #include "object.h"
|
---|
| 8 |
|
---|
| 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 | }
|
---|
Note:
See
TracBrowser
for help on using the repository browser.