Commit 789adced authored by unknown's avatar unknown

Many files:

  included full my_global.h and resolved some resulting name conflicts


ndb/include/ndb_global.h:
  included full my_global.h and resolved some resulting name conflicts
ndb/include/logger/FileLogHandler.hpp:
  included full my_global.h and resolved some resulting name conflicts
ndb/include/util/File.hpp:
  included full my_global.h and resolved some resulting name conflicts
ndb/src/common/logger/FileLogHandler.cpp:
  included full my_global.h and resolved some resulting name conflicts
ndb/src/common/util/File.cpp:
  included full my_global.h and resolved some resulting name conflicts
ndb/src/common/util/strlcat.c:
  included full my_global.h and resolved some resulting name conflicts
ndb/src/kernel/blocks/dbtux/Dbtux.hpp:
  included full my_global.h and resolved some resulting name conflicts
ndb/src/rep/RepComponents.hpp:
  included full my_global.h and resolved some resulting name conflicts
ndb/src/rep/rep_version.hpp:
  included full my_global.h and resolved some resulting name conflicts
ndb/src/rep/storage/GCIContainer.hpp:
  included full my_global.h and resolved some resulting name conflicts
parent c91ea436
...@@ -19,7 +19,7 @@ ...@@ -19,7 +19,7 @@
#include "LogHandler.hpp" #include "LogHandler.hpp"
class File; class File_class;
/** /**
* Logs messages to a file. The log file will be archived depending on * Logs messages to a file. The log file will be archived depending on
...@@ -104,7 +104,7 @@ private: ...@@ -104,7 +104,7 @@ private:
int m_maxNoFiles; int m_maxNoFiles;
long m_maxFileSize; long m_maxFileSize;
unsigned int m_maxLogEntries; unsigned int m_maxLogEntries;
File* m_pLogFile; File_class* m_pLogFile;
}; };
#endif #endif
/*#include <my_global.h>*/ #include <my_global.h>
#include <my_config.h> /*#include <my_config.h>*/
...@@ -26,7 +26,7 @@ ...@@ -26,7 +26,7 @@
* *
* @version #@ $Id: File.hpp,v 1.5 2002/04/26 13:15:38 ejonore Exp $ * @version #@ $Id: File.hpp,v 1.5 2002/04/26 13:15:38 ejonore Exp $
*/ */
class File class File_class
{ {
public: public:
/** /**
...@@ -65,7 +65,7 @@ public: ...@@ -65,7 +65,7 @@ public:
/** /**
* Default constructor. * Default constructor.
*/ */
File(); File_class();
/** /**
* Creates a new File with the specified filename and file mode. * Creates a new File with the specified filename and file mode.
...@@ -76,12 +76,12 @@ public: ...@@ -76,12 +76,12 @@ public:
* @param aFileName a filename. * @param aFileName a filename.
* @param mode the mode which the file should be opened/created with, default "r". * @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. * Destructor.
*/ */
~File(); ~File_class();
/** /**
* Opens/creates the file. If open() fails then 'errno' and perror() * Opens/creates the file. If open() fails then 'errno' and perror()
...@@ -198,9 +198,9 @@ private: ...@@ -198,9 +198,9 @@ private:
char m_fileName[MAX_FILE_NAME_SIZE]; char m_fileName[MAX_FILE_NAME_SIZE];
const char* m_fileMode; const char* m_fileMode;
/* Prohibit */ /* Prohibit */
File(const File& aCopy); File_class (const File_class& aCopy);
File operator = (const File&); File_class operator = (const File_class&);
bool operator == (const File&); bool operator == (const File_class&);
}; };
#endif #endif
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
along with this program; if not, write to the Free Software along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
#include "FileLogHandler.hpp" #include <FileLogHandler.hpp>
#include <File.hpp> #include <File.hpp>
...@@ -35,7 +35,7 @@ FileLogHandler::FileLogHandler() : ...@@ -35,7 +35,7 @@ FileLogHandler::FileLogHandler() :
m_maxLogEntries(MAX_LOG_ENTRIES) 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, FileLogHandler::FileLogHandler(const char* aFileName,
...@@ -47,7 +47,7 @@ FileLogHandler::FileLogHandler(const char* aFileName, ...@@ -47,7 +47,7 @@ FileLogHandler::FileLogHandler(const char* aFileName,
m_maxFileSize(maxFileSize), m_maxFileSize(maxFileSize),
m_maxLogEntries(maxLogEntries) m_maxLogEntries(maxLogEntries)
{ {
m_pLogFile = new File(aFileName, "a+"); m_pLogFile = new File_class(aFileName, "a+");
} }
FileLogHandler::~FileLogHandler() FileLogHandler::~FileLogHandler()
...@@ -166,10 +166,10 @@ FileLogHandler::createNewFile() ...@@ -166,10 +166,10 @@ FileLogHandler::createNewFile()
::snprintf(newName, sizeof(newName), ::snprintf(newName, sizeof(newName),
"%s.%d", m_pLogFile->getName(), fileNo++); "%s.%d", m_pLogFile->getName(), fileNo++);
} while (File::exists(newName)); } while (File_class::exists(newName));
m_pLogFile->close(); m_pLogFile->close();
if (!File::rename(m_pLogFile->getName(), newName)) if (!File_class::rename(m_pLogFile->getName(), newName))
{ {
setErrorCode(errno); setErrorCode(errno);
rc = false; rc = false;
...@@ -201,7 +201,7 @@ FileLogHandler::setFilename(const BaseString &filename) { ...@@ -201,7 +201,7 @@ FileLogHandler::setFilename(const BaseString &filename) {
close(); close();
if(m_pLogFile) if(m_pLogFile)
delete m_pLogFile; delete m_pLogFile;
m_pLogFile = new File(filename.c_str(), "a+"); m_pLogFile = new File_class(filename.c_str(), "a+");
open(); open();
return true; return true;
}; };
......
...@@ -31,7 +31,7 @@ ...@@ -31,7 +31,7 @@
// //
bool bool
File::exists(const char* aFileName) File_class::exists(const char* aFileName)
{ {
bool rc = true; bool rc = true;
...@@ -56,7 +56,7 @@ File::exists(const char* aFileName) ...@@ -56,7 +56,7 @@ File::exists(const char* aFileName)
} }
long long
File::size(FILE* f) File_class::size(FILE* f)
{ {
long cur_pos = 0, length = 0; long cur_pos = 0, length = 0;
...@@ -69,23 +69,23 @@ File::size(FILE* f) ...@@ -69,23 +69,23 @@ File::size(FILE* f)
} }
bool 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; return ::rename(currFileName, newFileName) == 0 ? true : false;
} }
bool bool
File::remove(const char* aFileName) File_class::remove(const char* aFileName)
{ {
return ::remove(aFileName) == 0 ? true : false; return ::remove(aFileName) == 0 ? true : false;
} }
File::File() : File_class::File_class() :
m_file(NULL), m_file(NULL),
m_fileMode("r") 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_file(NULL),
m_fileMode(mode) m_fileMode(mode)
{ {
...@@ -93,13 +93,13 @@ File::File(const char* aFileName, const char* mode) : ...@@ -93,13 +93,13 @@ File::File(const char* aFileName, const char* mode) :
} }
bool bool
File::open() File_class::open()
{ {
return open(m_fileName, m_fileMode); return open(m_fileName, m_fileMode);
} }
bool bool
File::open(const char* aFileName, const char* mode) File_class::open(const char* aFileName, const char* mode)
{ {
if(m_fileName != aFileName){ if(m_fileName != aFileName){
/** /**
...@@ -116,21 +116,21 @@ File::open(const char* aFileName, const char* mode) ...@@ -116,21 +116,21 @@ File::open(const char* aFileName, const char* mode)
return rc; return rc;
} }
File::~File() File_class::~File_class()
{ {
close(); close();
} }
bool bool
File::remove() File_class::remove()
{ {
// Close the file first! // Close the file first!
close(); close();
return File::remove(m_fileName); return File_class::remove(m_fileName);
} }
bool bool
File::close() File_class::close()
{ {
bool rc = true; bool rc = true;
if (m_file != NULL) if (m_file != NULL)
...@@ -144,55 +144,55 @@ File::close() ...@@ -144,55 +144,55 @@ File::close()
} }
int 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); return ::fread(buf, itemSize, nitems, m_file);
} }
int 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); return ::fread((void*)&buf[start], 1, length, m_file);
} }
int int
File::readChar(char* buf) File_class::readChar(char* buf)
{ {
return readChar(buf, 0, strlen(buf)); return readChar(buf, 0, strlen(buf));
} }
int 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); return ::fwrite(buf, size, nitems, m_file);
} }
int 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); return ::fwrite((const void*)&buf[start], sizeof(char), length, m_file);
} }
int int
File::writeChar(const char* buf) File_class::writeChar(const char* buf)
{ {
return writeChar(buf, 0, ::strlen(buf)); return writeChar(buf, 0, ::strlen(buf));
} }
long long
File::size() const File_class::size() const
{ {
return File::size(m_file); return File_class::size(m_file);
} }
const char* const char*
File::getName() const File_class::getName() const
{ {
return m_fileName; return m_fileName;
} }
int int
File::flush() const File_class::flush() const
{ {
#if defined NDB_OSE || defined NDB_SOFTOSE #if defined NDB_OSE || defined NDB_SOFTOSE
::fflush(m_file); ::fflush(m_file);
......
...@@ -39,6 +39,7 @@ ...@@ -39,6 +39,7 @@
//#include <NdbString.h> //#include <NdbString.h>
#ifndef HAVE_STRLCAT #ifndef HAVE_STRLCAT
size_t size_t
strlcat (char *dst, const char *src, size_t dst_sz) strlcat (char *dst, const char *src, size_t dst_sz)
{ {
......
...@@ -83,6 +83,9 @@ ...@@ -83,6 +83,9 @@
#define jamEntry() jamEntryLine(90000 + __LINE__) #define jamEntry() jamEntryLine(90000 + __LINE__)
#endif #endif
#undef max
#undef min
class Configuration; class Configuration;
class Dbtux : public SimulatedBlock { class Dbtux : public SimulatedBlock {
......
...@@ -26,7 +26,6 @@ ...@@ -26,7 +26,6 @@
#include <rep/rep_version.hpp> #include <rep/rep_version.hpp>
/** /**
* Connection data * Connection data
*/ */
......
...@@ -29,7 +29,7 @@ ...@@ -29,7 +29,7 @@
extern "C" extern "C"
void void
DBUG_PRINT(const char * fmt, ...); DBUG_PRINT__(const char * fmt, ...);
extern "C" extern "C"
void void
......
...@@ -17,6 +17,8 @@ ...@@ -17,6 +17,8 @@
#ifndef GCI_CONTAINER_HPP #ifndef GCI_CONTAINER_HPP
#define GCI_CONTAINER_HPP #define GCI_CONTAINER_HPP
#undef swap
#include <Vector.hpp> #include <Vector.hpp>
#include "LogRecord.hpp" #include "LogRecord.hpp"
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment