mirror of
https://github.com/MariaDB/server.git
synced 2025-01-31 11:01:52 +01:00
Many files:
included full my_global.h and resolved some resulting name conflicts
This commit is contained in:
parent
b2e241ff90
commit
7d6496382f
10 changed files with 46 additions and 41 deletions
|
@ -19,7 +19,7 @@
|
|||
|
||||
#include "LogHandler.hpp"
|
||||
|
||||
class File;
|
||||
class File_class;
|
||||
|
||||
/**
|
||||
* Logs messages to a file. The log file will be archived depending on
|
||||
|
@ -104,7 +104,7 @@ private:
|
|||
int m_maxNoFiles;
|
||||
long m_maxFileSize;
|
||||
unsigned int m_maxLogEntries;
|
||||
File* m_pLogFile;
|
||||
File_class* m_pLogFile;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
|
|
@ -1,3 +1,3 @@
|
|||
/*#include <my_global.h>*/
|
||||
#include <my_config.h>
|
||||
#include <my_global.h>
|
||||
/*#include <my_config.h>*/
|
||||
|
||||
|
|
|
@ -26,7 +26,7 @@
|
|||
*
|
||||
* @version #@ $Id: File.hpp,v 1.5 2002/04/26 13:15:38 ejonore Exp $
|
||||
*/
|
||||
class File
|
||||
class File_class
|
||||
{
|
||||
public:
|
||||
/**
|
||||
|
@ -65,7 +65,7 @@ public:
|
|||
/**
|
||||
* Default constructor.
|
||||
*/
|
||||
File();
|
||||
File_class();
|
||||
|
||||
/**
|
||||
* Creates a new File with the specified filename and file mode.
|
||||
|
@ -76,12 +76,12 @@ public:
|
|||
* @param aFileName a filename.
|
||||
* @param mode the mode which the file should be opened/created with, default "r".
|
||||
*/
|
||||
File(const char* aFileName, const char* mode = "r");
|
||||
File_class(const char* aFileName, const char* mode = "r");
|
||||
|
||||
/**
|
||||
* Destructor.
|
||||
*/
|
||||
~File();
|
||||
~File_class();
|
||||
|
||||
/**
|
||||
* Opens/creates the file. If open() fails then 'errno' and perror()
|
||||
|
@ -198,9 +198,9 @@ private:
|
|||
char m_fileName[MAX_FILE_NAME_SIZE];
|
||||
const char* m_fileMode;
|
||||
/* Prohibit */
|
||||
File(const File& aCopy);
|
||||
File operator = (const File&);
|
||||
bool operator == (const File&);
|
||||
File_class (const File_class& aCopy);
|
||||
File_class operator = (const File_class&);
|
||||
bool operator == (const File_class&);
|
||||
};
|
||||
#endif
|
||||
|
||||
|
|
|
@ -14,7 +14,7 @@
|
|||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
|
||||
|
||||
#include "FileLogHandler.hpp"
|
||||
#include <FileLogHandler.hpp>
|
||||
|
||||
#include <File.hpp>
|
||||
|
||||
|
@ -35,7 +35,7 @@ FileLogHandler::FileLogHandler() :
|
|||
m_maxLogEntries(MAX_LOG_ENTRIES)
|
||||
|
||||
{
|
||||
m_pLogFile = new File("logger.log", "a+");
|
||||
m_pLogFile = new File_class("logger.log", "a+");
|
||||
}
|
||||
|
||||
FileLogHandler::FileLogHandler(const char* aFileName,
|
||||
|
@ -47,7 +47,7 @@ FileLogHandler::FileLogHandler(const char* aFileName,
|
|||
m_maxFileSize(maxFileSize),
|
||||
m_maxLogEntries(maxLogEntries)
|
||||
{
|
||||
m_pLogFile = new File(aFileName, "a+");
|
||||
m_pLogFile = new File_class(aFileName, "a+");
|
||||
}
|
||||
|
||||
FileLogHandler::~FileLogHandler()
|
||||
|
@ -166,10 +166,10 @@ FileLogHandler::createNewFile()
|
|||
::snprintf(newName, sizeof(newName),
|
||||
"%s.%d", m_pLogFile->getName(), fileNo++);
|
||||
|
||||
} while (File::exists(newName));
|
||||
} while (File_class::exists(newName));
|
||||
|
||||
m_pLogFile->close();
|
||||
if (!File::rename(m_pLogFile->getName(), newName))
|
||||
if (!File_class::rename(m_pLogFile->getName(), newName))
|
||||
{
|
||||
setErrorCode(errno);
|
||||
rc = false;
|
||||
|
@ -201,7 +201,7 @@ FileLogHandler::setFilename(const BaseString &filename) {
|
|||
close();
|
||||
if(m_pLogFile)
|
||||
delete m_pLogFile;
|
||||
m_pLogFile = new File(filename.c_str(), "a+");
|
||||
m_pLogFile = new File_class(filename.c_str(), "a+");
|
||||
open();
|
||||
return true;
|
||||
};
|
||||
|
|
|
@ -31,7 +31,7 @@
|
|||
//
|
||||
|
||||
bool
|
||||
File::exists(const char* aFileName)
|
||||
File_class::exists(const char* aFileName)
|
||||
{
|
||||
bool rc = true;
|
||||
|
||||
|
@ -56,7 +56,7 @@ File::exists(const char* aFileName)
|
|||
}
|
||||
|
||||
long
|
||||
File::size(FILE* f)
|
||||
File_class::size(FILE* f)
|
||||
{
|
||||
long cur_pos = 0, length = 0;
|
||||
|
||||
|
@ -69,23 +69,23 @@ File::size(FILE* f)
|
|||
}
|
||||
|
||||
bool
|
||||
File::rename(const char* currFileName, const char* newFileName)
|
||||
File_class::rename(const char* currFileName, const char* newFileName)
|
||||
{
|
||||
return ::rename(currFileName, newFileName) == 0 ? true : false;
|
||||
}
|
||||
bool
|
||||
File::remove(const char* aFileName)
|
||||
File_class::remove(const char* aFileName)
|
||||
{
|
||||
return ::remove(aFileName) == 0 ? true : false;
|
||||
}
|
||||
|
||||
File::File() :
|
||||
File_class::File_class() :
|
||||
m_file(NULL),
|
||||
m_fileMode("r")
|
||||
{
|
||||
}
|
||||
|
||||
File::File(const char* aFileName, const char* mode) :
|
||||
File_class::File_class(const char* aFileName, const char* mode) :
|
||||
m_file(NULL),
|
||||
m_fileMode(mode)
|
||||
{
|
||||
|
@ -93,13 +93,13 @@ File::File(const char* aFileName, const char* mode) :
|
|||
}
|
||||
|
||||
bool
|
||||
File::open()
|
||||
File_class::open()
|
||||
{
|
||||
return open(m_fileName, m_fileMode);
|
||||
}
|
||||
|
||||
bool
|
||||
File::open(const char* aFileName, const char* mode)
|
||||
File_class::open(const char* aFileName, const char* mode)
|
||||
{
|
||||
if(m_fileName != aFileName){
|
||||
/**
|
||||
|
@ -116,21 +116,21 @@ File::open(const char* aFileName, const char* mode)
|
|||
|
||||
return rc;
|
||||
}
|
||||
File::~File()
|
||||
File_class::~File_class()
|
||||
{
|
||||
close();
|
||||
}
|
||||
|
||||
bool
|
||||
File::remove()
|
||||
File_class::remove()
|
||||
{
|
||||
// Close the file first!
|
||||
close();
|
||||
return File::remove(m_fileName);
|
||||
return File_class::remove(m_fileName);
|
||||
}
|
||||
|
||||
bool
|
||||
File::close()
|
||||
File_class::close()
|
||||
{
|
||||
bool rc = true;
|
||||
if (m_file != NULL)
|
||||
|
@ -144,55 +144,55 @@ File::close()
|
|||
}
|
||||
|
||||
int
|
||||
File::read(void* buf, size_t itemSize, size_t nitems) const
|
||||
File_class::read(void* buf, size_t itemSize, size_t nitems) const
|
||||
{
|
||||
return ::fread(buf, itemSize, nitems, m_file);
|
||||
}
|
||||
|
||||
int
|
||||
File::readChar(char* buf, long start, long length) const
|
||||
File_class::readChar(char* buf, long start, long length) const
|
||||
{
|
||||
return ::fread((void*)&buf[start], 1, length, m_file);
|
||||
}
|
||||
|
||||
int
|
||||
File::readChar(char* buf)
|
||||
File_class::readChar(char* buf)
|
||||
{
|
||||
return readChar(buf, 0, strlen(buf));
|
||||
}
|
||||
|
||||
int
|
||||
File::write(const void* buf, size_t size, size_t nitems)
|
||||
File_class::write(const void* buf, size_t size, size_t nitems)
|
||||
{
|
||||
return ::fwrite(buf, size, nitems, m_file);
|
||||
}
|
||||
|
||||
int
|
||||
File::writeChar(const char* buf, long start, long length)
|
||||
File_class::writeChar(const char* buf, long start, long length)
|
||||
{
|
||||
return ::fwrite((const void*)&buf[start], sizeof(char), length, m_file);
|
||||
}
|
||||
|
||||
int
|
||||
File::writeChar(const char* buf)
|
||||
File_class::writeChar(const char* buf)
|
||||
{
|
||||
return writeChar(buf, 0, ::strlen(buf));
|
||||
}
|
||||
|
||||
long
|
||||
File::size() const
|
||||
File_class::size() const
|
||||
{
|
||||
return File::size(m_file);
|
||||
return File_class::size(m_file);
|
||||
}
|
||||
|
||||
const char*
|
||||
File::getName() const
|
||||
File_class::getName() const
|
||||
{
|
||||
return m_fileName;
|
||||
}
|
||||
|
||||
int
|
||||
File::flush() const
|
||||
File_class::flush() const
|
||||
{
|
||||
#if defined NDB_OSE || defined NDB_SOFTOSE
|
||||
::fflush(m_file);
|
||||
|
|
|
@ -39,6 +39,7 @@
|
|||
//#include <NdbString.h>
|
||||
|
||||
#ifndef HAVE_STRLCAT
|
||||
|
||||
size_t
|
||||
strlcat (char *dst, const char *src, size_t dst_sz)
|
||||
{
|
||||
|
|
|
@ -83,6 +83,9 @@
|
|||
#define jamEntry() jamEntryLine(90000 + __LINE__)
|
||||
#endif
|
||||
|
||||
#undef max
|
||||
#undef min
|
||||
|
||||
class Configuration;
|
||||
|
||||
class Dbtux : public SimulatedBlock {
|
||||
|
|
|
@ -26,7 +26,6 @@
|
|||
|
||||
#include <rep/rep_version.hpp>
|
||||
|
||||
|
||||
/**
|
||||
* Connection data
|
||||
*/
|
||||
|
|
|
@ -29,7 +29,7 @@
|
|||
|
||||
extern "C"
|
||||
void
|
||||
DBUG_PRINT(const char * fmt, ...);
|
||||
DBUG_PRINT__(const char * fmt, ...);
|
||||
|
||||
extern "C"
|
||||
void
|
||||
|
|
|
@ -17,6 +17,8 @@
|
|||
#ifndef GCI_CONTAINER_HPP
|
||||
#define GCI_CONTAINER_HPP
|
||||
|
||||
#undef swap
|
||||
|
||||
#include <Vector.hpp>
|
||||
|
||||
#include "LogRecord.hpp"
|
||||
|
|
Loading…
Add table
Reference in a new issue