File tree 35 files changed +45
-76
lines changed
35 files changed +45
-76
lines changed Original file line number Diff line number Diff line change 6
6
# By: llord <llord@student.42.fr> +#+ +:+ +#+ #
7
7
# +#+#+#+#+#+ +#+ #
8
8
# 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 #
10
10
# #
11
11
# **************************************************************************** #
12
12
@@ -103,10 +103,10 @@ FTLST = ft_lstadd_back ft_lstadd_front ft_lstclear ft_lstdelone \
103
103
ft_lstiter ft_lstlast ft_lstmap ft_lstnew ft_lstsize
104
104
105
105
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
107
107
108
108
FTPUT_DIR = ft_put/
109
- FTPUT = ft_putbase ft_putnbr ft_putstr
109
+ FTPUT = ft_putbase ft_puterr ft_putnbr ft_putstr
110
110
111
111
FTSTR_DIR = ft_str/
112
112
FTSTR = ft_split ft_strchr ft_strdup ft_striteri ft_strjoin \
Original file line number Diff line number Diff line change 6
6
/* By: llord <llord@student.42.fr> +#+ +:+ +#+ */
7
7
/* +#+#+#+#+#+ +#+ */
8
8
/* 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 */
10
10
/* */
11
11
/* ************************************************************************** */
12
12
13
13
#include "libft.h"
14
14
15
15
//writes a char onto a file
16
-
17
16
void ft_putchar_fd (char c , int fd )
18
17
{
19
18
write (fd , & c , 1 );
Original file line number Diff line number Diff line change 6
6
/* By: llord <llord@student.42.fr> +#+ +:+ +#+ */
7
7
/* +#+#+#+#+#+ +#+ */
8
8
/* 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 */
10
10
/* */
11
11
/* ************************************************************************** */
12
12
13
13
#include "libft.h"
14
14
15
15
//writes a string onto a file and changes line
16
-
17
16
void ft_putendl_fd (char * s , int fd )
18
17
{
19
18
int i ;
Original file line number Diff line number Diff line change 6
6
/* By: llord <llord@student.42.fr> +#+ +:+ +#+ */
7
7
/* +#+#+#+#+#+ +#+ */
8
8
/* 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 */
10
10
/* */
11
11
/* ************************************************************************** */
12
12
@@ -39,7 +39,7 @@ static int lenghtfinder(int number)
39
39
}
40
40
return (lenght );
41
41
}
42
-
42
+ //writes a number onto a file
43
43
void ft_putnbr_fd (int n , int fd )
44
44
{
45
45
int lenght ;
Original file line number Diff line number Diff line change 6
6
/* By: llord <llord@student.42.fr> +#+ +:+ +#+ */
7
7
/* +#+#+#+#+#+ +#+ */
8
8
/* 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 */
10
10
/* */
11
11
/* ************************************************************************** */
12
12
Original file line number Diff line number Diff line change 6
6
/* By: llord <llord@student.42.fr> +#+ +:+ +#+ */
7
7
/* +#+#+#+#+#+ +#+ */
8
8
/* 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 */
10
10
/* */
11
11
/* ************************************************************************** */
12
12
13
13
#include "libft.h"
14
14
15
15
//checks is a char is alphanumeric
16
-
17
16
int ft_isalnum (int c )
18
17
{
19
18
if (('A' <= c && c <= 'Z' )
Original file line number Diff line number Diff line change 6
6
/* By: llord <llord@student.42.fr> +#+ +:+ +#+ */
7
7
/* +#+#+#+#+#+ +#+ */
8
8
/* 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 */
10
10
/* */
11
11
/* ************************************************************************** */
12
12
13
13
#include "libft.h"
14
14
15
15
//checks is a char is alphabetic
16
-
17
16
int ft_isalpha (int c )
18
17
{
19
18
if ('A' <= c && c <= 'Z' )
Original file line number Diff line number Diff line change 6
6
/* By: llord <llord@student.42.fr> +#+ +:+ +#+ */
7
7
/* +#+#+#+#+#+ +#+ */
8
8
/* 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 */
10
10
/* */
11
11
/* ************************************************************************** */
12
12
13
13
#include "libft.h"
14
14
15
15
//checks is a char is in the ascii set
16
-
17
16
int ft_isascii (int c )
18
17
{
19
18
if (0 <= c && c <= 127 )
Original file line number Diff line number Diff line change 6
6
/* By: llord <llord@student.42.fr> +#+ +:+ +#+ */
7
7
/* +#+#+#+#+#+ +#+ */
8
8
/* 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 */
10
10
/* */
11
11
/* ************************************************************************** */
12
12
13
13
#include "libft.h"
14
14
15
15
//checks is a char is numeric
16
-
17
16
int ft_isdigit (int c )
18
17
{
19
18
if ('0' <= c && c <= '9' )
Original file line number Diff line number Diff line change 6
6
/* By: llord <llord@student.42.fr> +#+ +:+ +#+ */
7
7
/* +#+#+#+#+#+ +#+ */
8
8
/* 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 */
10
10
/* */
11
11
/* ************************************************************************** */
12
12
13
13
#include "libft.h"
14
14
15
15
//checks is a char is printable
16
-
17
16
int ft_isprint (int c )
18
17
{
19
18
if (32 <= c && c <= 126 )
Original file line number Diff line number Diff line change 6
6
/* By: llord <llord@student.42.fr> +#+ +:+ +#+ */
7
7
/* +#+#+#+#+#+ +#+ */
8
8
/* 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 */
10
10
/* */
11
11
/* ************************************************************************** */
12
12
13
13
#include "libft.h"
14
14
15
15
//fills a memory location with zeros
16
-
17
16
void * ft_bzero (void * s , size_t n )
18
17
{
19
18
char * ptr ;
Original file line number Diff line number Diff line change 6
6
/* By: llord <llord@student.42.fr> +#+ +:+ +#+ */
7
7
/* +#+#+#+#+#+ +#+ */
8
8
/* 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 */
10
10
/* */
11
11
/* ************************************************************************** */
12
12
13
13
#include "libft.h"
14
14
15
15
//mallocs a memory location and fills it with zeros
16
-
17
16
void * ft_calloc (size_t count , size_t size )
18
17
{
19
18
void * ptr ;
Original file line number Diff line number Diff line change 1
1
/* ************************************************************************** */
2
2
/* */
3
3
/* ::: :::::::: */
4
- /* ft_free_array.c :+: :+: :+: */
4
+ /* ft_free.c :+: :+: :+: */
5
5
/* +:+ +:+ +:+ */
6
6
/* By: llord <llord@student.42.fr> +#+ +:+ +#+ */
7
7
/* +#+#+#+#+#+ +#+ */
8
8
/* 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 */
10
10
/* */
11
11
/* ************************************************************************** */
12
12
13
13
#include "libft.h"
14
14
15
15
//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 )
17
17
{
18
18
free (* ptr );
19
19
* ptr = NULL ;
20
20
}
21
21
22
22
//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 )
24
24
{
25
25
int i ;
26
26
Original file line number Diff line number Diff line change 6
6
/* By: llord <llord@student.42.fr> +#+ +:+ +#+ */
7
7
/* +#+#+#+#+#+ +#+ */
8
8
/* 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 */
10
10
/* */
11
11
/* ************************************************************************** */
12
12
13
13
#include "libft.h"
14
14
15
15
//locates the first instance of a value in a given memory location
16
-
17
16
void * ft_memchr (const void * s , int c , size_t n )
18
17
{
19
18
char * str ;
Original file line number Diff line number Diff line change 6
6
/* By: llord <llord@student.42.fr> +#+ +:+ +#+ */
7
7
/* +#+#+#+#+#+ +#+ */
8
8
/* 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 */
10
10
/* */
11
11
/* ************************************************************************** */
12
12
13
13
#include "libft.h"
14
14
15
15
//compares the first diverging value from two different memory locations
16
-
17
16
int ft_memcmp (const void * s1 , const void * s2 , size_t n )
18
17
{
19
18
unsigned int i ;
Original file line number Diff line number Diff line change 6
6
/* By: llord <llord@student.42.fr> +#+ +:+ +#+ */
7
7
/* +#+#+#+#+#+ +#+ */
8
8
/* 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 */
10
10
/* */
11
11
/* ************************************************************************** */
12
12
13
13
#include "libft.h"
14
14
15
15
//copies a given memory location onto another (unsafe)
16
-
17
16
void * ft_memcpy (void * dst , const void * src , size_t n )
18
17
{
19
18
char * d ;
Original file line number Diff line number Diff line change 6
6
/* By: llord <llord@student.42.fr> +#+ +:+ +#+ */
7
7
/* +#+#+#+#+#+ +#+ */
8
8
/* 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 */
10
10
/* */
11
11
/* ************************************************************************** */
12
12
13
13
#include "libft.h"
14
14
15
15
//copies a given memory location onto another (safe)
16
-
17
16
void * ft_memmove (void * dst , const void * src , size_t len )
18
17
{
19
18
char * d ;
Original file line number Diff line number Diff line change 6
6
/* By: llord <llord@student.42.fr> +#+ +:+ +#+ */
7
7
/* +#+#+#+#+#+ +#+ */
8
8
/* 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 */
10
10
/* */
11
11
/* ************************************************************************** */
12
12
13
13
#include "libft.h"
14
14
15
15
//fills a memory adress with a given char
16
-
17
16
void * ft_memset (void * b , int c , size_t len )
18
17
{
19
18
char * ptr ;
Original file line number Diff line number Diff line change 6
6
/* By: llord <llord@student.42.fr> +#+ +:+ +#+ */
7
7
/* +#+#+#+#+#+ +#+ */
8
8
/* 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 */
10
10
/* */
11
11
/* ************************************************************************** */
12
12
13
13
#include "libft.h"
14
14
15
15
//writes a number in a given base
16
-
17
16
void ft_putbase (unsigned long n , unsigned long base , char * baselist )
18
17
{
19
18
char digit ;
Original file line number Diff line number Diff line change 6
6
/* By: llord <llord@student.42.fr> +#+ +:+ +#+ */
7
7
/* +#+#+#+#+#+ +#+ */
8
8
/* 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 */
10
10
/* */
11
11
/* ************************************************************************** */
12
12
13
13
#include "libft.h"
14
14
15
15
//writes a number onto the terminal
16
-
17
16
static char digitfinder (int number , int position )
18
17
{
19
18
int digit ;
Original file line number Diff line number Diff line change 6
6
/* By: llord <llord@student.42.fr> +#+ +:+ +#+ */
7
7
/* +#+#+#+#+#+ +#+ */
8
8
/* 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 */
10
10
/* */
11
11
/* ************************************************************************** */
12
12
13
13
#include "libft.h"
14
14
15
15
//writes a string onto the terminal
16
-
17
16
void ft_putstr (char * s )
18
17
{
19
18
int i ;
Original file line number Diff line number Diff line change 6
6
/* By: llord <llord@student.42.fr> +#+ +:+ +#+ */
7
7
/* +#+#+#+#+#+ +#+ */
8
8
/* 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 */
10
10
/* */
11
11
/* ************************************************************************** */
12
12
13
13
#include "libft.h"
14
14
15
- //does black magic to split a string into an array of substrings
16
-
17
15
static int word_count (char const * s , char c );
18
16
static int word_lenght (char const * s , char c , int start );
19
17
static int next_word (char const * s , char c , int start );
20
18
static char * fill_word (char const * s , char c , int start );
21
19
20
+ //does black magic to split a string into an array of substrings
22
21
char * * ft_split (char const * s , char c )
23
22
{
24
23
char * * output ;
Original file line number Diff line number Diff line change 6
6
/* By: llord <llord@student.42.fr> +#+ +:+ +#+ */
7
7
/* +#+#+#+#+#+ +#+ */
8
8
/* 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 */
10
10
/* */
11
11
/* ************************************************************************** */
12
12
13
13
#include "libft.h"
14
14
15
15
//finds the first instance of a specified char in a given string
16
-
17
16
char * ft_strchr (const char * s , int c )
18
17
{
19
18
while (* s )
You can’t perform that action at this time.
0 commit comments