Commit a1fa70c9 authored by Robert Edmonds's avatar Robert Edmonds

'struct _ProtobufC' -> 'struct ProtobufC'

identifiers in any scope that begin with an underscore and a capital
letter are reserved in C.
parent 97b6aa36
...@@ -135,17 +135,17 @@ typedef enum { ...@@ -135,17 +135,17 @@ typedef enum {
PROTOBUF_C_TYPE_MESSAGE, PROTOBUF_C_TYPE_MESSAGE,
} ProtobufCType; } ProtobufCType;
typedef struct _ProtobufCBinaryData ProtobufCBinaryData; typedef struct ProtobufCBinaryData ProtobufCBinaryData;
struct _ProtobufCBinaryData { struct ProtobufCBinaryData {
size_t len; size_t len;
uint8_t *data; uint8_t *data;
}; };
typedef struct _ProtobufCIntRange ProtobufCIntRange; /* private */ typedef struct ProtobufCIntRange ProtobufCIntRange; /* private */
/* --- memory management --- */ /* --- memory management --- */
typedef struct _ProtobufCAllocator ProtobufCAllocator; typedef struct ProtobufCAllocator ProtobufCAllocator;
struct _ProtobufCAllocator struct ProtobufCAllocator
{ {
void *(*alloc)(void *allocator_data, size_t size); void *(*alloc)(void *allocator_data, size_t size);
void (*free)(void *allocator_data, void *pointer); void (*free)(void *allocator_data, void *pointer);
...@@ -163,8 +163,8 @@ struct _ProtobufCAllocator ...@@ -163,8 +163,8 @@ struct _ProtobufCAllocator
extern PROTOBUF_C_API ProtobufCAllocator protobuf_c_default_allocator; /* settable */ extern PROTOBUF_C_API ProtobufCAllocator protobuf_c_default_allocator; /* settable */
/* --- append-only data buffer --- */ /* --- append-only data buffer --- */
typedef struct _ProtobufCBuffer ProtobufCBuffer; typedef struct ProtobufCBuffer ProtobufCBuffer;
struct _ProtobufCBuffer { struct ProtobufCBuffer {
void (*append)(ProtobufCBuffer *buffer, void (*append)(ProtobufCBuffer *buffer,
size_t len, size_t len,
const uint8_t *data); const uint8_t *data);
...@@ -172,9 +172,9 @@ struct _ProtobufCBuffer { ...@@ -172,9 +172,9 @@ struct _ProtobufCBuffer {
/* --- enums --- */ /* --- enums --- */
typedef struct _ProtobufCEnumValue ProtobufCEnumValue; typedef struct ProtobufCEnumValue ProtobufCEnumValue;
typedef struct _ProtobufCEnumValueIndex ProtobufCEnumValueIndex; typedef struct ProtobufCEnumValueIndex ProtobufCEnumValueIndex;
typedef struct _ProtobufCEnumDescriptor ProtobufCEnumDescriptor; typedef struct ProtobufCEnumDescriptor ProtobufCEnumDescriptor;
/* /*
* ProtobufCEnumValue: this represents a single value of an enumeration. * ProtobufCEnumValue: this represents a single value of an enumeration.
...@@ -182,7 +182,7 @@ typedef struct _ProtobufCEnumDescriptor ProtobufCEnumDescriptor; ...@@ -182,7 +182,7 @@ typedef struct _ProtobufCEnumDescriptor ProtobufCEnumDescriptor;
* 'c_name' is the full name of the C enumeration value. * 'c_name' is the full name of the C enumeration value.
* 'value' is the number assigned to this value, as given in the .proto file. * 'value' is the number assigned to this value, as given in the .proto file.
*/ */
struct _ProtobufCEnumValue { struct ProtobufCEnumValue {
const char *name; const char *name;
const char *c_name; const char *c_name;
int value; int value;
...@@ -206,7 +206,7 @@ struct _ProtobufCEnumValue { ...@@ -206,7 +206,7 @@ struct _ProtobufCEnumValue {
* and protobuf_c_enum_descriptor_get_value() to efficiently * and protobuf_c_enum_descriptor_get_value() to efficiently
* lookup values in the descriptor. * lookup values in the descriptor.
*/ */
struct _ProtobufCEnumDescriptor { struct ProtobufCEnumDescriptor {
uint32_t magic; uint32_t magic;
const char *name; const char *name;
...@@ -234,9 +234,9 @@ struct _ProtobufCEnumDescriptor { ...@@ -234,9 +234,9 @@ struct _ProtobufCEnumDescriptor {
/* --- messages --- */ /* --- messages --- */
typedef struct _ProtobufCMessageDescriptor ProtobufCMessageDescriptor; typedef struct ProtobufCMessageDescriptor ProtobufCMessageDescriptor;
typedef struct _ProtobufCFieldDescriptor ProtobufCFieldDescriptor; typedef struct ProtobufCFieldDescriptor ProtobufCFieldDescriptor;
typedef struct _ProtobufCMessage ProtobufCMessage; typedef struct ProtobufCMessage ProtobufCMessage;
typedef void (*ProtobufCMessageInit)(ProtobufCMessage *); typedef void (*ProtobufCMessageInit)(ProtobufCMessage *);
/* /*
...@@ -259,7 +259,7 @@ typedef void (*ProtobufCMessageInit)(ProtobufCMessage *); ...@@ -259,7 +259,7 @@ typedef void (*ProtobufCMessageInit)(ProtobufCMessage *);
* 'flags' is a flag word. Zero or more of the bits defined in the * 'flags' is a flag word. Zero or more of the bits defined in the
* ProtobufCFieldFlag enum may be set. * ProtobufCFieldFlag enum may be set.
*/ */
struct _ProtobufCFieldDescriptor { struct ProtobufCFieldDescriptor {
const char *name; const char *name;
uint32_t id; uint32_t id;
ProtobufCLabel label; ProtobufCLabel label;
...@@ -298,7 +298,7 @@ typedef enum { ...@@ -298,7 +298,7 @@ typedef enum {
* 'fields_sorted_by_name', 'n_field_ranges' and 'field_ranges' * 'fields_sorted_by_name', 'n_field_ranges' and 'field_ranges'
* are used for looking up fields by name and id. (private) * are used for looking up fields by name and id. (private)
*/ */
struct _ProtobufCMessageDescriptor { struct ProtobufCMessageDescriptor {
uint32_t magic; uint32_t magic;
const char *name; const char *name;
...@@ -342,8 +342,8 @@ struct _ProtobufCMessageDescriptor { ...@@ -342,8 +342,8 @@ struct _ProtobufCMessageDescriptor {
* 'n_unknown_fields' is the number of fields we didn't recognize. * 'n_unknown_fields' is the number of fields we didn't recognize.
* 'unknown_fields' are fields we didn't recognize. * 'unknown_fields' are fields we didn't recognize.
*/ */
typedef struct _ProtobufCMessageUnknownField ProtobufCMessageUnknownField; typedef struct ProtobufCMessageUnknownField ProtobufCMessageUnknownField;
struct _ProtobufCMessage { struct ProtobufCMessage {
const ProtobufCMessageDescriptor *descriptor; const ProtobufCMessageDescriptor *descriptor;
unsigned n_unknown_fields; unsigned n_unknown_fields;
ProtobufCMessageUnknownField *unknown_fields; ProtobufCMessageUnknownField *unknown_fields;
...@@ -391,15 +391,15 @@ protobuf_c_message_init(const ProtobufCMessageDescriptor *, void *message); ...@@ -391,15 +391,15 @@ protobuf_c_message_init(const ProtobufCMessageDescriptor *, void *message);
/* --- services --- */ /* --- services --- */
typedef struct _ProtobufCMethodDescriptor ProtobufCMethodDescriptor; typedef struct ProtobufCMethodDescriptor ProtobufCMethodDescriptor;
struct _ProtobufCMethodDescriptor { struct ProtobufCMethodDescriptor {
const char *name; const char *name;
const ProtobufCMessageDescriptor *input; const ProtobufCMessageDescriptor *input;
const ProtobufCMessageDescriptor *output; const ProtobufCMessageDescriptor *output;
}; };
typedef struct _ProtobufCServiceDescriptor ProtobufCServiceDescriptor; typedef struct ProtobufCServiceDescriptor ProtobufCServiceDescriptor;
struct _ProtobufCServiceDescriptor { struct ProtobufCServiceDescriptor {
uint32_t magic; uint32_t magic;
const char *name; const char *name;
...@@ -413,8 +413,8 @@ struct _ProtobufCServiceDescriptor { ...@@ -413,8 +413,8 @@ struct _ProtobufCServiceDescriptor {
typedef void (*ProtobufCClosure)(const ProtobufCMessage *, void *closure_data); typedef void (*ProtobufCClosure)(const ProtobufCMessage *, void *closure_data);
typedef struct _ProtobufCService ProtobufCService; typedef struct ProtobufCService ProtobufCService;
struct _ProtobufCService { struct ProtobufCService {
const ProtobufCServiceDescriptor *descriptor; const ProtobufCServiceDescriptor *descriptor;
void (*invoke)(ProtobufCService *service, void (*invoke)(ProtobufCService *service,
unsigned method_index, unsigned method_index,
...@@ -467,7 +467,7 @@ typedef enum { ...@@ -467,7 +467,7 @@ typedef enum {
/* --- unknown message fields --- */ /* --- unknown message fields --- */
struct _ProtobufCMessageUnknownField { struct ProtobufCMessageUnknownField {
uint32_t tag; uint32_t tag;
ProtobufCWireType wire_type; ProtobufCWireType wire_type;
size_t len; size_t len;
...@@ -476,8 +476,8 @@ struct _ProtobufCMessageUnknownField { ...@@ -476,8 +476,8 @@ struct _ProtobufCMessageUnknownField {
/* --- extra (superfluous) api: trivial buffer --- */ /* --- extra (superfluous) api: trivial buffer --- */
typedef struct _ProtobufCBufferSimple ProtobufCBufferSimple; typedef struct ProtobufCBufferSimple ProtobufCBufferSimple;
struct _ProtobufCBufferSimple { struct ProtobufCBufferSimple {
ProtobufCBuffer base; ProtobufCBuffer base;
size_t alloced; size_t alloced;
size_t len; size_t len;
...@@ -529,7 +529,7 @@ protobuf_c_buffer_simple_append( ...@@ -529,7 +529,7 @@ protobuf_c_buffer_simple_append(
/* === stuff which needs to be declared for use in the generated code === */ /* === stuff which needs to be declared for use in the generated code === */
struct _ProtobufCEnumValueIndex { struct ProtobufCEnumValueIndex {
const char *name; const char *name;
unsigned index; /* into values[] array */ unsigned index; /* into values[] array */
}; };
...@@ -542,7 +542,7 @@ struct _ProtobufCEnumValueIndex { ...@@ -542,7 +542,7 @@ struct _ProtobufCEnumValueIndex {
* The data structures assumes that the values in the original array are * The data structures assumes that the values in the original array are
* sorted. * sorted.
*/ */
struct _ProtobufCIntRange { struct ProtobufCIntRange {
int start_value; int start_value;
unsigned orig_index; unsigned orig_index;
/* /*
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment