Sha256: a3186c19eb7c19b28e5550e8ea0243dd65502ae6d6ee8b9d729991b3415617dd

Contents?: true

Size: 1.17 KB

Versions: 19

Compression:

Stored size: 1.17 KB

Contents

#include "defs.h"


using namespace Rucy;


/*
	do nothing.
*/
static
VALUE do_nothing(VALUE self)
{
}

/*
	return nil.
*/
static
VALUE return_nil(VALUE self)
{
	return nil();
}

/*
	return int.
*/
static
VALUE return_int(VALUE self)
{
	return value(1);
}

/*
	return flaot.
*/
static
VALUE return_float(VALUE self)
{
	return value(1.0f);
}

/*
	return string.
*/
static
VALUE return_string(VALUE self)
{
	return value("");
}

/*
	check_arg_count
*/
static
VALUE arg_count_must_1(VALUE self)
{
	check_arg_count(__FILE__, __LINE__, "arg_count_must_1", argc, 1);
	RUCY_SYM(ok);
	return ok.value();
}


void
Init_function ()
{
	Module mRucy = rb_define_module("Rucy");
	Module mTester = rb_define_module_under(mRucy, "Tester");

	rb_define_method(mTester, "do_nothing", RUBY_METHOD_FUNC(do_nothing), -1);
	rb_define_method(mTester, "return_nil", RUBY_METHOD_FUNC(return_nil), 0);
	rb_define_method(mTester, "return_int", RUBY_METHOD_FUNC(return_int), 0);
	rb_define_method(mTester, "return_float", RUBY_METHOD_FUNC(return_float), 0);
	rb_define_method(mTester, "return_string", RUBY_METHOD_FUNC(return_string), 0);
	rb_define_method(mTester, "arg_count_must_1", RUBY_METHOD_FUNC(arg_count_must_1), -1);
}

Version data entries

19 entries across 19 versions & 1 rubygems

Version Path
rucy-0.3 .doc/ext/rucy/function.cpp
rucy-0.2.1 .doc/ext/rucy/function.cpp
rucy-0.2 .doc/ext/rucy/function.cpp
rucy-0.1.44 .doc/ext/rucy/function.cpp
rucy-0.1.43 .doc/ext/rucy/function.cpp
rucy-0.1.42 .doc/ext/rucy/function.cpp
rucy-0.1.41 .doc/ext/rucy/function.cpp
rucy-0.1.40 .doc/ext/rucy/function.cpp
rucy-0.1.39 .doc/ext/rucy/function.cpp
rucy-0.1.38 .doc/ext/rucy/function.cpp
rucy-0.1.37 .doc/ext/rucy/function.cpp
rucy-0.1.36 .doc/ext/rucy/function.cpp
rucy-0.1.35 .doc/ext/rucy/function.cpp
rucy-0.1.34 .doc/ext/rucy/function.cpp
rucy-0.1.33 .doc/ext/rucy/function.cpp
rucy-0.1.32 .doc/ext/rucy/function.cpp
rucy-0.1.31 .doc/ext/rucy/function.cpp
rucy-0.1.30 .doc/ext/rucy/function.cpp
rucy-0.1.29 .doc/ext/rucy/function.cpp