{"id":18707353,"url":"https://github.com/gboncoffee/b3.h","last_synced_at":"2025-04-12T10:33:18.057Z","repository":{"id":220602454,"uuid":"752076728","full_name":"gboncoffee/b3.h","owner":"gboncoffee","description":"Definitions for B3 FIX/SBE messages","archived":true,"fork":false,"pushed_at":"2024-02-14T20:24:55.000Z","size":28,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-02-18T23:45:00.246Z","etag":null,"topics":["c","economics","header-only"],"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/gboncoffee.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}},"created_at":"2024-02-03T00:49:22.000Z","updated_at":"2024-12-02T14:08:44.000Z","dependencies_parsed_at":"2024-02-14T21:33:23.777Z","dependency_job_id":"31d59563-d1c8-4e89-a151-6e1d2fd9d88e","html_url":"https://github.com/gboncoffee/b3.h","commit_stats":null,"previous_names":["gboncoffee/b3.h"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gboncoffee%2Fb3.h","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gboncoffee%2Fb3.h/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gboncoffee%2Fb3.h/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gboncoffee%2Fb3.h/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/gboncoffee","download_url":"https://codeload.github.com/gboncoffee/b3.h/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248553431,"owners_count":21123446,"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","economics","header-only"],"created_at":"2024-11-07T12:17:38.108Z","updated_at":"2025-04-12T10:33:17.794Z","avatar_url":"https://github.com/gboncoffee.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# b3.h\n\nDefinitions for [B3](https://www.b3.com.br/en_us/) FIX/SBE messages.\n\nTo use it, just `#include` it as any other C header.\n\n## Compatibility\n\nThis is ISO C90 (`-pedantic -ansi`), but depends on extensions that GCC kindly\ndoes not disable (`#pragma scalar_storage_order little-endian` and\n`__attribute__((packed))`). Clang does fail to recognize the pragma and throws\nwarnings ignoring it, but you will probably be fine in a little endian machine.\n\n## Usage\n\nThe protocol is simple enough to just cast pointers around. For example,\nassuming a packet was received and is stored in the buffer `buf` with size\n`size`:\n\n```c\nsize_t size;\nuint8_t *buf = receive_buffer_from_somewhere(\u0026size);\n\nB3PacketHeader *header = (B3PacketHeader*) buf;\nB3MessageHeader *first_msg = (B3MessageHeader*) (((size_t) buf) + sizeof(B3PacketHeader));\nB3MessageHeader *second_msg = (B3MessageHeader*) (((size_t) first_msg) + first_msg-\u003elength);\n/* And so on and so forth... */\n\nswitch (first_msg-\u003etemplate_id) {\ncase B3_HIGH_PRICE:\n    B3MessageHighPrice *msg = (B3MessageHighPrice*) (((size_t) first_msg) + sizeof(B3MessageHeader));\n    printf(\"Received high price message at %d\", msg-\u003emd_entry_timestamp);\ncase B3_LOW_PRICE:\n    B3MessageLowPrice *msg = (B3MessageHighPrice*) (((size_t) first_msg) + sizeof(B3MessageHeader));\n    printf(\"Received high price message at %d\", msg-\u003emd_entry_timestamp);\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgboncoffee%2Fb3.h","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgboncoffee%2Fb3.h","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgboncoffee%2Fb3.h/lists"}