summaryrefslogtreecommitdiff
path: root/libs/libaxolotl/src/protobuf-c/protobuf-c.h
diff options
context:
space:
mode:
authorGluzskiy Alexandr <sss@sss.chaoslab.ru>2017-02-13 07:56:33 +0300
committerGluzskiy Alexandr <sss@sss.chaoslab.ru>2017-02-13 09:09:08 +0300
commit193f645f65ad4ffdec3186e4176b23af10861199 (patch)
treee1b16b48ac74c5f03f99a98798e849f6dd9752cc /libs/libaxolotl/src/protobuf-c/protobuf-c.h
parent36c32a13878d3bd94e88bd9c764f1eadb05ea1ed (diff)
libs:
libaxolotl: updated libaxolotl (libsignal-c) from (https://github.com/WhisperSystems/libsignal-protocol-c)
Diffstat (limited to 'libs/libaxolotl/src/protobuf-c/protobuf-c.h')
-rw-r--r--libs/libaxolotl/src/protobuf-c/protobuf-c.h36
1 files changed, 27 insertions, 9 deletions
diff --git a/libs/libaxolotl/src/protobuf-c/protobuf-c.h b/libs/libaxolotl/src/protobuf-c/protobuf-c.h
index 55156a0510..705a1f7003 100644
--- a/libs/libaxolotl/src/protobuf-c/protobuf-c.h
+++ b/libs/libaxolotl/src/protobuf-c/protobuf-c.h
@@ -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
@@ -205,10 +221,9 @@ PROTOBUF_C__BEGIN_DECLS
# define PROTOBUF_C__API
#endif
-#if !defined(PROTOBUF_C__NO_DEPRECATED)
-# if (__GNUC__ > 3) || (__GNUC__ == 3 && __GNUC_MINOR__ >= 1)
-# define PROTOBUF_C__DEPRECATED __attribute__((__deprecated__))
-# endif
+#if !defined(PROTOBUF_C__NO_DEPRECATED) && \
+ ((__GNUC__ > 3) || (__GNUC__ == 3 && __GNUC_MINOR__ >= 1))
+# define PROTOBUF_C__DEPRECATED __attribute__((__deprecated__))
#else
# define PROTOBUF_C__DEPRECATED
#endif
@@ -240,6 +255,9 @@ typedef enum {
/** Set if the field is marked with the `deprecated` option. */
PROTOBUF_C_FIELD_FLAG_DEPRECATED = (1 << 1),
+
+ /** Set if the field is a member of a oneof (union). */
+ PROTOBUF_C_FIELD_FLAG_ONEOF = (1 << 2),
} ProtobufCFieldFlag;
/**
@@ -546,7 +564,7 @@ struct ProtobufCFieldDescriptor {
/**
* The offset in bytes of the message's C structure's quantifier field
* (the `has_MEMBER` field for optional members or the `n_MEMBER` field
- * for repeated members.
+ * for repeated members or the case enum for oneofs).
*/
unsigned quantifier_offset;
@@ -763,13 +781,13 @@ protobuf_c_version_number(void);
* The version of the protobuf-c headers, represented as a string using the same
* format as protobuf_c_version().
*/
-#define PROTOBUF_C_VERSION "1.0.1"
+#define PROTOBUF_C_VERSION "1.1.1"
/**
* The version of the protobuf-c headers, represented as an integer using the
* same format as protobuf_c_version_number().
*/
-#define PROTOBUF_C_VERSION_NUMBER 1000001
+#define PROTOBUF_C_VERSION_NUMBER 1001001
/**
* The minimum protoc-c version which works with the current version of the