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

C++ report_event函数代码示例

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

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



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

示例1: schedule_tick

inline void schedule_tick(void)
{
	TCNT = 0;	// clear timer state
	
	if (g_cycle_flag != 0)
	{
		report_event(EVENT_CODE_SCHED_OVER, ((g_next_slice<<8)|g_next_item), MODE_UPDATE);
		g_cycle_flag++;
	} else {
		g_cycle_flag = 1;
		
		/* re-enable global interrupts */
		sei();
		
		/* execute the schedule for this slice */
		exec_slice();
		if (++g_next_slice >= NUMBER_OF_SCHEDULE_SLOTS)
			g_next_slice = 0;
		
		/* check for cycle overrun */
		if (g_cycle_flag > 1)
			report_event(EVENT_CODE_SCHED_OVER_CNT, g_cycle_flag, MODE_UPDATE);
		
		/* service the watchdog timer */
		wdt_reset();
		g_cycle_flag = 0;
	}
}
开发者ID:Andrew-Hanlon,项目名称:EasyAVR,代码行数:28,代码来源:scheduler.c


示例2: inotify_callback

static void inotify_callback(char* path, int event) {
  if (event & IN_CREATE || event & IN_MOVED_TO) {
    report_event("CREATE", path);
    report_event("CHANGE", path);
    return;
  }

  if (event & IN_MODIFY) {
    report_event("CHANGE", path);
    return;
  }

  if (event & IN_ATTRIB) {
    report_event("STATS", path);
    return;
  }

  if (event & IN_DELETE || event & IN_MOVED_FROM) {
    report_event("DELETE", path);
    return;
  }

  if (event & IN_UNMOUNT) {
    output("RESET\n");
    userlog(LOG_DEBUG, "RESET");
    return;
  }
}
开发者ID:belyak,项目名称:intellij-community,代码行数:28,代码来源:main.c


示例3: acts_close

/*
 * acts_close - close and prepare for next call.
 *
 * In ClOSE state no further protocol actions are required
 * other than to close and release the device and prepare to
 * dial the next number if necessary.
 */
void
acts_close(
	struct peer *peer
	)
{
	struct actsunit *up;
	struct refclockproc *pp;
	char	lockfile[128];
	int	dtr;

	pp = peer->procptr;
	up = pp->unitptr;
	if (pp->io.fd != -1) {
		report_event(PEVNT_CLOCK, peer, "close");
		dtr = TIOCM_DTR;
		if (ioctl(pp->io.fd, TIOCMBIC, &dtr) < 0)
			msyslog(LOG_ERR, "acts: ioctl(TIOCMBIC) failed: %m");
		io_closeclock(&pp->io);
		pp->io.fd = -1;
	}
	if (pp->sloppyclockflag & CLK_FLAG2) {
		snprintf(lockfile, sizeof(lockfile),
		    LOCKFILE, up->unit);
		unlink(lockfile);
	}
	if (up->msgcnt == 0 && up->retry > 0) {
		if (sys_phone[up->retry] != NULL) {
			up->state = S_IDLE;
			up->timer = REDIAL;
			return;
		}
	}
	up->state = S_IDLE;
	up->timer = 0;
}
开发者ID:sambuc,项目名称:netbsd,代码行数:42,代码来源:refclock_acts.c


示例4: stop_kern_loop

static void
stop_kern_loop(void)
{
	if (pll_control && kern_enable)
		report_event(EVNT_KERN, NULL,
		    "kernel time sync disabled");
}
开发者ID:coyizumi,项目名称:cs111,代码行数:7,代码来源:ntp_loopfilter.c


示例5: start_kern_loop

