static VALUE rb_gimp_rgb_alloc(VALUE klass) { GimpRGB *color = ALLOC(GimpRGB); return TypedData_Wrap_Struct(klass, &GimpRGB_type, color); }
static VALUE dataerror_alloc(VALUE klass) { VALUE n = rb_str_new_cstr("[Bug #9167] error"); return TypedData_Wrap_Struct(klass, &dataerror_type, (void *)n); }
static VALUE fdbm_alloc(VALUE klass) { return TypedData_Wrap_Struct(klass, &dbm_type, 0); }
static VALUE engine_alloc(VALUE klass) { engine_t *data = ALLOC(engine_t); data->engine = NULL; return TypedData_Wrap_Struct(klass, &data_type, data); }
VALUE Map_alloc(VALUE klass) { Map* self = ALLOC(Map); memset(self, 0, sizeof(Map)); self->value_type_class = Qnil; return TypedData_Wrap_Struct(klass, &Map_type, self); }
VALUE sdaf_alloc_typed_func(VALUE klass) { struct sample_typed_wrapped_struct* bar = (struct sample_typed_wrapped_struct *)malloc(sizeof(struct sample_typed_wrapped_struct)); bar->foo = 42; return TypedData_Wrap_Struct(klass, &sample_typed_wrapped_struct_data_type, bar); }
/* Allocates grpc_rb_server instances. */ static VALUE grpc_rb_server_alloc(VALUE cls) { grpc_rb_server *wrapper = ALLOC(grpc_rb_server); wrapper->wrapped = NULL; wrapper->mark = Qnil; return TypedData_Wrap_Struct(cls, &grpc_rb_server_data_type, wrapper); }
static VALUE rb_grn_column_cache_allocate (VALUE klass) { return TypedData_Wrap_Struct(klass, &data_type, NULL); }
/* Allocates CallCredentials instances. Provides safe initial defaults for the instance fields. */ static VALUE grpc_rb_call_credentials_alloc(VALUE cls) { grpc_rb_call_credentials *wrapper = ALLOC(grpc_rb_call_credentials); wrapper->wrapped = NULL; wrapper->mark = Qnil; return TypedData_Wrap_Struct(cls, &grpc_rb_call_credentials_data_type, wrapper); }
static VALUE iow_newobj(VALUE obj) { return TypedData_Wrap_Struct(rb_mInternalObjectWrapper, &iow_data_type, (void *)obj); }
static VALUE di_open_s(VALUE klass) { VALUE self = TypedData_Wrap_Struct(klass, &di_data_type, 0); return rb_ensure(di_open_body, self, di_open_ensure, self); }
static VALUE channel_alloc(VALUE klass) { ChannelHolder *holder = ALLOC(ChannelHolder); holder->channel = NULL; holder->session = Qundef; return TypedData_Wrap_Struct(klass, &channel_type, holder); }
/* * call-seq: * DescriptorPool.new => pool * * Creates a new, empty, descriptor pool. */ VALUE DescriptorPool_alloc(VALUE klass) { DescriptorPool* self = ALLOC(DescriptorPool); self->symtab = upb_symtab_new(&self->symtab); return TypedData_Wrap_Struct(klass, &_DescriptorPool_type, self); }
static VALUE ossl_ssl_session_alloc(VALUE klass) { return TypedData_Wrap_Struct(klass, &ossl_ssl_session_type, NULL); }
/* Allocates grpc_rb_server instances. */ static VALUE grpc_rb_server_alloc(VALUE cls) { grpc_rb_server* wrapper = ALLOC(grpc_rb_server); wrapper->wrapped = NULL; wrapper->shutdown_started = (gpr_atm)0; return TypedData_Wrap_Struct(cls, &grpc_rb_server_data_type, wrapper); }
/* Allocates grpc_rb_channel instances. */ static VALUE grpc_rb_channel_alloc(VALUE cls) { grpc_rb_channel *wrapper = ALLOC(grpc_rb_channel); wrapper->bg_wrapped = NULL; wrapper->credentials = Qnil; return TypedData_Wrap_Struct(cls, &grpc_channel_data_type, wrapper); }
static VALUE enc_new(rb_encoding *encoding) { return TypedData_Wrap_Struct(rb_cEncoding, &encoding_data_type, encoding); }
static VALUE rb_hello_alloc(VALUE klass) { return TypedData_Wrap_Struct(klass, &rb_hello_type, NULL); }
VALUE sws_typed_wrap_struct(VALUE self, VALUE val) { struct sample_typed_wrapped_struct* bar = (struct sample_typed_wrapped_struct *)malloc(sizeof(struct sample_typed_wrapped_struct)); bar->foo = FIX2INT(val); return TypedData_Wrap_Struct(rb_cObject, &sample_typed_wrapped_struct_data_type, bar); }
static VALUE application_alloc(VALUE klass) { application_t *data = ALLOC(application_t); data->application = NULL; return TypedData_Wrap_Struct(klass, &data_type, data); }