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


C++ print_status函数代码示例

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


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

示例1: main

int main() {
	airhook_init(&socket,time(NULL));
	for (;;) {
		char line[1024],*command;
		fprintf(stderr,"] ");
		if (NULL == fgets(line,sizeof(line),stdin)) break;
		command = strtok(line," \n");
		if (NULL == command || !strcmp(command,"")) ;
		else if (!strcmp(command,"r")) read_packet();
		else if (!strcmp(command,"w")) write_packet();
		else if (!strcmp(command,"p")) dump_packet();
		else if (!strcmp(command,"m")) send_message();
		else if (!strcmp(command,"s")) print_status();
		else if (!strcmp(command,"d")) discard_message();
		else {
			fprintf(stderr,"invalid command: %s\n"
			"commands: r filename        -- read packet\n"
			"          w filename length -- write packet\n"
			"          p filename        -- print packet\n"
			"          m message         -- send message\n"
			"          s                 -- get status\n"
			"          s num             -- get message status\n"
			"          d num             -- discard message\n",
			command);
		}
	}

	return 0;
}
开发者ID:wtanaka,项目名称:airhook,代码行数:29,代码来源:airtest.c

示例2: svn_cl__print_status

/* Called by status-cmd.c */
svn_error_t *
svn_cl__print_status(const char *path,
                     const svn_client_status_t *status,
                     svn_boolean_t detailed,
                     svn_boolean_t show_last_committed,
                     svn_boolean_t skip_unrecognized,
                     svn_boolean_t repos_locks,
                     unsigned int *text_conflicts,
                     unsigned int *prop_conflicts,
                     unsigned int *tree_conflicts,
                     svn_client_ctx_t *ctx,
                     apr_pool_t *pool)
{
  if (! status
      || (skip_unrecognized
          && !(status->versioned
               || status->conflicted
               || status->node_status == svn_wc_status_external))
      || (status->node_status == svn_wc_status_none
          && status->repos_node_status == svn_wc_status_none))
    return SVN_NO_ERROR;

  return print_status(svn_dirent_local_style(path, pool),
                      detailed, show_last_committed, repos_locks, status,
                      text_conflicts, prop_conflicts, tree_conflicts,
                      ctx, pool);
}
开发者ID:Distrotech,项目名称:subversion,代码行数:28,代码来源:status.c

示例3: main

int main(int argc, char **argv)
{
	vme_bus_handle_t bus_handle;
	int rval;

	if (vme_init(&bus_handle)) {
		perror("vme_init");
		return -1;
	}

	/* If there are no arguments, print the current endian conversion
	   hardware setup, else set the requested values.
	 */
	if (1 == argc) {
		rval = print_status(bus_handle);
	} else {
		rval = set_status(bus_handle, argc, argv);
	}

	if (vme_term(bus_handle)) {
		perror("vme_term");
		rval = -1;
	}

	return rval;
}
开发者ID:jeisch,项目名称:vme,代码行数:26,代码来源:vme_endian.c

示例4: read_verbose_version_info_rsp

static void read_verbose_version_info_rsp(const void *data, uint8_t size)
{
	uint8_t status = get_u8(data);
	uint8_t chip_id = get_u8(data + 1);
	uint8_t target_id = get_u8(data + 2);
	uint16_t build_base = get_le16(data + 3);
	uint16_t build_num = get_le16(data + 5);
	const char *str;

	print_status(status);
	print_field("Chip ID: %u (0x%2.2x)", chip_id, chip_id);

	switch (target_id) {
	case 254:
		str = "Invalid";
		break;
	case 255:
		str = "Undefined";
		break;
	default:
		str = "Reserved";
		break;
	}

	print_field("Build target: %s (%u)", str, target_id);
	print_field("Build baseline: %u (0x%4.4x)", build_base, build_base);
	print_field("Build number: %u (0x%4.4x)", build_num, build_num);
}
开发者ID:ghent360,项目名称:bluez,代码行数:28,代码来源:broadcom.c

示例5: prv_instance_dump

static void prv_instance_dump(lwm2m_object_t * objectP,
                              uint16_t id)
{
    int numData;
    lwm2m_tlv_t * dataArray;
    int size;
    uint8_t * buffer;
    int i;
    uint16_t res;

    numData = 0;
    res = objectP->readFunc(id, &numData, &dataArray, objectP);
    if (res != COAP_205_CONTENT)
    {
        printf("Error ");
        print_status(stdout, res);
        printf("\r\n");
        return;
    }

    dump_tlv(stdout, numData, dataArray, 0);

    size = lwm2m_tlv_serialize(numData, dataArray, &buffer);
    printf("char objectTlv[%d] = {", size);
    for (i = 0 ; i < size ; i++)
    {
        printf("0x%02X, ", buffer[i]);
    }
    printf("\b\b};\r\n");
    lwm2m_tlv_free(numData, dataArray);
    lwm2m_free(buffer);
}
开发者ID:kftd67,项目名称:wakaama,代码行数:32,代码来源:lwm2mclient.c

示例6: main_shutdown_graceful

// this can be called by other functions, or by DC when the schedd is
// shutdown gracefully
void main_shutdown_graceful() {
	print_status();
	dagman.dag->DumpNodeStatus( true, false );
	dagman.dag->GetJobstateLog().WriteDagmanFinished( EXIT_RESTART );
	dagman.CleanUp();
	DC_Exit( EXIT_RESTART );
}
开发者ID:AlanDeSmet,项目名称:htcondor,代码行数:9,代码来源:dagman_main.cpp

示例7: print_status

void print_status(struct DB *db, struct Node *node)
{
	printf("In node %d exist %d keys and values\n", node->num_vertix, node->n);
	if (node->leaf)
		printf("This node is also a leaf\n");
	else
		printf("This node is not a leaf\n");
	int i;
	for (i = 0; i < node->n; i++) {
		printf("Size of key is %d and value is %s\n", node->keys[i].size, 
			(char *)node->keys[i].data);
		printf("Size of value is %d and value is %s\n", node->values[i].size, 
			(char *)node->values[i].data);
	}

	if (!node->leaf) {
		for (i = 0; i < node->n+1; i++) {
			printf("Child %d is %d\n", i, node->children[i]);
		}
	}
	printf("\n");
	fflush(stdout);

	if (!node->leaf) {
		for (i = 0; i < node->n+1; i++) {
			struct Node *new_node = db->open_node(db, node->children[i]);
			print_status(db, new_node);
			new_node->close_node(db, new_node);
			free(new_node);
		}
	}
	return;
}
开发者ID:madmarble,项目名称:azaza,代码行数:33,代码来源:print.c

示例8: main

int main(void) {
    // Declare variables
    double weight = 0.0,
           height = 0.0,
           bmi = 0.0;
    WeightStatus status = 0;
    
    // Ask for and save the value for weight.
    weight = get_weight();
    
    // Ask for and save the value for height.
    height = get_height();
    
    // Bail out if we have an invalid weight.
    if (validate_weight(weight) == 0) {
        printf("\n!!! Invalid weight. Exiting...\n");
        return 0;
    }
    
    // Bail out if we have an invalid height.
    if (validate_height(height) == 0) {
        printf("\n!!! Invalid height. Exiting...\n");
        return 0;
    }
    
    // Calculate and print the BMI.
    bmi = get_bmi(weight, height);
    print_bmi(bmi);
    
    // Decide and print the weight status.
    status = get_weight_status(bmi);
    print_status(status);
	
	return 0;
}
开发者ID:mattokaren,项目名称:zw-schoolwork,代码行数:35,代码来源:lab06.c

示例9: answer_status_by_id

void answer_status_by_id(struct gss_account account, int id, char *msg)
{
        /* cURL functionality used just to URIencode the msg */
        CURL *curl = curl_easy_init();
	if(curl) {
                char *encoded_msg = curl_easy_escape(curl, msg, strlen(msg));
		if(encoded_msg) {
		        /* margin to fit the ID is included */
                        int amount = 68+strlen(encoded_msg);
			char *send = malloc(amount);
			snprintf(send, amount, "in_reply_to_status_id=%d&source=GnuSocialShell&status=%s", id, encoded_msg);
			if (loglevel >= LOG_DEBUG) { // OK?
			        fprintf(stderr, "in_reply_to_status_id=%d&source=GnuSocialShell&status=%s\n", id, encoded_msg);
			}
			// send[sizeof(send)-1] = '\0'; // snprintf does that too
			char *xml_data = send_to_api(account, send, "statuses/update.xml");
			int xml_data_size = strlen(xml_data);
			if (FindXmlError(xml_data, strlen(xml_data)) < 0 && parseXml(xml_data, xml_data_size, "</status>", 9, NULL, 0) > 0) {
				struct status posted_status;
				posted_status = makeStatusFromRawSource(xml_data, xml_data_size);
				print_status(posted_status);
			}
			free(xml_data);
			free(send);
		        curl_free(encoded_msg);
		}
	}
}
开发者ID:dalmemail,项目名称:GnuSocialShell,代码行数:28,代码来源:answer_status_by_id.c

