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

C++ do_error函数代码示例

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

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



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

示例1: init_progress_rpt

void
init_progress_rpt (void)
{

	/*
	 *  allocate the done vector
	 */

	if ((prog_rpt_done = (__uint64_t *)
		malloc(sizeof(__uint64_t)*glob_agcount)) == NULL ) {
		do_error(_("cannot malloc pointer to done vector\n"));
	}
	bzero(prog_rpt_done, sizeof(__uint64_t)*glob_agcount);

	/*
	 *  Setup comm block, start the thread
	 */

	pthread_mutex_init(&global_msgs.mutex, NULL);
	global_msgs.count = glob_agcount;
	global_msgs.interval = report_interval;
	global_msgs.done   = prog_rpt_done;
	global_msgs.total  = &prog_rpt_total;

	if (pthread_create (&report_thread, NULL,
		progress_rpt_thread, (void *)&global_msgs))
		do_error(_("unable to create progress report thread\n"));

	return;
}
开发者ID:ystk,项目名称:debian-xfsprogs,代码行数:30,代码来源:progress.c


示例2: save_city

void
save_city (char *cname)
{
    char *s, *s2, *s3, *s4;
    int l;

    if ((l = strlen (cname)) < 2)
	return;
    if ((s = (char *) malloc (lc_save_dir_len + l + 16)) == 0)
	malloc_failure ();
    if ((s2 = (char *) malloc (lc_save_dir_len + l + 32)) == 0)
	malloc_failure ();
    if ((s3 = (char *) malloc ((lc_save_dir_len + l) * 2 + 32)) == 0)
	malloc_failure ();
    if ((s4 = (char *) malloc ((lc_save_dir_len + l) * 2 + 32)) == 0)
	malloc_failure ();

    sprintf (s, "%s%c%s", lc_save_dir, PATH_SLASH, cname);
    sprintf (s2, "%s%c%s", lc_save_dir, PATH_SLASH, "tmp-save");
    sprintf (s3, "gzip -f %s", s2);
    sprintf (s4, "mv %s.gz %s", s2, s);

    save_city_raw (s2);
    if (system (s3) != 0)
	do_error ("gzip failed while in save_city");
    if (system (s4) != 0)
	do_error ("mv failed while in save_city");

    free (s);
    free (s2);
    free (s3);
    free (s4);
}
开发者ID:usrshare,项目名称:lincity,代码行数:33,代码来源:ldsvguts.c


示例3: do_page_out

/* 将被替换页面的内容写回辅存 */
void do_page_out(Ptr_PageTableItem ptr_pageTabIt)
{
	unsigned int writeNum;
	if (fseek(ptr_auxMem, ptr_pageTabIt->auxAddr, SEEK_SET) < 0)
	{
#ifdef DEBUG
		printf("DEBUG: auxAddr=%u\tftell=%u\n", ptr_pageTabIt, ftell(ptr_auxMem));
#endif
		do_error(ERROR_FILE_SEEK_FAILED);
		exit(1);
	}
	if ((writeNum = fwrite(actMem + ptr_pageTabIt->blockNum * PAGE_SIZE, 
		sizeof(BYTE), PAGE_SIZE, ptr_auxMem)) < PAGE_SIZE)
	{

#ifdef DEBUG
		printf("DEBUG: auxAddr=%u\tftell=%u\n", ptr_pageTabIt->auxAddr, ftell(ptr_auxMem));
		printf("DEBUG: writeNum=%u\n", writeNum);
		printf("DEGUB: feof=%d\tferror=%d\n", feof(ptr_auxMem), ferror(ptr_auxMem));
#endif
		do_error(ERROR_FILE_WRITE_FAILED);
		exit(1);
	}
	printf("写回成功:物理块%u-->>辅存地址%03X\n", ptr_pageTabIt->auxAddr, ptr_pageTabIt->blockNum);

}
开发者ID:ZZJC1306,项目名称:VMM,代码行数:27,代码来源:vmm.c


