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

C++ ERRMSG函数代码示例

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

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



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

示例1: usleep

bool clsYarp::checkYarp()
{
	if(!yarpInitiated){
		usleep(100);
		#ifdef REQUIRE_YARP
		ERRMSG(("yarp failed to initialize"));
		#else
		WARNMSG(("yarp failed to initialize"));
		#endif
	}
	return yarpInitiated;
}
开发者ID:alexlib,项目名称:flywalkreloaded,代码行数:12,代码来源:yarp.cpp


示例2: GetGIDFromConfig

int
GetGIDFromConfig(Process* proc, Config* config)
{
    const char* pGroupName = 0;
    INT32 ulGID = -1;
    if (pGroupName = config->GetString(proc, "config.Group"))
    {
        /* "%n" allows you to use the GID */
        if (pGroupName[0] == '%')
        {
            ulGID = strtol(pGroupName + 1, 0, 0);
        }
        else
        {
            int isNumeric = 1;
            const char* ptr = pGroupName;

            while (ptr)
            {
                if (!isdigit(*ptr))
                {
                    isNumeric = 0;
                    break;
                }
                ptr++;
            }

            if (isNumeric)
            {
                ulGID = strtol(pGroupName + 1, 0, 0);
            }
            else
            {
                struct group* pGroupInfo = getgrnam(pGroupName);

                if (pGroupInfo)
                {
                    ulGID = pGroupInfo->gr_gid;
                }
                else
                {
                    ERRMSG(proc->pc->error_handler,
                           "Couldn't find group %s in the system database",
                            pGroupName);
                }
            }
        }
    }
    else
        ulGID = config->GetInt(proc, "config.Group");

    return ulGID;
}
开发者ID:muromec,项目名称:qtopia-ezx,代码行数:53,代码来源:core_proc.cpp


示例3: DBGMSG

        void ModelReader::ModelHandler::onElementEnd(const std::string& name) {
            if(_toSkip.size() > 0) {
                const std::string& expected= _toSkip.back();

                if(expected == name) {
                    _toSkip.pop_back();

                    if(_toSkip.size() <= 0) {
                    	DBGMSG("skipped %s", name.c_str());
                    }
                } else {
                    ERRMSG("expected %s but got %s", expected.c_str(), name.c_str());
                }
            } else {
                if(_parser != NULL) {
                    _parser= _parser->post();
                } else {
                    ERRMSG("invalid end tag %s", name.c_str());
                }
            }
        }
开发者ID:konstantinmiller,项目名称:dashp2p,代码行数:21,代码来源:ModelReader.cpp


示例4: run_decoder

static int run_decoder(aac_t *aac)
{
	char *darg[8]={AAC_DECODER,"-f","2","-o", NULL, NULL, NULL};
	darg[4]=FIFO_NAME;
	darg[5]=aac->fname;
	aac->dpid=child_start(darg,NULL,NULL,NULL);
	if(!(aac->inf=fopen(FIFO_NAME,"r"))) {
		ERRMSG("can't open fifo\n");
		return -1;
	}
	return 0;
}
开发者ID:sumikawa,项目名称:raop_play,代码行数:12,代码来源:aac_stream.c


示例5: ckd_connect

/*! EINTR aware connect() call */
int ckd_connect (int sock_fd, struct sockaddr *addr, socklen_t len)
{
   ssize_t ret;

   do {
      ret = connect(sock_fd, addr, len);
   } while (ret == -1 && errno == EINTR);
   if (ret == -1) {
      ERRMSG("dpid.c", "connect", errno);
   }
   return ret;
}
开发者ID:epitron,项目名称:dillo,代码行数:13,代码来源:dpid.c


示例6: check_elf_format

