Skip to content

About

My very first C static library recoding essential standard libc functions and linked list utilities — 42 School project.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

18 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

This activity has been created as part of the 42 curriculum by ydames.

Libft

Your Very First Own C Static Library.

C Language Norminette 42 School


Description

Libft is the foundational C programming project of the 42 curriculum. Since standard C library functions are not permitted by default in most subsequent projects, the goal of this activity is to re-implement a comprehensive set of essential libc functions, alongside additional utility functions for string manipulation, file descriptor output, and linked list management.

The resulting static library (libft.a) serves as a personal toolkit that will be reused and expanded throughout future C projects. All functions are written in C in strict compliance with the 42 Norm and compiled without memory leaks or undefined behaviors.

Library Overview

Part Category Functions
Part 1 Character Checks & Conversions ft_isalpha, ft_isdigit, ft_isalnum, ft_isascii, ft_isprint, ft_toupper, ft_tolower
Part 1 String Manipulation ft_strlen, ft_strchr, ft_strrchr, ft_strncmp, ft_strlcpy, ft_strlcat, ft_strnstr, ft_atoi
Part 1 Memory Manipulation ft_memset, ft_bzero, ft_memcpy, ft_memmove, ft_memchr, ft_memcmp
Part 1 Dynamic Allocation ft_calloc, ft_strdup
Part 2 String Creation & Transform ft_substr, ft_strjoin, ft_strtrim, ft_split, ft_itoa, ft_strmapi, ft_striteri
Part 2 File Descriptor Output ft_putchar_fd, ft_putstr_fd, ft_putendl_fd, ft_putnbr_fd
Part 3 Linked Lists (t_list) ft_lstnew, ft_lstadd_front, ft_lstadd_back, ft_lstsize, ft_lstlast, ft_lstdelone, ft_lstclear, ft_lstiter, ft_lstmap

Instructions

Compilation

The project includes a Makefile compliant with the 42 Norm (compiling with cc and the -Wall -Wextra -Werror flags without relinking) and generates libft.a at the root of the repository.

  1. Clone the repository:

    git clone [https://github.com/m4ss-dev/Common-Core---Libft-dd69b518-c470-4dda-8722-53db7e041016.git](https://github.com/m4ss-dev/Common-Core---Libft-dd69b518-c470-4dda-8722-53db7e041016.git) libft
    cd libft
  2. Compile the library:

    make
  3. Available Makefile rules:

    • make or make all: Compiles the source files and creates libft.a.
    • make clean: Removes object files (.o).
    • make fclean: Removes object files and libft.a.
    • make re: Performs a full recompilation (fclean followed by all).

Usage & Execution

Include "libft.h" in your C source files and link libft.a during compilation:

#include "libft.h"

int main(void)
{
    ft_putendl_fd("Hello from libft!", 1);
    return (0);
}

Compile your program with the library:

cc -Wall -Wextra -Werror main.c libft.a -o my_program
./my_program

Resources

Technical References

  • Linux / BSD Manual Pages (man): Official documentation covering standard libc behaviors, edge cases, and prototypes (man 3 strlen, man 3 calloc, man 3 strlcat, etc.).
  • The C Programming Language (K&R): Reference book on pointers, memory management, and standard library design.
  • 42 Norm Documentation: Official coding style and structure guidelines enforced by norminette.

AI Usage

In accordance with 42's AI guidelines, AI tools were strictly used as an educational tutor (without generating ready-to-use code):

  • Debugging and Edge Cases: Analyzing compiler warnings, Norminette errors, and memory edge cases (such as checking for SIZE_MAX overflow in ft_calloc or unsigned char comparisons in ft_strncmp).
  • Algorithmic Guidance: Step-by-step breakdown of algorithms (such as ft_atoi and memory allocation strategies) through guided questions rather than direct answers.
  • Documentation: Structuring, formatting, and translating this README.md file to comply with the project requirements.

About

My very first C static library recoding essential standard libc functions and linked list utilities — 42 School project.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages