home *** CD-ROM | disk | FTP | other *** search
/ Geek Gadgets 1 / ADE-1.bin / ade-dist / texinfo-3.7-src.tgz / tar.out / fsf / texinfo / libtxi / bzero.c < prev    next >
Text File  |  1996-09-28  |  1KB  |  45 lines

  1. /*
  2.  * Copyright (C) 1993 Free Software Foundation, Inc.
  3.  *
  4.  * This program is free software; you can redistribute it and/or modify
  5.  * it under the terms of the GNU General Public License as published by
  6.  * the Free Software Foundation; either version 2, or (at your option)
  7.  * any later version.
  8.  *
  9.  * This program is distributed in the hope that it will be useful,
  10.  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  11.  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  12.  * GNU General Public License for more details.
  13.  *
  14.  * You should have received a copy of the GNU General Public License
  15.  * along with this program; if not, you can either send email to this
  16.  * program's author (see below) or write to: The Free Software Foundation,
  17.  * Inc.; 59 Temple Place - Suite 330. Boston, MA 02111-1307, USA.
  18.  */
  19.  
  20. #if !defined (HAVE_MEMSET) && !defined (HAVE_BZERO)
  21.  
  22. void
  23. bzero (b, length)
  24.      register char *b;
  25.      register int length;
  26. {
  27. #ifdef VMS /* but this is definitely VMS-specific */
  28.   short zero = 0;
  29.   long max_str = 65535;
  30.  
  31.   while (length > max_str)
  32.     {
  33.       (void) LIB$MOVC5 (&zero, &zero, &zero, &max_str, b);
  34.       length -= max_str;
  35.       b += max_str;
  36.     }
  37.   (void) LIB$MOVC5 (&zero, &zero, &zero, &length, b);
  38. #else
  39.   while (length-- > 0)
  40.     *b++ = 0;
  41. #endif /* not VMS */
  42. }
  43.  
  44. #endif /* not HAVE_MEMSET && not HAVE_BZERO */
  45.