Skip to content

psdiaspedro/libft-42Cursus

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

23 Commits
 
 
 
 
 
 
 
 

Repository files navigation

42cursus' libft

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

index

Implementation of some of the Standard C Library functions

Libft is the first project in the study program at School 42 (UNIT Factory).

The purpose of the project is to introduce to students standard C functions that we will be able to use in our future projects. To give a deeper understanding of functions we needed to create our own realization of standard functions.

All functions are created in accordance with Norm - the bunch of rules how code should be formatted.

NOTE!
Because of 42 School norm requirements:

  • All variables are declared and aligned at the top of each function
  • Each function can't have more then 25 lines of code
  • C++ style code commenting is forbidden
  • Project should be created just with allowed functions otherwise it's cheating.

The project consists of 3 main logical parts:

  • Standart Libc functions
  • Additional functions
  • Bonus part functions

Functions from <ctype.h> library

Functions from <stdlib.h> library

Functions from <strings.h> library

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_strnstr - locate a substring in a string (size-bounded).
  • ft_strcmp * - compare strings.
  • ft_strncmp * - compare strings (size-bounded).
  • ft_strdup - save a copy of a string (with malloc).
  • 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_putendl_fd - output string to given file with newline.
  • 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.
  • ft_strmapi - create new string from modifying string with specified function.
  • ft_striteri - Applies the function f to each character of the string passed as argument.

Linked list functions

Note: functions marked with * are bonus functions (not mandatory by the project's subject).

Using Makefile you can create library file libft.a
Makefile has 4 main options:

  • make - to compile C files - create object files and library libft.a
  • make clean - to remove object files
  • make fclean - remove libft.a file
  • make re - recompile the library

More about School 42 you can find here: https://en.wikipedia.org/wiki/42_(school)

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published