tgrekov-pipex
HIVE pipex May 2024
Loading...
Searching...
No Matches
arr_has.c
Go to the documentation of this file.
1/* ************************************************************************** */
2/* */
3/* ::: :::::::: */
4/* arr_has.c :+: :+: :+: */
5/* +:+ +:+ +:+ */
6/* By: tgrekov <tgrekov@student.hive.fi> +#+ +:+ +#+ */
7/* +#+#+#+#+#+ +#+ */
8/* Created: 2024/04/22 06:40:50 by tgrekov #+# #+# */
9/* Updated: 2024/05/06 14:16:47 by tgrekov ### ########.fr */
10/* */
11/* ************************************************************************** */
12
30int arr_has(void **arr, void *content,
31 int (*compare)(void *, void *))
32{
33 int i;
34
35 i = 0;
36 while (arr[i])
37 {
38 if (!compare(content, arr[i++]))
39 return (1);
40 }
41 return (0);
42}
int arr_has(void **arr, void *content, int(*compare)(void *, void *))
Check null-terminated array arr for entry content using comparison function compare.
Definition arr_has.c:30
static int compare(void *a, void *b)
Compare path string a against path string b, which will always have a trailing forward slash.
Definition get_paths.c:31