示例4: do_page_in

/* 将辅存内容写入实存 */
void do_page_in(Ptr_PageTableItem ptr_pageTabIt, unsigned int blockNum)
{
	unsigned int readNum;

	//打开辅存文件ptr_auxMem,从文件开头(SEEK_SET)处偏移ptr_pageTabIt->auxAddr(该页表在辅存中的位置)开始读取数据
	if (fseek(ptr_auxMem, ptr_pageTabIt->auxAddr, SEEK_SET) < 0)
	{
#ifdef DEBUG
		printf("DEBUG: auxAddr=%u\tftell=%u\n", ptr_pageTabIt->auxAddr, ftell(ptr_auxMem));
#endif
		do_error(ERROR_FILE_SEEK_FAILED);
		exit(1);
	}

	//从之前打开的ptr_auxMem文件流中读取数据,写入到实存中指定块的位置(actMem + blockNum * PAGE_SIZE)
	//读写字节的大小(sizeof(BYTE))           读写4个字节(PAGE_SIZE)

	//初始化时并没有设置辅存中的数据,所以辅存为空,读取会失败
	if ((readNum = fread(actMem + blockNum * PAGE_SIZE,
		sizeof(BYTE), PAGE_SIZE, ptr_auxMem)) < PAGE_SIZE)
	{
#ifdef DEBUG
		printf("DEBUG: auxAddr=%u\tftell=%u\n", ptr_pageTabIt->auxAddr, ftell(ptr_auxMem));
		printf("DEBUG: blockNum=%u\treadNum=%u\n", blockNum, readNum);
		printf("DEGUB: feof=%d\tferror=%d\n", feof(ptr_auxMem), ferror(ptr_auxMem));
#endif
		do_error(ERROR_FILE_READ_FAILED);
		exit(1);
	}
	printf("调页成功:辅存地址%u-->>物理块%u\n", ptr_pageTabIt->auxAddr, blockNum);

}
开发者ID:TheLastSummer,项目名称:4-os-vmm,代码行数:33,代码来源:vmm.c


示例5: do_list_all

void do_list_all(int cli_fd, struct be_msg *rmsg)
{
  struct be_group *group = NULL;
  struct be_vc *curr;
  struct be_msg smsg;

  for(group = &group_head; group != NULL; group = group->next) {

    for(curr = group->head; curr != NULL; curr = curr->next) {

      smsg.msgtype = OK; 
      smsg.nas_idx = curr->nas_idx;
      smsg.uid     = curr->uid;
      memcpy(&smsg.pvc, &curr->pvc, sizeof(struct sockaddr_atmpvc));
      memcpy(&smsg.name, group->name, MAX_GROUPNAME_LEN);
      // brcm begin
      smsg.mode = curr->mode;
      // brcm end
      if( send(cli_fd, &smsg, sizeof(smsg), 0) < 0 )
	do_error(LOG_ERR,"do_list_all() couldn't send VC info: %s",strerror(errno));
    }

  }

  if(smsg.msgtype == OK) 
    smsg.msgtype = LIST_END;
  else
    smsg.msgtype = GROUP_NOT_FOUND;

  if( send(cli_fd, &smsg, sizeof(smsg), 0) < 0 )
    do_error(LOG_ERR,"do_list_all() couldn't send LIST_END message: %s",strerror(errno));
}
开发者ID:TheTypoMaster,项目名称:AH4222,代码行数:32,代码来源:pvc2684d.c


示例6: write_primary_sb

