aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorCharles <sircharlesaze@gmail.com>2020-04-04 23:36:19 +0200
committerCharles <sircharlesaze@gmail.com>2020-04-04 23:36:19 +0200
commit65cf641e9533b190db870d0cc46f2f852239ebf6 (patch)
treedf2002170b96d189493e54cb484390fb2af2a2d1 /include
parent42316d8393d32bd88fb8e0cba6825185f78dacd0 (diff)
downloadlibft-65cf641e9533b190db870d0cc46f2f852239ebf6.tar.gz
libft-65cf641e9533b190db870d0cc46f2f852239ebf6.tar.bz2
libft-65cf641e9533b190db870d0cc46f2f852239ebf6.zip
Added test for ft_strsjoin, ft_strsjoinf, ft_vecpush_safe, Added doc for algo functions, tested functions
Diffstat (limited to 'include')
-rw-r--r--include/libft_algo.h25
-rw-r--r--include/libft_def.h26
-rw-r--r--include/libft_dstr.h5
-rw-r--r--include/libft_ht.h3
4 files changed, 52 insertions, 7 deletions
diff --git a/include/libft_algo.h b/include/libft_algo.h
index e726d1f..e859de5 100644
--- a/include/libft_algo.h
+++ b/include/libft_algo.h
@@ -6,10 +6,15 @@
/* By: cacharle <marvin@42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2020/01/19 07:22:57 by cacharle #+# #+# */
-/* Updated: 2020/04/04 15:46:10 by charles ### ########.fr */
+/* Updated: 2020/04/04 23:33:51 by charles ### ########.fr */
/* */
/* ************************************************************************** */
+/*
+** \file libft_algo.h
+** \brief Algorithms
+*/
+
#ifndef LIBFT_ALGO_H
# define LIBFT_ALGO_H
@@ -18,12 +23,26 @@
# include "libft_def.h"
# include "libft_str.h"
+/*
+** \brief Range struct
+** \param lo Lower bound
+** \param hi Upper bound
+*/
+
typedef struct
{
int lo;
int hi;
} t_ftrange;
+/*
+** \brief Merge sort consts struct
+** \param base Array to sort
+** \param left Left subarray
+** \param right Right subarray
+** \note Only used internaly by ft_mergesort
+*/
+
struct s_merge_sorted_arrays
{
void *base;
@@ -31,6 +50,10 @@ struct s_merge_sorted_arrays
void *right;
};
+/*
+** remove this horror
+*/
+
typedef struct s_ft_search_const
{
const void *key;
diff --git a/include/libft_def.h b/include/libft_def.h
index 69a7655..7406959 100644
--- a/include/libft_def.h
+++ b/include/libft_def.h
@@ -6,10 +6,15 @@
/* By: cacharle <marvin@42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2020/01/31 10:36:56 by cacharle #+# #+# */
-/* Updated: 2020/04/03 07:04:57 by charles ### ########.fr */
+/* Updated: 2020/04/04 21:40:37 by charles ### ########.fr */
/* */
/* ************************************************************************** */
+/*
+** \file libft_def.h
+** \brief Type and constant definition
+*/
+
#ifndef LIBFT_DEF_H
# define LIBFT_DEF_H
@@ -30,7 +35,22 @@ typedef unsigned int t_ftuint;
typedef long int t_ftlong;
typedef unsigned long int t_ftulong;
-typedef void (*t_ftdel_func)(void*);
-typedef int (*t_ftcompar_func)(const void*, const void*);
+/*
+** \brief Standard delete function
+** \param x Resource to delete
+*/
+
+typedef void (*t_ftdel_func)(void *x);
+
+/*
+** \brief Standard comparison function
+** \param x1 Resource 1
+** \param x2 Resource 2
+** \return negative number if x1 < x2,
+** 0 if x1 == x2,
+** positive number if x1 > x2
+*/
+
+typedef int (*t_ftcompar_func)(const void *x1, const void *x2);
#endif
diff --git a/include/libft_dstr.h b/include/libft_dstr.h
index 11bf2f4..fbe69db 100644
--- a/include/libft_dstr.h
+++ b/include/libft_dstr.h
@@ -6,7 +6,7 @@
/* By: charles <charles.cabergs@gmail.com> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2020/04/03 10:39:51 by charles #+# #+# */
-/* Updated: 2020/04/04 21:18:48 by charles ### ########.fr */
+/* Updated: 2020/04/04 23:33:27 by charles ### ########.fr */
/* */
/* ************************************************************************** */
@@ -37,6 +37,7 @@ void ft_dstrdestroy(t_ftdstr *dstr);
t_ftdstr *ft_dstrgrow(t_ftdstr *dstr, size_t at_least);
char *ft_dstrunwrap(t_ftdstr *dstr);
t_ftdstr *ft_dstrinsert(t_ftdstr *dstr, char *inserted, size_t i);
-// t_ftdstr *ft_dstrsubstitute(t_ftdstr *dstr, char *sub, size_t start, size_t end);
+t_ftdstr *ft_dstrsubstitute(t_ftdstr *dstr, char *sub,
+ size_t start, size_t end);
#endif
diff --git a/include/libft_ht.h b/include/libft_ht.h
index b3c1d2d..c53ee4d 100644
--- a/include/libft_ht.h
+++ b/include/libft_ht.h
@@ -6,7 +6,7 @@
/* By: cacharle <marvin@42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2020/01/31 10:36:09 by cacharle #+# #+# */
-/* Updated: 2020/04/03 07:12:12 by charles ### ########.fr */
+/* Updated: 2020/04/04 22:34:53 by charles ### ########.fr */
/* */
/* ************************************************************************** */
@@ -21,6 +21,7 @@
# include "libft.h"
# include "libft_def.h"
# include "libft_lst.h"
+# include "libft_mem.h"
/*
** \brief Hash table entry, key/value pair