Skip to content

This project is about coding a C library. It will contain a lot of general purpose functions your programs will rely upon.

Notifications You must be signed in to change notification settings

pvaladares/42cursus-00-Libft

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

26 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

42cursus' libft

Development repo for 42cursus' libft project
For further information about 42cursus and its projects, please refer to 42cursus repo.

GitHub code size in bytes Number of lines of code Code language count GitHub top language GitHub last commit


🗣️ About

The aim of this project is to code a C library recoding usual functions that you'll be allowed to use in all your other projects.

For detailed information and comments, refer to the subject of this project.

🚀 TLDR: this project consists of coding basic C functions (see below), which are then compiled
into a library for use in other projects of the cursus.

Mandatory Part

Functions from <ctype.h> library

Functions from <stdlib.h> library

  • ft_atoi - convert ASCII string to integer.
  • ft_calloc - memory allocation (with malloc).

Functions from <strings.h> library

  • ft_bzero - write zeroes to a byte string.

Functions from <string.h> library

Non-standard functions

  • ft_substr - save substring from string (with malloc).
  • ft_strjoin - concatenate two strings into a new string (with malloc).
  • ft_strtrim - trim beginning and end of string with the specified characters with malloc).
  • ft_split - split string, with specified character as delimiter, into an array of strings.
  • ft_itoa - convert integer to ASCII string.
  • ft_strmapi - create new string from modifying string with specified function.
  • ft_striteri - modifies string with specific function.
  • ft_putchar_fd - output a character to given file.
  • ft_putstr_fd - output string to given file.
  • ft_putendl_fd - output string to given file with newline.
  • ft_putnbr_fd - output integer to given file.

Bonus part

Linked list functions

  • ft_lstnew - create a new list (with malloc).
  • ft_lstadd_front - add new element at the beginning of the list.
  • ft_lstsize - count the elements in a list.
  • ft_lstlast - find the last element of the list.
  • ft_lstadd_back - add new element at end of the list.
  • ft_lstdelone - delete element from the list.
  • ft_lstclear - delete a sequence of elements of the list from a starting element.
  • ft_lstiter - apply function to all the elements of the list.
  • ft_lstmap - apply function to all the elements of the list and create a new list (with malloc).

🛠️ Testing

Makefile and re-link

Mandatory part

git clone https://github.com/pvaladares/42cursus-00-Libft.git && cd 42cursus-00-Libft && make

Typing again make should show the following message:

make: `libft.a' is up to date.

Mandatory part + bonus

make bonus

Typing again make bonus should show the following message:

make[1]: `libft.a' is up to date.

Third-party testers

About

This project is about coding a C library. It will contain a lot of general purpose functions your programs will rely upon.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published