home *** CD-ROM | disk | FTP | other *** search
/ The World of Computer Software / World_Of_Computer_Software-02-385-Vol-1of3.iso / s / stex2-18.zip / SeeTeX / libtex / bcopy.c next >
C/C++ Source or Header  |  1990-07-10  |  499b  |  27 lines

  1. #ifndef lint
  2. static char rcsid[] = "$Header: /usr/src/local/tex/local/mctex/lib/RCS/bcopy.c,v 3.1 89/08/22 21:42:07 chris Exp $";
  3. #endif
  4.  
  5. /*
  6.  * Sample bcopy() routine.
  7.  * This should be rewritten to be as fast as possible for your
  8.  * machine.
  9.  */
  10. bcopy(from, to, count)
  11.     register char *from, *to;
  12.     register int count;
  13. {
  14.  
  15.     if (from == to)
  16.         return;
  17.     if (from > to) {
  18.         while (--count >= 0)
  19.             *to++ = *from++;
  20.     } else {
  21.         from += count;
  22.         to += count;
  23.         while (--count >= 0)
  24.             *--to = *--from;
  25.     }
  26. }
  27.