{"id":17209177,"url":"https://github.com/rswinkle/c_utils","last_synced_at":"2026-04-25T16:34:08.871Z","repository":{"id":27308889,"uuid":"30783017","full_name":"rswinkle/c_utils","owner":"rswinkle","description":"utility functions and libraries, for lists, queue's, strings, file I/O and general utilities, and vectors in the form of CVector (which has it's own repo).","archived":false,"fork":false,"pushed_at":"2026-04-18T09:30:00.000Z","size":231,"stargazers_count":5,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2026-04-18T11:36:06.923Z","etag":null,"topics":["c","cpp","cvector","list","queue","string","utilities","utility-library","vector"],"latest_commit_sha":null,"homepage":"","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":"neonkat/local_manifests","license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/rswinkle.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null},"funding":{"liberapay":"rswinkle","custom":"http://www.robertwinkler.com/donations.html"}},"created_at":"2015-02-14T01:04:50.000Z","updated_at":"2026-04-18T09:30:03.000Z","dependencies_parsed_at":"2022-08-26T23:02:29.180Z","dependency_job_id":null,"html_url":"https://github.com/rswinkle/c_utils","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/rswinkle/c_utils","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rswinkle%2Fc_utils","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rswinkle%2Fc_utils/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rswinkle%2Fc_utils/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rswinkle%2Fc_utils/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rswinkle","download_url":"https://codeload.github.com/rswinkle/c_utils/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rswinkle%2Fc_utils/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32269462,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-25T09:15:33.318Z","status":"ssl_error","status_checked_at":"2026-04-25T09:15:31.997Z","response_time":59,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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","cpp","cvector","list","queue","string","utilities","utility-library","vector"],"created_at":"2024-10-15T02:50:57.985Z","updated_at":"2026-04-25T16:34:08.866Z","avatar_url":"https://github.com/rswinkle.png","language":"C","readme":"\nC_UTILS\n=======\nThis started out as just 1 small library  but now includes 5 separate,\nindependent libraries.  This is because I now view this project as a\ngrowing collection of any broadly useful C libraries I'm likely to\nuse/need in any C project.  So this is kind of like my version of\nSean Barret's [stb project](https://github.com/nothings/stb) but\nspecifically his stb.h, full of general useful C code.  Of course\nmine is nowhere near as unified/consistent/well designed or\ncomprehensive but oh well.\n\n### c_utils\nWhat this repository started out as, made up of c_utils.c/h and basic_types.h,\nthis includes utilities for reading/writing to/from files and strings,\nsplitting, trimming, and slicing strings as well as other misc. useful\nC functions.\n\n### rsw_cstr\nThis is a string library modeled after CVector (It actually started\nas a generated vector_char).  It has many more functions than CVector, most taken/modeled\nafter C++ std::string, including find, replace, substr etc.  It also has it's own functions\nfor file reading/writing, splitting, trimming, slicing etc.\n\n### clist\nCurrently just a header file based closely on the Linux kernel's\nintrusive doubly linked list type and functions/macros.  I've added\na couple functions and will add more.  I also plan to make a deque\non top of this eventually.\n\n### CQueue\nThis is the all in one, cqueue.h file from [CQueue](http://github.com/rswinkle/CQueue)\n\n### CVector\nThis is the all in one, cvector.h file from [CVector](http://github.com/rswinkle/CVector)\n\nThey are all written in clean C, ie they compile as C++.  This repository's\npremake only builds and sort of tests c_utils but CQueue and CVector (and thus rsw_cstr\nindirectly) have their own tests in their respective repos.\n\n#### Note on the difference between c_utils and rsw_cstr\nThe main difference between the 2 libraries is that c_utils is very general and has many\nfunctions that are not I/O related and while all of it's I/O, and manipulation functions work on\nregular strings, they use the c_array type and can be used to read binary data and manipulate\nan array of types other than char.  On the other hand, rsw_cstr's are resizable strings like\nstd::string, guaranteed to be null terminated (actually c_array functions null terminate too\njust so that you can use them to, for example read in a string and immediately print it).\n\nA good comparison is the split functions of the 2 libraries.  The c_utils version returns\nan array of c_arrays which point into the original string you're splitting.  In other words, they aren't\nallocated, they aren't NULL terminated (though it'd be easy to NULL terminate) and you can't\nresize them.  The rsw_cstr version returns an array of of cstrs which you can immediately\nmanipulate individually, erasing, extending, printing, whatever.  Both methods are shown in main.c.\n\nUsage\n=====\nTo actually use the libraries just copy the appropriate c/h file(s) to your project.\nTo get a general idea of how to use the libraries and see it in action and how it should\nbehave, look at the tests in main.c or in the separate repos for CVector and CQueue.\n\nDocumentation\n=============\nThere is some sparse documentation in the comments but it's mostly self\ndocumenting, implementing common functions/interfaces.\n\n\nLICENSE\n=======\nAll 5 libraries are licensed under the MIT license\n\nCopyright (c) 2013-2020 Robert Winkler\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of this software and associated\ndocumentation files (the \"Software\"), to deal in the Software without restriction, including without limitation\nthe rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and\nto permit persons to whom the Software is furnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED\nTO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\nTHE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF\nCONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\nIN THE SOFTWARE.\n","funding_links":["https://liberapay.com/rswinkle","http://www.robertwinkler.com/donations.html"],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frswinkle%2Fc_utils","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frswinkle%2Fc_utils","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frswinkle%2Fc_utils/lists"}