Thomas Van Lenten | 30650d8 | 2015-05-01 08:57:16 -0400 | [diff] [blame] | 1 | // Protocol Buffers - Google's data interchange format |
| 2 | // Copyright 2008 Google Inc. All rights reserved. |
Thomas Van Lenten | 30650d8 | 2015-05-01 08:57:16 -0400 | [diff] [blame] | 3 | // |
Joshua Haberman | 44bd65b | 2023-09-08 17:43:14 -0700 | [diff] [blame] | 4 | // 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 Lenten | 30650d8 | 2015-05-01 08:57:16 -0400 | [diff] [blame] | 7 | |
Thomas Van Lenten | d846b0b | 2015-06-08 16:24:57 -0400 | [diff] [blame] | 8 | #import "GPBRuntimeTypes.h" |
Thomas Van Lenten | 30650d8 | 2015-05-01 08:57:16 -0400 | [diff] [blame] | 9 | |
| 10 | CF_EXTERN_C_BEGIN |
| 11 | |
Thomas Van Lenten | 8c88957 | 2015-06-16 16:45:14 -0400 | [diff] [blame] | 12 | NS_ASSUME_NONNULL_BEGIN |
| 13 | |
Thomas Van Lenten | 30650d8 | 2015-05-01 08:57:16 -0400 | [diff] [blame] | 14 | typedef enum { |
| 15 | GPBWireFormatVarint = 0, |
| 16 | GPBWireFormatFixed64 = 1, |
| 17 | GPBWireFormatLengthDelimited = 2, |
| 18 | GPBWireFormatStartGroup = 3, |
| 19 | GPBWireFormatEndGroup = 4, |
| 20 | GPBWireFormatFixed32 = 5, |
| 21 | } GPBWireFormat; |
| 22 | |
| 23 | enum { |
| 24 | GPBWireFormatMessageSetItem = 1, |
| 25 | GPBWireFormatMessageSetTypeId = 2, |
| 26 | GPBWireFormatMessageSetMessage = 3 |
| 27 | }; |
| 28 | |
Protobuf Team Bot | 242771a | 2023-06-05 00:18:59 -0700 | [diff] [blame] | 29 | uint32_t GPBWireFormatMakeTag(uint32_t fieldNumber, GPBWireFormat wireType) __attribute__((const)); |
Thomas Van Lenten | 30650d8 | 2015-05-01 08:57:16 -0400 | [diff] [blame] | 30 | GPBWireFormat GPBWireFormatGetTagWireType(uint32_t tag) __attribute__((const)); |
| 31 | uint32_t GPBWireFormatGetTagFieldNumber(uint32_t tag) __attribute__((const)); |
Thomas Van Lenten | c18aa77 | 2016-06-29 09:51:13 -0400 | [diff] [blame] | 32 | BOOL GPBWireFormatIsValidTag(uint32_t tag) __attribute__((const)); |
Thomas Van Lenten | 30650d8 | 2015-05-01 08:57:16 -0400 | [diff] [blame] | 33 | |
Protobuf Team Bot | 242771a | 2023-06-05 00:18:59 -0700 | [diff] [blame] | 34 | GPBWireFormat GPBWireFormatForType(GPBDataType dataType, BOOL isPacked) __attribute__((const)); |
Thomas Van Lenten | 30650d8 | 2015-05-01 08:57:16 -0400 | [diff] [blame] | 35 | |
| 36 | #define GPBWireFormatMessageSetItemTag \ |
| 37 | (GPBWireFormatMakeTag(GPBWireFormatMessageSetItem, GPBWireFormatStartGroup)) |
| 38 | #define GPBWireFormatMessageSetItemEndTag \ |
| 39 | (GPBWireFormatMakeTag(GPBWireFormatMessageSetItem, GPBWireFormatEndGroup)) |
| 40 | #define GPBWireFormatMessageSetTypeIdTag \ |
| 41 | (GPBWireFormatMakeTag(GPBWireFormatMessageSetTypeId, GPBWireFormatVarint)) |
Protobuf Team Bot | 242771a | 2023-06-05 00:18:59 -0700 | [diff] [blame] | 42 | #define GPBWireFormatMessageSetMessageTag \ |
| 43 | (GPBWireFormatMakeTag(GPBWireFormatMessageSetMessage, GPBWireFormatLengthDelimited)) |
Thomas Van Lenten | 30650d8 | 2015-05-01 08:57:16 -0400 | [diff] [blame] | 44 | |
Thomas Van Lenten | 8c88957 | 2015-06-16 16:45:14 -0400 | [diff] [blame] | 45 | NS_ASSUME_NONNULL_END |
| 46 | |
Thomas Van Lenten | 30650d8 | 2015-05-01 08:57:16 -0400 | [diff] [blame] | 47 | CF_EXTERN_C_END |