| 1 |  | /********************************************************************** | 
| 2 |  |  | 
| 3 |  | This basic Periodic Table class was originally taken from the data.cpp | 
| 4 | < | file in OpenBabel. The code has been modified to match the OOPSE coding style. | 
| 4 | > | file in OpenBabel. The code has been modified to match the OpenMD coding style. | 
| 5 |  |  | 
| 6 |  | We have retained the OpenBabel copyright and GPL license on this class: | 
| 7 |  |  | 
| 29 |  | * @version 1.0 | 
| 30 |  | */ | 
| 31 |  |  | 
| 32 | – | #include <iostream> | 
| 32 |  | #include "config.h" | 
| 33 | + |  | 
| 34 | + | #include <iostream> | 
| 35 |  | #include <cstdlib> | 
| 36 |  | #include <string> | 
| 37 |  | #include <fstream> | 
| 38 |  | #include <cstdlib> | 
| 39 |  | #include "utils/ElementsTable.hpp" | 
| 40 |  | #include "utils/simError.h" | 
| 41 | < | #include "io/basic_ifstrstream.hpp" | 
| 41 | > | #include "io/ifstrstream.hpp" | 
| 42 |  |  | 
| 43 | < | #if !HAVE_STRNCASECMP | 
| 44 | < | extern "C" int strncasecmp(const char *s1, const char *s2, size_t n); | 
| 43 | > | #ifdef _MSC_VER | 
| 44 | > | #define strncasecmp _strnicmp | 
| 45 | > | #define strcasecmp _stricmp | 
| 46 |  | #endif | 
| 47 |  |  | 
| 48 | + |  | 
| 49 |  | #ifdef WIN32 | 
| 50 |  | #define FILE_SEP_CHAR "\\" | 
| 51 |  | #else | 
| 56 |  | #define BUFF_SIZE 32768 | 
| 57 |  | #endif | 
| 58 |  |  | 
| 59 | < | namespace oopse { | 
| 59 | > | namespace OpenMD { | 
| 60 |  |  | 
| 61 |  | ElementsTable etab; | 
| 62 |  |  | 
| 63 |  | ElementsTable::ElementsTable() { | 
| 64 |  | init_ = false; | 
| 65 | < | STR_DEFINE(dir_, FRC_PATH ); | 
| 65 | > | dir_ = std::string("TO_STRING(FRC_PATH)"); | 
| 66 |  | envvar_ = "FORCE_PARAM_PATH"; | 
| 67 |  | filename_ = "element.txt"; | 
| 68 |  | } | 
| 112 |  | return elements_.size(); | 
| 113 |  | } | 
| 114 |  |  | 
| 115 | < | char *ElementsTable::GetSymbol(int atomicnum) { | 
| 115 | > | const char *ElementsTable::GetSymbol(int atomicnum) { | 
| 116 |  | if (!init_) | 
| 117 |  | Init(); | 
| 118 |  |  |