protobuf-c

protobuf-c

github.com

1

About this website

protobuf-c is a C implementation of the Google Protocol Buffers data serialization format, providing both a code generator (protoc-c) and a C runtime library (libprotobuf-c) for encoding and decoding protobuf messages. With over 3,100 stars as of 2026, protobuf-c enables C and C++ applications (especially embedded systems, IoT devices, game engines, and high-performance networking code) to use Protocol Buffers for efficient, compact, and language-agnostic data exchange. The project consists of two components: protoc-c (a protoc plugin written in C that reads .proto schema files and generates .pb-c.c and .pb-c.h source files containing C struct definitions, initialization macros, and pack/unpack functions), and libprotobuf-c (a lightweight C library under 50KB compiled that provides the protobuf wire format implementation, message serialization via protobuf_c_message_pack, deserialization via protobuf_c_message_unpack, reflection-based field access, and message initialization). Key features include: support for all protobuf wire types (varint, 64-bit, length-delimited, 32-bit), required, optional, and repeated fields, packed repeated fields (proto3 style), enums, nested messages, oneof fields, maps (proto3), extensions and unknown field preservation, text format parsing and generation, packed and unpacked serialization modes, and zero-copy deserialization options. The library has no external dependencies (not even libc in embedded builds), supports packed structs for memory-constrained environments, and provides custom allocator support for memory management in custom environments. Licensed under BSD-2-Clause.

Tags & Categories

Categories

Tags

Statistics

1
Views
0
Clicks
0
Like
0
Dislike

Comments

Log In to post a comment

No comments yet. Be the first!