2002-11-03 17:26:12 +01:00
|
|
|
/*
|
2003-09-26 16:13:15 +02:00
|
|
|
* 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.
|
2002-11-03 17:26:12 +01:00
|
|
|
*
|
2003-09-26 16:13:15 +02:00
|
|
|
* 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.
|
2002-11-03 17:26:12 +01:00
|
|
|
*
|
2003-09-26 16:13:15 +02:00
|
|
|
* The Original Code was created by Dmitry Yemanov
|
|
|
|
* for the Firebird Open Source RDBMS project.
|
2002-11-03 17:26:12 +01:00
|
|
|
*
|
2003-09-26 16:13:15 +02:00
|
|
|
* Copyright (c) 2002 Dmitry Yemanov <dimitr@users.sf.net>
|
|
|
|
* and all contributors signed below.
|
2002-11-03 17:26:12 +01:00
|
|
|
*
|
2003-09-26 16:13:15 +02:00
|
|
|
* All Rights Reserved.
|
|
|
|
* Contributor(s): ______________________________________.
|
2002-11-03 17:26:12 +01:00
|
|
|
*/
|
|
|
|
|
|
|
|
#include "firebird.h"
|
|
|
|
|
2010-02-28 19:00:51 +01:00
|
|
|
#include "../common/config/config.h"
|
|
|
|
#include "../common/config/config_file.h"
|
2010-10-12 10:02:57 +02:00
|
|
|
#include "../common/config/os/config_root.h"
|
2010-02-28 19:00:51 +01:00
|
|
|
#include "../common/classes/init.h"
|
2010-03-29 12:54:18 +02:00
|
|
|
#include "../common/dllinst.h"
|
2010-10-12 10:02:57 +02:00
|
|
|
#include "../common/os/fbsyslog.h"
|
2011-06-02 17:57:08 +02:00
|
|
|
#include "firebird/Plugin.h"
|
2002-11-03 17:26:12 +01:00
|
|
|
|
|
|
|
#ifdef HAVE_STDLIB_H
|
|
|
|
#include <stdlib.h>
|
|
|
|
#endif
|
|
|
|
|
2010-02-28 19:00:51 +01:00
|
|
|
namespace {
|
|
|
|
|
|
|
|
/******************************************************************************
|
|
|
|
*
|
|
|
|
* firebird.conf implementation
|
|
|
|
*/
|
|
|
|
|
2010-03-05 18:21:18 +01:00
|
|
|
class ConfigImpl : public Firebird::PermanentStorage
|
2010-02-28 19:00:51 +01:00
|
|
|
{
|
|
|
|
public:
|
2011-01-19 18:24:49 +01:00
|
|
|
explicit ConfigImpl(Firebird::MemoryPool& p)
|
|
|
|
: Firebird::PermanentStorage(p), confMessage(getPool())
|
2010-02-28 19:00:51 +01:00
|
|
|
{
|
2011-01-19 18:24:49 +01:00
|
|
|
ConfigFile file(fb_utils::getPrefix(fb_utils::FB_DIR_CONF, CONFIG_FILE));
|
|
|
|
defaultConfig = new Config(file);
|
|
|
|
|
|
|
|
if (file.getMessage())
|
2010-02-28 19:00:51 +01:00
|
|
|
{
|
2011-01-19 18:24:49 +01:00
|
|
|
confMessage = file.getMessage();
|
2010-02-28 19:00:51 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/* void changeDefaultConfig(Config* newConfig)
|
|
|
|
{
|
|
|
|
defaultConfig = newConfig;
|
|
|
|
}
|
|
|
|
*/
|
|
|
|
Firebird::RefPtr<Config> getDefaultConfig() const
|
|
|
|
{
|
|
|
|
return defaultConfig;
|
|
|
|
}
|
|
|
|
|
2011-01-19 18:24:49 +01:00
|
|
|
const char* getMessage()
|
|
|
|
{
|
|
|
|
return confMessage.nullStr();
|
|
|
|
}
|
|
|
|
|
2010-02-28 19:00:51 +01:00
|
|
|
private:
|
|
|
|
Firebird::RefPtr<Config> defaultConfig;
|
|
|
|
|
|
|
|
ConfigImpl(const ConfigImpl&);
|
|
|
|
void operator=(const ConfigImpl&);
|
|
|
|
|
2011-01-19 18:24:49 +01:00
|
|
|
Firebird::string confMessage;
|
2010-02-28 19:00:51 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
/******************************************************************************
|
|
|
|
*
|
|
|
|
* Static instance of the system configuration file
|
|
|
|
*/
|
|
|
|
|
|
|
|
Firebird::InitInstance<ConfigImpl> firebirdConf;
|
|
|
|
|
2010-03-05 18:21:18 +01:00
|
|
|
/******************************************************************************
|
|
|
|
*
|
|
|
|
* Static instance of the root and install directories detector
|
|
|
|
*/
|
|
|
|
|
|
|
|
Firebird::InitInstance<ConfigRoot> rootDetector;
|
|
|
|
|
2010-02-28 19:00:51 +01:00
|
|
|
} // anonymous namespace
|
2002-11-03 17:26:12 +01:00
|
|
|
|
|
|
|
/******************************************************************************
|
|
|
|
*
|
2002-11-30 16:08:09 +01:00
|
|
|
* Configuration entries
|
2002-11-03 17:26:12 +01:00
|
|
|
*/
|
|
|
|
|
2004-11-09 13:59:37 +01:00
|
|
|
const char* GCPolicyCooperative = "cooperative";
|
|
|
|
const char* GCPolicyBackground = "background";
|
|
|
|
const char* GCPolicyCombined = "combined";
|
|
|
|
|
2006-12-17 15:02:23 +01:00
|
|
|
const char* AmNative = "native";
|
|
|
|
const char* AmTrusted = "trusted";
|
|
|
|
const char* AmMixed = "mixed";
|
|
|
|
|
2010-02-28 19:00:51 +01:00
|
|
|
const Config::ConfigEntry Config::entries[MAX_CONFIG_KEY] =
|
2002-11-30 16:08:09 +01:00
|
|
|
{
|
2006-05-31 10:53:00 +02:00
|
|
|
{TYPE_INTEGER, "TempBlockSize", (ConfigValue) 1048576}, // bytes
|
2010-04-15 16:40:27 +02:00
|
|
|
{TYPE_INTEGER, "TempCacheLimit", (ConfigValue) -1}, // bytes
|
2002-11-30 16:08:09 +01:00
|
|
|
{TYPE_BOOLEAN, "RemoteFileOpenAbility", (ConfigValue) false},
|
|
|
|
{TYPE_INTEGER, "GuardianOption", (ConfigValue) 1},
|
2011-05-09 12:15:19 +02:00
|
|
|
{TYPE_INTEGER, "CpuAffinityMask", (ConfigValue) 0},
|
2002-12-07 14:27:12 +01:00
|
|
|
{TYPE_INTEGER, "TcpRemoteBufferSize", (ConfigValue) 8192}, // bytes
|
2005-04-04 14:54:34 +02:00
|
|
|
{TYPE_BOOLEAN, "TcpNoNagle", (ConfigValue) true},
|
2010-04-15 16:40:27 +02:00
|
|
|
{TYPE_INTEGER, "DefaultDbCachePages", (ConfigValue) -1}, // pages
|
2002-12-07 14:27:12 +01:00
|
|
|
{TYPE_INTEGER, "ConnectionTimeout", (ConfigValue) 180}, // seconds
|
2003-08-22 00:30:20 +02:00
|
|
|
{TYPE_INTEGER, "DummyPacketInterval", (ConfigValue) 0}, // seconds
|
2003-10-03 12:38:06 +02:00
|
|
|
{TYPE_INTEGER, "LockMemSize", (ConfigValue) 1048576}, // bytes
|
2002-12-07 14:27:12 +01:00
|
|
|
{TYPE_BOOLEAN, "LockGrantOrder", (ConfigValue) true},
|
2007-01-25 13:56:16 +01:00
|
|
|
{TYPE_INTEGER, "LockHashSlots", (ConfigValue) 1009}, // slots
|
2003-12-01 20:44:29 +01:00
|
|
|
{TYPE_INTEGER, "LockAcquireSpins", (ConfigValue) 0},
|
2002-12-07 14:27:12 +01:00
|
|
|
{TYPE_INTEGER, "EventMemSize", (ConfigValue) 65536}, // bytes
|
|
|
|
{TYPE_INTEGER, "DeadlockTimeout", (ConfigValue) 10}, // seconds
|
2003-01-12 16:33:00 +01:00
|
|
|
{TYPE_INTEGER, "PrioritySwitchDelay", (ConfigValue) 100}, // milliseconds
|
2004-09-02 11:00:48 +02:00
|
|
|
{TYPE_BOOLEAN, "UsePriorityScheduler", (ConfigValue) true},
|
2003-01-12 16:33:00 +01:00
|
|
|
{TYPE_INTEGER, "PriorityBoost", (ConfigValue) 5}, // ratio oh high- to low-priority thread ticks in jrd.cpp
|
2003-01-15 15:10:07 +01:00
|
|
|
{TYPE_STRING, "RemoteServiceName", (ConfigValue) FB_SERVICE_NAME},
|
2003-06-25 09:39:04 +02:00
|
|
|
{TYPE_INTEGER, "RemoteServicePort", (ConfigValue) 0},
|
2003-02-02 16:20:02 +01:00
|
|
|
{TYPE_STRING, "RemotePipeName", (ConfigValue) FB_PIPE_NAME},
|
2007-10-28 15:35:16 +01:00
|
|
|
{TYPE_STRING, "IpcName", (ConfigValue) FB_IPC_NAME},
|
2003-02-07 13:58:30 +01:00
|
|
|
#ifdef WIN_NT
|
2003-02-16 14:26:53 +01:00
|
|
|
{TYPE_INTEGER, "MaxUnflushedWrites", (ConfigValue) 100},
|
2003-02-16 19:58:56 +01:00
|
|
|
{TYPE_INTEGER, "MaxUnflushedWriteTime", (ConfigValue) 5},
|
2003-02-07 13:58:30 +01:00
|
|
|
#else
|
2003-02-16 14:26:53 +01:00
|
|
|
{TYPE_INTEGER, "MaxUnflushedWrites", (ConfigValue) -1},
|
2003-02-16 19:58:56 +01:00
|
|
|
{TYPE_INTEGER, "MaxUnflushedWriteTime", (ConfigValue) -1},
|
2003-02-07 13:58:30 +01:00
|
|
|
#endif
|
2003-02-16 19:58:56 +01:00
|
|
|
{TYPE_INTEGER, "ProcessPriorityLevel", (ConfigValue) 0},
|
2003-03-11 15:57:08 +01:00
|
|
|
{TYPE_INTEGER, "RemoteAuxPort", (ConfigValue) 0},
|
2003-03-15 21:02:39 +01:00
|
|
|
{TYPE_STRING, "RemoteBindAddress", (ConfigValue) 0},
|
2003-04-06 17:01:30 +02:00
|
|
|
{TYPE_STRING, "ExternalFileAccess", (ConfigValue) "None"}, // location(s) of external files for tables
|
2003-04-12 18:34:26 +02:00
|
|
|
{TYPE_STRING, "DatabaseAccess", (ConfigValue) "Full"}, // location(s) of databases
|
2009-09-11 12:49:46 +02:00
|
|
|
#define UDF_DEFAULT_CONFIG_VALUE "Restrict UDF"
|
|
|
|
{TYPE_STRING, "UdfAccess", (ConfigValue) UDF_DEFAULT_CONFIG_VALUE}, // location(s) of UDFs
|
2003-09-28 23:36:05 +02:00
|
|
|
{TYPE_STRING, "TempDirectories", (ConfigValue) 0},
|
2004-10-24 04:47:05 +02:00
|
|
|
#ifdef DEV_BUILD
|
|
|
|
{TYPE_BOOLEAN, "BugcheckAbort", (ConfigValue) true}, // whether to abort() engine when internal error is found
|
|
|
|
#else
|
2004-04-06 09:25:45 +02:00
|
|
|
{TYPE_BOOLEAN, "BugcheckAbort", (ConfigValue) false}, // whether to abort() engine when internal error is found
|
2004-10-24 04:47:05 +02:00
|
|
|
#endif
|
2010-05-01 15:47:39 +02:00
|
|
|
{TYPE_INTEGER, "TraceDSQL", (ConfigValue) 0}, // bitmask
|
2006-03-15 18:23:07 +01:00
|
|
|
{TYPE_BOOLEAN, "LegacyHash", (ConfigValue) true}, // let use old passwd hash verification
|
2010-04-15 16:40:27 +02:00
|
|
|
{TYPE_STRING, "GCPolicy", (ConfigValue) NULL}, // garbage collection policy
|
2006-01-17 05:40:31 +01:00
|
|
|
{TYPE_BOOLEAN, "Redirection", (ConfigValue) false},
|
2009-03-16 17:51:41 +01:00
|
|
|
{TYPE_STRING, "Authentication", (ConfigValue) AmNative}, // use native, trusted or mixed
|
2007-07-25 20:44:54 +02:00
|
|
|
{TYPE_INTEGER, "DatabaseGrowthIncrement", (ConfigValue) 128 * 1048576}, // bytes
|
2009-08-30 12:08:19 +02:00
|
|
|
{TYPE_INTEGER, "FileSystemCacheThreshold", (ConfigValue) 65536}, // page buffers
|
2008-08-25 09:58:45 +02:00
|
|
|
{TYPE_BOOLEAN, "RelaxedAliasChecking", (ConfigValue) false}, // if true relax strict alias checking rules in DSQL a bit
|
2009-02-01 23:10:12 +01:00
|
|
|
{TYPE_BOOLEAN, "OldSetClauseSemantics", (ConfigValue) false}, // if true disallow SET A = B, B = A to exchange column values
|
2009-02-02 10:12:38 +01:00
|
|
|
{TYPE_STRING, "AuditTraceConfigFile", (ConfigValue) ""}, // location of audit trace configuration file
|
2009-08-29 21:55:23 +02:00
|
|
|
{TYPE_INTEGER, "MaxUserTraceLogSize", (ConfigValue) 10}, // maximum size of user session trace log
|
2011-01-14 18:31:40 +01:00
|
|
|
{TYPE_INTEGER, "FileSystemCacheSize", (ConfigValue) 30}, // percent
|
2011-03-02 14:42:56 +01:00
|
|
|
{TYPE_STRING, "Providers", (ConfigValue) "Remote, Engine12, Loopback"},
|
|
|
|
{TYPE_STRING, "AuthServer", (ConfigValue) "Legacy_Auth, Win_Sspi"},
|
|
|
|
{TYPE_STRING, "AuthClient", (ConfigValue) "Legacy_Auth, Win_Sspi"},
|
2011-01-14 18:31:40 +01:00
|
|
|
{TYPE_STRING, "UserManager", (ConfigValue) "Legacy_Auth"},
|
2011-03-02 14:42:56 +01:00
|
|
|
{TYPE_STRING, "TracePlugin", (ConfigValue) "fbtrace"},
|
2011-05-09 12:15:19 +02:00
|
|
|
{TYPE_STRING, "SecurityDatabase", (ConfigValue) "$(root)/security3.fdb"}, // security database name
|
|
|
|
{TYPE_BOOLEAN, "SharedCache", (ConfigValue) true},
|
|
|
|
{TYPE_BOOLEAN, "SharedDatabase", (ConfigValue) false}
|
2002-11-03 17:26:12 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
/******************************************************************************
|
|
|
|
*
|
2010-02-28 19:00:51 +01:00
|
|
|
* Config routines
|
2002-11-03 17:26:12 +01:00
|
|
|
*/
|
|
|
|
|
2010-02-28 19:00:51 +01:00
|
|
|
Config::Config(const ConfigFile& file)
|
|
|
|
{
|
2011-03-02 14:42:56 +01:00
|
|
|
// Array to save string temporarily
|
|
|
|
// Will be finally save by loadValues() in the end of ctor
|
|
|
|
Firebird::ObjectsArray<ConfigFile::String> tempStrings(getPool());
|
2002-11-03 17:26:12 +01:00
|
|
|
|
2011-03-02 14:42:56 +01:00
|
|
|
// Iterate through the known configuration entries
|
2010-02-28 19:00:51 +01:00
|
|
|
for (unsigned int i = 0; i < MAX_CONFIG_KEY; i++)
|
|
|
|
{
|
|
|
|
values[i] = entries[i].default_value;
|
2011-03-02 14:42:56 +01:00
|
|
|
if (entries[i].data_type == TYPE_STRING && values[i])
|
|
|
|
{
|
|
|
|
ConfigFile::String expand((const char*)values[i]);
|
2011-03-06 02:06:36 +01:00
|
|
|
if (file.macroParse(expand) && expand != (const char*) values[i])
|
2011-03-02 14:42:56 +01:00
|
|
|
{
|
|
|
|
ConfigFile::String& saved(tempStrings.add());
|
|
|
|
saved = expand;
|
|
|
|
values[i] = (ConfigValue) saved.c_str();
|
|
|
|
}
|
|
|
|
}
|
2010-02-28 19:00:51 +01:00
|
|
|
}
|
2002-11-03 17:26:12 +01:00
|
|
|
|
2010-02-28 19:00:51 +01:00
|
|
|
loadValues(file);
|
|
|
|
}
|
|
|
|
|
|
|
|
Config::Config(const ConfigFile& file, const Config& base)
|
2002-11-03 17:26:12 +01:00
|
|
|
{
|
2010-02-28 19:00:51 +01:00
|
|
|
// Iterate through the known configuration entries
|
2002-11-30 16:08:09 +01:00
|
|
|
|
2010-02-28 19:00:51 +01:00
|
|
|
for (unsigned int i = 0; i < MAX_CONFIG_KEY; i++)
|
|
|
|
{
|
|
|
|
values[i] = base.values[i];
|
|
|
|
}
|
2002-11-30 16:08:09 +01:00
|
|
|
|
2010-02-28 19:00:51 +01:00
|
|
|
loadValues(file);
|
|
|
|
}
|
2002-11-03 17:26:12 +01:00
|
|
|
|
2010-02-28 19:00:51 +01:00
|
|
|
void Config::loadValues(const ConfigFile& file)
|
|
|
|
{
|
2009-04-17 16:10:11 +02:00
|
|
|
// Iterate through the known configuration entries
|
2002-11-03 17:26:12 +01:00
|
|
|
|
2010-02-28 19:00:51 +01:00
|
|
|
for (int i = 0; i < MAX_CONFIG_KEY; i++)
|
2002-11-03 17:26:12 +01:00
|
|
|
{
|
2010-02-28 19:00:51 +01:00
|
|
|
const ConfigEntry& entry = entries[i];
|
2010-03-04 13:52:01 +01:00
|
|
|
const ConfigFile::String value = getValue(file, entry.key);
|
2002-11-03 17:26:12 +01:00
|
|
|
|
2010-02-28 19:00:51 +01:00
|
|
|
if (value.length())
|
2002-11-30 16:08:09 +01:00
|
|
|
{
|
2010-02-28 19:00:51 +01:00
|
|
|
// Assign the actual value
|
2002-11-30 16:08:09 +01:00
|
|
|
|
2010-02-28 19:00:51 +01:00
|
|
|
switch (entry.data_type)
|
|
|
|
{
|
|
|
|
case TYPE_BOOLEAN:
|
|
|
|
values[i] = (ConfigValue) asBoolean(value);
|
|
|
|
break;
|
|
|
|
case TYPE_INTEGER:
|
|
|
|
values[i] = (ConfigValue) asInteger(value);
|
|
|
|
break;
|
|
|
|
case TYPE_STRING:
|
|
|
|
values[i] = (ConfigValue) asString(value);
|
|
|
|
break;
|
|
|
|
//case TYPE_STRING_VECTOR:
|
|
|
|
// break;
|
|
|
|
}
|
2011-03-02 14:42:56 +01:00
|
|
|
}
|
2002-11-30 16:08:09 +01:00
|
|
|
|
2011-03-02 14:42:56 +01:00
|
|
|
if (entry.data_type == TYPE_STRING && values[i] != entry.default_value)
|
|
|
|
{
|
|
|
|
const char* src = (const char*) values[i];
|
|
|
|
char* dst = FB_NEW(getPool()) char[strlen(src) + 1];
|
|
|
|
strcpy(dst, src);
|
|
|
|
values[i] = (ConfigValue) dst;
|
2002-11-30 16:08:09 +01:00
|
|
|
}
|
2002-11-03 17:26:12 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2010-02-28 19:00:51 +01:00
|
|
|
Config::~Config()
|
2002-11-03 17:26:12 +01:00
|
|
|
{
|
2009-04-17 16:10:11 +02:00
|
|
|
// Free allocated memory
|
2002-11-03 17:26:12 +01:00
|
|
|
|
2010-02-28 19:00:51 +01:00
|
|
|
for (int i = 0; i < MAX_CONFIG_KEY; i++)
|
2002-11-03 17:26:12 +01:00
|
|
|
{
|
2002-11-30 16:08:09 +01:00
|
|
|
if (values[i] == entries[i].default_value)
|
|
|
|
continue;
|
|
|
|
|
|
|
|
switch (entries[i].data_type)
|
|
|
|
{
|
|
|
|
case TYPE_STRING:
|
2008-05-22 23:45:22 +02:00
|
|
|
delete[] (char*) values[i];
|
2002-11-30 16:08:09 +01:00
|
|
|
break;
|
2009-08-18 14:41:39 +02:00
|
|
|
//case TYPE_STRING_VECTOR:
|
|
|
|
// break;
|
2002-11-30 16:08:09 +01:00
|
|
|
}
|
2002-11-03 17:26:12 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2010-03-04 13:52:01 +01:00
|
|
|
ConfigFile::String Config::getValue(const ConfigFile& file, ConfigName key)
|
2002-11-03 17:26:12 +01:00
|
|
|
{
|
2010-02-28 19:00:51 +01:00
|
|
|
const ConfigFile::Parameter* p = file.findParameter(key);
|
|
|
|
return p ? p->value : "";
|
2002-11-30 16:08:09 +01:00
|
|
|
}
|
2002-11-03 17:26:12 +01:00
|
|
|
|
2010-03-04 13:52:01 +01:00
|
|
|
int Config::asInteger(const ConfigFile::String &value)
|
2002-11-30 16:08:09 +01:00
|
|
|
{
|
|
|
|
return atoi(value.data());
|
|
|
|
}
|
2002-11-03 17:26:12 +01:00
|
|
|
|
2010-03-04 13:52:01 +01:00
|
|
|
bool Config::asBoolean(const ConfigFile::String &value)
|
2002-11-30 16:08:09 +01:00
|
|
|
{
|
2011-04-13 17:09:18 +02:00
|
|
|
return (atoi(value.data()) != 0) ||
|
|
|
|
value.equalsNoCase("true") ||
|
|
|
|
value.equalsNoCase("yes") ||
|
2011-04-12 14:47:33 +02:00
|
|
|
value.equalsNoCase("y");
|
2002-11-30 16:08:09 +01:00
|
|
|
}
|
2002-11-03 17:26:12 +01:00
|
|
|
|
2010-03-04 13:52:01 +01:00
|
|
|
const char* Config::asString(const ConfigFile::String &value)
|
2002-11-30 16:08:09 +01:00
|
|
|
{
|
|
|
|
return value.c_str();
|
2002-11-03 17:26:12 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
/******************************************************************************
|
|
|
|
*
|
|
|
|
* Public interface
|
|
|
|
*/
|
|
|
|
|
2010-02-28 19:00:51 +01:00
|
|
|
const Firebird::RefPtr<Config> Config::getDefaultConfig()
|
|
|
|
{
|
|
|
|
return firebirdConf().getDefaultConfig();
|
|
|
|
}
|
|
|
|
|
2011-01-19 18:24:49 +01:00
|
|
|
const char* Config::getMessage()
|
|
|
|
{
|
2011-01-20 10:18:37 +01:00
|
|
|
return firebirdConf().getMessage();
|
2011-01-19 18:24:49 +01:00
|
|
|
}
|
|
|
|
|
2005-05-28 00:45:31 +02:00
|
|
|
const char* Config::getInstallDirectory()
|
|
|
|
{
|
2010-03-05 18:21:18 +01:00
|
|
|
return rootDetector().getInstallDirectory();
|
2005-05-28 00:45:31 +02:00
|
|
|
}
|
|
|
|
|
2007-04-05 14:47:20 +02:00
|
|
|
static Firebird::PathName* rootFromCommandLine = 0;
|
|
|
|
|
|
|
|
void Config::setRootDirectoryFromCommandLine(const Firebird::PathName& newRoot)
|
|
|
|
{
|
|
|
|
delete rootFromCommandLine;
|
2008-12-05 02:20:14 +01:00
|
|
|
rootFromCommandLine = FB_NEW(*getDefaultMemoryPool())
|
2007-04-05 14:47:20 +02:00
|
|
|
Firebird::PathName(*getDefaultMemoryPool(), newRoot);
|
|
|
|
}
|
|
|
|
|
|
|
|
const Firebird::PathName* Config::getCommandLineRootDirectory()
|
|
|
|
{
|
|
|
|
return rootFromCommandLine;
|
|
|
|
}
|
|
|
|
|
2002-11-30 16:08:09 +01:00
|
|
|
const char* Config::getRootDirectory()
|
2002-11-03 17:26:12 +01:00
|
|
|
{
|
2010-03-05 18:21:18 +01:00
|
|
|
// must check it here - command line must override any other root settings
|
2007-04-05 14:47:20 +02:00
|
|
|
if (rootFromCommandLine)
|
|
|
|
{
|
|
|
|
return rootFromCommandLine->c_str();
|
|
|
|
}
|
|
|
|
|
2010-03-05 18:21:18 +01:00
|
|
|
return rootDetector().getRootDirectory();;
|
2002-11-03 17:26:12 +01:00
|
|
|
}
|
|
|
|
|
2011-03-02 14:42:56 +01:00
|
|
|
unsigned int Config::getKeyByName(ConfigName nm)
|
|
|
|
{
|
|
|
|
ConfigFile::KeyType name(nm);
|
|
|
|
for (unsigned int i = 0; i < MAX_CONFIG_KEY; i++)
|
|
|
|
{
|
|
|
|
if (name == entries[i].key)
|
|
|
|
{
|
|
|
|
return i;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return ~0;
|
|
|
|
}
|
|
|
|
|
|
|
|
int Config::getInt(unsigned int key) const
|
|
|
|
{
|
|
|
|
if (key >= MAX_CONFIG_KEY)
|
|
|
|
return 0;
|
|
|
|
return get<int>(static_cast<ConfigKey>(key));
|
|
|
|
}
|
|
|
|
|
|
|
|
const char* Config::getString(unsigned int key) const
|
|
|
|
{
|
|
|
|
if (key >= MAX_CONFIG_KEY)
|
2011-03-06 02:06:36 +01:00
|
|
|
return NULL;
|
2011-03-02 14:42:56 +01:00
|
|
|
return get<const char*>(static_cast<ConfigKey>(key));
|
|
|
|
}
|
|
|
|
|
2010-03-03 16:02:01 +01:00
|
|
|
int Config::getTempBlockSize()
|
2002-11-03 17:26:12 +01:00
|
|
|
{
|
2010-03-03 16:02:01 +01:00
|
|
|
return (int) getDefaultConfig()->values[KEY_TEMP_BLOCK_SIZE];
|
2002-11-03 17:26:12 +01:00
|
|
|
}
|
|
|
|
|
2010-03-03 16:02:01 +01:00
|
|
|
int Config::getTempCacheLimit()
|
2002-11-03 17:26:12 +01:00
|
|
|
{
|
2010-03-03 16:02:01 +01:00
|
|
|
int v = (int) getDefaultConfig()->values[KEY_TEMP_CACHE_LIMIT];
|
2010-04-15 16:40:27 +02:00
|
|
|
if (v < 0)
|
|
|
|
{
|
|
|
|
v = getSharedDatabase() ? 8388608 : 67108864; // bytes
|
|
|
|
}
|
|
|
|
return v;
|
2002-11-03 17:26:12 +01:00
|
|
|
}
|
|
|
|
|
2002-11-30 16:08:09 +01:00
|
|
|
bool Config::getRemoteFileOpenAbility()
|
2002-11-03 17:26:12 +01:00
|
|
|
{
|
2010-05-18 15:32:30 +02:00
|
|
|
return fb_utils::bootBuild() ? true : ((bool) getDefaultConfig()->values[KEY_REMOTE_FILE_OPEN_ABILITY]);
|
2002-11-03 17:26:12 +01:00
|
|
|
}
|
|
|
|
|
2002-11-30 16:08:09 +01:00
|
|
|
int Config::getGuardianOption()
|
2002-11-03 17:26:12 +01:00
|
|
|
{
|
2010-02-28 19:00:51 +01:00
|
|
|
return (int) getDefaultConfig()->values[KEY_GUARDIAN_OPTION];
|
2002-11-03 17:26:12 +01:00
|
|
|
}
|
2002-11-10 14:41:20 +01:00
|
|
|
|
2002-11-30 16:08:09 +01:00
|
|
|
int Config::getCpuAffinityMask()
|
2002-11-10 14:41:20 +01:00
|
|
|
{
|
2010-02-28 19:00:51 +01:00
|
|
|
return (int) getDefaultConfig()->values[KEY_CPU_AFFINITY_MASK];
|
2002-11-10 14:41:20 +01:00
|
|
|
}
|
2002-12-03 14:37:06 +01:00
|
|
|
|
2002-12-06 13:34:43 +01:00
|
|
|
int Config::getTcpRemoteBufferSize()
|
|
|
|
{
|
2010-02-28 19:00:51 +01:00
|
|
|
int rc = (int) getDefaultConfig()->values[KEY_TCP_REMOTE_BUFFER_SIZE];
|
2006-05-29 18:30:28 +02:00
|
|
|
if (rc < 1448)
|
|
|
|
rc = 1448;
|
|
|
|
if (rc > MAX_SSHORT)
|
|
|
|
rc = MAX_SSHORT;
|
|
|
|
return rc;
|
2002-12-06 13:34:43 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
bool Config::getTcpNoNagle()
|
|
|
|
{
|
2010-02-28 19:00:51 +01:00
|
|
|
return (bool) getDefaultConfig()->values[KEY_TCP_NO_NAGLE];
|
2002-12-06 13:34:43 +01:00
|
|
|
}
|
2002-12-06 22:12:59 +01:00
|
|
|
|
2010-02-28 19:00:51 +01:00
|
|
|
int Config::getDefaultDbCachePages() const
|
2002-12-06 22:12:59 +01:00
|
|
|
{
|
2010-04-15 16:40:27 +02:00
|
|
|
int rc = get<int>(KEY_DEFAULT_DB_CACHE_PAGES);
|
|
|
|
if (rc < 0)
|
|
|
|
{
|
2010-04-16 03:44:10 +02:00
|
|
|
rc = getSharedDatabase() ? 256 : 2048; // pages
|
2010-04-15 16:40:27 +02:00
|
|
|
}
|
|
|
|
return rc;
|
2002-12-06 22:12:59 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
int Config::getConnectionTimeout()
|
|
|
|
{
|
2010-02-28 19:00:51 +01:00
|
|
|
return (int) getDefaultConfig()->values[KEY_CONNECTION_TIMEOUT];
|
2002-12-06 22:12:59 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
int Config::getDummyPacketInterval()
|
|
|
|
{
|
2010-02-28 19:00:51 +01:00
|
|
|
return (int) getDefaultConfig()->values[KEY_DUMMY_PACKET_INTERVAL];
|
2002-12-06 22:12:59 +01:00
|
|
|
}
|
2002-12-07 14:27:12 +01:00
|
|
|
|
2010-02-28 19:00:51 +01:00
|
|
|
int Config::getLockMemSize() const
|
2002-12-07 14:27:12 +01:00
|
|
|
{
|
2010-02-28 19:00:51 +01:00
|
|
|
return get<int>(KEY_LOCK_MEM_SIZE);
|
2002-12-07 14:27:12 +01:00
|
|
|
}
|
|
|
|
|
2010-02-28 19:00:51 +01:00
|
|
|
bool Config::getLockGrantOrder() const
|
2002-12-07 14:27:12 +01:00
|
|
|
{
|
2010-02-28 19:00:51 +01:00
|
|
|
return get<bool>(KEY_LOCK_GRANT_ORDER);
|
2002-12-07 14:27:12 +01:00
|
|
|
}
|
|
|
|
|
2010-02-28 19:00:51 +01:00
|
|
|
int Config::getLockHashSlots() const
|
2002-12-07 14:27:12 +01:00
|
|
|
{
|
2010-02-28 19:00:51 +01:00
|
|
|
return get<int>(KEY_LOCK_HASH_SLOTS);
|
2002-12-07 14:27:12 +01:00
|
|
|
}
|
|
|
|
|
2010-02-28 19:00:51 +01:00
|
|
|
int Config::getLockAcquireSpins() const
|
2002-12-07 14:27:12 +01:00
|
|
|
{
|
2010-02-28 19:00:51 +01:00
|
|
|
return get<int>(KEY_LOCK_ACQUIRE_SPINS);
|
2002-12-07 14:27:12 +01:00
|
|
|
}
|
|
|
|
|
2010-02-28 19:00:51 +01:00
|
|
|
int Config::getEventMemSize() const
|
2002-12-07 14:27:12 +01:00
|
|
|
{
|
2010-02-28 19:00:51 +01:00
|
|
|
return get<int>(KEY_EVENT_MEM_SIZE);
|
2002-12-07 14:27:12 +01:00
|
|
|
}
|
|
|
|
|
2010-02-28 19:00:51 +01:00
|
|
|
int Config::getDeadlockTimeout() const
|
2002-12-07 14:27:12 +01:00
|
|
|
{
|
2010-02-28 19:00:51 +01:00
|
|
|
return get<int>(KEY_DEADLOCK_TIMEOUT);
|
2002-12-07 14:27:12 +01:00
|
|
|
}
|
|
|
|
|
2003-01-12 16:33:00 +01:00
|
|
|
int Config::getPrioritySwitchDelay()
|
|
|
|
{
|
2010-02-28 19:00:51 +01:00
|
|
|
int rc = (int) getDefaultConfig()->values[KEY_PRIORITY_SWITCH_DELAY];
|
2003-01-12 16:33:00 +01:00
|
|
|
if (rc < 1)
|
|
|
|
rc = 1;
|
|
|
|
return rc;
|
|
|
|
}
|
|
|
|
|
|
|
|
int Config::getPriorityBoost()
|
|
|
|
{
|
2010-02-28 19:00:51 +01:00
|
|
|
int rc = (int) getDefaultConfig()->values[KEY_PRIORITY_BOOST];
|
2003-01-12 16:33:00 +01:00
|
|
|
if (rc < 1)
|
|
|
|
rc = 1;
|
|
|
|
if (rc > 1000)
|
|
|
|
rc = 1000;
|
|
|
|
return rc;
|
|
|
|
}
|
2003-01-15 15:10:07 +01:00
|
|
|
|
2004-09-02 11:00:48 +02:00
|
|
|
bool Config::getUsePriorityScheduler()
|
|
|
|
{
|
2010-02-28 19:00:51 +01:00
|
|
|
return (bool) getDefaultConfig()->values[KEY_USE_PRIORITY_SCHEDULER];
|
2004-09-02 11:00:48 +02:00
|
|
|
}
|
|
|
|
|
2003-01-15 15:10:07 +01:00
|
|
|
const char *Config::getRemoteServiceName()
|
|
|
|
{
|
2010-02-28 19:00:51 +01:00
|
|
|
return (const char*) getDefaultConfig()->values[KEY_REMOTE_SERVICE_NAME];
|
2003-01-15 15:10:07 +01:00
|
|
|
}
|
|
|
|
|
2004-01-13 14:38:36 +01:00
|
|
|
unsigned short Config::getRemoteServicePort()
|
2003-01-15 15:10:07 +01:00
|
|
|
{
|
2010-02-28 19:00:51 +01:00
|
|
|
return (unsigned short) getDefaultConfig()->values[KEY_REMOTE_SERVICE_PORT];
|
2003-01-15 15:10:07 +01:00
|
|
|
}
|
|
|
|
|
2003-02-02 16:20:02 +01:00
|
|
|
const char *Config::getRemotePipeName()
|
2003-01-15 15:10:07 +01:00
|
|
|
{
|
2010-02-28 19:00:51 +01:00
|
|
|
return (const char*) getDefaultConfig()->values[KEY_REMOTE_PIPE_NAME];
|
2003-01-15 15:10:07 +01:00
|
|
|
}
|
|
|
|
|
2003-02-02 16:20:02 +01:00
|
|
|
const char *Config::getIpcName()
|
2003-01-15 15:10:07 +01:00
|
|
|
{
|
2010-02-28 19:00:51 +01:00
|
|
|
return (const char*) getDefaultConfig()->values[KEY_IPC_NAME];
|
2003-01-15 15:10:07 +01:00
|
|
|
}
|
2003-02-05 15:32:21 +01:00
|
|
|
|
2010-02-28 19:00:51 +01:00
|
|
|
int Config::getMaxUnflushedWrites() const
|
2003-02-05 15:32:21 +01:00
|
|
|
{
|
2010-02-28 19:00:51 +01:00
|
|
|
return get<int>(KEY_MAX_UNFLUSHED_WRITES);
|
2003-02-05 15:32:21 +01:00
|
|
|
}
|
|
|
|
|
2010-02-28 19:00:51 +01:00
|
|
|
int Config::getMaxUnflushedWriteTime() const
|
2003-02-05 15:32:21 +01:00
|
|
|
{
|
2010-02-28 19:00:51 +01:00
|
|
|
return get<int>(KEY_MAX_UNFLUSHED_WRITE_TIME);
|
2003-02-09 12:22:10 +01:00
|
|
|
}
|
2003-02-16 19:58:56 +01:00
|
|
|
|
|
|
|
int Config::getProcessPriorityLevel()
|
|
|
|
{
|
2010-02-28 19:00:51 +01:00
|
|
|
return (int) getDefaultConfig()->values[KEY_PROCESS_PRIORITY_LEVEL];
|
2003-02-16 19:58:56 +01:00
|
|
|
}
|
|
|
|
|
2003-03-11 15:57:08 +01:00
|
|
|
int Config::getRemoteAuxPort()
|
|
|
|
{
|
2010-02-28 19:00:51 +01:00
|
|
|
return (int) getDefaultConfig()->values[KEY_REMOTE_AUX_PORT];
|
2003-03-11 15:57:08 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
const char *Config::getRemoteBindAddress()
|
|
|
|
{
|
2010-02-28 19:00:51 +01:00
|
|
|
return (const char*) getDefaultConfig()->values[KEY_REMOTE_BIND_ADDRESS];
|
2003-03-11 15:57:08 +01:00
|
|
|
}
|
2003-03-15 21:02:39 +01:00
|
|
|
|
2010-02-28 19:00:51 +01:00
|
|
|
const char *Config::getExternalFileAccess() const
|
2003-03-15 21:02:39 +01:00
|
|
|
{
|
2010-02-28 19:00:51 +01:00
|
|
|
return get<const char*>(KEY_EXTERNAL_FILE_ACCESS);
|
2003-03-15 21:02:39 +01:00
|
|
|
}
|
2003-03-31 19:41:18 +02:00
|
|
|
|
2003-04-06 17:01:30 +02:00
|
|
|
const char *Config::getDatabaseAccess()
|
2003-03-31 19:41:18 +02:00
|
|
|
{
|
2010-02-28 19:00:51 +01:00
|
|
|
return (const char*) getDefaultConfig()->values[KEY_DATABASE_ACCESS];
|
2003-03-31 19:41:18 +02:00
|
|
|
}
|
2003-04-12 18:34:26 +02:00
|
|
|
|
|
|
|
const char *Config::getUdfAccess()
|
|
|
|
{
|
2009-09-11 12:49:46 +02:00
|
|
|
static Firebird::GlobalPtr<Firebird::Mutex> udfMutex;
|
|
|
|
static Firebird::GlobalPtr<Firebird::string> udfValue;
|
|
|
|
static const char* volatile value = 0;
|
|
|
|
|
|
|
|
if (value)
|
|
|
|
{
|
|
|
|
return value;
|
|
|
|
}
|
|
|
|
|
|
|
|
Firebird::MutexLockGuard guard(udfMutex);
|
|
|
|
|
|
|
|
if (value)
|
|
|
|
{
|
|
|
|
return value;
|
|
|
|
}
|
|
|
|
|
2010-02-28 19:00:51 +01:00
|
|
|
const char* v = (const char*) getDefaultConfig()->values[KEY_UDF_ACCESS];
|
2009-09-14 09:48:54 +02:00
|
|
|
if (CASE_SENSITIVITY ? (! strcmp(v, UDF_DEFAULT_CONFIG_VALUE) && FB_UDFDIR[0]) :
|
|
|
|
(! fb_utils::stricmp(v, UDF_DEFAULT_CONFIG_VALUE) && FB_UDFDIR[0]))
|
2009-09-11 12:49:46 +02:00
|
|
|
{
|
|
|
|
udfValue->printf("Restrict %s", FB_UDFDIR);
|
|
|
|
value = udfValue->c_str();
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
value = v;
|
|
|
|
}
|
|
|
|
return value;
|
2003-04-12 18:34:26 +02:00
|
|
|
}
|
2003-05-01 13:35:15 +02:00
|
|
|
|
|
|
|
const char *Config::getTempDirectories()
|
|
|
|
{
|
2010-02-28 19:00:51 +01:00
|
|
|
return (const char*) getDefaultConfig()->values[KEY_TEMP_DIRECTORIES];
|
2003-05-01 13:35:15 +02:00
|
|
|
}
|
2003-09-28 23:36:05 +02:00
|
|
|
|
2004-04-06 09:25:45 +02:00
|
|
|
bool Config::getBugcheckAbort()
|
|
|
|
{
|
2010-02-28 19:00:51 +01:00
|
|
|
return (bool) getDefaultConfig()->values[KEY_BUGCHECK_ABORT];
|
2004-04-06 09:25:45 +02:00
|
|
|
}
|
|
|
|
|
2010-05-01 15:47:39 +02:00
|
|
|
int Config::getTraceDSQL()
|
|
|
|
{
|
|
|
|
return (int) getDefaultConfig()->values[KEY_TRACE_DSQL];
|
|
|
|
}
|
|
|
|
|
2004-11-07 15:12:15 +01:00
|
|
|
bool Config::getLegacyHash()
|
|
|
|
{
|
2010-02-28 19:00:51 +01:00
|
|
|
return (bool) getDefaultConfig()->values[KEY_LEGACY_HASH];
|
2004-11-07 15:12:15 +01:00
|
|
|
}
|
2004-11-09 13:59:37 +01:00
|
|
|
|
2010-02-28 19:00:51 +01:00
|
|
|
const char *Config::getGCPolicy() const
|
2004-11-09 13:59:37 +01:00
|
|
|
{
|
2010-04-15 16:40:27 +02:00
|
|
|
const char* rc = get<const char*>(KEY_GC_POLICY);
|
|
|
|
|
|
|
|
if (rc)
|
|
|
|
{
|
|
|
|
if (strcmp(rc, GCPolicyCooperative) != 0 &&
|
|
|
|
strcmp(rc, GCPolicyBackground) != 0 &&
|
|
|
|
strcmp(rc, GCPolicyCombined) != 0)
|
|
|
|
{
|
|
|
|
// user-provided value is invalid - fail to default
|
2010-04-16 03:44:10 +02:00
|
|
|
rc = NULL;
|
2010-04-15 16:40:27 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if (! rc)
|
|
|
|
{
|
|
|
|
rc = getSharedCache() ? GCPolicyCombined : GCPolicyCooperative;
|
|
|
|
}
|
|
|
|
|
|
|
|
return rc;
|
2004-11-09 13:59:37 +01:00
|
|
|
}
|
2005-01-12 09:30:24 +01:00
|
|
|
|
2005-12-21 11:10:37 +01:00
|
|
|
bool Config::getRedirection()
|
|
|
|
{
|
2010-02-28 19:00:51 +01:00
|
|
|
return (bool) getDefaultConfig()->values[KEY_REDIRECTION];
|
2005-12-21 11:10:37 +01:00
|
|
|
}
|
2006-01-17 05:40:31 +01:00
|
|
|
|
2006-12-17 15:02:23 +01:00
|
|
|
const char *Config::getAuthMethod()
|
2006-12-10 13:31:15 +01:00
|
|
|
{
|
2010-02-28 19:00:51 +01:00
|
|
|
return (const char*) getDefaultConfig()->values[KEY_AUTH_METHOD];
|
2006-12-10 13:31:15 +01:00
|
|
|
}
|
2007-04-25 23:08:57 +02:00
|
|
|
|
2010-02-28 19:00:51 +01:00
|
|
|
int Config::getDatabaseGrowthIncrement() const
|
2007-04-25 23:08:57 +02:00
|
|
|
{
|
2010-02-28 19:00:51 +01:00
|
|
|
return get<int>(KEY_DATABASE_GROWTH_INCREMENT);
|
2007-04-25 23:08:57 +02:00
|
|
|
}
|
2007-07-25 20:44:54 +02:00
|
|
|
|
2010-02-28 19:00:51 +01:00
|
|
|
int Config::getFileSystemCacheThreshold() const
|
2007-07-25 20:44:54 +02:00
|
|
|
{
|
2010-02-28 19:00:51 +01:00
|
|
|
int rc = get<int>(KEY_FILESYSTEM_CACHE_THRESHOLD);
|
2009-11-05 09:27:03 +01:00
|
|
|
return rc < 0 ? 0 : rc;
|
2007-07-25 20:44:54 +02:00
|
|
|
}
|
2007-11-29 18:53:38 +01:00
|
|
|
|
|
|
|
bool Config::getRelaxedAliasChecking()
|
|
|
|
{
|
2010-02-28 19:00:51 +01:00
|
|
|
return (bool) getDefaultConfig()->values[KEY_RELAXED_ALIAS_CHECKING];
|
2007-11-29 18:53:38 +01:00
|
|
|
}
|
2008-08-25 09:58:45 +02:00
|
|
|
|
|
|
|
bool Config::getOldSetClauseSemantics()
|
|
|
|
{
|
2010-02-28 19:00:51 +01:00
|
|
|
return (bool) getDefaultConfig()->values[KEY_OLD_SET_CLAUSE_SEMANTICS];
|
2008-08-25 09:58:45 +02:00
|
|
|
}
|
2009-02-01 23:10:12 +01:00
|
|
|
|
2009-08-29 21:55:23 +02:00
|
|
|
int Config::getFileSystemCacheSize()
|
|
|
|
{
|
2010-02-28 19:00:51 +01:00
|
|
|
return (int) getDefaultConfig()->values[KEY_FILESYSTEM_CACHE_SIZE];
|
2009-08-29 21:55:23 +02:00
|
|
|
}
|
|
|
|
|
2009-02-01 23:10:12 +01:00
|
|
|
const char *Config::getAuditTraceConfigFile()
|
|
|
|
{
|
2010-02-28 19:00:51 +01:00
|
|
|
return (const char*) getDefaultConfig()->values[KEY_TRACE_CONFIG];
|
2009-02-01 23:10:12 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
int Config::getMaxUserTraceLogSize()
|
|
|
|
{
|
2010-02-28 19:00:51 +01:00
|
|
|
return (int) getDefaultConfig()->values[KEY_MAX_TRACELOG_SIZE];
|
2009-02-01 23:10:12 +01:00
|
|
|
}
|
2010-04-15 16:40:27 +02:00
|
|
|
|
|
|
|
bool Config::getSharedCache()
|
|
|
|
{
|
2011-05-09 12:15:19 +02:00
|
|
|
return (bool) getDefaultConfig()->values[KEY_SHARED_CACHE];
|
2010-04-15 16:40:27 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
bool Config::getSharedDatabase()
|
|
|
|
{
|
2011-05-09 12:15:19 +02:00
|
|
|
return (bool) getDefaultConfig()->values[KEY_SHARED_DATABASE];
|
2010-04-15 16:40:27 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
bool Config::getMultiClientServer()
|
|
|
|
{
|
|
|
|
// AP - absolutely wrong for superclassic assumption
|
|
|
|
// should be set by server in case of 'super' mode in it
|
|
|
|
#ifdef SUPERSERVER
|
|
|
|
return true;
|
|
|
|
#else
|
|
|
|
return false;
|
|
|
|
#endif
|
|
|
|
}
|
2011-01-14 18:31:40 +01:00
|
|
|
|
|
|
|
const char* Config::getPlugins(unsigned int type)
|
|
|
|
{
|
2011-01-16 03:16:15 +01:00
|
|
|
switch (type)
|
2011-01-14 18:31:40 +01:00
|
|
|
{
|
|
|
|
case Firebird::PluginType::Provider:
|
|
|
|
return (const char*) getDefaultConfig()->values[KEY_PLUG_PROVIDERS];
|
|
|
|
case Firebird::PluginType::AuthServer:
|
|
|
|
return (const char*) getDefaultConfig()->values[KEY_PLUG_AUTH_SERVER];
|
|
|
|
case Firebird::PluginType::AuthClient:
|
|
|
|
return (const char*) getDefaultConfig()->values[KEY_PLUG_AUTH_CLIENT];
|
|
|
|
case Firebird::PluginType::AuthUserManagement:
|
|
|
|
return (const char*) getDefaultConfig()->values[KEY_PLUG_AUTH_MANAGE];
|
|
|
|
case Firebird::PluginType::Trace:
|
|
|
|
return (const char*) getDefaultConfig()->values[KEY_PLUG_TRACE];
|
|
|
|
}
|
|
|
|
|
|
|
|
(Firebird::Arg::Gds(isc_random) << "Internal error in getPlugins()").raise();
|
|
|
|
return NULL; // compiler warning silencer
|
|
|
|
}
|
2011-03-02 14:42:56 +01:00
|
|
|
|
|
|
|
unsigned int FB_CARG FirebirdConf::getKey(const char* name)
|
|
|
|
{
|
|
|
|
return Config::getKeyByName(name);
|
|
|
|
}
|
|
|
|
|
|
|
|
int FB_CARG FirebirdConf::asInteger(unsigned int key)
|
|
|
|
{
|
|
|
|
return config->getInt(key);
|
|
|
|
}
|
|
|
|
|
|
|
|
const char* FB_CARG FirebirdConf::asString(unsigned int key)
|
|
|
|
{
|
|
|
|
return config->getString(key);
|
|
|
|
}
|
|
|
|
|
|
|
|
int FB_CARG FirebirdConf::release()
|
|
|
|
{
|
|
|
|
if (--refCounter == 0)
|
|
|
|
{
|
|
|
|
delete this;
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
|
2011-03-06 02:06:36 +01:00
|
|
|
const char* Config::getSecurityDatabase() const
|
2011-03-02 14:42:56 +01:00
|
|
|
{
|
|
|
|
return get<const char*>(KEY_SECURITY_DATABASE);
|
|
|
|
}
|