本文整理汇总了C++中printVersion函数的典型用法代码示例。如果您正苦于以下问题:C++ printVersion函数的具体用法?C++ printVersion怎么用?C++ printVersion使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了printVersion函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: usage
/*======================================================================*/
void usage(char *programName)
{
#if (BUILD+0) != 0
printVersion(BUILD);
#else
printVersion(0);
#endif
printf("\n\nUsage:\n\n");
printf(" %s [<switches>] <adventure>\n\n", programName);
printf("where the possible optional switches are:\n");
#ifdef HAVE_GLK
glk_set_style(style_Preformatted);
#endif
printf(" -v verbose mode\n");
printf(" -l log transcript to a file\n");
printf(" -c log player commands to a file\n");
printf(" -n no Status Line\n");
printf(" -d enter debug mode\n");
printf(" -t[<n>] trace game execution, higher <n> gives more trace\n");
printf(" -i ignore version and checksum errors\n");
printf(" -r make regression test easier (don't timestamp, page break, randomize...)\n");
#ifdef HAVE_GLK
glk_set_style(style_Normal);
#endif
}
开发者ID:cspiegel,项目名称:garglk,代码行数:26,代码来源:utils.c
示例2: main
int main(int argc, char* argv[]){
float vNumber=0.3;
CommandLineArgs myArgs{};
if(!processCommandLine(argc, argv, myArgs)){
std::cout<<"ERROR processing command line"<<"\n";
return 1;
}
if (myArgs.wantHelp){
printHelp();
return 0;
}
if (myArgs.wantVers){
printVersion(vNumber);
return 0;
}
//std::cout<<"Command line inputted \n iValue = "<<(myArgs.iValue=="")<<"\n";
// The readStream functions handle the input of strings. It calls the transformChar function to ensure that all alphabet characters are capitalised and any other characters are ignored.
std::string bigString{""};
if (myArgs.iValue == ""){
bigString= read(std::cin);
}
else{
std::ifstream in_file {myArgs.iValue};
if (in_file.good()){
bigString=read(in_file);
}
else {
std::cout<<"Input file not OK to read \n";
return 1;
}
}
//std::cout<<"Cipher choice = "<<myArgs.cipherChoice<<"\n";
std::string result;
auto myCipher = CipherFactory(myArgs.cipherChoice, myArgs.kValue);
if (myArgs.encOrDec) result = myCipher->encrypt(bigString);
else if (myArgs.encOrDec == false) result = myCipher->decrypt(bigString);
else std::cout<<"ERROR: Not sure whether to encrypt or decrypt \n";
// And now to out put the results
if (myArgs.oValue==""){
std::cout<<"Result is here: "<<result<<"\n";
outPut(std::cout, result);
}
else {
std::ofstream out_file{myArgs.oValue};
if (out_file.good()){
outPut (out_file, result);
}
else {
return 1;
}
}
}
开发者ID:jackendrick,项目名称:mpags-cipher,代码行数:60,代码来源:mpags-cipher.cpp
示例3: set
int Tool::execute( cfg::cmd::CommandLine &cmd ) {
if (cmd.isSet("set")) {
set();
}
if (cmd.isSet("debug")) {
debug();
}
if (cmd.isSet("help")) {
printf("%s allowed options\n%s\n", name().c_str(), cmd.desc().c_str());
} else if (cmd.isSet("version")) {
printVersion();
} else if (cmd.isSet("build")) {
printBuild();
} else if (cmd.isSet("pretend")) {
pretend();
} else if (cmd.isSet("defaults")) {
defaults();
} else {
setupSignals();
// Initialize log system
util::log::init();
int result = run( cmd );
// Finalize log system
util::log::fin();
return result;
}
return 0;
}
开发者ID:jgrande,项目名称:ginga,代码行数:33,代码来源:tool.cpp
示例4: printHelp
int PatcherApplication::run()
{
if (args.containsKey('h', "help")) {
printHelp();
return Ok;
}
if (args.containsKey('v', "version")) {
printVersion();
return Ok;
}
if ( !isArgumentsValid(args) ) {
printErrorMessage("", InvalidArguments);
return InvalidArguments;
}
// --- main workflow
std::string pathToQt = args.list().at(1);
Error error = patchQtInDir(pathToQt);
if (error != Ok) {
printErrorMessage(pathToQt, error);
return error;
}
return Ok;
}
开发者ID:dant3,项目名称:qt-patcher,代码行数:27,代码来源:patcherapplication.cpp
示例5: printHelpInfo
void printHelpInfo(){
printVersion();
Usage();
Attention();
}
开发者ID:zhaoweiwang,项目名称:Tool-Develop,代码行数:7,代码来源:readCmdline.cpp
示例6: separationInit
static int separationInit(int debugBOINC)
{
int rc;
MWInitType initType = MW_PLAIN;
#if DISABLE_DENORMALS
mwDisableDenormalsSSE();
#endif
mwFixFPUPrecision();
if (debugBOINC)
initType |= MW_DEBUG;
if (SEPARATION_OPENCL)
initType |= MW_OPENCL;
rc = mwBoincInit(initType);
if (rc)
return rc;
if (BOINC_APPLICATION && mwIsFirstRun())
{
/* Print the version, but only once for the workunit */
printVersion(TRUE, FALSE);
}
#if (SEPARATION_OPENCL) && defined(_WIN32)
/* We need to increase timer resolution to prevent big slowdown on windows when CPU is loaded. */
mwSetTimerMinResolution();
#endif /* defined(_WIN32) */
return 0;
}
开发者ID:Milkyway-at-home,项目名称:milkywayathome_client,代码行数:34,代码来源:separation_main.c
示例7: main
/**
* THE entry point for the application
*
* @param argc Number of arguments in array argv
* @param argv Arguments array
*/
int main(int argc, char** argv)
{
/* Create the Qt core application object */
QApplication qapp(argc, argv);
#if defined(__APPLE__) || defined(Q_OS_MAC)
/* Load plugins from within the bundle ONLY */
QDir dir(QApplication::applicationDirPath());
dir.cdUp();
dir.cd("plugins");
QApplication::setLibraryPaths(QStringList(dir.absolutePath()));
#endif
/* Let te world know... */
printVersion();
/* Parse command-line arguments */
if (parseArgs(argc, argv) == false)
return 0;
/* Load translation for current locale */
loadTranslation(QLocale::system().name(), qapp);
/* Create and initialize the Fixture Editor application object */
App app;
if (FXEDArgs::fixture.isEmpty() == false)
app.loadFixtureDefinition(FXEDArgs::fixture);
/* Show and execute the application */
app.show();
return qapp.exec();
}
开发者ID:PML369,项目名称:qlcplus,代码行数:38,代码来源:main.cpp
示例8: usage
static void
usage(const char *message=NULL)
{
if (message) fprintf(stderr,"%s: %s\n",argv0,message);
fprintf(stderr,"usage: %s --path <path> [EXTRA_OPTIONS]\n",argv0);
fprintf(stderr," -D|--database <name> : data base to use (default %s)\n",dbName);
fprintf(stderr," -p|--path <path> : full path to the table\n");
fprintf(stderr," -t|--time <time> : sets query time (default: now)\n");
fprintf(stderr," -x|--expire <time> : sets query expiration time (default: forever)\n");
fprintf(stderr," -F|--flavor : set database flavor (default ofl)\n");
fprintf(stderr," -f|--file <file> : set file name for I/O (default: stdin/stdout)\n");
fprintf(stderr," -g|-r|--get|--read : get (read) data from database (default)\n");
fprintf(stderr," -s|-w|--set|--write : set (write) data to database\n");
fprintf(stderr," -c|--comment <txt> : set db comment (default user id)\n");
fprintf(stderr," -T|--tree : print config tree\n");
fprintf(stderr," -H|--history : print time line for node\n");
fprintf(stderr," -C|--config : print available config versions\n");
fprintf(stderr," -d|--dataonly : don't write #node/table line, just the data\n");
fprintf(stderr," -v|--verbose : set verbose mode on\n");
fprintf(stderr," -q|--quiet : set quiet mode on\n");
//fprintf(stderr," -w|--noWrite : don't write #node/table line to the output\n");
fprintf(stderr," -h|--help : this short help\n");
fprintf(stderr," supported time formats (cf. man date):\n");
for(int i=0; dbTimeFormat[i]!=NULL ; i++ ) {
const int MLEN=128;
char tmpstr[MLEN];
time_t t = time(0);
strftime(tmpstr,MLEN,dbTimeFormat[i],gmtime(&t));
fprintf(stderr," %-20s e.g.: %s\n",dbTimeFormat[i],tmpstr);
}
fprintf(stderr,"%s\n",printVersion());
if(message) exit(-1);
return;
}
开发者ID:star-bnl,项目名称:star-emc,代码行数:34,代码来源:eemcDb.C
示例9: main
//------------------------------------------------------------------------------
int main(int argc, char **argv) {
prgm_opt::variables_map option_map;
prgm_opt::options_description options("Options");
try {
prgm_opt::arg="[Value]";
options.add_options()
(CMDOPTIONS::HELP_OPTION[0],CMDOPTIONS::HELP_OPTION[2])
(CMDOPTIONS::PERCOLATORFILE_OPTION[0],prgm_opt::value<string>()->required(),CMDOPTIONS::PERCOLATORFILE_OPTION[2])
(CMDOPTIONS::MZIDFILE_OPTION[0],prgm_opt::value<string>()->required(),CMDOPTIONS::MZIDFILE_OPTION[2])
(CMDOPTIONS::INPUTDIR_OPTION[0],prgm_opt::value<string>()->required(),CMDOPTIONS::INPUTDIR_OPTION[2])
(CMDOPTIONS::MZIDOUTPUT_OPTION[0],prgm_opt::value<string>()->required(),CMDOPTIONS::MZIDOUTPUT_OPTION[2])
(CMDOPTIONS::OUTPUTDIR_OPTION[0],prgm_opt::value<string>()->required(),CMDOPTIONS::OUTPUTDIR_OPTION[2])
(CMDOPTIONS::DECOY_OPTION[0],CMDOPTIONS::DECOY_OPTION[2])
(CMDOPTIONS::VALIDATION_OPTION[0],CMDOPTIONS::VALIDATION_OPTION[2])
(CMDOPTIONS::WARNING_OPTION[0],CMDOPTIONS::WARNING_OPTION[2]);
prgm_opt::store(prgm_opt::parse_command_line(argc,argv,options),option_map);
if (option_map.count(CMDOPTIONS::HELP_OPTION[1])) {
printVersion();
cout << options;
CleanUp(EXIT_SUCCESS);
}
if (option_map.count(CMDOPTIONS::DECOY_OPTION[1]))
percolator.setDecoy();
if (option_map.count(CMDOPTIONS::VALIDATION_OPTION[1])) {
percolator.unsetValidation();
mzid.unsetValidation();
}
if (option_map.count(CMDOPTIONS::WARNING_OPTION[1]))
percolator.unsetWarningFlag();
if (option_map.count(CMDOPTIONS::MZIDOUTPUT_OPTION[1]))
mzid.setOutputFileEnding(option_map[CMDOPTIONS::MZIDOUTPUT_OPTION[1]].as<string>());
if (option_map.count(CMDOPTIONS::INPUTDIR_OPTION[1]))
if (!percolator.setInputDirectory(option_map[CMDOPTIONS::INPUTDIR_OPTION[1]].as<string>()))
THROW_ERROR(PRINT_TEXT::MZIDINPUTDIR_NOT_FOUND);
if (option_map.count(CMDOPTIONS::OUTPUTDIR_OPTION[1]))
if (!mzid.setOutputDirectory(option_map[CMDOPTIONS::OUTPUTDIR_OPTION[1]].as<string>()))
THROW_ERROR(PRINT_TEXT::MZIDOUTPUTDIR_NOT_CREATED);
if (option_map.count(CMDOPTIONS::PERCOLATORFILE_OPTION[1]))
if (!percolator.setFilename(option_map[CMDOPTIONS::PERCOLATORFILE_OPTION[1]].as<string>()))
THROW_ERROR_VALUE(PRINT_TEXT::NO_PERCOLATOR_FILE,option_map[CMDOPTIONS::PERCOLATORFILE_OPTION[1]].as<string>());
if (option_map.count(CMDOPTIONS::MZIDFILE_OPTION[1])) {
percolator.multiplemzidfiles=false;
if (!percolator.addFilenames(option_map[CMDOPTIONS::MZIDFILE_OPTION[1]].as<string>(),false))
THROW_ERROR("");
}
if (percolator.noFilename())
THROW_ERROR(PRINT_TEXT::PERCOLATOR_FILE_NOT_ENTERED);
xercesc::XMLPlatformUtils::Initialize();
if (!percolator.getPoutValues())
THROW_ERROR(PRINT_TEXT::CANNOT_LOAD_PERCOLATOR_FILE);
if (!mzid.insertMZIDValues(percolator.pout_values,percolator.mzidfilenames,percolator.multiplemzidfiles))
THROW_ERROR(PRINT_TEXT::CANNOT_INSERT);
CleanUp(EXIT_SUCCESS);
}
catch(exception &e) {
cerr << e.what() << endl;
CleanUp(EXIT_FAILURE);
}
}
开发者ID:glormph,项目名称:pout2mzid,代码行数:61,代码来源:main.cpp
示例10: readFromArgs
static s32 readFromArgs(s32 argc, const char* argv[], ocrConfig_t * ocrConfig) {
// Override any env variable with command line option
s32 cur = 1;
s32 userArgs = argc;
char * ocrOptPrefix = "-ocr:";
s32 ocrOptPrefixLg = strlen(ocrOptPrefix);
while(cur < argc) {
const char * arg = argv[cur];
if (strncmp(ocrOptPrefix, arg, ocrOptPrefixLg) == 0) {
// This is an OCR option
const char * ocrArg = arg+ocrOptPrefixLg;
if (strcmp("cfg", ocrArg) == 0) {
checkNextArgExists(cur, argc, "cfg");
setIniFile(ocrConfig, argv[cur+1]);
argv[cur] = NULL;
argv[cur+1] = NULL;
cur++; // skip param
userArgs-=2;
} else if (strcmp("version", ocrArg) == 0) {
printVersion();
exit(0);
break;
} else if (strcmp("help", ocrArg) == 0) {
printHelp();
exit(0);
break;
}
}
cur++;
}
return userArgs;
}
开发者ID:ChengduoZhao,项目名称:ocr,代码行数:32,代码来源:ocr-lib.c
示例11: initProgram
void initProgram(int argc, char ** argv, char ** envp)
{
cfg.argc = argc;
cfg.argv = argv;
cfg.envp = envp;
cfg.help = 0;
cfg.debug = 0;
cfg.daemon = 0;
cfg.version = 0;
cfg.syslog = 0;
cfg.port = 0;
cfg.passkey = NULL;
initOptions();
printDebug();
printHelp();
printVersion();
signal(SIGINT, mySignal);
daemonize();
initLogging();
initServer();
}
开发者ID:kpoxapy,项目名称:manager-game-c,代码行数:27,代码来源:main.c
示例12: readArgument
void readArgument(QApplication &app)
{
auto args = QCoreApplication::arguments();
auto name = QFileInfo{args.at(0)}.fileName();
for (int i = 1; i < args.size(); ++i) {
auto arg = args.at(i);
if (arg.compare("-d") == 0 || arg.compare("--debug") == 0) {
qInstallMessageHandler(debugMessageHandler);
} else if (arg.compare("-v") == 0 || arg.compare("--version") == 0) {
printVersion();
exit(0);
} else if (arg.compare("-h") == 0 || arg.compare("--help") == 0) {
printHelp(name);
exit(0);
} else {
printUnknownArgs(arg);
printHelp(name);
exit(1);
}
}
}
开发者ID:Brli,项目名称:chewing-editor,代码行数:26,代码来源:main.cpp
示例13: printHelp
/* prints help option */
void printHelp()
{
printVersion();
printf("----------------------\n");
printf("Command: dog\n");
printf("Usage: dog [-n] [-m filename] [-M filename] [filename]\n");
printf("switch: --help for this option\n");
}
开发者ID:pratapl,项目名称:COSC50,代码行数:10,代码来源:dog.c
示例14: main
int main(int argc, char *argv[])
{
/* Declarations */
int c, option_index = 0;
struct option long_options[] =
{
{"instrument-number", required_argument, 0, 'i'},
{"sample-number", required_argument, 0, 's'},
{"frequency", required_argument, 0, 'f'},
{"help", no_argument, 0, 'h'},
{"version", no_argument, 0, 'v'},
{0, 0, 0, 0}
};
char *filename;
unsigned int playAllInstruments = TRUE;
unsigned int instrumentNumber = 0;
unsigned int playAllSamples = TRUE;
unsigned int sampleNumber = 0;
int frequency = 22050;
/* Parse command-line options */
while((c = getopt_long(argc, argv, "i:s:f:hv", long_options, &option_index)) != -1)
{
switch(c)
{
case 'i':
playAllInstruments = FALSE;
instrumentNumber = atoi(optarg);
break;
case 's':
playAllSamples = FALSE;
sampleNumber = atoi(optarg);
break;
case 'f':
frequency = atoi(optarg);
break;
case 'h':
printUsage(argv[0]);
return 0;
case '?':
printUsage(argv[0]);
return 1;
case 'v':
printVersion(argv[0]);
return 0;
}
}
/* Validate non options */
if(optind >= argc)
filename = NULL;
else
filename = argv[optind];
return SDL_8SVX_play8SVXSamples(filename, playAllInstruments, instrumentNumber, playAllSamples, sampleNumber, frequency);
}
开发者ID:svanderburg,项目名称:SDL_8SVX,代码行数:57,代码来源:main.c
示例15: usage
static void usage()
{
printVersion();
printf("Usage: xml2smf [args] [infile] [outfile]\n");
printf(" args:\n"
" -v print version\n"
" -d debug mode\n"
);
}
开发者ID:AndresDose,项目名称:MuseScore,代码行数:9,代码来源:xml2smf.cpp
示例16: parseCommandLine
bool parseCommandLine(const std::vector<Common::UString> &argv, int &returnValue,
Common::UString &cdpthFile, Common::UString &twoDAFile,
Common::UString &outFile) {
std::vector<Common::UString> args;
bool optionsEnd = false;
for (size_t i = 1; i < argv.size(); i++) {
// A "--" marks an end to all options
if (argv[i] == "--") {
optionsEnd = true;
continue;
}
// We're still handling options
if (!optionsEnd) {
// Help text
if ((argv[i] == "-h") || (argv[i] == "--help")) {
printUsage(stdout, argv[0]);
returnValue = 0;
return false;
}
if (argv[i] == "--version") {
printVersion();
returnValue = 0;
return false;
}
if (argv[i].beginsWith("-") || argv[i].beginsWith("--")) {
// An options, but we already checked for all known ones
printUsage(stderr, argv[0]);
returnValue = -1;
return false;
}
}
args.push_back(argv[i]);
}
if (args.size() != 3) {
printUsage(stderr, argv[0]);
returnValue = -1;
return false;
}
cdpthFile = args[0];
twoDAFile = args[1];
outFile = args[2];
return true;
}
开发者ID:cc9cii,项目名称:xoreos-tools,代码行数:57,代码来源:cdpth2tga.cpp
示例17: main
/**
* THE entry point for the application
*
* @param argc Number of arguments in array argv
* @param argv Arguments array
*/
int main(int argc, char** argv)
{
/* Create the Qt core application object */
QApplication qapp(argc, argv);
/* At least MIDI plugin requires this so best to declare it here for everyone */
qRegisterMetaType<QVariant>("QVariant");
#ifdef __APPLE__
/* Load plugins from within the bundle ONLY */
QDir dir(QApplication::applicationDirPath());
dir.cdUp();
dir.cd("plugins");
QApplication::setLibraryPaths(QStringList(dir.absolutePath()));
#endif
QLCi18n::init();
/* Let the world know... */
printVersion();
/* Parse command-line arguments */
if (parseArgs() == false)
return 0;
/* Load translation for main application */
QLCi18n::loadTranslation("qlcplus");
/* Handle debug messages */
qInstallMsgHandler(qlcMessageHandler);
/* Create and initialize the QLC application object */
App app;
#if defined(WIN32) || defined(__APPLE__)
if (QLCArgs::debugLevel < QtSystemMsg)
{
QLCArgs::dbgBox = new DebugBox(&app);
QLCArgs::dbgBox->show();
}
#endif
app.startup();
app.show();
if (QLCArgs::workspace.isEmpty() == false)
app.loadXML(QLCArgs::workspace);
if (QLCArgs::operate == true)
app.slotModeOperate();
if (QLCArgs::kioskMode == true)
app.enableKioskMode();
if (QLCArgs::fullScreen == true)
app.slotControlFullScreen(QLCArgs::fullScreenResize);
if (QLCArgs::kioskMode == true && QLCArgs::closeButtonRect.isValid() == true)
app.createKioskCloseButton(QLCArgs::closeButtonRect);
return qapp.exec();
}
开发者ID:OnceBe,项目名称:qlcplus,代码行数:63,代码来源:main.cpp
示例18: setOption
void setOption(int c, string& option_arg)
{
switch (c)
{
case 'V':
printVersion();
exit(0);
}
}
开发者ID:gsc0107,项目名称:KAT,代码行数:9,代码来源:kat_args.hpp
示例19: printVersion
void CommandLine::printHelp(std::ostream& out)
{
printVersion(out);
out << std::endl << "Usage: " << (isYggdrasil ? "./yggdrasil" : "./exabayes" ) << " -f alnFile [ -q modelFile ] [ -m model ] [ -s seed | -r id ] -n id [options..] "
<< std::endl;
out << "\n\n"
<< "================================================================\n"
<< "Mandatory Arguments: \n"
<< "================================================================\n\n"
<< " -f alnFile a alignment file (either binary and created by parser or plain-text phylip)\n\n"
<< " -s seed a master seed for the MCMC\n\n"
<< " -n ruid a run id\n\n"
<< " -r id restart from checkpoint. Just specify the id of the previous run (-n) here. \n"
<< " Make sure, that all files created by the previous run are in the working directory.\n"
<< " This option is not mandatory for the start-up, seed (via -s) will be ignored.\n\n"
<< " -q modelfile a RAxML-style model file (see manual) for multi-partition alignments. Not needed \n"
<< " with binary files.\n\n"
<< " -t treeFile a file containing starting trees (in Newick format) for chains. If the file provides less\n"
<< " starting trees than chains to be initialized, parsimony/random trees will be used for\n"
<< " remaining chains. If a tree contains branch lengths, these branch lengths will be used\n"
<< " as initial values.\n\n"
<< " -m model indicates the type of data for a single partition non-binary alignment file\n"
<< " (valid values: BIN, DNA or PROT)\n\n"
<< std::endl;
out << "\n"
<< "================================================================\n"
<< "Options:\n"
<< "================================================================\n\n"
<< " -v print version and quit\n\n"
<< " -h print this help\n\n"
<< " -z quiet mode. Substantially reduces the information printed by " << PROGRAM_NAME << ".\n"
<< " This option will save you some idle time, when you run " << PROGRAM_NAME << " with a\n"
<< " lot of processes.\n\n"
<< " -d execute a dry-run. Procesess the input, but does not execute any sampling.\n\n"
<< " -c confFile a file configuring your " << PROGRAM_NAME << " run. For a template see the 'examples' folder.\n\n"
<< " -w dir specify a working directory for output files\n\n";
out << " -R num the number of runs (i.e., independent chains) to be executed in parallel\n\n"
<< " -C num number of chains (i.e., coupled chains) to be executed in parallel\n\n"
<< " -x disables thread pinning (which schedules a thread to a cpu core\n"
<< " in a fixed way). You should try this function, if you notice load imbalances with the\n"
<< " threaded version of the code (i.e., using -T x).\n\n" ;
out << " -S try to save memory using the SEV-technique for gap columns on large gappy alignments\n"
<< " Please refer to http://www.biomedcentral.com/1471-2105/12/470\n"
<< " On very gappy alignments this option yields considerable runtime improvements. \n\n"
<< " -T x start x threads per MPI process. If you do not use MPI, simply start x threads. \n\n"
<< " -M mode specifies the memory versus runtime trade-off (see manual for detailed discussion).\n"
<< " <mode> is a value between 0 (fastest, highest memory consumption) and 3 (slowest,\n"
<< " least memory consumption)\n\n"
<< std::endl;
}
开发者ID:pombredanne,项目名称:exa-bayes,代码行数:56,代码来源:CommandLine.cpp
示例20: main
int main(int argc, const char* argv[])
{
int rc;
SeparationFlags sf;
SeparationPrefs preferences;
const char** argvCopy = NULL;
#ifdef NDEBUG
mwDisableErrorBoxes();
#endif /* NDEBUG */
argvCopy = mwFixArgv(argc, argv);
rc = parseParameters(argc, argvCopy ? argvCopy : argv, &sf);
if (rc)
{
if (BOINC_APPLICATION)
{
freeSeparationFlags(&sf);
mwBoincInit(MW_PLAIN);
parseParameters(argc, argvCopy, &sf);
printVersion(TRUE, FALSE);
}
mw_printf("Failed to parse parameters\n");
free(argvCopy);
mw_finish(EXIT_FAILURE);
}
rc = separationInit(sf.debugBOINC);
free(argvCopy);
if (rc)
return rc;
separationReadPreferences(&preferences);
setFlagsFromPreferences(&sf, &preferences, argv[0]);
if (sf.processPriority != MW_PRIORITY_INVALID)
{
mwSetProcessPriority(sf.processPriority);
}
rc = worker(&sf);
freeSeparationFlags(&sf);
if (!sf.ignoreCheckpoint && sf.cleanupCheckpoint && rc == 0)
{
mw_report("Removing checkpoint file '%s'\n", CHECKPOINT_FILE);
mw_remove(CHECKPOINT_FILE);
}
mw_finish(rc);
return rc;
}
开发者ID:Milkyway-at-home,项目名称:milkywayathome_client,代码行数:55,代码来源:separation_main.c
注:本文中的printVersion函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论