Add a New Built-in Function

All built-in functions are children of NodeFunctionBuiltin class and are generated by gen_builtin.pl Perl script. To define a new built-in function you have to do:

$funcdecl = 'getAdjacencyMatrix(graph) : array';

$include = <<END_OF_CODE;
#include "valuegraph.h"
END_OF_CODE

$code = <<END_OF_CODE;
	ValueGraph* g = NULL;

	if((g = par[0]->toValueGraph()) != NULL)
		return g->getAdjacencyMatrix();
	else
	{
		WARN_P(_("Bad parameters type: $funcdecl"));
		return VALUENULL;
	}
END_OF_CODE

genBFClass('getAdjacencyMatrix', 'NodeBuiltinGetAdjacencyMatrix', 1, $code, $include);