{"id":13420960,"url":"https://github.com/polyphony-ot/libot","last_synced_at":"2025-03-15T07:32:11.890Z","repository":{"id":16480238,"uuid":"19232616","full_name":"polyphony-ot/libot","owner":"polyphony-ot","description":"A C library for operational transformation.","archived":false,"fork":false,"pushed_at":"2015-07-18T22:40:09.000Z","size":689,"stargazers_count":13,"open_issues_count":13,"forks_count":2,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-07-31T22:57:13.148Z","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":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/polyphony-ot.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-04-28T08:53:24.000Z","updated_at":"2022-10-07T15:07:33.000Z","dependencies_parsed_at":"2022-09-24T07:01:35.670Z","dependency_job_id":null,"html_url":"https://github.com/polyphony-ot/libot","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/polyphony-ot%2Flibot","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/polyphony-ot%2Flibot/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/polyphony-ot%2Flibot/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/polyphony-ot%2Flibot/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/polyphony-ot","download_url":"https://codeload.github.com/polyphony-ot/libot/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243701277,"owners_count":20333615,"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":[],"created_at":"2024-07-30T22:01:45.027Z","updated_at":"2025-03-15T07:32:11.559Z","avatar_url":"https://github.com/polyphony-ot.png","language":"C","funding_links":[],"categories":["TODO scan for Android support in followings"],"sub_categories":[],"readme":"libot\n=====\n\nA cross-platform library for real-time text editing.\n\nlibot is the core of the [polyphony project](https://github.com/polyphony-ot). It uses operational transformation (OT) to allow for real-time text editing between users. Since it's written in C, it can be used on virtually any platform, meaning that the complexities of OT only need to be handled in a single codebase. The other polyphony libraries simply wrap libot in order to provide a more native experience for their own platform.\n\nGetting Started\n---------------\n\nFirst, [check to see](https://github.com/polyphony-ot) if there's a polyphony library available for your platform. Using a library for your platform will be easier and will provide a more idiomatic API.\n\nIf there isn't a library for your specific platform (or if you want to make one), take a look at the [Getting Started](doc/getting-started.md) guide for an explanation of how to use libot's API.\n\n### Example\n\nHere's a quick snippet that demonstrates what using libot looks like. The following code shows how a client would insert the text \"abc\" into a document:\n\n```c\n// This function will be called by libot whenever a message needs to be sent to\n// the server.\nstatic int send(const char* msg) {\n    // Send msg to the server\n}\n\n// This function will be called by libot whenever the UI or editor need to be\n// updated with new text.\nstatic int event(ot_event_type t, ot_op* op) {\n    // Update the UI/editor with the changes in op.\n}\n\n// Create a new client and provide it our send and event functions.\not_client* client = ot_new_client(send, event);\n\n// Create and apply a new op that inserts the text \"abc\" into the document.\not_op* op = ot_new_op();\not_insert(\"abc\");\not_client_apply(client, op);\n```\n\nThat's it! The libot client handles sending our change to the server, notifying our editor that there's new text, and resolving any conflicts with OT.\n\nBuilding\n--------\n\nTo build libot, simply run `make`. This will create debug and release archives of libot which can be found in `bin/debug/libot.a` and `bin/release/libot.a`.\n\nlibot builds using clang by default, but it should also be compatible with gcc.\n\n### Testing\n\nIf you're making changes to libot or running it on a new platform, you'll also want to run tests with `make clean test`. This will run libot's entire test suite.\n\nCode coverage can also be enabled by setting the `COVERAGE` variable with `make -e COVERAGE=1 clean test`. Note that code coverage requires that [lcov](http://ltp.sourceforge.net/coverage/lcov.php) be installed and in your PATH. The generated report can be found in `bin/coverage/index.html`.\n\nYou can also test for memory leaks by using the `TESTRUNNER` variable. This variable allows you to specify an arbitrary wrapper command for running tests. For example, to run the tests with valgrind you'd do `make -e TESTRUNNER=valgrind clean test`.\n\nDocumentation\n-------------\n\nThe [doc](doc) directory contains various guides and explanations for the different parts of libot. The [Getting Started](doc/getting-started.md) guide in particular has a good general introduction to working with libot. You can also find reference documentation for specific types and functions in the header files.\n\nContributing\n------------\n\nPolyphony is looking for contributors! If you're interested in learning how a real-time text editor works, contributing new features, or porting libot to a new platform, please see the [contributing guide](CONTRIBUTING.md).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpolyphony-ot%2Flibot","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpolyphony-ot%2Flibot","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpolyphony-ot%2Flibot/lists"}