8
0
mirror of https://github.com/FirebirdSQL/firebird.git synced 2025-01-22 18:43:02 +01:00

Changes to read /etc/firebird.conf file

This commit is contained in:
skywalker 2001-08-21 09:41:00 +00:00
parent 83f8c38cf0
commit 570289f7b6
11 changed files with 89 additions and 25 deletions

View File

@ -35,6 +35,14 @@ int FirebirdConfig::getSysInt(const string& key) {
return sysConfig.getInt(key);
}
//-----------------------------------------------------------------------------
//
//
//
bool FirebirdConfig::getSysBoolean(const string& key) {
return sysConfig.getBoolean(key);
}
//-----------------------------------------------------------------------------
//

View File

@ -12,6 +12,7 @@ public:
static string getSysString(const string& key);
static int getSysInt(const string& key);
static bool getSysBoolean(const string& key);
static void loadSysConfig();
static const string getSysConfigFile();
static void setSysConfigFile(const string& newFile);
@ -28,6 +29,7 @@ public:
virtual void checkLoadConfig()= 0;
virtual string getString(const string& key) = 0;
virtual int getInt(const string& key) = 0;
virtual bool getBoolean(const string& key) = 0;
virtual ~FirebirdConfig() {}

View File

@ -17,6 +17,7 @@ FirebirdConfigFile::FirebirdConfigFile()
{
isLoadedFlg = false;
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;
}
//-----------------------------------------------------------------------------
//

View File

@ -9,7 +9,7 @@
#include "FirebirdConfig.h"
class FirebirdConfigFile : FirebirdConfig {
class FirebirdConfigFile : public FirebirdConfig {
public:
FirebirdConfigFile();
@ -20,10 +20,11 @@ public:
bool getIsLoadedFlg() { return isLoadedFlg; }
void setIsLoadedFlg(bool newFlg) { isLoadedFlg = newFlg; }
void loadConfig();
void checkLoadConfig();
string getString(const string& key);
int getInt(const string& key);
virtual void loadConfig();
virtual void checkLoadConfig();
virtual string getString(const string& key);
virtual int getInt(const string& key);
virtual bool getBoolean(const string& key);
private:
string configFile;

View File

@ -115,6 +115,9 @@
#include "../jrd/event_proto.h"
#include "../jrd/old_proto.h"
#include "fbutil/FirebirdConfig.h"
#ifdef GARBAGE_THREAD
#include "vio_proto.h"
#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
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);
}

View File

@ -26,7 +26,7 @@
# 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=../..
@ -63,7 +63,7 @@ all: gbak_static gbak gsplit
gbak_static : $(BIN)/gbak_static
$(BIN)/gbak_static : $(BURP_Objects) $(BOOT_GDSLIB_Objects)
$(CXX) $(LINK_OPTS) $^ -o $@ $(COREFOUNDATION_LINK) $(LINK_LIBS)
$(CXX) $(LINK_OPTS) $^ -o $@ $(COREFOUNDATION_LINK) $(STATICLINK_LIBS)

View File

@ -26,7 +26,7 @@
# 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=../..
@ -43,12 +43,28 @@ AllObjects= $(FBUTIL_Objects)
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.
.PHONY: jrdlib_dependencies
jrdlib_dependencies: $(FBUTIL_Objects)
# The following was just for testing
testx: main.o $(FBUTIL_Objects)
g++ -o $@ $^ $(STATICLINK_LIBS)
clean:
-rm $(AllObjects)

View File

@ -26,7 +26,7 @@
# 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=..
@ -40,7 +40,7 @@ include $(ROOT)/src/make.shared.variables
ISC_USER= sysdba
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_PASSWORD
@ -83,7 +83,7 @@ phase1: $(GPRE_STATIC)
$(GPRE_STATIC):
$(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
$(MAKE) -C gpre $@
@ -98,6 +98,8 @@ gpre_boot : jrd_boot
jrd_boot :
$(MAKE) -C jrd $@
fbutil_boot :
$(MAKE) -C fbutil $@

View File

@ -26,7 +26,7 @@
# 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=../..
@ -75,7 +75,7 @@ gpre_static : $(GPRE_STATIC)
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)
-$(RM) $(GPRE_CURRENT)
$(LN) $(@F) $(GPRE_CURRENT)

View File

@ -26,7 +26,7 @@
# 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=../..
@ -80,7 +80,7 @@ jrdlib_dependencies: $(LOCK_Objects)
gds_lock_manager : $(BIN)/gds_lock_mgr
$(BIN)/gds_lock_mgr: $(LOCKMGR_Objects) $(BOOT_GDSLIB_Objects)
$(CXX) $(LINK_OPTS) $^ -o $@ $(LINK_LIBS)
$(CXX) $(LINK_OPTS) $^ -o $@ $(STATICLINK_LIBS)
$(CHMOD_S7) $@
@ -90,9 +90,9 @@ $(BIN)/gds_lock_mgr: $(LOCKMGR_Objects) $(BOOT_GDSLIB_Objects)
# 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)
$(CHMOD_S7) $@

View File

@ -26,7 +26,7 @@
# 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
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 =
EXE_LINK = @CC@
STATICEXE_LINK = @CXX@
EXE_LINK = g++
STATICEXE_LINK = g++
# EXE_LINK = @CXX@
# STATICEXE_LINK = @CXX@
endif
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
STATICLINK_LIBS = $(LINK_LIBS)
STATICLINK_LIBS = -lm -lstdc++ -lgcc -lc -ldl -lcrypt