minix/commands/aal/wr_ranlib.c

37 lines
791 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 <ranlib.h>
#include "object.h"
2010-07-05 01:01:32 +02:00
#include "wr_bytes.h"
#include "ranlib.h"
2005-04-21 16:53:53 +02:00
2010-07-05 01:01:32 +02:00
void wr_ranlib(int fd, struct ranlib *ran, long cnt)
2005-04-21 16:53:53 +02:00
{
#if ! (BYTES_REVERSED || WORDS_REVERSED)
if (sizeof (struct ranlib) != SZ_RAN)
#endif
{
char buf[100 * SZ_RAN];
while (cnt) {
register int i = (cnt > 100) ? 100 : cnt;
register char *c = buf;
long j = i * SZ_RAN;
cnt -= i;
while (i--) {
put4(ran->ran_off,c); c += 4;
put4(ran->ran_pos,c); c += 4;
ran++;
}
wr_bytes(fd, buf, j);
}
}
#if ! (BYTES_REVERSED || WORDS_REVERSED)
else wr_bytes(fd, (char *) ran, cnt * SZ_RAN);
#endif
}