/libft

Primary LanguageC

libft

This project is about coding a C library, based on some general purpose functions that I'll be able to use in my future 42 projects.

For detailed information, see the subject of this project.

Standard functions

Functions from <ctype.h> library

  • ft_isascii - Checks whether the argument passed can be represented as a valid ASCII character.
  • ft_isalnum - Checks whether the argument passed is an alphanumeric character or not.
  • ft_isalpha - Checks whether the argument passed is an alphabetic character or not.
  • ft_isdigit - Checks whether the argument passed is an numeric character or not.
  • ft_isprint - Checks whether the argument passed is a printable character or not.
  • ft_tolower - Takes an uppercase alphabet and convert it to a lowercase character.
  • ft_toupper - Takes an lowercase alphabet and convert it to an uppercase character.

Functions from <stdlib.h> library

  • ft_atoi - Transform the first numeric characters of a string in numbers.
  • ft_calloc - Allocates memory for an array, replacing every position of memory with zero ('0').

Functions from <strings.h> library

  • ft_bzero - Erase bytes of a memory area, by replacing it with zeros.
  • ft_memset - Fills the first 'n' bytes of a string with a character.
  • ft_memchr - Find the first occurrence of a character in a memory area (size-bounded).
  • ft_memcmp - Compare two memory areas (size-bounded).
  • ft_memmove - Copies a memory area to another memory area, allowing overlapping (size-bounded).
  • ft_memcpy - Copies a memory area to another memory area (size-bounded).

Functions from <string.h> library

  • ft_strlen - Calculates the length of a given string.
  • ft_strchr - Loops through a string to find the first occurrence of a character.
  • ft_strrchr - Loops through a string to find the last occurrence of a character.
  • ft_strnstr - Locate the first occurence of a substring in a string (size-bounded).
  • ft_strncmp - Compares two strings (size-bounded).
  • ft_strdup - Duplicates a string (with malloc).
  • ft_strlcpy - Copies a string to another (size-bounded).
  • ft_strlcat - Appends a string to another (size-bounded).

Non-standard functions

  • ft_putchar_fd - Output a character to a given file descriptor.
  • ft_putstr_fd - Output a string to a given file descriptor.
  • ft_putendl_fd - Output a string with a newline to a given file descriptor.
  • ft_putnbr_fd - Output an integer to a given file descriptor.
  • ft_itoa - Transform a number into a string (with malloc).
  • ft_substr - Extract a substring from a string.
  • ft_strtrim - Trim the beginning and the end of a string based on a set of characters.
  • ft_strjoin - Concatenate two strings into a new string (with malloc).
  • ft_split - Split a string into parts, according to a delimiter.
  • ft_strmapi - Creates a new string by applying a function to each character of a string.
  • ft_striteri - Modify a string by applying a function to each character of it.

Bonus functions (linked-list functions)

  • ft_lstnew - Create new node of a list (with malloc).
  • ft_lstsize - Calculates the length of a given list.
  • ft_lstlast - Find the last node of a list.
  • ft_lstadd_back - Add a new node at the end of a list.
  • ft_lstadd_front - Add a new node at the beginning of a list.
  • ft_lstdelone - Delete a node of a list.
  • ft_lstclear - Delete all the nodes of a list.
  • ft_lstiter - Applies a function to the content of all list's nodes.
  • ft_lstmap - Creates a new list by applying a function to the content of all list's nodes.