Go to the documentation of this file.
31 #ifndef __GOOGLE_PROTOBUF_RUBY_PROTOBUF_H__
32 #define __GOOGLE_PROTOBUF_RUBY_PROTOBUF_H__
34 #include <ruby/ruby.h>
36 #include <ruby/encoding.h>
337 #define NATIVE_SLOT_MAX_SIZE sizeof(uint64_t)
353 uint32_t* case_memory,
354 uint32_t case_number);
373 #define MAP_KEY_FIELD 1
374 #define MAP_VALUE_FIELD 2
379 #define ONEOF_CASE_NONE 0
453 VALUE
Map_init(
int argc, VALUE* argv, VALUE
self);
457 extern const rb_data_type_t
Map_type;
473 VALUE
Map_eq(VALUE _self, VALUE _other);
477 VALUE
Map_merge(VALUE _self, VALUE hashmap);
495 #define MESSAGE_FIELD_NO_CASE ((size_t)-1)
496 #define MESSAGE_FIELD_NO_HASBIT ((size_t)-1)
592 #define ENCODE_MAX_NESTING 63
607 #define CHECK_UPB(code, msg) do { \
608 upb_status status = UPB_STATUS_INIT; \
610 check_upb_status(&status, msg); \
615 #endif // __GOOGLE_PROTOBUF_RUBY_PROTOBUF_H__
void RepeatedField_push_native(VALUE _self, void *data)
void native_slot_dup(upb_fieldtype_t type, void *to, void *from)
void free_layout(MessageLayout *layout)
VALUE Map_merge_into_self(VALUE _self, VALUE hashmap)
VALUE EnumDescriptor_file_descriptor(VALUE _self)
VALUE cMessageBuilderContext
const upb_msgdef * msgdef
struct RepeatedField RepeatedField
VALUE FileDescriptor_alloc(VALUE klass)
MessageLayout * create_layout(const upb_msgdef *msgdef)
const upb_oneofdef * oneofdef
DescriptorPool * ruby_to_DescriptorPool(VALUE value)
VALUE Message_initialize(int argc, VALUE *argv, VALUE _self)
GLuint const GLchar * name
VALUE native_slot_get(upb_fieldtype_t type, VALUE type_class, const void *memory)
void stringsink_uninit(stringsink *sink)
void RepeatedField_mark(void *self)
VALUE MessageBuilderContext_repeated(int argc, VALUE *argv, VALUE _self)
VALUE Map_has_key(VALUE _self, VALUE key)
VALUE Descriptor_alloc(VALUE klass)
void Descriptor_mark(void *_self)
void Message_free(void *self)
VALUE Google_Protobuf_discard_unknown(VALUE self, VALUE msg_rb)
FieldDescriptor * ruby_to_FieldDescriptor(VALUE value)
void add_def_obj(const void *def, VALUE value)
VALUE layout_hash(MessageLayout *layout, void *storage)
VALUE Map_hash(VALUE _self)
VALUE Map_init(int argc, VALUE *argv, VALUE self)
VALUE Descriptor_file_descriptor(VALUE _self)
VALUE Map_index(VALUE _self, VALUE key)
VALUE Message_inspect(VALUE _self)
OneofDescriptor * ruby_to_OneofDescriptor(VALUE value)
void FieldDescriptor_register(VALUE module)
VALUE layout_get(MessageLayout *layout, const void *storage, const upb_fielddef *field)
VALUE FieldDescriptor_default_set(VALUE _self, VALUE default_value)
void Builder_register(VALUE module)
const upb_fielddef * fielddef
void layout_set(MessageLayout *layout, void *storage, const upb_fielddef *field, VALUE val)
VALUE Map_each(VALUE _self)
VALUE MessageBuilderContext_initialize(VALUE _self, VALUE descriptor, VALUE builder)
VALUE Message_eq(VALUE _self, VALUE _other)
VALUE enum_resolve(VALUE self, VALUE sym)
VALUE FieldDescriptor_type(VALUE _self)
VALUE Message_decode_json(int argc, VALUE *argv, VALUE klass)
FileDescriptor * ruby_to_FileDescriptor(VALUE value)
void layout_init(MessageLayout *layout, void *storage)
const upb_enumdef * enumdef
VALUE Descriptor_lookup(VALUE _self, VALUE name)
VALUE EnumDescriptor_name_set(VALUE _self, VALUE str)
VALUE Map_iter_key(Map_iter *iter)
VALUE Message_descriptor(VALUE klass)
VALUE Message_decode(VALUE klass, VALUE data)
VALUE MessageBuilderContext_alloc(VALUE klass)
VALUE Message_index(VALUE _self, VALUE field_name)
void MessageBuilderContext_register(VALUE module)
const rb_data_type_t _EnumDescriptor_type
VALUE RepeatedField_insert(int argc, VALUE *argv, VALUE _self)
VALUE RepeatedField_to_ary(VALUE _self)
VALUE Message_encode(VALUE klass, VALUE msg_rb)
VALUE Message_hash(VALUE _self)
GLuint GLsizei const GLchar * label
void FieldDescriptor_mark(void *_self)
void MessageBuilderContext_free(void *_self)
VALUE RepeatedField_init(int argc, VALUE *argv, VALUE self)
VALUE RepeatedField_clear(VALUE _self)
VALUE RepeatedField_push(VALUE _self, VALUE val)
void native_slot_set_value_and_case(const char *name, upb_fieldtype_t type, VALUE type_class, void *memory, VALUE value, uint32_t *case_memory, uint32_t case_number)
Map * ruby_to_Map(VALUE value)
void DescriptorPool_mark(void *_self)
void validate_type_class(upb_fieldtype_t type, VALUE klass)
Descriptor * ruby_to_Descriptor(VALUE value)
VALUE FileBuilderContext_add_message(VALUE _self, VALUE name)
void MessageBuilderContext_mark(void *_self)
void * Message_data(void *msg)
VALUE layout_inspect(MessageLayout *layout, void *storage)
VALUE layout_get_default(const upb_fielddef *field)
void Builder_free(void *_self)
VALUE field_type_class(const upb_fielddef *field)
upb_fieldtype_t field_type
void Descriptor_free(void *_self)
VALUE OneofDescriptor_name(VALUE _self)
upb_fieldtype_t ruby_to_fieldtype(VALUE type)
void Map_begin(VALUE _self, Map_iter *iter)
VALUE RepeatedField_length(VALUE _self)
VALUE Descriptor_add_oneof(VALUE _self, VALUE obj)
void RepeatedField_free(void *self)
void native_slot_init(upb_fieldtype_t type, void *memory)
VALUE Message_method_missing(int argc, VALUE *argv, VALUE _self)
VALUE cFileBuilderContext
VALUE Map_clear(VALUE _self)
VALUE Map_eq(VALUE _self, VALUE _other)
void OneofBuilderContext_register(VALUE module)
VALUE FieldDescriptor_name(VALUE _self)
VALUE Descriptor_name_set(VALUE _self, VALUE str)
VALUE Builder_initialize(VALUE _self)
void Builder_mark(void *_self)
void OneofBuilderContext_mark(void *_self)
VALUE layout_eq(MessageLayout *layout, void *msg1, void *msg2)
void EnumDescriptor_register(VALUE module)
VALUE FieldDescriptor_label_set(VALUE _self, VALUE label)
void EnumDescriptor_free(void *_self)
bool native_slot_eq(upb_fieldtype_t type, void *mem1, void *mem2)
const upb_fielddef * map_entry_key(const upb_msgdef *msgdef)
VALUE Map_set_frame(VALUE self, VALUE val)
VALUE Map_to_h(VALUE _self)
const upb_fielddef * map_field_key(const upb_fielddef *field)
VALUE MessageBuilderContext_oneof(VALUE _self, VALUE name)
void FileDescriptor_free(void *_self)
VALUE Builder_add_file(int argc, VALUE *argv, VALUE _self)
const upb_fielddef * map_entry_value(const upb_msgdef *msgdef)
Builder * ruby_to_Builder(VALUE value)
VALUE Message_encode_json(int argc, VALUE *argv, VALUE klass)
void DescriptorPool_free(void *_self)
VALUE MessageBuilderContext_optional(int argc, VALUE *argv, VALUE _self)
VALUE enum_lookup(VALUE self, VALUE number)
VALUE FileBuilderContext_add_enum(VALUE _self, VALUE name)
VALUE Descriptor_add_field(VALUE _self, VALUE obj)
void Map_next(Map_iter *iter)
VALUE FieldDescriptor_submsg_name_set(VALUE _self, VALUE value)
VALUE build_module_from_enumdesc(EnumDescriptor *enumdef)
VALUE Message_index_set(VALUE _self, VALUE field_name, VALUE value)
VALUE FileBuilderContext_alloc(VALUE klass)
const rb_data_type_t _Descriptor_type
VALUE cOneofBuilderContext
GLsizei GLsizei GLuint * obj
VALUE Message_to_h(VALUE _self)
void FieldDescriptor_free(void *_self)
VALUE RepeatedField_index(int argc, VALUE *argv, VALUE _self)
VALUE FieldDescriptor_alloc(VALUE klass)
void OneofBuilderContext_free(void *_self)
VALUE cEnumBuilderContext
VALUE Descriptor_each(VALUE _self)
const upb_msgdef * msgdef
VALUE FileBuilderContext_initialize(VALUE _self, VALUE file_descriptor, VALUE builder)
VALUE FieldDescriptor_get(VALUE _self, VALUE msg_rb)
void native_slot_mark(upb_fieldtype_t type, void *memory)
void DescriptorPool_register(VALUE module)
const upb_json_parsermethod * json_fill_method
void OneofDescriptor_mark(void *_self)
VALUE Message_dup(VALUE _self)
VALUE RepeatedField_replace(VALUE _self, VALUE list)
VALUE FieldDescriptor_default(VALUE _self)
VALUE FieldDescriptor_type_set(VALUE _self, VALUE type)
VALUE EnumDescriptor_enummodule(VALUE _self)
bool Map_done(Map_iter *iter)
void FileDescriptor_mark(void *_self)
VALUE FileBuilderContext_pending_descriptors(VALUE _self)
void check_upb_status(const upb_status *status, const char *msg)
void FileBuilderContext_mark(void *_self)
void layout_clear(MessageLayout *layout, const void *storage, const upb_fielddef *field)
VALUE DescriptorPool_build(int argc, VALUE *argv, VALUE _self)
VALUE Map_merge(VALUE _self, VALUE hashmap)
void FileBuilderContext_free(void *_self)
VALUE EnumDescriptor_name(VALUE _self)
VALUE Descriptor_lookup_oneof(VALUE _self, VALUE name)
void layout_deep_copy(MessageLayout *layout, void *to, void *from)
VALUE Builder_add_message(VALUE _self, VALUE name)
VALUE MessageBuilderContext_required(int argc, VALUE *argv, VALUE _self)
void OneofDescriptor_register(VALUE module)
VALUE OneofDescriptor_alloc(VALUE klass)
void native_slot_deep_copy(upb_fieldtype_t type, void *to, void *from)
VALUE Builder_alloc(VALUE klass)
VALUE FileDescriptor_syntax_set(VALUE _self, VALUE syntax)
VALUE Builder_add_enum(VALUE _self, VALUE name)
void EnumDescriptor_mark(void *_self)
void EnumBuilderContext_register(VALUE module)
void RepeatedField_register(VALUE module)
VALUE RepeatedField_each(VALUE _self)
VALUE layout_has(MessageLayout *layout, const void *storage, const upb_fielddef *field)
VALUE FieldDescriptor_number(VALUE _self)
VALUE DescriptorPool_add(VALUE _self, VALUE def)
VALUE RepeatedField_inspect(VALUE _self)
const upb_handlers * pb_serialize_handlers
const upb_pbdecodermethod * new_fillmsg_decodermethod(Descriptor *descriptor, const void *owner)
const FieldDescriptor * field
const SETUP_TEARDOWN_TESTCONTEXT char * key
void native_slot_check_int_range_precision(const char *name, upb_fieldtype_t type, VALUE value)
VALUE FieldDescriptor_number_set(VALUE _self, VALUE number)
VALUE FileDescriptor_syntax(VALUE _self)
VALUE RepeatedField_index_set(VALUE _self, VALUE _index, VALUE val)
void RepeatedField_reserve(RepeatedField *self, int new_size)
OneofBuilderContext * ruby_to_OneofBuilderContext(VALUE value)
VALUE FieldDescriptor_set(VALUE _self, VALUE msg_rb, VALUE value)
VALUE EnumBuilderContext_value(VALUE _self, VALUE name, VALUE number)
VALUE fieldtype_to_ruby(upb_fieldtype_t type)
VALUE FileDescriptor_initialize(int argc, VALUE *argv, VALUE _self)
VALUE EnumDescriptor_initialize(VALUE _self, VALUE file_descriptor_rb)
const rb_data_type_t Map_type
VALUE EnumDescriptor_lookup_name(VALUE _self, VALUE name)
void OneofDescriptor_free(void *_self)
VALUE FileDescriptor_name(VALUE _self)
void layout_dup(MessageLayout *layout, void *to, void *from)
VALUE get_def_obj(const void *def)
rb_data_type_t Message_type
VALUE build_class_from_descriptor(Descriptor *descriptor)
VALUE Map_dup(VALUE _self)
VALUE Map_deep_copy(VALUE _self)
VALUE RepeatedField_pop_one(VALUE _self)
VALUE FieldDescriptor_label(VALUE _self)
VALUE RepeatedField_hash(VALUE _self)
VALUE Message_deep_copy(VALUE _self)
VALUE RepeatedField_dup(VALUE _self)
void FileDescriptor_register(VALUE module)
rb_encoding * kRubyStringUtf8Encoding
void Map_register(VALUE module)
VALUE OneofBuilderContext_initialize(VALUE _self, VALUE descriptor, VALUE builder)
bool is_map_field(const upb_fielddef *field)
void EnumBuilderContext_mark(void *_self)
VALUE OneofBuilderContext_optional(int argc, VALUE *argv, VALUE _self)
MessageBuilderContext * ruby_to_MessageBuilderContext(VALUE value)
const upb_msgdef * msgdef
VALUE RepeatedField_plus(VALUE _self, VALUE list)
void Map_mark(void *self)
VALUE MessageBuilderContext_map(int argc, VALUE *argv, VALUE _self)
const upb_fielddef * map_field_value(const upb_fielddef *field)
EnumDescriptor * ruby_to_EnumDescriptor(VALUE value)
void native_slot_set(const char *name, upb_fieldtype_t type, VALUE type_class, void *memory, VALUE value)
void layout_mark(MessageLayout *layout, void *storage)
const upb_pbdecodermethod * fill_method
const rb_data_type_t RepeatedField_type
VALUE Map_keys(VALUE _self)
VALUE OneofDescriptor_add_field(VALUE _self, VALUE field)
size_t native_slot_size(upb_fieldtype_t type)
VALUE Map_inspect(VALUE _self)
VALUE DescriptorPool_generated_pool(VALUE _self)
ID descriptor_instancevar_interned
VALUE Descriptor_each_oneof(VALUE _self)
VALUE native_slot_encode_and_freeze_string(upb_fieldtype_t type, VALUE value)
VALUE Map_alloc(VALUE klass)
void Message_mark(void *self)
VALUE EnumBuilderContext_initialize(VALUE _self, VALUE enumdesc)
void * RepeatedField_index_native(VALUE _self, int index)
VALUE RepeatedField_eq(VALUE _self, VALUE _other)
VALUE Google_Protobuf_deep_copy(VALUE self, VALUE obj)
bool field_contains_hasbit(MessageLayout *layout, const upb_fielddef *field)
VALUE FieldDescriptor_clear(VALUE _self, VALUE msg_rb)
EnumBuilderContext * ruby_to_EnumBuilderContext(VALUE value)
RepeatedField * ruby_to_RepeatedField(VALUE value)
VALUE EnumDescriptor_alloc(VALUE klass)
const upb_handlers * json_serialize_handlers_preserve
VALUE Map_index_set(VALUE _self, VALUE key, VALUE value)
VALUE Descriptor_initialize(VALUE _self, VALUE file_descriptor_rb)
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
VALUE OneofDescriptor_each(VALUE _self, VALUE field)
VALUE EnumDescriptor_each(VALUE _self)
void Map_free(void *self)
VALUE FieldDescriptor_submsg_name(VALUE _self)
const upb_handlers * json_serialize_handlers
VALUE Map_values(VALUE _self)
VALUE Map_delete(VALUE _self, VALUE key)
VALUE Descriptor_name(VALUE _self)
GLsizei const GLfloat * value
VALUE EnumDescriptor_lookup_value(VALUE _self, VALUE number)
const upb_handlers * fill_handlers
VALUE OneofDescriptor_name_set(VALUE _self, VALUE value)
VALUE RepeatedField_deep_copy(VALUE _self)
VALUE EnumBuilderContext_alloc(VALUE klass)
VALUE DescriptorPool_lookup(VALUE _self, VALUE name)
upb_fieldtype_t value_type
const upb_enumdef * enumdef
VALUE Builder_finalize_to_pool(VALUE _self, VALUE pool_rb)
VALUE Map_length(VALUE _self)
VALUE FieldDescriptor_name_set(VALUE _self, VALUE str)
VALUE default_file_descriptor
void Descriptor_register(VALUE module)
VALUE OneofBuilderContext_alloc(VALUE klass)
const upb_filedef * filedef
rb_encoding * kRubyStringASCIIEncoding
VALUE Message_alloc(VALUE klass)
VALUE DescriptorPool_alloc(VALUE klass)
VALUE Map_iter_value(Map_iter *iter)
VALUE RepeatedField_alloc(VALUE klass)
void FileBuilderContext_register(VALUE module)
VALUE FieldDescriptor_has(VALUE _self, VALUE msg_rb)
int RepeatedField_size(VALUE _self)
VALUE EnumDescriptor_add_value(VALUE _self, VALUE name, VALUE number)
rb_encoding * kRubyString8bitEncoding
VALUE FieldDescriptor_subtype(VALUE _self)
void EnumBuilderContext_free(void *_self)
VALUE Descriptor_msgclass(VALUE _self)
libaditof
Author(s):
autogenerated on Wed May 21 2025 02:06:58