Sha256: 99122b52ee98eced544285dd1a305cd293d55ba7239afeb3bd40263d4717feaa

Contents?: true

Size: 1.03 KB

Versions: 19

Compression:

Stored size: 1.03 KB

Contents

#include "defs.h"


using namespace Rucy;


/*
	do nothing.
*/
static
RUCY_DEFN(do_nothing)
{
}
RUCY_END

/*
	return nil.
*/
static
RUCY_DEF0(return_nil)
{
	return nil();
}
RUCY_END

/*
	return int.
*/
static
RUCY_DEF0(return_int)
{
	return value(1);
}
RUCY_END

/*
	return flaot.
*/
static
RUCY_DEF0(return_float)
{
	return value(1.0f);
}
RUCY_END

/*
	return string.
*/
static
RUCY_DEF0(return_string)
{
	return value("");
}
RUCY_END

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


void
Init_function ()
{
	Module mRucy   =       define_module("Rucy");
	Module mTester = mRucy.define_module("Tester");

	mTester.define_method("do_nothing", do_nothing);
	mTester.define_method("return_nil", return_nil);
	mTester.define_method("return_int", return_int);
	mTester.define_method("return_float", return_float);
	mTester.define_method("return_string", return_string);
	mTester.define_method("arg_count_must_1", arg_count_must_1);
}

Version data entries

19 entries across 19 versions & 1 rubygems

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