summaryrefslogtreecommitdiff
path: root/src/extension.cpp
diff options
context:
space:
mode:
authorEmiel Bruijntjes <emiel.bruijntjes@copernica.com>2013-08-25 17:40:03 +0200
committerEmiel Bruijntjes <emiel.bruijntjes@copernica.com>2013-08-25 17:40:03 +0200
commite14055694478d70e58b5fc653b08a9a514bbc455 (patch)
treeab47d723699a7fe86f47f68c182ab695bf9b3bab /src/extension.cpp
parente838e180f5bbcf19e7235f30311645e942ff92d2 (diff)
{more work in progress: the function that was defined with c++ now gets calls, but it does not yet call the actual implementation
Diffstat (limited to 'src/extension.cpp')
-rw-r--r--src/extension.cpp11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/extension.cpp b/src/extension.cpp
index 94543ef..94b5082 100644
--- a/src/extension.cpp
+++ b/src/extension.cpp
@@ -22,8 +22,11 @@ static Extension *extension;
* @param name Name of the extension
* @param version Version number
*/
-Extension::Extension(const char *name, const char *version) : _name(name), _version(version), _entry(NULL), _request(NULL)
+Extension::Extension(const char *name, const char *version, const std::initializer_list<Function> &functions) : _name(name), _version(version)
{
+ // allocate functions
+ _functions = new Functions(functions);
+
// store pointer to the one and only extension
extension = this;
}
@@ -33,6 +36,9 @@ Extension::Extension(const char *name, const char *version) : _name(name), _vers
*/
Extension::~Extension()
{
+ // deallocate functions
+ delete _functions;
+
// deallocate entry
if (_entry) delete _entry;
}
@@ -105,7 +111,7 @@ zend_module_entry *Extension::entry()
_entry->ini_entry = NULL; // the php.ini record
_entry->deps = NULL; // dependencies on other modules
_entry->name = _name; // extension name
- _entry->functions = NULL; // functions supported by this module
+ _entry->functions = _functions->internal(); // functions supported by this module
_entry->module_startup_func = extension_startup; // startup function for the whole extension
_entry->module_shutdown_func = extension_shutdown; // shutdown function for the whole extension
_entry->request_startup_func = request_startup; // startup function per request
@@ -132,4 +138,3 @@ zend_module_entry *Extension::entry()
*/
}
-