aboutsummaryrefslogtreecommitdiff
path: root/ruby/ext/google/protobuf_c/protobuf.h
diff options
context:
space:
mode:
authorChris Fallin <cfallin@c1f.net>2015-01-06 18:01:32 -0800
committerChris Fallin <cfallin@c1f.net>2015-01-06 18:01:32 -0800
commit80276ac0218f6d8fcdbad0fb09b233b31d2bc0fb (patch)
tree9500a829302bcc5c490aeb28c0fbe77b580b424f /ruby/ext/google/protobuf_c/protobuf.h
parentfd1a3ff11d5854c34ba66c63598cdc5fd234e399 (diff)
downloadprotobuf-80276ac0218f6d8fcdbad0fb09b233b31d2bc0fb.tar.gz
protobuf-80276ac0218f6d8fcdbad0fb09b233b31d2bc0fb.tar.bz2
protobuf-80276ac0218f6d8fcdbad0fb09b233b31d2bc0fb.zip
Addressed code-review comments.
Diffstat (limited to 'ruby/ext/google/protobuf_c/protobuf.h')
-rw-r--r--ruby/ext/google/protobuf_c/protobuf.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/ruby/ext/google/protobuf_c/protobuf.h b/ruby/ext/google/protobuf_c/protobuf.h
index 91a97a68..6dac6029 100644
--- a/ruby/ext/google/protobuf_c/protobuf.h
+++ b/ruby/ext/google/protobuf_c/protobuf.h
@@ -268,10 +268,19 @@ extern rb_encoding* kRubyString8bitEncoding;
VALUE field_type_class(const upb_fielddef* field);
+#define MAP_KEY_FIELD 1
+#define MAP_VALUE_FIELD 2
+
+// These operate on a map field (i.e., a repeated field of submessages whose
+// submessage type is a map-entry msgdef).
bool is_map_field(const upb_fielddef* field);
const upb_fielddef* map_field_key(const upb_fielddef* field);
const upb_fielddef* map_field_value(const upb_fielddef* field);
+// These operate on a map-entry msgdef.
+const upb_fielddef* map_entry_key(const upb_msgdef* msgdef);
+const upb_fielddef* map_entry_value(const upb_msgdef* msgdef);
+
// -----------------------------------------------------------------------------
// Repeated field container type.
// -----------------------------------------------------------------------------