1 file changed, +82, -80
6cf338fupdates readme
README.md
+82, -80
+82, -80
@@ -1,83 +1,6 @@
1 -*This project has been created as part of the 42 curriculum by mleitao.*
2 -
3 -<h1 id="description">Description</h1>
4 -
5 -**Libft** is a custom C library that consists of reimplementations of standard C library functions along with additional utility functions for string, memory, data and file manipulation, as well as linked list operations.
6 -The library, which is compiled into a static archive (`libft.a`), can be included into other C projects.
7 -
8 -
9 -<details open>
10 - <summary><h3 id="part1">Part I – Libc functions</h3></summary>
11 -
12 - <br/>
13 -
14 - Name | Prototype | Description
15 - --|--|--
16 - [isalpha](./ft_isalpha.c) | `int ft_isalpha(int c);` | checks if `c` is an alphabetic character
17 - [isdigit](./ft_isdigit.c) | `int ft_isdigit(int c);` | checks if `c` is a digit character
18 - [isalnum](./ft_isalnum.c) | `int ft_isalnum(int c);` | checks if `c` is an alphanumeric character
19 - [isascii](./ft_isascii.c) | `int ft_isascii(int c);` | checks if `c` is in ascii table
20 - [isprint](./ft_isprint.c) | `int ft_isprint(int c);` | checks if `c` is a printable character
21 - [strlen](./ft_strlen.c) | `size_t ft_strlen(const char *s);` | gets length of `s`
22 - [memset](./ft_memset.c) | `void *ft_memset(void *s, int c, size_t n);` | fills `s` with `n` bytes `c`
23 - [bzero](./ft_bzero.c) | `void ft_bzero(void *s, size_t n);` | fills `s` with `n` bytes `'\0'`
24 - [memcpy](./ft_memcpy.c) | `void *ft_memcpy(void *dest, const void *src, size_t n);` | copies `n` bytes from non-overlapping memory areas `src` to `dest`
25 - [memmove](./ft_memmove.c) | `void *ft_memmove(void *dest, const void *src, size_t n);` | copies `n` bytes from `src` to a temporary buffer and from that buffer to `dest`
26 - [strlcpy](./ft_strlcpy.c) | `size_t ft_strlcpy(char *dst, const char *src, size_t size);` | copies `size - 1` characters from `src` into `dst`
27 - [strlcat](./ft_strlcat.c) | `size_t ft_strlcat(char *dst, const char *src, size_t size);` | appends `size - strlen(dst) - 1` bytes from `src` to `dst`
28 - [toupper](./ft_toupper.c) | `int ft_toupper(int c);` | converts lowercase letter `c` to its uppercase equivalent
29 - [tolower](./ft_tolower.c) | `int ft_tolower(int c);` | converts uppercase letter `c` to its lowercase equivalent
30 - [strchr](./ft_strchr.c) | `char *ft_strchr(const char *s, int c)` | gets first occurence of `c` in `s`
31 - [strrchr](./ft_strrchr.c) | `char *ft_strrchr(const char *s, int c)` | gets last occurence of `c` in `s`
32 - [strncmp](./ft_strncmp.c) | `int ft_strncmp(const char *s1, const char *s2, size_t n)` | compares the first `n` bytes of `s1` and `s2`
33 - [memchr](./ft_memchr.c) | `void *ft_memchr(const void *s, int c, size_t n)` | scans `n` bytes of `s` for first instance of `c`
34 - [strnstr](./ft_strnstr.c) | `char *ft_strnstr(const char *big, const char *little, size_t len)` | locates `little` in `big` where no more than `len` characters are searched
35 - [atoi](./ft_atoi.c) | `int ft_atoi(const char *nptr)` | converts `nptr` to int
36 - [calloc](./ft_calloc.c) | `void *ft_calloc(size_t nmemb, size_t size);` | allocates `nmemb * size` and initializes it to `0`
37 - [strdup](./ft_strdup.c) | `char *ft_strdup(const char *s);` | duplicates `s` into heap
38 -</details>
39 -
40 -<br/>
1+<h1 id="libft">Libft</h1>
41 2
42 -<details open>
43 - <summary><h3 id="part2">Part II – Additional functions</h3></summary>
44 -
45 - <br/>
46 -
47 - Name | Prototype | Description
48 - --|--|--
49 - [ft_substr](./ft_substr.c) | `char *ft_substr(char const *s, unsigned int start, size_t len);` | gets substring from `s` starting at index `start` and has maximum length `len`
50 - [ft_strjoin](./ft_strjoin.c) | `char *ft_strjoin(char const *s1, char const *s2);` | concatenates `s1` and `s2` into a new string
51 - [ft_strtrim](./ft_strtrim.c) | `char *ft_strtrim(char const *s1, char const *set);` | removes `set` from beginning and end of `s1`
52 - [ft_split](./ft_split.c) | `char **ft_split(char const *s, char c);` | gets array of new strings that result from splitting `s` using `c`
53 - [ft_itoa](./ft_itoa.c) | `char *ft_itoa(int n);` | converts `n` to string
54 - [ft_strmapi](./ft_strmapi.c) | `char *ft_strmapi(char const *s, char (*f)(unsigned int, char));` | gets a new string resulting from the application of `f` in every character of `s`
55 - [ft_striteri](./ft_striteri.c) | `void ft_striteri(char *s, void (*f)(unsigned int, char*));` | applies `f` to every character in `s`
56 - [ft_putchar_fd](./ft_putchar_fd.c) | `void ft_putchar_fd(char c, int fd);` | outputs `c` to file descriptor `fd`
57 - [ft_putstr_fd](./ft_putstr_fd.c) | `void ft_putstr_fd(char *s, int fd);` | outputs `s` to file descriptor `fd`
58 - [ft_putendl_fd](./ft_putendl_fd.c) | `void ft_putendl_fd(char *s, int fd);` | outputs `s` followed by `\n` to `fd`
59 - [ft_putnbr_fd](./ft_putnbr_fd.c) | `void ft_putnbr_fd(int n, int fd);` | outputs `n` into `fd`
60 -</details>
61 -
62 -<br/>
63 -
64 -<details open>
65 - <summary><h3 id="part3">Part III – Linked lists</h3></summary>
66 -
67 - <br/>
68 -
69 - Name | Prototype | Description
70 - --|--|--
71 - [ft_lstnew](./ft_lstnew.c) | `t_list *ft_lstnew(void *content);` | creates new node with content `content` and next `NULL`
72 - [ft_lstadd_front](./ft_lstadd_front.c) | `void ft_lstadd_front(t_list **lst, t_list *new);` | adds node `new` at the beginning of `lst`
73 - [ft_lstsize](./ft_lstsize.c) | `int ft_lstsize(t_list *lst);` | counts number of nodes in `lst`
74 - [ft_lstlast](./ft_lstlast.c) | `t_list *ft_lstlast(t_list *lst);` | gets last node of `lst`
75 - [ft_lstadd_back](./ft_lstadd_back.c) | `void ft_lstadd_back(t_list **lst, t_list *new);` | adds node `new` at the end of `lst`
76 - [ft_lstdelone](./ft_lstdelone.c) | `void ft_lstdelone(t_list *lst, void (*del)(void*));` | frees the node `lst` and its content, latter with `del`
77 - [ft_lstclear](./ft_lstclear.c) | `void ft_lstclear(t_list **lst, void (*del)(void*));` | deletes all the nodes starting at the one pointed to by `lst` and frees their contents
78 - [ft_lstiter](./ft_lstiter.c) | `void ft_lstiter(t_list *lst, void (*f)(void *));` | applies `f` iteractively to the list `lst`
79 - [ft_lstmap](/ft_lstmap.c) | `t_list *ft_lstmap(t_list *lst, void *(*f)(void *),void (*del)(void *));` | gets new list resulting of the application of `f` to list `lst` iteractively
80 -</details>
3+*This project has been created as part of the 42 curriculum by mleitao.*
81 4
82 5 <h1 id="instructions">Instructions</h1>
83 6
@@ -172,7 +95,86 @@ Expected output:
172 95 Hello, libft!
173 96 ```
174 97
175 -<h3 id="resources">Resources</h3>
98+<h1 id="description">Description</h1>
99+
100+**Libft** is a custom C library that consists of reimplementations of standard C library functions along with additional utility functions for string, memory, data and file manipulation, as well as linked list operations.
101+The library, which is compiled into a static archive (`libft.a`), can be included into other C projects.
102+
103+
104+<details open>
105+ <summary><h3 id="part1">Part I – Libc functions</h3></summary>
106+
107+ <br/>
108+
109+ Name | Prototype | Description
110+ --|--|--
111+ [isalpha](./ft_isalpha.c) | `int ft_isalpha(int c);` | checks if `c` is an alphabetic character
112+ [isdigit](./ft_isdigit.c) | `int ft_isdigit(int c);` | checks if `c` is a digit character
113+ [isalnum](./ft_isalnum.c) | `int ft_isalnum(int c);` | checks if `c` is an alphanumeric character
114+ [isascii](./ft_isascii.c) | `int ft_isascii(int c);` | checks if `c` is in ascii table
115+ [isprint](./ft_isprint.c) | `int ft_isprint(int c);` | checks if `c` is a printable character
116+ [strlen](./ft_strlen.c) | `size_t ft_strlen(const char *s);` | gets length of `s`
117+ [memset](./ft_memset.c) | `void *ft_memset(void *s, int c, size_t n);` | fills `s` with `n` bytes `c`
118+ [bzero](./ft_bzero.c) | `void ft_bzero(void *s, size_t n);` | fills `s` with `n` bytes `'\0'`
119+ [memcpy](./ft_memcpy.c) | `void *ft_memcpy(void *dest, const void *src, size_t n);` | copies `n` bytes from non-overlapping memory areas `src` to `dest`
120+ [memmove](./ft_memmove.c) | `void *ft_memmove(void *dest, const void *src, size_t n);` | copies `n` bytes from `src` to a temporary buffer and from that buffer to `dest`
121+ [strlcpy](./ft_strlcpy.c) | `size_t ft_strlcpy(char *dst, const char *src, size_t size);` | copies `size - 1` characters from `src` into `dst`
122+ [strlcat](./ft_strlcat.c) | `size_t ft_strlcat(char *dst, const char *src, size_t size);` | appends `size - strlen(dst) - 1` bytes from `src` to `dst`
123+ [toupper](./ft_toupper.c) | `int ft_toupper(int c);` | converts lowercase letter `c` to its uppercase equivalent
124+ [tolower](./ft_tolower.c) | `int ft_tolower(int c);` | converts uppercase letter `c` to its lowercase equivalent
125+ [strchr](./ft_strchr.c) | `char *ft_strchr(const char *s, int c)` | gets first occurence of `c` in `s`
126+ [strrchr](./ft_strrchr.c) | `char *ft_strrchr(const char *s, int c)` | gets last occurence of `c` in `s`
127+ [strncmp](./ft_strncmp.c) | `int ft_strncmp(const char *s1, const char *s2, size_t n)` | compares the first `n` bytes of `s1` and `s2`
128+ [memchr](./ft_memchr.c) | `void *ft_memchr(const void *s, int c, size_t n)` | scans `n` bytes of `s` for first instance of `c`
129+ [strnstr](./ft_strnstr.c) | `char *ft_strnstr(const char *big, const char *little, size_t len)` | locates `little` in `big` where no more than `len` characters are searched
130+ [atoi](./ft_atoi.c) | `int ft_atoi(const char *nptr)` | converts `nptr` to int
131+ [calloc](./ft_calloc.c) | `void *ft_calloc(size_t nmemb, size_t size);` | allocates `nmemb * size` and initializes it to `0`
132+ [strdup](./ft_strdup.c) | `char *ft_strdup(const char *s);` | duplicates `s` into heap
133+</details>
134+
135+<br/>
136+
137+<details open>
138+ <summary><h3 id="part2">Part II – Additional functions</h3></summary>
139+
140+ <br/>
141+
142+ Name | Prototype | Description
143+ --|--|--
144+ [ft_substr](./ft_substr.c) | `char *ft_substr(char const *s, unsigned int start, size_t len);` | gets substring from `s` starting at index `start` and has maximum length `len`
145+ [ft_strjoin](./ft_strjoin.c) | `char *ft_strjoin(char const *s1, char const *s2);` | concatenates `s1` and `s2` into a new string
146+ [ft_strtrim](./ft_strtrim.c) | `char *ft_strtrim(char const *s1, char const *set);` | removes `set` from beginning and end of `s1`
147+ [ft_split](./ft_split.c) | `char **ft_split(char const *s, char c);` | gets array of new strings that result from splitting `s` using `c`
148+ [ft_itoa](./ft_itoa.c) | `char *ft_itoa(int n);` | converts `n` to string
149+ [ft_strmapi](./ft_strmapi.c) | `char *ft_strmapi(char const *s, char (*f)(unsigned int, char));` | gets a new string resulting from the application of `f` in every character of `s`
150+ [ft_striteri](./ft_striteri.c) | `void ft_striteri(char *s, void (*f)(unsigned int, char*));` | applies `f` to every character in `s`
151+ [ft_putchar_fd](./ft_putchar_fd.c) | `void ft_putchar_fd(char c, int fd);` | outputs `c` to file descriptor `fd`
152+ [ft_putstr_fd](./ft_putstr_fd.c) | `void ft_putstr_fd(char *s, int fd);` | outputs `s` to file descriptor `fd`
153+ [ft_putendl_fd](./ft_putendl_fd.c) | `void ft_putendl_fd(char *s, int fd);` | outputs `s` followed by `\n` to `fd`
154+ [ft_putnbr_fd](./ft_putnbr_fd.c) | `void ft_putnbr_fd(int n, int fd);` | outputs `n` into `fd`
155+</details>
156+
157+<br/>
158+
159+<details open>
160+ <summary><h3 id="part3">Part III – Linked lists</h3></summary>
161+
162+ <br/>
163+
164+ Name | Prototype | Description
165+ --|--|--
166+ [ft_lstnew](./ft_lstnew.c) | `t_list *ft_lstnew(void *content);` | creates new node with content `content` and next `NULL`
167+ [ft_lstadd_front](./ft_lstadd_front.c) | `void ft_lstadd_front(t_list **lst, t_list *new);` | adds node `new` at the beginning of `lst`
168+ [ft_lstsize](./ft_lstsize.c) | `int ft_lstsize(t_list *lst);` | counts number of nodes in `lst`
169+ [ft_lstlast](./ft_lstlast.c) | `t_list *ft_lstlast(t_list *lst);` | gets last node of `lst`
170+ [ft_lstadd_back](./ft_lstadd_back.c) | `void ft_lstadd_back(t_list **lst, t_list *new);` | adds node `new` at the end of `lst`
171+ [ft_lstdelone](./ft_lstdelone.c) | `void ft_lstdelone(t_list *lst, void (*del)(void*));` | frees the node `lst` and its content, latter with `del`
172+ [ft_lstclear](./ft_lstclear.c) | `void ft_lstclear(t_list **lst, void (*del)(void*));` | deletes all the nodes starting at the one pointed to by `lst` and frees their contents
173+ [ft_lstiter](./ft_lstiter.c) | `void ft_lstiter(t_list *lst, void (*f)(void *));` | applies `f` iteractively to the list `lst`
174+ [ft_lstmap](/ft_lstmap.c) | `t_list *ft_lstmap(t_list *lst, void *(*f)(void *),void (*del)(void *));` | gets new list resulting of the application of `f` to list `lst` iteractively
175+</details>
176+
177+<h1 id="resources">Resources</h3>
176178
177179 - `man` pages
178180 - Stack Overflow