wr_ranlib.c

Go to the documentation of this file.
00001 /* $Header: /opt/proj/minix/cvsroot/src/commands/aal/wr_ranlib.c,v 1.1.1.1 2005/04/21 14:53:58 beng Exp $ */
00002 /*
00003  * (c) copyright 1987 by the Vrije Universiteit, Amsterdam, The Netherlands.
00004  * See the copyright notice in the ACK home directory, in the file "Copyright".
00005  */
00006 #include <ranlib.h>
00007 #include "object.h"
00008 
00009 wr_ranlib(fd, ran, cnt)
00010         register struct ranlib  *ran;
00011         register long   cnt;
00012 {
00013 #if ! (BYTES_REVERSED || WORDS_REVERSED)
00014         if (sizeof (struct ranlib) != SZ_RAN)
00015 #endif
00016         {
00017                 char buf[100 * SZ_RAN];
00018 
00019                 while (cnt) {
00020                         register int i = (cnt > 100) ? 100 : cnt;
00021                         register char *c = buf;
00022                         long j = i * SZ_RAN;
00023 
00024                         cnt -= i;
00025                         while (i--) {
00026                                 put4(ran->ran_off,c); c += 4;
00027                                 put4(ran->ran_pos,c); c += 4;
00028                                 ran++;
00029                         }
00030                         wr_bytes(fd, buf, j);
00031                 }
00032         }
00033 #if ! (BYTES_REVERSED || WORDS_REVERSED)
00034         else    wr_bytes(fd, (char *) ran, cnt * SZ_RAN);
00035 #endif
00036 }

Generated on Fri Apr 14 22:56:38 2006 for minix by  doxygen 1.4.6