From f92b39e11c3fae1419111546641f540af5ff8022 Mon Sep 17 00:00:00 2001 From: skidder Date: Sun, 8 Feb 2004 18:47:47 +0000 Subject: [PATCH] Get posix build closer to buildable state after Alex' commits, but build is still broken. It was very bad idea to commit incomplete and broken stuff into CVS, in particular, fb_string still has some rough edges, doesn't work with memory pools correctly and fb_string.cpp is just missing. --- src/jrd/flu.cpp | 4 ++-- src/jrd/os/posix/config_root.cpp | 4 ++-- src/jrd/os/posix/mod_loader.cpp | 10 ++++----- src/jrd/os/posix/path_utils.cpp | 36 ++++++++++++++++---------------- 4 files changed, 27 insertions(+), 27 deletions(-) diff --git a/src/jrd/flu.cpp b/src/jrd/flu.cpp index c82a920ac2..2130b9b4ad 100644 --- a/src/jrd/flu.cpp +++ b/src/jrd/flu.cpp @@ -43,7 +43,7 @@ * */ /* -$Id: flu.cpp,v 1.43 2004-02-08 17:08:31 alexpeshkoff Exp $ +$Id: flu.cpp,v 1.44 2004-02-08 18:47:44 skidder Exp $ */ #include "firebird.h" @@ -483,7 +483,7 @@ FPTR_INT ISC_lookup_entrypoint(TEXT* module, } if (!mod) { // Start looking for "libxxxx.so" module names - FireBird::PathName moduleName = "lib"; + Firebird::PathName moduleName = "lib"; moduleName += (const char*) absolute_module; mod = search_for_module((TEXT*) moduleName.c_str(), name, ShowAccessError); } diff --git a/src/jrd/os/posix/config_root.cpp b/src/jrd/os/posix/config_root.cpp index e9b3c4c3e7..9a2834a512 100644 --- a/src/jrd/os/posix/config_root.cpp +++ b/src/jrd/os/posix/config_root.cpp @@ -34,7 +34,7 @@ * compatibility with Kylix * * - * $Id: config_root.cpp,v 1.8 2003-08-09 22:52:35 brodsom Exp $ + * $Id: config_root.cpp,v 1.9 2004-02-08 18:47:47 skidder Exp $ */ #include "firebird.h" @@ -49,7 +49,7 @@ #include "../jrd/os/config_root.h" #include "../jrd/os/path_utils.h" -typedef Firebird::string string; +typedef Firebird::PathName string; static const char *CONFIG_FILE = "firebird.conf"; diff --git a/src/jrd/os/posix/mod_loader.cpp b/src/jrd/os/posix/mod_loader.cpp index 0b04d1112d..b1e6f013e2 100644 --- a/src/jrd/os/posix/mod_loader.cpp +++ b/src/jrd/os/posix/mod_loader.cpp @@ -25,7 +25,7 @@ private: void *module; }; -bool ModuleLoader::isLoadableModule(const Firebird::string& module) +bool ModuleLoader::isLoadableModule(const Firebird::PathName& module) { struct stat sb; if (-1 == stat(module.c_str(), &sb)) @@ -37,15 +37,15 @@ bool ModuleLoader::isLoadableModule(const Firebird::string& module) return true; } -void ModuleLoader::doctorModuleExtention(Firebird::string& name) +void ModuleLoader::doctorModuleExtention(Firebird::PathName& name) { - Firebird::string::size_type pos = name.rfind(".so"); - if (pos != Firebird::string::npos && pos == name.length() - 3) + Firebird::PathName::size_type pos = name.rfind(".so"); + if (pos != Firebird::PathName::npos && pos == name.length() - 3) return; // No doctoring necessary name += ".so"; } -ModuleLoader::Module *ModuleLoader::loadModule(const Firebird::string& modPath) +ModuleLoader::Module *ModuleLoader::loadModule(const Firebird::PathName& modPath) { void *module; diff --git a/src/jrd/os/posix/path_utils.cpp b/src/jrd/os/posix/path_utils.cpp index 24642bdf3e..4644735182 100644 --- a/src/jrd/os/posix/path_utils.cpp +++ b/src/jrd/os/posix/path_utils.cpp @@ -7,24 +7,24 @@ /// The POSIX implementation of the path_utils abstraction. const char PathUtils::dir_sep = '/'; -const Firebird::string PathUtils::up_dir_link = ".."; +const char* PathUtils::up_dir_link = ".."; class PosixDirItr : public PathUtils::dir_iterator { public: - PosixDirItr(const Firebird::string&); + PosixDirItr(const Firebird::PathName&); ~PosixDirItr(); const PosixDirItr& operator++(); - const Firebird::string& operator*() { return file; } + const Firebird::PathName& operator*() { return file; } operator bool() { return !done; } private: DIR *dir; - Firebird::string file; + Firebird::PathName file; int done; }; -PosixDirItr::PosixDirItr(const Firebird::string& path) +PosixDirItr::PosixDirItr(const Firebird::PathName& path) : dir_iterator(path), dir(0), done(0) { dir = opendir(dirPrefix.c_str()); @@ -58,18 +58,18 @@ const PosixDirItr& PosixDirItr::operator++() return *this; } -PathUtils::dir_iterator *PathUtils::newDirItr(MemoryPool& p, const Firebird::string& path) +PathUtils::dir_iterator *PathUtils::newDirItr(MemoryPool& p, const Firebird::PathName& path) { return FB_NEW(p) PosixDirItr(path); } -void PathUtils::splitLastComponent(Firebird::string& path, Firebird::string& file, - const Firebird::string& orgPath) +void PathUtils::splitLastComponent(Firebird::PathName& path, Firebird::PathName& file, + const Firebird::PathName& orgPath) { - Firebird::string::size_type pos; + Firebird::PathName::size_type pos; pos = orgPath.rfind(dir_sep); - if (pos == Firebird::string::npos) + if (pos == Firebird::PathName::npos) { path = ""; file = orgPath; @@ -82,9 +82,9 @@ void PathUtils::splitLastComponent(Firebird::string& path, Firebird::string& fil file.append(orgPath, pos+1, orgPath.length() - pos - 1); } -void PathUtils::concatPath(Firebird::string& result, - const Firebird::string& first, - const Firebird::string& second) +void PathUtils::concatPath(Firebird::PathName& result, + const Firebird::PathName& first, + const Firebird::PathName& second) { if (second.length() == 0) { @@ -114,14 +114,14 @@ void PathUtils::concatPath(Firebird::string& result, result = first + second; } -bool PathUtils::isRelative(const Firebird::string& path) +bool PathUtils::isRelative(const Firebird::PathName& path) { if (path.length() > 0) return path[0] != dir_sep; return false; } -bool PathUtils::isSymLink(const Firebird::string& path) +bool PathUtils::isSymLink(const Firebird::PathName& path) { struct stat st, lst; if (stat(path.c_str(), &st) != 0) @@ -131,11 +131,11 @@ bool PathUtils::isSymLink(const Firebird::string& path) return st.st_ino != lst.st_ino; } -bool PathUtils::comparePaths(const Firebird::string& path1, - const Firebird::string& path2) { +bool PathUtils::comparePaths(const Firebird::PathName& path1, + const Firebird::PathName& path2) { return path1 == path2; } -bool PathUtils::canAccess(const Firebird::string& path, int mode) { +bool PathUtils::canAccess(const Firebird::PathName& path, int mode) { return access(path.c_str(), mode) == 0; }