static int
check_elf_format(int fd, char *filename, int *phnum, unsigned int *num_load)
{
	int i;
	Elf64_Ehdr ehdr64;
	Elf64_Phdr load64;
	Elf32_Ehdr ehdr32;
	Elf32_Phdr load32;

	if (lseek(fd, 0, SEEK_SET) < 0) {
		ERRMSG("Can't seek %s. %s\n", filename, strerror(errno));
		return FALSE;
	}
	if (read(fd, &ehdr64, sizeof(Elf64_Ehdr)) != sizeof(Elf64_Ehdr)) {
		ERRMSG("Can't read %s. %s\n", filename, strerror(errno));
		return FALSE;
	}
	if (lseek(fd, 0, SEEK_SET) < 0) {
		ERRMSG("Can't seek %s. %s\n", filename, strerror(errno));
		return FALSE;
	}
	if (read(fd, &ehdr32, sizeof(Elf32_Ehdr)) != sizeof(Elf32_Ehdr)) {
		ERRMSG("Can't read %s. %s\n", filename, strerror(errno));
		return FALSE;
	}
	(*num_load) = 0;
	if ((ehdr64.e_ident[EI_CLASS] == ELFCLASS64)
	    && (ehdr32.e_ident[EI_CLASS] != ELFCLASS32)) {
		(*phnum) = ehdr64.e_phnum;
		for (i = 0; i < ehdr64.e_phnum; i++) {
			if (!get_elf64_phdr(fd, filename, i, &load64)) {
				ERRMSG("Can't find Phdr %d.\n", i);
				return FALSE;
			}
			if (load64.p_type == PT_LOAD)
				(*num_load)++;
		}
		return ELF64;

	} else if ((ehdr64.e_ident[EI_CLASS] != ELFCLASS64)
	    && (ehdr32.e_ident[EI_CLASS] == ELFCLASS32)) {
		(*phnum) = ehdr32.e_phnum;
		for (i = 0; i < ehdr32.e_phnum; i++) {
			if (!get_elf32_phdr(fd, filename, i, &load32)) {
				ERRMSG("Can't find Phdr %d.\n", i);
				return FALSE;
			}
			if (load32.p_type == PT_LOAD)
				(*num_load)++;
		}
		return ELF32;
	}
	ERRMSG("Can't get valid ehdr.\n");
	return FALSE;
}
开发者ID:jmesmon,项目名称:makedumpfile,代码行数:55,代码来源:elf_info.c


示例7: get_machdep_info_ppc

int
get_machdep_info_ppc(void)
{
	unsigned long vmlist, vmalloc_start;

	info->section_size_bits = _SECTION_SIZE_BITS;
	info->max_physmem_bits  = _MAX_PHYSMEM_BITS;
	info->page_offset = __PAGE_OFFSET;

	if (SYMBOL(_stext) != NOT_FOUND_SYMBOL)
		info->kernel_start = SYMBOL(_stext);
	else {
		ERRMSG("Can't get the symbol of _stext.\n");
		return FALSE;
	}
		
	DEBUG_MSG("kernel_start : %lx\n", info->kernel_start);

	/*
	 * For the compatibility, makedumpfile should run without the symbol
	 * vmlist and the offset of vm_struct.addr if they are not necessary.
	 */
	if ((SYMBOL(vmlist) == NOT_FOUND_SYMBOL)
	    || (OFFSET(vm_struct.addr) == NOT_FOUND_STRUCTURE)) {
		return TRUE;
	}
	if (!readmem(VADDR, SYMBOL(vmlist), &vmlist, sizeof(vmlist))) {
		ERRMSG("Can't get vmlist.\n");
		return FALSE;
	}
	if (!readmem(VADDR, vmlist + OFFSET(vm_struct.addr), &vmalloc_start,
	    sizeof(vmalloc_start))) {
		ERRMSG("Can't get vmalloc_start.\n");
		return FALSE;
	}
	info->vmalloc_start = vmalloc_start;
	DEBUG_MSG("vmalloc_start: %lx\n", vmalloc_start);

	return TRUE;
}
开发者ID:chitranshi,项目名称:makedumpfile,代码行数:40,代码来源:ppc.c


示例8: ReadSDSUCommand

int ReadSDSUCommand(void) {

    int bytes;
    int retVal;

    if ((bytes = READ_FIFO(context->fifo[USER_DATA_FULL], (void *) &intBuf, sizeof(intBuf))) != sizeof(intBuf)) {
        if (bytes > 0) {
            ERRMSG("ReadSDSUCommand> ERROR - read from FIFO USER_DATA_FULL %d bytes\n", bytes);
        } else if (bytes < 0) {
            ERRMSG("ReadSDSUCommand> ERROR - read from FIFO USER_DATA_FULL errno %d\n", bytes);
        } else {
            /* When zero bytes are read this probably means the task or FIFO has been deleted */
            ERRMSG("ReadSDSUCommand> read %d bytes, read from FIFO USER_DATA_FULL aborted!\n", bytes);
        }
        retVal = ERR_READFIFO;
    } else {
        DBGMSG("ReadSDSUCommand> bufphysadr=%#lx bufsize=%ld bufid=%#lx\n", intBuf.bufphysadr, intBuf.bufsize, intBuf.bufid);
        retVal = NO_ERROR;
    }

    return retVal;
}
开发者ID:ramosdeflores,项目名称:EMIR-DAS,代码行数:22,代码来源:ct_interface.c