void
write_primary_sb(xfs_sb_t *sbp, int size)
{
	xfs_dsb_t	*buf;

	if (no_modify)
		return;

	buf = memalign(libxfs_device_alignment(), size);
	if (buf == NULL) {
		do_error(_("failed to memalign superblock buffer\n"));
		return;
	}
	memset(buf, 0, size);

	if (lseek64(x.dfd, 0LL, SEEK_SET) != 0LL) {
		free(buf);
		do_error(_("couldn't seek to offset 0 in filesystem\n"));
	}

	
	libxfs_sb_to_disk(buf, sbp, XFS_SB_ALL_BITS);

	if (write(x.dfd, buf, size) != size) {
		free(buf);
		do_error(_("primary superblock write failed!\n"));
	}

	free(buf);
}
开发者ID:Claruarius,项目名称:stblinux-2.6.37,代码行数:30,代码来源:sb.c


示例7: do_page_out

/* 将被替换页面的内容写回辅存 */
void do_page_out(Ptr_PageTableItem ptr_pageTabIt)
{
	unsigned int writeNum;
	//同上,从辅存中相应页面的地址开始读写
	if (fseek(ptr_auxMem, ptr_pageTabIt->auxAddr, SEEK_SET) < 0)
	{
#ifdef DEBUG
		printf("DEBUG: auxAddr=%u\tftell=%u\n", ptr_pageTabIt, ftell(ptr_auxMem));
#endif
		do_error(ERROR_FILE_SEEK_FAILED);
		exit(1);
	}

	//fwrite()与fread()的区别是,fwrite()执行完之后必须关闭流fclose(),而fread()不关闭会将流移动到上次读写结束的地址
	if ((writeNum = fwrite(actMem + ptr_pageTabIt->blockNum * PAGE_SIZE,
		sizeof(BYTE), PAGE_SIZE, ptr_auxMem)) < PAGE_SIZE)
	{
#ifdef DEBUG
		printf("DEBUG: auxAddr=%u\tftell=%u\n", ptr_pageTabIt->auxAddr, ftell(ptr_auxMem));
		printf("DEBUG: writeNum=%u\n", writeNum);
		printf("DEGUB: feof=%d\tferror=%d\n", feof(ptr_auxMem), ferror(ptr_auxMem));
#endif
		do_error(ERROR_FILE_WRITE_FAILED);
		exit(1);
	}
	printf("写回成功:物理块%u-->>辅存地址%03X\n", ptr_pageTabIt->auxAddr, ptr_pageTabIt->blockNum);

	/********************************************************************************************************/
	//fclose(ptr_auxMem);   main函数里面关闭了
	/********************************************************************************************************/

}
开发者ID:TheLastSummer,项目名称:4-os-vmm,代码行数:33,代码来源:vmm.c


示例8: do_list_group

void do_list_group(int cli_fd, struct be_msg *rmsg)
{
  struct be_group *group;
  struct be_vc *curr;
  struct be_msg smsg;

  smsg.msgtype = GROUP_NOT_FOUND;

  for(group = &group_head; group != NULL; group = group->next)
    if(!strncmp(rmsg->name,group->name,MAX_GROUPNAME_LEN))
      break;

  if(group) {
    for(curr = group->head; curr != NULL; curr = curr->next) {

      smsg.msgtype =  OK;
      smsg.nas_idx = curr->nas_idx;
      smsg.uid     = curr->uid;
      memcpy(&smsg.pvc, &curr->pvc, sizeof(struct sockaddr_atmpvc));
      memcpy(&smsg.name, &group->name, MAX_GROUPNAME_LEN);
      if( send(cli_fd, &smsg, sizeof(smsg), 0) < 0 )
	do_error(LOG_ERR,"do_list_group() couldn't send OK message: %s",strerror(errno));
    }

    smsg.msgtype = LIST_END;
  }

  if( send(cli_fd, &smsg, sizeof(smsg), 0) < 0 )
    do_error(LOG_ERR,"do_list_group() couldn't send LIST_END message: %s",strerror(errno));
}
开发者ID:TheTypoMaster,项目名称:AH4222,代码行数:30,代码来源:pvc2684d.c


示例9: ocfs2_validate_gd_parent

