blob: 557e023f47cba727350549b4c1587fc21f15e50b [file] [log] [blame]
Thomas Van Lenten30650d82015-05-01 08:57:16 -04001// Protocol Buffers - Google's data interchange format
2// Copyright 2008 Google Inc. All rights reserved.
Thomas Van Lenten30650d82015-05-01 08:57:16 -04003//
Joshua Haberman44bd65b2023-09-08 17:43:14 -07004// Use of this source code is governed by a BSD-style
5// license that can be found in the LICENSE file or at
6// https://developers.google.com/open-source/licenses/bsd
Thomas Van Lenten30650d82015-05-01 08:57:16 -04007
Thomas Van Lentend846b0b2015-06-08 16:24:57 -04008#import "GPBRuntimeTypes.h"
Thomas Van Lenten30650d82015-05-01 08:57:16 -04009
10CF_EXTERN_C_BEGIN
11
Thomas Van Lenten8c889572015-06-16 16:45:14 -040012NS_ASSUME_NONNULL_BEGIN
13
Thomas Van Lenten30650d82015-05-01 08:57:16 -040014typedef enum {
15 GPBWireFormatVarint = 0,
16 GPBWireFormatFixed64 = 1,
17 GPBWireFormatLengthDelimited = 2,
18 GPBWireFormatStartGroup = 3,
19 GPBWireFormatEndGroup = 4,
20 GPBWireFormatFixed32 = 5,
21} GPBWireFormat;
22
23enum {
24 GPBWireFormatMessageSetItem = 1,
25 GPBWireFormatMessageSetTypeId = 2,
26 GPBWireFormatMessageSetMessage = 3
27};
28
Protobuf Team Bot242771a2023-06-05 00:18:59 -070029uint32_t GPBWireFormatMakeTag(uint32_t fieldNumber, GPBWireFormat wireType) __attribute__((const));
Thomas Van Lenten30650d82015-05-01 08:57:16 -040030GPBWireFormat GPBWireFormatGetTagWireType(uint32_t tag) __attribute__((const));
31uint32_t GPBWireFormatGetTagFieldNumber(uint32_t tag) __attribute__((const));
Thomas Van Lentenc18aa772016-06-29 09:51:13 -040032BOOL GPBWireFormatIsValidTag(uint32_t tag) __attribute__((const));
Thomas Van Lenten30650d82015-05-01 08:57:16 -040033
Protobuf Team Bot242771a2023-06-05 00:18:59 -070034GPBWireFormat GPBWireFormatForType(GPBDataType dataType, BOOL isPacked) __attribute__((const));
Thomas Van Lenten30650d82015-05-01 08:57:16 -040035
36#define GPBWireFormatMessageSetItemTag \
37 (GPBWireFormatMakeTag(GPBWireFormatMessageSetItem, GPBWireFormatStartGroup))
38#define GPBWireFormatMessageSetItemEndTag \
39 (GPBWireFormatMakeTag(GPBWireFormatMessageSetItem, GPBWireFormatEndGroup))
40#define GPBWireFormatMessageSetTypeIdTag \
41 (GPBWireFormatMakeTag(GPBWireFormatMessageSetTypeId, GPBWireFormatVarint))
Protobuf Team Bot242771a2023-06-05 00:18:59 -070042#define GPBWireFormatMessageSetMessageTag \
43 (GPBWireFormatMakeTag(GPBWireFormatMessageSetMessage, GPBWireFormatLengthDelimited))
Thomas Van Lenten30650d82015-05-01 08:57:16 -040044
Thomas Van Lenten8c889572015-06-16 16:45:14 -040045NS_ASSUME_NONNULL_END
46
Thomas Van Lenten30650d82015-05-01 08:57:16 -040047CF_EXTERN_C_END