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

C++ ERR_MSG函数代码示例

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

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



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

示例1: main

int main(void)
{
	sigset_t pendingset;
	struct sigaction act;
	act.sa_handler = myhandler;
	act.sa_flags = 0;
	sigemptyset(&act.sa_mask);
	int rc;

	rc = sigaction(SIGCHLD, &act, 0);
	if (rc) {
		ERR_MSG("sigaction()", rc);
		return PTS_UNRESOLVED;
	}

	if (sigset(SIGCHLD, SIG_HOLD) == SIG_ERR) {
		perror("Unexpected error while using sigset()");
		return PTS_UNRESOLVED;
	}

	raise(SIGCHLD);

	rc = sigpending(&pendingset);
	if (rc) {
		ERR_MSG("sigpending()", rc);
		return PTS_UNRESOLVED;
	}

	if (sigismember(&pendingset, SIGCHLD) != 1) {
		printf("Test FAILED: Signal SIGCHLD wasn't hold.\n");
		return PTS_FAIL;
	}

	printf("Test PASSED\n");
	return PTS_PASS;
}
开发者ID:kraj,项目名称:ltp,代码行数:36,代码来源:6-1.c


示例2: bma150_read_reg

// ************************************************************************
// Gsensor Code -- BMA150
// ************************************************************************
static int bma150_read_reg(struct i2c_client *clnt, unsigned char reg, unsigned char *data, unsigned char count)
{
    unsigned char tmp[10];
	
    if (10 < count)
        return -1;
	
    tmp[0] = reg;
    if (bma150_i2c_tx(tmp, 1) < 0)
    {
        ERR_MSG("Set REGISTER address error");
        return -EIO;
    }

    if (bma150_i2c_rx(tmp, count) < 0)
    {
        ERR_MSG("Read REGISTER content error");
        return -EIO;
    }

    strncpy(data, tmp, count);

    return 0;
}
开发者ID:Austrie,项目名称:SpeedDemon-Kernel,代码行数:27,代码来源:bma150.c


示例3: G_THROW

void 
JB2Dict::JB2Codec::Encode::code(const GP<JB2Dict> &gjim)
{
  if(!gjim)
  {
    G_THROW( ERR_MSG("JB2Image.bad_number") );
  }
  JB2Dict &jim=*gjim;
      // -------------------------
      // THIS IS THE ENCODING PART
      // -------------------------
      int firstshape = jim.get_inherited_shape_count();
      int nshape = jim.get_shape_count();
      init_library(jim);
      // Code headers.
      int rectype = REQUIRED_DICT_OR_RESET;
      if (jim.get_inherited_shape_count() > 0)
        code_record(rectype, gjim, 0);
      rectype = START_OF_DATA;
      code_record(rectype, gjim, 0);
      // Code Comment.
      rectype = PRESERVED_COMMENT;
      if (!! jim.comment)
        code_record(rectype, gjim, 0);
      // Encode every shape
      int shapeno;
      DJVU_PROGRESS_TASK(jb2code,"jb2 encode", nshape-firstshape);
      for (shapeno=firstshape; shapeno<nshape; shapeno++)
        {
          DJVU_PROGRESS_RUN(jb2code, (shapeno-firstshape)|0xff);
          // Code shape
          JB2Shape &jshp = jim.get_shape(shapeno);
          rectype=(jshp.parent >= 0)
            ?MATCHED_REFINE_LIBRARY_ONLY:NEW_MARK_LIBRARY_ONLY;
          code_record(rectype, gjim, &jshp);
          add_library(shapeno, jshp);
	  // Check numcoder status
	  if (cur_ncell > CELLCHUNK) 
	    {
	      rectype = REQUIRED_DICT_OR_RESET;
	      code_record(rectype, 0, 0);	      
	    }
        }
      // Code end of data record
      rectype = END_OF_DATA;
      code_record(rectype, gjim, 0); 
      gzp=0;
}
开发者ID:OpenInkpot-archive,项目名称:iplinux-djvulibre,代码行数:48,代码来源:JB2EncodeCodec.cpp


示例4: formRadvd