static void
start_kern_loop(void)
{
	static int atexit_done;
	int ntp_adj_ret;

	pll_control = TRUE;
	ZERO(ntv);
	ntv.modes = MOD_BITS;
	ntv.status = STA_PLL;
	ntv.maxerror = MAXDISPERSE;
	ntv.esterror = MAXDISPERSE;
	ntv.constant = sys_poll; /* why is it that here constant is unconditionally set to sys_poll, whereas elsewhere is is modified depending on nanosecond vs. microsecond kernel? */
#ifdef SIGSYS
	/*
	 * Use sigsetjmp() to save state and then call ntp_adjtime(); if
	 * it fails, then pll_trap() will set pll_control FALSE before
	 * returning control using siglogjmp().
	 */
	newsigsys.sa_handler = pll_trap;
	newsigsys.sa_flags = 0;
	if (sigaction(SIGSYS, &newsigsys, &sigsys)) {
		msyslog(LOG_ERR, "sigaction() trap SIGSYS: %m");
		pll_control = FALSE;
	} else {
		if (sigsetjmp(env, 1) == 0) {
			if ((ntp_adj_ret = ntp_adjtime(&ntv)) != 0) {
			    ntp_adjtime_error_handler(__func__, &ntv, ntp_adj_ret, errno, 0, 0, __LINE__ - 1);
			}
		}
		if (sigaction(SIGSYS, &sigsys, NULL)) {
			msyslog(LOG_ERR,
			    "sigaction() restore SIGSYS: %m");
			pll_control = FALSE;
		}
	}
#else /* SIGSYS */
	if ((ntp_adj_ret = ntp_adjtime(&ntv)) != 0) {
	    ntp_adjtime_error_handler(__func__, &ntv, ntp_adj_ret, errno, 0, 0, __LINE__ - 1);
	}
#endif /* SIGSYS */

	/*
	 * Save the result status and light up an external clock
	 * if available.
	 */
	pll_status = ntv.status;
	if (pll_control) {
		if (!atexit_done) {
			atexit_done = TRUE;
			atexit(&stop_kern_loop);
		}
#ifdef STA_NANO
		if (pll_status & STA_CLK)
			ext_enable = TRUE;
#endif /* STA_NANO */
		report_event(EVNT_KERN, NULL,
	  	    "kernel time sync enabled");
	}
}
开发者ID:coyizumi,项目名称:cs111,代码行数:60,代码来源:ntp_loopfilter.c


示例6: cleaner

BOOST_LOG_EXPORT void basic_event_log_backend< CharT >::consume(record_type const& record)
{
    if (!m_pImpl->m_EventComposer.empty())
    {
        log::aux::cleanup_guard< insertion_list > cleaner(m_pImpl->m_Insertions);

        // Get event ID and construct insertions
        DWORD id = m_pImpl->m_EventComposer(record, m_pImpl->m_Insertions);
        WORD string_count = static_cast< WORD >(m_pImpl->m_Insertions.size());
        scoped_array< const char_type* > strings(new const char_type*[string_count]);
        for (WORD i = 0; i < string_count; ++i)
            strings[i] = m_pImpl->m_Insertions[i].c_str();

        // Get event type
        WORD event_type = EVENTLOG_INFORMATION_TYPE;
        if (!m_pImpl->m_LevelMapper.empty())
            event_type = static_cast< WORD >(m_pImpl->m_LevelMapper(record));

        WORD event_category = 0;
        if (!m_pImpl->m_CategoryMapper.empty())
            event_category = static_cast< WORD >(m_pImpl->m_CategoryMapper(record));

        report_event(
            m_pImpl->m_SourceHandle,       // Event log handle.
            event_type,                    // Event type.
            event_category,                // Event category.
            id,                            // Event identifier.
            NULL,                          // No user security identifier.
            string_count,                  // Number of substitution strings.
            0,                             // No data.
            strings.get(),                 // Pointer to strings.
            NULL);                         // No data.
    }
}
开发者ID:nairboon,项目名称:anarchnet,代码行数:34,代码来源:event_log_backend.cpp


示例7: switch

