This commit is contained in:
Camille Chauvet
2023-02-14 17:11:39 +01:00
parent 8283472d2e
commit c5467769d9
109 changed files with 199 additions and 94 deletions

BIN
utils/ft_getstr.o Normal file

Binary file not shown.

BIN
utils/ft_is_in_quote.o Normal file

Binary file not shown.

25
utils/ft_printn.c Normal file
View File

@ -0,0 +1,25 @@
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_printn.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: cchauvet <cchauvet@student.42angoulem +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2023/02/14 14:43:00 by cchauvet #+# #+# */
/* Updated: 2023/02/14 14:47:27 by cchauvet ### ########.fr */
/* */
/* ************************************************************************** */
#include "./utils.h"
void ft_printn(const char *str, size_t n)
{
size_t i;
i = 0;
while (i < n && str[i] != '\0')
{
ft_putchar_fd(1, str[i]);
i++;
}
}

BIN
utils/ft_printn.o Normal file

Binary file not shown.

BIN
utils/ft_strnchr.o Normal file

Binary file not shown.

BIN
utils/ft_strncpy.o Normal file

Binary file not shown.

BIN
utils/ft_strreplace.o Normal file

Binary file not shown.

View File

@ -1,12 +1,26 @@
#ifndef FT_UTILS
# define FT_UTILS
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* utils.h :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: cchauvet <cchauvet@student.42angoulem +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2023/02/14 14:46:40 by cchauvet #+# #+# */
/* Updated: 2023/02/14 14:46:41 by cchauvet ### ########.fr */
/* */
/* ************************************************************************** */
#ifndef UTILS_H
# define UTILS_H
# include <stdlib.h>
# include "../libftx/libftx.h"
size_t ft_strncpy(char *dst, const char *src, size_t n);
int ft_is_in_quote(const char *str, size_t n);
char *ft_strreplace(char *str, const char *fill, size_t start, size_t stop);
int ft_is_in_quote(const char *str, size_t n);
char *ft_strreplace(char *str, const char *fill,
size_t start, size_t stop);
ssize_t ft_strnchr(const char *str, char c);
char *ft_getstr(const char *str, size_t n);
void ft_printn(const char *str, size_t n);
#endif