{"id":23289656,"url":"https://github.com/mathyscogne/42_libft","last_synced_at":"2025-10-10T00:45:08.379Z","repository":{"id":261246558,"uuid":"872009151","full_name":"MathysCogne/42_libft","owner":"MathysCogne","description":"Essential C library functions, including the standard library, and additional utilities","archived":false,"fork":false,"pushed_at":"2024-11-15T15:48:02.000Z","size":1776,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-12-20T04:17:32.668Z","etag":null,"topics":["42","libft"],"latest_commit_sha":null,"homepage":"","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/MathysCogne.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-10-13T14:54:21.000Z","updated_at":"2024-11-18T18:19:24.000Z","dependencies_parsed_at":"2024-11-05T14:43:13.189Z","dependency_job_id":"12c1fad0-67fe-4b96-81df-13e061186194","html_url":"https://github.com/MathysCogne/42_libft","commit_stats":null,"previous_names":["mathyscogne/42_libft"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MathysCogne%2F42_libft","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MathysCogne%2F42_libft/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MathysCogne%2F42_libft/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MathysCogne%2F42_libft/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/MathysCogne","download_url":"https://codeload.github.com/MathysCogne/42_libft/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":238563732,"owners_count":19492975,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["42","libft"],"created_at":"2024-12-20T04:17:34.755Z","updated_at":"2025-10-10T00:45:03.339Z","avatar_url":"https://github.com/MathysCogne.png","language":"C","readme":"\u003ca name=\"readme-top\"\u003e\u003c/a\u003e\n\u003cdiv align=\"center\"\u003e\n\n\u003ch1\u003e\u003cimg src=\"subject/banner.png\" alt=\"42 Libft\" width=\"700\" /\u003e\u003c/h1\u003e\n\u003ch3\u003e\u003cstrong\u003eYour personal C library\u003c/strong\u003e\u003c/h3\u003e\n\u003cp\u003e\u003ca href=\"https://github.com/MathysCogne/42_libft/blob/main/subject/subject_libft.pdf\"\u003e\u003cstrong\u003eSubject\u003c/strong\u003e\u003c/a\u003e\u003c/p\u003e\n\u003c/br\u003e\n\u003c/div\u003e\n\nThis repository contains my implementations of essential C library functions, including the standard library, and additional utilities.\n\nExplore my complete library, which includes Libft, Extra, Printf, and Get Next Line (GNL) here: [MyLibft_GNL_Printf](https://github.com/MathysCogne/MyLibft_GNL_Printf).\n\n\n\u003c/br\u003e\n\n## Standard Library Functions\n\n| **Function**                     | **Description**                                                                                     | **Usage**                                         |\n|----------------------------------|-----------------------------------------------------------------------------------------------------|--------------------------------------------------|\n| `void ft_bzero(void *s, size_t n)` | Sets the first `n` bytes of the memory area pointed to by `s` to zero.                           | `ft_bzero(buffer, size);`                        |\n| `void *ft_calloc(size_t count, size_t size)` | Allocates memory for an array of `count` elements of `size` bytes and initializes it to zero.    | `void *array = ft_calloc(count, size);`         |\n| `void *ft_memchr(const void *mem, int c, size_t size)` | Locates the first occurrence of `c` in the first `size` bytes of the memory area pointed to by `mem`. | `ft_memchr(mem, 'A', size);`                     |\n| `int ft_memcmp(const void *s1, const void *s2, size_t n)` | Compares the first `n` bytes of memory areas `s1` and `s2`.                                      | `int result = ft_memcmp(s1, s2, n);`            |\n| `void *ft_memcpy(void *dest, const void *src, size_t n)` | Copies `n` bytes from memory area `src` to memory area `dest`.                                    | `ft_memcpy(dest, src, size);`                   |\n| `void *ft_memmove(void *dest, const void *src, size_t n)` | Moves `n` bytes from memory area `src` to memory area `dest`, handling overlapping regions.      | `ft_memmove(dest, src, size);`                  |\n| `void *ft_memset(void *s, int c, size_t n)` | Fills the first `n` bytes of the memory area pointed to by `s` with the constant byte `c`.        | `ft_memset(buffer, 'A', size);`                 |\n| `size_t ft_strlen(const char *s)`  | Calculates the length of the string `s`, not including the null terminator.                       | `size_t len = ft_strlen(\"Hello\");`               |\n| `char *ft_strdup(const char *src)` | Returns a pointer to a new string which is a duplicate of the string `src`.                       | `char *dup = ft_strdup(\"Hello\");`                |\n| `char *ft_strchr(const char *string, int find)` | Locates the first occurrence of `find` in `string`.                                               | `char *ptr = ft_strchr(\"Hello\", 'e');`          |\n| `char *ft_strjoin(char const *s1, char const *s2)` | Allocates and returns a new string which is the result of the concatenation of `s1` and `s2`.     | `char *result = ft_strjoin(\"Hello\", \" World\");` |\n| `size_t ft_strlcat(char *dest, const char *src, size_t size)` | Appends the `src` string to `dest`, ensuring to not exceed `size` total.                         | `ft_strlcat(dest, src, size);`                  |\n| `size_t ft_strlcpy(char *dest, const char *src, size_t size)` | Copies the string `src` to `dest`, with size limit.                                               | `size_t copied = ft_strlcpy(dest, src, size);`  |\n| `int ft_atoi(const char *str)`    | Converts the string `str` to an integer.                                                           | `int num = ft_atoi(\"42\");`                        |\n| `int ft_isalpha(int character)`   | Checks if `character` is an alphabetic character.                                                  | `int is_alpha = ft_isalpha('A');`                |\n| `int ft_isalnum(int character)`   | Checks if `character` is alphanumeric.                                                             | `int is_alnum = ft_isalnum('4');`                |\n| `int ft_isdigit(int character)`   | Checks if `character` is a digit.                                                                   | `int is_digit = ft_isdigit('4');`                |\n| `int ft_isascii(int character)`   | Checks if `character` is an ASCII character.                                                       | `int is_ascii = ft_isascii('A');`                |\n| `int ft_isprint(int character)`   | Checks if `character` is a printable character.                                                    | `int is_print = ft_isprint(' ');`                |\n| `char *ft_itoa(int n)`           | Converts an integer to a string.                                                                    | `char *str = ft_itoa(42);`                       |\n| `void ft_putchar_fd(char c, int fd)` | Outputs the character `c` to the file descriptor `fd`.                                            | `ft_putchar_fd('A', 1);`                         |\n| `void ft_putstr_fd(char *s, int fd)` | Outputs the string `s` to the file descriptor `fd`.                                               | `ft_putstr_fd(\"Hello\", 1);`                      |\n| `void ft_putendl_fd(char *s, int fd)` | Outputs the string `s` followed by a newline to the file descriptor `fd`.                          | `ft_putendl_fd(\"Hello\", 1);`                     |\n| `void ft_putnbr_fd(int n, int fd)` | Outputs the integer `n` to the file descriptor `fd`.                                              | `ft_putnbr_fd(42, 1);`                           |\n| `char **ft_split(char const *s, char c)` | Splits a string into an array of strings based on a delimiter `c`.                                 | `char **array = ft_split(\"Hello World\", ' ');`  |\n| `char *ft_striteri(char *s, void (*f)(unsigned int, char *))` | Applies the function `f` to each character of the string `s`.                                      | `ft_striteri(str, function);`                    |\n| `char *ft_strmapi(char *s, char (*f)(unsigned int, char))` | Applies the function `f` to each character of the string `s` and returns a new string.            | `char *new_str = ft_strmapi(str, function);`    |\n| `char *ft_strrchr(const char *string, int find)` | Locates the last occurrence of `find` in `string`.                                                | `char *ptr = ft_strrchr(\"Hello\", 'o');`         |\n| `char *ft_strtrim(char const *s1, char const *set)` | Removes the characters in `set` from the beginning and end of `s1`.                               | `char *trimmed = ft_strtrim(\"!!Hello!!\", \"!\");` |\n| `int ft_strncmp(const char *s1, const char *s2, size_t n)` | Compares the first `n` characters of the strings `s1` and `s2`.                                   | `int cmp = ft_strncmp(s1, s2, n);`               |\n| `char *ft_strnstr(const char *haystack, const char *needle, size_t len)` | Locates the first occurrence of `needle` in `haystack` within `len` bytes.                       | `char *ptr = ft_strnstr(haystack, needle, len);` |\n| `char *ft_substr(char const *s, unsigned int start, size_t len)` | Allocates and returns a substring from `s`, starting at `start`, of length `len`.                 | `char *sub = ft_substr(s, start, len);`         |\n| `int ft_tolower(int c)`         | Converts `c` to lowercase if it is an uppercase letter.                                             | `int lower = ft_tolower('A');`                   |\n| `int ft_toupper(int c)`         | Converts `c` to uppercase if it is a lowercase letter.                                             | `int upper = ft_toupper('a');`                   |\n\n## Linked List Functions\n\n| **Function**                     | **Description**                                                                                     | **Usage**                                         |\n|----------------------------------|-----------------------------------------------------------------------------------------------------|--------------------------------------------------|\n| `t_list *ft_lstnew(void *content)` | Allocates and returns a new node with the given `content`.                                        | `t_list *new_node = ft_lstnew(content);`        |\n| `void ft_lstadd_front(t_list **lst, t_list *new)` | Adds the node `new` at the beginning of the list `lst`.                                          | `ft_lstadd_front(\u0026head, new_node);`             |\n| `void ft_lstadd_back(t_list **lst, t_list *new)` | Adds the node `new` at the end of the list `lst`.                                                | `ft_lstadd_back(\u0026head, new_node);`              |\n| `void ft_lstdelone(t_list *lst, void (*del)(void *))` | Deletes the node `lst` and frees its content using `del`.                                        | `ft_lstdelone(node, del_function);`              |\n| `void ft_lstclear(t_list **lst, void (*del)(void *))` | Deletes and frees all nodes of the list `lst` and sets the pointer to NULL.                      | `ft_lstclear(\u0026head, del_function);`              |\n| `void ft_lstiter(t_list *lst, void (*f)(void *))` | Applies the function `f` to each node of the list `lst`.                                         | `ft_lstiter(head, function);`                    |\n| `t_list *ft_lstmap(t_list *lst, void *(*f)(void *), void (*del)(void *))` | Applies the function `f` to each node and creates a new list with the results.                  | `t_list *new_list = ft_lstmap(head, function, del_function);` |\n\n\u003c/br\u003e\n\n## Disclaimer\n\u003e At 42 School, most projects must comply with the [Norm](https://github.com/42School/norminette/blob/master/pdf/en.norm.pdf).\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmathyscogne%2F42_libft","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmathyscogne%2F42_libft","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmathyscogne%2F42_libft/lists"}