31 lines
1.1 KiB
C
31 lines
1.1 KiB
C
/* ************************************************************************** */
|
|
/* */
|
|
/* ::: :::::::: */
|
|
/* mem_compare.c :+: :+: :+: */
|
|
/* +:+ +:+ +:+ */
|
|
/* By: maiboyer <maiboyer@student.42.fr> +#+ +:+ +#+ */
|
|
/* +#+#+#+#+#+ +#+ */
|
|
/* Created: 2023/11/06 11:16:02 by maiboyer #+# #+# */
|
|
/* Updated: 2023/12/09 15:00:58 by maiboyer ### ########.fr */
|
|
/* */
|
|
/* ************************************************************************** */
|
|
|
|
#include "me/mem/mem.h"
|
|
|
|
bool mem_compare(const void *lhs, const void *rhs, t_usize count)
|
|
{
|
|
t_usize i;
|
|
t_u8 *lhs_;
|
|
t_u8 *rhs_;
|
|
|
|
i = 0;
|
|
lhs_ = (t_u8 *)lhs;
|
|
rhs_ = (t_u8 *)rhs;
|
|
while (i < count)
|
|
{
|
|
if (lhs_[i] - rhs_[i])
|
|
return (false);
|
|
i++;
|
|
}
|
|
return (true);
|
|
}
|