|
Qore Programming Language
0.8.3
|
00001 /* -*- mode: c++; indent-tabs-mode: nil -*- */ 00002 /* 00003 BuiltinFunctionList.h 00004 00005 Qore programming language 00006 00007 Copyright 2003 - 2011 David Nichols 00008 00009 This library is free software; you can redistribute it and/or 00010 modify it under the terms of the GNU Lesser General Public 00011 License as published by the Free Software Foundation; either 00012 version 2.1 of the License, or (at your option) any later version. 00013 00014 This library is distributed in the hope that it will be useful, 00015 but WITHOUT ANY WARRANTY; without even the implied warranty of 00016 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00017 Lesser General Public License for more details. 00018 00019 You should have received a copy of the GNU Lesser General Public 00020 License along with this library; if not, write to the Free Software 00021 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 00022 */ 00023 00024 #ifndef _QORE_BUILTINFUNCTIONLIST_H 00025 00026 #define _QORE_BUILTINFUNCTIONLIST_H 00027 00028 #include <qore/common.h> 00029 #include <qore/Restrictions.h> 00030 #include <qore/QoreThreadLock.h> 00031 00032 #include <stdarg.h> 00033 00038 DLLLOCAL void init_builtin_functions(); 00039 00040 class BuiltinFunction; 00041 00043 00046 class BuiltinFunctionList { 00047 private: 00048 // not implemented 00049 DLLLOCAL BuiltinFunctionList(const BuiltinFunctionList&); 00050 DLLLOCAL BuiltinFunctionList& operator=(const BuiltinFunctionList&); 00051 DLLLOCAL void *operator new(size_t); 00052 00053 public: 00054 DLLLOCAL BuiltinFunctionList(); 00055 DLLLOCAL ~BuiltinFunctionList(); 00056 00058 00063 DLLEXPORT static void add(const char *name, q_func_t f, int functional_domain = QDOM_DEFAULT); 00064 00066 00074 DLLEXPORT static void add2(const char *name, q_func_t f, int64 code_flags = QC_NO_FLAGS, int64 functional_domain = QDOM_DEFAULT, const QoreTypeInfo *returnTypeInfo = 0, unsigned num_params = 0, ...); 00075 00077 00086 DLLEXPORT static void add3(const char *name, q_func_t f, int64 code_flags = QC_NO_FLAGS, int64 functional_domain = QDOM_DEFAULT, const QoreTypeInfo *returnTypeInfo = 0, const type_vec_t &typeList = type_vec_t(), const arg_vec_t &defaultArgList = arg_vec_t()); 00087 00089 00092 DLLEXPORT static int size(); 00093 00095 00098 DLLEXPORT static const BuiltinFunction *find(const char *name); 00099 00100 // internal functions 00101 DLLLOCAL void clear(); 00102 DLLLOCAL static void init(); 00103 }; 00104 00106 DLLEXPORT extern BuiltinFunctionList builtinFunctions; 00107 00108 #endif // _QORE_BUILTINFUNCTIONLIST_H