mirror of
https://github.com/FirebirdSQL/firebird.git
synced 2025-02-02 10:40:38 +01:00
Changes to read /etc/firebird.conf file
This commit is contained in:
parent
83f8c38cf0
commit
570289f7b6
@ -35,6 +35,14 @@ int FirebirdConfig::getSysInt(const string& key) {
|
|||||||
return sysConfig.getInt(key);
|
return sysConfig.getInt(key);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//-----------------------------------------------------------------------------
|
||||||
|
//
|
||||||
|
//
|
||||||
|
//
|
||||||
|
|
||||||
|
bool FirebirdConfig::getSysBoolean(const string& key) {
|
||||||
|
return sysConfig.getBoolean(key);
|
||||||
|
}
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
//
|
//
|
||||||
|
@ -12,6 +12,7 @@ public:
|
|||||||
|
|
||||||
static string getSysString(const string& key);
|
static string getSysString(const string& key);
|
||||||
static int getSysInt(const string& key);
|
static int getSysInt(const string& key);
|
||||||
|
static bool getSysBoolean(const string& key);
|
||||||
static void loadSysConfig();
|
static void loadSysConfig();
|
||||||
static const string getSysConfigFile();
|
static const string getSysConfigFile();
|
||||||
static void setSysConfigFile(const string& newFile);
|
static void setSysConfigFile(const string& newFile);
|
||||||
@ -28,6 +29,7 @@ public:
|
|||||||
virtual void checkLoadConfig()= 0;
|
virtual void checkLoadConfig()= 0;
|
||||||
virtual string getString(const string& key) = 0;
|
virtual string getString(const string& key) = 0;
|
||||||
virtual int getInt(const string& key) = 0;
|
virtual int getInt(const string& key) = 0;
|
||||||
|
virtual bool getBoolean(const string& key) = 0;
|
||||||
|
|
||||||
virtual ~FirebirdConfig() {}
|
virtual ~FirebirdConfig() {}
|
||||||
|
|
||||||
|
@ -17,6 +17,7 @@ FirebirdConfigFile::FirebirdConfigFile()
|
|||||||
{
|
{
|
||||||
isLoadedFlg = false;
|
isLoadedFlg = false;
|
||||||
configFile = "/etc/firebird.conf";
|
configFile = "/etc/firebird.conf";
|
||||||
|
cout << "Got ya" << endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
@ -114,6 +115,30 @@ int FirebirdConfigFile::getInt(const string& key) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//-----------------------------------------------------------------------------
|
||||||
|
//
|
||||||
|
//
|
||||||
|
//
|
||||||
|
|
||||||
|
bool FirebirdConfigFile::getBoolean(const string& key) {
|
||||||
|
|
||||||
|
checkLoadConfig();
|
||||||
|
|
||||||
|
string data = getString(key);
|
||||||
|
|
||||||
|
if (data.empty()) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
int result = atoi(data.data());
|
||||||
|
|
||||||
|
if (result != 0) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
//
|
//
|
||||||
|
@ -9,7 +9,7 @@
|
|||||||
|
|
||||||
#include "FirebirdConfig.h"
|
#include "FirebirdConfig.h"
|
||||||
|
|
||||||
class FirebirdConfigFile : FirebirdConfig {
|
class FirebirdConfigFile : public FirebirdConfig {
|
||||||
public:
|
public:
|
||||||
|
|
||||||
FirebirdConfigFile();
|
FirebirdConfigFile();
|
||||||
@ -20,10 +20,11 @@ public:
|
|||||||
bool getIsLoadedFlg() { return isLoadedFlg; }
|
bool getIsLoadedFlg() { return isLoadedFlg; }
|
||||||
void setIsLoadedFlg(bool newFlg) { isLoadedFlg = newFlg; }
|
void setIsLoadedFlg(bool newFlg) { isLoadedFlg = newFlg; }
|
||||||
|
|
||||||
void loadConfig();
|
virtual void loadConfig();
|
||||||
void checkLoadConfig();
|
virtual void checkLoadConfig();
|
||||||
string getString(const string& key);
|
virtual string getString(const string& key);
|
||||||
int getInt(const string& key);
|
virtual int getInt(const string& key);
|
||||||
|
virtual bool getBoolean(const string& key);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
string configFile;
|
string configFile;
|
||||||
|
@ -115,6 +115,9 @@
|
|||||||
#include "../jrd/event_proto.h"
|
#include "../jrd/event_proto.h"
|
||||||
#include "../jrd/old_proto.h"
|
#include "../jrd/old_proto.h"
|
||||||
|
|
||||||
|
|
||||||
|
#include "fbutil/FirebirdConfig.h"
|
||||||
|
|
||||||
#ifdef GARBAGE_THREAD
|
#ifdef GARBAGE_THREAD
|
||||||
#include "vio_proto.h"
|
#include "vio_proto.h"
|
||||||
#endif
|
#endif
|
||||||
@ -697,7 +700,11 @@ STATUS DLL_EXPORT GDS_ATTACH_DATABASE(STATUS* user_status,
|
|||||||
/* Check to see if the database is truly local or if it just looks
|
/* Check to see if the database is truly local or if it just looks
|
||||||
that way */
|
that way */
|
||||||
|
|
||||||
if (ISC_check_if_remote(expanded_filename, TRUE))
|
int checkRemoteFiles = 0;
|
||||||
|
if (FirebirdConfig::getSysBoolean("DoRemoteOpenForNFSFiles")) {
|
||||||
|
checkRemoteFiles=1;
|
||||||
|
}
|
||||||
|
if (ISC_check_if_remote(expanded_filename, checkRemoteFiles))
|
||||||
ERR_post(gds_unavailable, 0);
|
ERR_post(gds_unavailable, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -26,7 +26,7 @@
|
|||||||
# Contributor(s):
|
# Contributor(s):
|
||||||
#
|
#
|
||||||
#
|
#
|
||||||
# $Id: Makefile.in.burp,v 1.4 2001-08-13 08:14:38 skywalker Exp $
|
# $Id: Makefile.in.burp,v 1.5 2001-08-21 09:41:00 skywalker Exp $
|
||||||
#
|
#
|
||||||
|
|
||||||
ROOT=../..
|
ROOT=../..
|
||||||
@ -63,7 +63,7 @@ all: gbak_static gbak gsplit
|
|||||||
gbak_static : $(BIN)/gbak_static
|
gbak_static : $(BIN)/gbak_static
|
||||||
|
|
||||||
$(BIN)/gbak_static : $(BURP_Objects) $(BOOT_GDSLIB_Objects)
|
$(BIN)/gbak_static : $(BURP_Objects) $(BOOT_GDSLIB_Objects)
|
||||||
$(CXX) $(LINK_OPTS) $^ -o $@ $(COREFOUNDATION_LINK) $(LINK_LIBS)
|
$(CXX) $(LINK_OPTS) $^ -o $@ $(COREFOUNDATION_LINK) $(STATICLINK_LIBS)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -26,7 +26,7 @@
|
|||||||
# Contributor(s):
|
# Contributor(s):
|
||||||
#
|
#
|
||||||
#
|
#
|
||||||
# $Id: Makefile.in.fbutil,v 1.4 2001-08-13 08:14:38 skywalker Exp $
|
# $Id: Makefile.in.fbutil,v 1.5 2001-08-21 09:41:00 skywalker Exp $
|
||||||
#
|
#
|
||||||
|
|
||||||
ROOT=../..
|
ROOT=../..
|
||||||
@ -43,12 +43,28 @@ AllObjects= $(FBUTIL_Objects)
|
|||||||
Dependancies=$(AllObjects:.o=.d)
|
Dependancies=$(AllObjects:.o=.d)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
fbutil_boot : $(LIB)/fbutil_boot.a
|
||||||
|
|
||||||
|
$(LIB)/fbutil_boot.a: $(FBUTIL_Objects)
|
||||||
|
-$(RM) $@
|
||||||
|
$(AR) $@ $^
|
||||||
|
-$(RANLIB) $@
|
||||||
|
$(CHMOD_6) $@
|
||||||
|
|
||||||
|
|
||||||
# Build all our objects that belong in the shared library.
|
# Build all our objects that belong in the shared library.
|
||||||
.PHONY: jrdlib_dependencies
|
.PHONY: jrdlib_dependencies
|
||||||
|
|
||||||
jrdlib_dependencies: $(FBUTIL_Objects)
|
jrdlib_dependencies: $(FBUTIL_Objects)
|
||||||
|
|
||||||
|
|
||||||
|
# The following was just for testing
|
||||||
|
|
||||||
|
testx: main.o $(FBUTIL_Objects)
|
||||||
|
g++ -o $@ $^ $(STATICLINK_LIBS)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
-rm $(AllObjects)
|
-rm $(AllObjects)
|
||||||
|
@ -26,7 +26,7 @@
|
|||||||
# Contributor(s):
|
# Contributor(s):
|
||||||
#
|
#
|
||||||
#
|
#
|
||||||
# $Id: Makefile.in.firebird,v 1.8 2001-08-20 08:15:33 skywalker Exp $
|
# $Id: Makefile.in.firebird,v 1.9 2001-08-21 09:41:00 skywalker Exp $
|
||||||
#
|
#
|
||||||
|
|
||||||
ROOT=..
|
ROOT=..
|
||||||
@ -40,7 +40,7 @@ include $(ROOT)/src/make.shared.variables
|
|||||||
|
|
||||||
ISC_USER= sysdba
|
ISC_USER= sysdba
|
||||||
ISC_PASSWORD= masterkey
|
ISC_PASSWORD= masterkey
|
||||||
LD_LIBRARY_PATH=/home/odonohue/src/firebird2/gen/firebird/lib
|
LD_LIBRARY_PATH=/home/odonohue/src/firebird2/gen/firebird/lib:/usr/lib
|
||||||
|
|
||||||
export ISC_USER
|
export ISC_USER
|
||||||
export ISC_PASSWORD
|
export ISC_PASSWORD
|
||||||
@ -83,7 +83,7 @@ phase1: $(GPRE_STATIC)
|
|||||||
$(GPRE_STATIC):
|
$(GPRE_STATIC):
|
||||||
$(MAKE) phase1_build
|
$(MAKE) phase1_build
|
||||||
|
|
||||||
phase1_build: jrd_boot gpre_boot build_alt_use_boot jrdlib_dependencies gpre_static
|
phase1_build: jrd_boot fbutil_boot gpre_boot build_alt_use_boot jrdlib_dependencies gpre_static
|
||||||
|
|
||||||
gpre_static : jrdlib_dependencies
|
gpre_static : jrdlib_dependencies
|
||||||
$(MAKE) -C gpre $@
|
$(MAKE) -C gpre $@
|
||||||
@ -98,6 +98,8 @@ gpre_boot : jrd_boot
|
|||||||
jrd_boot :
|
jrd_boot :
|
||||||
$(MAKE) -C jrd $@
|
$(MAKE) -C jrd $@
|
||||||
|
|
||||||
|
fbutil_boot :
|
||||||
|
$(MAKE) -C fbutil $@
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -26,7 +26,7 @@
|
|||||||
# Contributor(s):
|
# Contributor(s):
|
||||||
#
|
#
|
||||||
#
|
#
|
||||||
# $Id: Makefile.in.gpre,v 1.6 2001-08-13 08:14:38 skywalker Exp $
|
# $Id: Makefile.in.gpre,v 1.7 2001-08-21 09:41:00 skywalker Exp $
|
||||||
#
|
#
|
||||||
|
|
||||||
ROOT=../..
|
ROOT=../..
|
||||||
@ -75,7 +75,7 @@ gpre_static : $(GPRE_STATIC)
|
|||||||
gpre : $(GPRE)
|
gpre : $(GPRE)
|
||||||
|
|
||||||
|
|
||||||
$(GPRE_BOOT): $(GPRECommon_Objects) $(GPREBoot_Objects) $(LIB)/jrd_boot.a
|
$(GPRE_BOOT): $(GPRECommon_Objects) $(GPREBoot_Objects) $(LIB)/jrd_boot.a $(LIB)/fbutil_boot.a
|
||||||
$(STATICEXE_LINK) -o $(GPRE_BOOT) $^ $(STATICLINK_LIBS)
|
$(STATICEXE_LINK) -o $(GPRE_BOOT) $^ $(STATICLINK_LIBS)
|
||||||
-$(RM) $(GPRE_CURRENT)
|
-$(RM) $(GPRE_CURRENT)
|
||||||
$(LN) $(@F) $(GPRE_CURRENT)
|
$(LN) $(@F) $(GPRE_CURRENT)
|
||||||
|
@ -26,7 +26,7 @@
|
|||||||
# Contributor(s):
|
# Contributor(s):
|
||||||
#
|
#
|
||||||
#
|
#
|
||||||
# $Id: Makefile.in.lock,v 1.5 2001-08-13 08:14:38 skywalker Exp $
|
# $Id: Makefile.in.lock,v 1.6 2001-08-21 09:41:00 skywalker Exp $
|
||||||
#
|
#
|
||||||
|
|
||||||
ROOT=../..
|
ROOT=../..
|
||||||
@ -80,7 +80,7 @@ jrdlib_dependencies: $(LOCK_Objects)
|
|||||||
gds_lock_manager : $(BIN)/gds_lock_mgr
|
gds_lock_manager : $(BIN)/gds_lock_mgr
|
||||||
|
|
||||||
$(BIN)/gds_lock_mgr: $(LOCKMGR_Objects) $(BOOT_GDSLIB_Objects)
|
$(BIN)/gds_lock_mgr: $(LOCKMGR_Objects) $(BOOT_GDSLIB_Objects)
|
||||||
$(CXX) $(LINK_OPTS) $^ -o $@ $(LINK_LIBS)
|
$(CXX) $(LINK_OPTS) $^ -o $@ $(STATICLINK_LIBS)
|
||||||
$(CHMOD_S7) $@
|
$(CHMOD_S7) $@
|
||||||
|
|
||||||
|
|
||||||
@ -90,9 +90,9 @@ $(BIN)/gds_lock_mgr: $(LOCKMGR_Objects) $(BOOT_GDSLIB_Objects)
|
|||||||
# the "mgr" not "manager".
|
# the "mgr" not "manager".
|
||||||
|
|
||||||
|
|
||||||
lock_print : $(BIN)/lock_print
|
lock_print : $(BIN)/gds_lock_print
|
||||||
|
|
||||||
$(BIN)/lock_print: $(LOCKPRINT_Objects) $(LIBGDS_DEP)
|
$(BIN)/gds_lock_print: $(LOCKPRINT_Objects) $(LIBGDS_DEP)
|
||||||
$(CXX) $(LINK_OPTS) $(LIBGDS_LINK) $^ -o $@ $(LINK_LIBS)
|
$(CXX) $(LINK_OPTS) $(LIBGDS_LINK) $^ -o $@ $(LINK_LIBS)
|
||||||
$(CHMOD_S7) $@
|
$(CHMOD_S7) $@
|
||||||
|
|
||||||
|
@ -26,7 +26,7 @@
|
|||||||
# Contributor(s):
|
# Contributor(s):
|
||||||
#
|
#
|
||||||
#
|
#
|
||||||
# $Id: make.rules,v 1.8 2001-08-20 08:15:33 skywalker Exp $
|
# $Id: make.rules,v 1.9 2001-08-21 09:41:00 skywalker Exp $
|
||||||
#
|
#
|
||||||
|
|
||||||
#____________________________________________________________________________
|
#____________________________________________________________________________
|
||||||
@ -121,20 +121,23 @@ else
|
|||||||
|
|
||||||
LIB_LINK= ld -shared
|
LIB_LINK= ld -shared
|
||||||
STATICLIB_LINK= ar cruvs
|
STATICLIB_LINK= ar cruvs
|
||||||
LIB_LINK_OPTIONS = -soname libgds.so.2 -rpath /usr/lib
|
LIB_LINK_OPTIONS = -soname libgds.so -rpath /usr/lib
|
||||||
|
# LIB_LINK_OPTIONS = -soname libgds.so.2 -rpath /usr/lib
|
||||||
# LIB_LINK_OPTIONS =
|
# LIB_LINK_OPTIONS =
|
||||||
|
|
||||||
EXE_LINK = @CC@
|
EXE_LINK = g++
|
||||||
STATICEXE_LINK = @CXX@
|
STATICEXE_LINK = g++
|
||||||
|
# EXE_LINK = @CXX@
|
||||||
|
# STATICEXE_LINK = @CXX@
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
LINK_OPTIONS=
|
LINK_OPTIONS=
|
||||||
LINK_LIBS= -lm -lstdc++ -lc -ldl -lcrypt
|
LINK_LIBS= -lm -lstdc++ -lgcc -lc -ldl -lcrypt
|
||||||
#LINK_LIBS= -L$(LIB) -lgds -lm -lc -ldl -lcrypt
|
#LINK_LIBS= -L$(LIB) -lgds -lm -lc -ldl -lcrypt
|
||||||
STATICLINK_LIBS = $(LINK_LIBS)
|
STATICLINK_LIBS = -lm -lstdc++ -lgcc -lc -ldl -lcrypt
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user