示例10: search_complete_cb

static void
search_complete_cb (OlLyricSourceSearchTask *task,
                    enum OlLyricSourceStatus status,
                    GList *results,
                    gpointer userdata)
{
  printf ("search complete: ");
  print_status (status);
  ol_test_expect (status == (gsize)userdata);
  if (status == OL_LYRIC_SOURCE_STATUS_SUCCESS)
  {
    if (results)
    {
      test_download (OL_LYRIC_SOURCE_CANDIDATE (results->data));
      test_download_cancel (OL_LYRIC_SOURCE_CANDIDATE (results->data));
    }
    for (; results; results = results->next)
    {
      OlLyricSourceCandidate *candidate;
      candidate = OL_LYRIC_SOURCE_CANDIDATE (results->data);
      printf ("(%s)%s - %s - %s\n",
              ol_lyric_source_candidate_get_sourceid (candidate),
              ol_lyric_source_candidate_get_title (candidate),
              ol_lyric_source_candidate_get_artist (candidate),
              ol_lyric_source_candidate_get_album (candidate));
    }
  }
  task_cnt--;
  check_quit ();
}
开发者ID:lenoch,项目名称:osdlyrics,代码行数:30,代码来源:ol_lyric_source_test.c

示例11: on_account_added

static void
on_account_added (MailmeTelepathy        *tp_provider,
                  MailmeTelepathyAccount *account,
                  gpointer                user_data)
{
  gchar *display_name = NULL;

  g_assert (GPOINTER_TO_INT(user_data) == 666);

  g_object_get (account, "display-name", &display_name, NULL);
  g_free(display_name);

  print_status (account);

  mailme_telepathy_account_get_inbox_async (
      account,
      on_received_inbox_open_info,
      NULL);

  g_signal_connect (account,
                    "notify::unread-count",
                    G_CALLBACK (on_account_changed),
                    NULL);

  g_signal_connect (account,
                    "notify::display-name",
                    G_CALLBACK (on_account_changed),
                    NULL);
}
开发者ID:Cordia,项目名称:dawati-shell,代码行数:29,代码来源:test-mailme.c

示例12: on_account_changed

static void
on_account_changed (GObject    *object,
                    GParamSpec *pspec,
                    gpointer    user_data)
{
   print_status (MAILME_TELEPATHY_ACCOUNT (object));
}
开发者ID:Cordia,项目名称:dawati-shell,代码行数:7,代码来源:test-mailme.c

示例13: cmd_status

int
cmd_status(mpd_unused  int argc, mpd_unused char **argv, struct mpd_connection *conn)
{
	if (options.verbosity >= V_DEFAULT)
		print_status(conn);
	return 0;
}
开发者ID:somecommand,项目名称:mpc,代码行数:7,代码来源:command.c

示例14: process_cmd_line

static int process_cmd_line(state *s, int argc, char **argv)
{
  int i;

  while ((i=getopt(argc,argv,"tb:hV")) != -1) {
    switch(i) {

    case 't':
      s->mode |= mode_transitional;
      break;

    case 'b':
      find_block_size(s,optarg);
      break;

    case 'h':      
      usage();
      exit(EXIT_SUCCESS);

    case 'V':
      print_status ("%s", VERSION);
      exit(EXIT_SUCCESS);
      
    default:
      try_msg();
      exit(EXIT_FAILURE);
    }
  }

  return (sanity_check(s));
}
开发者ID:jessek,项目名称:colorize,代码行数:31,代码来源:filecompare.c

示例15: accept_tcp

	void accept_tcp(packet_t *packet, int packetloss, tcp_stream_t *stream)
	{
		if (!stream->userdata())
		{
			stream->set_userdata((void *)1);
			if (!stream->have_partner())
			{
				++d_single_sided;
				//printf("%s is single-sided\n", to_str(*stream).c_str());
			}
			else
				++d_full_streams;
		}
		d_packetloss += packetloss;

		if (packet)
		{
			uint64_t now = packet->ts().tv_sec;
			if (d_prev_ts + d_every < now)
			{
				printf("%ld: ", now);
				print_status();
				d_prev_ts = now;
			}
			packet->release();
		}
	}
开发者ID:jap,项目名称:reass,代码行数:27,代码来源:reass_monitor_packetloss.cpp


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