示例9: get_phnum_memory

int
get_phnum_memory(void)
{
	int phnum;
	Elf64_Ehdr ehdr64;
	Elf32_Ehdr ehdr32;

	if (is_elf64_memory()) { /* ELF64 */
		if (!get_elf64_ehdr(fd_memory, name_memory, &ehdr64)) {
			ERRMSG("Can't get ehdr64.\n");
			return FALSE;
		}
		phnum = ehdr64.e_phnum;
	} else {                /* ELF32 */
		if (!get_elf32_ehdr(fd_memory, name_memory, &ehdr32)) {
			ERRMSG("Can't get ehdr32.\n");
			return FALSE;
		}
		phnum = ehdr32.e_phnum;
	}
	return phnum;
}
开发者ID:jmesmon,项目名称:makedumpfile,代码行数:22,代码来源:elf_info.c


示例10: camera_open

///////////////////////////////////////////////////////////////////////
// External API
///////////////////////////////////////////////////////////////////////
int camera_open(char* camname,int sensor)
{
	int handle;
	struct pxa_camera* camobj = NULL;

	// Initialize camera object
	memset(&camobj,0,sizeof(camobj));

	if(camname==NULL){
		camname="/dev/video0";
	}

	handle = open(camname, O_RDONLY);
	if (handle<0) {
		ERRMSG("cann't open camera %s (%d)\n",camname,errno);
		ASSERT(handle>=0);
		return 0;
	}

	if(ioctl(handle, VIDIOC_S_INPUT, &sensor)<0) {
        	ERRMSG("can't set input\n");
	        close(handle);
        	return 0;
	}

	// Initialize camera object
	camobj = malloc(sizeof(struct pxa_camera));
	memset(camobj,0,sizeof(struct pxa_camera));
	ASSERT(camobj);
	camobj->handle = handle;
	camobj->status = CAM_STATUS_READY;
	camobj->width = 0;
	camobj->height = 0;
	camobj->sensor = sensor;

	ASSERT(sizeof(int)==sizeof(struct pxa_camera*));
	return (int)camobj;
//	return handle;
}
开发者ID:ansrl89,项目名称:eswc2013_kobot_mission,代码行数:42,代码来源:camera.c


示例11: updateTcpInfo

void TcpConnection::write(string& s)
{
	/* Assert socket health and health of TCP connection. */
	//dp2p_assert(fdSocket != -1);
	//assertSocketHealth();
	updateTcpInfo();
	if(lastTcpInfo.tcpi_state != TCP_ESTABLISHED) {
		ERRMSG("Wanted to send requests but TCP connection is %s.", TcpConnectionManager::tcpState2String(lastTcpInfo.tcpi_state).c_str());
		ERRMSG("Server state: %s", SourceManager::sourceState2String(srcId).c_str());
		//ERRMSG("reqQueue: %s", reqQueue2String().c_str());
		throw std::runtime_error("Unexpected termination of TCP connection.");
	}

	/* Send the request. */
	while(!s.empty())
	{
		int retVal = ::send(fdSocket, s.c_str(), s.size(), 0);//MSG_DONTWAIT);
		// TODO: react to connectivity interruptions here
		dp2p_assert(retVal > 0);
		s.erase(0, retVal);
	}
}
开发者ID:konstantinmiller,项目名称:dashp2p,代码行数:22,代码来源:TcpConnectionManager.cpp


示例12: stop_decoder

static int stop_decoder(aac_t *aac)
{
	int i;

	if(!aac->dpid) return 0;
	kill(aac->dpid,SIGTERM);
	for(i=0;i<10;i++){
		if(!aac->dpid) return 0;
		usleep(10*1000);
	}
	ERRMSG("decoder process can't be terminated\n");
	return 0;
}
开发者ID:sumikawa,项目名称:raop_play,代码行数:13,代码来源:aac_stream.c


示例13: bind_socket_fd

/*! Bind a socket port on localhost. Try to be close to base_port.
 * \Return
 * \li listening socket file descriptor on success
 * \li -1 on failure
 */
int bind_socket_fd(int base_port, int *p_port)
{
   int sock_fd, port;
   struct sockaddr_in sin;
   int ok = 0, last_port = base_port + 50;

   if ((sock_fd = make_socket_fd()) == -1) {
      return (-1);              /* avoids nested ifs */
   }
   /* Set the socket FD to close on exec */
   fcntl(sock_fd, F_SETFD, FD_CLOEXEC | fcntl(sock_fd, F_GETFD));


   memset(&sin, 0, sizeof(sin));
   sin.sin_family = AF_INET;
   sin.sin_addr.s_addr = htonl(INADDR_LOOPBACK);

   /* Try to bind a port on localhost */
   for (port = base_port; port <= last_port; ++port) {
      sin.sin_port = htons(port);
      if ((bind(sock_fd, (struct sockaddr *)&sin, sizeof(sin))) == -1) {
         if (errno == EADDRINUSE || errno == EADDRNOTAVAIL)
            continue;
         ERRMSG("bind_socket_fd", "bind", errno);
      } else if (listen(sock_fd, QUEUE) == -1) {
         ERRMSG("bind_socket_fd", "listen", errno);
      } else {
         *p_port = port;
         ok = 1;
         break;
      }
   }
   if (port > last_port) {
      MSG_ERR("Hey! Can't find an available port from %d to %d\n",
              base_port, last_port);
   }

   return ok ? sock_fd : -1;
}
开发者ID:epitron,项目名称:dillo,代码行数:44,代码来源:dpid.c


示例14: GetNextCluster

ULONG GetNextCluster(ULONG Cluster)
{
    ULONG Sector = 0;
    ULONG ByteOffset = 0;
    PUCHAR pSectorCache = (PUCHAR)SECTOR_CACHE_START;   // Sector cache is where the sector used to read the FAT cluster chains lives.
    static ULONG CurrentSector = 0;
    ULONG NextCluster = 0;

    // If we're passed an EOF cluster, return it.
    //
    if (IsEOFCluster(Cluster))
        return(Cluster);

    // Is caller giving us a valid cluster?
    //
    if (!IsDataCluster(Cluster))
    {
        ERRMSG(MSG_BAD_CLUSTER_NUMBER, ("Bad cluster number\n"));
        return(0);  // 0 isn't a valid cluster number (at least for our purposes).
    }

    // Compute sector where our FAT entry lives.
    //
    Sector = Cluster << 2;
    ByteOffset = Sector & ((1 << pBPB->BytesPerSector)-1);
    Sector = Sector >> pBPB->BytesPerSector;
    Sector += g_FATParms.FATLBA;

    // If the sector we're interested in isn't in our cache, get it.
    //
    if (CurrentSector != Sector)
    {
        if (!ReadSectors( pBPB->DriveID, Sector, 1, pSectorCache))
        {
//          TODO: Only a message?
//          SERPRINT("GetNextCluster - unable to read sector.\r\n");
        }

        CurrentSector = Sector;
    }

    // Locate next cluster number...
    //
    NextCluster = *(PULONG)(pSectorCache + ByteOffset);

//    SERPRINT("GNC: cluster=0x%x  next cluster=0x%x\r\n", Cluster, NextCluster);

    // Return the next cluster value.
    //
    return(NextCluster);
}
开发者ID:embedded101,项目名称:Compact2013.BSP,代码行数:51,代码来源:bldr_exfat.c


示例15: DrvMountDrives

void        DrvMountDrives( HWND hwnd)

{
    ULONG   rc = 0;
    HEV     hev = 0;
    TID     tid;
    char *  pErr = 0;

do {
    rc = DosCreateEventSem( 0, &hev, 0, FALSE);
    if (rc)
        ERRMSG( "DosCreateEventSem")

    tid = _beginthread( DrvMountDrivesThread, 0, 0x4000, (PVOID)hev);
    if (tid == -1)
        ERRMSG( "_beginthread")

    rc = WinWaitEventSem( hev, 4000);
    if (!rc)
        break;

    if (rc != ERROR_TIMEOUT)
        ERRMSG( "DosWaitEventSem")

    rc = CamDlgBox( hwnd, IDD_LVMHANG, hev);
    printf( "DrvMountDrives - semaphore %s posted\n",
            (rc ? "was" : "was not"));

} while (0);

    if (hev)
        DosCloseEventSem( hev);

    if (pErr)
        printf( "DrvMountDrives - %s - rc= 0x%lx\n", pErr, rc);

    return;
}
开发者ID:OS2World,项目名称:APP-GRAPHICS-Cameraderie,代码行数:38,代码来源:camdrive.c


