The Libft project is a custom library created as part of the curriculum at 42 São Paulo. This project serves as the starting point for many other projects at 42, providing basic functions that replace and complement the standard C library functions.
Libft includes various utility functions for string manipulation, memory management, linked lists, and other common operations in C. Some of the features include:
- String manipulation (
ft_strlen
,ft_strcpy
,ft_strncpy
, etc.) - Memory management (
ft_memset
,ft_memcpy
,ft_memccpy
, etc.) - Linked list management (
ft_lstnew
,ft_lstadd
,ft_lstdelone
, etc.) - Additional functions (
ft_atoi
,ft_isalpha
,ft_tolower
, etc.)
To compile the library, you can use the provided Makefile. Run the following commands in the terminal:
make
This will generate the libft.a file, which can be included in other projects.
To clean up the object files generated during compilation:
make clean
To clean all generated files, including libft.a:
make re
To use Libft in your projects, include the library header and link the libft.a file during compilation:
#include "libft.h"
When compiling your project, add libft.a to the compiler command line:
gcc -Wall -Wextra -Werror -o my_program my_program.c libft.a
The project directory structure is organized as follows:
libft/
├── includes/
│ └── libft.h
├── src/
│ └── aditionals/
│ └── list/
│ └── memory/
│ └── string/
├── Makefile
├── README.md
- includes/: Contains the libft.h header file;
- src/: Contains the source code files for the library;
- Makefile: Build script;
- README.md: Project documentation.
Contributions are welcome! If you want to contribute to this project, please follow the steps below:
- Fork the project
- Create a branch for your feature (git checkout -b feature/new-feature)
- Commit your changes (git commit -am 'Add new feature')
- Push to the branch (git push origin feature/new-feature)
- Create a new Pull Request
This project is licensed under the MIT License. See the LICENSE file for more details.