summaryrefslogtreecommitdiff
path: root/src/parameters.cpp
diff options
context:
space:
mode:
authorEmiel Bruijntjes <emiel.bruijntjes@copernica.com>2013-09-08 16:26:11 -0700
committerEmiel Bruijntjes <emiel.bruijntjes@copernica.com>2013-09-08 16:26:11 -0700
commitdf2520e4b2c87e2302ee4c6cec1e672091efebfb (patch)
treef3bcd4fa7c4d0c6ee601268ceca4d6841ed90d0d /src/parameters.cpp
parenteb86ac350756afeffa0e2db8be87876d35bc40a8 (diff)
Refactoring function class, and making it even more easy to directly enable native C functions in PHP
Diffstat (limited to 'src/parameters.cpp')
-rw-r--r--src/parameters.cpp39
1 files changed, 39 insertions, 0 deletions
diff --git a/src/parameters.cpp b/src/parameters.cpp
new file mode 100644
index 0000000..d31f49c
--- /dev/null
+++ b/src/parameters.cpp
@@ -0,0 +1,39 @@
+/**
+ * Parameters.cpp
+ *
+ * @author Emiel Bruijntjes <emiel.bruijntjes@copernica.com>
+ * @copyright 2013 Copernica BV
+ */
+#include "includes.h"
+
+/**
+ * Set up namespace
+ */
+namespace Php {
+
+/**
+ * Parameters
+ * @param argc Number of arguments
+ * @param tsrm_ls
+ */
+Parameters::Parameters(int argc TSRMLS_DC)
+{
+ // reserve plenty of space
+ reserve(argc);
+
+ // loop through the arguments
+ for (int i=0; i<argc; i++)
+ {
+ // get the argument
+ zval **arg = (zval **) (zend_vm_stack_top(TSRMLS_C) - 1 - (argc-i));
+
+ // append value
+ push_back(Value(*arg));
+ }
+}
+
+/**
+ * End of namespace
+ */
+}
+