Skip to content

LezardSC/42-libft

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

42-libft

Overview

This is the first project from 42 School. It consists of several exercises—similar to those in the piscine—to revisit and consolidate the fundamentals of C programming. The project was validated at 125% (including bonus tasks). Additionally, an add-ons directory was created to include extra functions that were gradually added during the common core C curriculum.

Function List

Mandatory Functions

ft_atoi: Converts a string to an integer.

ft_bzero: Sets a block of memory to zero.

ft_calloc: Allocates memory for an array and initializes it to zero.

ft_isalnum: Checks if a character is alphanumeric.

ft_isalpha: Checks if a character is alphabetic.

ft_isascii: Determines if a character is an ASCII character.

ft_isdigit: Checks if a character is a digit.

ft_isprint: Checks if a character is printable.

ft_itoa: Converts an integer to its string representation.

ft_memchr: Searches for a specific byte in a block of memory.

ft_memcmp: Compares two memory blocks.

ft_memcpy: Copies memory from a source to a destination.

ft_memmove: Safely copies overlapping memory areas.

ft_memset: Fills a block of memory with a specified byte.

ft_putchar_fd: Outputs a character to a given file descriptor.

ft_putendl_fd: Outputs a string followed by a newline to a file descriptor.

ft_putnbr_fd: Outputs an integer to a file descriptor.

ft_putstr_fd: Outputs a string to a file descriptor.

ft_split: Splits a string into an array of substrings using a specified delimiter.

ft_strchr: Locates the first occurrence of a character in a string.

ft_strdup: Duplicates a string by allocating new memory.

ft_striteri: Applies a function to each character of a string, providing its index.

ft_strjoin: Concatenates two strings into a new string.

ft_strlcat: Appends one string to another with size limitations to prevent overflow.

ft_strlcpy: Copies a string to a destination buffer, ensuring proper null-termination.

ft_strlen: Computes the length of a string.

ft_strmapi: Applies a function to each character of a string and returns a new modified string.

ft_strncmp: Compares two strings up to a specified number of characters.

ft_strnstr: Searches for a substring within a string up to a given length.

ft_strrchr: Finds the last occurrence of a character in a string.

ft_strtrim: Trims specified characters from the beginning and end of a string.

ft_substr: Extracts a substring from a string starting at a given index.

ft_tolower: Converts an uppercase letter to lowercase.

ft_toupper: Converts a lowercase letter to uppercase.

Bonus Functions

ft_lstnew: Creates a new linked list node with the provided content.

ft_lstadd_front: Adds a new node at the beginning of a linked list.

ft_lstsize: Counts and returns the number of nodes in a linked list.

ft_lstadd_back: Appends a new node to the end of a linked list.

ft_lstlast: Retrieves the last node in a linked list.

ft_lstdelone: Deletes a single linked list node using a specified function to free its content.

ft_lstclear: Deletes and frees all nodes in a linked list.

ft_lstiter: Iterates over each node in a linked list and applies a function to its content.

ft_lstmap: Creates a new linked list by applying a function to each node’s content from an existing list.

Add-on Functions

free_tab: Frees a dynamically allocated array of strings.

free_tab_int: Frees a two-dimensional array of integers, given its size.

free_tab_void: Frees a dynamically allocated array of pointers (void**).

ft_count: Returns the number of digits in an integer.

ft_count_long: Returns the number of digits in a long integer.

ft_count_ul: Returns the number of digits in an unsigned long integer.

ft_count_unsigned: Returns the number of digits in an unsigned integer.

ft_putchar: Outputs a single character to the standard output.

ft_putnbr: Outputs an integer to the standard output.

ft_putnbr_base: Outputs an integer in a specified numeral base.

ft_putnbr_base_ul: Outputs an unsigned long integer in a specified numeral base.

ft_putunbr: Outputs an unsigned integer to the standard output.

ft_putstr: Outputs a string to the standard output.

ft_strcmp: Compares two strings and returns the difference between the first pair of differing characters.

ft_strcpy: Copies a string from a source to a destination buffer.

ft_strncpy: Copies up to a specified number of characters from a source string to a destination.

ft_strlen_doublechar: Computes the number of strings in an array of strings (a double pointer).

ft_swap_int: Swaps the values of two integers.

ft_atoi_base: Converts a string representing a number in a given base to its integer value.

ft_printf: A custom implementation of the printf function for formatted output.

get_next_line: Reads a line from a file descriptor and returns it as a string.

Author

login: jrenault

About

First project of 42 School. Few C functions.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published