Libft is a custom C library that reimplements standard C library functions. This project serves as the foundation for all subsequent projects in the 42 curriculum, providing essential utility functions for string manipulation, memory management, linked list operations, and more.
- String Functions: Complete string manipulation library (strlen, strcpy, strdup, etc.)
- Memory Functions: Memory allocation and manipulation (malloc, memcpy, memset, etc.)
- Character Functions: Character classification and conversion (isalpha, isdigit, tolower, etc.)
- Conversion Functions: String to number conversion (atoi, itoa)
- Linked List Functions: Complete linked list implementation with bonus functions
- File Descriptor Functions: Output functions for different file descriptors
Libft/
├── libft.h # Header file with all function declarations
├── Makefile # Build configuration
├── ft_*.c # Implementation files for each function
└── .git/ # Git repository
- Memory:
ft_memset,ft_memcpy,ft_memmove,ft_memchr,ft_memcmp,ft_bzero,ft_calloc - String:
ft_strlen,ft_strlcpy,ft_strlcat,ft_strchr,ft_strrchr,ft_strnstr,ft_strncmp,ft_strdup - String Manipulation:
ft_substr,ft_strjoin,ft_strtrim,ft_split,ft_strmapi,ft_striteri - Character:
ft_isalpha,ft_isdigit,ft_isalnum,ft_isascii,ft_isprint,ft_toupper,ft_tolower - Conversion:
ft_atoi,ft_itoa - Output:
ft_putchar_fd,ft_putstr_fd,ft_putendl_fd,ft_putnbr_fd
ft_lstnew,ft_lstadd_front,ft_lstsize,ft_lstlastft_lstadd_back,ft_lstdelone,ft_lstclear,ft_lstiter,ft_lstmap
After building, the library creates libft.a which can be linked with other projects:
gcc -o my_program my_program.c -L. -lft- GCC compiler
- Make utility
- Standard C libraries
- All functions follow the 42 coding style (norminette)
- Functions are designed to be memory-safe and handle edge cases
- The library serves as a dependency for many other 42 projects
- Functions are optimized for performance and readability
shmohamm - 42 Abu Dhabi