Changeset b5ecd9 for src/config.cpp
- Timestamp:
- Apr 29, 2008, 7:04:59 AM (18 years ago)
- Branches:
- Action_Thermostats, Add_AtomRandomPerturbation, Add_FitFragmentPartialChargesAction, Add_RotateAroundBondAction, Add_SelectAtomByNameAction, Added_ParseSaveFragmentResults, AddingActions_SaveParseParticleParameters, Adding_Graph_to_ChangeBondActions, Adding_MD_integration_tests, Adding_ParticleName_to_Atom, Adding_StructOpt_integration_tests, AtomFragments, Automaking_mpqc_open, AutomationFragmentation_failures, Candidate_v1.5.4, Candidate_v1.6.0, Candidate_v1.6.1, Candidate_v1.7.0, ChangeBugEmailaddress, ChangingTestPorts, ChemicalSpaceEvaluator, CombiningParticlePotentialParsing, Combining_Subpackages, Debian_Package_split, Debian_package_split_molecuildergui_only, Disabling_MemDebug, Docu_Python_wait, EmpiricalPotential_contain_HomologyGraph, EmpiricalPotential_contain_HomologyGraph_documentation, Enable_parallel_make_install, Enhance_userguide, Enhanced_StructuralOptimization, Enhanced_StructuralOptimization_continued, Example_ManyWaysToTranslateAtom, Exclude_Hydrogens_annealWithBondGraph, FitPartialCharges_GlobalError, Fix_BoundInBox_CenterInBox_MoleculeActions, Fix_ChargeSampling_PBC, Fix_ChronosMutex, Fix_FitPartialCharges, Fix_FitPotential_needs_atomicnumbers, Fix_ForceAnnealing, Fix_IndependentFragmentGrids, Fix_ParseParticles, Fix_ParseParticles_split_forward_backward_Actions, Fix_PopActions, Fix_QtFragmentList_sorted_selection, Fix_Restrictedkeyset_FragmentMolecule, Fix_StatusMsg, Fix_StepWorldTime_single_argument, Fix_Verbose_Codepatterns, Fix_fitting_potentials, Fixes, ForceAnnealing_goodresults, ForceAnnealing_oldresults, ForceAnnealing_tocheck, ForceAnnealing_with_BondGraph, ForceAnnealing_with_BondGraph_continued, ForceAnnealing_with_BondGraph_continued_betteresults, ForceAnnealing_with_BondGraph_contraction-expansion, FragmentAction_writes_AtomFragments, FragmentMolecule_checks_bonddegrees, GeometryObjects, Gui_Fixes, Gui_displays_atomic_force_velocity, ImplicitCharges, IndependentFragmentGrids, IndependentFragmentGrids_IndividualZeroInstances, IndependentFragmentGrids_IntegrationTest, IndependentFragmentGrids_Sole_NN_Calculation, JobMarket_RobustOnKillsSegFaults, JobMarket_StableWorkerPool, JobMarket_unresolvable_hostname_fix, MoreRobust_FragmentAutomation, ODR_violation_mpqc_open, PartialCharges_OrthogonalSummation, PdbParser_setsAtomName, PythonUI_with_named_parameters, QtGui_reactivate_TimeChanged_changes, Recreated_GuiChecks, Rewrite_FitPartialCharges, RotateToPrincipalAxisSystem_UndoRedo, SaturateAtoms_findBestMatching, SaturateAtoms_singleDegree, StoppableMakroAction, Subpackage_CodePatterns, Subpackage_JobMarket, Subpackage_LinearAlgebra, Subpackage_levmar, Subpackage_mpqc_open, Subpackage_vmg, Switchable_LogView, ThirdParty_MPQC_rebuilt_buildsystem, TrajectoryDependenant_MaxOrder, TremoloParser_IncreasedPrecision, TremoloParser_MultipleTimesteps, TremoloParser_setsAtomName, Ubuntu_1604_changes, stable
- Children:
- 3c1dfb
- Parents:
- 2910e0
- File:
-
- 1 edited
-
src/config.cpp (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/config.cpp
r2910e0 rb5ecd9 17 17 pseudopotpath = (char *) MallocString(sizeof(char)*255,"config constructor: mainname"); 18 18 configpath = (char *) MallocString(sizeof(char)*255,"config constructor: mainname"); 19 configname = (char *) MallocString(sizeof(char)*255,"config constructor: mainname"); 19 20 strcpy(mainname,"pcp"); 20 21 strcpy(defaultpath,"not specified"); … … 88 89 Free((void **)&pseudopotpath, "config::~config: *pseudopotpath"); 89 90 Free((void **)&configpath, "config::~config: *configpath"); 91 Free((void **)&configname, "config::~config: *configname"); 90 92 }; 91 93 … … 406 408 * \param *filename config file string 407 409 */ 408 void config::RetrieveConfigPath (char *filename)410 void config::RetrieveConfigPathAndName(char *filename) 409 411 { 412 char *ptr = NULL; 410 413 int last = -1; 411 414 for(int i=0;i<255;i++) { … … 417 420 if (last == -1) { // no path in front, set to local directory. 418 421 strcpy(configpath, "./"); 422 ptr = filename; 419 423 } else { 420 424 strncpy(configpath, filename, last+1); 425 ptr = &filename[last+1]; 421 426 if (last < 254) 422 427 configpath[last+1]='\0'; 423 428 } 424 cout << "Found configpath: " << configpath << ", dir slash was found at " << last << "." << endl; 429 strcpy(configname, ptr); 430 cout << "Found configpath: " << configpath << ", dir slash was found at " << last << ", config name is " << configname << "." << endl; 425 431 }; 426 432 … … 438 444 return; 439 445 } 440 RetrieveConfigPath (filename);446 RetrieveConfigPathAndName(filename); 441 447 // ParseParameters 442 448 … … 669 675 return; 670 676 } 671 RetrieveConfigPath (filename);677 RetrieveConfigPathAndName(filename); 672 678 // ParseParameters 673 679
Note:
See TracChangeset
for help on using the changeset viewer.