示例16: get_tcp_connect

/*
 * create tcp connection
 * as long as the socket is not non-blocking, this can block the process
 * nsport is network byte order
 */
int get_tcp_connect(int sd, struct sockaddr_in dest_addr)
{

    if(connect(sd, (struct sockaddr *)&dest_addr, sizeof(struct sockaddr))) {
        SLEEP_MSEC(100L);
        // try one more time
        if(connect(sd, (struct sockaddr *)&dest_addr, sizeof(struct sockaddr))) {
            ERRMSG("error:get_tcp_nconnect addr=%s, port=%d\n",
                   inet_ntoa(dest_addr.sin_addr), ntohs(dest_addr.sin_port));
            return -1;
        }
    }
    return 0;
}
开发者ID:albertz,项目名称:RaopX,代码行数:19,代码来源:aexcl_lib.c


示例17: est_dpi_sigchld

/*! Establish SIGCHLD handler */
void est_dpi_sigchld(void)
{
   struct sigaction sigact;
   sigset_t set;

   (void) sigemptyset(&set);
   sigact.sa_handler = dpi_sigchld;
   sigact.sa_mask = set;
   sigact.sa_flags = SA_NOCLDSTOP;
   if (sigaction(SIGCHLD, &sigact, NULL) == -1) {
      ERRMSG("est_dpi_sigchld", "sigaction", errno);
      exit(1);
   }
}
开发者ID:epitron,项目名称:dillo,代码行数:15,代码来源:dpid.c


示例18: a_Dpip_get_attr

/*!
 * Get value of msg field from dpi_tag
 * \Return
 * message on success, NULL on failure
 */
char *get_message(int sock_fd, char *dpi_tag)
{
   char *msg, *d_cmd;

   msg = a_Dpip_get_attr(dpi_tag, "msg");
   if (msg == NULL) {
      ERRMSG("get_message", "failed to parse msg", 0);
      d_cmd = a_Dpip_build_cmd("cmd=%s msg=%s",
                               "DpiError", "Failed to parse request");
      (void) CKD_WRITE(sock_fd, d_cmd);
      dFree(d_cmd);
   }
   return (msg);
}
开发者ID:epitron,项目名称:dillo,代码行数:19,代码来源:dpid.c


示例19: seh_probe

static int seh_probe(struct platform_device *dev)
{
	int ret;

	ENTER();

	seh_int_wq = create_workqueue("seh_rx_wq");

	INIT_WORK(&seh_int_request, seh_int_handler_high);

	seh_dev = (struct seh_dev*)kzalloc(sizeof(struct seh_dev), GFP_KERNEL);
	if (seh_dev == NULL)
	{
		ERRMSG("seh_probe: unable to allocate memory\n");
		return -ENOMEM;
	}

	init_waitqueue_head(&(seh_dev->readq));
	sema_init(&seh_dev->read_sem, 1);
	seh_dev->dev = (struct device *)dev;

	ret = misc_register(&seh_miscdev);
	if (ret)
		ERRMSG("seh_probe: failed to call misc_register\n");
	wake_lock_init(&seh_wakeup, WAKE_LOCK_SUSPEND, "seh_wakeups");

	ret = request_irq(IRQ_COMM_WDT_ID, seh_int_handler_low, IRQF_DISABLED,
			     seh_name, NULL);
	if (ret)
	{
		ERRMSG("seh_probe: cannot register the COMM WDT interrupt\n");
		return ret;
	}
	LEAVE();

	return ret;
}
开发者ID:maxfu,项目名称:android_kernel_armada_pxa1088,代码行数:37,代码来源:seh_linux.c


示例20: auds_get_next_sample

int auds_get_next_sample(auds_t *auds, __u8 **data, int *size)
{
	int rval;
	auds_t *lauds=auds;
	if(auds->auds) lauds=auds->auds;
	switch(lauds->data_type){
	case AUD_TYPE_PCM:
		rval=pcm_get_next_sample(lauds, data, size);
		break;
	case AUD_TYPE_NONE:
		ERRMSG("%s:### shouldn't come here\n",__func__);
		return -1;
	}
	return rval;
}
开发者ID:maximeflamant,项目名称:waveplay,代码行数:15,代码来源:audio_stream.c



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

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