{"id":22632226,"url":"https://github.com/spockbotmc/mcd2c","last_synced_at":"2025-04-11T20:10:52.781Z","repository":{"id":146096897,"uuid":"225239696","full_name":"SpockBotMC/mcd2c","owner":"SpockBotMC","description":"Generate C serialization/deserialization code from the minecraft-data protodef protocol spec","archived":false,"fork":false,"pushed_at":"2020-07-22T12:39:51.000Z","size":1704,"stargazers_count":8,"open_issues_count":0,"forks_count":3,"subscribers_count":7,"default_branch":"master","last_synced_at":"2025-03-25T16:08:12.616Z","etag":null,"topics":["c","minecraft","minecraft-data","protodef","spockbot"],"latest_commit_sha":null,"homepage":null,"language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"zlib","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/SpockBotMC.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,"publiccode":null,"codemeta":null}},"created_at":"2019-12-01T22:21:43.000Z","updated_at":"2024-08-14T21:43:30.000Z","dependencies_parsed_at":"2023-05-14T13:00:26.848Z","dependency_job_id":null,"html_url":"https://github.com/SpockBotMC/mcd2c","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SpockBotMC%2Fmcd2c","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SpockBotMC%2Fmcd2c/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SpockBotMC%2Fmcd2c/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SpockBotMC%2Fmcd2c/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/SpockBotMC","download_url":"https://codeload.github.com/SpockBotMC/mcd2c/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248473127,"owners_count":21109628,"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","minecraft","minecraft-data","protodef","spockbot"],"created_at":"2024-12-09T02:16:51.561Z","updated_at":"2025-04-11T20:10:52.774Z","avatar_url":"https://github.com/SpockBotMC.png","language":"C","readme":"# mcd2c\n\nGenerate C serialization/deserialization code from the minecraft-data protodef protocol spec\n\nRequires [python-minecraft-data](https://github.com/SpockBotMC/python-minecraft-data)\n\n## Usage\n\n`python mcd2c.py [version]`\n\nWill generate two files: `[version]_proto.c` and `[version]_proto.h`\n\nThe header file is pretty self explanatory, each packet gets four or five functions:\n\n`int walk_[packet_name](char *source, size_t max_len)`\n\nValidates a packet's layout in a buffer, returns `-1` on invalid or improper layout and the total size of the packet on success. Walk should always be called on a buffer before calling a decode function, because decode doesn't do any bounds checking.\n\n`size_t size_[packet_name]([packet_type] packet)`\n\nCalculates the size of the packet when serialized, so you can know the amount of free space you need in the destination buffer. Size should always be called on a packet before calling an encode function, because encode doesn't do any bounds checking.\n\n`char * enc_[packet_name](char *dest, [packet_type] packet)`\n\nSerializes the packet into the destination buffer, returns a pointer to the end of the serialized packet.\n\n`char * dec_[packet_name]([packet_type] *dest, char *source)`\n\nDeserializes the buffer into the destination packet, returns a pointer to the end of the deserialized buffer.\n\n`void free_[packet_name]([packet_type] packet)`\n\nFrees dynamically allocated memory for packets that have dynamic-memory types, not present for packets that don't require dynamic memory allocation.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fspockbotmc%2Fmcd2c","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fspockbotmc%2Fmcd2c","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fspockbotmc%2Fmcd2c/lists"}