static int ocfs2_validate_gd_parent(struct super_block *sb,
				    struct ocfs2_dinode *di,
				    struct buffer_head *bh,
				    int clean_error)
{
	unsigned int max_bits;
	struct ocfs2_group_desc *gd = (struct ocfs2_group_desc *)bh->b_data;

	if (di->i_blkno != gd->bg_parent_dinode) {
		do_error("Group descriptor #%llu has bad parent "
			 "pointer (%llu, expected %llu)",
			 (unsigned long long)bh->b_blocknr,
			 (unsigned long long)le64_to_cpu(gd->bg_parent_dinode),
			 (unsigned long long)le64_to_cpu(di->i_blkno));
		return -EINVAL;
	}

	max_bits = le16_to_cpu(di->id2.i_chain.cl_cpg) * le16_to_cpu(di->id2.i_chain.cl_bpc);
	if (le16_to_cpu(gd->bg_bits) > max_bits) {
		do_error("Group descriptor #%llu has bit count of %u",
			 (unsigned long long)bh->b_blocknr,
			 le16_to_cpu(gd->bg_bits));
		return -EINVAL;
	}

	if (le16_to_cpu(gd->bg_chain) >=
	    le16_to_cpu(di->id2.i_chain.cl_next_free_rec)) {
		do_error("Group descriptor #%llu has bad chain %u",
			 (unsigned long long)bh->b_blocknr,
			 le16_to_cpu(gd->bg_chain));
		return -EINVAL;
	}

	return 0;
}
开发者ID:joka90,项目名称:htc-kernel-msm7227,代码行数:35,代码来源:suballoc.c


示例10: new_connection

void new_connection(TCPsocket sock) {
   TCPsocket tmp;
   struct socket_node *socket;
   IPaddress *ip;
 
/* accept the connection temporarily */
   tmp = SDLNet_TCP_Accept(sock);
   if (!tmp)
      do_error(SDLNet_GetError());

/* are we full or game already started? */
   if (get_active_players() + 1 > NUM_PLAYERS || current_turn)
      SDLNet_TCP_Close(tmp);
   else {
   /* nope! */
      socket = new_socket(SOCKET_CLIENT);
      socket->sock = tmp;
      if (SDLNet_TCP_AddSocket(sockset, tmp) < 0)
         do_error(SDLNet_GetError());

      ip = SDLNet_TCP_GetPeerAddress(tmp);
      if (!ip)
         do_error(SDLNet_GetError());
      if (SDLNet_ResolveIP(ip))
         strcpy(socket->host, SDLNet_ResolveIP(ip));
      else
         sprintf(socket->host, "Unknown IP");

      join_player(socket);	/*	add player to game	*/
   }
}
开发者ID:johan--,项目名称:netnuclear,代码行数:31,代码来源:net.c


示例11: do_print_virtual

void do_print_virtual(){
	int i,j,k,readNum,p;
	printf("打印辅存内容:\n");
	BYTE temp[VIRTUAL_MEMORY_SIZE];
	if (fseek(ptr_auxMem, 0, SEEK_SET) < 0)
	{
		do_error(ERROR_FILE_SEEK_FAILED);
		exit(1);
	}
	if ((readNum = fread(temp, 
		sizeof(BYTE), VIRTUAL_MEMORY_SIZE, ptr_auxMem)) < VIRTUAL_MEMORY_SIZE)
	{
		do_error(ERROR_FILE_READ_FAILED);
		exit(1);
	}
	printf("1级页号\t2级页号\t辅存\t内容\t\n");
	for(i=0,k=0;i<ROOT_PAGE_SUM;i++)
	{
		for(p=0;p<CHILD_PAGE_SUM;p++)
		{
			printf("%d\t%d\t%d\t",i,p,k);
			for(j=0;j<PAGE_SIZE;j++){
				printf("%02x ",temp[k++]);
			}
			printf("\n");
		}
	}
}
开发者ID:ZZJC1306,项目名称:VMM,代码行数:28,代码来源:vmm.c


