// py_ex_show_info.cpp : Defines the entry point for the console application.
//

#include "stdafx.h"

#include <eter/py_tinker.h>
#include <stdio.h>

class test
{
public:
	void run()
	{
		puts("hehe -_-)~");
	}
	bool bug_fix_20050719()
	{
		return true;
	}
	int sum(const char* name, int a, int b)
	{
		printf("%s: %d + %d\n", name, a, b);
		return a+b;
	}
};

const char* text()
{
	return "-_-)/ python wins!!";
}

int score(const char* name)
{
	printf("[%s] score!! \n", name);
	return 100;
}

py_tinker::class_<test> buildtest()
{
	using namespace py_tinker;
	return class_<test>("test")
		.defv("run", &test::run)
		.deft("sum", &test::sum)
		.deft("bug_fix_20050719", &test::bug_fix_20050719)
		;
}

void initeter()
{
	py_tinker::module_("eter")
		.deft("text", text)
		.deft("score", score)
		.def(buildtest())
		;
}


void main()
{
	Py_Initialize();
	Py_SetProgramName((char*)"py_test");
			
	initeter();
	py_tinker::PyEmbed_RunMainFile("ex_show_info.py");
	Py_Finalize();	
}
