bcmp.c 643 Bytes
Newer Older
Jason Merrill committed
1 2 3 4 5
/* bcmp
   This function is in the public domain.  */

/*

6
@deftypefn Supplemental int bcmp (char *@var{x}, char *@var{y}, int @var{count})
Jason Merrill committed
7

8
Compares the first @var{count} bytes of two areas of memory.  Returns
9 10
zero if they are the same, nonzero otherwise.  Returns zero if
@var{count} is zero.  A nonzero result only indicates a difference,
11 12
it does not indicate any sorting order (say, by having a positive
result mean @var{x} sorts before @var{y}).
Jason Merrill committed
13

14
@end deftypefn
Jason Merrill committed
15 16 17

*/

18 19 20
#include <stddef.h>

extern int memcmp(const void *, const void *, size_t);
Jason Merrill committed
21 22

int
23
bcmp (const void *s1, const void *s2, size_t count)
Jason Merrill committed
24
{
25
  return memcmp (s1, s2, count);
Jason Merrill committed
26 27
}