void formRadvd(request *wp, char *path, char *query)
{
	int pid;
	char tmpBuf[256];
	char *submitUrl;
	char* value;
	radvdCfgParam_t radvdCfgParam;
	/*Get parameters*/
	getRadvdInfo(&radvdCfgParam);
	
	/*Set parameters*/
	value=req_get_cstream_var(wp,"submit","");
	if(0 == strcmp(value,"Save"))
	{
		set_RadvdParam(wp, path, query,&radvdCfgParam);
	}
	
	/*Set to pMIb*/
	apmib_set(MIB_IPV6_RADVD_PARAM,&radvdCfgParam);
	
	/*Update it to flash*/
setOk_radvd:
	apmib_update(CURRENT_SETTING);

	/*create the config file*/
	create_RadvdCfgFile(&radvdCfgParam);
	/*start the Daemon*/
#ifndef NO_ACTION
	pid = fork();
        if (pid) {
	      	waitpid(pid, NULL, 0);
	}
        else if (pid == 0) {
		snprintf(tmpBuf, 100, "%s/%s", _CONFIG_SCRIPT_PATH, _IPV6_RADVD_SCRIPT_PROG);
		execl( tmpBuf, _IPV6_RADVD_SCRIPT_PROG, NULL);
               	exit(1);
        }
#endif

	submitUrl = req_get_cstream_var(wp, "submit-url", "");   // hidden page
	OK_MSG(submitUrl);

  	return;

setErr_radvd:
	ERR_MSG(tmpBuf);
	return;
}
开发者ID:jameshilliard,项目名称:WECB-BH-GPL,代码行数:48,代码来源:fmipv6.c


示例5: do_transition

static int do_transition(struct state_t* state,void* input)
{
	struct transition_t* p;
	p = state->trans;
	while( p ){
		if( p->event.happend(input) ){
			state->owner->cur_state = p->next_state;
			state->prev = state;
			DEBUG_MSG("will transition to another state\n");
			return 0;
		}
		p = p->_next;
	}
	ERR_MSG("no target to transition to\n");
	return -1;
}
开发者ID:wowk,项目名称:wowk-state-machine,代码行数:16,代码来源:state-machine.c


示例6: if

const JB2Shape &
JB2Dict::get_shape(const int shapeno) const
{
  const JB2Shape *retval;
  if(shapeno >= inherited_shapes)
  {
    retval=&shapes[shapeno - inherited_shapes];
  }else if(inherited_dict)
  {
    retval=&(inherited_dict->get_shape(shapeno));
  }else
  {
    G_THROW( ERR_MSG("JB2Image.bad_number") );
  }
  return *retval;
}
开发者ID:serghei,项目名称:kde3-kdegraphics,代码行数:16,代码来源:JB2Image.cpp


示例7: GetCurrentThreadId

void
GMonitor::broadcast()
{
  if (ok)
    {
      DWORD self = GetCurrentThreadId();
      if (count>0 || self!=locker)
        G_THROW( ERR_MSG("GThreads.not_acq_broad") );
      for (struct thr_waiting *w=head; w; w=w->next)
        if (w->waiting)
            {
              SetEvent(w->gwait);
              w->waiting = FALSE;
            }
    }
}
开发者ID:371816210,项目名称:ebookdroid-1,代码行数:16,代码来源:GThreads.cpp


示例8: pthread_self

void 
GMonitor::leave()
{
  static pthread_t pthread_null;
  pthread_t self = pthread_self();
  if (ok && (count>0 || !pthread_equal(locker, self)))
    G_THROW( ERR_MSG("GThreads.not_acq_broad") );
  count += 1;
  if (count > 0)
    {
      count = 1;
      locker = pthread_null;
      if (ok)
        pthread_mutex_unlock(&mutex);
    }
}
开发者ID:371816210,项目名称:ebookdroid-1,代码行数:16,代码来源:GThreads.cpp


示例9: fsm_release

int fsm_release(struct state_machine_t** fsm)
{
	if( !fsm || !(*fsm) ){
		return 0;
	}

	if( (*fsm)->isrunning ){
		ERR_MSG("the state machine is still running\n");
		return -1;
	}

	free(*fsm);
	*fsm = NULL;

	return 0;
}
开发者ID:wowk,项目名称:wowk-state-machine,代码行数:16,代码来源:state-machine.c


示例10: test_1

/**
 * Test 1 - Installation d'un driver
 * Description
 * Installer le driver alors qu'il n'est pas installé
 * Resultat attendu
 * La valeur de retour doit être positive, et correspond au numéro du driver. Il doit être possible
 * de le retrouver en utilisant la fonction iosDrvShow.
 **/
