Skip to content

ylam21/libft

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

55 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Libft

This project is part of the 42 Prague curriculum.
The goal of libft is to reimplement a set of standard C library functions as well as additional utilities.
The result is a custom C library that can be reused in later 42 projects.

📦 Installation & Compilation

  1. Clone the repository:
git clone git@github.com:ylam21/libft.git libft
cd libft
  1. Compile the library:
make

This will produce the libft.a static library.

🧹 Makefile Rules

make – Compile the library

make clean – Remove object files (.o)

make fclean – Remove object files and the compiled library (libft.a)

make re – Recompile everything (equivalent to fclean + make)

🚀 Usage

  1. Include the header in your source file:
#include "libft.h"
  1. Compile your program with the library:
gcc -Ilibft your_program.c -Llibft -lft -o a.out

-Ilibft tells the compiler where to find libft.h

-Llibft tells the linker where to find libft.a

-lft links the library

📑 Functions

✅ Reimplemented libc functions

  • isalpha
  • isdigit
  • isalnum
  • isascii
  • isprint
  • strlen
  • memset
  • bzero
  • memcpy
  • memmove
  • strlcpy
  • strlcat
  • toupper
  • tolower
  • strchr
  • strrchr
  • strncmp
  • memchr
  • memcmp
  • strnstr
  • atoi
  • calloc
  • strdup
  • ft_substr
  • ft_strjoin
  • ft_strtrim
  • ft_split
  • ft_itoa
  • ft_strmapi
  • ft_striteri
  • ft_putchar_fd
  • ft_putstr_fd
  • ft_putendl_fd
  • ft_putnbr_fd

🏗️ Bonus part – Linked list functions

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

📝 Notes

This library will be used as a foundation for future 42 projects.

Functions follow the 42 norminette coding standard.

Each function is prefixed with ft_ to avoid naming conflicts with the standard library.

About

My C standard library

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published