Skip to content

Commit da20827

Browse files
author
Loic Lord
committed
moved function comments a bit
1 parent 1ba3bf7 commit da20827

35 files changed

+45
-76
lines changed

Makefile

+3-3
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
# By: llord <llord@student.42.fr> +#+ +:+ +#+ #
77
# +#+#+#+#+#+ +#+ #
88
# Created: 2021/09/22 12:48:17 by llord #+# #+# #
9-
# Updated: 2023/03/29 09:57:20 by llord ### ########.fr #
9+
# Updated: 2023/03/30 11:45:30 by llord ### ########.fr #
1010
# #
1111
# **************************************************************************** #
1212

@@ -103,10 +103,10 @@ FTLST = ft_lstadd_back ft_lstadd_front ft_lstclear ft_lstdelone \
103103
ft_lstiter ft_lstlast ft_lstmap ft_lstnew ft_lstsize
104104

105105
FTMEM_DIR = ft_mem/
106-
FTMEM = ft_bzero ft_calloc ft_memchr ft_memcmp ft_memcpy ft_memmove ft_memset
106+
FTMEM = ft_bzero ft_calloc ft_free ft_memchr ft_memcmp ft_memcpy ft_memmove ft_memset
107107

108108
FTPUT_DIR = ft_put/
109-
FTPUT = ft_putbase ft_putnbr ft_putstr
109+
FTPUT = ft_putbase ft_puterr ft_putnbr ft_putstr
110110

111111
FTSTR_DIR = ft_str/
112112
FTSTR = ft_split ft_strchr ft_strdup ft_striteri ft_strjoin \

ft_fd/ft_putchar_fd.c

+1-2
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,13 @@
66
/* By: llord <llord@student.42.fr> +#+ +:+ +#+ */
77
/* +#+#+#+#+#+ +#+ */
88
/* Created: 2022/01/21 11:38:41 by llord #+# #+# */
9-
/* Updated: 2022/04/07 12:12:34 by llord ### ########.fr */
9+
/* Updated: 2023/03/30 11:47:46 by llord ### ########.fr */
1010
/* */
1111
/* ************************************************************************** */
1212

1313
#include "libft.h"
1414

1515
//writes a char onto a file
16-
1716
void ft_putchar_fd(char c, int fd)
1817
{
1918
write(fd, &c, 1);

ft_fd/ft_putendl_fd.c

+1-2
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,13 @@
66
/* By: llord <llord@student.42.fr> +#+ +:+ +#+ */
77
/* +#+#+#+#+#+ +#+ */
88
/* Created: 2022/01/24 21:28:54 by llord #+# #+# */
9-
/* Updated: 2022/04/07 12:12:21 by llord ### ########.fr */
9+
/* Updated: 2023/03/30 11:47:46 by llord ### ########.fr */
1010
/* */
1111
/* ************************************************************************** */
1212

1313
#include "libft.h"
1414

1515
//writes a string onto a file and changes line
16-
1716
void ft_putendl_fd(char *s, int fd)
1817
{
1918
int i;

ft_fd/ft_putnbr_fd.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
/* By: llord <llord@student.42.fr> +#+ +:+ +#+ */
77
/* +#+#+#+#+#+ +#+ */
88
/* Created: 2022/01/24 15:05:48 by llord #+# #+# */
9-
/* Updated: 2022/04/19 14:03:16 by llord ### ########.fr */
9+
/* Updated: 2023/03/30 11:47:42 by llord ### ########.fr */
1010
/* */
1111
/* ************************************************************************** */
1212

@@ -39,7 +39,7 @@ static int lenghtfinder(int number)
3939
}
4040
return (lenght);
4141
}
42-
42+
//writes a number onto a file
4343
void ft_putnbr_fd(int n, int fd)
4444
{
4545
int lenght;

ft_fd/ft_putstr_fd.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
/* By: llord <llord@student.42.fr> +#+ +:+ +#+ */
77
/* +#+#+#+#+#+ +#+ */
88
/* Created: 2022/01/24 21:28:54 by llord #+# #+# */
9-
/* Updated: 2022/04/07 12:12:00 by llord ### ########.fr */
9+
/* Updated: 2023/03/30 11:47:47 by llord ### ########.fr */
1010
/* */
1111
/* ************************************************************************** */
1212

ft_is/ft_isalnum.c

+1-2
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,13 @@
66
/* By: llord <llord@student.42.fr> +#+ +:+ +#+ */
77
/* +#+#+#+#+#+ +#+ */
88
/* Created: 2022/03/28 13:07:44 by llord #+# #+# */
9-
/* Updated: 2022/04/07 15:44:43 by llord ### ########.fr */
9+
/* Updated: 2023/03/30 11:47:26 by llord ### ########.fr */
1010
/* */
1111
/* ************************************************************************** */
1212

1313
#include "libft.h"
1414

1515
//checks is a char is alphanumeric
16-
1716
int ft_isalnum(int c)
1817
{
1918
if (('A' <= c && c <= 'Z')

ft_is/ft_isalpha.c

+1-2
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,13 @@
66
/* By: llord <llord@student.42.fr> +#+ +:+ +#+ */
77
/* +#+#+#+#+#+ +#+ */
88
/* Created: 2022/03/28 13:07:47 by llord #+# #+# */
9-
/* Updated: 2022/04/07 15:44:52 by llord ### ########.fr */
9+
/* Updated: 2023/03/30 11:47:26 by llord ### ########.fr */
1010
/* */
1111
/* ************************************************************************** */
1212

1313
#include "libft.h"
1414

1515
//checks is a char is alphabetic
16-
1716
int ft_isalpha(int c)
1817
{
1918
if ('A' <= c && c <= 'Z')

ft_is/ft_isascii.c

+1-2
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,13 @@
66
/* By: llord <llord@student.42.fr> +#+ +:+ +#+ */
77
/* +#+#+#+#+#+ +#+ */
88
/* Created: 2022/03/28 13:07:56 by llord #+# #+# */
9-
/* Updated: 2022/04/07 15:44:56 by llord ### ########.fr */
9+
/* Updated: 2023/03/30 11:47:26 by llord ### ########.fr */
1010
/* */
1111
/* ************************************************************************** */
1212

1313
#include "libft.h"
1414

1515
//checks is a char is in the ascii set
16-
1716
int ft_isascii(int c)
1817
{
1918
if (0 <= c && c <= 127)

ft_is/ft_isdigit.c

+1-2
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,13 @@
66
/* By: llord <llord@student.42.fr> +#+ +:+ +#+ */
77
/* +#+#+#+#+#+ +#+ */
88
/* Created: 2022/03/28 13:07:53 by llord #+# #+# */
9-
/* Updated: 2022/04/07 15:45:05 by llord ### ########.fr */
9+
/* Updated: 2023/03/30 11:47:25 by llord ### ########.fr */
1010
/* */
1111
/* ************************************************************************** */
1212

1313
#include "libft.h"
1414

1515
//checks is a char is numeric
16-
1716
int ft_isdigit(int c)
1817
{
1918
if ('0' <= c && c <= '9')

ft_is/ft_isprint.c

+1-2
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,13 @@
66
/* By: llord <llord@student.42.fr> +#+ +:+ +#+ */
77
/* +#+#+#+#+#+ +#+ */
88
/* Created: 2022/03/28 13:07:56 by llord #+# #+# */
9-
/* Updated: 2022/04/07 15:45:08 by llord ### ########.fr */
9+
/* Updated: 2023/03/30 11:47:25 by llord ### ########.fr */
1010
/* */
1111
/* ************************************************************************** */
1212

1313
#include "libft.h"
1414

1515
//checks is a char is printable
16-
1716
int ft_isprint(int c)
1817
{
1918
if (32 <= c && c <= 126)

ft_mem/ft_bzero.c

+1-2
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,13 @@
66
/* By: llord <llord@student.42.fr> +#+ +:+ +#+ */
77
/* +#+#+#+#+#+ +#+ */
88
/* Created: 2022/03/30 11:44:13 by llord #+# #+# */
9-
/* Updated: 2022/04/07 12:19:09 by llord ### ########.fr */
9+
/* Updated: 2023/03/30 11:45:05 by llord ### ########.fr */
1010
/* */
1111
/* ************************************************************************** */
1212

1313
#include "libft.h"
1414

1515
//fills a memory location with zeros
16-
1716
void *ft_bzero(void *s, size_t n)
1817
{
1918
char *ptr;

ft_mem/ft_calloc.c

+1-2
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,13 @@
66
/* By: llord <llord@student.42.fr> +#+ +:+ +#+ */
77
/* +#+#+#+#+#+ +#+ */
88
/* Created: 2022/03/28 13:07:47 by llord #+# #+# */
9-
/* Updated: 2022/04/07 15:44:35 by llord ### ########.fr */
9+
/* Updated: 2023/03/30 11:45:05 by llord ### ########.fr */
1010
/* */
1111
/* ************************************************************************** */
1212

1313
#include "libft.h"
1414

1515
//mallocs a memory location and fills it with zeros
16-
1716
void *ft_calloc(size_t count, size_t size)
1817
{
1918
void *ptr;

ft_mem/ft_free_array.c ft_mem/ft_free.c

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,26 @@
11
/* ************************************************************************** */
22
/* */
33
/* ::: :::::::: */
4-
/* ft_free_array.c :+: :+: :+: */
4+
/* ft_free.c :+: :+: :+: */
55
/* +:+ +:+ +:+ */
66
/* By: llord <llord@student.42.fr> +#+ +:+ +#+ */
77
/* +#+#+#+#+#+ +#+ */
88
/* Created: 2023/03/07 15:31:17 by llord #+# #+# */
9-
/* Updated: 2023/03/07 16:45:39 by llord ### ########.fr */
9+
/* Updated: 2023/03/30 11:45:05 by llord ### ########.fr */
1010
/* */
1111
/* ************************************************************************** */
1212

1313
#include "libft.h"
1414

1515
//takes a pointer's adress and frees whatever is there, setting it to NULL after
16-
void free_null(void **ptr)
16+
void ft_free_null(void **ptr)
1717
{
1818
free(*ptr);
1919
*ptr = NULL;
2020
}
2121

2222
//takes a array's adress and frees whatever is there, setting it to NULL after
23-
void free_array(void ***ptr)
23+
void ft_free_array(void ***ptr)
2424
{
2525
int i;
2626

ft_mem/ft_memchr.c

+1-2
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,13 @@
66
/* By: llord <llord@student.42.fr> +#+ +:+ +#+ */
77
/* +#+#+#+#+#+ +#+ */
88
/* Created: 2022/01/31 13:34:38 by llord #+# #+# */
9-
/* Updated: 2022/04/07 12:16:24 by llord ### ########.fr */
9+
/* Updated: 2023/03/30 11:45:05 by llord ### ########.fr */
1010
/* */
1111
/* ************************************************************************** */
1212

1313
#include "libft.h"
1414

1515
//locates the first instance of a value in a given memory location
16-
1716
void *ft_memchr(const void *s, int c, size_t n)
1817
{
1918
char *str;

ft_mem/ft_memcmp.c

+1-2
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,13 @@
66
/* By: llord <llord@student.42.fr> +#+ +:+ +#+ */
77
/* +#+#+#+#+#+ +#+ */
88
/* Created: 2022/01/31 13:35:04 by llord #+# #+# */
9-
/* Updated: 2022/04/07 12:14:33 by llord ### ########.fr */
9+
/* Updated: 2023/03/30 11:45:05 by llord ### ########.fr */
1010
/* */
1111
/* ************************************************************************** */
1212

1313
#include "libft.h"
1414

1515
//compares the first diverging value from two different memory locations
16-
1716
int ft_memcmp(const void *s1, const void *s2, size_t n)
1817
{
1918
unsigned int i;

ft_mem/ft_memcpy.c

+1-2
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,13 @@
66
/* By: llord <llord@student.42.fr> +#+ +:+ +#+ */
77
/* +#+#+#+#+#+ +#+ */
88
/* Created: 2022/03/30 11:44:13 by llord #+# #+# */
9-
/* Updated: 2022/04/07 15:53:09 by llord ### ########.fr */
9+
/* Updated: 2023/03/30 11:45:05 by llord ### ########.fr */
1010
/* */
1111
/* ************************************************************************** */
1212

1313
#include "libft.h"
1414

1515
//copies a given memory location onto another (unsafe)
16-
1716
void *ft_memcpy(void *dst, const void *src, size_t n)
1817
{
1918
char *d;

ft_mem/ft_memmove.c

+1-2
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,13 @@
66
/* By: llord <llord@student.42.fr> +#+ +:+ +#+ */
77
/* +#+#+#+#+#+ +#+ */
88
/* Created: 2022/03/30 11:44:13 by llord #+# #+# */
9-
/* Updated: 2022/04/07 15:53:05 by llord ### ########.fr */
9+
/* Updated: 2023/03/30 11:45:05 by llord ### ########.fr */
1010
/* */
1111
/* ************************************************************************** */
1212

1313
#include "libft.h"
1414

1515
//copies a given memory location onto another (safe)
16-
1716
void *ft_memmove(void *dst, const void *src, size_t len)
1817
{
1918
char *d;

ft_mem/ft_memset.c

+1-2
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,13 @@
66
/* By: llord <llord@student.42.fr> +#+ +:+ +#+ */
77
/* +#+#+#+#+#+ +#+ */
88
/* Created: 2022/03/30 11:44:13 by llord #+# #+# */
9-
/* Updated: 2022/04/07 12:12:52 by llord ### ########.fr */
9+
/* Updated: 2023/03/30 11:45:05 by llord ### ########.fr */
1010
/* */
1111
/* ************************************************************************** */
1212

1313
#include "libft.h"
1414

1515
//fills a memory adress with a given char
16-
1716
void *ft_memset(void *b, int c, size_t len)
1817
{
1918
char *ptr;

ft_put/ft_putbase.c

+1-2
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,13 @@
66
/* By: llord <llord@student.42.fr> +#+ +:+ +#+ */
77
/* +#+#+#+#+#+ +#+ */
88
/* Created: 2022/01/24 15:05:48 by llord #+# #+# */
9-
/* Updated: 2022/04/19 14:17:38 by llord ### ########.fr */
9+
/* Updated: 2023/03/30 11:46:43 by llord ### ########.fr */
1010
/* */
1111
/* ************************************************************************** */
1212

1313
#include "libft.h"
1414

1515
//writes a number in a given base
16-
1716
void ft_putbase(unsigned long n, unsigned long base, char *baselist)
1817
{
1918
char digit;

ft_put/ft_putnbr.c

+1-2
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,13 @@
66
/* By: llord <llord@student.42.fr> +#+ +:+ +#+ */
77
/* +#+#+#+#+#+ +#+ */
88
/* Created: 2022/01/24 15:05:48 by llord #+# #+# */
9-
/* Updated: 2022/04/23 11:21:37 by llord ### ########.fr */
9+
/* Updated: 2023/03/30 11:46:42 by llord ### ########.fr */
1010
/* */
1111
/* ************************************************************************** */
1212

1313
#include "libft.h"
1414

1515
//writes a number onto the terminal
16-
1716
static char digitfinder(int number, int position)
1817
{
1918
int digit;

ft_put/ft_putstr.c

+1-2
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,13 @@
66
/* By: llord <llord@student.42.fr> +#+ +:+ +#+ */
77
/* +#+#+#+#+#+ +#+ */
88
/* Created: 2022/01/24 21:28:54 by llord #+# #+# */
9-
/* Updated: 2022/04/23 11:35:24 by llord ### ########.fr */
9+
/* Updated: 2023/03/30 11:45:39 by llord ### ########.fr */
1010
/* */
1111
/* ************************************************************************** */
1212

1313
#include "libft.h"
1414

1515
//writes a string onto the terminal
16-
1716
void ft_putstr(char *s)
1817
{
1918
int i;

ft_str/ft_split.c

+2-3
Original file line numberDiff line numberDiff line change
@@ -6,19 +6,18 @@
66
/* By: llord <llord@student.42.fr> +#+ +:+ +#+ */
77
/* +#+#+#+#+#+ +#+ */
88
/* Created: 2022/01/31 13:35:19 by llord #+# #+# */
9-
/* Updated: 2022/04/14 15:43:32 by llord ### ########.fr */
9+
/* Updated: 2023/03/30 11:46:47 by llord ### ########.fr */
1010
/* */
1111
/* ************************************************************************** */
1212

1313
#include "libft.h"
1414

15-
//does black magic to split a string into an array of substrings
16-
1715
static int word_count(char const *s, char c);
1816
static int word_lenght(char const *s, char c, int start);
1917
static int next_word(char const *s, char c, int start);
2018
static char *fill_word(char const *s, char c, int start);
2119

20+
//does black magic to split a string into an array of substrings
2221
char **ft_split(char const *s, char c)
2322
{
2423
char **output;

ft_str/ft_strchr.c

+1-2
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,13 @@
66
/* By: llord <llord@student.42.fr> +#+ +:+ +#+ */
77
/* +#+#+#+#+#+ +#+ */
88
/* Created: 2022/01/31 13:34:38 by llord #+# #+# */
9-
/* Updated: 2022/04/07 12:03:06 by llord ### ########.fr */
9+
/* Updated: 2023/03/30 11:46:47 by llord ### ########.fr */
1010
/* */
1111
/* ************************************************************************** */
1212

1313
#include "libft.h"
1414

1515
//finds the first instance of a specified char in a given string
16-
1716
char *ft_strchr(const char *s, int c)
1817
{
1918
while (*s)

0 commit comments

Comments
 (0)