00001 /********************************************************************* 00002 * RPC for the Windows NT Operating System 00003 * 1993 by Martin F. Gergeleit 00004 * Users may use, copy or modify Sun RPC for the Windows NT Operating 00005 * System according to the Sun copyright below. 00006 * 00007 * RPC for the Windows NT Operating System COMES WITH ABSOLUTELY NO 00008 * WARRANTY, NOR WILL I BE LIABLE FOR ANY DAMAGES INCURRED FROM THE 00009 * USE OF. USE ENTIRELY AT YOUR OWN RISK!!! 00010 *********************************************************************/ 00011 00012 /* 00013 * bcopy.c -- 00014 * Implements bcopy(2) and bzero(2) byte operations. 00015 * 00016 * Author: 00017 * See-Mong Tan, 6/26/88 00018 */ 00019 00020 #if !defined(UNDER_CE) && !defined(WINDOWS_CE) 00021 #include <stdio.h> 00022 #endif 00023 00024 /* 00025 * bcopy(char *s1, char *s2, int len) -- 00026 * Copies len bytes from s1 to s2 00027 */ 00028 void 00029 bcopy(s1, s2, len) 00030 char *s1, *s2; 00031 int len; 00032 { 00033 for(; len > 0; len--) 00034 *s2++ = *s1++; 00035 } 00036 00037 /* 00038 * bzero(char *s, int len) -- 00039 * Places len zero byes in s 00040 */ 00041 void 00042 bzero(s, len) 00043 char *s; 00044 int len; 00045 { 00046 for(; len > 0; len--) 00047 *s++ = (char) 0; 00048 } 00049 00050 /* 00051 * bcmp() compares byte string b1 against byte string b2, 00052 * returning zero if they are identical, non-zero otherwise. 00053 * Both strings are assumed to be length bytes long. bcmp() of 00054 * length zero bytes always returns zero. 00055 */ 00056 int 00057 bcmp(s1, s2, len) 00058 char *s1, *s2; 00059 int len; 00060 { 00061 for(; len > 0; len--, s1++, s2++) 00062 if (*s1 != *s2) 00063 return 1; 00064 return 0; 00065 }