BOOST_LOG_EXPORT void basic_simple_event_log_backend< CharT >::consume(
    record_type const& record, target_string_type const& formatted_message)
{
    const char_type* message = formatted_message.c_str();
    event_log::event_type evt_type = event_log::info;
    if (!m_pImpl->m_LevelMapper.empty())
        evt_type = m_pImpl->m_LevelMapper(record);

    DWORD event_id;
    switch (evt_type)
    {
    case event_log::success:
        event_id = BOOST_LOG_MSG_DEBUG; break;
    case event_log::warning:
        event_id = BOOST_LOG_MSG_WARNING; break;
    case event_log::error:
        event_id = BOOST_LOG_MSG_ERROR; break;
    default:
        event_id = BOOST_LOG_MSG_INFO; break;
    }

    report_event(
        m_pImpl->m_SourceHandle,        // Event log handle.
        static_cast< WORD >(evt_type),  // Event type.
        0,                              // Event category.
        event_id,                       // Event identifier.
        NULL,                           // No user security identifier.
        1,                              // Number of substitution strings.
        0,                              // No data.
        &message,                       // Pointer to strings.
        NULL);                          // No data.
}
开发者ID:nairboon,项目名称:anarchnet,代码行数:32,代码来源:event_log_backend.cpp


示例8: report_call_event

void
report_call_event (int evt, eXosip_call_t * jc,
                   eXosip_dialog_t * jd, osip_transaction_t * tr)
{
  eXosip_event_t *je;

  je = eXosip_event_init_for_call (evt, jc, jd, tr);
  report_event (je, NULL);
}
开发者ID:tws67,项目名称:bayonne-base-windows,代码行数:9,代码来源:jevents.c


示例9: sync_status

static void
sync_status(const char *what, int ostatus, int nstatus)
{
	char obuf[256], nbuf[256], tbuf[1024];
	snprintf(obuf, sizeof(obuf), "%04x", ostatus);
	snprintf(nbuf, sizeof(nbuf), "%04x", nstatus);
	snprintf(tbuf, sizeof(tbuf), "%s status: %s -> %s", what, obuf, nbuf);
	report_event(EVNT_KERN, NULL, tbuf);
}
开发者ID:ntpsec,项目名称:ntpsec,代码行数:9,代码来源:ntp_loopfilter.c


示例10: update_and_check_report_als

static inline void update_and_check_report_als(int32_t lux)
{
	int32_t lux_last;
	lux_last = pStkAlsData->als_lux_last;

	if (unlikely(abs(lux - lux_last) >= CONFIG_STK_ALS_CHANGE_THRESHOLD)) {
		pStkAlsData->als_lux_last = lux;
		report_event(pStkAlsData->input_dev, lux);
	}
}
开发者ID:gcsuri,项目名称:linux-wetek-3.14.y,代码行数:10,代码来源:stk220x_poll.c


示例11: enqueue_fn

void enqueue_fn(const uint8_t code)
{
	if (g_fn_buffer_length < FN_BUFFER_SIZE)
	{
		g_fn_buffer[g_fn_buffer_length] = code;
		g_fn_buffer_length++;
	} else {
		report_event(EVENT_CODE_KEYMAP_FN_BUF_FULL, 0, MODE_UPDATE);
		g_fn_buffer[FN_BUFFER_SIZE] = 0;
	}
}
开发者ID:m5kR10bHxS,项目名称:EasyAVR,代码行数:11,代码来源:keymap.c


示例12: initial_actuate

void initial_actuate(const uint8_t row, const uint8_t col)
{
#ifndef SIMPLE_DEVICE
	const uint8_t code = pgm_read_byte(&LAYERS[0][row][col]);
	
	if ((code == HID_KEYBOARD_SC_ENTER) ||
	    (code == HID_KEYBOARD_SC_KEYPAD_ENTER))
	{
		report_event(EVENT_CODE_NVM_ERASE_SETTINGS, 0, MODE_REOCCUR);
		nvm_init_eeprom();
	}
#endif /* SIMPLE_DEVICE */
}
开发者ID:m5kR10bHxS,项目名称:EasyAVR,代码行数:13,代码来源:keymap.c


