{"id":28042321,"url":"https://github.com/nabilac27/42-libft","last_synced_at":"2025-05-11T14:26:06.343Z","repository":{"id":258674527,"uuid":"870224402","full_name":"nabilac27/42-libft","owner":"nabilac27","description":"First 42 School Project: Creating my own library in C","archived":false,"fork":false,"pushed_at":"2025-04-10T02:22:58.000Z","size":1727,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-10T03:28:27.199Z","etag":null,"topics":["dynamic-memory-allocation","error-handling","linked-list","memory-management","string-manipulation"],"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/nabilac27.png","metadata":{"files":{"readme":"docs/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-09T16:53:42.000Z","updated_at":"2025-04-10T02:23:01.000Z","dependencies_parsed_at":null,"dependency_job_id":"f5a552da-5031-4577-9795-213d70b58c25","html_url":"https://github.com/nabilac27/42-libft","commit_stats":null,"previous_names":["nabilac27/libft","nabilac27/42-libft"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nabilac27%2F42-libft","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nabilac27%2F42-libft/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nabilac27%2F42-libft/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nabilac27%2F42-libft/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nabilac27","download_url":"https://codeload.github.com/nabilac27/42-libft/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253578775,"owners_count":21930599,"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":["dynamic-memory-allocation","error-handling","linked-list","memory-management","string-manipulation"],"created_at":"2025-05-11T14:26:05.697Z","updated_at":"2025-05-11T14:26:06.335Z","avatar_url":"https://github.com/nabilac27.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# **libft**\n\nThis repository contains my implementation of the **42 Libft** project, \na custom C library that replicates essential standard C library functions. \n\nIt includes fundamental utilities for memory management, string manipulation, and more, \nacting as a core building block for many **42** projects.\n\n## **Key Features**:\n- **Memory Management**: Functions such as `malloc`, `free`, and `calloc` for dynamic memory handling.\n- **String Manipulation**: Key string functions like `strlen`, `strcpy`, `strcmp`, etc.\n- **Utility Functions**: Various helper functions for a wide range of operations.\n\nThis project is designed to help strengthen understanding of C programming, \nfocusing on low-level memory manipulation, pointer management, and efficient coding practices.\n\n---\n\n## **Functions Overview**\n### **Libc Functions `\u003cctype.h\u003e`**\n\n| **Function** | **Description** |\n|--------------|-----------------|\n| `ft_isalpha(int i)` | Checks if the character is an alphabetic letter (A-Z or a-z). |\n| `ft_isdigit(int i)` | Checks if the character is a digit (0-9). |\n| `ft_isalnum(int i)` | Checks if the character is alphanumeric (a letter or a digit). |\n| `ft_isascii(int i)` | Checks if the character is an ASCII character. |\n| `ft_isprint(int i)` | Checks if the character is printable (including space). |\n| `ft_toupper(int i)` | Converts a lowercase letter to uppercase. |\n| `ft_tolower(int i)` | Converts an uppercase letter to lowercase. |\n\n### **Libc Functions: `\u003cstring.h\u003e`**\n\n| **Function** | **Description** |\n|--------------|-----------------|\n| `ft_strlen(const char *str)` | Returns the length of the string (excluding the null-terminator). |\n| `ft_memset(void *ptr, int value, size_t num)` | Fills the first `num` bytes of the memory area pointed to by `ptr` with the value `value`. |\n| `ft_bzero(void *ptr, size_t n)` | Sets the first `n` bytes of the memory area pointed to by `ptr` to zero. |\n| `ft_memcpy(void *dest, const void *src, size_t n)` | Copies `n` bytes from memory area `src` to memory area `dest`. |\n| `ft_memmove(void *dst, const void *src, size_t len)` | Moves `len` bytes from memory area `src` to memory area `dst`. Handles overlap. |\n| `ft_strlcpy(char *restrict dst, const char *restrict src, size_t dstsize)` | Copies up to `dstsize - 1` characters from `src` to `dst` and null-terminates the result. |\n| `ft_strlcat(char *restrict dst, const char *restrict src, size_t dstsize)` | Appends `src` to the end of `dst` while ensuring no overflow (null-terminated). |\n| `ft_strchr(const char *ptr_string, int ptr_find)` | Returns a pointer to the first occurrence of `ptr_find` in `ptr_string`. |\n| `ft_strrchr(const char *ptr_string, int ptr_find)` | Returns a pointer to the last occurrence of `ptr_find` in `ptr_string`. |\n| `ft_strncmp(const char *s1, const char *s2, size_t n)` | Compares up to `n` characters of two strings. |\n| `ft_memchr(const void *ptr_src, int ptr_find, size_t n)` | Scans the first `n` bytes of `ptr_src` for the first occurrence of `ptr_find`. |\n| `ft_memcmp(const void *s1, const void *s2, size_t n)` | Compares the first `n` bytes of memory areas `s1` and `s2`. |\n| `ft_strnstr(const char *haystack, const char *needle, size_t len)` | Finds the first occurrence of `needle` in `haystack`, within `len` characters. |\n| `ft_strdup(const char *s1)` | Duplicates the string `s1`, allocating memory for the new string. |\n\n### **Libc Functions: `\u003cstdlib.h\u003e`**\n\n| **Function** | **Description** |\n|--------------|-----------------|\n| `ft_atoi(const char *str)` | Converts the string `str` to an integer. |\n| `ft_calloc(size_t count, size_t size)` | Allocates memory for `count` elements, each of size `size`, and initializes it to zero. |\n\n### **Additional Functions**\n\n| **Function** | **Description** |\n|--------------|-----------------|\n| `ft_substr(char const *s, unsigned int start, size_t len)` | Returns a substring from `s`, starting at `start` with a length of `len`. |\n| `ft_strjoin(char const *s1, char const *s2)` | Concatenates `s1` and `s2` into a new string. |\n| `ft_strtrim(char const *s1, char const *set)` | Trims characters from both ends of `s1` that are present in `set`. |\n| `ft_split(char const *s, char c)` | Splits the string `s` into an array of strings, using `c` as the delimiter. |\n| `ft_itoa(int n)` | Converts the integer `n` to a string. |\n| `ft_strmapi(char const *s, char (*f)(unsigned int, char))` | Applies the function `f` to each character of `s`, returning a new string. |\n| `ft_striteri(char *s, void (*f)(unsigned int, char *))` | Applies the function `f` to each character of `s` (in place). |\n| `ft_putchar_fd(char c, int fd)` | Writes the character `c` to the file descriptor `fd`. |\n| `ft_putstr_fd(char *s, int fd)` | Writes the string `s` to the file descriptor `fd`. |\n| `ft_putendl_fd(char *s, int fd)` | Writes the string `s` followed by a newline to the file descriptor `fd`. |\n| `ft_putnbr_fd(int n, int fd)` | Writes the integer `n` to the file descriptor `fd`. |\n\n\n---\n\n## **libft_v2** - Enhanced Version\n\nThis repository contains my **enhanced version of Libft**, \nwhich builds on the original **42 Libft** by adding extra utilities and functionalities \ntailored to the more complex requirements of **42 projects**.\n\n## **Key Additions**:\n- **`ft_printf`**: A custom implementation of the `printf` function for formatted output.\n- **`get_next_line`**: A function to read lines from a file descriptor efficiently.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnabilac27%2F42-libft","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnabilac27%2F42-libft","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnabilac27%2F42-libft/lists"}