GPBWireFormat.h 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  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. #import "GPBRuntimeTypes.h"
  8. CF_EXTERN_C_BEGIN
  9. NS_ASSUME_NONNULL_BEGIN
  10. typedef enum {
  11. GPBWireFormatVarint = 0,
  12. GPBWireFormatFixed64 = 1,
  13. GPBWireFormatLengthDelimited = 2,
  14. GPBWireFormatStartGroup = 3,
  15. GPBWireFormatEndGroup = 4,
  16. GPBWireFormatFixed32 = 5,
  17. } GPBWireFormat;
  18. enum {
  19. GPBWireFormatMessageSetItem = 1,
  20. GPBWireFormatMessageSetTypeId = 2,
  21. GPBWireFormatMessageSetMessage = 3
  22. };
  23. uint32_t GPBWireFormatMakeTag(uint32_t fieldNumber, GPBWireFormat wireType) __attribute__((const));
  24. GPBWireFormat GPBWireFormatGetTagWireType(uint32_t tag) __attribute__((const));
  25. uint32_t GPBWireFormatGetTagFieldNumber(uint32_t tag) __attribute__((const));
  26. BOOL GPBWireFormatIsValidTag(uint32_t tag) __attribute__((const));
  27. GPBWireFormat GPBWireFormatForType(GPBDataType dataType, BOOL isPacked) __attribute__((const));
  28. #define GPBWireFormatMessageSetItemTag \
  29. (GPBWireFormatMakeTag(GPBWireFormatMessageSetItem, GPBWireFormatStartGroup))
  30. #define GPBWireFormatMessageSetItemEndTag \
  31. (GPBWireFormatMakeTag(GPBWireFormatMessageSetItem, GPBWireFormatEndGroup))
  32. #define GPBWireFormatMessageSetTypeIdTag \
  33. (GPBWireFormatMakeTag(GPBWireFormatMessageSetTypeId, GPBWireFormatVarint))
  34. #define GPBWireFormatMessageSetMessageTag \
  35. (GPBWireFormatMakeTag(GPBWireFormatMessageSetMessage, GPBWireFormatLengthDelimited))
  36. NS_ASSUME_NONNULL_END
  37. CF_EXTERN_C_END