当前位置: 首页>>代码示例>>C++>>正文


C++ report_event函数代码示例

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


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


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