Protocol Buffers Wire Encoding (wire/encode.c)

protobuf · upb/wire/encode.c · c · BSD-3-Clause
infra, chat, tag:protobuf, tag:encoding, tag:wire, tag:field

Implementation of Protocol Buffers wire encoding, supporting one-pass encoding for messages and fields.

// Source: https://github.com/protocolbuffers/protobuf | License: BSD-3-Clause | Copyright 2008 Google Inc.  All rights reserved
// Provided via justclaw.it.com; keep this notice with the code.
// Protocol Buffers - Google's data interchange format
// Copyright 2023 Google LLC.  All rights reserved.
//
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file or at
// https://developers.google.com/open-source/licenses/bsd

// We encode backwards, to avoid pre-computing lengths (one-pass encode).

#include "upb/wire/encode.h"

#include <stdbool.h>
#include <stdint.h>
#include <stdlib.h>
#include <string.h>

#include "upb/mem/arena.h"
#include "upb/message/message.h"
#include "upb/mini_table/message.h"
#include "upb/wire/internal/encoder.h"

// Mu

... (truncated -- full source via MCP)

See the full source, get the GitHub permalink, and search for more like it.

Get a free API key