Sha256: 62f5fde8470872a65aa00a6b462def0b483804708fe775e295aecc7bbfaecac8

Contents?: true

Size: 534 Bytes

Versions: 3

Compression:

Stored size: 534 Bytes

Contents

<%
set name: "new"
set singleton: true
%>
/*
  @overload <%=name%>(<%=args[0][1]%>)
  @param  [Integer]  <%=args[0][1]%> parameter

  allocate instance of <%=class_name%> class.

 <%= desc %>
 */
static VALUE
<%=c_func(1)%>(VALUE self, VALUE v1)
{
    <%=struct%> *x, *w;

    TypedData_Get_Struct(other, <%=struct%>, &<%=data_type_var%>, x);

    w = <%=func_name%>(x);
    if (!w) {
        rb_raise(rb_eNoMemError,"fail to allocate struct");
    }
    return TypedData_Wrap_Struct(<%=class_var%>, &<%=data_type_var%>, (void*)w);
}

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
numo-gsl-0.1.2 ext/numo/gsl/gen/tmpl/c_new_f_other.c
numo-gsl-0.1.1 ext/numo/gsl/gen/tmpl/c_new_f_other.c
numo-gsl-0.1.0 ext/numo/gsl/gen/tmpl/c_new_f_other.c