Skip to content

Libft is a custom C library implementation that replicates key functions from the standard C library to enhance understanding of memory management, string manipulation, and data structures.

Notifications You must be signed in to change notification settings

doooriian/Libft

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

24 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation


42 Logo

Libft

A custom C library project from 42 School

Libft Badge

GitHub code size in bytes Code language count GitHub top language GitHub last commit

---

✨ Overview

Libft is an individual project at 42 School aimed at recreating essential C standard library functions, along with additional utilities. This library serves as a foundation for future projects at 42, where the use of certain standard libraries is restricted. As we progress through the curriculum, this library will expand with more custom functions tailored to our needs.

The goal? Build a robust, reusable, and efficient set of tools from scratch.


📑 Function Categories

📚 <ctype.h> Functions

Functions for character handling:

  • ft_isalpha — Checks if a character is alphabetic.
  • ft_isdigit — Checks if a character is a digit (0-9).
  • ft_isalnum — Checks if a character is alphanumeric.
  • ft_isascii — Validates if a character is in the ASCII set.
  • ft_isprint — Checks if a character is printable.
  • ft_toupper — Converts a character to uppercase.
  • ft_tolower — Converts a character to lowercase.

📚 <string.h> Functions

Functions for string and memory manipulation:

  • ft_strlen — Calculates the length of a string.
  • ft_memset — Fills memory with a constant byte.
  • ft_bzero — Sets a memory block to zero.
  • ft_memcpy — Copies memory from source to destination.
  • ft_memmove — Copies memory, handling overlapping areas.
  • ft_strlcpy — Copies a string with size limitation.
  • ft_strlcat — Concatenates strings with size limitation.
  • ft_strchr — Finds the first occurrence of a character.
  • ft_strrchr — Finds the last occurrence of a character.
  • ft_strncmp — Compares two strings up to n characters.
  • ft_memchr — Scans memory for a specific character.
  • ft_memcmp — Compares two memory blocks.
  • ft_strnstr — Locates a substring within a string.
  • ft_strdup — Duplicates a string.

📚 <stdlib.h> Functions

Functions for memory allocation and conversion:

  • ft_atoi — Converts a string to an integer.
  • ft_calloc — Allocates memory and initializes it to zero.

🚀 Non-Standard Functions

Custom utility functions:

  • ft_substr — Extracts a substring from a string.
  • ft_strjoin — Concatenates two strings.
  • ft_strtrim — Trims specific characters from a string.
  • ft_split — Splits a string by a delimiter.
  • ft_itoa — Converts an integer to a string.
  • ft_strmapi — Applies a function to each character of a string.
  • ft_striteri — Applies a function to each character with index.
  • ft_putchar_fd — Outputs a character to a file descriptor.
  • ft_putstr_fd — Outputs a string to a file descriptor.
  • ft_putendl_fd — Outputs a string + newline to a file descriptor.
  • ft_putnbr_fd — Outputs a number to a file descriptor.

🔗 Linked List Functions

Functions for linked list management:


🛠️ Technologies Used

  • C — Core programming language.
  • Makefile — Build automation tool.

🚀 How to Build and Run

  1. Clone repository

    git clone git@github.com:doooriian/Libft.git
  2. Go inside project directory and run make

    cd Libft
    make
  3. To use the library in your code, #include the following header

    #include "libft.h"

🧪 Testing

This project was tested using Francinette, a widely-used third-party tester designed for 42 School projects.

✅ Results

Here’s my score for the Libft project:

Libft Grade

📬 Contact

Feel free to reach out or contribute to this project via GitHub!

About

Libft is a custom C library implementation that replicates key functions from the standard C library to enhance understanding of memory management, string manipulation, and data structures.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published