PageRenderTime 39ms CodeModel.GetById 14ms RepoModel.GetById 0ms app.codeStats 0ms

/iOS/Framework/AppBlade/CrashReporter/Dependencies/protobuf-2.0.3/src/protobuf-c-private.h

https://github.com/where/Fork_AppBlade_SDK
C Header | 66 lines | 23 code | 11 blank | 32 comment | 0 complexity | d7848670640b1391d1e4fee0bdc35093 MD5 | raw file
Possible License(s): CC-BY-SA-3.0, Apache-2.0
  1. /* --- protobuf-c-private.h: private structures and functions --- */
  2. /*
  3. * Copyright 2008, Dave Benson.
  4. *
  5. * Licensed under the Apache License, Version 2.0 (the "License");
  6. * you may not use this file except in compliance with
  7. * the License. You may obtain a copy of the License
  8. * at http://www.apache.org/licenses/LICENSE-2.0 Unless
  9. * required by applicable law or agreed to in writing,
  10. * software distributed under the License is distributed on
  11. * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
  12. * KIND, either express or implied. See the License for the
  13. * specific language governing permissions and limitations
  14. * under the License.
  15. */
  16. /* === needs to be declared for the PROTOBUF_C_BUFFER_SIMPLE_INIT macro === */
  17. void protobuf_c_buffer_simple_append (ProtobufCBuffer *buffer,
  18. size_t len,
  19. const unsigned char *data);
  20. /* === stuff which needs to be declared for use in the generated code === */
  21. struct _ProtobufCEnumValueIndex
  22. {
  23. const char *name;
  24. unsigned index; /* into values[] array */
  25. };
  26. /* IntRange: helper structure for optimizing
  27. int => index lookups
  28. in the case where the keys are mostly consecutive values,
  29. as they presumably are for enums and fields.
  30. The data structures assumes that the values in the original
  31. array are sorted */
  32. struct _ProtobufCIntRange
  33. {
  34. int start_value;
  35. unsigned orig_index;
  36. /* NOTE: the number of values in the range can
  37. be inferred by looking at the next element's orig_index.
  38. a dummy element is added to make this simple */
  39. };
  40. /* === declared for exposition on ProtobufCIntRange === */
  41. /* note: ranges must have an extra sentinel IntRange at the end whose
  42. orig_index is set to the number of actual values in the original array */
  43. /* returns -1 if no orig_index found */
  44. int protobuf_c_int_ranges_lookup (unsigned n_ranges,
  45. ProtobufCIntRange *ranges);
  46. #define PROTOBUF_C_SERVICE_DESCRIPTOR_MAGIC 0x14159bc3
  47. #define PROTOBUF_C_MESSAGE_DESCRIPTOR_MAGIC 0x28aaeef9
  48. #define PROTOBUF_C_ENUM_DESCRIPTOR_MAGIC 0x114315af
  49. /* === behind the scenes on the generated service's __init functions */
  50. typedef void (*ProtobufCServiceDestroy) (ProtobufCService *service);
  51. void
  52. protobuf_c_service_generated_init (ProtobufCService *service,
  53. const ProtobufCServiceDescriptor *descriptor,
  54. ProtobufCServiceDestroy destroy);