示例13: lux_store

static ssize_t lux_store(struct kobject *kobj,
		struct kobj_attribute *attr,
		const char *buf, size_t len)
{
	unsigned long value = 0;

	if (kstrtoul(buf, 10, &value))
		return -EINVAL;

	STK_LOCK(1);
	report_event(pStkAlsData->input_dev, value);
	STK_LOCK(0);
	return len;
}
开发者ID:gcsuri,项目名称:linux-wetek-3.14.y,代码行数:14,代码来源:stk220x_poll.c


示例14: sync_status

static void
sync_status(const char *what, int ostatus, int nstatus)
{
	char obuf[256], nbuf[256], tbuf[1024];
#if defined(USE_SNPRINTB) && defined (STA_FMT)
	snprintb(obuf, sizeof(obuf), STA_FMT, ostatus);
	snprintb(nbuf, sizeof(nbuf), STA_FMT, nstatus);
#else
	snprintf(obuf, sizeof(obuf), "%04x", ostatus);
	snprintf(nbuf, sizeof(nbuf), "%04x", nstatus);
#endif
	snprintf(tbuf, sizeof(tbuf), "%s status: %s -> %s", what, obuf, nbuf);
	report_event(EVNT_KERN, NULL, tbuf);
}
开发者ID:coyizumi,项目名称:cs111,代码行数:14,代码来源:ntp_loopfilter.c


示例15: rstclock

/*
 * Clock state machine. Enter new state and set state variables.
 */
static void
rstclock(
	int	trans,		/* new state */
	double	offset		/* new offset */
	)
{
	DPRINTF(2, ("rstclock: mu %lu state %d poll %d count %d\n",
		    current_time - clock_epoch, trans, sys_poll,
		    tc_counter));
	if (trans != state && trans != EVNT_FSET)
		report_event(trans, NULL, NULL);
	state = trans;
	last_offset = clock_offset = offset;
	clock_epoch = current_time;
}
开发者ID:ajinkya93,项目名称:netbsd-src,代码行数:18,代码来源:ntp_loopfilter.c


示例16: refclock_receive

/*
 * refclock_receive - simulate the receive and packet procedures
 *
 * This routine simulates the NTP receive and packet procedures for a
 * reference clock. This provides a mechanism in which the ordinary NTP
 * filter, selection and combining algorithms can be used to suppress
 * misbehaving radios and to mitigate between them when more than one is
 * available for backup.
 */
void
refclock_receive(
	struct peer *peer	/* peer structure pointer */
	)
{
	struct refclockproc *pp;

#ifdef DEBUG
	if (debug)
		printf("refclock_receive: at %lu %s\n",
		    current_time, stoa(&peer->srcadr));
#endif

	/*
	 * Do a little sanity dance and update the peer structure. Groom
	 * the median filter samples and give the data to the clock
	 * filter.
	 */
	pp = peer->procptr;
	peer->leap = pp->leap;
	if (peer->leap == LEAP_NOTINSYNC)
		return;

	peer->received++;
	peer->timereceived = current_time;
	if (!peer->reach) {
		report_event(PEVNT_REACH, peer, NULL);
		peer->timereachable = current_time;
	}
	peer->reach |= 1;
	peer->reftime = pp->lastref;
	peer->aorg = pp->lastrec;
	peer->rootdisp = pp->disp;
	get_systime(&peer->dst);
	if (!refclock_sample(pp))
		return;

	clock_filter(peer, pp->offset, 0., pp->jitter);
	if (cal_enable && fabs(last_offset) < sys_mindisp && sys_peer !=
	    NULL) {
		if (sys_peer->refclktype == REFCLK_ATOM_PPS &&
		    peer->refclktype != REFCLK_ATOM_PPS)
			pp->fudgetime1 -= pp->offset * FUDGEFAC;
	}
}
开发者ID:pexip,项目名称:os-ntp,代码行数:54,代码来源:ntp_refclock.c


