1 // Protocol Buffers - Google's data interchange format 2 // Copyright 2008 Google Inc. All rights reserved. 3 // 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 7 8 #import "GPBRuntimeTypes.h" 9 10 CF_EXTERN_C_BEGIN 11 12 NS_ASSUME_NONNULL_BEGIN 13 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 29 uint32_t GPBWireFormatMakeTag(uint32_t fieldNumber, GPBWireFormat wireType) __attribute__((const)); 30 GPBWireFormat GPBWireFormatGetTagWireType(uint32_t tag) __attribute__((const)); 31 uint32_t GPBWireFormatGetTagFieldNumber(uint32_t tag) __attribute__((const)); 32 BOOL GPBWireFormatIsValidTag(uint32_t tag) __attribute__((const)); 33 34 GPBWireFormat GPBWireFormatForType(GPBDataType dataType, BOOL isPacked) __attribute__((const)); 35 36 #define GPBWireFormatMessageSetItemTag \ 37 (GPBWireFormatMakeTag(GPBWireFormatMessageSetItem, GPBWireFormatStartGroup)) 38 #define GPBWireFormatMessageSetItemEndTag \ 39 (GPBWireFormatMakeTag(GPBWireFormatMessageSetItem, GPBWireFormatEndGroup)) 40 #define GPBWireFormatMessageSetTypeIdTag \ 41 (GPBWireFormatMakeTag(GPBWireFormatMessageSetTypeId, GPBWireFormatVarint)) 42 #define GPBWireFormatMessageSetMessageTag \ 43 (GPBWireFormatMakeTag(GPBWireFormatMessageSetMessage, GPBWireFormatLengthDelimited)) 44 45 NS_ASSUME_NONNULL_END 46 47 CF_EXTERN_C_END 48