当前位置: 首页>>代码示例>>C++>>正文


C++ display_version函数代码示例

本文整理汇总了C++中display_version函数的典型用法代码示例。如果您正苦于以下问题:C++ display_version函数的具体用法?C++ display_version怎么用?C++ display_version使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了display_version函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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


注:本文中的display_version函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。