libft
A custom C library containing implementations of standard libc functions and additional data structure utilities.
2021-04-01

libft
A C library I built from scratch to replace the standard libc functions I wasn't allowed to use in school projects. Ended up using it in basically every subsequent C project. Every function is written by hand with a focus on getting the behavior exactly right.
What's in it
Character checks and conversion
ft_isalpha, ft_isdigit, ft_isalnum, ft_isascii, ft_isprint, ft_toupper, ft_tolower
Memory
ft_memset, ft_bzero, ft_memcpy, ft_memmove, ft_memchr, ft_memcmp, ft_calloc
Strings
ft_strlen, ft_strlcpy, ft_strlcat, ft_strchr, ft_strrchr, ft_strncmp, ft_strnstr, ft_strdup, ft_substr, ft_strjoin, ft_strtrim, ft_split, ft_strmapi, ft_striteri
Conversion
ft_atoi, ft_itoa
File descriptor output
ft_putchar_fd, ft_putstr_fd, ft_putendl_fd, ft_putnbr_fd
Linked list bonus
| Function | What it does |
|---|---|
| ft_lstnew | Create a new node |
| ft_lstadd_front / ft_lstadd_back | Add to start or end |
| ft_lstsize | Count nodes |
| ft_lstlast | Get the last node |
| ft_lstdelone / ft_lstclear | Delete one node or the whole list |
| ft_lstiter | Apply a function to each node |
| ft_lstmap | Build a new list by mapping a function |
Build and use
make # compiles to libft.a
make bonus # includes the linked list functions#include "libft.h"gcc your_file.c libft.a -o your_programSCREENSHOTS // 01 FRAMES
