{"id":20055211,"url":"https://github.com/khammerschmidt/42cursus-libft","last_synced_at":"2025-03-02T09:23:21.865Z","repository":{"id":227720833,"uuid":"417380450","full_name":"KHammerschmidt/42cursus-Libft","owner":"KHammerschmidt","description":"Writing my own library with standard functions in C.","archived":false,"fork":false,"pushed_at":"2022-12-10T20:21:54.000Z","size":110,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-01-12T21:32:58.603Z","etag":null,"topics":["library","linked-lists","makefile","memory-management","typecasting","void-pointers"],"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/KHammerschmidt.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}},"created_at":"2021-10-15T05:38:05.000Z","updated_at":"2022-12-07T13:41:39.000Z","dependencies_parsed_at":"2024-03-14T21:14:04.037Z","dependency_job_id":null,"html_url":"https://github.com/KHammerschmidt/42cursus-Libft","commit_stats":null,"previous_names":["khammerschmidt/42cursus-libft"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KHammerschmidt%2F42cursus-Libft","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KHammerschmidt%2F42cursus-Libft/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KHammerschmidt%2F42cursus-Libft/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KHammerschmidt%2F42cursus-Libft/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/KHammerschmidt","download_url":"https://codeload.github.com/KHammerschmidt/42cursus-Libft/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241483540,"owners_count":19970097,"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":["library","linked-lists","makefile","memory-management","typecasting","void-pointers"],"created_at":"2024-11-13T12:46:52.773Z","updated_at":"2025-03-02T09:23:21.773Z","avatar_url":"https://github.com/KHammerschmidt.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003ch1 align=\"center\"\u003e\n  \u003cimg  width=\"90\" src=\"https://user-images.githubusercontent.com/19689770/129336866-169b0dc7-ea41-47d4-b50a-d466508031af.png\"\u003e\n  \n\t🧰 libft\n \u003c/img\u003e\n\t\n\u003c/h1\u003e\n\u003c/br\u003e\n \n\n\u003cp align=\"center\"\u003e\n\t\u003cb\u003eDevelopment repo of my very own standard library\u003c/b\u003e\u003cbr\u003e\n\tStart date: 15/july/2021 \u003c/br\u003e\n\t\u003csub\u003e Project status: completed 122/100 points \u003csub\u003e\u003c/br\u003e\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n\t\u003cimg alt=\"Github repo size\" src=\"https://img.shields.io/github/repo-size/KHammerschmidt/Libft?color=turquoise\"/\u003e\n\t\u003cimg alt=\"Languages used in repo\" src=\"https://img.shields.io/github/languages/count/KHammerschmidt/Libft?color=red\u0026label=languages%20used%20in%20repo\"/\u003e\n\t\u003cimg alt=\"Top used progamming language\" src=\"https://img.shields.io/github/languages/top/KHammerschmidt/libft?color=purple\"/\u003e\t\n\u003c/p\u003e\n\n---\n\n## 💡 About the project\n\u003e The aim of this project is to re-code my own library with standard functions of the C library ```libc``` as well as some utility functions for memory and string manipulation. The bonus functions cover list manipulation.[^1]\n\u003c/br\u003e\n\n**Requirements**\n\nAll functions must have the same prototypes and implement the same behaviours as the originals. They must comply with the way they are defined in their man. All functions shall begin with the 'ft_' prefix.\n\n\u003c/br\u003e\n\n**Key learning points**\n  - Handling different variable types and memory allocation\n  - Passing on various types of input and typecasting void pointers\n  - Setting up a Makefile to compile my library\n  - Familiarise myself with linked lists\n\n\u003c/br\u003e\n\n## 📄 Functions\n\n### ▫️**Libc functions**\n##### Character type testing\n* [`ft_isalpha`](./src/ft_isalpha.c) - tests for alphabetic character\n* [`ft_isdigit`](./src/ft_isdigit.c) - tests for decimal-digit character\n* [`ft_isalnum`](./src/ft_isalnum.c) - tests for alphanumeric character\n* [`ft_isascii`](./src/ft_isascii.c) - tests for ASCII character\n* [`ft_isprint`](./src/ft_isprint.c) - tests for printable characters\n##### Printing utils\n* [`ft_toupper`](./src/ft_toupper.c) - converts lower case to upper case\n* [`ft_tolower`](./src/ft_tolower.c) - converts upper case to lower case\n* [`ft_putchar_fd`](./src/ft_putchar_fd.c) - writes one character to given file descriptor\n* [`ft_putstr_fd`](./src/ft_putstr_fd.c) - writes a string to the given file descriptor\n* [`ft_putendl_fd`](./src/ft_putendl_fd.c) - writes a string and newline to the given file descriptor \n* [`ft_putnbr_fd`](./src/ft_putnbr_fd.c) - writes an integer to the given file descriptor\n##### Memory area manipulation\n* [`ft_memset`](./src/ft_memset.c) - writes a byte to a byte string\n* [`ft_memmove`](./src/ft_memmove.c) - copies bytes from string to another\n* [`ft_memcpy`](./src/ft_memcpy.c) - copies bytes from src to dst memory area\n* [`ft_memchr`](./src/ft_memchr.c) - locates first occurence of byte in byte string\n* [`ft_memcmp`](./src/ft_memcmp.c) - compares two byte strings\n##### Memory allocation\n* [`ft_bzero`](./src/ft_bzero.c) - writes zeroed butes to a string \n* [`ft_calloc`](./src/ft_calloc.c) - allocates memory and fills it with zeroed \n##### String manipulation\n* [`ft_strlen`](./src/ft_strlen.c) - returns the length of a string\n* [`ft_strlcpy`](./src/ft_strlcpy.c) - size-bound string copying\n* [`ft_strlcat`](./src/ft_strlcat.c) - appends string src to string dst \n* [`ft_strchr`](./src/ft_strchr.c) - locates first occurence of a character in string\n* [`ft_strrchr`](./src/ft_strrchr.c) - locates last occurence of a character in string\n* [`ft_strncmp`](./src/ft_strncmp.c) - compares lexicographically two strings\n* [`ft_strnstr`](./src/ft_strnstr.c) - locates a substring in a string\n* [`ft_strdup`](./src/ft_strdup.c) - saves a copy of a string\n* [`ft_atoi`](./src/ft_atoi.c) - converts a string to integer representation\n\u003c/br\u003e\n\n### ▫️**Utility functions**\n* [`ft_substr`](./src/ft_substr.c) - returns a substring from string\n* [`ft_strjoin`](./src/ft_strjoin.c) - concatenates two strings\n* [`ft_strtrim`](./src/ft_strtrim.c) - trims a string in regards to a reference set\n* [`ft_split`](./src/ft_split.c) - splits a string and returns an array\n* [`ft_itoa`](./src/ft_itoa.c) - allocates and returns a string of an integer\n* [`ft_strmapi`](./src/ft_strmapi.c) - creates new string resulting from successive application of function to each character \n* [`ft_striteri`](./src/ft_striteri.c) - applies a function to each character of a string\n\u003c/br\u003e\n\n### ▫️**Bonus functions - linked lists**\n* [`ft_lstnew`](./src/ft_lstnew.c) - allocates a new initialised list element \n* [`ft_lstadd_front`](./src/ft_lstadd_front.c) - adds an element to the beginning of a list\n* [`ft_lstsize`](./src/ft_lstsize.c) - returns number of elements in list\n* [`ft_lstlast`](./src/ft_lstlast.c) - returns the last element of a list\n* [`ft_lstadd_back`](./src/ft_lstadd_back.c) - adds an elemenet to the end of a list\n* [`ft_lstdelone`](./src/ft_lstdelone.c) - frees an element's content and elemente itself\n* [`ft_lstclear`](./src/ft_lstclear.c) - deletes and frees the given element and every successor\n* [`ft_lstiter`](./src/ft_lstiter.c) - iterates list and applies function to elements\n\u003c/br\u003e\n\n### ▫️Added functions for usability in later projects\n* [`ft_free`](./src/ft_free.c) - Frees a strings' memory and sets it to NULL\n* [`ft_strnjoin`](./src/ft_strjoin.c) - concatenates two strings but no more than set bytes\n\u003c/br\u003e\n\n\n## 🛠️ **Usage**\n\n\nClone the repository:\n```bash\ngit clone https://github.com/KHammerschmidt/42cursus-Libft \u0026\u0026\ncd libft\n```\n\n\nCreate the library archive:\n```bash\nmake\n```\n\n\nAdd bonus functions to archive:\n```bash\nmake bonus\n```\n\n\nTo incoporate this library within a project add this line to your Makefile, adjust directory to project respectively.\n```bash\nmake -C $(LIBFT_DIR)\n```\n\n\n---\n[^1]: This repo does not pass the initial moulinette tests of Libft at École 42 due to added functions and changes required by later projects.\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkhammerschmidt%2F42cursus-libft","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkhammerschmidt%2F42cursus-libft","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkhammerschmidt%2F42cursus-libft/lists"}