libft

A custom C library containing implementations of standard libc functions and additional data structure utilities.

2021-04-01

low-levelOpen GitHub
libft

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

FunctionWhat it does
ft_lstnewCreate a new node
ft_lstadd_front / ft_lstadd_backAdd to start or end
ft_lstsizeCount nodes
ft_lstlastGet the last node
ft_lstdelone / ft_lstclearDelete one node or the whole list
ft_lstiterApply a function to each node
ft_lstmapBuild 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_program

SCREENSHOTS // 01 FRAMES

Screenshot 1
01 / 01