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


C++ show_message函数代码示例

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


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


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