Skip to content

thesahbaz/Libft

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

This project has been created as part of the 42 curriculum by muhakgul


Libft - My Very First Own Library

Description

Libft is the foundational project of the 42 school curriculum. [cite_start]The goal is to recreate a selection of standard C library functions (libc) and implement additional utility functions that will serve as a personal development toolkit for future projects[cite: 4, 14, 15]. [cite_start]By building this library, I have gained a deep understanding of memory management, pointer arithmetic, and data structures in C[cite: 46, 194].

Instructions

  • [cite_start]Language: The project is written in C and follows the Norm[cite: 19, 20].
  • [cite_start]Compilation: All files are compiled with cc using the -Wall -Wextra -Werror flags[cite: 25, 100].
  • [cite_start]Stability: Functions are designed to avoid unexpected crashes (segmentation faults, etc.) and handle memory leaks properly[cite: 22, 24].

Makefile Rules

[cite_start]The provided Makefile contains the following mandatory rules[cite: 27, 92]:

  • [cite_start]make or make all: Compiles the source files and creates the libft.a library[cite: 27].
  • [cite_start]make clean: Deletes the object files[cite: 27].
  • [cite_start]make fclean: Deletes object files and the libft.a library[cite: 27].
  • [cite_start]make re: Performs a full recompilation[cite: 27].
  • [cite_start]make bonus: Includes the linked list functions in the library[cite: 28].

Library Content

Part 1 – Libc Functions

[cite_start]Reimplemented standard functions from libc with the ft_ prefix[cite: 107, 109]:

  • [cite_start]Character Checks: ft_isalpha, ft_isdigit, ft_isalnum, ft_isascii, ft_isprint[cite: 114].
  • [cite_start]String Manipulation: ft_strlen, ft_strlcpy, ft_strlcat, ft_strchr, ft_strrchr, ft_strncmp, ft_strnstr, ft_strdup[cite: 131, 124, 127, 136, 119, 122, 132, 140].
  • [cite_start]Memory Operations: ft_memset, ft_bzero, ft_memcpy, ft_memmove, ft_memchr, ft_memcmp[cite: 134, 135, 118, 121, 125, 129].
  • [cite_start]Conversions: ft_atoi, ft_calloc[cite: 137, 139].

Part 2 – Additional Functions

[cite_start]Utility functions for string/number conversion and file descriptor output[cite: 151]:

  • [cite_start]String/Int Utilities: ft_substr, ft_strjoin, ft_strtrim, ft_split, ft_itoa[cite: 161, 173, 177, 178, 179].
  • [cite_start]Functional Tools: ft_strmapi, ft_striteri[cite: 183].
  • [cite_start]Output Functions: ft_putchar_fd, ft_putstr_fd, ft_putendl_fd, ft_putnbr_fd[cite: 183, 187, 188, 189].

Part 3 – Linked List Functions

[cite_start]A set of functions to manage singly linked lists using the t_list structure[cite: 192, 195]:

  • [cite_start]List Creation/Management: ft_lstnew, ft_lstadd_front, ft_lstadd_back, ft_lstsize, ft_lstlast[cite: 210, 211, 217, 215, 216].
  • [cite_start]Deletion/Iteration: ft_lstdelone, ft_lstclear, ft_lstiter, ft_lstmap[cite: 218, 222, 223, 225].

Resources

  • Manuals: 42 computer man pages.
  • Piscine: Concepts and code snippets from my 42 Piscine experience.
  • Learning Content: YouTube channels @CoderLog, @cs50, and Sadi Enver Şeker (BilgisayarKavramlari).
  • [cite_start]AI Usage: AI was used as a learning tool to explain complex algorithmic flows (especially for ft_split) and to assist in debugging and organizing the project structure.

Library Description

The first part of the library focuses on low-level string manipulations and memory operations. The second part introduces more complex C development functions and file descriptor handling. [cite_start]Finally, the third part provides a reusable and flexible linked list API using the t_list structure[cite: 239].

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published