示例17: rstclock

/*
 * Clock state machine. Enter new state and set state variables.
 */
static void
rstclock(
	int	trans,		/* new state */
	double	offset		/* new offset */
	)
{
#ifdef DEBUG
	if (debug > 1)
		printf("local_clock: mu %lu state %d poll %d count %d\n",
		    current_time - clock_epoch, trans, sys_poll,
		    tc_counter);
#endif
	if (trans != state && trans != EVNT_FSET)
		report_event(trans, NULL, NULL);
	state = trans;
	last_offset = clock_offset = offset;
	clock_epoch = current_time;
}
开发者ID:coyizumi,项目名称:cs111,代码行数:21,代码来源:ntp_loopfilter.c


示例18: refclock_report

/*
 * refclock_report - note the occurance of an event
 *
 * This routine presently just remembers the report and logs it, but
 * does nothing heroic for the trap handler. It tries to be a good
 * citizen and bothers the system log only if things change.
 */
void
refclock_report(
	struct peer *peer,
	int code
	)
{
	struct refclockproc *pp;

	pp = peer->procptr;
	if (pp == NULL)
		return;

	switch (code) {

	case CEVNT_TIMEOUT:
		pp->noreply++;
		break;

	case CEVNT_BADREPLY:
		pp->badformat++;
		break;

	case CEVNT_FAULT:
		break;

	case CEVNT_BADDATE:
	case CEVNT_BADTIME:
		pp->baddata++;
		break;

	default:
		/* ignore others */
		break;
	}
	if (pp->lastevent < 15)
		pp->lastevent++;
	if (pp->currentstatus != code) {
		pp->currentstatus = (u_char)code;
		report_event(PEVNT_CLOCK, peer, ceventstr(code));
	}
}
开发者ID:pexip,项目名称:os-ntp,代码行数:48,代码来源:ntp_refclock.c


示例19: delete_fn

void delete_fn(const uint8_t code)
{
	int8_t i;
	
	for (i=0; i<g_fn_buffer_length; i++)
	{
		if (g_fn_buffer[i] == code)
		{
			break;
		}
	}
	if (i >= g_fn_buffer_length)
	{
		report_event(EVENT_CODE_KEYMAP_FN_NOT_FOUND, code, MODE_UPDATE);
		return;
	}
	for (; i<g_fn_buffer_length; i++)
	{
		g_fn_buffer[i] = g_fn_buffer[i+1];
	}
	g_fn_buffer_length--;
}
开发者ID:m5kR10bHxS,项目名称:EasyAVR,代码行数:22,代码来源:keymap.c


示例20: xsyslog

static void xsyslog(BIO *bp, int priority, const char *string)
{
	LPCSTR lpszStrings[2];
	WORD evtype= EVENTLOG_ERROR_TYPE;
	int pid = _getpid();
	char pidbuf[DECIMAL_SIZE(pid)+4];

	switch (priority)
		{
	case LOG_EMERG:
	case LOG_ALERT:
	case LOG_CRIT:
	case LOG_ERR:
		evtype = EVENTLOG_ERROR_TYPE;
		break;
	case LOG_WARNING:
		evtype = EVENTLOG_WARNING_TYPE;
		break;
	case LOG_NOTICE:
	case LOG_INFO:
	case LOG_DEBUG:
		evtype = EVENTLOG_INFORMATION_TYPE;
		break;
	default:		/* Should never happen, but set it
				   as error anyway. */
		evtype = EVENTLOG_ERROR_TYPE;
		break;
		}

	sprintf(pidbuf, "[%d] ", pid);
	lpszStrings[0] = pidbuf;
	lpszStrings[1] = string;

	if(report_event && bp->ptr)
		report_event(bp->ptr, evtype, 0, 1024, NULL, 2, 0,
				lpszStrings, NULL);
}
开发者ID:RafaelRMachado,项目名称:MinnowBoard,代码行数:37,代码来源:bss_log.c



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

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