int test_1()
{
	int success = 0;
	if(pe_driverInstall(10) >= 0)
	{
		success++;
		iosDrvShow();
		getchar();
		// Call this to clean the system.
	}
	else
	{
		ERR_MSG(1);
	}
	pe_driverUninstall();
	return success;
}
开发者ID:boysb25,项目名称:VxWorks-Driver,代码行数:25,代码来源:unittestl.c


示例11: G_THROW

void 
DjVuTXT::encode(const GP<ByteStream> &gbs) const
{
  ByteStream &bs=*gbs;
  if (! textUTF8 )
    G_THROW( ERR_MSG("DjVuText.no_text") );
  // Encode text
  int textsize = textUTF8.length();
  bs.write24( textsize );
  bs.writall( (void*)(const char*)textUTF8, textsize );
  // Encode zones
  if (has_valid_zones())
  {
    bs.write8(Zone::version);
    page_zone.encode(gbs);
  }
}
开发者ID:smyts,项目名称:tengwa-djvu,代码行数:17,代码来源:DjVuText.cpp


示例12: DEBUG_MSG

void
GIFFManager::load_file(GP<ByteStream> str)
{
  DEBUG_MSG("GIFFManager::load_file(): Loading IFF file.\n");
  DEBUG_MAKE_INDENT(3);
   
  GP<IFFByteStream> gistr=IFFByteStream::create(str);
  IFFByteStream &istr=*gistr;
  GUTF8String chunk_id;
  if (istr.get_chunk(chunk_id))
  {
    if (chunk_id.substr(0,5) != "FORM:")
      G_THROW( ERR_MSG("GIFFManager.cant_find2") );
    set_name(chunk_id);
    load_chunk(istr, top_level);
    istr.close_chunk();
  }
}
开发者ID:OpenInkpot-archive,项目名称:iplinux-djvulibre,代码行数:18,代码来源:GIFFManager.cpp


示例13: G_THROW

void 
GBitmap::compress()
{
  if (grays > 2)
    G_THROW( ERR_MSG("GBitmap.cant_compress") );
  GMonitorLock lock(monitor());
  if (bytes)
    {
      grle.resize(0);
      grlerows.resize(0);
      rlelength = encode(rle,grle);
      if (rlelength)
        {
          gbytes_data.resize(0);
          bytes = 0;
        }
    }
}
开发者ID:acmepjz,项目名称:djvulibre,代码行数:18,代码来源:GBitmap.cpp


示例14: G_THROW

DjVuProgressTask::~DjVuProgressTask()
{
    if (data && data->callback)
    {
        if (data->head != this)
            G_THROW( ERR_MSG("DjVuGlobal.not_compatible") );
        data->head = parent;
        if (!parent)
        {
            unsigned long curdate = GOS::ticks();
            if((*(data->callback))(data->gtask?data->gtask:"",curdate-startdate, curdate-startdate))
            {
                G_THROW("INTERRUPT");
            }
        }
    }
    delete (GP<Data> *)gdata;
}
开发者ID:smyts,项目名称:tengwa-djvu,代码行数:18,代码来源:DjVuGlobal.cpp


示例15: fsm_init

int fsm_init(struct state_machine_t** fsm)
{
	if( !fsm ){
		ERR_MSG("invalid argument\n");
		return -1;
	}

	*fsm = (struct state_machine_t*)calloc(1,sizeof(struct state_machine_t));
	if( *fsm == NULL ){
		STD_ERR_MSG("Cant allocate memory");
		return -1;
	}
	
	(*fsm)->default_entered = default_entered_cb;
	(*fsm)->default_exited = default_exited_cb;

	return 0;
}
开发者ID:wowk,项目名称:wowk-state-machine,代码行数:18,代码来源:state-machine.c


示例16: convertToColor

static unsigned long
convertToColor(const GUTF8String &s)
{
  unsigned long retval=0;
  if(s.length())
  {
    int endpos;
    if(s[0] == '#')
    {
      retval=s.substr(1,-1).toULong(0,endpos,16);
    }
    if(endpos < 0)
    {
      G_THROW( (ERR_MSG("XMLAnno.bad_color") "\t")+s );
    }
  }
  return retval;
}
开发者ID:smyts,项目名称:tengwa-djvu,代码行数:18,代码来源:XMLParser.cpp


示例17: bma150_early_suspend_func

static void bma150_early_suspend_func(struct early_suspend * h)
{
//Div6D1-OH-ECompass-EarlySuspend_To_Suspend-00*{
#ifndef USE_SUSPEND
    INF_MSG("START");
    
    if (atomic_read(&dev_opened) > 0)
    {
        if (enter_mode(BMA150_MODE_SLEEP))
        {
            ERR_MSG("Gsensor Enter sleep mode fail");
        }
    }
    atomic_inc(&is_early_suspend);
#else
	
#endif
//Div6D1-OH-ECompass-EarlySuspend_To_Suspend-00*}
}
开发者ID:Austrie,项目名称:SpeedDemon-Kernel,代码行数:19,代码来源:bma150.c


示例18: LimitSwitch_Pressed

bool LimitSwitch_Pressed(uint8_t sw)
{
	uint8_t val;
	switch(sw) {
		case LimitSwitch_XMin:
			val = GPIO_ReadInputDataBit(X_Axis_Min_Port, X_Axis_Min_Pin);
			break;
		case LimitSwitch_YMin:
			val = GPIO_ReadInputDataBit(Y_Axis_Min_Port, Y_Axis_Min_Pin);
			break;
		case LimitSwitch_ZMin:
			val = GPIO_ReadInputDataBit(Z_Axis_Min_Port, Z_Axis_Min_Pin);
			break;
		default:
			ERR_MSG("Invalid switch number %d", sw);
			return false;
	}
	return !val;
}
开发者ID:jackeyjiang,项目名称:3DPrinter-firmware,代码行数:19,代码来源:limitSwitch.c


示例19: G_THROW

GP<GBitmap>
JB2Image::get_bitmap(int subsample, int align) const
{
  if (width==0 || height==0)
    G_THROW( ERR_MSG("JB2Image.cant_create") );
  int swidth = (width + subsample - 1) / subsample;
  int sheight = (height + subsample - 1) / subsample;
  int border = ((swidth + align - 1) & ~(align - 1)) - swidth;
  GP<GBitmap> bm = GBitmap::create(sheight, swidth, border);
  bm->set_grays(1+subsample*subsample);
  for (int blitno = 0; blitno < get_blit_count(); blitno++)
    {
      const JB2Blit *pblit = get_blit(blitno);
      const JB2Shape  &pshape = get_shape(pblit->shapeno);
      if (pshape.bits)
        bm->blit(pshape.bits, pblit->left, pblit->bottom, subsample);
    }
  return bm;
}
开发者ID:serghei,项目名称:kde3-kdegraphics,代码行数:19,代码来源:JB2Image.cpp


示例20: switch

void
MapArea::initBorder(void)
      // Regenerates the boundary and refreshes border on the screen
{
   switch(getBorderType())
   {
      case GMapArea::NO_BORDER:
      case GMapArea::XOR_BORDER:
      case GMapArea::SOLID_BORDER:
	 ma_generatePieces();
	 repaintBorder();
	 break;
      case GMapArea::SHADOW_IN_BORDER:
	 for(int i=0;i<gmap_area->border_width;i++)
	    shadow_pattern[i]=-(100-100*(i+1)/gmap_area->border_width);
	 ma_generatePieces();
	 repaintBorder();
	 break;
      case GMapArea::SHADOW_OUT_BORDER:
	 for(int i=0;i<gmap_area->border_width;i++)
	    shadow_pattern[i]=100-100*(i+1)/gmap_area->border_width;
	 ma_generatePieces();
	 repaintBorder();
	 break;
      case GMapArea::SHADOW_EIN_BORDER:
	 for(int i=0;i<gmap_area->border_width;i++) shadow_pattern[i]=0;
	 shadow_pattern[0]=-100;
	 shadow_pattern[gmap_area->border_width-1]=100;
   	 ma_generatePieces();
	 repaintBorder();
	 break;
      case GMapArea::SHADOW_EOUT_BORDER:
	 for(int i=0;i<gmap_area->border_width;i++) shadow_pattern[i]=0;
	 shadow_pattern[0]=100;
	 shadow_pattern[gmap_area->border_width-1]=-100;
   	 ma_generatePieces();
	 repaintBorder();
	 break;
      default:
	 G_THROW(ERR_MSG("MapArea.unknown_border_type"));
   }
}
开发者ID:OpenInkpot-archive,项目名称:iplinux-djvulibre,代码行数:42,代码来源:MapAreas.cpp



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

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