mirror of
https://github.com/FirebirdSQL/firebird.git
synced 2025-01-23 22:43:04 +01:00
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.
This commit is contained in:
parent
427f4a6a2d
commit
f92b39e11c
@ -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);
|
||||
}
|
||||
|
@ -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";
|
||||
|
||||
|
@ -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;
|
||||
|
||||
|
@ -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;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user