source: trunk/minix/commands/aal/wr_ranlib.c@ 12

Last change on this file since 12 was 9, checked in by Mattia Monga, 14 years ago

Minix 3.1.2a

File size: 853 bytes
RevLine 
[9]1/* $Header: /cvsup/minix/src/commands/aal/wr_ranlib.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 <ranlib.h>
7#include "object.h"
8
9wr_ranlib(fd, ran, cnt)
10 register struct ranlib *ran;
11 register long cnt;
12{
13#if ! (BYTES_REVERSED || WORDS_REVERSED)
14 if (sizeof (struct ranlib) != SZ_RAN)
15#endif
16 {
17 char buf[100 * SZ_RAN];
18
19 while (cnt) {
20 register int i = (cnt > 100) ? 100 : cnt;
21 register char *c = buf;
22 long j = i * SZ_RAN;
23
24 cnt -= i;
25 while (i--) {
26 put4(ran->ran_off,c); c += 4;
27 put4(ran->ran_pos,c); c += 4;
28 ran++;
29 }
30 wr_bytes(fd, buf, j);
31 }
32 }
33#if ! (BYTES_REVERSED || WORDS_REVERSED)
34 else wr_bytes(fd, (char *) ran, cnt * SZ_RAN);
35#endif
36}
Note: See TracBrowser for help on using the repository browser.