Skip to content

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.

Notifications You must be signed in to change notification settings

josephcheel/42-Libft

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

49 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Libft |  42 Cursus Complete

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.

What is the the project about

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.

Danger

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.

General Instrucctions

  • 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
Warning

After using make or make all, compiling with make bonus must not recompile mandatory files. (disabled)

Mandatory Instrucctions

Part I  |  Libc functions

No External functions required

• isalpha • isdigit • isalnum • isascii • isprint • strlen • memset • bzero • memcpy • memmove • strlcpy • strlcat
• toupper • tolower • strchr • strrchr • strncmp • memchr • memcmp • strnstr • atoi

Malloc Function Allowed

• calloc • strdup

Part II  |  Additional functions

Malloc Function Allowed

• ft_substr • ft_strjoin • ft_strtrim • ft_itoa • ft_strmapi

Write Function Allowed

• ft_putchar_fd • ft_putstr_fd • ft_putendl_fd • ft_putnbr_fd

More functions...

• ft_split (Malloc & Free) • ft_striteri (No External Function Allowed)

Bonus Instrucctions

What is Bonus about

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 content
  • struct s_list *next adresses the next node of the list or NULL if the next node is the last one.

t_list img

Functions

• 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)

How to compile it

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)

About

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.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published