42sp School project
This repository contains all files for the libft project in the 42sp common core cursus. It's a custom-made library of useful functions in C language. The repository includes the Makefile and the libft.h header.
About · Grade · Index · Requirements · Instructions · Testing
This project is a C library of useful functions that are allowed to be used in future 42 School cursus projects. With access to this library, the coding process in incoming projects will be more effective. The aim of rewriting these functions is to get a better understanding of them, and get a wide range of utilities for the next projects.
The code in this repository follows the rules of the 42 Norminette.
ft_isascii- Test for ASCII characterft_isalpha- Test for alphabetic characterft_isdigit- Test for decimal digitft_isalnum- Test for alphanumeric characterft_isprint- Test for printable characterft_tolower- Convert to lowercaseft_toupper- Convert to uppercase
ft_bzero- Zero a byte stringft_memset- Fill memory with constant byteft_memchr- Scan memory for characterft_memcmp- Compare memory areasft_memmove- Copy memory area (handling overlap)ft_memcpy- Copy memory area
ft_strlen- Find length of stringft_strchr- Locate character in stringft_strrchr- Locate last occurrence of characterft_strnstr- Locate substring in stringft_strncmp- Compare two strings (size-limited)ft_strdup- Duplicate stringft_strlcpy- Size-bounded string copyft_strlcat- Size-bounded string concatenation
ft_itoa- Convert integer to stringft_substr- Extract substring from stringft_strtrim- Trim characters from start/endft_strjoin- Concatenate two stringsft_split- Split string into arrayft_strmapi- Apply function to each characterft_striteri- Apply function to each character (with index)ft_putchar_fd- Output character to file descriptorft_putstr_fd- Output string to file descriptorft_putendl_fd- Output string + newline to file descriptorft_putnbr_fd- Output number to file descriptor
ft_lstnew- Create new list elementft_lstsize- Count list elementsft_lstlast- Find last elementft_lstadd_back- Add element to endft_lstadd_front- Add element to beginningft_lstdelone- Delete elementft_lstclear- Clear listft_lstiter- Iterate through listft_lstmap- Apply function to list
The library is written in C language and needs the gcc or clang compiler, with <stdlib.h> and <unistd.h> standard libraries to run.
For basic functions:
$ make
For bonus functions:
$ make bonus
To delete all files generated with make, go to the path and run:
$ make fclean
To use the library functions in your code, simply include this header:
#include "libft.h"
This library have been tested with Francinette.
