wr_ranlib.c 570 B

12345678910111213141516171819202122232425262728
  1. /* $Id$ */
  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 "obj.h"
  7. void
  8. wr_ranlib(fd, ran, cnt1)
  9. struct ranlib *ran;
  10. long cnt1;
  11. {
  12. #if BYTE_ORDER == 0x0123
  13. if (sizeof (struct ranlib) != SZ_RAN)
  14. #endif
  15. {
  16. register long cnt = cnt1;
  17. register struct ranlib *r = ran;
  18. register char *c = (char *) r;
  19. while (cnt--) {
  20. put4(r->ran_off,c); c += 4;
  21. put4(r->ran_pos,c); c += 4;
  22. r++;
  23. }
  24. }
  25. wr_bytes(fd, (char *) ran, cnt1 * SZ_RAN);
  26. }