Changeset bd86e8
- Timestamp:
- Jul 9, 2009, 11:01:08 AM (16 years ago)
- Children:
- ab7b5e7
- Parents:
- c12297
- git-author:
- Frederik Heber <heber@…> (07/09/09 10:59:00)
- git-committer:
- Frederik Heber <heber@…> (07/09/09 11:01:08)
- Location:
- molecuilder/src
- Files:
-
- 5 edited
-
builder.cpp (modified) (7 diffs)
-
config.cpp (modified) (2 diffs)
-
molecules.hpp (modified) (1 diff)
-
periodentafel.cpp (modified) (3 diffs)
-
periodentafel.hpp (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
molecuilder/src/builder.cpp
rc12297 rbd86e8 1208 1208 * \return exit code (0 - successful, all else - something's wrong) 1209 1209 */ 1210 static int ParseCommandLineOptions(int argc, char **argv, MoleculeListClass *&molecules, periodentafel *&periode, config& configuration, char *&ConfigFileName , char *&PathToDatabases)1210 static int ParseCommandLineOptions(int argc, char **argv, MoleculeListClass *&molecules, periodentafel *&periode, config& configuration, char *&ConfigFileName) 1211 1211 { 1212 1212 Vector x,y,z,n; // coordinates for absolute point in cell volume … … 1223 1223 clock_t start,end; 1224 1224 int argptr; 1225 PathToDatabases = LocalPath;1225 strncpy(configuration.databasepath, LocalPath, MAXSTRINGSIZE-1); 1226 1226 1227 1227 // simply create a new molecule, wherein the config file is loaded and the manipulation takes place … … 1285 1285 } else { 1286 1286 cout << "Using " << argv[argptr] << " as elements database." << endl; 1287 PathToDatabases = argv[argptr];1287 strncpy (configuration.databasepath, argv[argptr], MAXSTRINGSIZE-1); 1288 1288 argptr+=1; 1289 1289 } … … 1302 1302 1303 1303 // 2. Parse the element database 1304 if (periode->LoadPeriodentafel( PathToDatabases)) {1304 if (periode->LoadPeriodentafel(configuration.databasepath)) { 1305 1305 cout << Verbose(0) << "Element list loaded successfully." << endl; 1306 1306 //periode->Output((ofstream *)&cout); … … 1771 1771 } 1772 1772 } else { // no arguments, hence scan the elements db 1773 if (periode->LoadPeriodentafel( PathToDatabases))1773 if (periode->LoadPeriodentafel(configuration.databasepath)) 1774 1774 cout << Verbose(0) << "Element list loaded successfully." << endl; 1775 1775 else … … 1794 1794 string line; 1795 1795 char *ConfigFileName = NULL; 1796 char *ElementsFileName = NULL;1797 1796 int j, count; 1798 1797 1799 1798 // =========================== PARSE COMMAND LINE OPTIONS ==================================== 1800 j = ParseCommandLineOptions(argc, argv, molecules, periode, configuration, ConfigFileName , ElementsFileName);1799 j = ParseCommandLineOptions(argc, argv, molecules, periode, configuration, ConfigFileName); 1801 1800 if (j == 1) return 0; // just for -v and -h options 1802 1801 if (j) return j; // something went wrong … … 1889 1888 1890 1889 // save element data base 1891 if (periode->StorePeriodentafel( ElementsFileName)) //ElementsFileName1890 if (periode->StorePeriodentafel(configuration.databasepath)) //ElementsFileName 1892 1891 cout << Verbose(0) << "Saving of elements.db successful." << endl; 1893 1892 else -
molecuilder/src/config.cpp
rc12297 rbd86e8 14 14 { 15 15 mainname = (char *) MallocString(sizeof(char)*MAXSTRINGSIZE,"config constructor: mainname"); 16 defaultpath = (char *) MallocString(sizeof(char)*MAXSTRINGSIZE,"config constructor: mainname"); 17 pseudopotpath = (char *) MallocString(sizeof(char)*MAXSTRINGSIZE,"config constructor: mainname"); 18 configpath = (char *) MallocString(sizeof(char)*MAXSTRINGSIZE,"config constructor: mainname"); 19 configname = (char *) MallocString(sizeof(char)*MAXSTRINGSIZE,"config constructor: mainname"); 16 defaultpath = (char *) MallocString(sizeof(char)*MAXSTRINGSIZE,"config constructor: defaultpath"); 17 pseudopotpath = (char *) MallocString(sizeof(char)*MAXSTRINGSIZE,"config constructor: pseudopotpath"); 18 databasepath = (char *) MallocString(sizeof(char)*MAXSTRINGSIZE,"config constructor: databasepath"); 19 configpath = (char *) MallocString(sizeof(char)*MAXSTRINGSIZE,"config constructor: configpath"); 20 configname = (char *) MallocString(sizeof(char)*MAXSTRINGSIZE,"config constructor: configname"); 20 21 strcpy(mainname,"pcp"); 21 22 strcpy(defaultpath,"not specified"); … … 93 94 Free((void **)&defaultpath, "config::~config: *defaultpath"); 94 95 Free((void **)&pseudopotpath, "config::~config: *pseudopotpath"); 96 Free((void **)&databasepath, "config::~config: *databasepath"); 95 97 Free((void **)&configpath, "config::~config: *configpath"); 96 98 Free((void **)&configname, "config::~config: *configname"); -
molecuilder/src/molecules.hpp
rc12297 rbd86e8 410 410 string basis; 411 411 412 private: 412 char *databasepath; 413 414 private: 413 415 char *mainname; 414 416 char *defaultpath; -
molecuilder/src/periodentafel.cpp
rc12297 rbd86e8 92 92 * \return pointer to element 93 93 */ 94 element * periodentafel::FindElement(c har *shorthand) const94 element * periodentafel::FindElement(const char *shorthand) const 95 95 { 96 96 element *walker = periodentafel::start; … … 162 162 * \param *path to to standard file names 163 163 */ 164 bool periodentafel::LoadPeriodentafel(c har *path)164 bool periodentafel::LoadPeriodentafel(const char *path) 165 165 { 166 166 ifstream infile; … … 301 301 /** Stores element list to file. 302 302 */ 303 bool periodentafel::StorePeriodentafel(c har *path) const303 bool periodentafel::StorePeriodentafel(const char *path) const 304 304 { 305 305 bool result = true; -
molecuilder/src/periodentafel.hpp
rc12297 rbd86e8 66 66 bool CleanupPeriodtable(); 67 67 element * FindElement(int Z); 68 element * FindElement(c har *shorthand) const;68 element * FindElement(const char *shorthand) const; 69 69 element * AskElement(); 70 70 bool Output(ofstream *output) const; 71 71 bool Checkout(ofstream *output, const int *checkliste) const; 72 bool LoadPeriodentafel(c har *path = NULL);73 bool StorePeriodentafel(c har *path = NULL) const;72 bool LoadPeriodentafel(const char *path); 73 bool StorePeriodentafel(const char *path) const; 74 74 75 75 private:
Note:
See TracChangeset
for help on using the changeset viewer.
