Program name | libft.a |
Turn in files | Makefile, libft.h, ft_*.c |
Makefile | NAME, all, clean, fclean, re |
External functs | Detailed below |
Description | Write your own library: a collection of functions that will be a useful tool for your cursus. |
- Declaring global variables is forbidden.
- If you need helper functions to split a more complex function, define them as static functions. This way, their scope will be limited to the appropriate file.
- Place all your files at the root of your repository.
- Turning in unused files is forbidden.
- Every .c files must compile with the flags -Wall -Wextra -Werror
- You must use the command ar to create your library. Using the libtool command is forbidden.
- Your libft.a has to be created at the root of your repository.
To begin, you must redo a set of functions from the libc. Your functions will have the same prototypes and implement the same behaviors as the originals. They must comply with the way they are defined in their man. The only difference will be their names. They will begin with the ’ft_’ prefix. For instance, strlen becomes ft_strlen.
You must write your own function implementing the following original ones. They do not require any external functions:
• isalpha• isdigit
• isalnum
• isascii
• isprint
• strlen
• memset
• bzero
• memcpy
• memmove
• strlcpy
• strlcat
• toupper
• tolower
• strchr
• strrchr
• strncmp
• memchr
• memcmp
• strnstr
• atoi
In order to implement the two following functions, you will use malloc():
• calloc
• strdup
In this second part, you must develop a set of functions that are either not in the libc, or that are part of it but in a different form.