Commit 00b5c56f authored by lahiker42's avatar lahiker42

make protobuf_c_message_init() into a function (Issue #49)

git-svn-id: https://protobuf-c.googlecode.com/svn/trunk@257 00440858-1255-0410-a3e6-75ea37f81c3a
parent e9cfa2dd
0.15 (NOT YET RELEASED)
- make protobuf_c_message_init() into a function (Issue #49, daveb)
0.14: 0.14:
- build fix (missing dependency in test directory) - build fix (missing dependency in test directory)
- add generation / installation of pkg-config files. (Bobby Powers) - add generation / installation of pkg-config files. (Bobby Powers)
......
...@@ -2433,6 +2433,13 @@ protobuf_c_message_free_unpacked (ProtobufCMessage *message, ...@@ -2433,6 +2433,13 @@ protobuf_c_message_free_unpacked (ProtobufCMessage *message,
FREE (allocator, message); FREE (allocator, message);
} }
void
protobuf_c_message_init (const ProtobufCMessageDescriptor *descriptor,
void *message)
{
descriptor->message_init((ProtobufCMessage*) (message));
}
/* === services === */ /* === services === */
typedef void (*GenericHandler)(void *service, typedef void (*GenericHandler)(void *service,
const ProtobufCMessage *input, const ProtobufCMessage *input,
......
...@@ -333,7 +333,8 @@ void protobuf_c_message_free_unpacked (ProtobufCMessage *message, ...@@ -333,7 +333,8 @@ void protobuf_c_message_free_unpacked (ProtobufCMessage *message,
/* WARNING: 'message' must be a block of memory /* WARNING: 'message' must be a block of memory
of size descriptor->sizeof_message. */ of size descriptor->sizeof_message. */
#define protobuf_c_message_init(descriptor, message) ((descriptor)->message_init((ProtobufCMessage*) (message))) void protobuf_c_message_init (const ProtobufCMessageDescriptor *,
void *message);
/* --- services --- */ /* --- services --- */
typedef struct _ProtobufCMethodDescriptor ProtobufCMethodDescriptor; typedef struct _ProtobufCMethodDescriptor ProtobufCMethodDescriptor;
......
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