{"id":30479658,"url":"https://github.com/codebrainz/vt100","last_synced_at":"2025-08-24T12:49:19.166Z","repository":{"id":309007343,"uuid":"1034873113","full_name":"codebrainz/vt100","owner":"codebrainz","description":"Comprehensive and efficient VT100 parser in plain C.","archived":false,"fork":false,"pushed_at":"2025-08-09T06:44:19.000Z","size":999,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-08-09T08:35:54.327Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/codebrainz.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","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}},"created_at":"2025-08-09T06:42:21.000Z","updated_at":"2025-08-09T06:44:22.000Z","dependencies_parsed_at":"2025-08-09T08:35:55.584Z","dependency_job_id":"2034d0e1-89a3-4637-a6ce-03d108de86d4","html_url":"https://github.com/codebrainz/vt100","commit_stats":null,"previous_names":["codebrainz/vt100"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/codebrainz/vt100","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codebrainz%2Fvt100","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codebrainz%2Fvt100/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codebrainz%2Fvt100/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codebrainz%2Fvt100/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/codebrainz","download_url":"https://codeload.github.com/codebrainz/vt100/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codebrainz%2Fvt100/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":271867958,"owners_count":24836502,"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-08-24T02:00:11.135Z","response_time":111,"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-08-24T12:49:14.600Z","updated_at":"2025-08-24T12:49:19.146Z","avatar_url":"https://github.com/codebrainz.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# VT100 Parser Library\n\nThis project provides a portable, incremental parser for VT100/ANSI escape\nsequences. It is suitable for use in terminal emulators, logging tools, or any\napplication that needs to interpret terminal control codes.\n\n---\n\n## Features\n\n- Incremental, event-driven parsing of VT100/ANSI escape sequences\n- No dynamic memory allocation required\n- Supports CSI, OSC, DCS, PM, APC, and standard control/printable characters\n- Robust handling of buffer/parameter overflows: string buffers (OSC/DCS/PM/APC)\n  are truncated if too long, and CSI parameter arrays are limited to 16 entries\n  (extra parameters are ignored)\n- Simple callback-based API\n- Thorough unit test coverage\n\n## Directory Structure\n\nAll files are in the project root unless otherwise noted:\n\n- `vt100.c`, `vt100.h` Library source and header\n- `vt100_test.c` Unit tests for the parser\n- `CMakeLists.txt` CMake build system\n- `Doxyfile.in` Doxygen configuration template\n- `LICENSE.md` License\n- `README.md` This file\n\n## Quick Start\n\n### One-step build, install, and test\n\nYou can use the provided `build.sh` script to perform a full clean build, install the library and header, run all tests, and show the installed files:\n\n```sh\n./build.sh\n```\n\nThis script will:\n\n- Remove any previous build directory for a clean build\n- Configure CMake with tests and documentation enabled\n- Build the library, test binary, and documentation\n- Install the static library and header to `build/install` (see below)\n- Run the unit tests (output: `All tests passed!` if successful)\n- Show the installed files using `tree -lh` (or `find` if `tree` is not available)\n\n### Manual CMake build (advanced)\n\nYou can also build manually with CMake. Optional documentation and test targets can be enabled using CMake options:\n\n```sh\n# Basic build (library only):\ncmake -S . -B build\ncmake --build build\n\n# Build with tests and documentation:\ncmake -S . -B build -DBUILD_TESTS=ON -DBUILD_DOCS=ON\ncmake --build build\n\n# Build only tests or docs:\ncmake -S . -B build -DBUILD_TESTS=ON\ncmake --build build\ncmake -S . -B build -DBUILD_DOCS=ON\ncmake --build build --target doc\n```\n\nTest binary: `build/bin/vt100_test` (not installed)\nStatic library: `build/lib/libvt100.a`\nDocumentation: `build/docs/reference/html/index.html`\n\n### Install location\n\nWhen using `build.sh` or running `cmake --install build`, the following files are installed to `build/install`:\n\n- `build/install/include/vt100.h` (header)\n- `build/install/lib/libvt100.a` (static library)\n\nThe test binary is not installed.\n\n### Run tests manually\n\n```sh\nbuild/bin/vt100_test\n```\n\n## Usage\n\nInclude `vt100.h` in your project and link against `libvt100.a`. Initialize a\nparser, provide a callback, and feed input data incrementally:\n\n```c\n#include \"vt100.h\"\n\nvoid my_callback(vt100_parser_t *parser, const vt100_event_t *event, void *user)\n{\n    // Handle events here\n}\n\nvt100_parser_t parser;\nvt100_parser_init(\u0026parser, my_callback, NULL);\nvt100_parser_feed(\u0026parser, data, len);\n```\n\n### Buffer and Parameter Limits\n\n- **CSI parameters:** Only the first 16 parameters are stored; extra parameters\n  are ignored.\n- **OSC/DCS/PM/APC strings:** If a string exceeds the buffer size (128 bytes\n  including null terminator), it is truncated and the event's\n  `is_overflow`/`is_overflowed` field is set.\n\n### XTerm Event Usage Example\n\nTo handle XTerm mouse and clipboard events, check the event type in your\ncallback:\n\n```c\nvoid my_callback(vt100_parser_t *parser, const vt100_event_t *event, void *user)\n{\n    switch (event-\u003etype) {\n    case VT100_EVENT_XTERM_MOUSE:\n        // Access event-\u003edata.xterm_mouse fields\n        break;\n    case VT100_EVENT_XTERM_CLIPBOARD:\n        // Access event-\u003edata.xterm_clipboard.data\n        break;\n    // ... handle other event types ...\n    }\n}\n```\n\nSee the unit tests in `vt100_test.c` for more usage examples.\n\n## Documentation\n\nTo generate API documentation (HTML) with CMake:\n\n```sh\ncmake --build build --target doc\n# Open build/docs/reference/html/index.html in your browser\n```\n\n## Requirements\n\n- Standard C99 compiler (tested with gcc and clang)\n- CMake 3.10+ (recommended)\n- `make` (optional, for legacy Makefile)\n- `clang-format` (optional, for formatting)\n\n## License\n\nThis project is released under the [MIT License](LICENSE.md).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcodebrainz%2Fvt100","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcodebrainz%2Fvt100","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcodebrainz%2Fvt100/lists"}