示例12: incore_ino_init

void
incore_ino_init(xfs_mount_t *mp)
{
	int i;
	int agcount = mp->m_sb.sb_agcount;

	if ((inode_tree_ptrs = malloc(agcount *
					sizeof(avltree_desc_t *))) == NULL)
		do_error(_("couldn't malloc inode tree descriptor table\n"));
	if ((inode_uncertain_tree_ptrs = malloc(agcount *
					sizeof(avltree_desc_t *))) == NULL)
		do_error(
		_("couldn't malloc uncertain ino tree descriptor table\n"));

	for (i = 0; i < agcount; i++)  {
		if ((inode_tree_ptrs[i] =
				malloc(sizeof(avltree_desc_t))) == NULL)
			do_error(_("couldn't malloc inode tree descriptor\n"));
		if ((inode_uncertain_tree_ptrs[i] =
				malloc(sizeof(avltree_desc_t))) == NULL)
			do_error(
			_("couldn't malloc uncertain ino tree descriptor\n"));
	}
	for (i = 0; i < agcount; i++)  {
		avl_init_tree(inode_tree_ptrs[i], &avl_ino_tree_ops);
		avl_init_tree(inode_uncertain_tree_ptrs[i], &avl_ino_tree_ops);
	}

	if ((last_rec = malloc(sizeof(ino_tree_node_t *) * agcount)) == NULL)
		do_error(_("couldn't malloc uncertain inode cache area\n"));

	memset(last_rec, 0, sizeof(ino_tree_node_t *) * agcount);

	full_ino_ex_data = 0;
}
开发者ID:chandanr,项目名称:xfsprogs-dev,代码行数:35,代码来源:incore_ino.c


示例13: do_page_in

/* 将辅存内容写入实存 */
void do_page_in(Ptr_PageTableItem ptr_pageTabIt, unsigned int blockNum)
{
	unsigned int readNum;
	if (fseek(ptr_auxMem, ptr_pageTabIt->auxAddr, SEEK_SET) < 0)
	{
#ifdef DEBUG
		printf("DEBUG: auxAddr=%u\tftell=%u\n", ptr_pageTabIt->auxAddr, ftell(ptr_auxMem));
#endif
		do_error(ERROR_FILE_SEEK_FAILED);
		exit(1);
	}
	if ((readNum = fread(actMem + blockNum * PAGE_SIZE, 
		sizeof(BYTE), PAGE_SIZE, ptr_auxMem)) < PAGE_SIZE)
	{

#ifdef DEBUG
		printf("DEBUG: auxAddr=%u\tftell=%u\n", ptr_pageTabIt->auxAddr, ftell(ptr_auxMem));
		printf("DEBUG: blockNum=%u\treadNum=%u\n", blockNum, readNum);
		printf("DEGUB: feof=%d\tferror=%d\n", feof(ptr_auxMem), ferror(ptr_auxMem));
#endif
		do_error(ERROR_FILE_READ_FAILED);
		exit(1);
	}
	printf("调页成功:辅存地址%u-->>物理块%u\n", ptr_pageTabIt->auxAddr, blockNum);
}
开发者ID:ZZJC1306,项目名称:VMM,代码行数:26,代码来源:vmm.c


示例14: print_final_rpt

__uint64_t
print_final_rpt(void)
{
	int i;
	struct tm *tmp;
	time_t now;
	__uint64_t *donep;
	__uint64_t sum;
	msg_block_t 	*msgp = &global_msgs;
	char		msgbuf[DURATION_BUF_SIZE];

	if (!ag_stride)
		return 0;

	if (pthread_mutex_lock(&global_msgs.mutex))
		do_error(_("print_final_rpt: cannot lock progress mutex\n"));

	bzero(&msgbuf, sizeof(msgbuf));

	now = time (NULL);
	tmp = localtime ((const time_t *) &now);

	/*
	*  Sum the work
	*/

	sum = 0;
	donep = msgp->done;
	for (i = 0; i < msgp->count; i++) {
		sum += *donep++;
	}

	if (report_interval) {
		switch(msgp->format->format) {
		case FMT1:
			sprintf (msgbuf, _(*msgp->format->fmt),
				tmp->tm_hour, tmp->tm_min, tmp->tm_sec,
				_(msgp->format->msg), sum,
				*msgp->total, _(*msgp->format->type));
			break;
		case FMT2:
			sprintf (msgbuf, _(*msgp->format->fmt),
				tmp->tm_hour, tmp->tm_min, tmp->tm_sec,
				_(msgp->format->msg), sum,
				_(*msgp->format->type));
			break;
		}
		do_log(_("%s"), msgbuf);
	}

	if (pthread_mutex_unlock(&global_msgs.mutex))
		do_error(_("print_final_rpt: cannot unlock progress mutex\n"));

	return(sum);
}
开发者ID:ystk,项目名称:debian-xfsprogs,代码行数:55,代码来源:progress.c


示例15: init_net

void init_net() {
   if (SDLNet_Init() < 0)
      do_error("Failed initializing SDL_net (\"%s\")", SDLNet_GetError());

   sockset = SDLNet_AllocSocketSet(NUM_PLAYERS);
   if (!sockset)
      do_error(SDLNet_GetError());

   online = 0;
   server = 0;
}
开发者ID:johan--,项目名称:netnuclear,代码行数:11,代码来源:net.c


示例16: cgiMain

int
cgiMain()
{
	int act;
	int ret;

	act = check_from();
	switch (act)
	{
	case -1:
		do_error("用户名或密码错误");
		break;
	case 0:
		if (auth_check() < 0)
		{
			do_error("用户名或密码错误");
			return 0;
		}
		show_basic_page();
		break;
	case 1:
		handle_basic();
		break;
	case 2:
		handle_security();
		break;
	case 3:
		ret = what_action();
		if (ret == 0)
			reboot(LINUX_REBOOT_CMD_RESTART);
		else if (ret == 1)
			show_cdev_page();
		break;
	case 4:
		handle_cdev();
		break;
	case 5:
		handle_breq();
		break;
	case 6:
		handle_scene();
		break;
	case 7:
		handle_slnk();
		break;
	case 128:
		reboot(LINUX_REBOOT_CMD_RESTART);
		break;
	default:
		break;
	}

	return 0;
}
开发者ID:jhlxz2003,项目名称:akb,代码行数:54,代码来源:set.c


示例17: do_input_request

