My implementation of some of the Standard C Library functions including some additional ones.
Libft is an individual project at 42 that requires us to re-create some standard C library functions including some additional ones that can be used later to build a library of useful functions for the rest of the program.
Disclaimer: Reinventing the wheel is bad, 42 makes us do this just so we can have a deeper understanding of data structures and basic algorithms. At 42 we're not allowed to use some standard libraries on our projects, so we have to keep growing this library with our own functions as we go farther in the program.
| CTYPE | INPUT_OUTPUT | LIST | MEMORY | STRING |
|---|---|---|---|---|
| ft_isalnum.c | ft_printf.c | ft_lstadd_back.c | ft_bzero.c | ft_atoi.c |
| ft_isalpha.c | ft_putchar.c | ft_lstadd_front.c | ft_calloc.c | ft_atol.c |
| ft_isascii.c | ft_putchar_fd.c | ft_lstclear.c | ft_matrix_free.c | ft_itoa.c |
| ft_isdigit.c | ft_putendl_fd.c | ft_lstdelone.c | ft_matrix_free_h.c | ft_matrix_height.c |
| ft_isprint.c | ft_putnbr.c | ft_lstiter.c | ft_memchr.c | ft_split.c |
| ft_tolower.c | ft_putnbr_fd.c | ft_lstlast.c | ft_memcmp.c | ft_strchr.c |
| ft_toupper.c | ft_putstr.c | ft_lstmap.c | ft_memcpy.c | ft_strdup.c |
| ft_putstr_fd.c | ft_lstnew.c | ft_memmove.c | ft_striteri.c | |
| get_next_line.c | ft_lstsize.c | ft_memset.c | ft_strjoin.c | |
| ft_strlcat.c | ||||
| ft_strlcpy.c | ||||
| ft_strlen.c | ||||
| ft_strmapi.c | ||||
| ft_strncmp.c | ||||
| ft_strnstr.c | ||||
| ft_strrchr.c | ||||
| ft_strrstr.c | ||||
| ft_strstr.c | ||||
| ft_strtrim.c | ||||
| ft_substr.c | ||||
| ft_strcharjoin.c |
Notes:
- Most of the the files and function names are namespaced with an ft in front. It stands for Fourty Two
- I update this list almost every month with new personal functions.
- If you don't know what a function does, refer to the header files in /inc directory.
The goal is to create a library called libft.a from the source files so I can later use that library from other projects at 42.
To create that library you need to run these commands in your terminal:
git clone https://github.com/mahdemir/libft
cd libft
make
You should see a libft.a file and some object files (.o) in a hidden .build/ directory.
Now to clean up (removing the .o files), call make clean
First you need to copy your code in to the root of the libft folder.
You have to tell the compiler where your library resides and which library it is using:
cc prog_name.c -L - -lft
-L takes the path to your library. . (current directory) in this case
-l takes the name of your library. This is the set of characters that come after lib in your library name.
Now just run your executable and enjoy!
That's it! If you're having some problems, just send me a tweet. If you think your problem is due to my code or this README, create a new issue. I'll definitely check it out.
.
βββ Makefile
βββ README.md
βββ inc
βΒ Β βββ ft_printf.h
βΒ Β βββ get_next_line.h
βΒ Β βββ libft.h
βββ src
βββ ctype
βΒ Β βββ ft_isalnum.c
βΒ Β βββ ft_isalpha.c
βΒ Β βββ ft_isascii.c
βΒ Β βββ ft_isdigit.c
βΒ Β βββ ft_isprint.c
βΒ Β βββ ft_tolower.c
βΒ Β βββ ft_toupper.c
βββ input_output
βΒ Β βββ ft_printf
βΒ Β βΒ Β βββ ft_printf.c
βΒ Β βΒ Β βββ ft_printf_utils.c
βΒ Β βββ ft_putchar.c
βΒ Β βββ ft_putchar_fd.c
βΒ Β βββ ft_putendl_fd.c
βΒ Β βββ ft_putnbr.c
βΒ Β βββ ft_putnbr_fd.c
βΒ Β βββ ft_putstr.c
βΒ Β βββ ft_putstr_fd.c
βΒ Β βββ get_next_line
βΒ Β βββ get_next_line.c
βΒ Β βββ get_next_line_utils.c
βββ list
βΒ Β βββ ft_lstadd_back.c
βΒ Β βββ ft_lstadd_front.c
βΒ Β βββ ft_lstclear.c
βΒ Β βββ ft_lstdelone.c
βΒ Β βββ ft_lstiter.c
βΒ Β βββ ft_lstlast.c
βΒ Β βββ ft_lstmap.c
βΒ Β βββ ft_lstnew.c
βΒ Β βββ ft_lstsize.c
βββ memory
βΒ Β βββ ft_bzero.c
βΒ Β βββ ft_calloc.c
βΒ Β βββ ft_matrix_free.c
βΒ Β βββ ft_matrix_free_h.c
βΒ Β βββ ft_memchr.c
βΒ Β βββ ft_memcmp.c
βΒ Β βββ ft_memcpy.c
βΒ Β βββ ft_memmove.c
βΒ Β βββ ft_memset.c
βββ string
βββ ft_atoi.c
βββ ft_atol.c
βββ ft_itoa.c
βββ ft_matrix_height.c
βββ ft_split.c
βββ ft_strcharjoin.c
βββ ft_strchr.c
βββ ft_strdup.c
βββ ft_striteri.c
βββ ft_strjoin.c
βββ ft_strlcat.c
βββ ft_strlcpy.c
βββ ft_strlen.c
βββ ft_strmapi.c
βββ ft_strncmp.c
βββ ft_strnstr.c
βββ ft_strrchr.c
βββ ft_strrstr.c
βββ ft_strstr.c
βββ ft_strtrim.c
βββ ft_substr.c