xref: /netbsd-src/external/gpl3/gdb/dist/libiberty/bcmp.c (revision 98b9484c67cdf05a7e01fa6a65d1f4f959a3633e)
1*98b9484cSchristos /* bcmp
2*98b9484cSchristos    This function is in the public domain.  */
3*98b9484cSchristos 
4*98b9484cSchristos /*
5*98b9484cSchristos 
6*98b9484cSchristos @deftypefn Supplemental int bcmp (char *@var{x}, char *@var{y}, int @var{count})
7*98b9484cSchristos 
8*98b9484cSchristos Compares the first @var{count} bytes of two areas of memory.  Returns
9*98b9484cSchristos zero if they are the same, nonzero otherwise.  Returns zero if
10*98b9484cSchristos @var{count} is zero.  A nonzero result only indicates a difference,
11*98b9484cSchristos it does not indicate any sorting order (say, by having a positive
12*98b9484cSchristos result mean @var{x} sorts before @var{y}).
13*98b9484cSchristos 
14*98b9484cSchristos @end deftypefn
15*98b9484cSchristos 
16*98b9484cSchristos */
17*98b9484cSchristos 
18*98b9484cSchristos #include <stddef.h>
19*98b9484cSchristos 
20*98b9484cSchristos extern int memcmp(const void *, const void *, size_t);
21*98b9484cSchristos 
22*98b9484cSchristos int
bcmp(const void * s1,const void * s2,size_t count)23*98b9484cSchristos bcmp (const void *s1, const void *s2, size_t count)
24*98b9484cSchristos {
25*98b9484cSchristos   return memcmp (s1, s2, count);
26*98b9484cSchristos }
27*98b9484cSchristos 
28