navit  0.5.1-trunk
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Macros Groups
protobuf-c-private.h
Go to the documentation of this file.
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 
17 
18 /* === needs to be declared for the PROTOBUF_C_BUFFER_SIMPLE_INIT macro === */
19 
21  size_t len,
22  const unsigned char *data);
23 
24 /* === stuff which needs to be declared for use in the generated code === */
25 
27 {
28  const char *name;
29  unsigned index; /* into values[] array */
30 };
31 
32 /* IntRange: helper structure for optimizing
33  int => index lookups
34  in the case where the keys are mostly consecutive values,
35  as they presumably are for enums and fields.
36 
37  The data structures assumes that the values in the original
38  array are sorted */
40 {
42  unsigned orig_index;
43  /* NOTE: the number of values in the range can
44  be inferred by looking at the next element's orig_index.
45  a dummy element is added to make this simple */
46 };
47 
48 
49 /* === declared for exposition on ProtobufCIntRange === */
50 /* note: ranges must have an extra sentinel IntRange at the end whose
51  orig_index is set to the number of actual values in the original array */
52 /* returns -1 if no orig_index found */
53 int protobuf_c_int_ranges_lookup (unsigned n_ranges,
54  ProtobufCIntRange *ranges);
55 
56 #define PROTOBUF_C_SERVICE_DESCRIPTOR_MAGIC 0x14159bc3
57 #define PROTOBUF_C_MESSAGE_DESCRIPTOR_MAGIC 0x28aaeef9
58 #define PROTOBUF_C_ENUM_DESCRIPTOR_MAGIC 0x114315af
59 
60 /* === behind the scenes on the generated service's __init functions */
61 typedef void (*ProtobufCServiceDestroy) (ProtobufCService *service);
62 void
64  const ProtobufCServiceDescriptor *descriptor,
65  ProtobufCServiceDestroy destroy);
66 
67 void
69  unsigned method_index,
70  const ProtobufCMessage *input,
71  ProtobufCClosure closure,
72  void *closure_data);
const char * name
Definition: protobuf-c-private.h:28
void(* ProtobufCServiceDestroy)(ProtobufCService *service)
Definition: protobuf-c-private.h:61
Definition: protobuf-c.h:304
unsigned index
Definition: protobuf-c-private.h:29
void(* ProtobufCClosure)(const ProtobufCMessage *message, void *closure_data)
Definition: protobuf-c.h:362
Definition: protobuf-c-private.h:26
unsigned orig_index
Definition: protobuf-c-private.h:42
void protobuf_c_service_invoke_internal(ProtobufCService *service, unsigned method_index, const ProtobufCMessage *input, ProtobufCClosure closure, void *closure_data)
Definition: protobuf-c.c:2449
Definition: protobuf-c.h:136
char data
Definition: garmin_img.c:354
Definition: protobuf-c.h:364
void protobuf_c_buffer_simple_append(ProtobufCBuffer *buffer, size_t len, const unsigned char *data)
void protobuf_c_service_generated_init(ProtobufCService *service, const ProtobufCServiceDescriptor *descriptor, ProtobufCServiceDestroy destroy)
Definition: protobuf-c.c:2476
Definition: maptool.h:168
Definition: protobuf-c.h:348
Definition: protobuf-c-private.h:39
int protobuf_c_int_ranges_lookup(unsigned n_ranges, ProtobufCIntRange *ranges)
int start_value
Definition: protobuf-c-private.h:41