{"id":23803088,"url":"https://github.com/mr-cheff/ultimate-string-library","last_synced_at":"2025-09-06T15:33:31.821Z","repository":{"id":194257352,"uuid":"690420684","full_name":"mr-cheff/ultimate-string-library","owner":"mr-cheff","description":"The ultimate string library for C where it's purpose is to eliminate the use of null terminators but allow C stdlib interactivity without the use of structs and still use char* arrays","archived":false,"fork":false,"pushed_at":"2023-09-14T19:12:14.000Z","size":20,"stargazers_count":6,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-11-22T03:03:29.814Z","etag":null,"topics":["c-strings","string-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/mr-cheff.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":"2023-09-12T06:57:03.000Z","updated_at":"2024-01-30T11:51:37.000Z","dependencies_parsed_at":"2024-11-22T04:00:50.943Z","dependency_job_id":null,"html_url":"https://github.com/mr-cheff/ultimate-string-library","commit_stats":null,"previous_names":["mauro-balades/ultimate-string-library","mr-cheff/ultimate-string-library"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mr-cheff%2Fultimate-string-library","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mr-cheff%2Fultimate-string-library/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mr-cheff%2Fultimate-string-library/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mr-cheff%2Fultimate-string-library/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mr-cheff","download_url":"https://codeload.github.com/mr-cheff/ultimate-string-library/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":232132920,"owners_count":18477222,"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-strings","string-library"],"created_at":"2025-01-01T22:29:31.520Z","updated_at":"2025-01-01T22:29:31.715Z","avatar_url":"https://github.com/mr-cheff.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ultimate-string-library\nThe ultimate string library for C where it's purpose is to eliminate the use of null terminators but allow C stdlib interactivity\n\n# How to use\n\n```c\n#include \"usl.h\"\n\nint main() {\n    usl str = usl_from(\"Hello, World!\");\n    usl str2 = usl_from(\"Hello, World!\");\n    usl str3 = usl_concat(str, str2);\n    printf(\"%s\\n\", usl_as_str(str3));\n    usl_free(str);\n    usl_free(str2);\n    usl_free(str3);\n}\n```\n\n# How to install\n\n```c\ninclude(FetchContent)\nFetchContent_Declare(usl\n  URL https://github.com/mauro-balades/ultimate-string-library.git\n)\n\nFetchContent_MakeAvailable(usl)\ntarget_link_libraries(${PROJECT_NAME} PRIVATE usl)\n```\n\n# How does it work?\n\nThe library uses a tipical `char*` but it also stores the length of the string in the first 4 bytes of the pointer.\n\n### Why?\n\nI wanted to make a string library that was easy to use and didn't require the use of null terminators. I also wanted to make it so that it was easy to convert to a `char*` so that it could be used with the C stdlib. \n\nThe C stdlib kinda... *sucks* when it comes to strings. It's not very safe and it's very easy to make mistakes. I wanted to make a library that was easy to use and didn't require the use of null terminators. I also wanted to make it so that it was easy to convert to a `char*` so that it could be used with the C stdlib.\n\nhere's an example of the string representation:\n\n```c\n[4 bytes] [n bytes]\n[length] [string]\n```\n\n```c\n\"Hello\"\n[5 bytes] [5 bytes]\n[0x05] [Hello]\n\n        H E L L O\n--------------\n0 0 0 5 H E L L O\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmr-cheff%2Fultimate-string-library","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmr-cheff%2Fultimate-string-library","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmr-cheff%2Fultimate-string-library/lists"}