Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
P
protobuf-c
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Libraries
protobuf-c
Commits
8eec9c90
Commit
8eec9c90
authored
Dec 06, 2014
by
Ilya Lipnitskiy
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
protobuf-c.h: Add docs for generated message init macro and function
parent
c23348a1
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
2 deletions
+18
-2
protobuf-c/protobuf-c.h
protobuf-c/protobuf-c.h
+18
-2
No files found.
protobuf-c/protobuf-c.h
View file @
8eec9c90
...
...
@@ -106,9 +106,25 @@ extern const ProtobufCMessageDescriptor foo__bar__baz_bah__descriptor;
* sufficient to allow them to be cast to `ProtobufCMessage`.
*
* For each message defined in a `.proto` file, we generate a number of
* functions
. Each function name contains a prefix based on the package name and
* message name in order to make it a unique C identifier.
* functions
and macros. Each function name contains a prefix based on the
*
package name and
message name in order to make it a unique C identifier.
*
* - `INIT`. Statically initializes a message object, initializing its
* descriptor and setting its fields to default values. Uninitialized
* messages cannot be processed by the protobuf-c library.
*
~~~{.c}
#define FOO__BAR__BAZ_BAH__INIT \
{ PROTOBUF_C_MESSAGE_INIT (&foo__bar__baz_bah__descriptor), 0 }
~~~
* - `init()`. Initializes a message object, initializing its descriptor and
* setting its fields to default values. Uninitialized messages cannot be
* processed by the protobuf-c library.
*
~~~{.c}
void foo__bar__baz_bah__init
(Foo__Bar__BazBah *message);
~~~
* - `unpack()`. Unpacks data for a particular message format. Note that the
* `allocator` parameter is usually `NULL` to indicate that the system's
* `malloc()` and `free()` functions should be used for dynamically allocating
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment