From 0fdfc4ced15ed29c407ad95cb0e1224711c1919d Mon Sep 17 00:00:00 2001 From: JasperVanEck Date: Thu, 28 Nov 2013 11:31:23 +0100 Subject: Added extension and functionvoid exmaple --- Examples/simple/simple.cpp | 23 ++++++++++++++++++----- 1 file changed, 18 insertions(+), 5 deletions(-) (limited to 'Examples/simple/simple.cpp') diff --git a/Examples/simple/simple.cpp b/Examples/simple/simple.cpp index 7942a3c..7dc9305 100644 --- a/Examples/simple/simple.cpp +++ b/Examples/simple/simple.cpp @@ -73,13 +73,26 @@ Php::Value bubblesort(Php::Parameters ¶ms) return r; } + +void my_function() +{ + +} + +Php::Value my_integer_return() +{ + throw Php::Exception("er is iets mis"); + + return "abcd"; +} + /** * Our own "my_plus" function that will be available in PHP * @param environment * @param params * @return Value */ -static Php::Value my_plus(Php::Environment &env, Php::Parameters ¶ms) +static Php::Value my_plus(Php::Parameters ¶ms) { Php::Value r(0); @@ -159,10 +172,10 @@ extern "C" // define the functions extension.add("my_plus", my_plus, { -// Php::ByVal("a", Php::numericType), -// Php::ByVal("b", Php::numericType) -// Php::ByVal("c", "MyClass"), -// Php::ByRef("d", Php::stringType) + Php::ByVal("a", Php::numericType), + Php::ByVal("b", Php::numericType) + Php::ByVal("c", "MyClass"), + Php::ByRef("d", Php::stringType) }); extension.add("bubblesort", bubblesort); -- cgit v1.2.3