- This library is the comming together of the two first projects in the 42 School's curriculum: libft and gnl
- Libft is the reimplementation, of many functions of the basic traditional C libraries
- Why Libft?
- What better way of understanding those timeless functions than reverse engineering them?
- We all need libraries in more complex projects.
- Using my own library in later projects built responsibility towards the code I deliver, because if I'm gonna use it, than I have to deal with inconsistencies, bad practices and inefficiencies by constantly refactoring the old and making it useful.
- GNL is a personalized version of the getline function (found in <stdlib.h>)
- Why GNL?
- In many C projects we need to read from files one line at a time, but we are not allowed to use the original getline, so we make our own.
- It's a hardcore introduction to memory allocation where there's ZERO TOLERANCE to leaks.
- Doing it efficiently will affect the efficiency of your latter projects
- I noticed how allocating and freeing on a loop or constantly using "higher" level string manipulation functions can make a program slower
from #include <ctype.h>
- isalpha
- isdigit
- isalnum
- isascii
- isprint
- toupper
- tolower
from #include <string.h>
- strlen
- strdup
- memset
- memcpy
- memmove
- memcmp
- memchr
- strlcpy (libbsd(7))
- strlcat (libbsd(7))
- strncmp
- strchr
- strrchr
- strnstr
from #include <stdlib.h>
- calloc
- atoi
- getline (ft_gnl)
from #include <strings.h>
- bzero
- ft_substr
- ft_strjoin
- ft_strtrim
- ft_split (my own version here is not the same as the required in the curriculum)
- ft_itoa
- ft_strmapi
- ft_striteri
- ft_putchar_fd
- ft_putstr_fd
- ft_putendl_fd
- ft_putnbr_fd
Bonus functions at 42 School, bonus functions are suggestions for extra points but not required to get a pass
- ft_lstnew
- ft_lstadd_back
- ft_lstadd_front
- ft_lstsize
- ft_lstlast
- ft_strrev
- ft_numlen
- ft_abs
- ft_word_counter
- ft_itoa_base
- ft_free_arr
- ft_free_arr_size
- ft_free_t_split
- ft_ishexlow
- ft_ishexup
- ft_memorylen
- ft_numlen
- ft_lst_circular
- ft_lstadd_here
- ft_lstdel_here
- ft_lstcircular_free
- ft_lstgetby_content
- ft_lstgetby_index
- ft_lstpop
- ft_lstprint
- ft_lstshift
I assume most IDEs allow you to view the info in the header file from inside of a ".c" file, like so:
on ft_neovim, SHIFT-K when the cursor is over a function does the magic btw