diff options
author | Emiel Bruijntjes <emiel.bruijntjes@copernica.com> | 2013-09-10 09:54:14 -0700 |
---|---|---|
committer | Emiel Bruijntjes <emiel.bruijntjes@copernica.com> | 2013-09-10 09:54:14 -0700 |
commit | 37c38c70de43d9d9ee3c9f0e2f175e19bcc0b485 (patch) | |
tree | 29cf02cfabad5eb22306ac05eaee96efbdb79cd9 /include/extension.h | |
parent | 85507088051bdfabf8bc71346290949b78c3c914 (diff) |
When registering functions, it now is also possible to specify the signature of the parameters
Diffstat (limited to 'include/extension.h')
-rw-r--r-- | include/extension.h | 25 |
1 files changed, 10 insertions, 15 deletions
diff --git a/include/extension.h b/include/extension.h index fb33c99..f5987e2 100644 --- a/include/extension.h +++ b/include/extension.h @@ -174,22 +174,23 @@ public: * @param function The function to add * @return Function The added function */ - Function &add(Function *function); + Function *add(Function *function); /** * Add a native function directly to the extension * @param name Name of the function * @param function The function to add + * @param arguments Optional argument specification * @return Function The added function */ - Function &add(const char *name, native_callback_0 function); - Function &add(const char *name, native_callback_1 function); - Function &add(const char *name, native_callback_2 function); - Function &add(const char *name, native_callback_3 function); - Function &add(const char *name, native_callback_4 function); - Function &add(const char *name, native_callback_5 function); - Function &add(const char *name, native_callback_6 function); - Function &add(const char *name, native_callback_7 function); + Function *add(const char *name, native_callback_0 function, const std::initializer_list<Argument> &arguments = {}); + Function *add(const char *name, native_callback_1 function, const std::initializer_list<Argument> &arguments = {}); + Function *add(const char *name, native_callback_2 function, const std::initializer_list<Argument> &arguments = {}); + Function *add(const char *name, native_callback_3 function, const std::initializer_list<Argument> &arguments = {}); + Function *add(const char *name, native_callback_4 function, const std::initializer_list<Argument> &arguments = {}); + Function *add(const char *name, native_callback_5 function, const std::initializer_list<Argument> &arguments = {}); + Function *add(const char *name, native_callback_6 function, const std::initializer_list<Argument> &arguments = {}); + Function *add(const char *name, native_callback_7 function, const std::initializer_list<Argument> &arguments = {}); /** * Retrieve the module entry @@ -210,12 +211,6 @@ private: std::set<std::unique_ptr<Function>> _functions; /** - * Hidden pointer to self - * @var HiddenPointer - */ - HiddenPointer<Extension> _ptr; - - /** * The information that is passed to the Zend engine * * Although it would be slightly faster to not make this a pointer, this |