{"id":20078798,"url":"https://github.com/nasso/libmy","last_synced_at":"2026-06-13T09:02:24.971Z","repository":{"id":92714771,"uuid":"213651784","full_name":"nasso/libmy","owner":"nasso","description":"C library for my Epitech projects - you probably don't need this","archived":false,"fork":false,"pushed_at":"2021-02-04T18:25:04.000Z","size":378,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-02T13:14:51.511Z","etag":null,"topics":["c","epitech"],"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/nasso.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,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-10-08T13:38:35.000Z","updated_at":"2024-06-20T18:59:09.000Z","dependencies_parsed_at":"2023-03-21T03:32:59.783Z","dependency_job_id":null,"html_url":"https://github.com/nasso/libmy","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/nasso/libmy","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nasso%2Flibmy","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nasso%2Flibmy/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nasso%2Flibmy/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nasso%2Flibmy/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nasso","download_url":"https://codeload.github.com/nasso/libmy/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nasso%2Flibmy/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34278154,"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-13T02:00:06.617Z","response_time":62,"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":["c","epitech"],"created_at":"2024-11-13T15:16:44.018Z","updated_at":"2026-06-13T09:02:24.957Z","avatar_url":"https://github.com/nasso.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# libmy\n\nPersonal library for my [EPITECH](https://www.epitech.eu) projects.\n\n## Demo\n\n```c\n#include \"my/my.h\"\n#include \"my/collections/hash_map.h\"\n\n// Demonstrate the use of the OPT(T) type\nstatic OPT(f64) safe_div(f64_t a, f64_t b)\n{\n    if (b == 0)\n        return (NONE(f64));\n    return (SOME(f64, a / b));\n}\n\n// Put arguments in a hash map\nint main(int ac, char **av) {\n    hash_map_t *args = hash_map_new();\n    char *foo = NULL;\n\n    for (usize_t i = 1; i + 1 \u003c ac; i += 2)\n        hash_map_insert(args, av[i], av[i + 1]);\n    foo = hash_map_get(args, \"foo\");\n    if (foo)\n        my_printf(\"foo: %s\\n\", foo);\n    hash_map_destroy(args);\n    return (0);\n}\n```\n\n## Features\n\n### Obvious primitive data type definitions:\n- `[iu](8|16|32|64|size)_t`: integer data types (`u8_t`, `i32_t`, ...)\n- `f(32|64)_t`: floating point data types (e.g. an `f32_t` is just a `float`)\n- `\u003cprimitive\u003e_(min|max)`: `min` and `max` functions for any primitive\n\n### Additionnal useful generic data types:\n- `OPT(T)`: similar to Rust's `Option\u003cT\u003e` or Haskell's `Maybe T`\n- `RES(T, E)`: similar to Rust's `Result\u003cT, E\u003e`\n- `OPT(\u003cprimitive\u003e)`: `OPT(T)` for all primitives!!\n- `RC(T)`: (R)eference (C)ounting primitive; similar to C++'s `std::shared_ptr`\n\n### Wrappers for standard functions to avoid `\"banned function used\"` errors:\n- `my_malloc`, `my_free` and `my_calloc`\n- `my_memcpy`, `my_memmove` and `my_memset`\n- `my_open` and `my_close`\n- `my_read` and `my_write`\n\n### General purpose collections:\n- `vector_t`: a continuous growable array (copies the elements' data)\n- `list_t`: circular doubly linked list (stores pointers to elements)\n- `hash_map_t`: an hash table implementation (stores pointers to elements)\n\n### Formatting utilities:\n- `my_printf`: yeah (no support for floating point data types yet tho)\n- `my_format`: format a string to a newly allocated `char *`\n\n### Buffered IO helpers:\n- `bufreader_t`: abstract buffered input stream\n- `bufwriter_t`: abstract buffered output stream\n- `filereader_t`: implementation of `bufreader_t` around a file descriptor\n- `filewriter_t`: implementation of `bufwriter_t` around a file descriptor\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnasso%2Flibmy","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnasso%2Flibmy","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnasso%2Flibmy/lists"}