2007-04-12 17:56:34 +02:00
|
|
|
/*
|
|
|
|
* PROGRAM: JRD System Functions
|
|
|
|
* MODULE: SysFunctions.h
|
|
|
|
* DESCRIPTION: System Functions
|
|
|
|
*
|
|
|
|
* The contents of this file are subject to the Initial
|
|
|
|
* Developer's Public License Version 1.0 (the "License");
|
|
|
|
* you may not use this file except in compliance with the
|
|
|
|
* License. You may obtain a copy of the License at
|
|
|
|
* http://www.ibphoenix.com/main.nfs?a=ibphoenix&page=ibp_idpl.
|
|
|
|
*
|
|
|
|
* Software distributed under the License is distributed AS IS,
|
|
|
|
* WITHOUT WARRANTY OF ANY KIND, either express or implied.
|
|
|
|
* See the License for the specific language governing rights
|
|
|
|
* and limitations under the License.
|
|
|
|
*
|
|
|
|
* The Original Code was created by Adriano dos Santos Fernandes
|
|
|
|
* for the Firebird Open Source RDBMS project, based on work done
|
|
|
|
* in Yaffil by Oleg Loa <loa@mail.ru> and Alexey Karyakin <aleksey.karyakin@mail.ru>
|
|
|
|
*
|
|
|
|
* Copyright (c) 2007 Adriano dos Santos Fernandes <adrianosf@uol.com.br>
|
|
|
|
* and all contributors signed below.
|
|
|
|
*
|
|
|
|
* All Rights Reserved.
|
|
|
|
* Contributor(s): ______________________________________.
|
|
|
|
* Oleg Loa <loa@mail.ru>
|
|
|
|
* Alexey Karyakin <aleksey.karyakin@mail.ru>
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef JRD_SYSFUNCTION_H
|
|
|
|
#define JRD_SYSFUNCTION_H
|
|
|
|
|
|
|
|
#include "../common/classes/MetaName.h"
|
|
|
|
#include "../jrd/DataTypeUtil.h"
|
2010-11-21 04:47:29 +01:00
|
|
|
#include "../dsql/Nodes.h"
|
2010-10-12 10:02:57 +02:00
|
|
|
#include "../common/dsc.h"
|
2007-04-12 17:56:34 +02:00
|
|
|
|
|
|
|
namespace Jrd
|
|
|
|
{
|
|
|
|
class thread_db;
|
|
|
|
struct impure_value;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
class SysFunction
|
|
|
|
{
|
|
|
|
public:
|
2007-10-12 22:25:04 +02:00
|
|
|
typedef void (*SetParamsFunc)(DataTypeUtilBase* dataTypeUtil, const SysFunction* function, int, dsc**);
|
|
|
|
typedef void (*MakeFunc)(DataTypeUtilBase* dataTypeUtil, const SysFunction* function, dsc*, int, const dsc**);
|
2010-11-21 04:47:29 +01:00
|
|
|
typedef dsc* (*EvlFunc)(Jrd::thread_db*, const SysFunction* function,
|
|
|
|
const Jrd::NestValueArray&, Jrd::impure_value*);
|
2007-04-15 13:27:15 +02:00
|
|
|
|
2007-04-12 17:56:34 +02:00
|
|
|
const Firebird::MetaName name;
|
|
|
|
int minArgCount;
|
|
|
|
int maxArgCount; // -1 for no limit
|
2007-06-09 21:18:21 +02:00
|
|
|
SetParamsFunc setParamsFunc;
|
2007-04-17 04:24:33 +02:00
|
|
|
MakeFunc makeFunc;
|
|
|
|
EvlFunc evlFunc;
|
2007-04-12 17:56:34 +02:00
|
|
|
void* misc;
|
|
|
|
|
2007-10-12 22:25:04 +02:00
|
|
|
static const SysFunction* lookup(const Firebird::MetaName& name);
|
2007-04-12 17:56:34 +02:00
|
|
|
|
2007-10-12 22:25:04 +02:00
|
|
|
void checkArgsMismatch(int count) const;
|
2007-04-12 17:56:34 +02:00
|
|
|
|
|
|
|
private:
|
2007-10-12 22:25:04 +02:00
|
|
|
const static SysFunction functions[];
|
2007-04-12 17:56:34 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
#endif // JRD_SYSFUNCTION_H
|
|
|
|
|