tgrekov-pipex
HIVE pipex May 2024
Loading...
Searching...
No Matches
dedupe.c File Reference

/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* dedupe.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: tgrekov <tgrekov@student.hive.fi> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2024/04/22 06:05:01 by tgrekov #+# #+# */
/* Updated: 2024/05/20 12:27:49 by tgrekov ### ########.fr */
/* */
/* ************************************************************************** */

Definition in file dedupe.c.

#include <stdlib.h>
#include <libft.h>
#include "utils.h"
Include dependency graph for dedupe.c:

Go to the source code of this file.

Functions

void ** dedupe (void **arr, int(*compare)(void *, void *), void *(*copy)(void *))
 Create new null-terminated array containing only unique values from arr, checked with compare, and copied with copy.
 

Function Documentation

◆ dedupe()

void ** dedupe ( void **  arr,
int(*)(void *, void *)  compare,
void *(*)(void *)  copy 
)

Create new null-terminated array containing only unique values from arr, checked with compare, and copied with copy.

Parameters
arrArray to deduplicate
compareFunction that compares two void *, returning 0 if they match
copyFunction that creates and returns a duplicate of it's void * argument
Return values
void**New, deduplicated null-terminated array

Definition at line 35 of file dedupe.c.

References arr_cut(), arr_free(), arr_has(), arr_len(), compare(), copy(), err(), and ft_calloc().

Here is the call graph for this function:
Here is the caller graph for this function: