How imafancydev/42-libft works
Project type and purpose
• This is a C static-library project (“libft”) that re-implements common C standard and utility functions.
• Purpose: to compile multiple self-contained modules into a single archive (libft.a) that client programs can link against.
File structure
• Root files:
• Makefile — build script
• libft.h — public header exposing all function prototypes
• *.c — each implements one function or one linked-list routine
• Categories (inferred by function behavior):
• ctype-style: ft_isalpha, ft_isdigit, etc.
• stdlib-style: ft_atoi, ft_calloc
• memory: ft_memset, ft_memcpy, ft_memmove, ft_bzero, etc.
• string: ft_strlen, ft_strlcpy, ft_strchr, ft_strdup, ft_strlcat, ft_strncmp, ft_strnstr, ft_strrchr
• non-standard utilities: ft_itoa, ft_split, ft_strjoin, ft_substr, ft_strtrim, ft_strmapi, ft_put*
• linked lists (bonus): ft_lstnew, ft_lstadd_front/back, ft_lstdelone, ft_lstclear, ft_lstiter, ft_lstmap, ft_lstsize
README for additional insights
• Describes the library’s purpose, list of functions by category, and usage instructions:
• make → builds libft.a
• link libft.a + example.c → executable
Elements
– Source modules (e.g., rectangles in blue)
– Build artifacts (.o and .a) (e.g., rectangles in orange)
– External actors (client app, compiler) (e.g., ellipses in green)
– from source to object files (compile)
– from object files to archive (package)
– from client to header and archive (link)