Sha256: 4de939643485f8c563018aa818df521318c75c9510f8c7656620abc60aedcd77

Contents?: true

Size: 488 Bytes

Versions: 3

Compression:

Stored size: 488 Bytes

Contents

#include <ruby.h>
#include <gsl/gsl_errno.h>

VALUE numo_eGslError;

static void
numo_gsl_err_hdl(const char *reason, const char *file, int line, int gsl_errno)
{
    rb_raise(numo_eGslError,"%s:%d: %s",file,line,reason);
}

void
Init_err(void)
{
    VALUE mNumo, mGSL;

    mNumo = rb_define_module("Numo");
    mGSL = rb_define_module_under(mNumo, "GSL");
    numo_eGslError = rb_define_class_under(mGSL, "GslError", rb_eStandardError);

    gsl_set_error_handler(&numo_gsl_err_hdl);
}

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
numo-gsl-0.1.2 ext/numo/gsl/err/err.c
numo-gsl-0.1.1 ext/numo/gsl/err/err.c
numo-gsl-0.1.0 ext/numo/gsl/err/err.c