• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ show_message函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



在下文中一共展示了show_message函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: RWarning_not_prod

void RWarning_not_prod(const char *fmt,...){
#ifndef RELEASE
  char message[1000];
  va_list argp;
  
  va_start(argp,fmt);
  /*	vfprintf(stderr,fmt,argp); */
  vsprintf(message,fmt,argp);
  va_end(argp);

  show_message(IS_WARNING,message);
#endif
}
开发者ID:jakobvonrotz,项目名称:radium,代码行数:13,代码来源:error.c


示例2: in_received_handler

static void in_received_handler(DictionaryIterator *iter, void *context) {
  phone_heartbeat = 5;
  APP_LOG(APP_LOG_LEVEL_DEBUG, "Received message, current screen: %d", current_screen);
  Tuple *server_error_tuple = dict_find(iter, SERVER_ERROR_KEY); 
  if (server_error_tuple){
	    if (current_screen != SCREEN_MESSAGE_KEY){
		server_error = atoi(server_error_tuple->value->cstring);
		APP_LOG(APP_LOG_LEVEL_DEBUG, "Server error received %d", server_error);
		show_message("No connection to Boat Remote Server");
	  } 
	  return;
  }
	
  else{
	  switch(current_menu){
		  case VIEW_MENU:
		  	  switch(current_screen){
				case SCREEN_MESSAGE_KEY:
		  			window_stack_pop(true);
		   		    change_screen(last_screen);
				case SCREEN_GPS_KEY:
		   			update_gps_fields(iter);
		   			break;
				case SCREEN_SAILING_KEY:
				   update_sailing_fields(iter);
				   break;
				case SCREEN_NAVIGATION_KEY:
				   update_navigation_fields(iter);
				   break;
				case SCREEN_WAYPOINT_KEY:
				   update_waypoint_fields(iter);
				   break;
				case SCREEN_LOG_KEY:
				   update_log_fields(iter);
				   break;
				case SCREEN_ANCHOR_WATCH_KEY:
				   update_anchor_watch_fields(iter);
	     		   Tuple *location_status_tuple = dict_find(iter, LOCATION_STATUS_KEY); 
		   		   if (location_status_tuple){
			           if (atoi(location_status_tuple->value->cstring) == 1){
				           show_popup("Attempting to set anchor location using phone GPS");
			           }
			           else{
			               show_popup("Unable to set anchor location using phone GPS, attempting to use boat location");
			           }
		           }
		           break;
			  }
	  }
  }
}
开发者ID:CodeWithASmile,项目名称:BoatRemotePlus,代码行数:51,代码来源:main.c


示例3: show_messages

static void
show_messages (void *ctx,
	       const notmuch_show_format_t *format,
	       notmuch_messages_t *messages,
	       int indent,
	       notmuch_show_params_t *params)
{
    notmuch_message_t *message;
    notmuch_bool_t match;
    int first_set = 1;
    int next_indent;

    fputs (format->message_set_start, stdout);

    for (;
	 notmuch_messages_valid (messages);
	 notmuch_messages_move_to_next (messages))
    {
	if (!first_set)
	    fputs (format->message_set_sep, stdout);
	first_set = 0;

	fputs (format->message_set_start, stdout);

	message = notmuch_messages_get (messages);

	match = notmuch_message_get_flag (message, NOTMUCH_MESSAGE_FLAG_MATCH);

	next_indent = indent;

	if (match || params->entire_thread) {
	    show_message (ctx, format, message, indent, params);
	    next_indent = indent + 1;

	    fputs (format->message_set_sep, stdout);
	}

	show_messages (ctx,
		       format,
		       notmuch_message_get_replies (message),
		       next_indent,
		       params);

	notmuch_message_destroy (message);

	fputs (format->message_set_end, stdout);
    }

    fputs (format->message_set_end, stdout);
}
开发者ID:dme,项目名称:notmuch,代码行数:50,代码来源:notmuch-show.c


示例4: hotkeys_init

/*
 * initialize hotkeys
 */
