merge resolved conflicts
This commit is contained in:
commit
a10ad36cbf
22 changed files with 174 additions and 16 deletions
|
|
@ -6,7 +6,7 @@
|
|||
# By: jhalford <jack@crans.org> +#+ +:+ +#+ #
|
||||
# +#+#+#+#+#+ +#+ #
|
||||
# Created: 2017/02/07 16:09:36 by jhalford #+# #+# #
|
||||
# Updated: 2017/03/06 15:41:48 by wescande ### ########.fr #
|
||||
# Updated: 2017/03/07 14:28:55 by ariard ### ########.fr #
|
||||
# #
|
||||
# **************************************************************************** #
|
||||
|
||||
|
|
@ -38,6 +38,7 @@ btree/btree_del.c\
|
|||
btree/btree_delone.c\
|
||||
btree/btree_insert_data.c\
|
||||
btree/btree_level_count.c\
|
||||
btree/btree_map.c\
|
||||
btree/btree_print.c\
|
||||
btree/btree_search_item.c\
|
||||
char/ft_isalnum.c\
|
||||
|
|
@ -114,6 +115,7 @@ math/ft_lltoa_base.c\
|
|||
math/ft_uilen.c\
|
||||
math/ft_uitoa_base.c\
|
||||
math/ft_ulltoa_base.c\
|
||||
math/id.c\
|
||||
mem/ft_bzero.c\
|
||||
mem/ft_memalloc.c\
|
||||
mem/ft_memccpy.c\
|
||||
|
|
@ -137,6 +139,7 @@ sstr/ft_sstrfree.c\
|
|||
sstr/ft_sstrprint.c\
|
||||
sstr/ft_sstrprint_fd.c\
|
||||
sstr/ft_sstrsort.c\
|
||||
sstr/ft_sstrstr.c\
|
||||
str/ft_atoi.c\
|
||||
str/ft_convert_base.c\
|
||||
str/ft_putaddr_fd.c\
|
||||
|
|
@ -154,6 +157,8 @@ str/ft_strcspn.c\
|
|||
str/ft_strcut.c\
|
||||
str/ft_strdel.c\
|
||||
str/ft_strdup.c\
|
||||
str/ft_strdupchr.c\
|
||||
str/ft_strduptr.c\
|
||||
str/ft_strequ.c\
|
||||
str/ft_strinsert.c\
|
||||
str/ft_stris.c\
|
||||
|
|
@ -162,11 +167,13 @@ str/ft_striteri.c\
|
|||
str/ft_strjoin.c\
|
||||
str/ft_strlcat.c\
|
||||
str/ft_strlen.c\
|
||||
str/ft_strlenchr.c\
|
||||
str/ft_strmap.c\
|
||||
str/ft_strmapi.c\
|
||||
str/ft_strncat.c\
|
||||
str/ft_strncmp.c\
|
||||
str/ft_strncpy.c\
|
||||
str/ft_strchrcpy.c\
|
||||
str/ft_strnequ.c\
|
||||
str/ft_strnew.c\
|
||||
str/ft_strnstr.c\
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@
|
|||
/* By: jhalford <jack@crans.org> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2016/11/16 11:13:15 by jhalford #+# #+# */
|
||||
/* Updated: 2017/03/06 18:19:50 by jhalford ### ########.fr */
|
||||
/* Updated: 2017/03/07 15:27:57 by jhalford ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
|
|
@ -36,6 +36,7 @@ typedef struct s_btree t_btree;
|
|||
typedef struct s_printdata t_printdata;
|
||||
|
||||
t_btree *btree_create_node(void const *item, size_t content_size);
|
||||
t_btree *btree_map(t_btree *root, void *(*f)(void *));
|
||||
void btree_insert_data(
|
||||
t_btree **root,
|
||||
void *item,
|
||||
|
|
|
|||
|
|
@ -1,5 +1,4 @@
|
|||
/* ************************************************************************** */
|
||||
/* */
|
||||
/* ************************************************************************** */ /* */
|
||||
/* ::: :::::::: */
|
||||
/* math.h :+: :+: :+: */
|
||||
/* +:+ +:+ +:+ */
|
||||
|
|
@ -33,5 +32,6 @@ size_t ft_lllen(long long n);
|
|||
size_t ft_lllen_base(long long n, int base);
|
||||
|
||||
int ft_addrcmp(void *a, void *b);
|
||||
void *id(void *data);
|
||||
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@
|
|||
/* By: jhalford <jack@crans.org> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2017/02/18 13:16:25 by jhalford #+# #+# */
|
||||
/* Updated: 2017/02/18 13:16:48 by jhalford ### ########.fr */
|
||||
/* Updated: 2017/03/07 11:35:11 by ariard ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
|
|
@ -21,5 +21,6 @@ char **ft_sstrdup(char **list);
|
|||
void ft_sstrdel(char **sstr, int index);
|
||||
void ft_sstrfree(char **sstr);
|
||||
char *ft_sstrcat(char **sstr, char sep);
|
||||
char *ft_sstrstr(char **sstr, char *find);
|
||||
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@
|
|||
/* By: jhalford <jack@crans.org> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2017/02/18 13:05:53 by jhalford #+# #+# */
|
||||
/* Updated: 2017/03/02 16:54:21 by jhalford ### ########.fr */
|
||||
/* Updated: 2017/03/07 11:36:58 by ariard ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
|
|
@ -22,9 +22,13 @@ int ft_toupper(int c);
|
|||
int ft_tolower(int c);
|
||||
|
||||
size_t ft_strlen(const char *s);
|
||||
size_t ft_strlenchr(const char *s, char c);
|
||||
char *ft_strdup(const char *s1);
|
||||
char *ft_strdupchr(const char *str, char c);
|
||||
char *ft_strduptr(char *str, int (*is)(int c));
|
||||
char *ft_strcpy(char *dst, const char *src);
|
||||
char *ft_strncpy(char *dst, const char *src, size_t len);
|
||||
char *ft_strchrcpy(char *dst, const char *str, char c);
|
||||
char *ft_strcat(char *s1, const char *s2);
|
||||
char *ft_strncat(char *s1, const char *s2, size_t n);
|
||||
size_t ft_strlcat(char *dst, const char *src, size_t size);
|
||||
|
|
|
|||
14
libftasm/src/btree/btree_map.c
Normal file
14
libftasm/src/btree/btree_map.c
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
#include "btree.h"
|
||||
|
||||
t_btree *btree_map(t_btree *root, void *(*f)(void *))
|
||||
{
|
||||
t_btree *new;
|
||||
|
||||
if (!root)
|
||||
return (NULL);
|
||||
new = btree_create_node(root->item, root->content_size);
|
||||
new->item = (*f)(new->item);
|
||||
new->left = btree_map(root->left, f);
|
||||
new->right = btree_map(root->right, f);
|
||||
return (new);
|
||||
}
|
||||
|
|
@ -6,7 +6,7 @@
|
|||
/* By: jhalford <marvin@42.fr> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2016/11/03 14:56:24 by jhalford #+# #+# */
|
||||
/* Updated: 2016/11/03 15:32:00 by jhalford ### ########.fr */
|
||||
/* Updated: 2017/03/07 11:59:16 by ariard ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@
|
|||
/* By: jhalford <marvin@42.fr> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2016/11/03 14:57:10 by jhalford #+# #+# */
|
||||
/* Updated: 2016/11/04 13:11:28 by jhalford ### ########.fr */
|
||||
/* Updated: 2017/03/07 12:08:47 by ariard ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
|
|
|
|||
6
libftasm/src/math/id.c
Normal file
6
libftasm/src/math/id.c
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
#include "libft.h"
|
||||
|
||||
void *id(void *data)
|
||||
{
|
||||
return (data);
|
||||
}
|
||||
|
|
@ -6,7 +6,7 @@
|
|||
/* By: jhalford <marvin@42.fr> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2016/11/03 14:57:25 by jhalford #+# #+# */
|
||||
/* Updated: 2016/12/07 16:23:30 by jhalford ### ########.fr */
|
||||
/* Updated: 2017/03/06 15:41:01 by ariard ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@
|
|||
/* By: jhalford <marvin@42.fr> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2016/11/03 14:57:26 by jhalford #+# #+# */
|
||||
/* Updated: 2016/11/03 15:36:05 by jhalford ### ########.fr */
|
||||
/* Updated: 2017/03/06 15:36:13 by ariard ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@
|
|||
/* By: jhalford <marvin@42.fr> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2016/11/03 14:57:31 by jhalford #+# #+# */
|
||||
/* Updated: 2016/12/07 15:34:47 by jhalford ### ########.fr */
|
||||
/* Updated: 2017/03/06 15:39:36 by ariard ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@
|
|||
/* By: jhalford <marvin@42.fr> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2016/11/03 14:57:36 by jhalford #+# #+# */
|
||||
/* Updated: 2016/11/03 14:57:36 by jhalford ### ########.fr */
|
||||
/* Updated: 2017/03/06 15:39:24 by ariard ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@
|
|||
/* By: jhalford <marvin@42.fr> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2016/11/03 18:03:58 by jhalford #+# #+# */
|
||||
/* Updated: 2017/03/05 15:20:02 by wescande ### ########.fr */
|
||||
/* Updated: 2017/03/07 14:28:29 by ariard ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
|
|
|
|||
32
libftasm/src/sstr/ft_sstrstr.c
Normal file
32
libftasm/src/sstr/ft_sstrstr.c
Normal file
|
|
@ -0,0 +1,32 @@
|
|||
/* ************************************************************************** */
|
||||
/* */
|
||||
/* ::: :::::::: */
|
||||
/* ft_sstrstr.c :+: :+: :+: */
|
||||
/* +:+ +:+ +:+ */
|
||||
/* By: ariard <ariard@student.42.fr> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2017/03/07 11:29:54 by ariard #+# #+# */
|
||||
/* Updated: 2017/03/07 12:44:17 by ariard ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
#include "libft.h"
|
||||
|
||||
char *ft_sstrstr(char **sstr, char *find)
|
||||
{
|
||||
int size;
|
||||
|
||||
if (!sstr)
|
||||
return (NULL);
|
||||
size = ft_strlen(find);
|
||||
while ((*sstr))
|
||||
{
|
||||
DG("size : %d", size);
|
||||
DG("sstr : %s", *sstr);
|
||||
DG("find : %s", find);
|
||||
if (ft_strncmp(*sstr, find, size) == 0)
|
||||
return (*sstr);
|
||||
sstr++;
|
||||
}
|
||||
return (NULL);
|
||||
}
|
||||
21
libftasm/src/str/ft_strchrcpy.c
Normal file
21
libftasm/src/str/ft_strchrcpy.c
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
/* ************************************************************************** */
|
||||
/* */
|
||||
/* ::: :::::::: */
|
||||
/* ft_strchrcpy.c :+: :+: :+: */
|
||||
/* +:+ +:+ +:+ */
|
||||
/* By: ariard <marvin@42.fr> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2016/12/01 15:43:59 by ariard #+# #+# */
|
||||
/* Updated: 2017/03/07 11:08:55 by ariard ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
#include "libft.h"
|
||||
|
||||
char *ft_strchrcpy(char *dst, const char *src, char c)
|
||||
{
|
||||
while (*src && *src != c)
|
||||
*dst++ = *src++;
|
||||
*dst = '\0';
|
||||
return (dst);
|
||||
}
|
||||
|
|
@ -6,7 +6,7 @@
|
|||
/* By: jhalford <jack@crans.org> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2016/12/07 14:25:41 by jhalford #+# #+# */
|
||||
/* Updated: 2017/03/05 15:20:36 by wescande ### ########.fr */
|
||||
/* Updated: 2017/03/07 14:27:58 by ariard ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
|
|
|
|||
23
libftasm/src/str/ft_strdupchr.c
Normal file
23
libftasm/src/str/ft_strdupchr.c
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
/* ************************************************************************** */
|
||||
/* */
|
||||
/* ::: :::::::: */
|
||||
/* ft_strdupchr.c :+: :+: :+: */
|
||||
/* +:+ +:+ +:+ */
|
||||
/* By: ariard <ariard@student.42.fr> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2017/03/07 11:01:15 by ariard #+# #+# */
|
||||
/* Updated: 2017/03/07 11:24:27 by ariard ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
#include "libft.h"
|
||||
|
||||
char *ft_strdupchr(const char *str, char c)
|
||||
{
|
||||
char *new;
|
||||
|
||||
if (!str || !(new = ft_memalloc(sizeof(*new) * (ft_strlenchr(str, c) + 1))))
|
||||
return (NULL);
|
||||
ft_strchrcpy(new, str, c);
|
||||
return (new);
|
||||
}
|
||||
26
libftasm/src/str/ft_strduptr.c
Normal file
26
libftasm/src/str/ft_strduptr.c
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
/* ************************************************************************** */
|
||||
/* */
|
||||
/* ::: :::::::: */
|
||||
/* ft_strduptr.c :+: :+: :+: */
|
||||
/* +:+ +:+ +:+ */
|
||||
/* By: ariard <marvin@42.fr> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2017/01/06 13:37:12 by ariard #+# #+# */
|
||||
/* Updated: 2017/03/07 12:41:20 by ariard ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
#include "libft.h"
|
||||
|
||||
char *ft_strduptr(char *str, int (*is)(int c))
|
||||
{
|
||||
char *new;
|
||||
char *tmp;
|
||||
|
||||
new = ft_memalloc(sizeof(char *) * ft_strlen(str) + 1);
|
||||
tmp = new;
|
||||
while (*str && (is)((int)*str))
|
||||
*new++ = *str++;
|
||||
*new = 0;
|
||||
return (tmp);
|
||||
}
|
||||
|
|
@ -6,7 +6,7 @@
|
|||
/* By: ariard <ariard@student.42.fr> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2017/03/02 15:11:28 by ariard #+# #+# */
|
||||
/* Updated: 2017/03/02 16:54:25 by jhalford ### ########.fr */
|
||||
/* Updated: 2017/03/07 11:44:29 by ariard ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@
|
|||
/* By: jhalford <marvin@42.fr> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2016/11/03 14:58:22 by jhalford #+# #+# */
|
||||
/* Updated: 2017/01/22 17:46:37 by jhalford ### ########.fr */
|
||||
/* Updated: 2017/03/07 11:06:41 by ariard ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
|
|
|
|||
23
libftasm/src/str/ft_strlenchr.c
Normal file
23
libftasm/src/str/ft_strlenchr.c
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
/* ************************************************************************** */
|
||||
/* */
|
||||
/* ::: :::::::: */
|
||||
/* ft_strlenchr.c :+: :+: :+: */
|
||||
/* +:+ +:+ +:+ */
|
||||
/* By: ariard <marvin@42.fr> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2016/12/01 16:10:54 by ariard #+# #+# */
|
||||
/* Updated: 2017/03/07 11:30:02 by ariard ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
#include "libft.h"
|
||||
|
||||
size_t ft_strlenchr(const char *s, char c)
|
||||
{
|
||||
size_t i;
|
||||
|
||||
i = 0;
|
||||
while (*s && *s++ != c)
|
||||
i++;
|
||||
return (i);
|
||||
}
|
||||
Loading…
Reference in a new issue