您当前的位置:首页 > IT编程 > C++
| C语言 | Java | VB | VC | python | Android | TensorFlow | C++ | oracle | 学术与代码 | cnn卷积神经网络 | gnn | 图像修复 | Keras | 数据集 | Neo4j | 自然语言处理 | 深度学习 | 医学CAD | 医学影像 | 超参数 | pointnet | pytorch | 异常检测 | Transformers | 情感分类 | 知识图谱 |

自学教程:C++ ERRMSG函数代码示例

51自学网 2021-06-01 20:33:13
  C++
这篇教程C++ ERRMSG函数代码示例写得很实用,希望能帮到您。

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

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


示例2: GetGIDFromConfig

intGetGIDFromConfig(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,


示例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,


示例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,


示例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,


示例6: check_elf_format

static intcheck_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,


示例7: get_machdep_info_ppc

intget_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,


示例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,


示例9: get_phnum_memory

intget_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,


示例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,


示例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,


示例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,


示例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,


示例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,


示例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,


示例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,


示例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,


示例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,


示例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,


示例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,


示例21: success

analyzer_t::analyzer_t(const std::string &trace_file, analysis_tool_t **tools_in,                       int num_tools_in) :    success(true), trace_iter(NULL), trace_end(NULL), num_tools(num_tools_in),    tools(tools_in){    for (int i = 0; i < num_tools; ++i) {        if (tools[i] == NULL || !*tools[i]) {            success = false;            ERRMSG("Tool is not successfully initialized/n");            return;        }    }    if (!init_file_reader(trace_file))        success = false;}
开发者ID:FirstBlue,项目名称:dynamorio,代码行数:15,


示例22: Msmpot_compute_longrng

int Msmpot_compute_longrng(Msmpot *msm) {  int err = 0;  /* permit only cubic interpolation - for now */  switch (msm->interp) {    case MSMPOT_INTERP_CUBIC:      err = Msmpot_compute_longrng_cubic(msm);      if (err) return ERROR(err);      break;    default:      return ERRMSG(MSMPOT_ERROR_SUPPORT,          "interpolation method not implemented");  }  return MSMPOT_SUCCESS;}
开发者ID:Eigenstate,项目名称:vmd-python,代码行数:15,


示例23: main

int main(    int argc,    char *argv[]) {    static atm_t atm;    static ctl_t ctl;    double dz, t0, z, z0, z1;    /* Check arguments... */    if (argc < 3)        ERRMSG("Give parameters: <ctl> <atm>");    /* Read control parameters... */    read_ctl(argc, argv, &ctl);    t0 = scan_ctl(argc, argv, "T0", -1, "0", NULL);    z0 = scan_ctl(argc, argv, "Z0", -1, "0", NULL);    z1 = scan_ctl(argc, argv, "Z1", -1, "90", NULL);    dz = scan_ctl(argc, argv, "DZ", -1, "1", NULL);    /* Set atmospheric grid... */    for (z = z0; z <= z1; z += dz) {        atm.time[atm.np] = t0;        atm.z[atm.np] = z;        if ((++atm.np) >= NP)            ERRMSG("Too many atmospheric grid points!");    }    /* Interpolate climatological data... */    climatology(&ctl, &atm);    /* Write data to disk... */    write_atm(NULL, argv[2], &ctl, &atm);    return EXIT_SUCCESS;}
开发者ID:dmoriano,项目名称:jurassic,代码行数:36,


示例24: Usage

void Usage(char * filename){#ifdef __FN_RFSET__	ERRMSG( "Usage: %s [-dhpq] serial_port_path/n", filename);#else	ERRMSG( "Usage: %s [-dh] serial_port_path/n", filename);#endif	ERRMSG( "    -d               : enable debugging/n");#ifdef __FN_RFSET__    ERRMSG( "    -p power         : rf power setting/n");    ERRMSG( "    -q state         : update permit state (0:close, 1:open)/n");    ERRMSG( "    -G mode          : update power mode (0~3)/n");#else#endif	ERRMSG( "    -h               : display this message/n");	ERRMSG( "/n");}
开发者ID:bearxiong99,项目名称:new_swamm,代码行数:17,


示例25: WriteSDSUCommand

int WriteSDSUCommand(void) {     if ( intVirBuff == NULL )          if ( (intVirBuff = (void *)memalign(SDSU_BURST_BLOCK, intBuffSize)) == NULL ) {               ERRMSG("WriteSDSUCommand> ERROR allocating buffer memory./n");               return ERR_MBUFF;          } else {               intPhyBuff = CACHE_DMA_VIRT_TO_PHYS(intVirBuff);               /* Write command structure */               intBuf.bufphysadr = (volatile const UINT32)intPhyBuff;               intBuf.bufsize = intBuffSize;               intBuf.bufid = 4321;          }     DBGMSG("WriteSDSUCommand> bufphysadr=%#lx bufsize=%ld bufid=%#lx/n", intBuf.bufphysadr, intBuf.bufsize, intBuf.bufid);     if (WRITE_FIFO(context->fifo[USER_DATA_EMPTY], (void *) &intBuf, sizeof(intBuf)) != BUFFER_OK) {         ERRMSG("WriteSDSUCommand> ERROR - write to FIFO USER_DATA_EMPTY/n");         return ERR_WRITEFIFO;     }     return NO_ERROR;}
开发者ID:ramosdeflores,项目名称:EMIR-DAS,代码行数:24,


示例26: policy_table_add_filter

/** * Adds a filter with the given interface name and address family to the table. * Only adds it if it does not yet exist in the table. *  * @param[in] filter_data *     Filter part of policy, containing interface name and address family */voidpolicy_table_add_filter(policy_filter_msg_t * filter_data){    policy_table_entry_t * policy;    INSIST(if_table != NULL);    INSIST(filter_data != NULL);    INSIST(strlen(filter_data->ifname) <= MAX_IF_NAME_LEN);    junos_trace(PED_TRACEFLAG_HT, "%s: %s, af: %d", __func__,        filter_data->ifname, filter_data->af);    policy = get_or_create_policy(filter_data->ifname, filter_data->af);    if(policy->broken) {        // if the policy is broken then this whole policy         // will be deleted because something's wrong with it        // ...So, don't add the filter        return;    }        if(!policy->pfd_filter) {        policy->pfd_filter = apply_pfd_filter_to_interface(policy->ifname);    }        if(!policy->filter) {        // Create filter if it doesn't exist        policy->filter = (ped_policy_filter_t *)malloc(sizeof(ped_policy_filter_t));        INSIST(policy->filter != NULL);    }    // Update filter data    memcpy(&(policy->filter->filter_data), filter_data,            sizeof(policy_filter_msg_t));    policy->filter->status = FILTER_PENDING;        if(apply_filters_to_interface(policy->ifname, policy->filter)) {        policy->filter->status = FILTER_ADDED;    } else {        policy->filter->status = FILTER_FAILED;        policy->broken = TRUE; // break it so it gets cleaned        clean_table = TRUE;                ERRMSG(PED, TRACE_LOG_ERR, "%s: Failed to apply filters"            "on interface", __func__, policy->ifname);    }}
开发者ID:jameskellynet,项目名称:junos-sdk-sample-apps,代码行数:55,


示例27: ERRMSG

cache_t*cache_simulator_t::create_cache(std::string policy){    if (policy == REPLACE_POLICY_NON_SPECIFIED || // default LRU        policy == REPLACE_POLICY_LRU) // set to LRU        return new cache_lru_t;    if (policy == REPLACE_POLICY_LFU) // set to LFU        return new cache_t;    if (policy == REPLACE_POLICY_FIFO) // set to FIFO        return new cache_fifo_t;    // undefined replacement policy    ERRMSG("Usage error: undefined replacement policy. "           "Please choose " REPLACE_POLICY_LRU" or " REPLACE_POLICY_LFU"./n");    return NULL;}
开发者ID:stoyannk,项目名称:dynamorio,代码行数:16,


示例28: auds_close

int auds_close(auds_t *auds){	if(auds->stream){		switch(auds->data_type){		case AUD_TYPE_PCM:			pcm_close(auds);			break;		case AUD_TYPE_NONE:			ERRMSG("### shouldn't come here/n");			break;		}	}	free(auds);	return 0;}
开发者ID:maximeflamant,项目名称:waveplay,代码行数:17,



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


C++ ERROR函数代码示例
C++ ERRLOG函数代码示例
万事OK自学网:51自学网_软件自学网_CAD自学网自学excel、自学PS、自学CAD、自学C语言、自学css3实例,是一个通过网络自主学习工作技能的自学平台,网友喜欢的软件自学网站。