void
hotkeys_init()
{
	char	msg_str[128];

	begin_func("hotkeys_init");

	if (hotkey_parse(menukey_str, &menukey, &menukey_mask) != 0) {
		sprintf(msg_str, "Invalid menu hotkey '%s'.\nFalling back to "
				"default (" DEF_MENUKEY ")\n", menukey_str);
		show_message(msg_str, "Warning", "OK", NULL, NULL);
		strcpy(menukey_str, DEF_MENUKEY);
		hotkey_parse(menukey_str, &menukey, &menukey_mask);
	}
	if (hotkey_parse(prev_item_key_str, &prev_item_key, &prev_item_mask) != 0) {
		sprintf(msg_str, "Invalid previous item hotkey '%s'.\n"
				"Falling back to default (" DEF_PREV_ITEM_KEY
				")\n", prev_item_key_str);
		show_message(msg_str, "Warning", "OK", NULL, NULL);
		hotkey_parse(DEF_PREV_ITEM_KEY, &prev_item_key,
				&prev_item_mask);
	}
	if (hotkey_parse(exec_item_key_str, &exec_item_key, &exec_item_mask) != 0) {
		sprintf(msg_str, "Invalid exec hotkey '%s'.\n"
				"Falling back to default (" DEF_EXEC_ITEM_KEY
				")\n", exec_item_key_str);
		show_message(msg_str, "Warning", "OK", NULL, NULL);
		hotkey_parse(DEF_EXEC_ITEM_KEY, &exec_item_key,
				&exec_item_mask);
	}
	gdk_window_add_filter(gdk_get_default_root_window(), global_keys_filter, NULL);
	grab_key(menukey, menukey_mask);
	grab_key(prev_item_key, prev_item_mask);
	grab_key(exec_item_key, exec_item_mask);

	return_void();
}
开发者ID:bbidulock,项目名称:dockapps,代码行数:40,代码来源:hotkeys.c


示例5: main

int main(void)
{
	pthread_t id;
	setbuf(stdout, NULL);
	
	if( pthread_create (&id, NULL, (void *)get_input, NULL) )
	{
		perror("Create thread fail!\n");
		exit(EXIT_FAILURE);
	}

	show_message();

	pthread_join(id, NULL);
	return EXIT_SUCCESS;
}
开发者ID:sigmax6,项目名称:sigmav,代码行数:16,代码来源:elevator.c


示例6: time_handler

static gboolean time_handler(GtkWidget *widget)
{
  static int msg_life = 0;
  pthread_mutex_lock(&mutex);
  if (new_msg) {
    new_msg = FALSE;
    msg_life = MSG_LIFE / time_interval;
    pthread_mutex_unlock(&mutex);
    show_message(msg_from, msg_content);
  }
  else {
    pthread_mutex_unlock(&mutex);
    if (--msg_life == 0)
      win_show("", "");
  }
  return TRUE;
}
开发者ID:zzmfish,项目名称:osdchat,代码行数:17,代码来源:osd_window.c


示例7: warn

void UserInterface::exec_fityk_script(const string& filename)
{
    user_interrupt = false;

    boost::scoped_ptr<FileOpener> opener;
    if (endswith(filename, ".gz"))
        opener.reset(new GzipFileOpener);
    else
        opener.reset(new NormalFileOpener);
    if (!opener->open(filename.c_str())) {
        warn("Can't open file: " + filename);
        return;
    }

    int line_index = 0;
    char *line;
    string s;
    while ((line = opener->read_line()) != NULL) {
        ++line_index;
        if (line[0] == '\0')
            continue;
        if (ctx_->get_verbosity() >= 0)
            show_message (kQuoted, S(line_index) + "> " + line);
        s += line;
        if (*(s.end() - 1) == '\\') {
            s.resize(s.size()-1);
            continue;
        }
        if (s.find("_SCRIPT_DIR_/") != string::npos) {
            string dir = get_directory(filename);
            replace_all(s, "_EXECUTED_SCRIPT_DIR_/", dir); // old magic string
            replace_all(s, "_SCRIPT_DIR_/", dir); // new magic string
        }
        Status r = execute_line(s);
        if (r != kStatusOk &&
                ctx_->get_settings()->on_error[0] != 'n' /*nothing*/)
            break;
        if (user_interrupt) {
            mesg("Script stopped by signal INT.");
            break;
        }
        s.clear();
    }
    if (line == NULL && !s.empty())
        throw SyntaxError("unfinished line");
}
开发者ID:simedcn,项目名称:fityk,代码行数:46,代码来源:ui.cpp


示例8: convert_pet_db

