{"id":27402950,"url":"https://github.com/k1ngmar/libkm","last_synced_at":"2025-04-14T04:46:27.958Z","repository":{"id":50681825,"uuid":"517687326","full_name":"K1ngmar/libkm","owner":"K1ngmar","description":"📚 Libc rewrite","archived":false,"fork":false,"pushed_at":"2023-11-16T15:27:44.000Z","size":179,"stargazers_count":4,"open_issues_count":4,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-06T21:50:05.452Z","etag":null,"topics":["c","libc","libft","library"],"latest_commit_sha":null,"homepage":"","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/K1ngmar.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"License","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2022-07-25T13:57:33.000Z","updated_at":"2023-05-06T10:52:24.000Z","dependencies_parsed_at":"2023-11-16T16:46:12.766Z","dependency_job_id":null,"html_url":"https://github.com/K1ngmar/libkm","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/K1ngmar%2Flibkm","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/K1ngmar%2Flibkm/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/K1ngmar%2Flibkm/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/K1ngmar%2Flibkm/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/K1ngmar","download_url":"https://codeload.github.com/K1ngmar/libkm/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248824667,"owners_count":21167343,"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":["c","libc","libft","library"],"created_at":"2025-04-14T04:46:26.928Z","updated_at":"2025-04-14T04:46:27.946Z","avatar_url":"https://github.com/K1ngmar.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# 📚libkm\nInspired by the 42 project Libft where we had to rewrite a bunch of libc functions with a couple additional ones, this project improves upon my libft and aims to be safer, cleaner, more complete and performant!\n\n## 📥 Install\n```bash\n# clone the repository\n$ git clone https://github.com/K1ngmar/libkm.git\n\n# build the repo\n$ make -C libkm\n\n# link the headers with\n$ cc -o $SOURCE -I$LIBKM_LOCATION/includes\n\n# link it with your project\n$ cc -o $OBJECTS -L$LIBKM_LOCATION/libkm.a -lkm\n```\n\n## 🐳 Test on ubuntu with docker\n```bash\n# build the image\n$ docker build -t ubuntu_test tests\n\n# run the image\n$ docker run -it -v $PWD:/libkm ubuntu_test\n```\n\n## 📦 CONTENTS\nAll the functionality contained in the library!\n- [Containers](#-containers)\n- [IO](#-io)\n- [String](#-string)\n- [Memory](#-memory)\n- [Sys](#-sys)\n- [Additional](#-additional)\n\n## 🫙 Containers:\n**Vector**  \nLike in c++ this vector is templated, only you have to register the types yourself using macros\n\u003e For a more detailed description of vector check out [this!](https://github.com/K1ngmar/libkm/blob/main/includes/libkm/containers/vector.h)\n\nHere is a quick example on how to create a vector of type int\n```c++\n#include \"libkm/containers/vector.h\"\n\n// put this in the .h \nREGISTER_KM_VECTOR_PROTOTYPES(int, integer)\n\n// put this in the .c\nREGISTER_KM_VECTOR_SOURCE(int, integer)\n\n//after registering the vector you can initialise it like this:\nkm_vector_integer_initialise(\u0026vec, NULL, NULL);\n\n// and destroy it like this\nkm_vector_integer_destroy(\u0026vec);\n```\n\n## 🧬 IO:\n**Printf family**\n\u003e For a more detailed description of the printf family check out [this!](https://github.com/K1ngmar/libkm/blob/main/includes/libkm/io/printf.h)\n- km_dprintf()\n- km_printf()\n- km_sprintf()\n- km_snprintf()\n\n**Get delim**\n\u003e For a more detailed description of the getdelim functions check out [this!](https://github.com/K1ngmar/libkm/blob/main/includes/libkm/io/getdelim.h)\n- getdelim\n- getline\n\n## 📖 String:\n**Ascii to integral conversions**\n\u003e For a more detailed description of the integral conversions check out [this!](https://github.com/K1ngmar/libkm/blob/main/includes/libkm/string.h)\n- km_atoi()\n- km_atol()\n- km_strtoll()\n- km_strtol()\n\n**String**\n\u003e For a more detailed description of the string functions check out [this!](https://github.com/K1ngmar/libkm/blob/main/includes/libkm/string.h#L110)\n- km_strlcpy()\n- km_strlcat()\n- km_toupper()\n- km_tolower()\n- km_strchr()\n- km_strrchr()\n- km_strcmp()\n- km_strncmp()\n- km_strstr()\n- km_strnstr()\n- km_strcasestr()\n- km_strtok()\n- km_strdup()\n- km_strndup()\n- km_strlen()\n- km_strnlen()\n- km_isupper()\n- km_islower()\n- km_isalpha()\n- km_isdigit()\n- km_isascii()\n- km_isprint()\n\n## 🃏 Memory:\n\u003e For a more detailed description of the memory functions checkout [this!](https://github.com/K1ngmar/libkm/blob/main/includes/libkm/memory.h)\n- km_memmove()\n- km_bzero()\n- km_calloc()\n- km_stupid_realloc()\n- km_memchr()\n- km_memcmp()\n- km_memcpy()\n- km_memset()\n\n## 💽 Sys:\n\u003e For a more detailed description of the system functions checkout [this!](https://github.com/K1ngmar/libkm/blob/main/includes/libkm/sys/cacheline.h)\n- get_cache_line_size()\n\n## ➕ Additional:\n**IO**\n\u003e For a more detailed description about the additional IO functions checkout [this!](https://github.com/K1ngmar/libkm/blob/main/includes/libkm/additional/io.h)\n- km_putchar_fd()\n- km_putstr_fd()\n- km_putendl_fd()\n- km_putnbr_fd()\n\n**String**\n\u003e For a more detailed description about the additional String functions checkout [this!](https://github.com/K1ngmar/libkm/blob/main/includes/libkm/additional/string.h)\n- km_substr()\n- km_strjoin()\n- km_safe_strjoin()\n- km_strtrim()\n- km_ltoa()\n- km_itoa()\n- km_strmapi()\n- km_striteri()\n- km_split()\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fk1ngmar%2Flibkm","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fk1ngmar%2Flibkm","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fk1ngmar%2Flibkm/lists"}