/libft

Project #00 - Your very first own library

Primary LanguageC

Libft - Your very first own library

xvoorvaa's 42 Libft Score

Workflows to check Linux and macOS compilation:

Libft macOS compile check CI

Libft Ubuntu compile check CI

Description Libft

The goal of this project is create small functions that you can combine to create your own library. These functions need to be able to act like the real functions from the C library and also manage the same error handling.

Installation

To build the program, there are only a few steps: First of all, you can download the repository through the following steps in any shell of your preference:

git clone git@github.com:xvoorvaa/libft.git
cd libft
make

This commands will compile everything and a executable "libft" should be created.

how_to_libft_v1

Functions from <ctype.h> library

  • ft_isalnum - alphanumeric character test.
  • ft_isalpha - alphabetic character test.
  • ft_islower * - lower-case character test.
  • ft_isupper * - upper-case character test.
  • ft_isdigit - decimal-digit character test.
  • ft_isprint - printing character test (space character inclusive).
  • ft_tolower - upper case to lower case letter conversion.
  • ft_toupper - lower case to upper case letter conversion.

  • Functions from <stdlib.h> library

  • ft_atoi - convert ASCII string to integer.
  • ft_calloc - memory allocation.

    Functions from <strings.h> library

  • ft_bzero - write zeroes to a byte string.
  • ft_memset - write a byte to a byte string.
  • ft_memchr - locate byte in byte string.
  • ft_memcmp - compare byte string.
  • ft_memmove - copy byte string.
  • ft_memcpy - copy memory area.
  • ft_memccpy - copy string until character found.

    Functions from <string.h> library

  • ft_strlen - find length of string.
  • ft_strchr - locate character in string (first occurrence).
  • ft_strrchr - locate character in string (last occurence).
  • ft_strstr * - locate a substring in a string.
  • ft_strnstr - locate a substring in a string (size-bounded).
  • ft_strcmp * - compare strings.
  • ft_strncmp * - compare strings (size-bounded).
  • ft_strcpy * - copy strings.
  • ft_strncpy * - copy strings (size-bounded).
  • ft_strdup - save a copy of a string (with malloc).
  • ft_strndup * - save a copy of a string (with malloc, size-bounded).
  • ft_strncat * - concatenate strings (s2 into s1, size-bounded).
  • ft_strlcpy - size-bounded string copying.
  • ft_strlcat - size-bounded string concatenation.

  • Non standard functions

  • ft_putchar_fd - output a character to given file.
  • ft_putstr_fd - output string to given file.
  • ft_putnbr_fd - output integer to given file.
  • ft_itoa - convert integer to ASCII string.
  • ft_substr - extract substring from string.
  • ft_strtrim - trim beginning and end of string with the specified characters.
  • ft_strjoin - concatenate two strings into a new string (with malloc).
  • ft_split - split string, with specified character as delimiter, into an array of strings.
  • Usage 🛠️


    To compile the library, run the following command:

    cd path_to_libft && make
    

    After creating the library, you're able to use the functions within another file. to do that add the folowing as header in a file:

    #include "libft.h"
    

    Third-party testers

  • libftTester-Tripouille
  • War-machine-Y3ll0w42
  • Unit-tester-Alelievr