Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

9 Commits
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Libft

A custom C standard library implementation built from scratch as part of the 42 curriculum.


πŸ“Œ What is this project?

Libft is a personal recreation of several standard C library functions, along with additional utility functions and a linked list implementation.

The goal is to understand how these core functions work internally by reimplementing them from scratch without using the original libc implementations.


βš™οΈ Features

This library includes:

πŸ”€ Standard libc functions

Rewritten versions of common C functions:

  • Character checks: ft_isalpha, ft_isdigit, ft_isalnum, ft_isascii, ft_isprint
  • String manipulation: ft_strlen, ft_strlcpy, ft_strlcat, ft_strdup, ft_strchr, ft_strrchr, ft_strncmp, ft_strnstr
  • Memory functions: ft_memset, ft_bzero, ft_memcpy, ft_memmove, ft_memchr, ft_memcmp
  • Conversion: ft_atoi, ft_itoa
  • Case conversion: ft_toupper, ft_tolower
  • Allocation: ft_calloc

🧰 Utility functions

Helpful additional functions:

  • ft_substr

  • ft_strjoin

  • ft_strtrim

  • ft_split

  • ft_strmapi

  • ft_striteri

  • File descriptors helpers:

    • ft_putchar_fd
    • ft_putstr_fd
    • ft_putendl_fd
    • ft_putnbr_fd

πŸ”— Bonus: Linked List

A simple linked list implementation:

  • ft_lstnew
  • ft_lstadd_front
  • ft_lstadd_back
  • ft_lstsize
  • ft_lstlast
  • ft_lstdelone
  • ft_lstclear
  • ft_lstiter
  • ft_lstmap

πŸ› οΈ Build

Compile the library using:

make

This generates:

libft.a

To remove object files:

make clean

To remove everything:

make fclean

To rebuild:

make re

πŸ“¦ Usage

Include the header in your project:

#include "libft.h"

Compile your program with the library:

gcc main.c -L. -lft

πŸ“ Project structure

libft/
β”œβ”€β”€ srcs/
β”œβ”€β”€ obj/
β”œβ”€β”€ libft.h
β”œβ”€β”€ Makefile
└── libft.a

🎯 Purpose

This project is part of the 42 School curriculum and serves as a foundation for future projects such as:

  • get_next_line
  • ft_printf
  • minishell

πŸ‘€ Author

  • 42 Login: iarefeva

πŸ“œ License

This project is for educational purposes as part of 42 School training.

About

Core 1st project

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages