本文整理汇总了C++中display_version函数的典型用法代码示例。如果您正苦于以下问题:C++ display_version函数的具体用法?C++ display_version怎么用?C++ display_version使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了display_version函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: main
int main(int argc, char const *argv[])
{
struct version v = {.major = 3,
.minor = 5,
.flags = 0};
printf("empreinte mémoire de la structure version = %d\n",
(int)sizeof(struct version));
display_version(&v, &isUnstableBis);
printf("\n");
v.minor++;
display_version(&v, &isUnstableBis);
printf("\n");
v.major++;
v.minor = 0;
display_version(&v, &isUnstableBis);
printf("\n");
v.minor++;
display_version(&v, &isUnstableBis);
printf("\n");
return 0;
}
开发者ID:ilyasToumlilt,项目名称:M2_NMV,代码行数:27,代码来源:testVersion.c
示例2: check_options
static void check_options(int argc, char *argv[])
{
char opt;
int index;
static struct option options[]={
{"help", 0, NULL, 'h'},
{"version", 0, NULL, 'V'}
};
opterr = 0;
while((opt = getopt_long(argc, argv, "hV", options, &index)) != -1)
{
switch(opt)
{
case 'V':
display_version();
exit(1);
break;
case 'h':
display_usage();
exit(1);
break;
default:
die("Unknown option: %s\nUse --help to show valid options.\n",
argv[optind - 1]);
break;
}
}
}
开发者ID:kayahr,项目名称:wlsuite,代码行数:31,代码来源:decodepic.c
示例3: main
int main(int argc, char *argv[])
{
struct option longopts[] = {
{ "version", no_argument, NULL, 'v' },
{ "help", no_argument, NULL, 'h' },
{ 0, 0, 0, 0 }
};
int c = 0;
/* Parse command-line options */
while ((c = getopt_long(argc, argv, "vh", longopts, NULL)) > -1) {
switch (c) {
case 'h':
display_usage(stdout);
return EXIT_SUCCESS;
case 'v':
display_version();
return EXIT_SUCCESS;
default:
/* Unknown option */
display_usage(stderr);
return EXIT_FAILURE;
}
}
/* Start the wm */
if (leaf_init() != ERR_NONE)
return leaf_exit(EXIT_FAILURE);
if (leaf_run() != ERR_NONE)
return leaf_exit(EXIT_FAILURE);
return leaf_exit(EXIT_SUCCESS);
}
开发者ID:shaoner,项目名称:leaf,代码行数:32,代码来源:leaf.c
示例4: syntax
/*-------------------------------------------------------------------*/
int syntax (char *pgm)
{
char usage[8192];
char buflfs[64];
#ifdef CCKD_COMPRESS_ZLIB
char *bufz = " -z compress using zlib [default]\n";
#else
char *bufz = "";
#endif
#ifdef CCKD_COMPRESS_BZIP2
char *bufbz = " -bz2 compress using bzip2\n";
#else
char *bufbz = "";
#endif
strncpy( buflfs,
(sizeof(off_t) > 4) ?
" -lfs create single large output file\n" : "",
sizeof( buflfs));
MSGBUF( usage, MSG_C( HHC02499, "I", pgm, "DASD copy/convert" ) );
display_version (stderr, usage+10, FALSE);
if (strcasecmp(pgm, "ckd2cckd") == 0)
MSGBUF( usage ,MSG( HHC02435, "I", bufz, bufbz ) );
else if (strcasecmp(pgm, "cckd2ckd") == 0)
MSGBUF( usage ,MSG( HHC02436, "I", buflfs ) );
else if (strcasecmp(pgm, "fba2cfba") == 0)
MSGBUF( usage ,MSG( HHC02437, "I", bufz, bufbz ) );
else if (strcasecmp(pgm, "cfba2fba") == 0)
MSGBUF( usage ,MSG( HHC02438, "I", buflfs ) );
else
MSGBUF( usage ,MSG( HHC02439, "I", pgm, bufz, bufbz, buflfs ) );
printf ("%s", usage);
return -1;
} /* end function syntax */
开发者ID:pfg504,项目名称:hercules-plus,代码行数:36,代码来源:dasdcopy.c
示例5: main
int main(int argc, char **argv)
{
int rc = 0;
char *fn, *sfn;
INITIALIZE_UTILITY("dasdls");
/* Display program info message */
display_version (stderr, "Hercules DASD list program ", FALSE);
if (argc < 2) {
fprintf(stderr, "Usage: dasdls dasd_image [sf=shadow-file-name]...\n");
exit(2);
}
/*
* If your version of Hercules doesn't have support in its
* dasdutil.c for turning off verbose messages, then remove
* the following line but you'll have to live with chatty
* progress output on stdout.
*/
set_verbose_util(0);
while (*++argv)
{
fn = *argv;
if (*(argv+1) && strlen (*(argv+1)) > 3 && !memcmp(*(argv+1), "sf=", 3))
sfn = *++argv;
else sfn = NULL;
if (do_ls(fn, sfn))
rc = 1;
}
return rc;
}
开发者ID:rmblair,项目名称:h390-spinhawk,代码行数:35,代码来源:dasdls.c
示例6: main
int main(int argc, char **argv)
{
struct state state;
memset(&state, 0, sizeof(struct state));
if (rc_read_options(&state, argc, argv) < 0)
return EXIT_FAILURE;
switch (state.rc.action) {
case ACTION_NONE:
/* this should never happen... */
assert(0);
break;
case ACTION_USAGE:
display_usage();
break;
case ACTION_VERSION:
display_version();
break;
case ACTION_ANALYZE:
case ACTION_RANK:
case ACTION_PREDICT:
db_load(&state);
break;
}
return EXIT_SUCCESS;
}
开发者ID:andybug,项目名称:spreden,代码行数:29,代码来源:spreden.c
示例7: main
int main(int argc, char *argv[])
{
char *exec_name = argv[0];
int option, option_index;
static struct option long_options[] =
{
{"help",0,0,'h'},
{"version",0,0,'v'},
{0,0,0,0}
};
while ((option = getopt_long(argc, argv, "hv", long_options,
&option_index)) != -1)
{
switch(option)
{
case 'h':
display_usage(exec_name);
exit(EXIT_SUCCESS);
case 'v':
display_version();
exit(EXIT_SUCCESS);
default:
display_usage(exec_name);
exit(EXIT_FAILURE);
}
}
begin();
return EXIT_SUCCESS;
}
开发者ID:mrnoda,项目名称:first-demo,代码行数:32,代码来源:main.cpp
示例8: process_command_line_args
static void
process_command_line_args (int argc, char *const *argv)
{
int ch = -1;
while (-1 != (ch = getopt (argc, argv, "rf:vVh")))
{
switch (ch)
{
case 'r':
/* FIXME: implement read-only option */
break;
case 'f':
set_contacts_file ();
break;
case 'v':
display_version ();
exit (0);
break;
case 'V':
display_license ();
exit (0);
break;
case 'h':
case '?':
default:
display_usage (argv[0]);
exit (0);
}
}
}
开发者ID:coachshea,项目名称:rolo,代码行数:31,代码来源:main.c
示例9: process_options
void process_options (int argc, char *argv[])
{
int error = 0;
exe_name = argv[0];
for (;;) {
int option_index = 0;
static const char *short_options = "jq";
static const struct option long_options[] = {
{"help", no_argument, 0, 0},
{"version", no_argument, 0, 0},
{"jffs2", no_argument, 0, 'j'},
{"quiet", no_argument, 0, 'q'},
{"silent", no_argument, 0, 'q'},
{0, 0, 0, 0},
};
int c = getopt_long(argc, argv, short_options,
long_options, &option_index);
if (c == EOF) {
break;
}
switch (c) {
case 0:
switch (option_index) {
case 0:
display_help();
break;
case 1:
display_version();
break;
}
break;
case 'q':
quiet = 1;
break;
case 'j':
jffs2 = 1;
break;
case '?':
error = 1;
break;
}
}
if (optind == argc) {
fprintf(stderr, "%s: no MTD device specified\n", exe_name);
error = 1;
}
if (error) {
fprintf(stderr, "Try `%s --help' for more information.\n",
exe_name);
exit(1);
}
mtd_device = argv[optind];
}
开发者ID:jamesyan84,项目名称:mt36k_android_4.0.4,代码行数:59,代码来源:flash_eraseall.c
示例10: main
int main(int argc, char *argv[])
{
int log_errno=0;
time_t my_time;
FILE *log_handle;
int i;
for(i=1; i<argc; i++)
{
if(strcmp(argv[i],"/help")==0 || strcmp(argv[i],"-help")==0 || strcmp(argv[i],"--help")==0 ||
strcmp(argv[i],"/h")==0 || strcmp(argv[i],"-h")==0 ||
strcmp(argv[i],"/?")==0 || strcmp(argv[i],"-?")==0)
{
display_help();
return 0;
}
else if((strcmp(argv[i],"/version")==0) || (strcmp(argv[i],"-version")==0) || (strcmp(argv[i],"--version")==0) ||
(strcmp(argv[i],"/v")==0) || (strcmp(argv[i],"-v")==0))
{
display_version();
return 0;
}
}
#ifdef Q_WS_X11
if(getenv("DISPLAY")==NULL)
{
printf("DISPLAY variable not set. Switching to PhotoRec in text mode.\n");
if(execv("photorec", argv)<0)
{
printf("photorec failed: %s\n", strerror(errno));
}
}
#endif
QApplication a(argc, argv);
log_handle=log_open("qphotorec.log", TD_LOG_CREATE, &log_errno);
#ifdef HAVE_DUP2
if(log_handle)
{
dup2(fileno(log_handle),2);
}
#endif
my_time=time(NULL);
log_info("\n\n%s",ctime(&my_time));
log_info("PhotoRec %s, Data Recovery Utility, %s\nChristophe GRENIER <[email protected]>\nhttp://www.cgsecurity.org\n", VERSION, TESTDISKDATE);
log_info("OS: %s\n" , get_os());
log_info("Compiler: %s\n", get_compiler());
#ifdef RECORD_COMPILATION_DATE
log_info("Compilation date: %s\n", get_compilation_date());
#endif
log_info("ext2fs lib: %s, ntfs lib: %s, ewf lib: %s, libjpeg: %s\n",
td_ext2fs_version(), td_ntfs_version(), td_ewf_version(), td_jpeg_version());
QPhotorec *p = new QPhotorec();
p->showMaximized();
p->show();
int ret=a.exec();
delete p;
log_close();
return ret;
}
开发者ID:alsd,项目名称:testdisk,代码行数:59,代码来源:qmainrec.cpp
示例11: display_help
static void display_help( void )
{
display_version();
eprintf( "\n"
"Usage: boxdumper [option] input\n"
" options:\n"
" --help Display help\n"
" --version Display version information\n"
" --box Dump box structure\n"
" --chapter Extract chapter list\n"
" --timestamp Dump media timestamps\n" );
}
开发者ID:darcyg,项目名称:vapoursynth-plugins,代码行数:12,代码来源:boxdumper.c
示例12: configure
int configure(int argc, char **argv){
parse_cmdline(argc, argv);
if(conf.help){
display_help();
return 1;
}
if(conf.version)
display_version();
if(strcmp(conf.confile, "")!=0 && load_conf(conf.confile))
return 1;
if(conf.config)
show_config();
}
开发者ID:PengFeiLi,项目名称:down,代码行数:13,代码来源:parsecmd.c
示例13: process_options
void process_options(int argc, char *argv[])
{
int error = 0;
input_file = NULL;
output_file = NULL;
for (;;) {
int option_index = 0;
static const char *short_options = "i:o:";
static const struct option long_options[] = {
{"help", no_argument, 0, 0},
{"version", no_argument, 0, 0},
{"input", required_argument, 0, 'i'},
{"output", required_argument, 0, 'o'},
{0, 0, 0, 0},
};
int c = getopt_long(argc, argv, short_options,
long_options, &option_index);
if (c == EOF)
break;
switch (c) {
case 0:
switch (option_index) {
case 0:
display_help();
break;
case 1:
display_version();
break;
}
break;
case 'i':
input_file = optarg;
break;
case 'o':
output_file = optarg;
break;
case '?':
error = 1;
break;
}
}
if (input_file == NULL || output_file == NULL || error)
display_help();
}
开发者ID:jhofstee,项目名称:writeloader,代码行数:49,代码来源:writeloader.c
示例14: process_options
void process_options(int argc, char *argv[], struct rfd *rfd)
{
int error = 0;
rfd->block_size = 0;
rfd->verbose = 0;
for (;;) {
int option_index = 0;
static const char *short_options = "hvVb:";
static const struct option long_options[] = {
{ "help", no_argument, 0, 'h' },
{ "version", no_argument, 0, 'V', },
{ "blocksize", required_argument, 0, 'b' },
{ "verbose", no_argument, 0, 'v' },
{ NULL, 0, 0, 0 }
};
int c = getopt_long(argc, argv, short_options,
long_options, &option_index);
if (c == EOF)
break;
switch (c) {
case 'h':
display_help();
break;
case 'V':
display_version();
break;
case 'v':
rfd->verbose = 1;
break;
case 'b':
rfd->block_size = atoi(optarg);
break;
case '?':
error = 1;
break;
}
}
if ((argc - optind) != 2 || error)
display_help();
rfd->mtd_filename = argv[optind];
rfd->out_filename = argv[optind + 1];
}
开发者ID:119,项目名称:aircam-openwrt,代码行数:48,代码来源:rfddump.c
示例15: parse_cmdline
/**
* parses command line arguments and assigns values to run time
* variables. relies on GNU getopts included with this distribution.
*/
void
parse_cmdline(CONF C, int argc, char *argv[]) {
int c = 0;
BOOLEAN display = FALSE;
while ((c = getopt_long(argc, argv, "Vhvf:CDd:l:p:", long_options, (int *)0)) != EOF) {
switch (c) {
case 'V':
display_version(TRUE);
break;
case 'h':
display_help(EXIT_SUCCESS);
case 'v':
set_verbose(C, TRUE);
break;
case 'C':
display = TRUE;
break;
//case 'f':
//XXX: parsed separately
// set_cfgfile(C, optarg);
// break;
case 'D':
set_debug(C, TRUE);
break;
case 'd':
if (!optarg) {
puts("NO OPTARG");
}
if (optarg != NULL && !strncasecmp(optarg, "false", 5)) {
set_daemon(C, FALSE);
} else {
set_daemon(C, TRUE);
}
break;
case 'l':
set_logfile(C, optarg);
break;
case 'p':
set_pidfile(C, optarg);
break;
} /* end of switch */
} /* end of while */
if (display) {
show(C, TRUE);
}
return;
} /* end of parse_cmdline */
开发者ID:JoeDog,项目名称:fido,代码行数:51,代码来源:main.c
示例16: main
int main(int argc, char **argv)
{
SDL_Thread *server_thread;
printf("Welcome to the Zod Engine\n");
if(argc<=1) starting_conditions.setdefaults();
//read in the arguments
starting_conditions.getoptions(argc, argv);
//make sure there is nothing conflicting,
//like we are trying to make a dedicated server that is supposed to connect to another server
starting_conditions.checkoptions();
//init this for the bots
ZCore::CreateRandomBotBypassData(bot_bypass_data, bot_bypass_size);
//now see what we have
if(starting_conditions.read_display_version) display_version();
if(starting_conditions.read_display_help) display_help(argv[0]);
//now what do we really run?
else if(starting_conditions.read_run_tray)
{
run_tray_app();
}
else if(starting_conditions.read_is_dedicated)
{
//run only a server
//server_thread = SDL_CreateThread(run_server_thread, NULL);
run_server_thread(NULL);
}
else if(starting_conditions.read_connect_address)
{
//connect to a server
run_player_thread();
}
else
{
//run a server, then connect to it
server_thread = SDL_CreateThread(run_server_thread, NULL);
run_player_thread();
}
return 1;
}
开发者ID:Nitaym,项目名称:zodengine,代码行数:47,代码来源:main.cpp
示例17: parse_cmdline
/**
* parses command line arguments and assigns
* values to run time variables. relies on GNU
* getopts included with this distribution.
*/
void
parse_cmdline( int argc, char *argv[] )
{
int c = 0;
int nhosts;
while(( c = getopt_long( argc, argv, "VhvCDH:i", long_options, (int *)0)) != EOF ){
switch( c ){
case 'V':
display_version( TRUE );
break;
case 'h':
display_help();
exit( EXIT_SUCCESS );
case 'v':
my.verbose = TRUE;
break;
case 'C':
my.config = TRUE;
break;
case 'D':
my.debug = TRUE;
break;
case 'i':
my.images = TRUE;
break;
case 'H':
{
int ll;
if(!strchr(optarg,':')) joe_fatal("no ':' in http-header");
if((strlen(optarg) + strlen(my.extra) + 3) > 512)
joe_fatal("too many headers");
strcat(my.extra,optarg);
strcat(my.extra,"\015\012");
}
break;
} /** end of switch( c ) **/
} /** end of while c = getopt_long **/
nhosts = argc - optind;
if( my.config ){ show_config( TRUE ); }
if( !nhosts ) { display_help( TRUE ); }
else{ my.url = strdup( argv[argc-1] ); }
} /* end of parse_cmdline */
开发者ID:kassanmoor,项目名称:Scout-Resurrected,代码行数:48,代码来源:main.c
示例18: display_help
/**
* display_help
* displays the help section to STDOUT and exits
*/
void
display_help()
{
/**
* call display_version, but do not exit
*/
display_version(FALSE);
printf("Usage: %s [options]\n", program_name);
printf(" %s [options] URL\n", program_name);
printf(" %s -g URL\n", program_name);
printf("Options:\n" );
puts(" -V, --version VERSION, prints the version number.");
puts(" -h, --help HELP, prints this section.");
puts(" -C, --config CONFIGURATION, show the current config.");
puts(" -v, --verbose VERBOSE, prints notification to screen.");
puts(" -q, --quiet QUIET turns verbose off and suppresses output.");
puts(" -g, --get GET, pull down HTTP headers and display the");
puts(" transaction. Great for application debugging.");
puts(" -c, --concurrent=NUM CONCURRENT users, default is 10");
puts(" -i, --internet INTERNET user simulation, hits URLs randomly." );
puts(" -b, --benchmark BENCHMARK: no delays between requests." );
puts(" -t, --time=NUMm TIMED testing where \"m\" is modifier S, M, or H" );
puts(" ex: --time=1H, one hour test." );
puts(" -r, --reps=NUM REPS, number of times to run the test." );
puts(" -f, --file=FILE FILE, select a specific URLS FILE." );
printf(" -R, --rc=FILE RC, specify an %src file\n",program_name);
puts(" -l, --log[=FILE] LOG to FILE. If FILE is not specified, the");
printf(" default is used: PREFIX/var/%s.log\n", program_name);
puts(" -m, --mark=\"text\" MARK, mark the log file with a string." );
puts(" -d, --delay=NUM Time DELAY, random delay before each requst");
puts(" between 1 and NUM. (NOT COUNTED IN STATS)");
puts(" -H, --header=\"text\" Add a header to request (can be many)" );
puts(" -A, --user-agent=\"text\" Sets User-Agent in request" );
puts(" -T, --content-type=\"text\" Sets Content-Type in request" );
puts("");
puts(copyright);
/**
* our work is done, exit nicely
*/
exit( EXIT_SUCCESS );
}
开发者ID:whitepages,项目名称:siege,代码行数:45,代码来源:main.c
示例19: parse_args
/**
* \brief Parse command-line arguments
* \details Parses the CLI arguments passed to the program and sets the
* pertinent values.
*
* \param argv A pointer to the first argument
*/
static void parse_args(char **argv) {
argument_t argument = ARGUMENT_NONE;
while (*++argv) {
if (argument == ARGUMENT_NONE) {
/* Parse argument names */
if (!strcmp(*argv, "-c") || !strcmp(*argv, "--count")) {
// UUID count (-c, --count)
argument = ARGUMENT_COUNT;
} else if (!strcmp(*argv, "-b") || !strcmp(*argv, "--brackets")) {
// Enclose the UUID between curly brackets (-b, --brackets)
g_brackets = 1;
} else if (!strcmp(*argv, "-u") || !strcmp(*argv, "--uppercase")) {
// UUID should be uppercase (-u, --uppercase)
g_uppercase = 1;
} else if (!strcmp(*argv, "-h") || !strcmp(*argv, "--help")) {
// Show help and exit
display_help();
exit(0);
} else if (!strcmp(*argv, "-v") || !strcmp(*argv, "--version")) {
// Show versioning information
display_version();
exit(0);
} else {
fprintf(stderr, "%s: error: unrecognized command line argument: `%s'\n", PROGRAM_NAME, *argv);
exit(1);
}
} else if (argument == ARGUMENT_COUNT) {
unsigned long count = strtoul(*argv, NULL, 10);
// Check for any possible overflow
if (count > 0 && count <= UINT_MAX) {
g_uuid_count = (unsigned)count;
argument = ARGUMENT_NONE;
} else {
fprintf(stderr, "%s: error: invalid count supplied. It must be greater than 0 and less than %u\n", PROGRAM_NAME, UINT_MAX + 1);
exit(1);
}
}
}
}
开发者ID:anpep,项目名称:commonutils,代码行数:48,代码来源:uuidgen.c
示例20: display_help
/**
* display help section to STDOUT and exit
*/
void
display_help(int status)
{
display_version(FALSE);
printf("Usage: %s [options]\n", program_name);
printf("Options:\n" );
puts(" -V, --version VERSION, prints version number to screen.");
puts(" -h, --help HELP, prints this section.");
puts(" -v, --verbose VERBOSE, prints notification to screen.");
printf(
" -f, --file=/path/file FILE, an alternative config file (default: /etc/%s/%s.conf)\n",
program_name, program_name
);
puts(" -C, --config CONFIG, displays the default settings and exits");
puts(" -d, --daemon=[true|false] DAEMON, run in the background as a daemon (-d <no arg> means true)");
puts(" -l, --log=arg LOG, set the default log which can be overridden at the file level.");
puts(" You can include a path to a file or 'syslog' to use system logging");
puts(" -p, --pid=/path/file PID, set an alternative path to a process ID file.");
printf(" The default pid is: /var/run/%s.pid\n", program_name);
exit(status);
}
开发者ID:JoeDog,项目名称:fido,代码行数:24,代码来源:main.c
注:本文中的display_version函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论