Skip to content

A library with a lot of rewritten C functions and some custom ones

License

Notifications You must be signed in to change notification settings

myryk31415/libft

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

42 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Libft

This is a project for creating a library in C, containing a collection of functions that replicate the behavior of standard library functions. The project is divided into mandatory and additional parts, each containing a set of functions to implement.

Part 1 - Libc Functions

In this part, the behavior of standard libc functions are replicated with names prefixed by ft_. Functions to implement include:

  • isalpha
  • isdigit
  • isalnum
  • isascii
  • isprint
  • strlen
  • memset
  • bzero
  • memcpy
  • memmove
  • strlcpy
  • strlcat
  • toupper
  • tolower
  • strchr
  • strrchr
  • strncmp
  • memchr
  • memcmp
  • strnstr
  • atoi
  • calloc
  • strdup

Part 2 - Additional Functions

This part involves creating additional functions that either complement the libc functions or provide new functionality. Functions to implement include:

  • ft_substr
  • ft_strjoin
  • ft_strtrim
  • ft_split
  • ft_itoa
  • ft_strmapi
  • ft_striteri
  • ft_putchar_fd
  • ft_putstr_fd
  • ft_putendl_fd
  • ft_putnbr_fd

Bonus - Linked Lists

The Bonus functions give some insight about linked lists:

  • ft_lstadd_back.c
  • ft_lstadd_front.c
  • ft_lstclear.c
  • ft_lstdelone.c
  • ft_lstiter.c
  • ft_lstlast.c
  • ft_lstmap.c
  • ft_lstnew.c
  • ft_lstsize.c

Ft_printf

My libft also inludes a custom implementation of the printf() function from the C standard library. The function ft_printf() will mimic the behavior of the original printf() and will handle various format specifiers.

Supported Conversions:

%c: Prints a single character.
%s: Prints a string (as defined by the common C convention).
%p: The void * pointer argument will be printed in hexadecimal format.
%d: Prints a decimal (base 10) number.
%i: Prints an integer in base 10.
%u: Prints an unsigned decimal (base 10) number.
%x: Prints a number in hexadecimal (base 16) lowercase format.
%X: Prints a number in hexadecimal (base 16) uppercase format.
%%: Prints a percent sign.

Get_next_line

Get_next_line is included in this libft as well which is a function that reads a line from a file descriptor and returns it. It implements a buffer which can be changed with the Compiler flag -D BUFFER_SIZE=n.

Makefile

A Makefile is required to compile the source files to the required output with specific flags (-Wall -Wextra -Werror). It should include rules for $(NAME), all, clean, fclean, and re. Additionally, if bonuses are implemented, a bonus rule should be included.

Submission

Submit the following files:

  • Makefile
  • libft.h
  • All ft_*.c files

Ensure that your project follows the norms outlined in the project requirements to avoid penalties during evaluation.

About

A library with a lot of rewritten C functions and some custom ones

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published