// Converte o arquivo pet_db.txt para SQL.
void convert_pet_db(void)
{
	FILE *fread, *fwrite;
	char line[1024], path[256];
	int count = 0, i;

	sprintf(path, "%s", "db/pet_db.txt");

	if (!(fread = fopen(path, "r")))
		return;

	fwrite = fopen("sql/pet_db.sql", "w+");

	while (fgets(line, sizeof(line), fread) != NULL) {
		char *token, **script, buf[1024], write[1024], *pos = buf;

		if ((line[0] == '/' && line[1] == '/') || line[0] == '\n')
			continue;

		line[strlen(line)-1] = '\0';
		explode(&script, (char *)line, '{');
		token = strtok(line, ",");

		for (i = 0; i < 22; i++) {
			if (i) {
				pos += sprintf(pos, ",");
			}

			if (i < 20)
				pos += ((i == 1 || i == 2)) ? sprintf(pos, "'%s'", escape_str(token)) : sprintf(pos, "%s", token);
			else
				pos += (i == 21) ? sprintf(pos, "'{%s'", escape_str(script[2])) : sprintf(pos, "'{%s'", replace_str(escape_str(script[1]), "},", "}"));

			token = strtok(NULL, ",");
		}

		snprintf(write, sizeof(write), "REPLACE INTO pet_db VALUES(%s);\n", buf);
		fprintf(fwrite, write);
		count++;
	}

	show_message(LIGHT_GREEN, "File %s successfully converted! rows affected: %d\n", path, count);
	fclose(fread);
	fclose(fwrite);
	file_count++;
}
开发者ID:Sh1raz,项目名称:brA_Conversor,代码行数:47,代码来源:conversor.c


示例9: show_signals

static void show_signals(dbc_t *dbc)
{
  message_list_t *ml;
  signal_list_t *sl;

  show_message_header();
  show_signal_header();

  for(ml = dbc->message_list; ml != NULL; ml = ml->next) {
    for(sl = ml->message->signal_list; sl != NULL; sl = sl->next) {
      show_message(ml);
      putchar(';');
      show_signal(sl);
      putchar('\n');
    }
  }
}
开发者ID:AndreasMartin72,项目名称:cantools,代码行数:17,代码来源:dbcls.c


示例10: main

int main (int argc, char *argv[]) {

  if (argc < 3 || argc < 2 || argc < 1) {
    show_usage(argv[0], TRUE, -1);
  }

  if (file_exists(argv[1]) != 1) {
    show_message("File not found.", TRUE, -2);
  }

  const char* cfilename   = argv[1];
  const char* cfieldname  = argv[2];

  json_object* jobj       = json_object_from_file(cfilename);
  json_object* jlast;

  int i;
  jlast = jobj;
  for(i = 2; i < argc; i++) {
    //printf("arg %d = %s \n", i, argv[i]);

    //argument is referencing an array item by index
    if (json_object_is_array(jlast) && str_is_integer(argv[i])) {
      jlast = json_object_array_get_idx(jlast, atol(argv[i]));
      continue;
    }

    if (json_object_has_item(jlast, argv[i])) {
      jlast = get_object_item(jlast, argv[i]);
    } else {
      jlast = NULL;
    }
  }

  //item was not found
  if (jlast == NULL) {
    printf("%s", "");
    exit(1);
  }

  //print string value or JSON representation of the object
  printf("%s", json_object_get_string(jlast));

  exit(0);
}
开发者ID:patinthehat,项目名称:json-utils,代码行数:45,代码来源:jsonread.c


示例11: check_table

static gint check_table(gpointer data)
{
    gint i;

    for (i = 0; i < addrcnt; i++)
        update_column(i);

    if (connections_updated) {
        update_connections_table();
        connections_updated = FALSE;
    }

    if (message[0]) {
	show_message(message);
	message[0] = 0;
    }

    return TRUE;
}
开发者ID:mahiso,项目名称:JudoShiai,代码行数:19,代码来源:main.c


示例12: reset_all_cback

/* ARGSUSED */
static XtCallbackProc
reset_all_cback(Widget w, xgobidata *xg, XtPointer cb_data) {
/*
 * read the raw data back in here instead of having to go
 * to the file menu to accomplish it.
*/
  Boolean reset = False;

  if (xg->datafilename != "") {
    if (reread_dat(xg->datafilename, xg)) {
      plot_once(xg);
      reset = True;
    }
  }

  if (!reset)
    show_message(
     "Sorry, I can\'t reset because I can\'t reread the data file\n", xg);
}
开发者ID:rashadkm,项目名称:xgobi,代码行数:20,代码来源:move_points.c


示例13: main

int main(int argc, const char * argv[]) {
    // insert code here...
    int i, playRound, moveStep;
    char choice;
    int *dot;
    
    srand(time(NULL));											/* 随机数生成*/
    show_message();
    
    for(playRound = 1; ;)
    {
        dot = calloc(MAX_PLAYER, sizeof(int));
        for(i = 0; ; ++i)
        {
            moveStep = f__move();
            printf("Player want to move %d\n", moveStep);
            
            dot[i % MAX_PLAYER] += moveStep;
            printf("Player %d is now %d\n", i % MAX_PLAYER + 1, dot[i % MAX_PLAYER]);
            if(dot[i % MAX_PLAYER] >= 60)
            {
                printf("%s%d\n", "YOU WIN! Congratulations PLAYER ", i % MAX_PLAYER + 1);
                break;
            }
        }
        printf("%s%d%s", "Round ", playRound," is over, do you want to next round?(Y/N)");
        scanf("%c", &choice);
        switch(choice)
        {
            case 'Y':
                continue;
            case 'N':
                printf("Bye\n");
                exit(0);
            default:
                printf("Your choice is unbelievbable!!\n");
                exit(0);
        }
    }
    
    return 0;

}
开发者ID:suxinde2009,项目名称:iOS_Practise_Demos,代码行数:43,代码来源:main.c


示例14: open_raw

static gint32 open_raw(
    char*            filename,
    enum pix_fmt     fmt,
    struct raw_data* img_data,
    const gchar*     plugin_name
) {
    gint32 img;
    FILE *file;

    file = fopen(filename, "rb");
    if (!file)
    {
	show_message("can't open file for reading");
	return(ERROR);
    }
    img = load_raw(filename, file, fmt, img_data, plugin_name);
    fclose (file);

    return img;
}
开发者ID:kleopatra999,项目名称:GIMP-raw-file-load,代码行数:20,代码来源:file-raw-load.c


示例15: die

void die(const char *fmt, ...)
{
  va_list ap;
  char str[1024];

  va_start(ap, fmt);
  vsnprintf(str, sizeof str, fmt, ap);
  va_end(ap);

  show_message("fatal error: %s", str);

#ifdef ZTERP_GLK
#ifdef GARGLK
  fprintf(stderr, "%s\n", str);
#endif
  glk_exit();
#endif

  exit(EXIT_FAILURE);
}
开发者ID:c4rlo,项目名称:gargoyle-fedora,代码行数:20,代码来源:util.c


示例16: convert_skill_improvise_db

// Converte o arquivo skill_improvise_db.txt para SQL.
void convert_skill_improvise_db(void)
{
	FILE *fread, *fwrite;
	char line[1024], path[256];
	int count = 0, i;

	sprintf(path, "%s", "db/skill_improvise_db.txt");

	if (!(fread = fopen(path, "r")))
		return;

	fwrite = fopen("sql/skill_improvise_db.sql", "w+");

	while (fgets(line, sizeof(line), fread) != NULL) {
		char *token, buf[1024], write[1024], *pos = buf;

		if ((line[0] == '/' && line[1] == '/') || line[0] == '\n')
			continue;

		line[strlen(line)-1] = '\0';
		token = strtok(line, ",");

		for (i = 0; i < 2; i++) {
			if (i) {
				pos += sprintf(pos, ",");
			}

			pos += sprintf(pos, "%d", atoi(token));
			token = strtok(NULL, ",");
		}

		snprintf(write, sizeof(write), "REPLACE INTO skill_improvise_db VALUES(%s);\n", buf);
		fprintf(fwrite, write);
		count++;
	}

	show_message(LIGHT_GREEN, "File %s successfully converted! rows affected: %d\n", path, count);
	fclose(fread);
	fclose(fwrite);
	file_count++;
}
开发者ID:Sh1raz,项目名称:brA_Conversor,代码行数:42,代码来源:conversor.c


示例17: while

void UserInterface::exec_stream(FILE *fp)
{
    LineReader reader;
    char *line;
    string s;
    while ((line = reader.next(fp)) != NULL) {
        if (ctx_->get_verbosity() >= 0)
            show_message(kQuoted, string("> ") + line);
        s += line;
        if (*(s.end() - 1) == '\\') {
            s.resize(s.size()-1);
            continue;
        }
        Status r = execute_line(s);
        if (r != kStatusOk)
            break;
        s.clear();
    }
    if (line == NULL && !s.empty())
        throw SyntaxError("unfinished line");
}
开发者ID:simedcn,项目名称:fityk,代码行数:21,代码来源:ui.cpp


示例18: move_points_on

void move_points_on (xgobidata *xg)
{
/*
 *  If this mode is currently selected, turn it off.
*/
  if (xg->prev_plot_mode == MOVEPTS_MODE && xg->plot_mode != MOVEPTS_MODE)
  {
    xg->is_point_moving = False;
    XtRemoveEventHandler(xg->workspace,
      XtAllEvents, TRUE,
      (XtEventHandler) mp_button, (XtPointer) xg);
    map_move_points(xg, False);
    xg->nearest_point = -1;
    plot_once(xg);
  }
  /* Else -- if xyplotting -- turn it on */
  else if (xg->plot_mode == MOVEPTS_MODE &&
           xg->prev_plot_mode != MOVEPTS_MODE)
  {
    if (xg->is_xyplotting || xg->is_spinning ||
      (xg->is_touring && !xg->is_pp) ||
      (xg->is_corr_touring && !xg->is_corr_pursuit))
    {
      xg->is_point_moving = True;
      map_move_points(xg, True);
      XtAddEventHandler(xg->workspace,
        ButtonPressMask | ButtonReleaseMask, FALSE,
        (XtEventHandler) mp_button, (XtPointer) xg);
      (void) XtAppAddWorkProc(app_con, RunWorkProcs, (XtPointer) NULL);
      /* Should use a different cursor ... */

    } else {
      show_message("Moving points won\'t work in this mode; sorry\n", xg);

      /*
       * It may be necessary to disable point moving if xg->std_type != 0
      */
    }
  }
}
开发者ID:rashadkm,项目名称:xgobi,代码行数:40,代码来源:move_points.c


示例19: send_result

void send_result(int bluepts[4], int whitepts[4], char blue_vote, char white_vote, 
		 char blue_hansokumake, char white_hansokumake, gint legend, gint hikiwake)
{
    memset(&msgout, 0, sizeof(msgout));

    if (current_category < 10000 || current_match >= 1000) {
        return;
    }
    msgout.type = MSG_RESULT;
    msgout.u.result.tatami = tatami;
    msgout.u.result.category = current_category;
    msgout.u.result.match = current_match;
    msgout.u.result.minutes = get_match_time();
    msgout.u.result.legend = legend;

    msgout.u.result.blue_score = array2int(bluepts); 
    msgout.u.result.white_score = array2int(whitepts);
    msgout.u.result.blue_vote = hikiwake ? 1 : blue_vote; 
    msgout.u.result.white_vote = hikiwake ? 1 : white_vote;
    msgout.u.result.blue_hansokumake = blue_hansokumake;
    msgout.u.result.white_hansokumake = white_hansokumake;

    if (msgout.u.result.blue_score != msgout.u.result.white_score ||
        msgout.u.result.blue_vote != msgout.u.result.white_vote || hikiwake ||
        msgout.u.result.blue_hansokumake || msgout.u.result.white_hansokumake) {
#if 0
        if (demo)
            while(time(NULL) % 20 != 0)
                ;
#endif
        send_packet(&msgout);
        result_send_time = time(NULL);
    }

#if 0
    show_message("", "", "", "", "", "");
    current_category = 0;
    current_match = 0;
#endif
}
开发者ID:mahiso,项目名称:JudoShiai,代码行数:40,代码来源:comm.c


示例20: DEFINE_LOADER_PLUGIN_IDENTIFY

DEFINE_LOADER_PLUGIN_IDENTIFY(p __attribute__((unused)), st, vw __attribute__((unused)), c __attribute__((unused)), priv __attribute__((unused)))
{
  unsigned char buf[3];

  if (stream_read(st, buf, 3) != 3)
    return LOAD_NOT;

  if (memcmp(buf, "GIF", 3) != 0)
    return LOAD_NOT;

  if (stream_read(st, buf, 3) != 3)
    return LOAD_NOT;

  if (memcmp(buf, "87a", 3) == 0)
    return LOAD_OK;
  if (memcmp(buf, "89a", 3) == 0)
    return LOAD_OK;

  show_message("GIF detected, but version is neither 87a nor 89a.\n");

  return LOAD_OK;
}
开发者ID:sina-ht,项目名称:enfle,代码行数:22,代码来源:gif.c



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ show_mouse函数代码示例发布时间:2022-05-30
下一篇:
C++ show_invalid_param_message函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap