Development repo for 42cursus libft project
For further information about 42cursus and its projects, please refer to 42-Common-Core-Guide repo.
This is a project in daily use. If you want to see the project that i have been evaluated in 42school click in releases at the right side!
The aim of this project is to code a C library regrouping usual functions that you'll be allowed to use in all your other projects.
C-Programming-Language-2nd-Edition (PDF)
For detailed information, refer to the subject of the project
π 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.
ft_isalnum
- alphanumeric character test.ft_isascii
- test for ASCII character.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.ft_tolower
- upper case to lower case letter conversion.ft_toupper
- lower case to upper case letter conversion.
ft_bzero
- write zeroes to a byte string.ft_memccpy
- copy string until character found.ft_memchr
- locate byte in byte string.ft_memcmp
- compare byte string.ft_memcpy
- copy memory area.ft_memmove
- copy byte string.ft_memset
- write a byte to a byte string.
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_strlcpy
- size-bounded string copying.ft_strlcat
- size-bounded string concatenation.
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_lstnew
- create new list.ft_lstsize
- count elements of a list.ft_lstlast
- find last element of list.ft_lstadd_back
- add new element at end of list.ft_lstadd_front
- add new element at beginning of list.ft_lstdelone
- delete element from list.ft_lstclear
- delete sequence of elements of list from a starting point.ft_lstiter
- apply function to content of all list's elements.ft_lstmap
- apply function to content of all list's elements into new list.
Note: functions marked with * are bonus functions (not mandatory by the project's subject).
The library is written in C language and thus needs the gcc
compiler and some standard C libraries to run.
1. Compiling the library
To compile the library, run:
$ cd path/to/libft && make
2. Using it in your code
To use the library functions in your code, simply include its header:
#include "libft.h"
and, when compiling your code, add the required flags:
-lft -L path/to/libft.a -I path/to/libft.h
1. I haven`t coded a tester yet, but you can make your own test for each function. Here some third party testers that you can use.
- xicodomingues/francinette
- jtoty/Libftest
- alelievr/libft-unit-test
- Night-squad/libft-war-machine-v2019
- t0mm4rx/libftdestructor
Rnpu cebwrpg bs gur 97 Pbzzba Pber pbagnvaf na rapbqrq uvag. Sbe rnpu pvepyr, bayl bar cebwrpg cebivqrf gur pbeerpg uvag arrqrq sbe gur arkg pvepyr. Guvf punyyratr vf vaqvivqhny, gurer vf bayl n cevmr sbe bar fghqrag jvaare cebivqvat nyy qrpbqrq zrffntrf. Nal nqinagntrq crbcyr pna cynl, yvxr pheerag be sbezre fgnss, ohg gur cevmr jvyy erznva flzobyvp. Gur uvag sbe guvf svefg cebwrpg vf: Ynetr pbjf trarebfvgl pbzrf jvgu punegf naq sbhe oybaqr ungf gb qrsl hccre tenivgl ureb.