This project involves creating your own library and re-coding certain functions from the 'C Standard Library' or libc. Libft aims to enhance understanding of the workings of basic functions, their implementation, and how to effectively use them.
The project involves re-coding certain fundamental C functions. The first part covers functions from Libc, while the second part includes functions that are either not present in libc or are part of it but in a different form.
The project should compile the Mandatory and Bonus sections separately. However, in this version, they are unified to make use of the entire library more easily in other projects.
- Makefile will compile your source files. Must have 'all' and 'bonus' rules for Mandatory and Bonus respectively. It must not relink.
- Program compilation must generate libft.a library
After using
make
ormake all
, compiling withmake bonus
must not recompile mandatory files. (disabled)
• isalpha
• isdigit
• isalnum
• isascii
• isprint
• strlen
• memset
• bzero
• memcpy
• memmove
• strlcpy
• strlcat
• toupper
• tolower
• strchr
• strrchr
• strncmp
• memchr
• memcmp
• strnstr
• atoi
• calloc • strdup
• ft_substr • ft_strjoin • ft_strtrim • ft_itoa • ft_strmapi
• ft_putchar_fd • ft_putstr_fd • ft_putendl_fd • ft_putnbr_fd
• ft_split (Malloc & Free) • ft_striteri (No External Function Allowed)
The Bonus Part introduces a new type of data structure known as a Linked List or Lists. All the functions in this part make use of this C struct to operate on this data.
void *content
stores the contentstruct s_list *next
adresses the next node of the list or NULL if the next node is the last one.
• ft_lstnew(Malloc) • ft_lstadd_front • ft_lstsize • ft_lstlast • ft_lstadd_back • ft_lstdelone(Free) • ft_lstclear(Free) • ft_lstiter • ft_lstmap(Malloc & Free)
Compilation is done through makefile rules.
- If you use the make command, the executable file libft.a will appear.
- You can also use the make bonus command, which will generate the libft.a executable file (bonus functions disabled)."
> make
> make bonus (disabled)