{"id":31897728,"url":"https://github.com/8bitprodigy/btchwrk","last_synced_at":"2025-10-13T11:44:35.253Z","repository":{"id":312458458,"uuid":"1047569590","full_name":"8bitprodigy/BTCHWRK","owner":"8bitprodigy","description":"A self-written C library of commonly needed/used data types, containers, algorithms, and macros. Pronounced \"Batch Work\" and no way else ;).","archived":false,"fork":false,"pushed_at":"2025-09-12T13:11:26.000Z","size":28,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-09-12T15:54:17.556Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"0bsd","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/8bitprodigy.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"COPYING","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}},"created_at":"2025-08-30T17:58:39.000Z","updated_at":"2025-09-12T13:11:31.000Z","dependencies_parsed_at":"2025-08-30T20:19:16.055Z","dependency_job_id":"13be346a-784f-4698-a7e2-398351af3487","html_url":"https://github.com/8bitprodigy/BTCHWRK","commit_stats":null,"previous_names":["8bitprodigy/btchwrk"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/8bitprodigy/BTCHWRK","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/8bitprodigy%2FBTCHWRK","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/8bitprodigy%2FBTCHWRK/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/8bitprodigy%2FBTCHWRK/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/8bitprodigy%2FBTCHWRK/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/8bitprodigy","download_url":"https://codeload.github.com/8bitprodigy/BTCHWRK/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/8bitprodigy%2FBTCHWRK/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279014811,"owners_count":26085594,"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-13T02:00:06.723Z","response_time":61,"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":[],"created_at":"2025-10-13T11:44:33.089Z","updated_at":"2025-10-13T11:44:35.245Z","avatar_url":"https://github.com/8bitprodigy.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# BTCHWRK\n\nPronounced \"Batch Work\" ;).\n\n---\n\nThis is a library of common useful data types, containers and algorithms one may \nneed that isn't part of the C standard library, provided to you, completely for\nfree as public domain or under the terms of the Zero BSD license -- take your \npick.\n\n---\n## Features/API:\n\n- `Any` - `\u003cbtchwrk/common.h\u003e`: A typedef'd union that can hold any basic C type.\n\n- `Sequence` - `\u003cbtchwrk/sequence.h\u003e`: A dynamic array container type.\n\t- **Methods:**\n\t\t- `Sequence Sequence_new( size_t datum_size, size_t capacity)`: Creates \n\t\ta new `Sequence` whose elements are `datum_size` wide and with `capacity` \n\t\tnumber of elements.\n\t\t- `void Sequence_free(Sequence seq)`: Grees a `Sequence` from memory.\n\t\t- `void Sequence_grow(Sequence seq)`: Grows the capacity of the `Sequence`\n\t\tby `Sequence.capacity * SEQUENCE_GROWTH_FACTOR` amount.\n\t\t- `void Sequence_shrink(Sequence seq)`: Shrinks the capacity of the \n\t\t`Sequence` to be equal to its length.\n\t\t- `void Sequence_add(Sequence seq, void *datum)`: Adds an element, `datum`\n\t\tto the end of the `Sequence`.\n\t\t- `void *Sequence_at(Sequence seq, size_t index)`: Returns a pointer to \n\t\tthe data at `index`.\n\t\t- `void Sequence_append(Sequence seq, void *data, size_t size)`: Appends\n\t\tan array, `data`, of `size` elements in length to the end of the \n\t\t`Sequence`.\n\t\t- `size_t Sequence_capacity(Sequence seq)`: Returns the total capacity \n\t\tof a `Sequence`.\n\t\t- `void Sequence_concat(Sequence seq1, Sequence seq2)`: Concatenates two\n\t\t`Sequence`s together.\n\t\t- `void Sequence_delete(Sequence seq, size_t index, size_t size)`: \n\t\tDeletes `size` number of elements from a `Sequence`, starting at `index`.\n\t\t- `void Sequence_insert(Sequence seq, size_t index, void *data, size_t size)`\n\t\t: Inserts an array, `data`, `size` elements in length into a `Sequence`\n\t\tstarting at `index`, pushing the elements starting at `index` and after \n\t\tback.\n\t\t- `Size_t Sequence_length(Sequence seq)`: Returns the number of elements\n\t\tin a `Sequence`.\n\t\t- `void Sequence_replace(Sequence seq, size_t index, void *data, size_t size)`\n\t\t: Replaces `size` number of elements of a `Sequence`, starting at `index`\n\t\twith `size` number of elements from array `data`. \n\n- `Text` = `\u003cbtchwrk/text.h\u003e`: A length-counted constant string type.\n\t- **Macros:**\n\t\t- `TXT( literal )`: Wraps a string literal into a `Text` literal.\n\t\t- `Text( literal )`: Alias of `TXT()` to be  used as like a constructor.\n\t\t- `CSTR2TXT( cstr )`: Wraps a C string into a `Text` literal.\n\t- **Methods:**\n\t\t- `char Text_charAt(Text txt, size_t index)`: Returns the character at a\n\t\tparticular index.\n\t\t- `int Text_compare(Text txt1, Text txt2)`: Compare two strings \n\t\tlexicographically. The sign of the result is the difference between the\n\t\tstring values. Returns 0 if equal.\n\t\t- `int Text_find(Text txt, Text needle)`: Finds the first occurrance of \n\t\tthe `Text` `needle` in `txt` and returns the starting position of that.\n\t\t- `int Text_findChar(Text txt, char c)`: Finds the first occurrance of \n\t\t`char` `c` in `txt`.\n\t\t- `size_t Text_length(Text txt)` Returns the length of `txt`.\n\t\t- `int Text_rfind(Text txt, Text needle)`: Reverse finds the first\n\t\toccurrance of `Text` `needle` in `txt` and returns the starting position.\n\t\t- `char *Text_toCStr(Text txt)`: Returns the C string equivalent of \n\t\t`txt`.\n\n- `TextBuffer` = `\u003cbtchwrk/text.h\u003e`: A length-counted dynamic string type.\n\t- **Macros:**\n\t\t- `TB2TXT( buf )`: Casts a `TextBuffer` to a `Text`.\n\t\t- `TB2STR( buf )`: Returns a C string from a `TextBuffer`.\n\t- **Constructors:**\n\t\t- `TextBuffer TextBuffer_new(size_t capacity)`: Constructs a new\n\t\t`TextBuffer`, preallocated with `capacity` characters.\n\t\t- `TextBuffer TextBuffer_fromText(Text txt)`: Constructs a new \n\t\t`TextBuffer` from a pre-existing `Text`.\n\t\t- `TextBuffer TextBuffer_fromCStr(const char *cstr)`: Constructs a\n\t\tnew `TextBuffer` from a C string.\n\t\t- `TextBuffer TextBuffer_substring(TextBuffer buf, size_t start, size_t length)`:\n\t\tConstructs a new `TextBuffer` from the substring of `buf` starting at\n\t\t`start` for `length` characters long.\n\t- **Destructor:**\n\t\t- `void TextBuffer_free(TextBuffer buf)`: Destructs `buf`, freeing it \n\t\tfrom memory.\n\t- **Methods:**\n\t\t- **Accessors:**\n\t\t\t- `size_t TextBuffer_length(TextBuffer buf)`: Returns the length of\n\t\t\ta `TextBuffer`.\n\t\t- **Mutators:**\n\t\t\t- `void TextBuffer_clear(TextBuffer buf)`: Clears the text from the\n\t\t\t`TextBuffer`.\n\t\t\t- `void TextBuffer_concat(TextBuffer buf, Text txt)`: Concatenates\n\t\t\ta `Text` to the end of `TextBuffer`.\n\t\t\t- `void TextBuffer_nConcat(TextBuffer buf, Text txt, size_t length)`:\n\t\t\tConcatenates `length` amount of `txt` to a `TextBuffer`.\n\t\t\t- `void TextBuffer_insert(TextBuffer buf, size_t index, Text txt)`:\n\t\t\tInserts `txt` into `buf` at `index`.\n\t\t\t- `void TextBuffer_setChar(TextBuffer buf, char c, size_t index)`:\n\t\t\tSets the `char` at `index` in `buf` to `c`.\n\t\t\n\t\n- `Variant` - `\u003cbtchwrk/common.h\u003e`: A transparent tagged union which can hold \nany basic C type. Has the following structure:\n\t- `VariantTag tag`: The tag indicating the currently held type.\n\t- `Any value`: The value held in the `Variant`.\n\n- `VariantTag` - `\u003cbtchwrk/common.h\u003e`: A typedef'd enum, enumerating every basic\nC type. Eat entry is in `SHOUT_CASE` and starts with the `VARIANT_` prefix.\n\n---\n\n## License:\n\nZero-BSD\n\n```\nCopyright (C) 2025 by chrisxdeboy@gmail.com\n\nPermission to use, copy, modify, and/or distribute this software for any purpose \nwith or without fee is hereby granted.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH \nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND \nFITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, \nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS \nOF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER \nTORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF \nTHIS SOFTWARE.\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F8bitprodigy%2Fbtchwrk","html_url":"https://awesome.ecosyste.ms/projects/github.com%2F8bitprodigy%2Fbtchwrk","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F8bitprodigy%2Fbtchwrk/lists"}