/libft

My own library of basic C functions.

Primary LanguageC

libft

My own My Skills library

About

This project was about coding a C library. It contained a lot of general purpose functions, both existing ones (in libc) and additional ones (either not in the libc or were but in a different form).

Functions included in the project:

A. Functions from libc

Functions from <ctype.h>:

Functions from <string(s).h>:

  • ft_strlen - calculates the length of a string.
  • ft_strchr - locates the first occurrence of a character in a string.
  • ft_strrchr - locates the last occurrence of a character in a string.
  • ft_strncmp - compares two strings up to a specified number of characters.
  • ft_strnstr - locates a substring in a string.
  • ft_strlcpy - copies a string with a specified size limit.
  • ft_strlcat - concatenates strings with a specified size limit.
  • ft_memset - sets a block of memory to a specified value.
  • ft_memcpy - copies a block of memory from one location to another.
  • ft_memmove - copies a block of memory from one location to another, handling overlaps correctly.
  • ft_memcmp - compares two blocks of memory.
  • ft_memchr - searches a block of memory for a specified byte.
  • ft_bzero - writes zeroes to a byte string.

Functions from <stdlib.h>:

B. Additional functions (not included in libc)

Non-standard functions:

  • ft_substr - extracts substring from string.
  • ft_strjoin - concatenates two strings into a new string (with malloc).
  • ft_strtrim - trims beginning and end of string with the specified characters.
  • ft_split - splits string, with specified character as delimiter, into an array of strings.
  • ft_itoa - converts integer to ASCII string.
  • ft_strmapi - creates new string from modifying string with specified function.
  • ft_striteri - applies a function to every character of a string.
  • ft_putchar_fd - writes a character to a file descriptor.
  • ft_putstr_fd - writes a string to a file descriptor.
  • ft_putendl_fd - writes a string followed by a newline to a file descriptor.
  • ft_putnbr_fd - writes an integer to a file descriptor.

Linked list functions (bonus part):