{"id":19362700,"url":"https://github.com/smartdevicelink/bson_c_lib","last_synced_at":"2025-04-23T12:33:07.980Z","repository":{"id":49472400,"uuid":"98553404","full_name":"smartdevicelink/bson_c_lib","owner":"smartdevicelink","description":"Library for converting a map to and from BSON format","archived":false,"fork":false,"pushed_at":"2021-06-08T18:55:34.000Z","size":1005,"stargazers_count":1,"open_issues_count":4,"forks_count":12,"subscribers_count":10,"default_branch":"master","last_synced_at":"2025-04-15T09:43:10.955Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/smartdevicelink.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}},"created_at":"2017-07-27T15:36:57.000Z","updated_at":"2021-11-06T08:05:23.000Z","dependencies_parsed_at":"2022-08-21T02:50:13.646Z","dependency_job_id":null,"html_url":"https://github.com/smartdevicelink/bson_c_lib","commit_stats":null,"previous_names":[],"tags_count":14,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/smartdevicelink%2Fbson_c_lib","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/smartdevicelink%2Fbson_c_lib/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/smartdevicelink%2Fbson_c_lib/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/smartdevicelink%2Fbson_c_lib/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/smartdevicelink","download_url":"https://codeload.github.com/smartdevicelink/bson_c_lib/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250435249,"owners_count":21430246,"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-11-10T07:29:58.398Z","updated_at":"2025-04-23T12:33:02.953Z","avatar_url":"https://github.com/smartdevicelink.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# README #\nLibrary for converting to and from BSON\n\n## Build library ##\n```bash\n./configure\nmake\n```\n\n## Install library ##\n```bash\nsudo make install\n```\n\n## Build Lua wrapper ##\n\n### Install Dependencies ###\n```bash\nsudo apt-get install lua5.2 liblua5.2 liblua5.2-dev\n```\n\n### Build Library ###\n```bash\n./configure --with-lua-wrapper=yes\nmake\n```\n\n### Using the Lua Library ###\n```lua\nbson = require(\"bson4lua\");\n\nbsonBytes = bson.to_bytes({\n\tdoubleValue = {\n\t\ttype = 0x01, --Double type\n\t\tvalue = 3.141592653589793\n\t},\n\tintValue = {\n\t\ttype = 0x10, --Int32 Type\n\t\tvalue = 360\n\t},\n\tstringValue = {\n\t\ttype = 0x02, --String type\n\t\tvalue = \"A string of characters\"\n\t}\n});\n\nprint(bsonBytes:byte(1, string.len(bsonBytes)));\n\nbsonTable = bson.to_table(string.char(0x05, 0x00, 0x00, 0x00, 0x00)); --Empty BSON document\n\nprint(\"Table: \");\nfor k, v in pairs(bsonTable) do\n    print(k, v);\nend\n```\n\n### Apple Platforms ###\nThere is a CocoaPod for iOS, MacOS, tvOS, and watchOS. Add to your podfile:\n\n```ruby\npod 'BiSON'\n```\n\n### Android Platforms ###\nThere is a jCenter artifact for Android. Add the following to your `build.gradle`:\n\n```\ndependencies {\n    api 'com.smartdevicelink:bson_java_port:1.2.5'\n}\n```\n\n## Build and run sample program ##\n```bash\ncd examples\ngcc -o sample sample.c -lbson\n./sample\n```\n\n## Build and run unit tests ##\n\nRunning unit tests requires `check` framework installed with pkg-config file (.pc). On Ubuntu, please install it by running:\n```\nsudo apt-get install check\n```\n\nOnce the framework is installed, invoke `configure` with `--with-tests` option, build the library then run `make check`:\n\n```bash\n./configure --with-tests\nmake\nmake check\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsmartdevicelink%2Fbson_c_lib","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsmartdevicelink%2Fbson_c_lib","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsmartdevicelink%2Fbson_c_lib/lists"}