summaryrefslogtreecommitdiff
path: root/ndb/src/mgmapi/LocalConfig.hpp
diff options
context:
space:
mode:
authorunknown <joreland@mysql.com>2004-12-17 10:36:14 +0100
committerunknown <joreland@mysql.com>2004-12-17 10:36:14 +0100
commit72c28731e9f7eade53ba7394305b05ac1b66bb20 (patch)
tree415dace493b0f4c1982e36cb17b6a6008150149b /ndb/src/mgmapi/LocalConfig.hpp
parentb181f610e1c5bd29a21a4b73bb2fa58b37a18d6b (diff)
parent4630d406d11a8e7c0e8dc4b8601fc8dd94e8a343 (diff)
downloadmariadb-git-72c28731e9f7eade53ba7394305b05ac1b66bb20.tar.gz
merge
BitKeeper/etc/logging_ok: auto-union configure.in: Auto merged ndb/include/Makefile.am: Auto merged ndb/include/kernel/LogLevel.hpp: Auto merged ndb/include/mgmapi/mgmapi.h: Auto merged ndb/include/ndbapi/NdbConnection.hpp: Auto merged ndb/include/ndbapi/NdbDictionary.hpp: Auto merged ndb/src/common/debugger/EventLogger.cpp: Auto merged ndb/src/common/logger/FileLogHandler.cpp: Auto merged ndb/src/common/logger/Logger.cpp: Auto merged ndb/src/common/mgmcommon/ConfigRetriever.cpp: Auto merged ndb/src/kernel/blocks/cmvmi/Cmvmi.cpp: Auto merged ndb/src/kernel/blocks/dbdict/Dbdict.cpp: Auto merged ndb/src/kernel/blocks/dbdih/Dbdih.hpp: Auto merged ndb/src/kernel/blocks/dbdih/DbdihMain.cpp: Auto merged ndb/src/kernel/main.cpp: Auto merged ndb/src/kernel/blocks/dbtc/DbtcMain.cpp: Auto merged ndb/src/kernel/blocks/ndbfs/Ndbfs.cpp: Auto merged ndb/src/kernel/vm/Configuration.cpp: Auto merged ndb/src/mgmapi/mgmapi.cpp: Auto merged ndb/src/mgmsrv/InitConfigFileParser.cpp: Auto merged ndb/src/mgmsrv/MgmtSrvr.cpp: Auto merged ndb/src/mgmsrv/MgmtSrvr.hpp: Auto merged ndb/src/mgmsrv/Services.cpp: Auto merged ndb/src/mgmsrv/Services.hpp: Auto merged ndb/src/mgmsrv/main.cpp: Auto merged ndb/src/ndbapi/NdbConnection.cpp: Auto merged ndb/src/ndbapi/TransporterFacade.cpp: Auto merged ndb/src/ndbapi/ndberror.c: Auto merged ndb/tools/Makefile.am: Auto merged
Diffstat (limited to 'ndb/src/mgmapi/LocalConfig.hpp')
-rw-r--r--ndb/src/mgmapi/LocalConfig.hpp68
1 files changed, 68 insertions, 0 deletions
diff --git a/ndb/src/mgmapi/LocalConfig.hpp b/ndb/src/mgmapi/LocalConfig.hpp
new file mode 100644
index 00000000000..c415ec1be91
--- /dev/null
+++ b/ndb/src/mgmapi/LocalConfig.hpp
@@ -0,0 +1,68 @@
+/* Copyright (C) 2003 MySQL AB
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+
+#ifndef LocalConfig_H
+#define LocalConfig_H
+
+#include <ndb_global.h>
+#include <NdbOut.hpp>
+
+//****************************************************************************
+// Description: The class LocalConfig corresponds to the information possible
+// to give in the local configuration file.
+//*****************************************************************************
+
+enum MgmtSrvrId_Type {
+ MgmId_TCP = 0,
+ MgmId_File = 1
+};
+
+struct MgmtSrvrId {
+ MgmtSrvrId_Type type;
+ BaseString name;
+ unsigned int port;
+};
+
+struct LocalConfig {
+
+ int _ownNodeId;
+ Vector<MgmtSrvrId> ids;
+
+ int error_line;
+ char error_msg[256];
+
+ LocalConfig();
+ ~LocalConfig();
+ bool init(const char *connectString = 0,
+ const char *fileName = 0);
+
+ void printError() const;
+ void printUsage() const;
+
+ void setError(int lineNumber, const char * _msg);
+ bool readConnectString(const char *, const char *info);
+ bool readFile(const char * file, bool &fopenError);
+ bool parseLine(char * line, int lineNumber);
+
+ bool parseNodeId(const char *buf);
+ bool parseHostName(const char *buf);
+ bool parseFileName(const char *buf);
+ bool parseString(const char *buf, BaseString &err);
+ char * makeConnectString(char *buf, int sz);
+};
+
+#endif // LocalConfig_H
+