#ifndef _mpqc_h #define _mpqc_h #ifdef HAVE_CONFIG_H #include #endif #include #include #include #include namespace detail { /** Temporary structure for storing information from command-line * * This structure has been introduced to gather the various calls to GetLongOpts * at one (initial) place and to abstract it from the source of command-lines. * This temporary object can be set by other means, too. I.e. we become * independent of usage in command-line programs. */ struct OptionValues { const char *keyvalue; // option "k" const char *debug; // option "" int limit; // option "l" const char *check; // option "c" const char *simple_input; // option "i" std::string executablename; #ifdef HAVE_CHEMISTRY_CCA string cca_load; // option "cca-path" string cc_path; // option "cca-load" #endif }; int try_main(int argc, char *argv[]); void clean_up(void); } /* namespace detail */ namespace mpqc { /** This is just a helper structure to combine all variables that get * initialized in init() */ struct InitValues { InitValues(); const char *input; const char *object_input; const char *generic_input; const char *output; std::ostream *outstream; char *in_char_array; detail::OptionValues &values; sc::GetLongOpt options; sc::Ref< sc::MessageGrp> grp; }; /** Initializes all variables inside InitValues struct and prepares code * for calculation. * * \param _initvalues struct holding state of variables to initialize * \param argc argument count * \param argv argument variables array */ void init(InitValues &_initvalues, int argc, char *argv[]); /** Parses command-line options, sets files and initializes message group * * \param _initvalues struct holding state of variables to initialize * \param argc argument count * \param argv argument variables array */ void parseOptions(InitValues &_initvalues, int argc, char *argv[]); /** Performs the main work to calculate the ground state energies, gradients, etc. * * @param _initvalues struct with all state variables * @param argc argument count * @param argv argument array * @param data void ptr to extract structure */ void mainFunction( InitValues &_initvalues, int argc, char **argv, void *data ); /** Cleans up variables in initialized variables struct. * */ void cleanup(InitValues &_initvalues); } /* namespace mpqc */ #endif