This commit is contained in:
Camille Chauvet
2023-01-06 19:37:36 +01:00
parent 975e0c2ef5
commit d7256c47a5
103 changed files with 495 additions and 180 deletions

View File

@ -1,4 +1,4 @@
:# **************************************************************************** #
# **************************************************************************** #
# #
# ::: :::::::: #
# Makefile :+: :+: :+: #
@ -6,13 +6,13 @@
# By: cchauvet <cchauvet@student.42angoulem +#+ +:+ +#+ #
# +#+#+#+#+#+ +#+ #
# Created: 2022/09/27 08:39:27 by cchauvet #+# #+# #
# Updated: 2023/01/05 19:00:54 by cchauvet ### ########.fr #
# Updated: 2023/01/05 20:32:04 by cchauvet ### ########.fr #
# #
# **************************************************************************** #
CC = clang
SRCS = draw.c main.c map.c shape.c xpm.c
SRCS = ft_strchri.c ft_strcmp.c ft_strfjoin.c ft_strmerger.c ft_strndup.c ft_tabrealloc.c ft_is_in.c
OBJS = $(SRCS:.c=.o)

BIN
libftx/extra/extra.a Normal file

Binary file not shown.

View File

@ -6,7 +6,7 @@
/* By: cchauvet <cchauvet@student.42angouleme.fr +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2023/01/04 14:03:10 by cchauvet #+# #+# */
/* Updated: 2023/01/05 18:59:25 by cchauvet ### ########.fr */
/* Updated: 2023/01/05 20:31:50 by cchauvet ### ########.fr */
/* */
/* ************************************************************************** */
@ -18,6 +18,9 @@
char *ft_strfjoin(char *s1, char *s2);
char *ft_strmerger(size_t arg_len, ...);
char **ft_tabrealloc(char **tab, size_t current_size, size_t new_size);
int ft_is_in(char *str, char c);
char **ft_tabrealloc(char **tab, size_t current_size, size_t new_size);
char *ft_strndup(char *src, size_t n);
ssize_t ft_strchri(char *str, char c);
int ft_strcmp(char *s1, char *s2);
#endif

26
libftx/extra/ft_is_in.c Normal file
View File

@ -0,0 +1,26 @@
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_is_in.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: cchauvet <cchauvet@student.42angouleme.fr +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2023/01/05 20:29:53 by cchauvet #+# #+# */
/* Updated: 2023/01/05 20:31:20 by cchauvet ### ########.fr */
/* */
/* ************************************************************************** */
#include "extra.h"
int ft_is_in(char *str, char c)
{
int i;
i = 0;
while (str[i] != '\0')
{
if (str[i] == c)
return (1);
}
return (0);
}

BIN
libftx/extra/ft_is_in.o Normal file

Binary file not shown.

28
libftx/extra/ft_strchri.c Normal file
View File

@ -0,0 +1,28 @@
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_strchri.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: cchauvet <cchauvet@student.42angouleme.fr +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2023/01/05 19:22:58 by cchauvet #+# #+# */
/* Updated: 2023/01/05 19:23:13 by cchauvet ### ########.fr */
/* */
/* ************************************************************************** */
#include "extra.h"
ssize_t ft_strchri(char *str, char c)
{
size_t i;
if (str == NULL)
return (-1);
i = 0;
while (str[i] != c && str[i] != '\0')
i++;
if (str[i] == '\0')
return (-1);
return (i);
}

BIN
libftx/extra/ft_strchri.o Normal file

Binary file not shown.

BIN
libftx/extra/ft_strcmp.o Normal file

Binary file not shown.

View File

@ -6,7 +6,7 @@
/* By: cchauvet <cchauvet@student.42angouleme.fr +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2023/01/04 14:06:04 by cchauvet #+# #+# */
/* Updated: 2023/01/04 14:17:40 by cchauvet ### ########.fr */
/* Updated: 2023/01/05 19:38:35 by cchauvet ### ########.fr */
/* */
/* ************************************************************************** */
@ -14,17 +14,20 @@
char *ft_strfjoin(char *s1, char *s2)
{
size_t i;
size_t y;
ssize_t i;
ssize_t y;
char *out;
out = malloc((ft_strlen(s1) + ft_strlen(s2) + 1) * sizeof(char));
if (out == NULL)
return (NULL);
i = -1;
i = 0;
if (s1 != NULL)
while (s1[++i] != '\0')
while (s1[i] != '\0')
{
out[i] = s1[i];
i++;
}
free(s1);
y = -1;
if (s2 != NULL)

BIN
libftx/extra/ft_strfjoin.o Normal file

Binary file not shown.

BIN
libftx/extra/ft_strmerger.o Normal file

Binary file not shown.

View File

@ -1,64 +1,16 @@
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* get_next_line_utils.c :+: :+: :+: */
/* ft_strndup.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: cchauvet <cchauvet@student.42angoulem +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2022/10/26 00:55:44 by cchauvet #+# #+# */
/* Updated: 2023/01/05 13:06:37 by cchauvet ### ########.fr */
/* Updated: 2023/01/05 19:27:03 by cchauvet ### ########.fr */
/* */
/* ************************************************************************** */
#include "get_next_line.h"
void *ft_calloc(size_t nmemb, size_t size)
{
char *tab;
size_t i;
if (nmemb == 0 || size * nmemb / nmemb != size)
return (NULL);
tab = malloc(nmemb * size);
if (tab == NULL)
return (NULL);
i = 0;
while (i < size * nmemb)
{
tab[i] = 0;
i++;
}
return ((void *) tab);
}
char *ft_strfjoin(char *s1, char *s2)
{
ssize_t i;
ssize_t j;
char *out;
out = ft_calloc((ft_strlen(s1) + ft_strlen(s2) + 1), sizeof(char));
if (out == NULL)
return (NULL);
i = 0;
if (s1 != NULL)
{
while (s1[i] != '\0')
{
out[i] = s1[i];
i++;
}
}
free(s1);
j = -1;
if (s2 != NULL)
{
while (s2[++j] != '\0')
out[i + j] = s2[j];
}
free(s2);
return (out);
}
#include "extra.h"
char *ft_strndup(char *src, size_t n)
{
@ -78,17 +30,3 @@ char *ft_strndup(char *src, size_t n)
}
return (out);
}
ssize_t ft_strchri(char *str, char c)
{
size_t i;
if (str == NULL)
return (-1);
i = 0;
while (str[i] != c && str[i] != '\0')
i++;
if (str[i] == '\0')
return (-1);
return (i);
}

BIN
libftx/extra/ft_strndup.o Normal file

Binary file not shown.

Binary file not shown.

View File

@ -6,11 +6,11 @@
# By: cchauvet <cchauvet@student.42angouleme.fr +#+ +:+ +#+ #
# +#+#+#+#+#+ +#+ #
# Created: 2022/12/14 15:49:18 by cchauvet #+# #+# #
# Updated: 2023/01/05 17:44:06 by cchauvet ### ########.fr #
# Updated: 2023/01/05 19:22:40 by cchauvet ### ########.fr #
# #
# **************************************************************************** #
SRCS = get_next_line.c get_next_line_utils.c
SRCS = get_next_line.c
OBJS = ${SRCS:.c=.o}

BIN
libftx/gnl/get_next_line.a Normal file

Binary file not shown.

View File

@ -6,7 +6,7 @@
/* By: cchauvet <cchauvet@student.42angouleme.fr +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2022/11/14 15:38:06 by cchauvet #+# #+# */
/* Updated: 2023/01/05 13:06:19 by cchauvet ### ########.fr */
/* Updated: 2023/01/05 19:27:45 by cchauvet ### ########.fr */
/* */
/* ************************************************************************** */
@ -18,10 +18,6 @@
# define BUFFER_SIZE 42
# endif
# include "../libft/libft.h"
void *ft_calloc(size_t nmemb, size_t size);
void *ft_realloc(void *ptr, size_t size);
char *ft_strfjoin(char *dst, char *src);
char *ft_strndup(char *src, size_t n);
ssize_t ft_strchri(char *str, char c);
# include "../extra/extra.h"
char *get_next_line(int fd);
#endif

BIN
libftx/gnl/get_next_line.o Normal file

Binary file not shown.

Binary file not shown.

BIN
libftx/libft/ft_atoi.o Normal file

Binary file not shown.

BIN
libftx/libft/ft_bzero.o Normal file

Binary file not shown.

BIN
libftx/libft/ft_calloc.o Normal file

Binary file not shown.

BIN
libftx/libft/ft_isalnum.o Normal file

Binary file not shown.

BIN
libftx/libft/ft_isalpha.o Normal file

Binary file not shown.

BIN
libftx/libft/ft_isascii.o Normal file

Binary file not shown.

BIN
libftx/libft/ft_isdigit.o Normal file

Binary file not shown.

BIN
libftx/libft/ft_isprint.o Normal file

Binary file not shown.

BIN
libftx/libft/ft_itoa.o Normal file

Binary file not shown.

BIN
libftx/libft/ft_memchr.o Normal file

Binary file not shown.

BIN
libftx/libft/ft_memcmp.o Normal file

Binary file not shown.

BIN
libftx/libft/ft_memcpy.o Normal file

Binary file not shown.

BIN
libftx/libft/ft_memmove.o Normal file

Binary file not shown.

BIN
libftx/libft/ft_memset.o Normal file

Binary file not shown.

Binary file not shown.

Binary file not shown.

BIN
libftx/libft/ft_putnbr_fd.o Normal file

Binary file not shown.

BIN
libftx/libft/ft_putstr_fd.o Normal file

Binary file not shown.

View File

@ -6,13 +6,13 @@
/* By: cchauvet <cchauvet@student.42angoulem +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2022/10/05 19:04:34 by cchauvet #+# #+# */
/* Updated: 2022/10/28 19:23:45 by cchauvet ### ########.fr */
/* Updated: 2023/01/06 19:33:51 by cchauvet ### ########.fr */
/* */
/* ************************************************************************** */
#include "libft.h"
static void *ft_cancel(char **tab, size_t len)
void *ft_cancel(char **tab, size_t len)
{
size_t i;

BIN
libftx/libft/ft_split.o Normal file

Binary file not shown.

BIN
libftx/libft/ft_strchr.o Normal file

Binary file not shown.

BIN
libftx/libft/ft_strdup.o Normal file

Binary file not shown.

BIN
libftx/libft/ft_striteri.o Normal file

Binary file not shown.

BIN
libftx/libft/ft_strjoin.o Normal file

Binary file not shown.

BIN
libftx/libft/ft_strlcat.o Normal file

Binary file not shown.

BIN
libftx/libft/ft_strlcpy.o Normal file

Binary file not shown.

BIN
libftx/libft/ft_strlen.o Normal file

Binary file not shown.

BIN
libftx/libft/ft_strmapi.o Normal file

Binary file not shown.

BIN
libftx/libft/ft_strncmp.o Normal file

Binary file not shown.

BIN
libftx/libft/ft_strnstr.o Normal file

Binary file not shown.

BIN
libftx/libft/ft_strrchr.o Normal file

Binary file not shown.

BIN
libftx/libft/ft_strtrim.o Normal file

Binary file not shown.

BIN
libftx/libft/ft_substr.o Normal file

Binary file not shown.

BIN
libftx/libft/ft_tolower.o Normal file

Binary file not shown.

BIN
libftx/libft/ft_toupper.o Normal file

Binary file not shown.

BIN
libftx/libft/libft.a Normal file

Binary file not shown.

View File

@ -6,7 +6,7 @@
/* By: cchauvet <cchauvet@student.42angoulem +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2022/09/26 14:47:54 by cchauvet #+# #+# */
/* Updated: 2023/01/05 18:55:10 by cchauvet ### ########.fr */
/* Updated: 2023/01/06 19:34:13 by cchauvet ### ########.fr */
/* */
/* ************************************************************************** */
@ -15,6 +15,7 @@
# include <stdlib.h>
# include <unistd.h>
void *ft_cancel(char **tab, size_t len);
int ft_atoi(const char *nptr);
void ft_bzero(void *s, size_t n);
void *ft_calloc(size_t nmemb, size_t size);

BIN
libftx/libftx.a Normal file

Binary file not shown.

View File

@ -6,7 +6,7 @@
/* By: cchauvet <cchauvet@student.42angoulem +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2022/09/26 14:47:54 by cchauvet #+# #+# */
/* Updated: 2023/01/05 18:59:40 by cchauvet ### ########.fr */
/* Updated: 2023/01/06 19:34:38 by cchauvet ### ########.fr */
/* */
/* ************************************************************************** */
@ -19,11 +19,15 @@
int ft_printf(const char *format, ...);
char *get_next_line(int fd);
int ft_is_in(char *str, char c);
char **ft_tabrealloc(char **tab, size_t current_size, size_t new_size);
char *ft_strfjoin(char *s1, char *s2);
char *ft_strmerger(size_t arg_len, ...);
int ft_strcmp(char *s1, char *s2);
ssize_t ft_strchri(char *str, char c);
char *ft_strndup(char *src, size_t n);
void *ft_cancel(char **tab, size_t len);
int ft_atoi(const char *nptr);
void ft_bzero(void *s, size_t n);
void *ft_calloc(size_t nmemb, size_t size);

BIN
libftx/printf/ft_dprintX.o Normal file

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

BIN
libftx/printf/ft_dprintul.o Normal file

Binary file not shown.

Binary file not shown.

BIN
libftx/printf/ft_dprintx.o Normal file

Binary file not shown.

BIN
libftx/printf/ft_isarg.o Normal file

Binary file not shown.

BIN
libftx/printf/ft_isdigit.o Normal file

Binary file not shown.

BIN
libftx/printf/ft_printf.a Normal file

Binary file not shown.

BIN
libftx/printf/ft_printf.o Normal file

Binary file not shown.

Binary file not shown.

Binary file not shown.

BIN
libftx/printf/ft_skipflag.o Normal file

Binary file not shown.

BIN
libftx/printf/ft_strlen.o Normal file

Binary file not shown.

BIN
libftx/printf/ft_vdprintf.o Normal file

Binary file not shown.