Skip to content

Latest commit

Β 

History

181 Commits

Folders and files

NameName
Last commit message
Last commit date
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

🧱 libft β€” 42 Paris Project

Rebuilding the fundamental bricks of the C standard library and creating a personal reusable library for future 42 projects.

42 Language: C Type: Library Platform: macOS/Linux Grade: 125/100 Status: Updated after grading


Table of contents


πŸŽ“ Context

This project is the very first milestone of the 42 Paris curriculum.

Its purpose is to reimplement core functions of the C standard library (strlen, memcpy, strchr, …), while progressively extending it with higher-level utilities, in order to build a robust and reusable personal C library: libft.

This library is designed to be reused across most 42 projects
(ft_printf, push_swap, minishell, …)
and to serve as a long-term foundation for all future C developments.


βš™οΈ Objectives

  • Reimplement libc fundamentals (strings, memory, characters, conversions)
  • Provide safe and reusable abstractions on top of low-level C APIs
  • Add extended utilities beyond the mandatory subject:
    • dynamic buffers (buff_*)
    • linked lists
    • math helpers
    • formatted output helpers
  • Ensure:
    • strict 42 Norm compliance
    • no memory leaks
    • well-defined API contracts (ownership, lifetime, error handling)

✨ Highlights

  • πŸ“¦ Dynamic growable buffer API (buff_*)
    Designed to minimize reallocations and simplify string / I/O manipulation.

  • 🧠 Explicit memory contracts
    Ownership, borrowing, and lifetime rules are documented for all public APIs.

  • πŸ›  Extended utility set
    Helpers that go beyond the libc scope while remaining dependency-free.

  • πŸ“š Fully documented public API
    Automatically generated documentation using Doxygen.


πŸ“š Documentation

The full API documentation is generated from the source code using Doxygen.

It focuses on public interfaces, while internal helpers remain accessible through call graphs for deeper understanding.

➑️ Browse the libft API documentation

The documentation describes:

  • function contracts
  • ownership & lifetime rules
  • warnings and undefined behavior
  • public data structures

πŸ—‚οΈ Repository overview

libft/
β”œβ”€β”€ libft.h            # Public API
β”œβ”€β”€ src/               # Implementations
β”œβ”€β”€ docs/
β”‚   β”œβ”€β”€ Doxyfile       # Doxygen configuration
β”‚   └── html/          # Generated API documentation
β”œβ”€β”€ Makefile
└── README.md

🧰 Build

Basic build:

make        # build libft.a

Clean up:

make clean  # remove object files
make fclean # remove objects and library

Rebuild:

make re     # full rebuild

Generate documentation locally:

make doc	# generate docs/html/* files

Run unit tests (using my own test framework)

make test	# run unit tests

πŸ’― 42 Peer-to-Peer Evaluations


β€œBuild your own standard library, and you’ll never fear undefined behavior again.” πŸ™ƒ

About

🧱 libft (42 Paris) β€” Rebuild of essential C standard library functions + extra utilities (printf, get_next_line, ...).

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Contributors

Languages