{"id":51284840,"url":"https://github.com/yomazini/42cursus-libft","last_synced_at":"2026-06-30T04:30:55.686Z","repository":{"id":264932819,"uuid":"893520285","full_name":"yomazini/42cursus-libft","owner":"yomazini","description":"Libft project at 42 School | Custom C library featuring string manipulation, memory management, \u0026 linked list functions.","archived":false,"fork":false,"pushed_at":"2025-07-01T23:50:29.000Z","size":1599,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-07-02T00:25:59.091Z","etag":null,"topics":["1337","1337cursus","1337school","42school","c","libft","libft-42","libft42","linked-list","memory-management"],"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/yomazini.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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2024-11-24T16:51:15.000Z","updated_at":"2025-07-01T23:50:33.000Z","dependencies_parsed_at":"2025-01-02T17:17:30.293Z","dependency_job_id":null,"html_url":"https://github.com/yomazini/42cursus-libft","commit_stats":null,"previous_names":["yomazini/42cursus-libft"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/yomazini/42cursus-libft","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yomazini%2F42cursus-libft","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yomazini%2F42cursus-libft/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yomazini%2F42cursus-libft/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yomazini%2F42cursus-libft/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/yomazini","download_url":"https://codeload.github.com/yomazini/42cursus-libft/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yomazini%2F42cursus-libft/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34952850,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-30T02:00:05.919Z","response_time":92,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["1337","1337cursus","1337school","42school","c","libft","libft-42","libft42","linked-list","memory-management"],"created_at":"2026-06-30T04:30:52.566Z","updated_at":"2026-06-30T04:30:55.668Z","avatar_url":"https://github.com/yomazini.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# 📚 Libft | 42 School Project \n### Because real programmers don't use `string.h` 😉\n\n![42 School Badge](https://img.shields.io/badge/42-School-blue)\n![Score](https://img.shields.io/badge/Score-125%2F100-brightgreen)\n![Norminette](https://img.shields.io/badge/Norminette-passing-success)\n\n\u003e *\"Why use standard functions when you can build your own?\"* - Every 42 Student Ever 😄\n\n## 🎯 About the Project\n\nHey there! 👋 Welcome to my very first project at 42 School. This is `libft` - where I built my own C library from scratch (because apparently `printf` is too mainstream 😎).\n\nScored a sweet 125/100 by implementing not just the required functions, but also nailing all the bonus parts. Think of it as the Swiss Army knife of C functions that I'll be using throughout my 42 journey!\n\n## 🔍 Project Overview\n\nThis project consists of coding a C library. It contains a lot of general-purpose functions that will be a useful foundation for future 42 projects.\n\n### Mandatory part\n\n#### Part 1 - Libc functions\n| Function | Description | Prototype |\n|----------|-------------|-----------|\n| [ft_isalpha](ft_isalpha.c) | Check if character is alphabetic | `int ft_isalpha(int c)` |\n| [ft_isdigit](ft_isdigit.c) | Check if character is digit | `int ft_isdigit(int c)` |\n| [ft_isalnum](ft_isalnum.c) | Check if character is alphanumeric | `int ft_isalnum(int c)` |\n| [ft_isascii](ft_isascii.c) | Check if character is ASCII | `int ft_isascii(int c)` |\n| [ft_isprint](ft_isprint.c) | Check if character is printable | `int ft_isprint(int c)` |\n| [ft_strlen](ft_strlen.c) | Calculate length of string | `size_t ft_strlen(const char *s)` |\n| [ft_memset](ft_memset.c) | Fill memory with constant byte | `void *ft_memset(void *b, int c, size_t len)` |\n| [ft_bzero](ft_bzero.c) | Zero a byte string | `void ft_bzero(void *s, size_t n)` |\n| [ft_memcpy](ft_memcpy.c) | Copy memory area | `void *ft_memcpy(void *dst, const void *src, size_t n)` |\n| [ft_memmove](ft_memmove.c) | Copy memory area with overlap handling | `void *ft_memmove(void *dst, const void *src, size_t len)` |\n| [ft_strlcpy](ft_strlcpy.c) | Size-bounded string copying | `size_t ft_strlcpy(char *dst, const char *src, size_t dstsize)` |\n| [ft_strlcat](ft_strlcat.c) | Size-bounded string concatenation | `size_t ft_strlcat(char *dst, const char *src, size_t dstsize)` |\n| [ft_toupper](ft_toupper.c) | Convert char to uppercase | `int ft_toupper(int c)` |\n| [ft_tolower](ft_tolower.c) | Convert char to lowercase | `int ft_tolower(int c)` |\n| [ft_strchr](ft_strchr.c) | Locate character in string | `char *ft_strchr(const char *s, int c)` |\n| [ft_strrchr](ft_strrchr.c) | Locate character in string from end | `char *ft_strrchr(const char *s, int c)` |\n| [ft_strncmp](ft_strncmp.c) | Compare two strings | `int ft_strncmp(const char *s1, const char *s2, size_t n)` |\n| [ft_memchr](ft_memchr.c) | Scan memory for a character | `void *ft_memchr(const void *s, int c, size_t n)` |\n| [ft_memcmp](ft_memcmp.c) | Compare memory areas | `int ft_memcmp(const void *s1, const void *s2, size_t n)` |\n| [ft_strnstr](ft_strnstr.c) | Locate a substring in a string | `char *ft_strnstr(const char *haystack, const char *needle, size_t len)` |\n| [ft_atoi](ft_atoi.c) | Convert ASCII string to integer | `int ft_atoi(const char *str)` |\n| [ft_calloc](ft_calloc.c) | Allocate and zero-initialize array | `void *ft_calloc(size_t count, size_t size)` |\n| [ft_strdup](ft_strdup.c) | Create duplicate of string | `char *ft_strdup(const char *s1)` |\n\n#### Part 2 - Additional functions\n| Function | Description | Prototype |\n|----------|-------------|-----------|\n| [ft_substr](ft_substr.c) | Extract substring from string | `char *ft_substr(char const *s, unsigned int start, size_t len)` |\n| [ft_strjoin](ft_strjoin.c) | Concatenate two strings | `char *ft_strjoin(char const *s1, char const *s2)` |\n| [ft_strtrim](ft_strtrim.c) | Trim characters from string | `char *ft_strtrim(char const *s1, char const *set)` |\n| [ft_split](ft_split.c) | Split string using delimiter | `char **ft_split(char const *s, char c)` |\n| [ft_itoa](ft_itoa.c) | Convert integer to ASCII string | `char *ft_itoa(int n)` |\n| [ft_strmapi](ft_strmapi.c) | Apply function to string | `char *ft_strmapi(char const *s, char (*f)(unsigned int, char))` |\n| [ft_striteri](ft_striteri.c) | Apply function to string with index | `void ft_striteri(char *s, void (*f)(unsigned int, char*))` |\n| [ft_putchar_fd](ft_putchar_fd.c) | Output char to file descriptor | `void ft_putchar_fd(char c, int fd)` |\n| [ft_putstr_fd](ft_putstr_fd.c) | Output string to file descriptor | `void ft_putstr_fd(char *s, int fd)` |\n| [ft_putendl_fd](ft_putendl_fd.c) | Output string with newline to fd | `void ft_putendl_fd(char *s, int fd)` |\n| [ft_putnbr_fd](ft_putnbr_fd.c) | Output integer to file descriptor | `void ft_putnbr_fd(int n, int fd)` |\n\n#### Bonus Part - Linked List Functions\n| Function | Description | Prototype |\n|----------|-------------|-----------|\n| [ft_lstnew](ft_lstnew_bonus.c) | Create new list node | `t_list *ft_lstnew(void *content)` |\n| [ft_lstadd_front](ft_lstadd_front_bonus.c) | Add node at beginning | `void ft_lstadd_front(t_list **lst, t_list *new)` |\n| [ft_lstsize](ft_lstsize_bonus.c) | Count list elements | `int ft_lstsize(t_list *lst)` |\n| [ft_lstlast](ft_lstlast_bonus.c) | Get last node of list | `t_list *ft_lstlast(t_list *lst)` |\n| [ft_lstadd_back](ft_lstadd_back_bonus.c) | Add node at end | `void ft_lstadd_back(t_list **lst, t_list *new)` |\n| [ft_lstdelone](ft_lstdelone_bonus.c) | Delete node content | `void ft_lstdelone(t_list *lst, void (*del)(void *))` |\n| [ft_lstclear](ft_lstclear_bonus.c) | Delete and free list | `void ft_lstclear(t_list **lst, void (*del)(void *))` |\n| [ft_lstiter](ft_lstiter_bonus.c) | Apply function to list content | `void ft_lstiter(t_list *lst, void (*f)(void *))` |\n| [ft_lstmap](ft_lstmap_bonus.c) | Apply function and create new list | `t_list *ft_lstmap(t_list *lst, void *(*f)(void *), void (*del)(void *))` |\n\n## 🚀 Getting Started\n\n### Prerequisites\n- GCC compiler\n- Make\n- Git\n\n### Installation\n\n1. Clone the repository:\n```bash\ngit clone https://github.com/yomazini/42cursus-libft.git\n```\n\n2. Navigate to the project directory:\n```bash\ncd 42cursus-libft\n```\n\n3. Compile the library:\n```bash\n# Compile mandatory functions\nmake\n\n# Compile with bonus functions\nmake bonus\n\n# Clean object files\nmake clean\n\n# Clean everything (objects and library)\nmake fclean\n\n# Recompile everything\nmake re\n```\n\n## 💡 What I Learned\n\nThrough this project, I gained deep understanding of:\n\n- **Memory Management**: Deep dive into how memory works in C\n- **Data Structures**: Understanding and implementing linked lists\n- **Algorithm Optimization**: Writing efficient and optimized code\n- **String Manipulation**: Advanced string handling techniques\n- **Pointer Arithmetic**: Complex pointer manipulations and memory operations\n- **Code Organization**: Structuring a library project\n- **Documentation**: Writing clear and useful documentation\n\n## 🎯 Key Features\n\n- **Memory Safety**: All functions handle edge cases and prevent buffer overflows\n- **Performance**: Optimized for speed and efficiency\n- **Reliability**: Thoroughly tested against edge cases\n- **Compliance**: Follows 42's strict norm requirements\n- **Zero Memory Leaks**: Validated using `leaks`\n- **Well Documented**: Clear comments and documentation\n\n## 🧪 Testing\n\nThe library has been extensively tested using:\n- 42's unit tests\n- Custom test cases\n- War Machine\n- Tripouille tester\n- Manual edge case testing\n\n\n## 📂 Project Structure\n\n```\n.\n├── Makefile\n├── README.md\n├── libft.h\n├── ft_atoi.c\n├── ft_memset.c\n├── ft_split.c\n├── ft_lstnew_bonus.c\n├── ft_lstmap_bonus.c\n└── ...\n\n```\n\n## 🛠️ Usage Example\n\n```c\n#include \"libft.h\"\n\nint main(void)\n{\n    // String manipulation\n    char *str = ft_strdup(\"Hello, 42!\");\n    printf(\"Length: %zu\\n\", ft_strlen(str));\n\n    // Linked list\n    t_list *lst = ft_lstnew(str);\n    ft_lstadd_back(\u0026lst, ft_lstnew(\"World!\"));\n\n    // Memory operations\n    char buffer[10];\n    ft_memset(buffer, 'A', 9);\n    buffer[9] = '\\0';\n\n    return (0);\n}\n```\n\nThis will link the library file to your program. Zhich allow you to use the functions in the library.\n\n```bash\ngcc -o my_program my_program.c -L. -lft\n```\n\n-----\n\n## 🎭 Author\n\nMade with 💖 and ☕️ by Youssef Mazini (ymazini)\n- 42 Intra: [ymazini](https://profile.intra.42.fr/users/ymazini)\n- GitHub: [yomazini](https://github.com/yomazini)\n\n## 🌟 Final Tips\n\n1. \"Practice makes perfect, but perfect practice makes perfect permanent!\"\n2. Document your code as if the next maintainer is a psychopath who knows where you live\n3. Test your code like your life depends on it (because your grades do!)\n4. Keep your code clean, your mind sharp, and your coffee strong\n5. Remember: A working function is good, but a well-documented, efficient, and clean function is better!\n\n---\n\n\u003e *\"In code we trust, but tests we must!\"* 😄\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyomazini%2F42cursus-libft","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fyomazini%2F42cursus-libft","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyomazini%2F42cursus-libft/lists"}