int do_input_request(){
	int Virtual_Address;
	int Progress;
	char Type;
	unsigned char content;
	printf("请输入合法要求 格式为 “地址 进程号 访问类型 写入数据(仅对写操作有效)\n格式的合法范围为0-255\n进程号的合法范围为0-1\n访问类型为:r(读)、w(写)、x(执行)\n写入数据仅在写时有效\n");
	scanf("%d %d", &Virtual_Address, &Progress);
	getchar();
	scanf("%c %c", &Type, &content);
	//printf("%d %d %c %02X", Virtual_Address, Progress, Type, content);
	if(Virtual_Address < 0 || Virtual_Address > VIRTUAL_MEMORY_SIZE){
		do_error(ERROR_ILLEGAL_INPUT);
		return 0;
	}
	if(Progress < 0 || Progress > VIRTUAL_PROGRESSES){
		do_error(ERROR_ILLEGAL_INPUT);
		return 0;
	}
	if(Type != 'w' && Type != 'r' && Type != 'x'){
		do_error(ERROR_ILLEGAL_INPUT);
		return 0;
	}
	switch(Type){
		case 'w':
			ptr_memAccReq->FromProgress = Progress;
			ptr_memAccReq->virAddr = Virtual_Address;
			ptr_memAccReq->reqType = REQUEST_WRITE;
			ptr_memAccReq->value = content;
			printf("读入请求:\n地址:%u\t类型:写入\t值:%02X\t 所属进程: %u\n", ptr_memAccReq->virAddr, ptr_memAccReq->value, ptr_memAccReq->FromProgress);
			
			break;
		case 'r':
			ptr_memAccReq->FromProgress = Progress;
			ptr_memAccReq->virAddr = Virtual_Address;
			ptr_memAccReq->reqType = REQUEST_READ;
			printf("读入请求:\n地址:%u\t类型:读取\t 所属进程: %u\n", ptr_memAccReq->virAddr, ptr_memAccReq->FromProgress);
			break;
		case 'x':
			ptr_memAccReq->FromProgress = Progress;
			ptr_memAccReq->virAddr = Virtual_Address;
			ptr_memAccReq->reqType = REQUEST_EXECUTE;
			printf("读入请求:\n地址:%u\t类型:执行\t 所属进程: %u\n", ptr_memAccReq->virAddr, ptr_memAccReq->FromProgress);
			break;
		default:
			do_error(ERROR_ILLEGAL_INPUT);
			break;
	}
	return 1;
}
开发者ID:AdmiralTony,项目名称:os-vmm,代码行数:49,代码来源:vmm1.c


示例18: main

int main(int argc, char* argv[])
{
	int i;
	char c;
	int flag = 0;
	if (!(ptr_auxMem = fopen(AUXILIARY_MEMORY, "r+")))
	{
		do_error(ERROR_FILE_OPEN_FAILED);
		exit(1);
	}
	do_init();
	do_print_info();
	ptr_memAccReq = (Ptr_MemoryAccessRequest) malloc(sizeof(MemoryAccessRequest));
	/* 在循环中模拟访存请求与处理过程 */
	while (TRUE)
	{
		do_request();
loop:	do_response();
		printf("按Y打印页表,按其他键不打印...\n");
loop1:	if ((c = getchar()) == 'y' || c == 'Y')
			do_print_info();
		while (c != '\n')
			c = getchar();
		if(flag == 1){
			flag = 0;
			goto loop1;
		}
		printf("按X退出程序,按I手动输入请求,按其他键继续...\n");
		if ((c = getchar()) == 'x' || c == 'X')
			break;
		if (c == 'i' || c == 'I'){
			flag = do_input_request();
			if(flag == 1)
				goto loop;
			printf("1111\n");
		}
		while (c != '\n'){
			c = getchar();
		}
		//sleep(5000);
	}

	if (fclose(ptr_auxMem) == EOF)
	{
		do_error(ERROR_FILE_CLOSE_FAILED);
		exit(1);
	}
	return (0);
}
开发者ID:AdmiralTony,项目名称:os-vmm,代码行数:49,代码来源:vmm.c


示例19: error

void error(int code, ...)
{
    va_list ap;
    va_start(ap, code);
    do_error(code, ap);
    va_end(ap);
}
开发者ID:kichik,项目名称:nsis-1,代码行数:7,代码来源:error.c


示例20: warning

void warning(struct position pos, const char * fmt, ...)
{
	va_list args;

	if (Wsparse_error) {
		va_start(args, fmt);
		do_error(pos, fmt, args);
		va_end(args);
		return;
	}

	if (!max_warnings) {
		show_info = 0;
		return;
	}

	if (!--max_warnings) {
		show_info = 0;
		fmt = "too many warnings";
	}

	va_start(args, fmt);
	do_warn("warning: ", pos, fmt, args);
	va_end(args);
}
开发者ID:alexanderkyte,项目名称:sparse,代码行数:25,代码来源:lib.c



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
C++ do_exec函数代码示例发布时间:2022-05-30
下一篇:
C++ do_div函数代码示例发布时间: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