This is my very first project as a 42 student!
Libft is all about creating my own C library, a foundational tool I will rely on throughout my journey at 42.
Description
This project focuses on building a strong foundation in C programming by understanding and recreating essential functions of the standard C library, as well as implementing additional utility functions. The main goals include:- Learn how the standard library functions work under the hood.
- Build a reusable library for future projects.
- Follow strict coding norms and guidelines.
Part 1: Libc Functions
ft_isalpha: Checks if a character is an alphabetic letter (a-z, A-Z).
ft_isdigit: Checks if a character is a numeric digit (0-9).
ft_isalnum: Checks if a character is alphanumeric (a-z, A-Z, 0-9).
ft_isascii: Checks if a character is part of the ASCII set (0-127).
ft_isprint: Checks if a character is printable (includes space).
ft_strlen: Calculates the length of a string.
ft_memset: Fills a block of memory with a specified value.
ft_bzero: Sets a block of memory to zero.
ft_memcpy: Copies memory from one location to another.
ft_memmove: Safely copies memory, allowing overlapping regions.
ft_strlcpy: Copies a string to a buffer, ensuring null-termination.
ft_strlcat: Appends a string to a buffer, ensuring null-termination.
ft_toupper: Converts a lowercase character to uppercase.
ft_tolower: Converts an uppercase character to lowercase.
ft_strchr: Finds the first occurrence of a character in a string.
ft_strrchr: Finds the last occurrence of a character in a string.
ft_strncmp: Compares two strings up to a specified length.
ft_memchr: Finds the first occurrence of a byte in a memory block.
ft_memcmp: Compares two memory blocks byte by byte.
ft_strnstr: Locates a substring within a string, with a length limit.
ft_atoi: Converts a string to an integer.
Part 2: Additional Functions
ft_substr: Extracts a substring from a given string.
ft_strjoin: Concatenates two strings into a new string.
ft_strtrim: Removes specified characters from the beginning and end of a string.
ft_split: Splits a string into an array of substrings using a delimiter.
ft_itoa: Converts an integer to a string.
ft_strmapi: Applies a function to each character of a string, creating a new string.
ft_striteri: Applies a function to each character of a string (modifies the original string).
ft_putchar_fd: Outputs a character to a specified file descriptor.
ft_putstr_fd: Outputs a string to a specified file descriptor.
ft_putendl_fd: Outputs a string followed by a newline to a specified file descriptor.
ft_putnbr_fd: Outputs an integer to a specified file descriptor.
Bonus: Linked List Utilities
ft_lstnew: Creates a new linked list node.
ft_lstadd_front: Adds a new node to the beginning of a linked list.
ft_lstsize: Counts the number of nodes in a linked list.
ft_lstlast: Returns the last node of a linked list.
ft_lstadd_back: Adds a new node to the end of a linked list.
ft_lstdelone: Deletes a single node from a linked list.
ft_lstclear: Deletes all nodes from a linked list.
ft_lstiter: Iterates through a linked list and applies a function to each node.
ft_lstmap: Creates a new linked list by applying a function to each node of an existing list.
-
Clone the repository:
git clone https://github.com/your-username/libft.git cd libft -
Build the library:
make
-
Include libft.a in your C projects:
#include "libft.h"
-
Compile your project with the library:
cc -o your_program your_program.c libft.a
Project developed by: Carol Cortes
