SkillAgentSearch skills...

Libft

An open source standard C library that includes useful functions (Refactoring some libc functions + our own functions).

Install / Use

/learn @ablaamim/Libft
About this skill

Quality Score

0/100

Supported Platforms

Universal

README


:book: LIBFT-42 :


</p> <p align="center"> <img src="https://github.com/ablaamim/LIBFT-42/blob/main/ressources/libftm.png" width="150"> </p>

:coffee: Artistic view of your LIBFT :


</p> <p align="center"> <img src="https://www.iamsterdam.com/media/locations-ndtrc/museums/rijksmuseum-library-cc-bynd-20-hans-splinter-via-flickr.jpg?w=977" width="800"> </p>

:performing_arts: HOW DOES IT FEEL ?


</p> <p align="center"> <img src="http://2.bp.blogspot.com/-bBJeRPdPd9M/UfYBsNF2ffI/AAAAAAAADnk/_qqet8O6rvo/s1600/library%2Bcard2.gif" width="800"> </p>

Subject :


:book: ENGLISH PDF


:information_source: What exactly is LIBFT ?


</p> <p align="center"> <img src="https://github.com/ablaamim/libft/blob/main/ressources/Libft.png" width="500"> </p>

This project aims to code a C library regrouping usual functions that you’ll be allowed to use in all your other projects.


:wrench: :wrench: Mandatory parts [part I] [part II] :


<h3 align=center> Part I : </h3>
</p> <p align="center"> <img src="https://media3.giphy.com/media/PiQejEf31116URju4V/giphy.gif?cid=790b76118ba41a4e1b4161c3938a263d41c72d85f85788ca&amp;rid=giphy.gif&amp;ct=g" width="500"> </p>

<i>In this first part, you must re-code a set of the libc functions, as defined in their man. Your functions will need to present the same prototype and behaviors as the originals. Your functions’ names must be prefixed by “ft_”. For instance strlen becomes ft_strlen.</i>

<p align=center>

| # | Assignement name | Description | |---|--- |--- | | | libft.h | Contains all prototypes of functions and structures. |


| FUNCTION | Allowed functions | Prototype | Description | Library | |--- |--- |--- |--- |--- | | • isalpha() | NONE | int ft_isalpha (int c) | Checks for an alphabetic character. | <ctype.h> | | • isdigit() | NONE | int ft_isdigit (int c) | Checks for a digit (0 through 9). | <ctype.h> | | • isalnum() | NONE | int ft_isalnum (int c) | Checks for an alphanumeric character. | <ctype.h> | | • isascii() | NONE | int ft_isascii (int c) | Checks whether c fits into the ASCII character set. | <ctype.h> | | • isprint() | NONE | int ft_isprint (int c) | Checks for any printable character. | <ctype.h> | | • strlen() | NONE | size_t strlen(const char *s) | Calculate the length of a string. | <string.h> | | • memset() | NONE | void *ft_memset(void *b, int c, size_t len) | Fill memory with a constant byte. | <string.h> | | • bzero() | NONE | void ft_bzero(void *s, size_t n) | Zero a byte string. | <string.h> | | • memcpy() | NONE | void *ft_memcpy(void *dest, const void *src, size_t n) | Copy memory area. | <string.h> | | • memmove() | NONE | void *ft_memmove(void *dst, const void *src, size_t len) | Function copies n bytes from memory area src to memory area dest. | <string.h> | | • strlcpy() | NONE | size_t ft_strlcpy(char *dst, const char *src, size_t dstlen) | Copy string to a specific size. | <string.h> | | • strlcat() | NONE | size_t ft_strlcat(char *dst, const char *src, size_t dstsize) | Concatenate string to a specific size. | <string.h> | | • toupper() | NONE | int ft_toupper(int c) | Convert chat to uppercase | <ctype.h> | | • tolower() | NONE | int ft_tolower(int c) | Convert char to lowercase. | <ctype.h> | | • strchr() | NONE | char *ft_strchr(const char *s, int c) | Locate character in string (first occurrence). | <string.h> | | • strrchr() | NONE | char *ft_strrchr(const char *s, int c) | Locate character in string (last occurrence). | <string.h> | | • strncmp() | NONE | int ft_strncmp(const char *s1, const char *s2, size_t n) | Compare n bytes of two strings. | <string.h> | | • memchr() | NONE | void *ft_memchr(const void *s, int c, size_t n) | Scan memory for a character. | <string.h> | | • memcmp() | NONE | int ft_memcmp(const void *s1, const void *s2, size_t n) | Compare memory areas. | <string.h> | | • strnstr() | NONE | char *ft_strnstr(const char *haystack, const char *needle, size_t len) | Locate a substring in a string. | <string.h> | | • atoi() | NONE | int ft_atoi(const char *s) | | <stdlib.h> |


</p> <p align="center"> <img src="https://postcoitum429456745.files.wordpress.com/2018/10/mao_rtfm_vectorize_by_cmenghi.png" width="500"> </p>

The legend says : "READ THE FUCKING MANUAL." X) !


| # | FUNCTION | MANUAL | |--- |--- |--- | | | • isalpha | man | | | • isdigit | man | | | • isalnum | man | | | • isascii | man | | | • strlen | man | | | • memset | man | | | • bzero | man | | | • memcpy | man | | | • memmove | man | | | • strlcpy | man | | | • strlcat | man | | | • toupper | man | | | • tolower | man | | | • strchr | man | | | • strncmp() | man | | | • memchr() | man | | | • memcmp() | man | | | • strnstr() | man | | | • atoi() | man |


</p>

You must also re-code the following functions, using the function “malloc”:

| Function | Allowed function | Prototype | Description | Manual | |--- |--- |--- |--- |--- | | •strdup | malloc() | char *ft_strdup(const char *s) | Duplicate a string. | man | | • calloc | malloc() | void *ft_calloc(size_t count, size_t size); | Allocate memory by filling it with zeros. | man |


:wrench: :factory: Additional functions :


<h3 align=center> Part II : </h3>
</p> <p align="center"> <img src="https://c.tenor.com/uYqsM9uIyuYAAAAS/simple-easy.gif" width="500"> </p>

<i>In this second part, you must code a set of functions that are either not included in the libc, or included in a different form. Some of these functions can be useful to write Part 1’s functions.</i>

<p align=center>

| FUNCTION | BEHAVIOR | |--- |--- | | - ft_substr | - returns a substring from a string | | - ft_strjoin.c | - concatenates two strings | | - ft_strtrim.c | - trims the beginning and end of string with specific set of chars | | -

Related Skills

View on GitHub
GitHub Stars11
CategoryDevelopment
Updated6mo ago
Forks0

Languages

C

Security Score

67/100

Audited on Sep 27, 2025

No findings