Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/pin3dev/42_libft
Custom C library that replicates standard functions and introduces extra utilities for handling strings, memory, and lists. This project serves as a foundation for mastering low-level programming and understanding function implementation in C.
https://github.com/pin3dev/42_libft
42-cursus 42-libft 42-school 42borntocode 42cursus 42sp custom-library libc libft libft-42 libft42 low-level
Last synced: about 2 months ago
JSON representation
Custom C library that replicates standard functions and introduces extra utilities for handling strings, memory, and lists. This project serves as a foundation for mastering low-level programming and understanding function implementation in C.
- Host: GitHub
- URL: https://github.com/pin3dev/42_libft
- Owner: pin3dev
- Created: 2022-12-14T23:31:21.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2024-10-24T23:13:05.000Z (about 2 months ago)
- Last Synced: 2024-10-26T05:15:33.418Z (about 2 months ago)
- Topics: 42-cursus, 42-libft, 42-school, 42borntocode, 42cursus, 42sp, custom-library, libc, libft, libft-42, libft42, low-level
- Language: C
- Homepage:
- Size: 122 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
Libft
Introduction •
Structure •
Docs •
Cloning •
Usage •
Norms •
Theoretical
This repository contains a custom C library, **Libft**, implemented as part of a coding project.
The objective of the project is to create a **static library** (`.a` file) in C that reimplements many of the standard library functions, as well as additional useful functions.
A static library is a collection of object files that are linked directly into the final executable at compile time.
The goal is to gain a deeper understanding of how these functions work internally and to provide a versatile library that can be reused in future C projects without relying on external dependencies.The mandatory part of the project involves reimplementing several standard C library functions.
These functions are divided into different subcategories, depending on their purpose.
The primary categories are **Libc functions** (reimplementations of standard C library functions) and **Additional functions** (new utility functions added to complement the library).
Within these categories, the functions can be further grouped based on their operations on **strings**, **memory**, **utility** functions, and **linked lists**.For detailed documentation, including usage examples and function breakdowns, please visit the link below:
To clone this repository and compile the project, run the following commands:
```bash
git clone https://github.com/pin3dev/42_Libft.git
cd 42_Libft/libft
```
This will download the project from GitHub into your local machine in current directory. Once inside the `libft` directory, you must run make to compile the library.### Makefile
A `Makefile` is provided to automate the compilation process. The Makefile includes the following rules:
- `all`: Compiles the library (`libft.a`).
- `clean`: Removes object files.
- `fclean`: Removes object files and the library (`libft.a`).
- `re`: Recompiles the entire project.
- `bonus`: Compiles the bonus part of the project.
- `test`: Compiles the bonus part and runs the test written by [@alelievr](https://github.com/alelievr/libft-unit-test)To compile the library, simply run:
```bash
make
```
This will generate the `libft.a` library, which can be linked in other projects to use all functions.### Basic Usage
To use the **libft** library in your C code, follow the steps below:
1. Include the header in your code:
```c
#include "libft/inc/libft.h"
```2. Compile your code with the library:
```bash
gcc -Wall -Wextra -Werror -o your_exec your_code.c 42_Libft/libft/libft.a
```3. You can now use any `libft` function in your program now!
## ⚠️ Norms and Guidelines Disclaimer
This project strictly follows the [**42 School Norm**](https://github.com/pin3dev/42_Cursus/blob/b9cd0fe844ddb441d0b3efb98abcee92aee49535/assets/General/norme.en.pdf) coding guidelines, which significantly influenced certain decisions in its implementation. These rules may sometimes lead to seemingly inefficient or unusual solutions, but they were necessary to meet the strict requirements of the school.
All the theoretical material used to develop this project is organized and can be accessed directly via the link below: