00001 /* memset 00002 This implementation is in the public domain. */ 00003 00004 /* 00005 00006 @deftypefn Supplemental void* memset (void *@var{s}, int @var{c}, size_t @var{count}) 00007 00008 Sets the first @var{count} bytes of @var{s} to the constant byte 00009 @var{c}, returning a pointer to @var{s}. 00010 00011 @end deftypefn 00012 00013 */ 00014 00015 #include <ansidecl.h> 00016 #ifdef __STDC__ 00017 #include <stddef.h> 00018 #else 00019 #define size_t unsigned long 00020 #endif 00021 00022 PTR 00023 DEFUN(memset, (dest, val, len), 00024 PTR dest AND register int val AND register size_t len) 00025 { 00026 register unsigned char *ptr = (unsigned char*)dest; 00027 while (len-- > 0) 00028 *ptr++ = val; 00029 return dest; 00030 }
1.5.6