{"id":19878536,"url":"https://github.com/dezashibi-c/dcommon","last_synced_at":"2025-10-15T16:29:30.411Z","repository":{"id":258150904,"uuid":"854003008","full_name":"dezashibi-c/dcommon","owner":"dezashibi-c","description":"My commonly used utilities, headers, scripts, etc.","archived":false,"fork":false,"pushed_at":"2025-07-04T06:08:39.000Z","size":315,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-07-04T07:21:24.663Z","etag":null,"topics":["c","data-structures","dynamic-values","helpers","scripts","utilities"],"latest_commit_sha":null,"homepage":"","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dezashibi-c.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGE_LOGS.md","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":"2024-09-08T06:10:23.000Z","updated_at":"2025-07-04T06:08:42.000Z","dependencies_parsed_at":"2024-10-25T07:18:32.029Z","dependency_job_id":"2c1c2c97-b624-468c-b766-5e77869d6aab","html_url":"https://github.com/dezashibi-c/dcommon","commit_stats":null,"previous_names":["dezashibi-c/dcommon"],"tags_count":30,"template":false,"template_full_name":null,"purl":"pkg:github/dezashibi-c/dcommon","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dezashibi-c%2Fdcommon","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dezashibi-c%2Fdcommon/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dezashibi-c%2Fdcommon/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dezashibi-c%2Fdcommon/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dezashibi-c","download_url":"https://codeload.github.com/dezashibi-c/dcommon/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dezashibi-c%2Fdcommon/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279093209,"owners_count":26101901,"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","status":"online","status_checked_at":"2025-10-15T02:00:07.814Z","response_time":56,"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","data-structures","dynamic-values","helpers","scripts","utilities"],"created_at":"2024-11-12T17:05:53.056Z","updated_at":"2025-10-15T16:29:30.406Z","avatar_url":"https://github.com/dezashibi-c.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Dezashibi Common library `dcommon`\n\nThis library is my personal utilities, types, helpers and macros that I often use in my projects.\n\nThe key concept in this library is **NOT** to be one lib rule them all style or full of complicated highly abstracted macros.\n\nSo you still need to know what you're writing and it might fail or causes undefined behavior.\n\nWhich comes with this question that should you use it or not!?\n\nShort answer: try to see if you should or you shouldn't.\n\nLong answer: You can use it because it's really clean and straight forward whether you want to hack it or learn from it, so if you want to have things already done and ready to be used and also easy to debug sure use it, if you're seeking something magical or you recently fell in love with `C` with some background on other languages it **does** provide a few features like dynamic values, dynamic arrays, hash tables, `result` type, etc. but in no way it's not going to remove the need for being actively focused on where you've allocated memory, when to free, etc.\n\nSo if you're ready to give it a try by all means please go ahead and use this and I can't wait for your opinions.\n\n**👉 NOTE:** The library is stable enough to be used, but I might want to add/remove a few macros and also improve documentation or I might add a quick start guide, that sort of things. that being said, don't trust me, use it in a smaller scale first, see if you can connect with it, let me know what you think. **and I'm not claiming the implementation is anything near as perfect or performant, so be aware**.\n\n## How the library is structured?\n\nIt's a one header file include style (**Not to be mistaken with single header libraries**):\n\n- Download a release of `dcommon.zip`\n- Unzip it to your `extern` or `src` folder and you'll have a `dcommon` folder in there\n- Include `dcommon/dcommon.h` where ever you want to use it.\n- Make sure you've added `DCOMMON_IMPL` before one and only one of your files before including the header file.\n- That's it.\n\n## What's on the menu?\n\n- `dcommon` lib\n  - Primitive type short names,\n  - Inclusion of mostly used standard library header files\n  - Dynamic value you can use and enjoy\n  - Dynamic array can hold dynamic values\n  - Hash Table with custom hash functions and key type\n  - String View\n  - Result type with macros to define your own, with returns success or error with error messages, codes, so on.\n  - Everything returns result no number coding\n  - string converter to numbers with proper bound check and errors\n  - Global cleanup that you can register your types and make sure if anything is broken it will first cleanup then exit\n  - Macros to log, condition based log, debug logs, etc.\n  - Utilities to create formatted string, duplicate string, append string, etc.\n  - ...\n- `tag.py` Script\n  - Simplifies creating tag, zip artifact or file attachment for github\n\n~~**👉 `dcommon` lib help can be found [here](/src/dcommon/docs.md).**~~ **Documents are being overhauled please wait**\n\n## `tag.py` Script\n\nThe idea is to run this simple script after a few modification to create\ntag and also release in case certain criteria are met\nThe script looks for `CHANGE_LOGS.md` in the current working directory\nit assumes the mentioned file has the following format\n\n👉 Checkout [`CHANGE_LOG.md`](/CHANGE_LOGS.md) of this very repository.\n\n**👉 For `tag.py` guide read [here](/src/scripts/tag.py#L39-L70).**\n\nThis library uses `tag.py` like [this](/scripts/tag.py#L72-L80).\n\n```py\n# name of the folder to zip this path is relative to the current working directory\n# it means if you run it from the root folder it looks for the folder to be zipped\n# in the root folder\n# leave it empty string `''` for disabling zip\nfolder_to_zip = ['src/dcommon']\n\n# you can list name of file or files you would like to be added individually to github\n# releases\nrelease_files = [\"src/dcommon.zip\", \"src/scripts/tag.py\"]\n```\n\nAnd every time I need I just run the following command at the root of my repository folder:\n\n```bash\npython3 ./scripts/tag.py\n```\n\n## License\n\nThis project is licensed under the BSD 3-Clause [LICENSE](/LICENSE).\n\nBSD 3-Clause License\n\nCopyright (c) 2024, Navid Dezashibi \u003cnavid@dezashibi.com\u003e\n\nRedistribution and use in source and binary forms, with or without\nmodification, are permitted provided that the following conditions are met:\n\n1. Redistributions of source code must retain the above copyright notice, this\n   list of conditions and the following disclaimer.\n\n2. Redistributions in binary form must reproduce the above copyright notice,\n   this list of conditions and the following disclaimer in the documentation\n   and/or other materials provided with the distribution.\n\n3. Neither the name of the copyright holder nor the names of its\n   contributors may be used to endorse or promote products derived from\n   this software without specific prior written permission.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\"\nAND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\nIMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\nDISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE\nFOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\nDAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR\nSERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\nCAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,\nOR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\nOF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdezashibi-c%2Fdcommon","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdezashibi-c%2Fdcommon","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdezashibi-c%2Fdcommon/lists"}